@ckeditor/ckeditor5-ai 47.6.1-alpha.0 → 47.6.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.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 _0x4d60c6,Command as Lt,ContextPlugin as _0x2536b2,Editor as dt}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0xb9ce18,IconCheck as _0x4bc037,IconError as _0x37c207,IconSubmit as _0x5b571b,IconAIHistory as Nt,IconMagicWand as _0xebc77a,IconRobotPencil as _0x2347bb,IconMaximize as _0x11186c,IconMinimize as _0x1423b1,IconShowChangesOn as _0x437493,IconShowChangesOff as _0x4568be,IconDocument as _0x29872c,IconBoxWithCross as _0x31cb58,IconBoxWithCheck as _0x1ee526,IconBoxWithMarker as _0x13fc41,IconInfo as tc,IconLoupe as _0x3b3312,IconCancel as _0x42f179,IconStop as _0x4641d7,IconAIChat as vt,IconPlus as _0x5251eb,IconPin as _0xc5e5e8,IconThreeHorizontalDots as _0x5aa290,IconChevronDown as _0x3b0b4d,IconChevronUp as _0x22916d,IconOutdated as _0x1fabb6,IconEye as _0x124680,IconEyeCrossedOut as _0x11edaf,IconChevronRight as _0x38d106,IconAIReview as _0x359b2f,IconAITranslate as _0x4469ec}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x4689d1,CKEditorError as _0x70c77e,ObservableMixin as ts,global as _0x468ca9,isVisible as _0x1081a2,Rect as _0x7d114a,Collection as _0x305a6b,FocusTracker as _0x3295cb,KeystrokeHandler as _0x4259de,first as _0x147222,toArray as _0x1c6a41,EmitterMixin as _0x5d9d11,logWarning as _0x580cf6,logError as gt,scrollViewportToShowTarget as _0x29d957,scrollAncestorsToShowTarget as _0x3facc1,ResizeObserver as _0x2ee52,_isMotionReduced as Rt,getConstrainedViewportRect as _0x5676c9,DomEmitterMixin as _0x2ba8ea}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x243ac0,ButtonView as _0x42f5cd,View as _0x10e3da,SpinnerView as _0x4d3539,IconView as _0x5d3550,AutocompleteView as _0x183750,ListView as _0x49312a,ListItemGroupView as _0x4c31b6,ListItemView as _0x5f33aa,ButtonLabelView as _0x3d9772,FocusCycler as _0xb86ebf,createLabeledTextarea as _0x42eb25,Dialog as _0x2e97ba,createDropdown as _0x46177f,addMenuToDropdown as _0x7ace04,MenuBarMenuView as _0x42db8e,MenuBarMenuListItemButtonView as _0xa34e7b,DialogViewPosition as _0x22e1d9,MenuBarMenuListView as _0x43c130,MenuBarMenuListItemView as _0x47412e,BodyCollection as _0x5669fa,BalloonPanelView as _0x54c977,clickOutsideHandler as _0x4fafed,addListToDropdown as _0x3c2b1d,UIModel as _0x4f6c60,submitHandler as _0x2355c2,LabeledFieldView as _0x558a3e,createLabeledInputText as _0x11afad,FormHeaderView as _0x3571c0,HighlightedTextView as _0x1324a5,ViewCollection as _0x229fa2,FileDialogButtonView as _0x322600,InputTextView as _0x4221dd,SearchTextView as _0x362dba,ListItemButtonView as _0xee7128,ButtonLabelWithHighlightView as _0x4afaa0,DropdownMenuPanelPositioningFunctions as _0x3c3478,BalloonToolbar as te,FormRowView as _0x4c5ad6,TextareaView as _0x13279b}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x455f92,ClipboardMarkersUtils as _0x3d39c4}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0xd892e0,ViewDataTransfer as _0x18536d,ViewUpcastWriter as _0x2edca5,Matcher as _0x10ad46,_DetachOperation as et,_insertIntoModelNodeList as _0x2c3f7b,_removeFromModelNodeList as to,ModelRange as it,transformOperationSets as nt,ViewDowncastWriter as Dt,ModelDocumentFragment as tt,ModelPosition as st,ModelTreeWalker as _0x4a224a,MarkerOperation as _0x314055,InsertOperation as _0x58675e}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x4160eb,escape as _0x32cd9f,escapeRegExp as _0x2d9edc,debounce as _0x1b9d98}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x40fb22,InvokeModelWithResponseStreamCommand as _0x3758f2,InvokeModelCommand as _0x471001}from'@aws-sdk/client-bedrock-runtime';import{createParser as $t}from'eventsource-parser';import{parseDocument as _0x431dbf}from'htmlparser2';import{isTag as _0x3810c4,findOne as yt,getParent as _0x5e3605,findAll as _0x343779,removeElement as _0x49d15d,replaceElement as _0x591a05,prepend as _0x5cae71,prependChild as _0x404e7d,appendChild as _0x5193e3,append as _0x244df5,find as _0x40d2a6,isComment as _0x4f0c06,getChildren as _0x249feb,textContent as _0x49ccfa}from'domutils';import _0x21dae7 from'dom-serializer';import{Document as Et,Element as _0x29a7aa,Text as _0x5a5d84,cloneNode as _0x11b822,isDocument as _0x52a1d6,isText as _0x111077,NodeWithChildren as _0x1736d2}from'domhandler';import{MarkdownGfmMdToHtml as _0x274852}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x540d79,DocumentCompare as _0x587691,DATA_ID_MODEL_ATTRIBUTE as Ct,ConfirmMixin as _0x4a6ce8,LateFocusDropdownButtonView as _0x4cf5ee,getAllMarkersDomElementsSorted as _0x4ca3b4,SuggestionsConversion as zt,DATA_ID_VIEW_ATTRIBUTE as _0xaec028,getMarkerDomElement as _0x2c5ad7}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x4c6283}from'es-toolkit';import _0x5e40b6 from'morphdom';import{IconWeb as _0x35cba2,IconClose as _0x1e97a7,IconDocument as _0x502d01,IconSelection as _0xff1518,IconFileUpload as _0x3d17c6,IconLink as _0x31c7e3,IconBulb as _0x508bba,IconAI as _0x2dc11,IconPreviousArrow as _0x2a9d1b,IconCheck as _0x4ddc06,IconDocumentOutline as _0x13d87b,IconPaperClip as _0x1a2027,IconBrowseFiles as _0x1d6eec,IconDropdownArrow as _0x24c88e,IconAIChat as _0x29a1be,IconAIReview as _0x1cb916,IconAITranslate as Vt,IconAIAskAI as _0x5cbeee,IconThumbUp as _0x49f028,IconThumbDown as _0x1adf0b,IconCopy as _0x3ccaab,IconShowChangesOff as _0x2046d4,IconShowChangesOn as _0x37f7c4,IconAIQuickActions as _0x376ad5,IconAIChatCommands as Gt,IconAIImproveWriting as Bt,IconAIContinueWriting as Ft,IconAIGrammarCheck as Wt,IconAIAdjustLength as Kt,IconAIChangeTone as Yt,IconAIOther as Jt,IconRefresh as _0x7940fe,IconNextArrow as _0x453dbb}from'@ckeditor/ckeditor5-icons/dist/index.js';import{diffArrays as _0x27d3f3}from'diff';const x='_ungrouppedCommands';function o(_0x520629,_0x13524e){const _0x58bca3=(0x0,_0x13524e['t'])('Other');return _0x520629['length']?'groupId'in _0x520629[0x0]?_0x520629:[{'groupId':x,'groupLabel':_0x58bca3,'order':0x1/0x0,'commands':_0x520629}]:[{'groupId':x,'groupLabel':_0x58bca3,'order':0x1/0x0,'commands':[]}];}const Kn=globalThis['DataTransfer'],f='ai-ui';class a extends _0x4d60c6{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x4eb5f7}=this,_0x1dde28=['ck-fake-ai-selection'];_0x4eb5f7['config']['get']('ai.assistant.useTheme')&&_0x1dde28['push']('ck-ai-assistant-ui_theme'),_0x4eb5f7['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x1dde28,'priority':0xc}}),_0x4eb5f7['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x397f7e,{writer:_0x3bc96e})=>{if(!_0x397f7e['markerRange']['isCollapsed'])return null;const _0x390cb1=_0x3bc96e['createUIElement']('span');return _0x3bc96e['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x390cb1),_0x390cb1;}});}['afterInit'](){!async function(_0x2778d3){const _0x283115=_0x2b8172([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]),_0x20c7c2=0x3dffc4e1,_0x5aabf4=0x3df84711^_0x20c7c2,_0x5f1902=window[_0x2b8172([0x44,0x61,0x74,0x65])][_0x2b8172([0x6e,0x6f,0x77])](),_0x325e05=_0x2778d3[_0x2b8172([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x270fc7=new window[(_0x2b8172([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1f7f1a=>{_0x325e05[_0x2b8172([0x6f,0x6e,0x63,0x65])](_0x2b8172([0x72,0x65,0x61,0x64,0x79]),_0x1f7f1a);}),_0x4d5a0c={[_0x2b8172([0x6b,0x74,0x79])]:_0x2b8172([0x45,0x43]),[_0x2b8172([0x75,0x73,0x65])]:_0x2b8172([0x73,0x69,0x67]),[_0x2b8172([0x63,0x72,0x76])]:_0x2b8172([0x50,0x2d,0x32,0x35,0x36]),[_0x2b8172([0x78])]:_0x2b8172([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]),[_0x2b8172([0x79])]:_0x2b8172([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]),[_0x2b8172([0x61,0x6c,0x67])]:_0x2b8172([0x45,0x53,0x32,0x35,0x36])},_0x3c0244=_0x325e05[_0x2b8172([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x2b8172([0x67,0x65,0x74])](_0x2b8172([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x1f0104(){let _0x3082c5,_0x514860=null,_0x2118f6=null;try{if(_0x3c0244==_0x2b8172([0x47,0x50,0x4c]))return _0x2b8172([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x3082c5=_0x42460f(),!_0x3082c5)return _0x2b8172([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x3082c5[_0x2b8172([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x2118f6=_0x213ce2(_0x3082c5[_0x2b8172([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x3082c5[_0x2b8172([0x6a,0x74,0x69])])),await _0xa2ed13()?_0x10bc7f()?_0x599224()?_0x2b8172([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0xb27a66()?(_0x3082c5[_0x2b8172([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2b8172([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x514860=_0x4d3e2a(_0x2b8172([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x479812()):_0x2b8172([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x2b8172([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x2b8172([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x2b8172([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x599224(){const _0x4cb7ef=[_0x2b8172([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x2b8172([0x74,0x72,0x69,0x61,0x6c])][_0x2b8172([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3082c5[_0x2b8172([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x5f1902/0x3e8:0xe10*_0x5aabf4;return _0x3082c5[_0x2b8172([0x65,0x78,0x70])]<_0x4cb7ef;}function _0x10bc7f(){const _0x24cfe8=_0x3082c5[_0x2b8172([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x24cfe8&&(!!_0x24cfe8[_0x2b8172([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2b8172([0x2a]))||!!_0x24cfe8[_0x2b8172([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2b8172([0x41,0x49])));}function _0xb27a66(){const _0x3a662c=_0x3082c5[_0x2b8172([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x3a662c||0x0==_0x3a662c[_0x2b8172([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x54522a}=new URL(window[_0x2b8172([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x3a662c[_0x2b8172([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x54522a))return!0x0;const _0x4e3054=_0x54522a[_0x2b8172([0x73,0x70,0x6c,0x69,0x74])](_0x2b8172([0x2e]));return _0x3a662c[_0x2b8172([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x51ee79=>_0x51ee79[_0x2b8172([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2b8172([0x2a])))[_0x2b8172([0x6d,0x61,0x70])](_0x4422eb=>_0x4422eb[_0x2b8172([0x73,0x70,0x6c,0x69,0x74])](_0x2b8172([0x2e])))[_0x2b8172([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x49bd38=>_0x49bd38[_0x2b8172([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x4e3054[_0x2b8172([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x2b8172([0x6d,0x61,0x70])](_0x56a7a9=>Array(_0x4e3054[_0x2b8172([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x56a7a9[_0x2b8172([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x2b8172([0x66,0x69,0x6c,0x6c])](_0x56a7a9[0x0]===_0x2b8172([0x2a])?_0x2b8172([0x2a]):'')[_0x2b8172([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x56a7a9))[_0x2b8172([0x73,0x6f,0x6d,0x65])](_0x3a1665=>_0x4e3054[_0x2b8172([0x65,0x76,0x65,0x72,0x79])]((_0x5e49e0,_0x4bdbef)=>_0x3a1665[_0x4bdbef]===_0x5e49e0||_0x3a1665[_0x4bdbef]===_0x2b8172([0x2a])));}function _0x479812(){return _0x514860&&_0x2118f6?new window[(_0x2b8172([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x23262e,_0x44f0c7)=>{_0x514860[_0x2b8172([0x74,0x68,0x65,0x6e])](_0x23262e,_0x44f0c7),_0x2118f6[_0x2b8172([0x74,0x68,0x65,0x6e])](_0x5512b3=>{_0x5512b3!=_0x2b8172([0x56,0x61,0x6c,0x69,0x64])&&_0x23262e(_0x5512b3);},_0x44f0c7);}):_0x514860||_0x2118f6||_0x2b8172([0x56,0x61,0x6c,0x69,0x64]);}}function _0x213ce2(_0x46deb1,_0x2b9ac9){return new window[(_0x2b8172([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5be093=>{if(_0x60a10a())return _0x5be093(_0x2b8172([0x56,0x61,0x6c,0x69,0x64]));_0xb34ebb(),_0x325e05[_0x2b8172([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x2b8172([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0xb4bcff=!0x1;const _0x584ee7=_0x4689d1();function _0x182afe(_0x4a61ec){return!!_0x4a61ec&&(typeof _0x4a61ec===_0x2b8172([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x4a61ec===_0x2b8172([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x4a61ec[_0x2b8172([0x74,0x68,0x65,0x6e])]===_0x2b8172([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x4a61ec[_0x2b8172([0x63,0x61,0x74,0x63,0x68])]===_0x2b8172([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x163bd6(_0x11fb76){_0xfa0a8b(_0x11fb76)[_0x2b8172([0x74,0x68,0x65,0x6e])](_0x5eacf7=>{if(!_0x5eacf7||_0x5eacf7[_0x2b8172([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x2b8172([0x6f,0x6b]))return _0x2b8172([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0xd484fb(_0x234765(_0x584ee7+_0x2b9ac9))!=_0x5eacf7[_0x2b8172([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x2b8172([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x2b8172([0x56,0x61,0x6c,0x69,0x64]);})[_0x2b8172([0x74,0x68,0x65,0x6e])](_0x31be51=>(_0x28983c(),_0x31be51),()=>{const _0x3ae159=_0x266269();return null==_0x3ae159?(_0x28983c(),_0x2b8172([0x56,0x61,0x6c,0x69,0x64])):_0x2b8172(_0x5f1902-_0x3ae159>(0x19f340e1^_0x20c7c2)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x2b8172([0x74,0x68,0x65,0x6e])](_0x5be093)[_0x2b8172([0x63,0x61,0x74,0x63,0x68])](()=>{_0x5be093(_0x2b8172([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x2bc56f=0x3dc92a61^_0x20c7c2;function _0x28983c(){const _0x2ad29c=_0x2b8172([0x6c,0x6c,0x63,0x74,0x2d])+_0xd484fb(_0x234765(_0x46deb1)),_0x1e9087=_0x31c593(_0xd484fb(window[_0x2b8172([0x4d,0x61,0x74,0x68])][_0x2b8172([0x63,0x65,0x69,0x6c])](_0x5f1902/_0x2bc56f)));window[_0x2b8172([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2b8172([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x2ad29c,_0x1e9087);}function _0x266269(){const _0x21a096=_0x2b8172([0x6c,0x6c,0x63,0x74,0x2d])+_0xd484fb(_0x234765(_0x46deb1)),_0x1227fe=window[_0x2b8172([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2b8172([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x21a096);return _0x1227fe?window[_0x2b8172([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x31c593(_0x1227fe),0x10)*_0x2bc56f:null;}function _0xfa0a8b(_0x143e7f){return new window[(_0x2b8172([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0xc9c40f,_0x57758c)=>{_0x143e7f[_0x2b8172([0x74,0x68,0x65,0x6e])](_0xc9c40f,_0x57758c),window[_0x2b8172([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x57758c,0x3dfe1021^_0x20c7c2);});}}_0x325e05[_0x2b8172([0x6f,0x6e])](_0x2b8172([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x6a3fba,_0x24d4e3)=>{if(_0x24d4e3[0x0]!=_0x46deb1)return _0x5be093(_0x2b8172([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x24d4e3[0x1]={..._0x24d4e3[0x1],[_0x2b8172([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x584ee7};},{[_0x2b8172([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2b8172([0x68,0x69,0x67,0x68])}),_0x325e05[_0x2b8172([0x6f,0x6e])](_0x2b8172([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x4211dd=>{_0x182afe(_0x4211dd[_0x2b8172([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0xb4bcff=!0x0,_0x163bd6(_0x4211dd[_0x2b8172([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x2b8172([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2b8172([0x6c,0x6f,0x77])}),_0x270fc7[_0x2b8172([0x74,0x68,0x65,0x6e])](()=>{_0xb4bcff||_0x5be093(_0x2b8172([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x60a10a(){return _0x325e05[_0x2b8172([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2b8172([0x76,0x69,0x65,0x77])][_0x2b8172([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x2b8172([0x61,0x75,0x74,0x6f]);}function _0xb34ebb(){_0x325e05[_0x2b8172([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2b8172([0x76,0x69,0x65,0x77])][_0x2b8172([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x2b8172([0x61,0x75,0x74,0x6f]);}}function _0x4d3e2a(_0x2aca3c){const _0x5d8a79=[new window[(_0x2b8172([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3b079b=>setTimeout(_0x3b079b,0x3df6fa2d^_0x20c7c2)),_0x270fc7[_0x2b8172([0x74,0x68,0x65,0x6e])](()=>new window[(_0x2b8172([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2f9e2e=>{let _0x372224=0x0;_0x325e05[_0x2b8172([0x6d,0x6f,0x64,0x65,0x6c])][_0x2b8172([0x6f,0x6e])](_0x2b8172([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x4ba27f,_0x4f1838)=>{_0x4f1838[0x0][_0x2b8172([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x372224++,_0x372224==(0x3dffc109^_0x20c7c2)&&(_0x2f9e2e(),_0x4ba27f[_0x2b8172([0x6f,0x66,0x66])]());});}))];return window[_0x2b8172([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x2b8172([0x72,0x61,0x63,0x65])](_0x5d8a79)[_0x2b8172([0x74,0x68,0x65,0x6e])](()=>_0x2aca3c);}async function _0x3709bc(){await _0x270fc7,_0x325e05[_0x2b8172([0x6d,0x6f,0x64,0x65,0x6c])][_0x2b8172([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x4a2026,_0x325e05[_0x2b8172([0x6d,0x6f,0x64,0x65,0x6c])][_0x2b8172([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x4a2026,_0x325e05[_0x2b8172([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x2b8172([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x430177(_0x5df93c){const _0x98cfd8=_0x43118e();_0x325e05[_0x98cfd8]=_0x2b8172([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x5df93c,_0x5df93c!=_0x2b8172([0x56,0x61,0x6c,0x69,0x64])&&_0x3709bc();}function _0x43118e(){const _0x5dae20=window[_0x2b8172([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x2b8172([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x2b8172([0x6e,0x6f,0x77])]())[_0x2b8172([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x2b8172([0x2e]),'');let _0x562df5=_0x2b8172([0x6e]);for(let _0x188435=0x0;_0x188435<_0x5dae20[_0x2b8172([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x188435+=0x2){let _0x5e87b6=window[_0x2b8172([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5dae20[_0x2b8172([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x188435,_0x188435+0x2));_0x5e87b6>=_0x283115[_0x2b8172([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x5e87b6-=_0x283115[_0x2b8172([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x562df5+=_0x283115[_0x5e87b6];}return _0x562df5;}function _0x42460f(){const _0x1d724b=_0x3c0244[_0x2b8172([0x73,0x70,0x6c,0x69,0x74])](_0x2b8172([0x2e]));if(0x3!=_0x1d724b[_0x2b8172([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x342a74(_0x1d724b[0x1]);function _0x342a74(_0x4343dd){const _0x6787d2=_0x5d4198(_0x4343dd);return _0x6787d2&&_0x562a82()?_0x6787d2:null;function _0x562a82(){const _0x29dcb5=_0x6787d2[_0x2b8172([0x6a,0x74,0x69])],_0x558eb6=window[_0x2b8172([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x29dcb5[_0x2b8172([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x29dcb5[_0x2b8172([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x2fc286={..._0x6787d2,[_0x2b8172([0x6a,0x74,0x69])]:_0x29dcb5[_0x2b8172([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x29dcb5[_0x2b8172([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x2fc286[_0x2b8172([0x76,0x63])],_0x234765(_0x2fc286)==_0x558eb6;}}}async function _0xa2ed13(){let _0x19d40f=!0x0;try{const _0x4c17cf=_0x3c0244[_0x2b8172([0x73,0x70,0x6c,0x69,0x74])](_0x2b8172([0x2e])),[_0x3a366d,_0x68daf5,_0xd7a8ce]=_0x4c17cf;return _0x9aea76(_0x3a366d),await _0x12cae7(_0x3a366d,_0x68daf5,_0xd7a8ce),_0x19d40f;}catch{return!0x1;}function _0x9aea76(_0x248c0a){const _0x6c3878=_0x5d4198(_0x248c0a);_0x6c3878&&_0x6c3878[_0x2b8172([0x61,0x6c,0x67])]==_0x2b8172([0x45,0x53,0x32,0x35,0x36])||(_0x19d40f=!0x1);}async function _0x12cae7(_0x49fbb8,_0x212c0a,_0xf49517){const _0x431c7d=window[_0x2b8172([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x2b8172([0x66,0x72,0x6f,0x6d])](_0x5039a7(_0xf49517),_0x3bc7c2=>_0x3bc7c2[_0x2b8172([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x4243a3=new window[(_0x2b8172([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x2b8172([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x49fbb8+_0x2b8172([0x2e])+_0x212c0a),_0x3548c4=window[_0x2b8172([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x2b8172([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x3548c4)return;const _0x2b61db=await _0x3548c4[_0x2b8172([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x2b8172([0x6a,0x77,0x6b]),_0x4d5a0c,{[_0x2b8172([0x6e,0x61,0x6d,0x65])]:_0x2b8172([0x45,0x43,0x44,0x53,0x41]),[_0x2b8172([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x2b8172([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x2b8172([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x3548c4[_0x2b8172([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x2b8172([0x6e,0x61,0x6d,0x65])]:_0x2b8172([0x45,0x43,0x44,0x53,0x41]),[_0x2b8172([0x68,0x61,0x73,0x68])]:{[_0x2b8172([0x6e,0x61,0x6d,0x65])]:_0x2b8172([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x2b61db,_0x431c7d,_0x4243a3)||(_0x19d40f=!0x1);}}function _0x5d4198(_0x22cd28){return _0x22cd28[_0x2b8172([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x2b8172([0x65,0x79]))?JSON[_0x2b8172([0x70,0x61,0x72,0x73,0x65])](_0x5039a7(_0x22cd28)):null;}function _0x5039a7(_0x3cbfe8){return window[_0x2b8172([0x61,0x74,0x6f,0x62])](_0x3cbfe8[_0x2b8172([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x2b8172([0x2b]))[_0x2b8172([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x2b8172([0x2f])));}function _0x234765(_0xe84a4c){let _0x53d61e=0x1505;function _0x27d207(_0x35347b){for(let _0x260267=0x0;_0x260267<_0x35347b[_0x2b8172([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x260267++){const _0x4457a3=_0x35347b[_0x2b8172([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x260267);_0x53d61e=(_0x53d61e<<0x5)+_0x53d61e+_0x4457a3,_0x53d61e&=_0x53d61e;}}function _0x145750(_0x2a524a){Array[_0x2b8172([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x2a524a)?_0x2a524a[_0x2b8172([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x145750):_0x2a524a&&typeof _0x2a524a==_0x2b8172([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x2b8172([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x2a524a)[_0x2b8172([0x73,0x6f,0x72,0x74])]()[_0x2b8172([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x1d9026,_0x12320d])=>{_0x27d207(_0x1d9026),_0x145750(_0x12320d);}):_0x27d207(window[_0x2b8172([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x2a524a));}return _0x145750(_0xe84a4c),_0x53d61e>>>0x0;}function _0xd484fb(_0x49ba6c){return _0x49ba6c[_0x2b8172([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x2b8172([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x2b8172([0x30]));}function _0x31c593(_0x5e3077){return _0x5e3077[_0x2b8172([0x73,0x70,0x6c,0x69,0x74])]('')[_0x2b8172([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x2b8172([0x6a,0x6f,0x69,0x6e])]('');}function _0x4a2026(){}function _0x2b8172(_0x38323a){return _0x38323a['map'](_0x272b21=>String['fromCharCode'](_0x272b21))['join']('');}_0x430177(await _0x1f0104());}(this);}['showFakeVisualSelection'](){const _0x4bec72=this['editor']['model'];_0x4bec72['change'](_0x4ec350=>{const _0x13b9db=_0x4bec72['document']['selection']['getRanges']();let _0x1f56ac=0x0;for(const _0x5d2443 of _0x13b9db){const _0x390049=f+':'+_0x1f56ac;if(_0x4bec72['markers']['has'](_0x390049))_0x4ec350['updateMarker'](_0x390049,{'range':_0x5d2443});else{if(_0x5d2443['start']['isAtEnd']){const _0x28c7f6=_0x5d2443['start']['getLastMatchingPosition'](({item:_0x73420})=>!_0x4bec72['schema']['isContent'](_0x73420),{'boundaries':_0x5d2443});_0x4ec350['addMarker'](_0x390049,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4ec350['createRange'](_0x28c7f6,_0x5d2443['end'])});}else _0x4ec350['addMarker'](_0x390049,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5d2443});}_0x1f56ac++;}});}['hideFakeVisualSelection'](){const _0x2b78cc=this['editor']['model'],_0x5cc1c2=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x5cc1c2['length']&&_0x2b78cc['change'](_0x5bb92a=>{_0x5cc1c2['forEach'](_0x42a4f0=>{_0x5bb92a['removeMarker'](_0x42a4f0);});});}['insertContent'](_0x4565ab,_0x4ec9e7){const _0xc6eeed=this['_getAISelection'](),_0x2a0628=_0x4ec9e7||_0xc6eeed['getFirstRange']();this['editor']['model']['canEditAt'](_0x2a0628)&&this['editor']['model']['change'](_0x18410d=>{this['hideFakeVisualSelection'](),_0x4ec9e7||this['_resetContentOfSelectedTableCells'](_0x18410d,_0xc6eeed),this['_pasteHTMLUsingClipboard']({'insertAt':_0x2a0628,'writer':_0x18410d,'html':_0x4565ab});});}['insertContentBelow'](_0x23bb09){const {model:_0x3b0739}=this['editor'],_0x47c8e2=this['_getAISelection']();_0x3b0739['change'](()=>{const _0x2594f9=this['_prepareTableInsertBelowPosition'](_0x23bb09,_0x47c8e2)||this['_getDefaultInsertBelowPosition'](_0x47c8e2);this['insertContent'](_0x23bb09,_0x2594f9);});}['_getAISelection'](){const _0x6cc0a7=this['editor']['model'],_0x55d0a1=Array['from'](_0x6cc0a7['markers']['getMarkersGroup'](f))['map'](_0x45c92d=>_0x45c92d['getRange']());return _0x6cc0a7['createSelection'](_0x55d0a1);}['_pasteHTMLUsingClipboard']({writer:_0x497b09,html:_0x468152,insertAt:_0x1b2b68}){const {view:_0x48128f}=this['editor']['editing'],_0x474c8b=this['editor']['plugins']['get'](_0x455f92),_0x5ae5cb=new Kn();_0x5ae5cb['setData']('text/html',_0x468152);const _0x199f8c=new ClipboardEvent('paste',{'clipboardData':_0x5ae5cb}),_0x436e43=new _0xd892e0(_0x48128f,_0x199f8c,{'dataTransfer':new _0x18536d(_0x5ae5cb)});_0x497b09['setSelection'](_0x1b2b68);const _0x34c362=(_0x54334d,_0x92ddb1)=>{_0x92ddb1['resultRange']&&_0x497b09['setSelection'](_0x92ddb1['resultRange']);};_0x474c8b['once']('contentInsertion',_0x34c362,{'priority':'lowest'}),_0x48128f['document']['fire']('paste',_0x436e43),_0x474c8b['off']('contentInsertion',_0x34c362);}['_getDefaultInsertBelowPosition'](_0x52d1b2){const {model:_0x6de864}=this['editor'],_0x320aa6=Array['from'](_0x52d1b2['getSelectedBlocks']());return _0x320aa6['length']?_0x6de864['createPositionAfter'](_0x320aa6['pop']()):_0x52d1b2['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x1099b8,_0x3a3ecc){const {model:_0x5c0ff9,plugins:_0x1ca1a9}=this['editor'];if(_0x1ca1a9['has']('TableUtils')){const _0x4a2022=_0x1ca1a9['get']('TableUtils')['getSelectedTableCells'](_0x3a3ecc);if(_0x4a2022['length']){const _0x52cb20=this['_getTableRowCountFromContent'](_0x1099b8),_0x5ce378=this['_createEmptyTableRows'](_0x4a2022,_0x52cb20);return _0x5c0ff9['createPositionAt'](_0x5ce378,0x0);}}return null;}['_getTableRowCountFromContent'](_0x1b9edd){const _0x30dce6=this['editor']['plugins']['get']('TableUtils'),_0x232704=this['editor']['data']['parse'](_0x1b9edd),_0x388b5c=Array['from'](_0x232704['getChildren']())['filter'](_0x2646e1=>_0x2646e1['is']('element','table'));let _0x5698d4=0x0;return _0x388b5c['forEach'](_0x44abbf=>{_0x5698d4+=_0x30dce6['getRows'](_0x44abbf);}),_0x5698d4;}['_createEmptyTableRows'](_0x15060a,_0xdd80e4){const _0x1dc6e7=this['editor']['plugins']['get']('TableUtils'),_0x1fa741=_0x1dc6e7['getRowIndexes'](_0x15060a),_0x2db54e=_0x1dc6e7['getColumnIndexes'](_0x15060a),_0x2f9d2d=_0x1fa741['last']+0x1,_0x49af82=_0x2db54e['first'],_0xa37009=_0x15060a[0x0]['findAncestor']('table');for(let _0x5a7353=0x0;_0x5a7353<_0xdd80e4;_0x5a7353++)_0x1dc6e7['insertRows'](_0xa37009,{'at':_0x2f9d2d});return _0xa37009['getChild'](_0x2f9d2d)['getChild'](_0x49af82);}['_resetContentOfSelectedTableCells'](_0xae6d3f,_0x515398){const {plugins:_0x383e08}=this['editor'],{model:_0x5f219c}=_0xae6d3f;if(!_0x383e08['has']('TableUtils'))return;_0x383e08['get']('TableUtils')['getSelectedTableCells'](_0x515398)['length']&&_0x5f219c['deleteContent'](_0x515398);}}class K extends _0x4d60c6{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x70c77e('aiadapter-text-adapter-not-set',null);}}class er extends Error{constructor(_0x2e6795){super(_0x2e6795),this['name']='AIRequestError';}}function Wn(_0x1e282d,_0x5c9dc5,_0xb1e771){const t=_0x1e282d['t'];switch(_0x5c9dc5){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',_0xb1e771);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0xb1e771);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'},_0xb1e771);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 _0x5c9dc5;}}class E extends Lt{['_commandDefinitions'];constructor(_0x5812e8,_0x1ee80b){super(_0x5812e8),this['_commandDefinitions']=_0x1ee80b,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x10c678,_0x35b13d,_0x501016)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x501016));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x20f1f4,_0x1bc849,_0x3c4468)=>{this['enabledCommandsIds']=_0x3c4468?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x1dba35=this['editor']['model'];this['_hasContext']=function(_0x1575eb){const _0x12d922=_0x1575eb['document']['selection'];return _0x12d922['isCollapsed']?0x0!==[..._0x12d922['getSelectedBlocks']()]['length']&&![..._0x12d922['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x1575eb['hasContent'](_0x12d922['getFirstRange']());}(_0x1dba35);const _0xc2d425=_0x1dba35['document']['selection'],_0x4ea3e5=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x5a2c17 of _0xc2d425['getRanges']())for(const _0x35285a of _0x5a2c17['getItems']())if(_0x35285a['is']('element')&&_0x4ea3e5['includes'](_0x35285a['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x284385='',_0x2e38ff='',_0x291089='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x284385,_0x2e38ff,_0x291089);}}function ns(_0x415539,_0x1f8634){const _0x1609c4=new Set();for(const _0x2750de of _0x415539['values']())(_0x1f8634||!0x1===_0x2750de['requiresContent'])&&_0x1609c4['add'](_0x2750de['id']);return Array['from'](_0x1609c4);}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(_0x6a48bc,_0x751f22,_0x26c258){super(),this['editor']=_0x6a48bc,this['textAdapter']=_0x751f22,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x26c258,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x3ed4cc,_0x41b0eb,_0x438417)=>{this['view']['value']=this['_sanitizeHTML'](_0x438417);}),this['listenTo'](this['view'],'submitPrompt',(_0x39f4e5,_0x59eeb6)=>{const _0x4d90da=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x59eeb6,_0x4d90da,'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:_0x36b845,query:_0x530f59,htmlContent:_0x51869d,label:_0x2452ec,mainActionLabel:_0x25325f}){this['view']['prompt']=_0x2452ec,this['view']['mainAction']=_0x25325f,this['initialContext']=_0x51869d,_0x530f59&&(this['view']['isRendered']?this['_handleQuery'](_0x530f59,_0x51869d,_0x36b845,_0x2452ec):this['view']['once']('render',()=>{this['_handleQuery'](_0x530f59,_0x51869d,_0x36b845,_0x2452ec);}));}['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'](_0x2d2a82,_0x47ed51,_0x33690c,_0x202255){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x47ed51,this['previousQuery']=_0x2d2a82,this['previousLabel']=_0x202255||_0x2d2a82,this['previousActionId']=_0x33690c,new Promise(_0x5d269f=>{this['textAdapter']['makeRequest']({'query':_0x2d2a82,'context':_0x47ed51,'onData':_0x581ae9=>{this['currentResponse']=_0x581ae9,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x33690c})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x4b8ed5=>{_0x4b8ed5 instanceof er?this['view']['handleError'](_0x4b8ed5['message']):this['view']['handleError'](),_0x5d269f();})['finally'](()=>{this['stopProcessing'](),_0x5d269f();});});}['_parseAndNormalizeContent'](_0x330803,_0x1b9d14=!0x1){const _0x46c1e9=hs['exec'](_0x330803);_0x330803=_0x46c1e9?_0x330803['substring'](_0x46c1e9[0x1]['length']):_0x330803['length']<0x64&&!_0x1b9d14?'':this['_stripMarkdownSyntax'](_0x330803);const _0x2974b7=this['_domParser']['parseFromString'](_0x330803,'text/html');if(_0x46c1e9){const _0x498761=Array['from'](_0x2974b7['body']['childNodes']);_0x498761['reverse']();for(const _0x10dd37 of _0x498761){if(_0x10dd37['nodeType']==Node['ELEMENT_NODE'])break;_0x10dd37['remove']();}}const _0x3c2747=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x2974b7['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x3c2747);const _0x5ec46c=this['editor']['config']['get']('ai.assistant.preserveComments'),_0xa5b13e=this['editor']['data']['toModel'](_0x3c2747);return _0x5ec46c||_0xa5b13e['markers']['clear'](),this['editor']['data']['stringify'](_0xa5b13e);}['_normalizeResponseHeadings'](_0x292994){const _0x176a8c=new _0x2edca5(this['editor']['editing']['view']['document']),_0x1cd077=new _0x10ad46({'name':/^h[1-5]$/}),_0x58a3bf=[];let _0x59e2f4=!0x1;for(const _0x42be94 of _0x292994)_0x42be94['is']('element')&&_0x1cd077['match'](_0x42be94)&&(_0x58a3bf['push'](_0x42be94),'h1'==_0x42be94['name']&&(_0x59e2f4=!0x0));if(_0x59e2f4){for(const _0x714221 of _0x58a3bf)_0x176a8c['rename']('h'+(parseInt(_0x714221['name'][0x1])+0x1),_0x714221);}}['_isH1TagSupportEnabled'](){const {data:_0x5d34a9,editing:_0x232e89}=this['editor'],_0x354f80=_0x5d34a9['htmlProcessor']['toView']('<h1></h1>'),_0x2429a3=_0x5d34a9['toView'](_0x5d34a9['toModel'](_0x354f80));return!!_0x232e89['view']['domConverter']['viewToDom'](_0x2429a3)['querySelector']('h1');}['_sanitizeHTML'](_0x304bc6){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x304bc6),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x296c89){const _0x666682=_0x296c89['trim']();return _0x666682['startsWith']('```html')?_0x666682['endsWith']('```')?_0x666682['substring'](0x7,_0x666682['length']-0x3):_0x666682['substring'](0x7):_0x296c89;}}const _={'REPLACE':'replace','INSERT':'insert'};class Pr extends _0x243ac0{constructor(_0x4c6928){super(_0x4c6928),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x4b9b1f=>Wn(_0x4c6928,'AI_'+_0x4b9b1f['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Wn(_0x4c6928,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Wn(_0x4c6928,'Try\x20again')),this['stopButton']=this['_createButton'](Wn(_0x4c6928,'Stop'));const _0x2118e9=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x2118e9['if']('isVisible','ck-hidden',_0x51f27f=>!_0x51f27f)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x1167d2,_0x24f7dc){const _0x1f308f=new _0x42f5cd(this['locale']);return _0x1f308f['set']({'label':_0x1167d2,'class':_0x24f7dc||'','isVisible':!0x0,'withText':!0x0}),_0x1f308f;}}class Ir extends _0x10e3da{['contentFieldView'];['copyButtonView'];constructor(_0x5c2fde,_0x495a19=''){super(_0x5c2fde),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x53e4a0=this['bindTemplate'];this['contentFieldView']=new Yn(_0x5c2fde,_0x495a19),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x53e4a0['if']('isVisible','ck-hidden',_0x1c80f5=>!_0x1c80f5)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x53e4a0['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 _0x1e126e=!0x1;this['on']('change:value',(_0x4fb0da,_0x46aee2,_0x273738)=>{const _0x3f839a=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x273738),this['isProcessing']&&_0x3f839a&&!_0x1e126e&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x2b99d6,_0x5ee70e,_0x5883c6)=>{_0x1e126e=!0x1,_0x5883c6?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x1e126e=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x1e126e=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x2e0168=this['locale'],_0xf7c72c=new _0x42f5cd(this['locale']),_0x34a168='ck-ai-form__copy-button';return _0xf7c72c['set']({'label':Wn(_0x2e0168,'Copy'),'icon':_0xb9ce18,'class':_0x34a168,'tooltip':!0x0}),_0xf7c72c['bind']('isVisible')['to'](this,'value',_0xbefdb3=>!!_0xbefdb3),_0xf7c72c['bind']('isEnabled')['to'](this,'isProcessing',_0x230a31=>!_0x230a31),_0xf7c72c['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0xf7c72c['icon']=_0x4bc037,_0xf7c72c['class']=_0x34a168+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0xf7c72c['icon']=_0xb9ce18,_0xf7c72c['class']=_0x34a168;},0x3e8);}),_0xf7c72c;}['_copyHTMLToClipboard'](_0x28243b){const {window:_0x2b3bb6,document:_0x447fe8}=_0x468ca9;if(_0x2b3bb6['ClipboardItem']){const {Blob:_0x3088c8,ClipboardItem:_0x2d80c9}=_0x2b3bb6,_0x14ad7c=[new _0x2d80c9({'text/html':new _0x3088c8([_0x28243b['innerHTML']],{'type':'text/html'}),'text/plain':new _0x3088c8([_0x28243b['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x14ad7c);}else{const _0x4b6f3a=_0x447fe8['createElement']('div');_0x4b6f3a['style']['position']='absolute',_0x4b6f3a['style']['left']='-9999px',_0x4b6f3a['innerHTML']='<span>[</span>'+_0x28243b['innerHTML']+'<span>]</span>',_0x447fe8['body']['appendChild'](_0x4b6f3a);const _0x35da98=_0x447fe8['createRange']();_0x35da98['setStartAfter'](_0x4b6f3a['firstElementChild']),_0x35da98['setEndBefore'](_0x4b6f3a['lastElementChild']);const _0x5ae6f3=_0x2b3bb6['getSelection']();_0x5ae6f3['removeAllRanges'](),_0x5ae6f3['addRange'](_0x35da98),_0x447fe8['execCommand']('copy'),_0x4b6f3a['remove']();}}}class Yn extends _0x10e3da{constructor(_0x1b7a18,_0xe7ba8c=''){super(_0x1b7a18),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0xe7ba8c,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x540eb4){this['element']['innerHTML']=_0x540eb4;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x552068=new _0x10e3da(),_0x509046=this['locale'],_0x21732b=new _0x4d3539();return _0x21732b['isVisible']=!0x0,_0x552068['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x21732b,{'text':Wn(_0x509046,'AI\x20is\x20writing...')}]}),_0x552068['render'](),_0x552068;}}class Vr extends _0x10e3da{constructor(_0x4c546b,_0x4ff985=''){super(_0x4c546b);const _0x39a99d=new _0x5d3550(),_0x276853=this['bindTemplate'];this['set']('text',_0x4ff985),_0x39a99d['content']=_0x37c207,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x39a99d,{'text':_0x276853['to']('text')}]});}}class Cr extends _0x183750{['submitButtonView'];['showHistoryButtonView'];constructor(_0x406f17,_0x3a67c8){super(_0x406f17,_0x3a67c8),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',(_0x177170,_0x3bc2ee)=>{_0x177170['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x3bc2ee());});}['_createSubmitButton'](){const _0xe607ae=new _0x42f5cd(this['locale']),_0x2b1105=this['locale'];return _0xe607ae['set']({'icon':_0x5b571b,'label':Wn(_0x2b1105,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0xe607ae['on']('execute',()=>{this['submit']();}),_0xe607ae['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x4c786b,_0x46b669)=>!_0x4c786b&&_0x46b669),_0xe607ae;}['_createShowHistoryButton'](){const _0x5ca817=new _0x42f5cd(this['locale']),_0x5e2745=this['resultsView'],_0x4d8091=this['locale'];_0x5ca817['set']({'label':Wn(_0x4d8091,'History'),'withText':!0x1,'icon':Nt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x5ca817['bind']('isOn')['to'](_0x5e2745,'isVisible'),_0x5ca817['bind']('isEnabled')['to'](this,'isEnabled'),_0x5ca817['on']('execute',()=>{_0x5e2745['isVisible']=!_0x5e2745['isVisible'],_0x5e2745['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x303db8=()=>{_0x468ca9['window']['requestAnimationFrame'](()=>{if(_0x1081a2(this['element'])){const _0x3a6f97=new _0x7d114a(this['queryView']['fieldView']['element']),_0x553c63=_0x3a6f97['width'],_0xde804c='rtl'===_0x4d8091['uiLanguageDirection']?'left':'right';_0x3a6f97['excludeScrollbarsAndBorders'](),_0x5ca817['element']['style'][_0xde804c]=_0x553c63-_0x3a6f97['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x303db8),this['on']('render',_0x303db8),_0x5ca817;}['submit'](){const _0x330a7e=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x330a7e);}['focus'](_0x3c077b){-0x1===_0x3c077b?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Hr extends _0x49312a{['historyGroupView'];['clearHistoryButton'];constructor(_0x3a4d6f){super(_0x3a4d6f),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x4c31b6(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Wn(_0x3a4d6f,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x4cfb68=0x0;for(const _0x1876f3 of this['items'])_0x4cfb68+=_0x1876f3['items']['length'];return{'resultsCount':_0x4cfb68,'totalItemsCount':_0x4cfb68};}['_createClearHistoryButton'](){const _0x3c74ee=this['locale'],_0xef6e9d=new _0x42f5cd(this['locale']);return _0xef6e9d['set']({'label':'('+Wn(_0x3c74ee,'Clear')+')','withText':!0x0}),_0xef6e9d['on']('execute',()=>this['fire']('clearHistory')),_0xef6e9d;}}class Rr extends _0x5f33aa{constructor(_0x4fbc79){super();const _0xb0b542=new _0x3d9772(),_0x5ea6bd=new _0x42f5cd(this['locale'],_0xb0b542);this['children']['add'](_0x5ea6bd),_0x5ea6bd['set']({'label':_0x4fbc79['prompt'],'withText':!0x0}),_0x5ea6bd['on']('execute',()=>{this['fire']('execute',{'value':_0x4160eb(_0x4fbc79['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class Br extends _0x305a6b{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x121dc5,_0x37cfd0)=>{const _0x2da541=go(_0x37cfd0['prompt']);for(const _0x4944a2 of this)if(_0x4944a2!=_0x37cfd0&&go(_0x4944a2['prompt'])===_0x2da541){this['remove'](_0x4944a2);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x462232=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0x462232));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0x5555c0=>_0x5555c0)));}}function go(_0x4fb02a){return _0x4fb02a['toLowerCase']()['trim']();}class k extends _0x10e3da{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x146e75,_0x4d1d1a,_0x18b260=''){super(_0x146e75),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(_0x146e75),this['contentArea']=new Ir(_0x146e75,_0x18b260),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 _0x3295cb(),this['keystrokes']=new _0x4259de(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0xb86ebf({'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 _0x349e66=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x4d1d1a],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x349e66['if']('isError','ck-hidden',_0xbedfa6=>!_0xbedfa6)]},'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'](_0x5d8bcc=0x1){-0x1===_0x5d8bcc?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 _0x320936=this['locale'],_0x40bdec=new Cr(_0x320936,{'queryView':{'label':Wn(_0x320936,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x42eb25,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Wn(_0x320936,'Empty\x20history'),'secondary':Wn(_0x320936,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x40bdec['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x220036,_0x541031)=>_0x220036&&!_0x541031),this['listenTo'](_0x40bdec,'submit',(_0xb8b00b,_0x4461bb)=>{this['prompt']=_0x4461bb;const _0x216b6e=_0x32cd9f(_0x4461bb);this['fire']('submitPrompt',_0x216b6e),_0x4461bb['trim']()&&this['_promptHistory']['add']({'prompt':_0x216b6e},0x0);},{'priority':'high'}),_0x40bdec;}['_createHistoryView'](){const _0x33e0ab=new Hr(this['locale']);return _0x33e0ab['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Rr),_0x33e0ab['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x33e0ab;}['_createToolbar'](){const _0x4cc1b5=new Pr(this['locale']);return _0x4cc1b5['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xb18357,_0x1fb129,_0xc63bfe)=>_0xb18357&&!_0x1fb129&&!!_0xc63bfe),_0x4cc1b5['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x4cc1b5['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x247373,_0x140349,_0x444e70)=>_0x247373&&!_0x140349&&!!_0x444e70),_0x4cc1b5['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x4cc1b5['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x593416,_0x48ef4f)=>_0x593416&&!_0x48ef4f),_0x4cc1b5['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x4cc1b5['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x4cc1b5['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x4cc1b5;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0xd6b189=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Wn(_0xd6b189,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x5e34ba){const _0x3dda30=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x5e34ba||Wn(_0x3dda30,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x4d60c6{['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[_0x3d39c4,a,K,_0x2e97ba];}constructor(_0x5324da){super(_0x5324da),_0x5324da['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x5324da['config']['define']('ai.assistant.contentAreaCssClass',''),_0x5324da['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x5324da['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x235509}=this;this['_aiAdapter']=_0x235509['plugins']['get'](K),this['_dialog']=_0x235509['plugins']['get'](_0x2e97ba),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x1d527e=new E(_0x235509,Array['from'](this['_commandDefinitions']['values']()));_0x235509['commands']['add']('showAIAssistant',_0x1d527e),_0x235509['ui']['componentFactory']['add']('aiCommands',_0x492a24=>{const _0x504882=_0x46177f(_0x492a24);return _0x504882['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x504882['buttonView']['set']({'label':Wn(_0x492a24,'AI\x20Commands'),'icon':_0xebc77a,'tooltip':!0x0}),_0x504882['on']('execute',_0x13e5b0=>this['_onExecute'](_0x13e5b0['source']['id'])),_0x7ace04(_0x504882,_0x235509['ui']['view']['body'],function(_0x118e05){const _0x2a6c99=o(_0x118e05['config']['get']('ai.assistant.commands'),_0x118e05['locale']),_0x97d842=B(_0x118e05,_0x2a6c99)['filter'](_0x49c7fe=>_0x49c7fe['commands']['length']);if(0x1===_0x97d842['length'])return B(_0x118e05,_0x97d842[0x0]['commands'])['map'](_0x1476d6=>({'id':_0x1476d6['id'],'label':_0x1476d6['label']}));return _0x97d842['map'](_0x380c57=>{const {groupId:_0x3fb89c,groupLabel:_0x50007d,commands:_0x44beed}=_0x380c57,_0x41fe1a=B(_0x118e05,_0x44beed)['map'](_0x1e918f=>({'id':_0x1e918f['id'],'label':_0x1e918f['label']}));return{'id':_0x3fb89c,'menu':_0x50007d||_0x3fb89c,'children':_0x41fe1a};});}(_0x235509),{'ariaLabel':Wn(_0x492a24,'AI\x20Commands')}),_0x504882['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x1d527e['on']('change:enabledCommandsIds',_0x5a72d3),_0x504882['menuView']['once']('render',_0x5a72d3),_0x504882;function _0x5a72d3(){_0x504882['isEnabled']=_0x1d527e['enabledCommandsIds']['length']>0x0;for(const _0x490520 of _0x504882['menuView']['buttons'])_0x490520['isEnabled']=_0x1d527e['enabledCommandsIds']['includes'](_0x490520['id']);}}),_0x235509['ui']['componentFactory']['add']('menuBar:aiCommands',_0x1cd0e0=>{const _0xf77aff=new _0x42db8e(_0x1cd0e0);_0xf77aff['buttonView']['set']({'label':Wn(_0x1cd0e0,'AI\x20Commands'),'icon':_0xebc77a}),_0xf77aff['bind']('isEnabled')['to'](_0x1d527e,'enabledCommandsIds',_0x2a5ecd=>_0x2a5ecd['length']>0x0);const _0x2a1769=o(_0x235509['config']['get']('ai.assistant.commands'),_0x1cd0e0);return this['_populateMenuBarMenu'](_0x1d527e,_0xf77aff,_0x2a1769,_0x39c948=>this['_onExecute'](_0x39c948)),_0xf77aff;}),_0x235509['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x4decdf=this['_createAIAssistantUIButton'](_0x42f5cd);return _0x4decdf['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x4decdf;}),_0x235509['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x45359e=this['_createAIAssistantUIButton'](_0xa34e7b);return _0x45359e['set']({'role':'menuitemcheckbox'}),_0x45359e;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x3a141f=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x5087a5;for(const _0x327023 in _0x3a141f){const _0x519486=_0x327023,_0x33ff16=_0x3a141f[_0x519486];if('aiLicenseKeyValid'==_0x33ff16||'aiLicenseKeyInvalid'==_0x33ff16||'aiLicenseKeyExpired'==_0x33ff16||'aiLicenseKeyDomainLimit'==_0x33ff16||'aiLicenseKeyNotAllowed'==_0x33ff16||'aiLicenseKeyEvaluationLimit'==_0x33ff16||'aiLicenseKeyUsageLimit'==_0x33ff16){delete _0x3a141f[_0x519486],_0x5087a5=_0x33ff16,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x5087a5&&_0x3a141f['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x5087a5&&_0x3a141f['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x5087a5&&_0x3a141f['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x5087a5&&_0x3a141f['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x5087a5&&_0x3a141f['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x5087a5&&_0x3a141f['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x358e20='',_0x15d1bb='',_0x3e54ac='custom'){const _0x3bd9ac=this['editor'],_0x2fd6d4=_0x3bd9ac['editing']['view'],_0x5d1ed1=_0x3bd9ac['plugins']['get'](a),_0x4f25e8=_0x3bd9ac['plugins']['get'](_0x3d39c4);_0x5d1ed1['showFakeVisualSelection']();const _0x28fe82=new w(),_0x2fc4e1=new ClipboardEvent('copy',{'clipboardData':_0x28fe82}),_0x1bf77f=new _0x18536d(_0x28fe82),_0x4688b8=new _0xd892e0(_0x2fd6d4,_0x2fc4e1,{'dataTransfer':_0x1bf77f});_0x4f25e8['_forceMarkersCopy']('comment',()=>{_0x2fd6d4['document']['fire']('copy',_0x4688b8);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x3bd9ac,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x3c47d8=_0x1bf77f['getData']('text/html');const _0x2d2191=_0x3bd9ac['model']['document']['selection'],_0x54fd65=Array['from'](_0x2d2191['getRanges']());0x1===_0x54fd65['length']&&_0x54fd65[0x0]['isFlat']&&!_0x2d2191['getSelectedElement']()&&''!==_0x3c47d8['replace'](/ /g,'')['trim']()&&(_0x3c47d8='<p>'+_0x3c47d8+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x3e54ac,'query':_0x358e20,'htmlContent':_0x3c47d8,'label':_0x15d1bb,'mainActionLabel':_[_0x3bd9ac['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x2347bb,'title':Wn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x22e1d9['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x5d1ed1['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x272a11=new Map(),_0x31537c=o(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x4170ce of _0x31537c)for(const _0xa764ad of _0x4170ce['commands'])_0x272a11['set'](_0xa764ad['id'],{..._0xa764ad,'groupId':_0x4170ce['groupId'],'groupLabel':_0x4170ce['groupLabel']||_0x4170ce['groupId']});return _0x272a11;}['_createAIAssistantUIButton'](_0x50a30d){const _0x39b297=this['editor'],_0x3cc847=_0x39b297['commands']['get']('showAIAssistant'),_0x1f9d67=new _0x50a30d(_0x39b297['locale']);return _0x1f9d67['set']({'label':Wn(_0x39b297['locale'],'AI\x20Assistant'),'icon':_0x2347bb,'isToggleable':!0x0}),_0x1f9d67['bind']('isEnabled')['to'](_0x3cc847),_0x1f9d67['bind']('isOn')['to'](this['_dialog'],'id',_0x2e310d=>'aiAssistant'===_0x2e310d),this['listenTo'](_0x1f9d67,'execute',()=>{_0x1f9d67['isOn']?this['hideUI']():_0x3cc847['execute']();}),_0x1f9d67;}['_initView'](){const _0x4033d3=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',()=>{_0x4033d3['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x4033d3['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x15db96,ui:{ariaLiveAnnouncer:_0x4ad582}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x2a45d7,_0xc0cf10,_0x15c71f)=>{const _0x4c3aad=this['_aiAssistantController']['currentContext'];_0x15c71f?_0x4ad582['announce'](Wn(_0x15db96,'AI\x20is\x20writing')):_0x4c3aad&&_0x4ad582['announce'](Wn(_0x15db96,'Generated\x20content:\x20%0',_0x4c3aad),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x14e97e,_0x19b995,_0x20e184)=>{if(_0x20e184){const _0x122f47=this['_formView']['errorView']['text'];_0x4ad582['announce'](Wn(_0x15db96,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x122f47));}});}['_onExecute'](_0x24e9ec){const _0x18181a=this['_commandDefinitions']['get'](_0x24e9ec),_0x4246a8=this['editor'],_0x5c5a3e=_0x4246a8['model']['document']['selection'],_0x44d165=_0x4246a8['commands']['get']('showAIAssistant'),_0x4a9c41=_0x4246a8['plugins']['get'](a),_0x3bfcbc=''+(_0x18181a['groupId']!==x?_0x18181a['groupLabel']+':\x20':'')+_0x18181a['label'];if(!0x1!==_0x18181a['requiresContent']&&_0x5c5a3e['isCollapsed']){const _0x48c206=_0x147222(_0x5c5a3e['getSelectedBlocks']())||_0x4246a8['model']['schema']['getLimitElement'](_0x5c5a3e);_0x4246a8['model']['change'](_0x177996=>{_0x177996['setSelection'](_0x48c206,'in');});}_0x4a9c41['showFakeVisualSelection'](),_0x44d165['execute'](_0x18181a['prompt'],_0x3bfcbc,'command:'+_0x24e9ec);}['_populateMenuBarMenu'](_0x513450,_0x4addc9,_0x6b3f2e,_0x7e0601){const _0x213bd6=this['editor'],_0x1d09b8=_0x213bd6['locale'],_0x3215e7=new _0x43c130(_0x1d09b8),_0xbe0404=B(_0x213bd6,_0x6b3f2e)['filter'](_0x4fa972=>_0x4fa972['commands']['length']);0x1===_0xbe0404['length']?this['_getMenuBarGroupButtons']({'command':_0x513450,'commands':_0xbe0404[0x0]['commands'],'parentMenuView':_0x4addc9,'onExecute':_0x7e0601})['forEach'](_0x1cf96c=>_0x3215e7['items']['add'](_0x1cf96c)):_0xbe0404['forEach'](({groupId:_0x38121b,groupLabel:_0x35b966,commands:_0x466825})=>{const _0x143fbd=new _0x47412e(_0x1d09b8,_0x4addc9),_0x30e16e=new _0x42db8e(_0x1d09b8),_0x30c382=new _0x43c130(_0x1d09b8),_0x3e9ee6=this['_getMenuBarGroupButtons']({'command':_0x513450,'commands':_0x466825,'parentMenuView':_0x30e16e,'onExecute':_0x7e0601});_0x30e16e['buttonView']['set']({'label':_0x35b966||_0x38121b}),_0x30e16e['delegate']('execute')['to'](_0x4addc9),_0x30c382['items']['addMany'](_0x3e9ee6),_0x30e16e['panelView']['children']['add'](_0x30c382),_0x143fbd['children']['add'](_0x30e16e),_0x3215e7['items']['add'](_0x143fbd);}),_0x4addc9['panelView']['children']['add'](_0x3215e7);}['_getMenuBarGroupButtons']({command:_0x13b3e2,commands:_0x19585d,parentMenuView:_0x2f88ed,onExecute:_0x2a31a9}){const _0x3014eb=this['editor'],_0x158e4b=_0x3014eb['locale'];return B(_0x3014eb,_0x19585d)['map'](_0x246851=>{const _0xcb6003=new _0x47412e(_0x158e4b,_0x2f88ed),_0x596ee5=new _0xa34e7b(_0x158e4b);return _0x596ee5['set']({'label':_0x246851['label']}),_0x596ee5['delegate']('execute')['to'](_0x2f88ed),_0x596ee5['on']('execute',()=>_0x2a31a9(_0x246851['id'])),_0x596ee5['bind']('isEnabled')['to'](_0x13b3e2,'enabledCommandsIds',_0x190942=>_0x190942['includes'](_0x246851['id'])),_0xcb6003['children']['add'](_0x596ee5),_0xcb6003;});}}function U(_0x2e32a9,_0x54e5de){return void 0x0!==_0x2e32a9['order']&&void 0x0===_0x54e5de['order']?0x1:void 0x0===_0x2e32a9['order']&&void 0x0!==_0x54e5de['order']?-0x1:void 0x0!==_0x2e32a9['order']&&void 0x0!==_0x54e5de['order']?_0x2e32a9['order']-_0x54e5de['order']:0x0;}function B(_0x1c2d7f,_0x4e4a0c){_0x4e4a0c['sort'](U);const _0x46f4d4={},_0x267332=[];for(const _0x1dd2c8 of _0x4e4a0c)if(void 0x0!==_0x1dd2c8['order']){if(_0x1dd2c8['order']in _0x46f4d4)throw new _0x70c77e('ai-commands-config-order-collision',_0x1c2d7f,{'conflictingDefinitions':[_0x1dd2c8,_0x46f4d4[_0x1dd2c8['order']]]});_0x46f4d4[_0x1dd2c8['order']]=_0x1dd2c8,_0x267332['splice'](_0x1dd2c8['order'],0x0,_0x1dd2c8);}else _0x267332['push'](_0x1dd2c8);return _0x267332;}class $n extends _0x4d60c6{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x506d79){super(_0x506d79);const _0x41dac3=_0x506d79['config'],_0x475009=_0x506d79['locale'];_0x41dac3['define']('ai.assistant.preserveComments',!0x0),_0x41dac3['define']('ai.assistant.commands',qn(_0x475009)),_0x41dac3['define']('ai.assistant.extraCommandGroups',[]),_0x41dac3['define']('ai.assistant.removeCommands',[]);let _0x1c1d9a=o(_0x41dac3['get']('ai.assistant.commands'),_0x475009);const _0x169e80=_0x41dac3['get']('ai.assistant.extraCommandGroups'),_0x2e7886=_0x41dac3['get']('ai.assistant.removeCommands');_0x169e80['forEach'](_0x37303b=>{const _0x3a892b=_0x1c1d9a['find'](_0x3c9458=>_0x3c9458['groupId']===_0x37303b['groupId']);_0x3a892b?_0x3a892b['commands']=_0x3a892b['commands']['concat'](_0x37303b['commands']):_0x1c1d9a['push'](_0x37303b);}),_0x1c1d9a=_0x1c1d9a['filter'](_0x46230c=>!_0x2e7886['includes'](_0x46230c['groupId'])),_0x1c1d9a['forEach'](_0x115d08=>{_0x115d08['commands']=_0x115d08['commands']['filter'](_0x5491a8=>!_0x2e7886['includes'](_0x5491a8['id']));}),_0x41dac3['set']('ai.assistant.commands',_0x1c1d9a);}}function qn(_0x41095c){return[{'groupId':'editOrReview','groupLabel':Wn(_0x41095c,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Wn(_0x41095c,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Wn(_0x41095c,'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(_0x41095c,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Wn(_0x41095c,'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(_0x41095c,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Wn(_0x41095c,'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(_0x41095c,'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(_0x41095c,'Change\x20tone'),'commands':[{'id':'professional','label':Wn(_0x41095c,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Wn(_0x41095c,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Wn(_0x41095c,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Wn(_0x41095c,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Wn(_0x41095c,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Wn(_0x41095c,'Change\x20style'),'commands':[{'id':'business','label':Wn(_0x41095c,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Wn(_0x41095c,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Wn(_0x41095c,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Wn(_0x41095c,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Wn(_0x41095c,'Translate'),'commands':[{'id':'translateEnglish','label':Wn(_0x41095c,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Wn(_0x41095c,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Wn(_0x41095c,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Wn(_0x41095c,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Wn(_0x41095c,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Wn(_0x41095c,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Wn(_0x41095c,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Wn(_0x41095c,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ye extends _0x4d60c6{['abortController'];static get['requires'](){return[K];}constructor(_0x48fb85){super(_0x48fb85),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'](_0x31e0bf){return this['sendRequest'](_0x31e0bf)['catch'](_0x3c62cf=>{if(_0x3c62cf instanceof er)return Promise['reject'](_0x3c62cf);if('AbortError'==_0x3c62cf['name'])return Promise['resolve']();throw console['error'](_0x3c62cf),new _0x70c77e('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x574492,_0x5edf5c){const _0x31bbba=this['editor']['locale'],_0x187cbc={'Content-Type':'application/json'};if('object'==typeof _0x574492)Object['assign'](_0x187cbc,_0x574492);else{if(_0x574492)try{const _0x385c35=await _0x574492(_0x5edf5c);Object['assign'](_0x187cbc,_0x385c35);}catch{return Promise['reject'](new er(Wn(_0x31bbba,'AI_ERROR_GET_HEADERS')));}}return _0x187cbc;}async['_prepareRequestParameters'](_0x4b5c2a,_0x31e4e7){const _0x5bd1f4=this['editor']['locale'];if('object'==typeof _0x4b5c2a)return _0x4b5c2a;try{return await _0x4b5c2a(_0x31e4e7);}catch{return Promise['reject'](new er(Wn(_0x5bd1f4,'AI_ERROR_GET_PARAMETERS')));}}}class Qn extends ye{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x4676bd){super(_0x4676bd),_0x4676bd['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x4676bd['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x4676bd['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x4676bd['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x4676bd['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x4676bd['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x334c71,context:_0x1fe211,onData:_0x1eb39e,actionId:_0x180121}){const _0x54d313=this['editor']['locale'],_0x5d1285=await this['prepareMessages'](_0x334c71,_0x1fe211,_0x180121),_0x3fbea8=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x180121),_0x48dab0=await this['_prepareRequestParameters'](this['_requestParameters'],_0x180121),_0x50a67c={'messages':_0x5d1285,..._0x48dab0},_0x4e1614={'method':'POST','headers':_0x3fbea8,'body':JSON['stringify'](_0x50a67c),'signal':this['abortController']['signal']},_0x116c45=await fetch(this['_apiUrl'],_0x4e1614);if(_0x116c45['ok'])return _0x48dab0['stream']?await this['_readStreamableResponse'](_0x116c45,_0x1eb39e):await this['_readStaticResponse'](_0x116c45,_0x1eb39e),Promise['resolve']();{const _0x553545=await _0x116c45['text']();return _0x553545['includes']('context_length_exceeded')?Promise['reject'](new er(Wn(_0x54d313,'AI_ERROR_CONTEXT_LENGTH'))):_0x553545['includes']('Moderation')?Promise['reject'](new er(Wn(_0x54d313,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x553545));}}async['prepareMessages'](_0x2347a3,_0x1c5205,_0x185ecb){let _0x323164,_0x36f573;return _0x1c5205?(_0x323164='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.',_0x36f573='Instruction:\x0a'+_0x2347a3+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x1c5205):(_0x323164='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.',_0x36f573=_0x2347a3),[{'role':'system','content':_0x323164},{'role':'user','content':_0x36f573}];}async['_readStreamableResponse'](_0x4495d9,_0x5e0ac4){const _0x293eb8=_0x4495d9['body']['getReader'](),_0x34c161=new TextDecoder();let _0x501739='',_0x2fcc54='',_0x1cdd0d='',_0x359cd7=!0x1;for(;!_0x359cd7;){const {done:_0x5f2504,value:_0x9a802f}=await _0x293eb8['read'](),_0x2c6e7e=_0x501739+_0x34c161['decode'](_0x9a802f);let _0x5f3591='';_0x359cd7=_0x5f2504;try{_0x5f3591=this['_cleanUpData'](_0x2c6e7e),_0x501739='';}catch{_0x501739=_0x2c6e7e;continue;}_0x2fcc54+=_0x5f3591,!_0x359cd7&&this['_isBufferIncomplete'](_0x2fcc54)||_0x2fcc54&&(_0x1cdd0d+=_0x2fcc54,_0x2fcc54='',_0x5e0ac4(_0x1cdd0d));}return Promise['resolve']();}async['_readStaticResponse'](_0x8f696c,_0x2c7591){return _0x2c7591((await _0x8f696c['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x3437d4){const _0x1f7eb2=_0x3437d4['split']('<')['length']!==_0x3437d4['split']('>')['length'],_0x1d22f3=_0x3437d4['length']<0x1e;return _0x1f7eb2&&_0x1d22f3;}['_cleanUpData'](_0x39d4a9){return _0x39d4a9['split'](/\n(?![^{]*\})/g)['map'](_0x442bb0=>_0x442bb0['replace']('data:\x20',''))['filter'](_0x17bf73=>_0x17bf73&&_0x17bf73['length']>0x0&&'[DONE]'!==_0x17bf73)['map'](_0x4a2af4=>{const {choices:_0x9f39b4}=JSON['parse'](_0x4a2af4);if(_0x9f39b4[0x0]?.['delta']?.['content'])return _0x9f39b4[0x0]['delta']['content'];})['filter'](_0x3307f6=>_0x3307f6)['join']('');}}class Xn extends ye{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x5733e3){super(_0x5733e3),_0x5733e3['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x5733e3['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']=_0x5733e3['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x5733e3['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x5733e3['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x5733e3['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x36596d,context:_0x502d92,onData:_0x23b0a9,actionId:_0x67f8e3}){const {model:_0x5650b0,stream:_0x1ccc50,..._0x17560e}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x67f8e3),_0x9877a8={'prompt':await this['preparePrompt'](_0x36596d,_0x502d92,_0x5650b0,_0x67f8e3),..._0x17560e};this['_apiUrl']?await this['_processProxyRequest'](_0x9877a8,_0x5650b0,_0x1ccc50,_0x23b0a9,_0x67f8e3):await this['_processAWSRequest'](_0x9877a8,_0x5650b0,_0x1ccc50,_0x23b0a9);}async['preparePrompt'](_0xbbfab0,_0x3e8039,_0x3b3ade,_0x34ddeb){let _0x167658,_0x211133;return _0x3e8039?(_0x167658='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.',_0x211133='Instruction:\x0a'+_0xbbfab0+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x3e8039):(_0x167658='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.',_0x211133=_0xbbfab0),'meta.llama'==this['getModelFamily'](_0x3b3ade)?'<<SYS>>\x0a'+_0x167658+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x211133+'\x0a[/INST]':'Human:\x0a'+_0x167658+'\x0a'+_0x211133+'\x0a\x0aAssistant:';}['getModelFamily'](_0x2c465a){if(/^anthropic\.claude/['test'](_0x2c465a))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x2c465a))return'ai21.j2';if(/^cohere\.command/['test'](_0x2c465a))return'cohere.command';if(/^meta\.llama/['test'](_0x2c465a))return'meta.llama';throw new er(Wn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x2c465a));}async['_processProxyRequest'](_0x2eeb12,_0x4ebc88,_0x143eba,_0x50fa3b,_0x49d2f1){const _0xb6226d={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x49d2f1),'body':JSON['stringify']({..._0x2eeb12,'model':_0x4ebc88,'stream':_0x143eba}),'signal':this['abortController']['signal']},_0x1fe7dc=await fetch(this['_apiUrl'],_0xb6226d);_0x143eba?await this['_readStreamableResponse'](_0x1fe7dc,_0x4ebc88,_0x50fa3b):await this['_readStaticResponse'](_0x1fe7dc,_0x4ebc88,_0x50fa3b);}async['_processAWSRequest'](_0x59fe97,_0x507cf4,_0x4b3f04,_0x2216c4){const _0x3eb8a1=new _0x40fb22(this['_bedrockClientConfig']),_0x1f0a94={'body':JSON['stringify'](_0x59fe97),'contentType':'application/json','accept':'application/json','modelId':_0x507cf4};let _0x219ed9;if(_0x4b3f04){const _0x1c6602=new _0x3758f2(_0x1f0a94);_0x219ed9=await _0x3eb8a1['send'](_0x1c6602,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x219ed9,_0x507cf4,_0x2216c4);}else{const _0x6b1a18=new _0x471001(_0x1f0a94);_0x219ed9=await _0x3eb8a1['send'](_0x6b1a18,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x219ed9,_0x507cf4,_0x2216c4);}}async['_readAsyncIterableResponse'](_0x37d2b3,_0x97718,_0x5231ec){const _0x34a3bc=_0x37d2b3['body'],_0x4eb876=new TextDecoder('utf-8');let _0x1c4aec='';for await(const _0x443a50 of _0x34a3bc)if(_0x443a50['chunk']){const _0x240f44=_0x4eb876['decode'](_0x443a50['chunk']['bytes']),_0x13ac84=JSON['parse'](_0x240f44);_0x1c4aec+=this['_getGeneratedText'](_0x13ac84,_0x97718),_0x5231ec(_0x1c4aec);}return Promise['resolve']();}async['_readStreamableResponse'](_0x59a71d,_0x58385b,_0x549d41){const _0x20d80c=_0x59a71d['body'],_0x516e06=new TextDecoder('utf-8'),_0x4456ef=_0x20d80c['getReader']();let _0x2a8447='',_0x56f900='',_0x347eb3=!0x1;for(;!_0x347eb3;){const {done:_0x5be2f0,value:_0xf4836a}=await _0x4456ef['read']();if(_0x347eb3=_0x5be2f0,_0x347eb3)break;const _0x18a50d=(_0x2a8447+_0x516e06['decode'](_0xf4836a))['split']('\x0a')['map'](_0x5800bc=>{try{return _0x2a8447='',JSON['parse'](_0x5800bc);}catch{return _0x2a8447=_0x5800bc,null;}})['filter'](_0x21b671=>null!==_0x21b671);_0x18a50d['length']&&(_0x56f900+=_0x18a50d['map'](_0x523f13=>this['_getGeneratedText'](_0x523f13,_0x58385b))['join'](''),_0x549d41(_0x56f900));}return Promise['resolve']();}async['_readStaticResponse'](_0x23a872,_0x16aa99,_0x8e5bc6){let _0xf66e63;return _0xf66e63=_0x23a872 instanceof Response?await _0x23a872['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x23a872['body'])),(_0x8e5bc6(this['_getGeneratedText'](_0xf66e63,_0x16aa99)),Promise['resolve']());}['_getGeneratedText'](_0x1e1892,_0x4b0df0){switch(this['getModelFamily'](_0x4b0df0)){case'anthropic.claude':return _0x1e1892['completion'];case'ai21.j2':return _0x1e1892['completions'][0x0]['data']['text'];case'cohere.command':return _0x1e1892['generations'][0x0]['text'];case'meta.llama':return _0x1e1892['generation'];}}}class ia extends _0x42f5cd{constructor(_0x13dd79,_0x1ab904={}){super(_0x13dd79),this['isToggleable']=!0x0,this['set']('side',_0x1ab904['side']||'top');const _0x2ca3ca=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x1c6a41(_0x1ab904['class']||[]),_0x2ca3ca['to']('side',_0x1cc1b7=>'ck-tab-button_'+_0x1cc1b7),_0x2ca3ca['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x10e3da{['children'];constructor(_0x5f1aac,_0x34601f={}){super(_0x5f1aac);const _0x309ef8=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x1c6a41(_0x34601f['class']||[]),_0x309ef8['to']('class'),_0x309ef8['if']('isVisible','ck-hidden',_0x5113b2=>!_0x5113b2)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x10e3da{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x402003,_0x239d00={}){super(_0x402003),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x239d00['side']||'top'),this['set']('isMaximized',!0x1);const _0x16e48a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x1c6a41(_0x239d00['class']||[]),_0x16e48a['to']('side',_0x12ed34=>'ck-tabs_'+_0x12ed34),_0x16e48a['to']('class'),_0x16e48a['to']('isMaximized',_0xe2f531=>_0xe2f531?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x16e48a['to']('side',_0x4923a7=>'ck-tabs__buttons-container_'+_0x4923a7)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x16e48a['to']('side',_0x14e494=>'ck-tabs__panels-container_'+_0x14e494)]},'children':this['panelViews']},..._0x1c6a41(_0x239d00['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x112d24){const _0x4e8a21=this['_tabs']['get'](_0x112d24);return _0x4e8a21||null;}['addTab'](_0x5413e9){const _0x280158=this['_setupButton']({'id':_0x5413e9['id'],'label':_0x5413e9['buttonLabel'],'icon':_0x5413e9['buttonIcon'],'order':_0x5413e9['order']}),_0x1811bd=new ea(this['locale']);return _0x1811bd['render'](),_0x5413e9['content']&&_0x1811bd['children']['add'](_0x5413e9['content']),this['panelViews']['add'](_0x1811bd),this['_tabs']['set'](_0x5413e9['id'],{'button':_0x280158,'panel':_0x1811bd,'order':void 0x0!==_0x5413e9['order']?_0x5413e9['order']:null}),this['fire']('addTab:'+_0x5413e9['id'],{'id':_0x5413e9['id'],'button':_0x280158,'panel':_0x1811bd}),null===this['activeTab']?this['activateTab'](_0x5413e9['id']):this['_hidePanel'](_0x5413e9['id']),{'button':_0x280158,'panel':_0x1811bd};}['activateTab'](_0x52e918){if(null!==_0x52e918&&!this['getTab'](_0x52e918))throw new _0x70c77e('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x52e918});this['activeTab']!==_0x52e918&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x52e918,_0x52e918&&this['_showPanel'](_0x52e918),this['fire']('activateTab:'+_0x52e918,_0x52e918));}['showTab'](_0xf762a0){if(!this['getTab'](_0xf762a0))throw new _0x70c77e('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0xf762a0});this['_showPanel'](_0xf762a0),this['_showButton'](_0xf762a0),this['fire']('show:'+_0xf762a0,_0xf762a0);}['hideTab'](_0x28eba6){if(!this['getTab'](_0x28eba6))throw new _0x70c77e('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x28eba6});const _0x2dff92=this['activeTab'];this['_hidePanel'](_0x28eba6),this['_hideButton'](_0x28eba6);const _0x59c6c8=this['getTabIds']();_0x2dff92===_0x28eba6&&_0x59c6c8['length']>0x1&&this['activateTab'](_0x59c6c8['find'](_0x521cba=>_0x521cba!==_0x28eba6)),this['fire']('hide:'+_0x28eba6,_0x28eba6);}['_getPanel'](_0x5f2b83){const _0x28b07a=this['_tabs']['get'](_0x5f2b83);return _0x28b07a?_0x28b07a['panel']:null;}['_showPanel'](_0x2f29fb){null!==this['activeTab']&&this['activeTab']!==_0x2f29fb||this['_getPanel'](_0x2f29fb)['show']();}['_hidePanel'](_0x4bc345){const _0x4f77db=this['_getPanel'](_0x4bc345);_0x4f77db['isVisible']&&(this['activeTab']===_0x4bc345&&(this['activeTab']=null),_0x4f77db['hide']());}['_getButton'](_0xb17213){const _0x2f4474=this['_tabs']['get'](_0xb17213);return _0x2f4474?_0x2f4474['button']:null;}['_showButton'](_0x2d16c5){this['_getButton'](_0x2d16c5)['show']();}['_hideButton'](_0x468b1c){this['_getButton'](_0x468b1c)['hide']();}['_setupButton'](_0x204556){const _0x4e442d=new ia(this['locale'],{'side':this['side']}),_0x2ac904=this['buttonViews'];if(_0x4e442d['set']({'label':_0x204556['label'],'icon':_0x204556['icon'],'tooltip':!0x0,'withText':!0x0}),_0x4e442d['bind']('isOn')['to'](this,'activeTab',_0x37ded4=>_0x37ded4===_0x204556['id']),_0x4e442d['bind']('side')['to'](this,'side'),_0x204556['order']){const _0x356074=[...this['_tabs']]['reduce']((_0x531f96,_0x573719)=>{const _0x4d65e6=_0x573719[0x0],{order:_0xe2e8f9}=_0x573719[0x1];return!_0xe2e8f9||_0xe2e8f9>_0x204556['order']?_0x531f96:_0xe2e8f9>=_0x531f96['order']?{'id':_0x4d65e6,'order':_0xe2e8f9}:_0x531f96;},{'id':'','order':0x0}),_0x5abedf=_0x2ac904['getIndex'](this['_getButton'](_0x356074['id']));_0x2ac904['add'](_0x4e442d,_0x5abedf+0x1);}else _0x2ac904['add'](_0x4e442d);return _0x4e442d['on']('execute',()=>{this['activateTab'](_0x204556['id']);}),_0x4e442d;}}const ni=['overlay','sidebar','custom'],oi=['left','right'];class hi extends ss{constructor(_0x1a0d9d,_0x90ac93={}){super(_0x1a0d9d,_0x90ac93),this['set']('type',_0x90ac93['type']||'sidebar'),this['set']('side',_0x90ac93['side']||'right'),this['set']('isVisible',_0x90ac93['visibleByDefault']??!0x0);const _0x80ec70=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x80ec70['if']('type','ck-ai-tabs__overlay',_0x3d79ec=>'overlay'===_0x3d79ec),_0x80ec70['if']('type','ck-ai-tabs__sidebar',_0x909787=>'sidebar'===_0x909787),_0x80ec70['if']('isVisible','ck-hidden',_0xafbe89=>!_0xafbe89)]}}),this['buttonViews']['on']('add',(_0x4f548c,_0xec5007)=>{_0xec5007['set']('withText',!0x1);});}}class pt extends _0x2536b2{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x245b98){super(_0x245b98);const _0x8a2cbe=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x8a2cbe)throw new _0x70c77e('ai-tabs-configuration-not-found');if(void 0x0!==_0x8a2cbe['showResizeButton']&&(this['showResizeButton']=_0x8a2cbe['showResizeButton']),'sidebar'!==_0x8a2cbe['type']&&'overlay'!==_0x8a2cbe['type']||_0x8a2cbe['side']&&(this['side']=_0x8a2cbe['side']),'sidebar'===_0x8a2cbe['type']){if(this['container']=_0x8a2cbe['element'],this['set']('type','sidebar'),!this['container'])throw new _0x70c77e('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x8a2cbe['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===_0x8a2cbe['visibleByDefault']||_0x8a2cbe['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'](_0x4939e3){if(_0x4939e3&&this['type']!==_0x4939e3){if(!ni['includes'](_0x4939e3))throw new _0x70c77e('ai-tabs-unsupported-ui-type');this['type']=_0x4939e3;}}['switchSide'](_0x2f55e9){if(_0x2f55e9&&this['side']!==_0x2f55e9){if(!oi['includes'](_0x2f55e9))throw new _0x70c77e('ai-tabs-unsupported-ui-side');this['side']=_0x2f55e9;}}['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 _0x2536b2{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x8095ca){super(_0x8095ca),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 _0x3f6897=this['context']['plugins']['get']('CloudServices');if(!_0x3f6897['token'])throw new _0x70c77e('ai-missing-token',this);this['_token']=_0x3f6897['token'];}['startConversation'](_0x5755ee,_0x500d21){const _0x27fc26=this['_sendApiRequest']('/conversations','POST',{'id':_0x5755ee,'group':_0x500d21});return{'getConversation':async()=>(await _0x27fc26['request'])['json'](),'abortController':_0x27fc26['abortController']};}['queryAssistant']({message:_0x2adfe7,conversationId:_0x48b794,parts:_0x53eb17,capabilities:_0x56f6b2,model:_0x3199ca,attributes:_0x99604f}){const _0x11e222={'prompt':_0x2adfe7,'content':_0x53eb17,'model':_0x3199ca,..._0x56f6b2&&{'capabilities':_0x56f6b2},..._0x99604f&&{'attributes':_0x99604f}},_0x4510f9=this['_sendApiRequest']('/conversations/'+_0x48b794+'/messages','POST',_0x11e222);return{'getStream':async()=>{const _0x4e5937=(await _0x4510f9['request'])['body'];return this['_getStreamReader'](_0x4e5937);},'abortController':_0x4510f9['abortController']};}['executeCustomAction']({content:_0xc5e3fd,message:_0x33ed6c,model:_0x36b6c6,outputFormat:_0x2aab00}){const _0x228d0d={'content':[{'type':'text','content':_0xc5e3fd}],'prompt':_0x33ed6c,'model':_0x36b6c6,'outputFormat':_0x2aab00},_0x5576cf=this['_sendApiRequest']('/actions/custom/calls','POST',_0x228d0d);return{'getStream':async()=>{const _0x26921b=(await _0x5576cf['request'])['body'];return this['_getStreamReader'](_0x26921b);},'abortController':_0x5576cf['abortController']};}['executeAction']({actionName:_0x4f776f,content:_0x152df7,args:_0x554d6a}){const _0x44b3df={'content':[{'type':'text','content':_0x152df7}],'args':_0x554d6a},_0x5deda2=this['_sendApiRequest']('/actions/system/'+_0x4f776f+'/calls','POST',_0x44b3df);return{'getStream':async()=>{const _0x4a6841=(await _0x5deda2['request'])['body'];return this['_getStreamReader'](_0x4a6841);},'abortController':_0x5deda2['abortController']};}['uploadFile'](_0x50d465,_0x3fd42c,_0x368e6b){const _0x14eef7=new FormData();_0x14eef7['append']('file',_0x3fd42c,_0x3fd42c['name']),_0x368e6b&&_0x14eef7['append']('attributes',JSON['stringify'](_0x368e6b));const _0x16a5f5=this['_sendApiRequest']('/conversations/'+_0x50d465+'/files','POST',_0x14eef7);return{'getId':async()=>(await _0x16a5f5['request'])['json'](),'abortController':_0x16a5f5['abortController']};}['fetchDocument'](_0xbb836,_0x581636){const _0x514481=this['_sendApiRequest']('/conversations/'+_0xbb836+'/documents/'+_0x581636,'GET');return{'getDocument':async()=>(await _0x514481['request'])['json'](),'abortController':_0x514481['abortController']};}['uploadDocument'](_0x2aa005,_0x735175,_0x3a1d79){const _0x319f06={'content':_0x735175};_0x3a1d79&&(_0x319f06['attributes']=_0x3a1d79);const _0x34d89c=this['_sendApiRequest']('/conversations/'+_0x2aa005+'/documents','POST',_0x319f06);return{'getId':async()=>(await _0x34d89c['request'])['json'](),'abortController':_0x34d89c['abortController']};}['fetchConversations'](_0x11fc53,_0x19db66={}){const _0x3cb4d1=new URLSearchParams();_0x3cb4d1['append']('group',_0x11fc53),_0x3cb4d1['append']('excludeEmpty',!0x1!==_0x19db66['excludeEmpty']?'true':'false'),_0x3cb4d1['append']('limit',_0x19db66['limit']?_0x19db66['limit']['toString']():'100'),_0x3cb4d1['append']('sortBy',_0x19db66['sortBy']?_0x19db66['sortBy']:'createdAt'),_0x3cb4d1['append']('order',_0x19db66['order']?_0x19db66['order']:'desc');const _0x39c6f7=this['_sendApiRequest']('/conversations?'+_0x3cb4d1['toString'](),'GET');return{'getConversations':async()=>{const _0x59d6de=await _0x39c6f7['request'];return(await _0x59d6de['json']())['items'];},'abortController':_0x39c6f7['abortController']};}['deleteConversation'](_0x5c9bea){const _0x29ef5e=this['_sendApiRequest']('/conversations/'+_0x5c9bea,'DELETE');return{'execute':async()=>{await _0x29ef5e['request'];},'abortController':_0x29ef5e['abortController']};}['updateConversation'](_0x439e1b,_0xdb395c){const _0x516e48=this['_sendApiRequest']('/conversations/'+_0x439e1b,'PATCH',_0xdb395c);return{'getResult':async()=>(await _0x516e48['request'],_0xdb395c),'abortController':_0x516e48['abortController']};}['fetchConversation'](_0x3670a7){const _0xe4c750=this['_sendApiRequest']('/conversations/'+_0x3670a7,'GET');return{'getConversation':async()=>(await _0xe4c750['request'])['json'](),'abortController':_0xe4c750['abortController']};}['fetchConversationMessages'](_0x37516b){const _0x101fa4=this['_sendApiRequest']('/conversations/'+_0x37516b+'/messages','GET');return{'getMessages':async()=>{const _0x4ee5a2=await _0x101fa4['request'];return(await _0x4ee5a2['json']())['items'];},'abortController':_0x101fa4['abortController']};}['uploadUrl'](_0x21ecc6,_0x52f81c,_0x3aefd5){const _0x3b6e26=this['_sendApiRequest']('/conversations/'+_0x21ecc6+'/web-resources','POST',{'url':_0x52f81c,'attributes':_0x3aefd5});return{'getId':async()=>(await _0x3b6e26['request'])['json'](),'abortController':_0x3b6e26['abortController']};}['getModels'](_0x23e178='en'){const _0xf50163=new URLSearchParams();_0xf50163['append']('language',_0x23e178);const _0x4e13f8='/models/1?'+_0xf50163['toString'](),_0x5b1e74=this['_sendApiRequest'](_0x4e13f8,'GET');return{'list':async()=>await(await _0x5b1e74['request'])['json'](),'abortController':_0x5b1e74['abortController']};}['deleteFile'](_0x259ed6,_0x54bbc6){const _0x4d0975=this['_sendApiRequest']('/conversations/'+_0x259ed6+'/files/'+_0x54bbc6,'DELETE');return{'execute':async()=>{await _0x4d0975['request'];},'abortController':_0x4d0975['abortController']};}['deleteDocument'](_0x359b5d,_0x401f73){const _0x19a640=this['_sendApiRequest']('/conversations/'+_0x359b5d+'/documents/'+_0x401f73,'DELETE');return{'execute':async()=>{await _0x19a640['request'];},'abortController':_0x19a640['abortController']};}['deleteWebResource'](_0x13d595,_0x1328e3){const _0x393d98=this['_sendApiRequest']('/conversations/'+_0x13d595+'/web-resources/'+_0x1328e3,'DELETE');return{'execute':async()=>{await _0x393d98['request'];},'abortController':_0x393d98['abortController']};}['callSystemReview']({reviewName:_0x3535b8,content:_0x430cb0,args:_0x5abd9c}){const _0x131a61=this['_sendApiRequest']('/reviews/system/'+_0x3535b8+'/calls','POST',{'content':[{'type':'text','content':_0x430cb0}],'args':_0x5abd9c});return{'getStream':async()=>{const _0x10fac9=(await _0x131a61['request'])['body'];return this['_getStreamReader'](_0x10fac9);},'abortController':_0x131a61['abortController']};}['callCustomReview']({content:_0x111cdf,prompt:_0x263024,model:_0x34ea35}){const _0x5c9533=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x111cdf}],'prompt':_0x263024,'model':_0x34ea35});return{'getStream':async()=>{const _0x47c657=(await _0x5c9533['request'])['body'];return this['_getStreamReader'](_0x47c657);},'abortController':_0x5c9533['abortController']};}['upsertAIChatRating'](_0x59e500,_0x2bc9b3,_0x4818d7){const _0x1920af=this['_sendApiRequest']('/conversations/'+_0x59e500+'/messages/'+_0x2bc9b3+'/ratings','PUT',{'positiveCount':_0x4818d7['positiveCount'],'totalCount':_0x4818d7['totalCount'],'modificationId':_0x4818d7['modificationId']});return{'execute':async()=>{await _0x1920af['request'];},'abortController':_0x1920af['abortController']};}['upsertAIActionRating'](_0x459240,_0x518ed5,_0x4912c4){const _0x4165f5=this['_sendApiRequest']('/actions/system/'+_0x459240+'/calls/'+_0x518ed5+'/ratings','PUT',{'positiveCount':_0x4912c4['positiveCount'],'totalCount':_0x4912c4['totalCount']});return{'execute':async()=>{await _0x4165f5['request'];},'abortController':_0x4165f5['abortController']};}['upsertCustomAIActionRating'](_0x512c1e,_0x6a387b){const _0x4a5d63=this['_sendApiRequest']('/actions/custom/calls/'+_0x512c1e+'/ratings','PUT',{'positiveCount':_0x6a387b['positiveCount'],'totalCount':_0x6a387b['totalCount']});return{'execute':async()=>{await _0x4a5d63['request'];},'abortController':_0x4a5d63['abortController']};}['upsertAIReviewRating'](_0x452907,_0x363588,_0x40727e,_0x11e25d){const _0x42295e=this['_sendApiRequest']('/reviews/system/'+_0x452907+'/calls/'+_0x363588+'/ratings','PUT',{'positiveCount':_0x40727e['positiveCount'],'totalCount':_0x40727e['totalCount'],'dataId':_0x11e25d});return{'execute':async()=>{await _0x42295e['request'];},'abortController':_0x42295e['abortController']};}['upsertCustomAIReviewRating'](_0x4c29c9,_0x473e61,_0x5384b5){const _0x5a65b0=this['_sendApiRequest']('/reviews/custom/calls/'+_0x4c29c9+'/ratings','PUT',{'positiveCount':_0x473e61['positiveCount'],'totalCount':_0x473e61['totalCount'],'dataId':_0x5384b5});return{'execute':async()=>{await _0x5a65b0['request'];},'abortController':_0x5a65b0['abortController']};}['_sendApiRequest'](_0x40c8f3,_0x2f97ce,_0xa22412){const _0x3ca944=new AbortController(),_0x527976=_0xa22412 instanceof FormData,_0x3ac4dd={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0xa22412&&!_0x527976&&(_0x3ac4dd['Content-Type']='application/json');const _0x2a1857={'method':_0x2f97ce,'headers':_0x3ac4dd,'signal':_0x3ca944['signal']};return _0xa22412&&(_0x2a1857['body']=_0x527976?_0xa22412:JSON['stringify'](_0xa22412)),{'request':fetch(''+this['_apiUrl']+_0x40c8f3,_0x2a1857)['catch'](_0x12e127=>{this['_handleError'](_0x12e127);})['then'](_0x234da4=>_0x234da4['ok']?_0x234da4:_0x234da4['json']()['then'](_0x4d0a62=>{throw{'url':this['_apiUrl'],'path':_0x40c8f3,'method':_0x2f97ce,'body':_0xa22412,'status':(_0x234da4||{})['status'],'statusText':(_0x234da4||{})['statusText'],'code':_0x4d0a62['code'],'message':_0x4d0a62['message'],'traceId':_0x4d0a62['traceId']};})),'abortController':_0x3ca944};}async*['_getStreamReader'](_0x32b8a5){const _0x5ca11a=[],_0x206c1e=_0x32b8a5['getReader'](),_0x5b37d2=$t({'onError':_0x31e6c8=>{this['_handleError'](_0x31e6c8);},'onEvent':_0x5d142d=>{_0x5d142d['data']=JSON['parse'](_0x5d142d['data']),_0x5ca11a['push'](_0x5d142d);}});try{let _0x4b51c5=!0x1;for(;!_0x4b51c5;){const {done:_0x57ed15,value:_0x5a4e41}=await _0x206c1e['read']();_0x57ed15&&(_0x4b51c5=!0x0),_0x5b37d2['feed'](this['_decoder']['decode'](_0x5a4e41,{'stream':!0x0})),yield*_0x5ca11a,_0x5ca11a['length']=0x0;}}catch(_0x44f0ad){this['_handleError'](_0x44f0ad);}finally{_0x206c1e['releaseLock'](),_0x5b37d2['reset']();}}['_handleError'](_0x8a4a3){if(_0x8a4a3 instanceof _0x70c77e)throw _0x8a4a3;if(_0x8a4a3 instanceof Error&&'AbortError'===_0x8a4a3['name'])throw new _0x70c77e('ai-request-aborted',this,{'originalError':_0x8a4a3});throw new _0x70c77e('ai-request-failed',this,{'originalError':_0x8a4a3});}}function i(_0x4e4b0a,_0x467eca,_0x4d6738){const t=_0x4e4b0a['t'];switch(_0x467eca){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'},_0x4d6738);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.'},_0x4d6738);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.'},_0x4d6738);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.'},_0x4d6738);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'},_0x4d6738);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x4d6738);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'},_0x4d6738);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.'},_0x4d6738);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.'},_0x4d6738);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.'},_0x4d6738);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.'},_0x4d6738);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'},_0x4d6738);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.'},_0x4d6738);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 _0x467eca;}}function Hs(_0x2c1996,_0x578317){const _0x14c572=new _0x42f5cd(_0x2c1996),_0x4d716c=i(_0x2c1996,'AI_TABS_LABEL_MINIMIZE'),_0x26767c=i(_0x2c1996,'AI_TABS_LABEL_MAXIMIZE');return _0x14c572['set']({'withText':!0x1,'icon':_0x11186c,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary'}),_0x14c572['bind']('label')['to'](_0x578317,'isMaximized',_0x219f11=>_0x219f11?_0x4d716c:_0x26767c),_0x14c572['bind']('icon')['to'](_0x578317,'isMaximized',_0x132902=>_0x132902?_0x1423b1:_0x11186c),_0x14c572['bind']('isOn')['to'](_0x578317,'isMaximized'),_0x14c572['on']('execute',()=>{_0x578317['fire']('resizeTabs');}),_0x14c572;}function Ui(_0x4cd030){return _0x431dbf(_0x4cd030);}function Tt(_0x4b4070){return _0x21dae7(_0x4b4070);}function St(_0x5e3a88,_0x3754a6,_0xb1df39){const _0xe5f91d=null!==_0x3754a6?_0xcc388=>_0xcc388['attribs'][_0x5e3a88]===_0x3754a6:_0x1a132c=>Boolean(_0x1a132c['attribs'][_0x5e3a88]);return yt(_0x35c7ec=>_0x3810c4(_0x35c7ec)&&_0xe5f91d(_0x35c7ec),_0xb1df39);}function Ji(_0x2d02e0,_0x51762f,_0x1a4758){const _0x4a391e=null!==_0x51762f?_0x17e228=>_0x17e228['attribs'][_0x2d02e0]===_0x51762f:_0x1fc3b0=>Boolean(_0x1fc3b0['attribs'][_0x2d02e0]);return _0x343779(_0x51da6f=>_0x3810c4(_0x51da6f)&&_0x4a391e(_0x51da6f),_0x1a4758);}function At(_0x145eab,_0x28c181){return _0x145eab&&_0x3810c4(_0x145eab)?_0x145eab['attribs'][_0x28c181]:null;}function Ns(_0x4ab0cd,_0x10a4a1,_0x5e6476){_0x3810c4(_0x4ab0cd)&&(null===_0x5e6476?delete _0x4ab0cd['attribs'][_0x10a4a1]:_0x4ab0cd['attribs'][_0x10a4a1]=_0x5e6476);}function Xi(_0x1ab216,_0x4767fd,_0x284481){const _0x832b13=_0x4767fd['cloneNode'](!0x0);'beforebegin'===_0x284481?_0x5cae71(_0x1ab216,_0x832b13):'afterbegin'===_0x284481?_0x404e7d(_0x1ab216,_0x832b13):'beforeend'===_0x284481?_0x5193e3(_0x1ab216,_0x832b13):'afterend'===_0x284481&&_0x244df5(_0x1ab216,_0x832b13);}function Pi(_0x165af6){const _0x4023c6=[];let _0x31a4aa=_0x165af6;for(;_0x31a4aa;)_0x31a4aa=_0x5e3605(_0x31a4aa),_0x31a4aa&&_0x4023c6['push'](_0x31a4aa);return _0x4023c6;}function zn(_0x1cbb4a){return _0x1cbb4a['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Bs(_0x46690b){let _0x46cffb=0x0;for(;_0x46690b['parentNode'];)_0x46690b=_0x46690b['parentNode'],_0x46cffb++;return _0x46cffb;}function Us(_0x338817){const _0xd2e5e4=[];let _0x17f3bd=_0x338817['nextSibling'];for(;_0x17f3bd;)_0xd2e5e4['push'](_0x17f3bd),_0x17f3bd=_0x17f3bd['nextSibling'];_0xd2e5e4['forEach'](_0x525503=>{_0x49d15d(_0x525503);});}class qi extends/* #__PURE__ -- @preserve */
|
|
25
|
-
|
|
26
|
-
ts(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x42ce1d){super(),this['_generateUid']=_0x42ce1d||_0x4689d1;}['merge'](_0x3d0100,_0x559f2d,_0x4e4091){const _0x52ce30=_0x3d0100['cloneNode'](!0x0);if(0x0===_0x559f2d['childNodes']['length']){const _0x311bf3=[];return Ji('data-id','new-element',_0x52ce30)['forEach'](_0x4e8151=>{const _0x18fd90=this['_generateUid']();Ns(_0x4e8151,'data-id',_0x18fd90),_0x311bf3['push'](_0x18fd90);}),this['_removeSpecialComments'](_0x52ce30),{'parsedContent':_0x52ce30,'newNodeIds':_0x311bf3,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x4e4091&&_0x4e4091['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x52ce30),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Ji('data-id',null,_0x559f2d)['map'](_0x15efdb=>At(_0x15efdb,'data-id'))['filter'](_0x3464e0=>!!_0x3464e0));let _0x3740c7=-0x1,_0x29c6ec=!0x1;const _0x1431f9=_0x52ce30['childNodes'],_0x33b425=Array['from'](_0x1431f9)['filter'](_0x556aee=>!(0x3===_0x556aee['nodeType']&&''===Tt(_0x556aee)['trim']())),_0xb1b623=_0x33b425['length'];for(let _0x21f0e7=0x0;_0x21f0e7<_0xb1b623;_0x21f0e7++){const _0x15cc51=_0x33b425[_0x21f0e7],_0x517d53=_0x33b425[_0x21f0e7+0x1];if(this['_isNewNode'](_0x15cc51)){if(-0x1===_0x3740c7&&(_0x3740c7=_0x21f0e7),this['_markWrappedElements'](_0x15cc51),!this['_isNewNode'](_0x517d53)){const [_0x3b0c91,_0x526bda]=this['_findReferenceNode'](_0x15cc51,_0x29c6ec,_0x559f2d);if(_0x3b0c91){const _0x178e5d=Array['from'](_0x33b425)['slice'](_0x3740c7,_0x21f0e7+0x1);this['_insertNodes'](_0x3b0c91,_0x178e5d,_0x526bda),_0x3740c7=-0x1;}}}else{if(this['_isExistingContentComment'](_0x15cc51))_0x29c6ec=!0x0;else{if(this['_isExistingNode'](_0x15cc51)){const _0x22c022=At(_0x15cc51,'data-id');if(_0x22c022&&this['_existingDataIds']['has'](_0x22c022)){const _0x5838e2=St('data-id',_0x22c022,_0x559f2d);this['_replaceNode'](_0x5838e2,_0x15cc51);}if(this['_touchedNodesState']['removedIds']['includes'](_0x22c022)){const _0x9c630f=this['_touchedNodesState']['removedIds']['indexOf'](_0x22c022);this['_touchedNodesState']['removedIds']['splice'](_0x9c630f,0x1);}}else{if(this['_isDelNode'](_0x15cc51)){const _0xad5f20=At(_0x15cc51,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0xad5f20)||this['_storeDeletedElementIds'](_0x15cc51);}}}}}for(const _0xa348c9 of this['_touchedNodesState']['removedIds']){const _0x4b3045=St('data-id',_0xa348c9,_0x559f2d);if(_0x4b3045){if(_0x4e4091&&_0x4e4091['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0xa348c9;const _0x1bea76=_0x4e4091['replaceRemovedWith']['cloneNode'](!0x0);Ns(_0x1bea76,'data-id',_0xa348c9),Ns(_0x1bea76,'data-removed','true'),_0x591a05(_0x4b3045,_0x1bea76);}else _0x49d15d(_0x4b3045);}}if(Ji('data-wrapped-id',null,_0x559f2d)['forEach'](_0x55156f=>{const _0x3ed70e=St('data-id',At(_0x55156f,'data-wrapped-id'),_0x559f2d);var _0x333c36,_0x1ed019;_0x3ed70e&&(_0x1ed019=_0x55156f,_0x49d15d(_0x333c36=_0x3ed70e),_0x591a05(_0x1ed019,_0x333c36));}),Ji('data-id','new-element',_0x559f2d)['forEach'](_0x2c2299=>{const _0x6b0ea3=this['_getUid'](_0x2c2299);Ns(_0x2c2299,'data-id',_0x6b0ea3),this['_touchedNodesState']['newIds']['push'](_0x6b0ea3);}),this['_removeSpecialComments'](_0x559f2d),_0x4e4091&&_0x4e4091['markUnstableElements']&&this['_markUnstableElements'](_0x559f2d,_0x4e4091['markUnstableElementsDepth']||0x0),_0x4e4091&&_0x4e4091['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0xed5c60=St('data-id',this['_touchedNodesState']['lastTouchedId'],_0x559f2d);for(;_0xed5c60;)Us(_0xed5c60),_0xed5c60=_0xed5c60['parentNode'];}return{'parsedContent':_0x559f2d,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x380357,_0x529b17,_0x31d42e){for(const _0x4f6cdd of _0x529b17){const _0x47e0f4=this['_getUid'](_0x4f6cdd);Ns(_0x4f6cdd,'data-id',_0x47e0f4),this['_touchedNodesState']['newIds']['push'](_0x47e0f4),this['_touchedNodesState']['lastTouchedId']=_0x47e0f4;}const _0x232930='afterbegin'===_0x31d42e||'afterend'===_0x31d42e?_0x529b17['reverse']():_0x529b17;for(const _0x252907 of _0x232930)Xi(_0x380357,_0x252907,_0x31d42e);}['_replaceNode'](_0x249404,_0x1eb3fe){if(!_0x249404)return;if(_0xb1fb44=_0x1eb3fe,zn(Tt(_0x249404))===zn(Tt(_0xb1fb44)))return;var _0xb1fb44;const _0x1b7838=this['_getUid'](_0x249404);Ns(_0x1eb3fe,'data-id',_0x1b7838),this['_touchedNodesState']['modifiedIds']['push'](_0x1b7838),this['_touchedNodesState']['lastTouchedId']=_0x1b7838,_0x591a05(_0x249404,_0x1eb3fe['cloneNode'](!0x0));}['_findReferenceNode'](_0x1a0a8e,_0x304f87,_0xe6ff6e){const _0xcaf12b=this['_findPrevElementWithDataId'](_0x1a0a8e,!0x1);if(_0xcaf12b){const _0x111170=this['_getNodeDataId'](_0xcaf12b),_0x2d1dd2=St('data-id',_0x111170,_0xe6ff6e);if(_0x2d1dd2)return[_0x2d1dd2,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x111170);}const _0x1c1c32=this['_findNextElementWithDataId'](_0x1a0a8e,!0x1);if(_0x1c1c32){const _0x3e5504=this['_getNodeDataId'](_0x1c1c32),_0x1a4cb2=St('data-id',_0x3e5504,_0xe6ff6e);if(_0x1a4cb2)return[_0x1a4cb2,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x3e5504);}return _0x304f87?_0x1a0a8e['nextSibling']?this['_findFallbackReferenceNode'](_0x1a0a8e,_0xe6ff6e):[_0xe6ff6e['childNodes'][_0xe6ff6e['childNodes']['length']-0x1],'afterend']:[_0xe6ff6e['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0xdba70f,_0x4e5723){const _0x27d25c=[],_0xd7c84f=this['_findPrevElementWithDataId'](_0xdba70f,!0x0);if(_0xd7c84f){const _0xef6f0a=St('data-id',this['_getNodeDataId'](_0xd7c84f),_0x4e5723);_0xef6f0a&&_0x27d25c['push']([_0xef6f0a,'afterend']);}const _0x3dfa51=this['_findNextElementWithDataId'](_0xdba70f,!0x0);if(_0x3dfa51){const _0x56f077=St('data-id',this['_getNodeDataId'](_0x3dfa51),_0x4e5723);_0x56f077&&_0x27d25c['push']([_0x56f077,'beforebegin']);}if(_0x27d25c['length']>0x1)return Bs(_0x27d25c[0x0][0x0])<=Bs(_0x27d25c[0x1][0x0])?_0x27d25c[0x0]:_0x27d25c[0x1];return 0x1===_0x27d25c['length']?_0x27d25c[0x0]:[_0x4e5723['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x4d1b57,_0x3d5502){let _0x5440f9=_0x4d1b57['nextSibling'],_0x10f43c=null,_0x4694e9=!0x1;for(;_0x5440f9;){if(_0x4f0c06(_0x5440f9)){if(this['_isDelNode'](_0x5440f9)&&(_0x10f43c=_0x5440f9),this['_isExistingContentComment'](_0x5440f9)&&_0x3d5502&&!_0x4694e9){_0x4694e9=!0x0,_0x5440f9=_0x5440f9['nextSibling'];continue;}break;}const _0x3220aa=At(_0x5440f9,'data-id');if(_0x3220aa&&'new-element'!==_0x3220aa&&this['_existingDataIds']['has'](_0x3220aa)){_0x10f43c=_0x5440f9;break;}_0x5440f9=_0x5440f9['nextSibling'];}return _0x10f43c;}['_findPrevElementWithDataId'](_0x576289,_0x2aa182){let _0x33b06a=_0x576289['previousSibling'],_0x17350b=null,_0x1a535f=!0x1;for(;_0x33b06a;){if(_0x4f0c06(_0x33b06a)){if(this['_isDelNode'](_0x33b06a)&&(_0x17350b=_0x33b06a),this['_isExistingContentComment'](_0x33b06a)&&_0x2aa182&&!_0x1a535f){_0x1a535f=!0x0,_0x33b06a=_0x33b06a['previousSibling'];continue;}break;}const _0x56b8f0=At(_0x33b06a,'data-id');if(_0x56b8f0&&'new-element'!==_0x56b8f0&&this['_existingDataIds']['has'](_0x56b8f0)){_0x17350b=_0x33b06a;break;}_0x33b06a=_0x33b06a['previousSibling'];}return _0x17350b;}['_markWrappedElements'](_0x58b8e0){_0x3810c4(_0x58b8e0)&&Ji('data-id',null,_0x58b8e0)['forEach'](_0x213b52=>{this['_isExistingNode'](_0x213b52)&&!this['_hasWrappedParent'](_0x213b52)&&(Ns(_0x213b52,'data-wrapped-id',At(_0x213b52,'data-id')),Ns(_0x213b52,'data-id',null));});}['_getNodeDataId'](_0x2df00a){if(!_0x2df00a)return null;if(_0x3810c4(_0x2df00a))return At(_0x2df00a,'data-id');if(_0x4f0c06(_0x2df00a)){const _0x5da27e=Tt(_0x2df00a)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x5da27e&&_0x5da27e[0x1])return _0x5da27e[0x1];}return null;}['_storeDeletedElementIds'](_0x4f8ceb){if(_0x4f0c06(_0x4f8ceb)){const _0x3e8ce2=Tt(_0x4f8ceb)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x3e8ce2&&_0x3e8ce2[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x3e8ce2[0x1]);}}['_getUid'](_0xb00953){return this['_isExistingNode'](_0xb00953)?At(_0xb00953,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x123e06){(function(_0x5b2ddb){return _0x40d2a6(_0x55ea22=>_0x4f0c06(_0x55ea22),_0x5b2ddb,!0x0,0x1/0x0);}(_0x123e06)['filter'](_0x32b6a5=>this['_isDelNode'](_0x32b6a5)||this['_isExistingContentComment'](_0x32b6a5))['forEach'](_0x4de283=>{_0x49d15d(_0x4de283);}));}['_markLastTagElementUnstable'](_0xa2e3bd){const _0x25f2be=_0xa2e3bd['childNodes'],_0x3889a6=_0x25f2be[_0x25f2be['length']-0x1];_0x3889a6&&_0x3810c4(_0x3889a6)&&Ns(_0x3889a6,'data-unstable','true');}['_markUnstableElements'](_0x383e89,_0x30dd2f){const _0x14cbf5=St('data-unstable','true',_0x383e89);if(!_0x14cbf5)return;const _0x46d6f0=Pi(_0x14cbf5)['slice'](0x0,-0x1),_0x275cd6=_0x46d6f0['length'];let _0x5376cb=_0x14cbf5;if(_0x275cd6>_0x30dd2f){let _0x573ac1=_0x275cd6,_0x59a97b=null;for(;_0x573ac1>_0x30dd2f&&_0x573ac1>=0x0;)_0x573ac1--,_0x59a97b=_0x46d6f0[_0x573ac1];_0x59a97b&&(_0x5376cb=_0x59a97b,Ns(_0x14cbf5,'data-unstable',null),Ns(_0x59a97b,'data-unstable','true'));}else{if(_0x275cd6<_0x30dd2f){let _0x18d2c1=_0x275cd6,_0x1f588b=_0x14cbf5;for(;_0x18d2c1<_0x30dd2f;){const _0x3f834e=_0x1f588b['childNodes']['filter'](_0x564b60=>_0x3810c4(_0x564b60));if(0x0===_0x3f834e['length'])break;_0x18d2c1++,_0x1f588b=_0x3f834e[_0x3f834e['length']-0x1];}_0x1f588b&&(_0x5376cb=_0x1f588b,Ns(_0x14cbf5,'data-unstable',null),Ns(_0x1f588b,'data-unstable','true'));}}let _0x40141a=_0x5376cb;for(;_0x40141a;){for(;_0x40141a['nextSibling'];)_0x40141a=_0x40141a['nextSibling'],_0x3810c4(_0x40141a)&&Ns(_0x40141a,'data-unstable','true');_0x40141a=_0x40141a['parentNode'];}}['_isNewNode'](_0x28ec6f){return Boolean('new-element'===At(_0x28ec6f,'data-id'));}['_isExistingNode'](_0x13309b){return Boolean((At(_0x13309b,'data-id')||'')['length']>0x0&&'new-element'!==At(_0x13309b,'data-id'));}['_isDelNode'](_0xbdebcd){return!!_0xbdebcd&&Boolean(_0x4f0c06(_0xbdebcd)&&Tt(_0xbdebcd)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x306a86){let _0x4d0532=_0x306a86['parentNode'];for(;_0x4d0532;){if(At(_0x4d0532,'data-wrapped-id'))return!0x0;_0x4d0532=_0x4d0532['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x177528){return Boolean(_0x4f0c06(_0x177528)&&Tt(_0x177528)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function J({editor:_0xfdb10e,changeGroups:_0x29bc1d,documentContextContent:_0x1f61df,showDiff:_0x170a5a,trimUnchanged:_0x1557ba=!0x0}){return _0x29bc1d['map'](_0x2a5855=>{const _0xb25343=new Et([]),_0x1f0900=new Et([]);for(const _0x958c9 of _0x2a5855['changes'])if(_0x170a5a&&'removed'==_0x958c9['type']||_0x1f0900['children']['push'](_0x958c9['node']['cloneNode'](!0x0)),'new'!=_0x958c9['type']&&(_0x170a5a||'removed'!=_0x958c9['type'])){const _0x2aa60e=yt(_0x51cf77=>At(_0x51cf77,'data-id')==_0x958c9['id'],_0x1f61df,!0x0);_0x2aa60e&&_0xb25343['children']['push'](_0x2aa60e['cloneNode'](!0x0));}const {content:_0xa61ffa,hasChanges:_0x389f28}=function(_0x3552f7,_0x1ac8f8,_0x4f295e,_0x331110,_0x10595f=!0x0){const _0x2ef9ee=_0x3552f7['plugins']['get']('DocumentCompare'),_0x43aa35=Tt(_0x1ac8f8),_0x349726=Tt(_0x4f295e),_0x76bd8d=_0x3552f7['data']['parse'](_0x43aa35,'$root'),_0x5c07fd=_0x3552f7['model']['createPositionAt'](_0x76bd8d,0x0),_0x3ef8ba=_0x2ef9ee['getDiff'](_0x43aa35,_0x349726,{'anchor':_0x5c07fd,'markDeletions':_0x331110}),_0x2a714b=_0x3ef8ba['getOperations']();if(0x0==_0x2a714b['length'])return{'content':_0x1ac8f8['cloneNode'](!0x0),'hasChanges':!0x1};_0x331110?function(_0x37f37e,_0x4ea974,_0x522572){if(0x0==_0x37f37e['length'])return;const _0x4703a6=_0x522572['plugins']['get']('DocumentCompare'),_0x37e4db=_0x522572['plugins']['get']('SuggestionsConversion');_0x522572['model']['change'](_0x3ac1ef=>{const _0x83c767=new Set();for(let _0x3c1fcc=0x0;_0x3c1fcc<_0x37f37e['length'];_0x3c1fcc++){const _0x275bc2=_0x37f37e[_0x3c1fcc];if(_0x275bc2['baseVersion']=null,_0x275bc2['isDocumentOperation']=!0x1,_0x4703a6['isMarkedRemoveOperation'](_0x275bc2)){const _0x114a21=_0x540d79(_0x275bc2['newRange'],_0x522572['model']),_0x14b7f0='suggestion:deletion:'+_0x4689d1()+':$aiSuggestion';_0x4ea974['markers']['set'](_0x14b7f0,_0x114a21);}else switch(_0x275bc2['type']){case'rename':{if(_0x275bc2['oldName']==_0x275bc2['newName'])break;_0x3ac1ef['batch']['addOperation'](_0x275bc2),_0x522572['model']['applyOperation'](_0x275bc2);const _0x407ed2='$elementName',_0x521e35=_0x275bc2['position'],_0x178ec1=_0x522572['model']['createRange'](_0x521e35,_0x522572['model']['createPositionAt'](_0x521e35['nodeAfter'],'end')),_0x29a859='suggestion:attribute:'+_0x407ed2+':'+_0x4689d1()+':$aiSuggestion';_0x4ea974['markers']['set'](_0x29a859,_0x178ec1);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x275bc2['oldValue']==_0x275bc2['newValue'])break;_0x3ac1ef['batch']['addOperation'](_0x275bc2),_0x522572['model']['applyOperation'](_0x275bc2);const _0x59a282=_0x275bc2['key'];if(!_0x37e4db['isRegisteredAttribute'](_0x59a282))break;const _0x12754f=_0x540d79(_0x275bc2['range'],_0x522572['model']),_0x560c3e='suggestion:attribute:'+_0x59a282+':'+_0x4689d1()+':$aiSuggestion';_0x4ea974['markers']['set'](_0x560c3e,_0x12754f);break;}case'insert':{_0x3ac1ef['batch']['addOperation'](_0x275bc2),_0x522572['model']['applyOperation'](_0x275bc2);if(_0x37f37e[_0x3c1fcc+0x1]&&'move'==_0x37f37e[_0x3c1fcc+0x1]['type']){no(_0x4ea974,_0x275bc2);break;}const _0x5928b0=_0x275bc2['position'],_0x353422=_0x275bc2['howMany'],_0x43053a=_0x540d79(_0x522572['model']['createRange'](_0x5928b0,_0x5928b0['getShiftedBy'](_0x353422)),_0x522572['model']),_0x30afd4='suggestion:insertion:'+_0x4689d1()+':$aiSuggestion';_0x4ea974['markers']['set'](_0x30afd4,_0x43053a);break;}case'split':{_0x3ac1ef['batch']['addOperation'](_0x275bc2),_0x522572['model']['applyOperation'](_0x275bc2);const _0x1c506d=_0x275bc2['splitPosition'],_0x32948d=_0x275bc2['moveTargetPosition'],_0xb81d37=_0x522572['model']['createRange'](_0x1c506d,_0x32948d),_0x184660='suggestion:insertion:'+_0x4689d1()+':$aiSuggestion';_0x4ea974['markers']['set'](_0x184660,_0xb81d37);break;}case'move':{_0x3ac1ef['batch']['addOperation'](_0x275bc2),_0x522572['model']['applyOperation'](_0x275bc2),_0x37f37e[_0x3c1fcc-0x1]&&'insert'==_0x37f37e[_0x3c1fcc-0x1]['type']&&no(_0x4ea974,_0x275bc2);const _0x3fb98b=_0x275bc2['getMovedRangeStart'](),_0x5c31a1=_0x275bc2['howMany'];for(let _0x99f4f4=0x0;_0x99f4f4<_0x5c31a1;_0x99f4f4++){const _0x535429=_0x3fb98b['getShiftedBy'](_0x99f4f4)['nodeAfter'];_0x83c767['add'](_0x535429);}break;}case'remove':{const _0xf5f2fc=_0x275bc2['sourcePosition'],_0xfe94c6=_0x275bc2['howMany'],_0x5cd221=new et(_0xf5f2fc,_0xfe94c6);_0x3ac1ef['batch']['addOperation'](_0x5cd221),_0x522572['model']['applyOperation'](_0x5cd221);break;}}}for(const _0x2986a0 of _0x83c767){const _0x2ed97e=_0x522572['model']['createRangeOn'](_0x2986a0),_0x112095='suggestion:formatBlock:$fakeWrap:'+_0x4689d1()+':$aiSuggestion';_0x4ea974['markers']['set'](_0x112095,_0x540d79(_0x2ed97e,_0x522572['model']));}});}(_0x2a714b,_0x76bd8d,_0x3552f7):_0x3552f7['model']['change'](_0x20238e=>{for(const _0x4dfcbe of _0x2a714b)if('remove'==_0x4dfcbe['type']){const _0x45feb8=_0x4dfcbe['sourcePosition'],_0x538f2a=_0x4dfcbe['howMany'],_0x7142c4=new et(_0x45feb8,_0x538f2a);_0x20238e['batch']['addOperation'](_0x7142c4),_0x3552f7['model']['applyOperation'](_0x7142c4);}else{if('marker'==_0x4dfcbe['type']){const _0x514cec=_0x4dfcbe['name'],_0x3a3ca8=_0x4dfcbe['newRange'];null!==_0x3a3ca8?_0x76bd8d['markers']['set'](_0x514cec,_0x3a3ca8):_0x76bd8d['markers']['delete'](_0x514cec);}else _0x4dfcbe['baseVersion']=null,_0x4dfcbe['isDocumentOperation']=!0x1,_0x20238e['batch']['addOperation'](_0x4dfcbe),_0x3552f7['model']['applyOperation'](_0x4dfcbe);}});if(_0x10595f){const _0x1d3e4e=mt(_0x3552f7,_0x2a714b,_0x76bd8d);ft(_0x3552f7['model'],_0x1d3e4e),function(_0x3e4eac,_0x2eea07){const _0x2f4897=_0x2eea07['getFirstRange']()['start'];let _0x57753c=_0x2eea07['getFirstRange']()['end'];const _0x5e1206=_0x2f4897['root'];(_0x57753c['textNode']||_0x57753c['nodeAfter']&&_0x57753c['nodeAfter']['is']('$text'))&&(_0x2c3f7b(_0x57753c,'...'),_0x57753c=_0x57753c['getShiftedBy'](0x3)),(_0x2f4897['textNode']||_0x2f4897['nodeBefore']&&_0x2f4897['nodeBefore']['is']('$text'))&&(_0x2c3f7b(_0x2f4897,'...'),function(_0x199d16,_0xf2f082,_0x374331){for(let [_0x5be836,_0xc13603]of _0x199d16['markers']){const _0x5e0685=_0xc13603['_getTransformedByInsertion'](_0xf2f082,_0x374331,!0x1);_0xc13603=_0x5e0685[0x0],_0x199d16['markers']['set'](_0x5be836,_0xc13603);}}(_0x5e1206,_0x2f4897,0x3),_0x2f4897['parent']==_0x57753c['parent']&&(_0x57753c=_0x57753c['getShiftedBy'](0x3)));const _0x3d0c33=_0x3e4eac['createRange'](_0x3e4eac['createPositionAt'](_0x5e1206,0x0),_0x2f4897),_0x514be8=_0x3e4eac['createRange'](_0x57753c,_0x3e4eac['createPositionAt'](_0x5e1206,'end')),_0x50d8ae=[..._0x3d0c33['getMinimalFlatRanges'](),..._0x514be8['getMinimalFlatRanges']()];_0x50d8ae['reverse']();for(const _0x3f97a4 of _0x50d8ae)to(_0x3f97a4),Jn(_0x5e1206,_0x3f97a4);}(_0x3552f7['model'],_0x1d3e4e);}const _0x54f665=_0x3552f7['data']['stringify'](_0x76bd8d,{'showSuggestionHighlights':!0x0});return{'content':Ui(_0x54f665),'hasChanges':!0x0};}(_0xfdb10e,_0xb25343,_0x1f0900,_0x170a5a,_0x1557ba);return{'type':_0x2a5855['changes'][0x0]['type'],'index':_0x2a5855['index'],'content':_0xa61ffa,'hasChanges':_0x389f28};});}function no(_0x102832,_0xb25437){for(const [_0x146d65,_0x1b6415]of _0x102832['markers']){const _0x1ecb37=it['_createFromRanges'](_0x1b6415['getTransformedByOperation'](_0xb25437));_0x102832['markers']['set'](_0x146d65,_0x1ecb37);}}function mt(_0x5c0040,_0xc3322,_0x59641c){const _0x5624c3=_0x5c0040['plugins']['get']('DocumentCompare');let _0x2d230a=_0x5c0040['model']['createPositionAt'](_0x59641c,Number['POSITIVE_INFINITY']),_0xffe0d9=_0x5c0040['model']['createPositionAt'](_0x59641c,0x0);for(const _0x11a4d2 of _0xc3322){let _0x552fb8,_0x4f9cd3;if(_0x5624c3['isMarkedRemoveOperation'](_0x11a4d2))_0x552fb8=_0x11a4d2['newRange']['start'],_0x4f9cd3=_0x11a4d2['newRange']['end'];else switch(_0x2d230a=_0x2d230a['getTransformedByOperation'](_0x11a4d2),_0xffe0d9=_0xffe0d9['getTransformedByOperation'](_0x11a4d2),_0x11a4d2['type']){case'rename':_0x552fb8=_0x11a4d2['position'],_0x4f9cd3=_0x552fb8['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x552fb8=_0x11a4d2['range']['start'],_0x4f9cd3=_0x11a4d2['range']['end'];break;case'insert':_0x552fb8=_0x11a4d2['position'],_0x4f9cd3=_0x552fb8['getShiftedBy'](_0x11a4d2['howMany']);break;case'split':_0x552fb8=_0x11a4d2['splitPosition'],_0x4f9cd3=_0x11a4d2['moveTargetPosition'];break;case'merge':{const _0x3bb117=_0x11a4d2['targetPosition']['path']['slice'](0x0,-0x1);_0x552fb8=_0x5c0040['model']['createPositionFromPath'](_0x59641c,_0x3bb117),_0x4f9cd3=_0x552fb8['getShiftedBy'](0x1);break;}case'remove':{const _0x455727=_0x11a4d2['howMany'],_0xf48e06=_0x11a4d2['sourcePosition']['_getTransformedByInsertion'](_0x11a4d2['targetPosition'],_0x455727),_0x5dc762=_0x11a4d2['getMovedRangeStart']();'remove'==_0x11a4d2['type']?(_0x552fb8=_0xf48e06,_0x4f9cd3=_0xf48e06):(_0x552fb8=_0x5dc762,_0x4f9cd3=_0x5dc762['getShiftedBy'](_0x455727));break;}}_0x552fb8&&_0x552fb8['isBefore'](_0x2d230a)&&(_0x2d230a=_0x552fb8['clone'](),_0x2d230a['stickiness']='toNone'),_0x4f9cd3&&_0x4f9cd3['isAfter'](_0xffe0d9)&&(_0xffe0d9=_0x4f9cd3['clone'](),_0xffe0d9['stickiness']='toNone');}return _0x5c0040['model']['createSelection'](_0x5c0040['model']['createRange'](_0x2d230a,_0xffe0d9));}function ft(_0x1689c9,_0x156f4a){ro(_0x1689c9,_0x156f4a,'forward');const _0x5a91b7=_0x156f4a['getFirstRange']();_0x156f4a['setTo']([]),_0x156f4a['setTo'](_0x5a91b7,{'backward':!0x0}),ro(_0x1689c9,_0x156f4a,'backward');}function ro(_0x9cc27e,_0x374e51,_0x19e462){let _0x9f756e=0x14;for(;_0x9f756e;){_0x9cc27e['modifySelection'](_0x374e51,{'unit':'word','direction':_0x19e462}),_0x9f756e--;const _0x1bfdbe=_0x374e51['focus']['forward'==_0x19e462?'nodeBefore':'nodeAfter'];if(_0x1bfdbe&&_0x1bfdbe['is']('element')&&_0x9cc27e['schema']['isBlock'](_0x1bfdbe)&&_0x9cc27e['schema']['isObject'](_0x1bfdbe))break;}}function Jn(_0x2ceee5,_0x14054d){for(const [_0x3ce868,_0x5853]of _0x2ceee5['markers']){const _0x2ddfc5=_0x5853['_getTransformedByDeletion'](_0x14054d['start'],_0x14054d['end']['offset']-_0x14054d['start']['offset']);null!=_0x2ddfc5?_0x2ceee5['markers']['set'](_0x3ce868,_0x2ddfc5):_0x2ceee5['markers']['delete'](_0x3ce868);}}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:_0x1bd505,content:_0xd2b75='',isDone:_0x4d87e0=!0x1,interactionId:_0x39aa49,areActionsDisabled:_0x5a72ea,documentContextContent:_0x1e978e,editor:_0x23f3c3,id:_0x17822d}){super(),this['id']=_0x17822d||_0x4689d1(),this['interactionId']=_0x39aa49,this['type']=_0x1bd505,this['areActionsDisabled']=!!_0x5a72ea,this['editor']=_0x23f3c3,this['aiResponseParser']=new qi(),this['aiResponseApplier']=new zi(),this['documentContextContent']=Ui(_0x1e978e||''),this['set']('isDone',_0x4d87e0),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0xd2b75);}['appendContent'](_0x4b2471){this['set']('content',this['content']+_0x4b2471);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x45aae2,_0x2ba581){this['changeGroups'][_0x45aae2]['state']=_0x2ba581,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x45aae2,'state':_0x2ba581});}['getContentParts']({showDiff:_0x580157,groupIndex:_0x3f6c00}){if(!this['editor'])throw new _0x70c77e('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x14794d=this['_getCachedContentParts'](_0x580157,_0x3f6c00);if(_0x14794d)return _0x14794d;let _0x291d9=[];if(void 0x0===_0x3f6c00)_0x291d9=this['changeGroups'];else{const _0x370b06=this['changeGroups']['find'](({index:_0x4aeafb})=>_0x4aeafb===_0x3f6c00);if(!_0x370b06)throw new _0x70c77e('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x3f6c00});_0x291d9=[_0x370b06];}const _0x3a9546=J({'editor':this['editor'],'showDiff':_0x580157,'changeGroups':_0x291d9,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x580157,_0x3a9546),_0x3a9546;}['_getCachedContentParts'](_0x4edac5,_0x3a8e95){const _0x8c8e52=_0x4edac5?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x8c8e52]['length'])return null;const _0x35aa7f=this['cachedSuggestionContentParts'][_0x8c8e52];if(void 0x0===_0x3a8e95)return _0x35aa7f['length']>0x0&&_0x35aa7f['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x4edac5,null),null):_0x4c6283(_0x35aa7f);{const _0x2d7482=_0x35aa7f['find'](({index:_0x359177})=>_0x359177===_0x3a8e95);if(_0x2d7482)return[_0x4c6283(_0x2d7482)];}return null;}['_setCachedContentParts'](_0x590b38,_0x30c82d){const _0xc38f97=_0x590b38?'withDiff':'withoutDiff';_0x30c82d?_0x30c82d['forEach'](_0x1a3221=>{const _0x3d73ab=this['cachedSuggestionContentParts'][_0xc38f97],_0x5d7160=_0x3d73ab['find'](({index:_0x210d42})=>_0x210d42===_0x1a3221['index']);if(_0x5d7160){const _0x1e6471=_0x3d73ab['indexOf'](_0x5d7160);_0x3d73ab['splice'](_0x1e6471,0x1,_0x1a3221);}else _0x3d73ab['push'](_0x1a3221);}):this['cachedSuggestionContentParts'][_0xc38f97]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x53cb25=this['changeGroups'];this['updateChangeGroups']();const _0x456501=this['_getDifferentChangeGroups'](_0x53cb25,this['changeGroups']);(_0x456501['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x456501),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0xe4df52,_0x487621){const _0x411e84=[];for(const _0x187eb0 of _0x487621){const _0x3faef4=_0xe4df52[_0x187eb0['index']];_0x3faef4?_0x3faef4['changes']['length']!==_0x187eb0['changes']['length']?_0x411e84['push'](_0x187eb0):_0x3faef4['changes']['forEach']((_0xec44cd,_0x86545b)=>{const _0x824b4a=_0x187eb0['changes'][_0x86545b];_0xec44cd['id']!==_0x824b4a['id']&&_0x411e84['push'](_0x187eb0);}):_0x411e84['push'](_0x187eb0);}return _0x411e84;}['updateChangeGroups'](){const _0x389c28=new _0x29a7aa('p',{},[new _0x29a7aa('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x5a5d84(i(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x2e060d=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x389c28,'cutAfterLastChange':!this['isDone']});if(!_0x2e060d['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x2e060d['parsedContent'];let _0x23e30d=[];if(_0x343779(_0x6e379c=>{const _0x6d531d=At(_0x6e379c,'data-id');if(!_0x6d531d||!_0x16d811(_0x6d531d))return!0x1;const _0x116298=[_0x6e379c,...Pi(_0x6e379c)]['at'](-0x2);if(_0x6e379c!=_0x116298){const _0x3afbba=At(_0x116298,'data-id');_0x16d811(_0x3afbba)||(_0x23e30d['push']({'node':_0x116298,'id':_0x3afbba,'type':'modified'}),_0x2e060d['modifiedNodeIds']['push'](_0x3afbba));}else _0x2e060d['modifiedNodeIds']['includes'](_0x6d531d)?_0x23e30d['push']({'node':_0x6e379c,'type':'modified','id':_0x6d531d}):_0x2e060d['newNodeIds']['includes'](_0x6d531d)?_0x23e30d['push']({'node':_0x6e379c,'type':'new','id':_0x6d531d,'anchorId':At(_0x6e379c['previousSibling'],'data-id')}):_0x23e30d['push']({'node':_0x6e379c,'type':'removed','id':_0x6d531d});return!0x0;},this['parsedMergedContent']),_0x23e30d=_0x23e30d['filter'](({node:_0x429b0d})=>[...Pi(_0x429b0d),_0x429b0d]['every'](_0x400de6=>!At(_0x400de6,'data-unstable'))),0x0==_0x23e30d['length'])return;const _0x56bbbf=[[_0x23e30d[0x0]]];for(let _0x278781=0x1;_0x278781<_0x23e30d['length'];_0x278781++){const _0xcf4ea2=_0x56bbbf[_0x56bbbf['length']-0x1],_0x411a66=_0xcf4ea2[_0xcf4ea2['length']-0x1];_0x23e30d[_0x278781]['node']['previousSibling']==_0x411a66['node']&&'modified'!=_0x23e30d[_0x278781]['type']&&'modified'!=_0x411a66['type']?_0xcf4ea2['push'](_0x23e30d[_0x278781]):_0x56bbbf['push']([_0x23e30d[_0x278781]]);}for(const _0x5bbfb4 of _0x56bbbf){const _0x310dcb=_0x5bbfb4[0x0],_0x5db862=_0x5bbfb4[_0x5bbfb4['length']-0x1],_0x323b0a=_0x50fdf8(_0x310dcb['node']['previousSibling']);_0x323b0a&&_0x5bbfb4['unshift'](_0x323b0a);const _0x4dc8ee=_0x50fdf8(_0x5db862['node']['nextSibling']);_0x4dc8ee&&_0x5bbfb4['push'](_0x4dc8ee);}function _0x16d811(_0x288a12){return _0x2e060d['modifiedNodeIds']['includes'](_0x288a12)||_0x2e060d['newNodeIds']['includes'](_0x288a12)||_0x2e060d['removedNodeIds']['includes'](_0x288a12);}function _0x50fdf8(_0x487be8){if(_0x487be8&&At(_0x487be8,'data-id')&&!At(_0x487be8,'data-unstable')){const _0x4187b6=At(_0x487be8,'data-id');if(!_0x16d811(_0x4187b6))return{'node':_0x487be8,'type':'context','id':_0x4187b6};}return null;}this['changeGroups']=_0x56bbbf['map']((_0x3abd9c,_0x59307d)=>({'changes':_0x3abd9c,'state':'pending','index':_0x59307d}));}}const ze=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class Fe extends _0x5d9d11(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x432840,editor:_0x5f38fd}){super(),this['id']=_0x4689d1(),this['connector']=_0x432840,this['isStopped']=!0x0,this['editor']=_0x5f38fd;}async['start'](){const _0x5421e2=[];let _0x8bebbf,_0x47f45b,_0x8e75d9;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x119b0d=await this['currentRequest']['getStream']();for await(const _0xb572ba of _0x119b0d){if(this['isStopped'])return;if('error'==_0xb572ba['event'])return void this['fire']('error',{'error':new _0x70c77e('ai-chat-interaction-error',this)});switch(_0xb572ba['event']){case'message-metadata':this['messageId']=_0xb572ba['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0xb572ba['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0xb572ba['data']['conversationTitle'],!0x0);break;case'source':_0x5421e2['push'](_0xb572ba['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'](),_0x8bebbf='modification-delta'==_0xb572ba['event']?'modification':'text',_0x47f45b='modification-delta'==_0xb572ba['event']?_0xb572ba['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x8bebbf&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x8bebbf,'interactionId':this['id'],'id':_0x47f45b}),'modification'==_0x8bebbf&&(this['currentReply']['sources']=_0x5421e2['splice'](0x0))),this['currentReply']['appendContent'](_0xb572ba['data']['textDelta']);break;case'mcp-tool-result':_0x8e75d9=JSON['parse'](_0xb572ba['data']['result']),this['_handleToolResultData']({'toolName':_0xb572ba['data']['toolName'],'data':_0x8e75d9['data'],'attributes':_0x8e75d9['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0xb572ba['data']['toolName'],'data':_0xb572ba['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x5421e2['length']>0x0&&(this['currentReply']['sources']=_0x5421e2['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x4b1874){return this['replies']['find'](_0x53ec34=>_0x53ec34['id']===_0x4b1874);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x1899fe=>_0x1899fe['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x596923){const _0x64e6c4=new He({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x596923});return this['replies']['push'](_0x64e6c4),_0x64e6c4['delegate'](...ze)['to'](this),this['fire']('replyCreated',_0x64e6c4),_0x64e6c4;}['setConversationTitle'](_0x3518c8,_0x4a786c=!0x1){this['fire']('setConversationTitle',_0x3518c8,_0x4a786c);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x1290d0){this['fire']('toolDataReceived',{'type':'result','toolName':_0x1290d0['toolName'],'data':structuredClone(_0x1290d0['data']||{}),'attributes':structuredClone(_0x1290d0['attributes']||{})},this);}['_handleToolNotificationData'](_0x1caab8){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x1caab8['toolName'],'data':structuredClone(_0x1caab8['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(_0x376468){return _0x376468['TOOL']='mcp-tool-context',_0x376468['FILE']='file',_0x376468['DOCUMENT']='document',_0x376468['URL']='web-resource',_0x376468['TEXT']='text',_0x376468['SELECTION']='selection',_0x376468;}({}),Oe=function(_0x4e32f5){return _0x4e32f5['TEXT']='text',_0x4e32f5['MARKDOWN']='markdown',_0x4e32f5['HTML']='html',_0x4e32f5;}({});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:_0xa3c67,config:_0x57c96b,ownerId:_0xa0ead4}){super(),this['_connector']=_0xa3c67,this['_config']=_0x57c96b,this['_ownerId']=_0xa0ead4;}['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'](_0x1eff92){const _0x67be78=await this['_createContextItemFromContent'](_0x1eff92);return this['_addToConversationContextItem'](_0x67be78),'current-document'===_0x67be78['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x67be78;}async['_createContextItemFromContent'](_0x3603ba){if(_0x3603ba['type']===Be['DOCUMENT']){const _0x45473=await this['_connector']['fetchDocument'](this['_ownerId'],_0x3603ba['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x3603ba['type'],'content':_0x45473['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x45473['attributes']?.['version'],'sessionId':_0x45473['attributes']?.['sessionId']};}if(_0x3603ba['type']===Be['TOOL'])return{'id':_0x3603ba['id'],'uiId':_0x3603ba['id'],'label':_0x3603ba['data']?.['label']||_0x3603ba['id'],'type':Be['TOOL'],'mcpServerName':_0x3603ba['mcpServerName'],'toolName':_0x3603ba['toolName'],'data':_0x3603ba['data']||{}};return{'id':_0x3603ba['id'],'uiId':_0x3603ba['id'],'label':_0x3603ba['attributes']?.['label']||_0x3603ba['name']||_0x3603ba['url']||_0x3603ba['id'],'type':_0x3603ba['type'],..._0x3603ba?.['attributes']?.['resourceId']?{'resourceId':_0x3603ba['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x32909b){const _0x5b3905=this['_pendingContextItems']['get'](_0x32909b);_0x5b3905?.['isReadOnly']||this['_removeContextItem'](_0x32909b);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x224355 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x224355['uiId']);const _0x21a9f7=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x21a9f7&&this['_addContextItem']({..._0x21a9f7,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x2f95e0){for(const _0x384c7b of _0x2f95e0['values']())this['_addToConversationContextItem'](_0x384c7b);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'](_0x1f4944){return Array['from'](_0x1f4944['values']())['map'](_0x546f79=>this['_mapContextItemToRequestData'](_0x546f79))['filter'](_0x47b907=>null!==_0x47b907);}async['addFilesToContext'](_0x57a548,_0x29ee74,_0x433c26=Be['FILE']){const _0x484815='files-'+_0x4689d1();this['_startUploadOperation'](_0x484815);try{await Promise['all'](_0x57a548['map'](async _0x320fa4=>{const _0x1d5ae8='file-'+_0x4689d1(),_0x2690d5=_0x32cd9f(_0x320fa4['name']);try{this['_addContextItem']({'type':_0x433c26,'label':_0x29ee74?.['label']||_0x2690d5,'uiId':_0x1d5ae8,'resourceId':_0x29ee74?.['resourceId']},!0x0);const _0x167af5=this['_connector']['uploadFile'](this['_ownerId'],_0x320fa4,_0x29ee74);this['_ongoingUploads']['set'](_0x1d5ae8,_0x167af5['abortController']);const {id:_0x40d43e}=await _0x167af5['getId']();this['_ongoingUploads']['delete'](_0x1d5ae8),this['_finishContextItemLoading']({'type':_0x433c26,'id':_0x40d43e,'label':_0x29ee74?.['label']||_0x2690d5,'uiId':_0x1d5ae8,'resourceId':_0x29ee74?.['resourceId']},!0x1);}catch(_0x4bf1a6){this['_ongoingUploads']['delete'](_0x1d5ae8);if(!(_0x4bf1a6 instanceof _0x70c77e&&_0x4bf1a6['message']['startsWith']('ai-request-aborted'))){const _0x545754=$e['get'](_0x4bf1a6['code'])||'ai-chat-file-upload-failed',_0x43695f=new _0x70c77e(_0x545754,null,{'fileName':_0x2690d5,..._0x4bf1a6});_0x43695f['stack']=_0x4bf1a6['stack'],this['fire']('error',{'error':_0x43695f});}this['_removeContextItem'](_0x1d5ae8);}}));}finally{this['_finishUploadOperation'](_0x484815);}}['addCurrentDocumentToContext'](_0x4e4539){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x5e872b={'type':Be['DOCUMENT'],'uiId':'current-document','label':_0x4e4539,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x5e872b);}async['updateCurrentDocument'](_0xdd7ff7,_0x2f543c,_0x2456e9,_0xefa2c9){const _0x55023c=this['_pendingContextItems']['get']('current-document');if(_0x55023c&&_0xdd7ff7){_0x55023c['selection']=_0xefa2c9?_0xefa2c9['map'](_0x4e8399=>({'start':_0x4e8399['start'],'end':_0x4e8399['end']})):[];try{if(_0x55023c['version']===_0x2f543c)return;const {id:_0x112982}=await this['_connector']['uploadDocument'](this['_ownerId'],_0xdd7ff7,{'version':_0x2f543c,'sessionId':_0x2456e9})['getId']();_0x55023c['id']=_0x112982,_0x55023c['content']=_0xdd7ff7,_0x55023c['version']=_0x2f543c,_0x55023c['sessionId']=_0x2456e9;}catch(_0x154d42){const _0x88fd13=new _0x70c77e('ai-chat-document-upload-failed',null);_0x88fd13['stack']=_0x154d42['stack'],this['fire']('error',{'error':_0x88fd13});}}}['addSelectionToContext'](_0x3afd15){this['_addContextItem']({'type':Be['SELECTION'],'label':_0x3afd15,'uiId':'selection','content':_0x3afd15});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x1bebae,_0x516e18){const _0x20da5b='url-'+_0x4689d1();this['_startUploadOperation'](_0x20da5b);const _0x71c9c4='url-'+_0x4689d1();try{this['_addContextItem']({'type':Be['URL'],'label':_0x516e18?.['label']||_0x1bebae,'uiId':_0x71c9c4,'resourceId':_0x516e18?.['resourceId']},!0x0);const _0x10f8d2=this['_connector']['uploadUrl'](this['_ownerId'],_0x1bebae,_0x516e18);this['_ongoingUploads']['set'](_0x71c9c4,_0x10f8d2['abortController']);const {id:_0xd507d3}=await _0x10f8d2['getId']();this['_ongoingUploads']['delete'](_0x71c9c4),this['_finishContextItemLoading']({'type':Be['URL'],'id':_0xd507d3,'label':_0x516e18?.['label']||_0x1bebae,'uiId':_0x71c9c4,'resourceId':_0x516e18?.['resourceId']},!0x1);}catch(_0x184885){this['_ongoingUploads']['delete'](_0x71c9c4),(_0x184885['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x70c77e('ai-chat-url-upload-failed',this,{'url':_0x1bebae,'originalError':_0x184885}),'url':_0x1bebae}),this['_removeContextItem'](_0x71c9c4));}finally{this['_finishUploadOperation'](_0x20da5b);}}['addToolItemToContext'](_0xb074b4){_0xb074b4['id']=_0xb074b4['id']??_0x4689d1()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0xb074b4['uiId'],_0xb074b4),this['fire']('contextItemAdded',{'contextItem':_0xb074b4,'isLoading':!0x1});}async['loadSourceResources'](_0x551160,_0x3b82ba,_0x3dfc11){const _0x9ad021=this['_addContextOptionsState']['sources']['find'](_0x5ce04f=>_0x5ce04f['id']===_0x551160);if(!_0x9ad021)return this['fire']('error',{'error':new _0x70c77e('ai-chat-source-not-found',this,{'sourceId':_0x551160}),'sourceId':_0x551160}),[];try{const _0x5af4e4=(await _0x9ad021['getResources'](_0x3b82ba))['map'](_0x361f98=>{const _0x4eaf22=this['_isResourceInContext'](_0x361f98['id']);return{..._0x361f98,'isInContext':_0x4eaf22};});return _0x9ad021['resources']=_0x5af4e4,this['fire']('sourceResourcesLoaded',{'sourceId':_0x551160,'source':_0x9ad021,'resources':_0x5af4e4,'uid':_0x3dfc11}),_0x5af4e4;}catch(_0x492a44){return this['fire']('error',{'error':new _0x70c77e('ai-chat-source-resources-load-failed',this,{'sourceId':_0x551160,'originalError':_0x492a44}),'sourceId':_0x551160,'sourceLabel':_0x9ad021['label']}),[];}}async['addResourceToContext'](_0x24fcd0,_0x2a288b){if(this['_isResourceInContext'](_0x2a288b['id']))return;let _0x21b2af=_0x2a288b['data'];if(!_0x21b2af&&_0x24fcd0['getData'])try{_0x21b2af=await _0x24fcd0['getData'](_0x2a288b['id']);}catch(_0x22b8c8){return void this['fire']('error',{'error':new _0x70c77e('ai-chat-resource-load-failed',this,{'resourceId':_0x2a288b['id'],'sourceId':_0x24fcd0['id'],'originalError':_0x22b8c8}),'resourceId':_0x2a288b['id'],'sourceId':_0x24fcd0['id']});}if(_0x21b2af)switch(_0x2a288b['type']){case Be['URL']:if('string'!=typeof _0x21b2af)return void this['fire']('error',{'error':new _0x70c77e('ai-chat-context-invalid-data',this,{'resourceId':_0x2a288b['id'],'sourceId':_0x24fcd0['id'],'expectedType':'string','actualType':typeof _0x21b2af}),'resourceId':_0x2a288b['id'],'sourceId':_0x24fcd0['id']});await this['addUrlToContext'](_0x21b2af,{'label':_0x2a288b['label'],'resourceId':_0x2a288b['id']});break;case Be['FILE']:if(!(_0x21b2af instanceof File))return void this['fire']('error',{'error':new _0x70c77e('ai-chat-context-invalid-data',this,{'resourceId':_0x2a288b['id'],'sourceId':_0x24fcd0['id'],'expectedType':'File','actualType':typeof _0x21b2af}),'resourceId':_0x2a288b['id'],'sourceId':_0x24fcd0['id']});await this['addFilesToContext']([_0x21b2af],{'label':_0x2a288b['label'],'resourceId':_0x2a288b['id']});break;case Be['TEXT']:if('object'!=typeof _0x21b2af||!('content'in _0x21b2af)||!('type'in _0x21b2af))return void this['fire']('error',{'error':new _0x70c77e('ai-chat-context-invalid-data',this,{'resourceId':_0x2a288b['id'],'sourceId':_0x24fcd0['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x21b2af}),'resourceId':_0x2a288b['id'],'sourceId':_0x24fcd0['id']});_0x21b2af=Ke['_convertTextResourceToFile'](_0x21b2af,_0x2a288b['label']),await this['addFilesToContext']([_0x21b2af],{'label':_0x2a288b['label'],'resourceId':_0x2a288b['id']},Be['TEXT']);break;case Be['TOOL']:break;default:this['fire']('error',{'error':new _0x70c77e('ai-chat-context-unsupported-type',this,{'resourceId':_0x2a288b['id'],'sourceId':_0x24fcd0['id'],'resourceType':_0x2a288b['type']}),'resourceId':_0x2a288b['id'],'sourceId':_0x24fcd0['id']});}else this['fire']('error',{'error':new _0x70c77e('ai-chat-resource-no-data',this,{'resourceId':_0x2a288b['id'],'sourceId':_0x24fcd0['id']}),'resourceId':_0x2a288b['id'],'sourceId':_0x24fcd0['id']});}static['_convertTextResourceToFile'](_0x1ccd1c,_0x3b8eaf){switch(_0x1ccd1c['type']){case Oe['MARKDOWN']:return new File([_0x1ccd1c['content']],_0x3b8eaf,{'type':'text/markdown'});case Oe['HTML']:return new File([_0x1ccd1c['content']],_0x3b8eaf,{'type':'text/html'});default:return new File([_0x1ccd1c['content']],_0x3b8eaf,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x517900){switch(_0x517900['type']){case Be['FILE']:return{'type':Be['FILE'],'id':_0x517900['id']};case Be['URL']:return{'type':Be['URL'],'id':_0x517900['id']};case Be['DOCUMENT']:return{'type':Be['DOCUMENT'],'id':_0x517900['id'],..._0x517900['selection']?.['length']&&{'selection':_0x517900['selection']}};case Be['TEXT']:return{'type':Be['FILE'],'id':_0x517900['id']};case Be['TOOL']:{const _0x3edc93=_0x517900;return{'type':Be['TOOL'],'mcpServerName':_0x3edc93['mcpServerName'],'toolName':_0x3edc93['toolName'],'data':_0x3edc93['data'],'id':_0x3edc93['id']};}default:return null;}}['_addContextItem'](_0x4c73b0,_0x4b8585=!0x1){if(this['_pendingContextItems']['set'](_0x4c73b0['uiId'],_0x4c73b0),_0x4c73b0['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x4c73b0,'isLoading':_0x4b8585}),'current-document'===_0x4c73b0['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x4c73b0['resourceId']){const _0x22c083=this['_findSourceIdsByResourceId'](_0x4c73b0['resourceId']);_0x22c083&&_0x22c083['forEach'](_0x5c8a68=>{this['_updateResourceInContextState'](_0x5c8a68,_0x4c73b0['resourceId'],!0x0);});}}['_removeContextItem'](_0x5599ca){const _0x17b1e1=this['_pendingContextItems']['get'](_0x5599ca),_0x4c1773=this['_ongoingUploads']['get'](_0x5599ca);if(_0x4c1773&&(_0x4c1773['abort'](),this['_ongoingUploads']['delete'](_0x5599ca)),_0x17b1e1?.['resourceId']){const _0x396f3e=this['_findSourceIdsByResourceId'](_0x17b1e1['resourceId']);_0x396f3e&&_0x396f3e['forEach'](_0x2bed76=>{this['_updateResourceInContextState'](_0x2bed76,_0x17b1e1['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x5599ca),this['fire']('contextItemRemoved',{'uiId':_0x5599ca,'type':_0x17b1e1?.['type']}),'current-document'===_0x5599ca&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x1f99e9,_0x3ec1d7){if(this['_pendingContextItems']['has'](_0x1f99e9['uiId'])&&(this['_pendingContextItems']['set'](_0x1f99e9['uiId'],_0x1f99e9),this['fire']('contextItemLoadingEnded',{'contextItem':_0x1f99e9,'isLoading':_0x3ec1d7}),_0x1f99e9['resourceId'])){const _0x22e7cf=this['_findSourceIdsByResourceId'](_0x1f99e9['resourceId']);_0x22e7cf&&_0x22e7cf['forEach'](_0xac148f=>{this['_updateResourceInContextState'](_0xac148f,_0x1f99e9['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x24e47f){this['_conversationContextItems']['set'](_0x24e47f['uiId'],_0x24e47f);}['_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'](_0x457282=>({..._0x457282,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x34418c=>({..._0x34418c,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x2f7d55=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x2f7d55,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x333fb3){for(const _0x84aeb0 of this['_pendingContextItems']['values']())if(_0x84aeb0['resourceId']===_0x333fb3)return!0x0;for(const _0x515346 of this['_conversationContextItems']['values']())if(_0x515346['resourceId']===_0x333fb3)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x5771c9){const _0x2b7f5f=[];for(const _0x270919 of this['_addContextOptionsState']['sources']){_0x270919['resources']['find'](_0x23fb78=>_0x23fb78['id']===_0x5771c9)&&_0x2b7f5f['push'](_0x270919['id']);}return 0x0===_0x2b7f5f['length']?null:_0x2b7f5f;}['_updateResourceInContextState'](_0x22ce6c,_0x403191,_0x21f4e2){const _0x11ff5d=this['_addContextOptionsState']['sources']['find'](_0x2aa2e0=>_0x2aa2e0['id']===_0x22ce6c);if(!_0x11ff5d)return;const _0x1af5b6=_0x11ff5d['resources']['find'](_0x5f0544=>_0x5f0544['id']===_0x403191);_0x1af5b6&&(_0x1af5b6['isInContext']=_0x21f4e2,this['fire']('resourceStateChanged',{'sourceId':_0x22ce6c,'resourceId':_0x403191,'isInContext':_0x21f4e2}));}['_startUploadOperation'](_0x285270){this['_ongoingUploadOperations']['set'](_0x285270,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x4c9e1f){this['_ongoingUploadOperations']['delete'](_0x4c9e1f),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Ye=['capabilitiesUpdated'];class Xe extends _0x5d9d11(){['_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'](_0x2e0890){const _0x5f3575={};return _0x2e0890&&_0x2e0890['isWebSearchEnabled']&&(_0x5f3575['webSearch']={}),_0x2e0890&&_0x2e0890['isReasoningEnabled']&&(_0x5f3575['reasoning']={}),_0x5f3575;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x46cd09){_0x46cd09!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x46cd09,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0xdb392){_0xdb392!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0xdb392,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Ze extends Fe{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['attributes'];constructor(_0x3c7d66){super(_0x3c7d66),this['conversationId']=_0x3c7d66['conversationId'],this['contextItems']=_0x3c7d66['contextItems'],this['capabilities']=_0x3c7d66['capabilities'],this['userMessage']=_0x3c7d66['userMessage'],this['model']=_0x3c7d66['model'],this['attributes']=_0x3c7d66['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 _0x5d9d11(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x429f3c){super(),this['options']=_0x429f3c,this['connector']=_0x429f3c['connector'],this['chatModels']=_0x429f3c['chatModels'],this['id']=_0x429f3c['conversationId'],this['isFromHistory']=_0x429f3c['isFromHistory'];}async['init'](_0x5a6429){try{this['chatContext']=new Ke({'connector':this['connector'],'config':_0x5a6429,'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 _0x114996=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x114996});const _0x192161=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x192161&&await this['setModel'](_0x192161);}catch(_0xf47ade){const _0x14daaf=new _0x70c77e('ai-chat-conversation-init-failed',null,{'message':_0xf47ade['message']||_0xf47ade});_0x14daaf['stack']=_0xf47ade['stack'],this['fire']('error',{'error':_0x14daaf});}}async['start'](){if(this['isStarted'])throw new _0x70c77e('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x70c77e('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x7e0dd}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x7e0dd,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0xda39ba){const _0x431b82=new _0x70c77e('ai-chat-conversation-start-failed',null,{'message':_0xda39ba['message'],'conversationId':this['id']});throw _0x431b82['stack']=_0xda39ba['stack'],this['fire']('error',{'error':_0x431b82}),_0x431b82;}}async['load'](_0x3b2032,_0x1972ca){try{const _0x27d8a6=await this['connector']['fetchConversation'](_0x3b2032)['getConversation'](),_0x41d867=await this['connector']['fetchConversationMessages'](_0x3b2032)['getMessages'](),_0x4ac35d=_0x41d867[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x27d8a6['id'],'title'in _0x27d8a6?this['fire']('setConversationTitle',_0x27d8a6['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x423f67=(await this['chatModels']['getAll']())['find'](_0x5ab243=>_0x5ab243['id']['toLowerCase']()===_0x4ac35d['toLowerCase']());return this['selectedModel']=_0x423f67,this['fire']('modelSelected',{'selectedModel':_0x423f67,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x41d867,_0x1972ca,_0x4ac35d),this['currentInteraction']=void 0x0,this;}catch(_0x53f245){const _0x56d6aa=new _0x70c77e('ai-chat-conversation-init-from-id-failed',null,{'message':_0x53f245['message'],'conversationId':_0x3b2032});throw _0x56d6aa['stack']=_0x53f245['stack'],this['fire']('error',{'error':_0x56d6aa}),_0x56d6aa;}}async['_processMessagesToInteractions'](_0x1830b5,_0x3b183c,_0x3752f4){let _0x25c6be;for(const _0x22661b of _0x1830b5)if('user'===_0x22661b['role']){const _0x2e74f8=await this['_extractContextItems'](_0x22661b),_0x4473bc={'isReasoningEnabled':Object['hasOwn'](_0x22661b['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x22661b['capabilities'],'webSearch')};_0x25c6be=this['createInteraction']({'userMessage':_0x22661b['prompt'],'contextItems':_0x2e74f8,'capabilities':_0x4473bc,'modelId':_0x3752f4,'attributes':_0x22661b['attributes']}),this['currentInteraction']=_0x25c6be,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x22661b['role']&&_0x25c6be){const _0xb57324=[];for(const _0x20222b of _0x22661b['content'])switch(_0x20222b['type']){case'text':case'modification':{const _0x1e91af=_0x25c6be['getDocumentContext']()?.['sessionId']!==_0x3b183c;_0x25c6be['currentReply']=_0x25c6be['createReply']({'type':_0x20222b['type'],'isDone':!0x0,'interactionId':_0x25c6be['id'],'areActionsDisabled':_0x1e91af}),_0x25c6be['currentReply']['appendContent'](_0x20222b['content']),_0xb57324['length']>0x0&&(_0x25c6be['currentReply']['sources']=_0xb57324['splice'](0x0));break;}case'url':_0xb57324['push'](_0x20222b);break;case'mcp-tool-result':{const {data:_0x26930a,attributes:_0x340270}=JSON['parse'](_0x20222b['content']);_0x25c6be['_handleToolResultData']({'toolName':_0x20222b['toolName'],'data':_0x26930a,'attributes':_0x340270});break;}}}}}async['_extractContextItems'](_0x1d1521){const _0xc01df4=new Map();if(!_0x1d1521['content'])return _0xc01df4;for(const _0x562f4d of _0x1d1521['content']){const _0x35a16e=await this['chatContext']['populateFromMessage'](_0x562f4d);_0x35a16e&&_0xc01df4['set'](_0x35a16e['id'],_0x35a16e);}return _0xc01df4;}async['handleUserInteraction']({userMessage:_0x386c15,attributes:_0x44d536}){if(!this['isStarted'])throw new _0x70c77e('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x70c77e('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x100f4f=this['chatContext']['getPendingContextItems'](),_0x3b7640=this['chatCapabilities']['getCapabilitiesConfig'](),_0x4b6522=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x386c15,'contextItems':_0x100f4f,'capabilities':_0x3b7640,'modelId':_0x4b6522,'attributes':_0x44d536}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x797654){if(_0x797654 instanceof _0x70c77e)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x797654});else{const _0x285fae=$e['get'](_0x797654['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new _0x70c77e(_0x285fae,null,{'error':_0x797654})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0xb40966,contextItems:_0x3db5f1,capabilities:_0x37faae,modelId:_0x237845,attributes:_0x2d7ff1}){const _0x33105c=new Ze({'userMessage':_0xb40966,'contextItems':_0x3db5f1,'capabilities':_0x37faae,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x237845,'attributes':_0x2d7ff1});return _0x33105c['delegate'](...ze)['to'](this),this['interactions']['push'](_0x33105c),this['fire']('interactionCreated',_0x33105c),_0x33105c;}['getInteraction'](_0x42acb3){return this['interactions']['find'](_0xa9ae4f=>_0xa9ae4f['id']===_0x42acb3);}['removeInteraction'](_0x64e8bc){const _0x45d992=this['getInteraction'](_0x64e8bc);_0x45d992&&(_0x45d992['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x45d992),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x3fc2c2){this['chatContext']['addCurrentDocumentToContext'](_0x3fc2c2);}async['updateCurrentDocumentInContext']({content:_0x62357d,version:_0x4ae56a,sessionId:_0x5d4852,selections:_0x273b2a}){await this['chatContext']['updateCurrentDocument'](_0x62357d,_0x4ae56a,_0x5d4852,_0x273b2a);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x1bb39e){this['chatContext']['addSelectionToContext'](_0x1bb39e);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x53438d){this['chatContext']['addFilesToContext'](_0x53438d);}['addUrlToContext'](_0x32c933){this['chatContext']['addUrlToContext'](_0x32c933);}['addToolItemToContext'](_0x47eae0){this['chatContext']['addToolItemToContext'](_0x47eae0);}['addResourceToContext'](_0x512ff0,_0x307d0f){this['chatContext']['addResourceToContext'](_0x512ff0,_0x307d0f);}['loadSourceResources'](_0x1d3bac,_0x18d2ad,_0x183738){return this['chatContext']['loadSourceResources'](_0x1d3bac,_0x18d2ad,_0x183738);}['removeFromContext'](_0x2b0df4){this['chatContext']['removeFromContext'](_0x2b0df4);}['setWebSearch'](_0x1b52e0){this['chatCapabilities']['setWebSearch'](_0x1b52e0);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0xceebb5){this['chatCapabilities']['setReasoning'](_0xceebb5);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x10214d){_0x10214d?!0x1===await this['chatModels']['isAvailable'](_0x10214d)&&(_0x580cf6('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x10214d}),_0x10214d=(await this['chatModels']['getAvailableModels']())[0x0]):(_0x580cf6('ai-chat-conversation-set-model-null',{'conversation':this}),_0x10214d=(await this['chatModels']['getAvailableModels']())[0x0]),_0x10214d['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x10214d,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x10214d}));}}class It extends _0x5d9d11(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x1d7b96,config:_0x50ddbd,locale:_0x3e8e61}){super(),this['_connector']=_0x1d7b96,this['_config']=_0x50ddbd,this['_locale']=_0x3e8e61;}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 _0x2bd853=await this['getAll']();let _0xd6b57f;return _0xd6b57f=this['_availableModels']?this['_filterModels'](_0x2bd853,this['_availableModels']):_0x2bd853['filter'](_0x349d6f=>_0x349d6f['recommended']),_0xd6b57f;}async['getModel'](_0x1294ae){const _0x7d391a=await this['getAll']();if(!_0x7d391a['length'])return null;if(_0x1294ae){const _0x3f353d=this['_getModelById'](_0x7d391a,_0x1294ae);if(_0x3f353d)return _0x3f353d;_0x580cf6('ai-chat-model-id-unrecognized',{'modelId':_0x1294ae,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x4a98c1=await this['getAvailableModels']();if(!_0x4a98c1['length'])return null;if(this['_defaultModelId']){const _0x30717b=this['_getModelById'](_0x4a98c1,this['_defaultModelId']);if(_0x30717b)return _0x30717b;_0x580cf6('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x4a98c1[0x0]['id']});}return _0x4a98c1[0x0];}async['isAvailable'](_0x7033a5){return(await this['getAvailableModels']())['some'](_0x2ce543=>_0x2ce543['name']===_0x7033a5['name']&&_0x2ce543['provider']===_0x7033a5['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0xf59d05=this['_locale']['uiLanguage']||'en',_0x4e2ace=this['_connector']['getModels'](_0xf59d05),_0x26bfe4=await _0x4e2ace['list']();this['_modelList']=_0x26bfe4['items']['map'](_0x31a826=>Bi(_0x31a826)?{..._0x31a826,'name':i(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x31a826);}catch(_0x3cd969){throw gt('ai-models-unable-to-retrieve',{'error':_0x3cd969}),_0x3cd969;}return[...this['_modelList']];}['_filterModels'](_0x2804ef,_0x7c2ecf){let _0x1a867e;if(_0x7c2ecf){_0x1a867e=[];const _0x46b6e2=new Set(),_0x5070d0='string'==typeof _0x7c2ecf?[_0x7c2ecf['toLocaleLowerCase']()]:_0x7c2ecf['map'](_0x480c54=>_0x480c54['toLocaleLowerCase']());for(const _0xb4e226 of _0x5070d0)for(const _0x3057a1 of _0x2804ef)!_0x46b6e2['has'](_0x3057a1['id'])&&this['_isMatchingFilter'](_0x3057a1,_0xb4e226)&&(_0x1a867e['push'](_0x3057a1),_0x46b6e2['add'](_0x3057a1['id']));}else _0x1a867e=_0x2804ef;return _0x1a867e;}['_isMatchingFilter'](_0x3ef2f1,_0x55cf13){const _0x3c53ac=_0x3ef2f1['id']['toLocaleLowerCase'](),_0x3174ef=_0x3ef2f1['name']['toLocaleLowerCase'](),_0x448533=_0x3ef2f1['provider']['toLocaleLowerCase']();return _0x3c53ac===_0x55cf13||_0x3174ef===_0x55cf13||Bi(_0x3ef2f1)&&'auto'===_0x55cf13||_0x448533===_0x55cf13||_0x3c53ac['startsWith'](_0x55cf13);}['_getModelById'](_0x4e3275,_0x468e69){return _0x4e3275['find'](_0x6f600a=>Bi(_0x6f600a)&&'auto'===_0x468e69?_0x6f600a:_0x6f600a['id']===_0x468e69)||null;}}function Bi(_0x2fee2a){return _0x2fee2a['id']['startsWith']('agent');}function T(_0x328d58){if(_0x328d58 instanceof dt)return _0x328d58;if(_0x328d58?.['editors']&&_0x328d58['editors']['get'](0x0))return _0x328d58['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.'),_0x328d58['editors']['get'](0x0);throw new _0x70c77e('ai-get-editor-from-context-no-editor');}function Z({editor:_0x403c34,interaction:_0x3d6d0e,reply:_0xea295d,groups:_0x26585d,transform:_0x589f28,documentCompare:_0x4e97b4,documentCompareOptions:_0x4ccb5e}){const _0x54e419=_0x3d6d0e['getDocumentContext']();if(!_0x54e419)return[];const _0x831a46=_0x54e419['content'],_0x507fca=_0x54e419['version'],_0x9ca703=_0xea295d['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x54a719}of _0x26585d){const _0x293a3d=_0x54a719['filter'](_0x193969=>'new'!=_0x193969['type'])['map'](_0x28c440=>St('data-id',_0x28c440['id'],_0x9ca703)),_0x50851a=_0x54a719['filter'](_0x19de18=>'removed'!=_0x19de18['type'])['map'](_0x4b83c4=>_0x4b83c4['node']['cloneNode'](!0x0));let _0xa947f9=null;if(_0x293a3d['length']){_0xa947f9=_0x293a3d[0x0]['previousSibling'];for(let _0x47db93=0x0;_0x47db93<_0x293a3d['length'];_0x47db93++)_0x49d15d(_0x293a3d[_0x47db93]);}if(_0x50851a['length']){_0xa947f9||(_0x54a719[0x0]['anchorId']?_0xa947f9=St('data-id',_0x54a719[0x0]['anchorId'],_0x9ca703):(_0xa947f9=_0x50851a['shift'](),_0x404e7d(_0x9ca703,_0xa947f9)));for(let _0xd41b02=0x0;_0xd41b02<_0x50851a['length'];_0xd41b02++)_0x244df5(_0xa947f9,_0x50851a[_0xd41b02]),_0xa947f9=_0x50851a[_0xd41b02];}}const _0x236ae7=Tt(_0x9ca703),_0x205745=_0x4e97b4['getDiff'](_0x831a46,_0x236ae7,_0x4ccb5e)['getOperations']();if(_0x589f28){const _0x459d84=_0x403c34['model']['document']['history']['getOperations'](_0x507fca),_0x184724={'document':_0x403c34['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return nt(_0x205745,_0x459d84,_0x184724)['operationsA'];}return _0x205745;}function Y(_0x325156,_0x35d1c8){if('marker'!=_0x35d1c8['type'])return;const _0x6ab612=_0x325156['model']['markers']['get'](_0x35d1c8['name']);_0x6ab612&&(_0x35d1c8['oldRange']=_0x6ab612['getRange']());}class at extends _0x2536b2{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[q,_0x587691];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new _0x5669fa(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 _0x40b74b=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x50c033,_0x1db8ef)=>{this['_handleUIUserMessage']({'userMessage':_0x1db8ef});}),this['listenTo'](_0x40b74b,'resizedTabs',(_0x5c6057,_0x4effaf)=>{this['_setIsMaximized'](_0x4effaf);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x40b74b['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',(_0x1c5c96,_0x4efede)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x4efede));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x1d4d06,_0x1e97c4)=>{this['activeConversation']?.['addUrlToContext'](_0x1e97c4);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x3d1730,_0x4d148b)=>{_0x4d148b['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x221155,_0xb83d44)=>{this['activeConversation']?.['addResourceToContext'](_0xb83d44['source'],_0xb83d44['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0xb0e89b,_0x368407)=>{this['_removeFromContext'](_0x368407);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x53bd56,_0x376862)=>{this['activeConversation']?.['loadSourceResources'](_0x376862['sourceId'],_0x376862['query'],_0x376862['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x13c487,_0x15fb47)=>{this['activeConversation']?.['setModel'](_0x15fb47);}),this['listenTo'](this['_aiChatUi'],'like',(_0x297afc,{replyId:_0x1ff5d6})=>{console['log']('Liked\x20response',_0x1ff5d6);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x1b38e9,{replyId:_0x25c1b8})=>{console['log']('Disliked\x20response',_0x25c1b8);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x37a360,_0x57b184)=>{this['_insertSuggestion'](_0x57b184);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x1a050a,{replyId:_0x22401b,partIndex:_0x40f1c8})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x22401b,_0x40f1c8);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x1297e6,{replyId:_0x3895be,partIndex:_0x18e493})=>{const _0xd0c274=this['_getDocumentRangeForReplyChanges'](_0x3895be,_0x18e493);_0xd0c274&&'$graveyard'!=_0xd0c274['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0xd0c274['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x4e57bd,_0x3f7844)=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over'),this['_applySuggestion'](_0x3f7844);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x4665ff,{replyId:_0xc959a0,showDiff:_0xf9b019})=>{const {reply:_0x367d28}=this['getInteractionAndReplyById'](_0xc959a0),_0x58fd2c=_0x367d28['getContentParts']({'showDiff':_0xf9b019});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x367d28['id'],'parts':_0x58fd2c,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x47a5c4,{replyId:_0x51e620,partIndex:_0x50914c})=>{this['_rejectSuggestion']({'replyId':_0x51e620,'partIndex':_0x50914c}),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:_0x441ec2,partIndex:_0x15302d}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x327b5f}=this['getInteractionAndReplyById'](_0x441ec2),_0xcc66cf=_0x327b5f['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x15302d});this['_aiChatBalloon']['updateContent']({'part':_0xcc66cf[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0xc5b17f,partIndex:_0x5ba086}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0xc5b17f,'partIndex':_0x5ba086}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x4b9c37,partIndex:_0x1bab90}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x4b9c37,'partIndex':_0x1bab90}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x259969,partIndex:_0x4a2f95}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x259969,'partIndex':_0x4a2f95}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0x220219,partIndex:_0x1e3b31}=this['_currentPreviewedChangeGroup'],_0x1686b1=this['_getPresentableSiblingContentPartIndex'](_0x220219,_0x1e3b31,'next');null!==_0x1686b1&&this['_openBalloonFor'](_0x220219,_0x1686b1);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x42d167,partIndex:_0x278e85}=this['_currentPreviewedChangeGroup'],_0x48085a=this['_getPresentableSiblingContentPartIndex'](_0x42d167,_0x278e85,'previous');null!==_0x48085a&&this['_openBalloonFor'](_0x42d167,_0x48085a);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x2f7648,{id:_0x99fc35})=>{if('aiChatBalloon'!==_0x99fc35)return;const {replyId:_0xb2db31,partIndex:_0x4fb698}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0xb2db31,'index':_0x4fb698,'isActive':!0x1});}));}async['afterInit'](){this['context']instanceof dt?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x367224,_0x3b6f43)=>{_0x3b6f43['on']('ready',()=>{this['_integrateEditor'](_0x3b6f43);});});const _0x2e13f6=this['context']['config']['get']('ai.chat.initialConversation');let _0x359786=_0x2e13f6;if('lastCreated'!=_0x2e13f6||(_0x359786=await this['_getLastCreatedConversationId'](),_0x359786))return'new'==_0x359786?this['_startConversationSafely']():this['loadConversation'](_0x359786);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_insertSuggestion'](_0x4be3cd){const _0x2d5086=T(this['context']);if(!_0x2d5086['plugins']['has']('TrackChanges'))throw new _0x70c77e('ai-no-track-changes',null);const _0x3ca7f5=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x26d591,interaction:_0x455837}=this['getInteractionAndReplyById'](_0x4be3cd['replyId']),_0x1d6758=this['_getDocumentRangeForReplyChanges'](_0x4be3cd['replyId'],_0x4be3cd['partIndex']),_0xc0a249=void 0x0!==_0x4be3cd['partIndex']?[_0x26d591['changeGroups'][_0x4be3cd['partIndex']]]:_0x26d591['changeGroups']['filter'](_0x28aa05=>'pending'==_0x28aa05['state']),_0xb4f140=_0xc0a249['map'](_0x34304e=>_0x26d591['changeGroups']['indexOf'](_0x34304e));if(!_0x1d6758||'$graveyard'==_0x1d6758['range']['root']['rootName'])return void _0xb4f140['forEach'](_0x55cfda=>_0x26d591['setChangeGroupState'](_0x55cfda,'outdated'));_0xb4f140['forEach'](_0x1e00c7=>_0x26d591['setChangeGroupState'](_0x1e00c7,'accepted'));const _0x1fe83a=Z({'editor':_0x2d5086,'reply':_0x26d591,'interaction':_0x455837,'groups':_0xc0a249,'transform':!0x0,'documentCompare':_0x3ca7f5,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x131f6c;_0x1d6758&&this['_scrollToSuggestionRange'](_0x1d6758['range']),_0x2d5086['model']['change'](_0x42d538=>{_0x131f6c=_0x42d538['batch'],_0x2d5086['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x1fe83a),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x131f6c,{'interactionId':_0x455837['id'],'replyId':_0x26d591['id'],'indexes':_0xb4f140['slice']()}),this['_updateRatings'](_0x26d591);}['_applySuggestion'](_0x575a9d){const _0x500cf8=T(this['context']),_0x121d2c=this['context']['plugins']['get'](_0x587691),{reply:_0x4ac1c9,interaction:_0x36ff6c}=this['getInteractionAndReplyById'](_0x575a9d['replyId']),_0x2cb127=this['_getDocumentRangeForReplyChanges'](_0x575a9d['replyId'],_0x575a9d['partIndex']),_0x475372=void 0x0!==_0x575a9d['partIndex']?[_0x4ac1c9['changeGroups'][_0x575a9d['partIndex']]]:_0x4ac1c9['changeGroups']['filter'](_0x286ba2=>'pending'==_0x286ba2['state']),_0x3aea47=_0x475372['map'](_0x52c4c2=>_0x4ac1c9['changeGroups']['indexOf'](_0x52c4c2));if(!_0x2cb127||'$graveyard'==_0x2cb127['range']['root']['rootName'])return void _0x3aea47['forEach'](_0x24f0cc=>_0x4ac1c9['setChangeGroupState'](_0x24f0cc,'outdated'));_0x3aea47['forEach'](_0x3f2fdf=>_0x4ac1c9['setChangeGroupState'](_0x3f2fdf,'accepted'));const _0x4e5e1b=Z({'editor':_0x500cf8,'reply':_0x4ac1c9,'interaction':_0x36ff6c,'groups':_0x475372,'transform':!0x0,'documentCompare':_0x121d2c,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x14710d;_0x2cb127&&this['_scrollToSuggestionRange'](_0x2cb127['range']),_0x500cf8['model']['change'](_0x15226a=>{_0x14710d=_0x15226a['batch'];for(const _0x3190d6 of _0x4e5e1b)_0x3190d6['baseVersion']=_0x500cf8['model']['document']['version'],Y(_0x500cf8,_0x3190d6),_0x15226a['batch']['addOperation'](_0x3190d6),_0x500cf8['model']['applyOperation'](_0x3190d6);}),this['_batchToChanges']['set'](_0x14710d,{'interactionId':_0x36ff6c['id'],'replyId':_0x4ac1c9['id'],'indexes':_0x3aea47['slice']()}),this['_updateRatings'](_0x4ac1c9);}['_rejectSuggestion'](_0x26899b){const {reply:_0x3d03fc}=this['getInteractionAndReplyById'](_0x26899b['replyId']);_0x3d03fc['setChangeGroupState'](_0x26899b['partIndex'],'rejected');}['_openBalloonFor'](_0x1ef78e,_0x551932){if(!this['_aiChatBalloon'])return;const {reply:_0x10ee97}=this['getInteractionAndReplyById'](_0x1ef78e),_0x34a7f8=_0x10ee97['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x37bf6f,_0x3f7deb;if(void 0x0!==_0x551932?(_0x3f7deb=_0x34a7f8['find'](_0x375978=>_0x375978['index']==_0x551932),_0x37bf6f=_0x3f7deb?.['index']):(_0x3f7deb=_0x34a7f8[0x0],_0x37bf6f=_0x3f7deb['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x1ef78e&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x37bf6f)return;const _0x5d4f3e=this['_getUserPresentableContentPartDocumentRange'](_0x1ef78e,_0x10ee97,_0x3f7deb);if(!_0x5d4f3e)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x1ef78e,'partIndex':_0x37bf6f},this['_scrollToSuggestionRange'](_0x5d4f3e,!0x0);const _0x5092af=this['_getPresentableSiblingContentPartIndex'](_0x1ef78e,_0x37bf6f,'next');this['_aiChatBalloon']['updateContent']({'part':_0x3f7deb,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x37bf6f,'title':i(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x37bf6f+0x1)['toString']()),'showRotator':null!==_0x5092af,'ranges':[_0x5d4f3e],'areActionsDisabled':_0x10ee97['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x1ef78e,_0x37bf6f),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x1ef78e,'index':_0x37bf6f,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x471db5,_0x36de64,_0x35f890){const {reply:_0x5e8b23}=this['getInteractionAndReplyById'](_0x471db5),_0x2bdba2=_0x5e8b23['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x2bdba2['length'])return null;const _0x5f27e3=_0x2bdba2['findIndex'](_0x25648c=>_0x25648c['index']==_0x36de64),_0x5a35da='next'==_0x35f890?0x1:-0x1;let _0x388d50=_0x2bdba2['at']((_0x5f27e3+_0x5a35da)%_0x2bdba2['length'])['index'],_0xeec944=_0x2bdba2[_0x388d50];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x471db5,_0x5e8b23,_0xeec944);){if(_0x388d50=_0x2bdba2['at']((_0x388d50+_0x5a35da)%_0x2bdba2['length'])['index'],_0x388d50===_0x5f27e3)return null;_0xeec944=_0x2bdba2[_0x388d50];}return _0x388d50;}['_getUserPresentableContentPartDocumentRange'](_0x53d1e4,_0xdacddc,_0x100139){const _0x5c62ec=_0xdacddc['changeGroups'];if(!_0x100139['hasChanges'])return null;const _0x51fedd=_0x5c62ec['find'](_0x2b302f=>_0x2b302f['index']==_0x100139['index']);if('pending'!==_0x51fedd?.['state'])return null;const _0x38b3ea=this['_getDocumentRangeForReplyChanges'](_0x53d1e4,_0x100139['index']);if(!_0x38b3ea)return null;const {range:_0x1a3a11,currentIndex:_0x158f89}=_0x38b3ea;return'$graveyard'==_0x1a3a11['root']['rootName']?(_0xdacddc['setChangeGroupState'](_0x158f89,'outdated'),null):_0x38b3ea['range'];}['_getDocumentRangeForReplyChanges'](_0x14f2c9,_0x97b8e5){const _0xf98a5b=T(this['context']),{reply:_0xafbd53,interaction:_0x407ed7}=this['getInteractionAndReplyById'](_0x14f2c9),_0x57de6b=_0xafbd53['changeGroups']['filter'](_0x57f6e1=>'pending'==_0x57f6e1['state']),_0x4869b6=_0x57de6b['map'](_0x52cd0d=>_0xafbd53['changeGroups']['indexOf'](_0x52cd0d));void 0x0===_0x97b8e5&&(_0x97b8e5=_0x4869b6[0x0]);const _0x1a1dd9=_0x4869b6['indexOf'](_0x97b8e5);if(-0x1==_0x1a1dd9)return null;const _0x2a5458=_0x57de6b[_0x1a1dd9],_0x4fe21c=new Et([]),_0x792c45=new Et([]);for(const _0x3e89ee of _0x2a5458['changes'])if('removed'!=_0x3e89ee['type']&&_0x792c45['children']['push'](_0x3e89ee['node']['cloneNode'](!0x0)),'new'!=_0x3e89ee['type']){const _0x3f59f6=yt(_0x20ec28=>At(_0x20ec28,'data-id')==_0x3e89ee['id'],_0xafbd53['documentContextContent'],!0x0);_0x4fe21c['children']['push'](_0x3f59f6['cloneNode'](!0x0));}if(0x0==_0x4fe21c['children']['length']){if(_0x2a5458['changes'][0x0]['anchorId']){const _0x5b562e=St('data-id',_0x2a5458['changes'][0x0]['anchorId'],_0xafbd53['documentContextContent']);_0x4fe21c['children']['unshift'](_0x5b562e['cloneNode'](!0x0)),_0x792c45['children']['unshift'](_0x5b562e['cloneNode'](!0x0)),_0x5b562e['nextSibling']&&(_0x4fe21c['children']['push'](_0x5b562e['nextSibling']['cloneNode'](!0x0)),_0x792c45['children']['push'](_0x5b562e['nextSibling']['cloneNode'](!0x0)));}else{const _0x540599=_0xafbd53['documentContextContent']['children'][0x0];if(!_0x540599)return null;_0x4fe21c['children']['push'](_0x540599['cloneNode'](!0x0)),_0x792c45['children']['push'](_0x540599['cloneNode'](!0x0));}}const _0x20582c=_0x407ed7['getDocumentContext'](),_0x356498=_0xf98a5b['data']['parse'](_0x20582c['content']),_0x3858cd=Tt(_0x4fe21c),_0x3e4eb3=_0xf98a5b['data']['parse'](_0x3858cd),_0x304749=_0xf98a5b['data']['parse'](_0x3858cd),_0x195848=_0xf98a5b['model']['createPositionAt'](_0x3e4eb3,0x0),_0x5bc161=Tt(_0x792c45),_0x277f42={'anchor':_0x195848,'markDeletions':!0x1},_0x4d8319=_0xf98a5b['plugins']['get'](_0x587691)['getDiff'](_0x3858cd,_0x5bc161,_0x277f42)['getOperations']();if(!_0x4d8319['length'])return null;_0xf98a5b['model']['change'](_0x264f6f=>{for(const _0x5581b5 of _0x4d8319)if('remove'==_0x5581b5['type']){const _0xf8b048=_0x5581b5['sourcePosition'],_0x1b3ce5=_0x5581b5['howMany'],_0x1b15bc=new et(_0xf8b048,_0x1b3ce5);_0x264f6f['batch']['addOperation'](_0x1b15bc),_0xf98a5b['model']['applyOperation'](_0x1b15bc);}else'marker'!==_0x5581b5['type']&&(_0x5581b5['baseVersion']=null,_0x5581b5['isDocumentOperation']=!0x1,_0x264f6f['batch']['addOperation'](_0x5581b5),_0xf98a5b['model']['applyOperation'](_0x5581b5));});const _0x563896=mt(_0xf98a5b,_0x4d8319,_0x3e4eb3);ft(_0xf98a5b['model'],_0x563896);const _0x7624b8=_0x563896['getFirstRange']()['start']['path']['slice'](),_0x2d16b7=_0x563896['getFirstRange']()['end']['path']['slice'](),_0x33ed21=[];let _0x2251da=_0x3e4eb3,_0x2aebc3=_0x304749;for(let _0x3909ee=0x0;_0x3909ee<_0x2d16b7['length'];_0x3909ee++){const _0x13fa3c=_0x2251da['maxOffset']-_0x2d16b7[_0x3909ee];_0x33ed21[_0x3909ee]=_0x2aebc3['maxOffset']-_0x13fa3c,_0x2251da=_0x2251da['getChildAtOffset'](_0x2d16b7[_0x3909ee]),_0x2aebc3=_0x2aebc3['getChildAtOffset'](_0x33ed21[_0x3909ee]);}const _0x4870c5=_0xf98a5b['model']['createRange'](_0xf98a5b['model']['createPositionFromPath'](_0x304749,_0x7624b8),_0xf98a5b['model']['createPositionFromPath'](_0x304749,_0x33ed21)),_0x2c97b7=_0x304749['getChild'](0x0)['getAttribute'](Ct),_0x3609c5=Array['from'](_0x356498['getChildren']())['find'](_0x486578=>_0x486578['getAttribute'](Ct)==_0x2c97b7)['getPath'](),_0x463bda=_0x4870c5['start']['path']['slice'](),_0xd43f96=_0x4870c5['end']['path']['slice']();_0x463bda[0x0]=_0x3609c5[0x0]+_0x463bda[0x0],_0xd43f96[0x0]=_0x3609c5[0x0]+_0xd43f96[0x0];let _0x501ef5=_0xf98a5b['model']['createRange'](_0xf98a5b['model']['createPositionFromPath'](_0xf98a5b['model']['document']['getRoot'](),_0x463bda),_0xf98a5b['model']['createPositionFromPath'](_0xf98a5b['model']['document']['getRoot'](),_0xd43f96));const _0x42a07e=_0xf98a5b['model']['document']['history']['getOperations'](_0x20582c['version']);for(const _0x522de0 of _0x42a07e)_0x501ef5=it['_createFromRanges'](_0x501ef5['getTransformedByOperation'](_0x522de0));return{'range':_0x501ef5,'currentIndex':_0x97b8e5};}['_integrateEditor'](_0x38123a){if(!_0x38123a['plugins']['has']('Undo'))return;const _0x1548a6=_0x38123a['commands']['get']('undo'),_0x410c0b=_0x38123a['commands']['get']('redo');this['listenTo'](_0x1548a6,'revert',(_0x1e679a,_0x4c4121,_0x1088ab)=>{const _0x3893d8=this['_batchToChanges']['get'](_0x4c4121);if(!_0x3893d8)return;const _0x2614c1=this['activeConversation']['getInteraction'](_0x3893d8['interactionId'])['getReply'](_0x3893d8['replyId']);_0x3893d8['indexes']['forEach'](_0x45ba5a=>_0x2614c1['setChangeGroupState'](_0x45ba5a,'pending')),this['_batchToChanges']['delete'](_0x4c4121),this['_batchToChanges']['set'](_0x1088ab,_0x3893d8);}),this['listenTo'](_0x410c0b,'revert',(_0x117ef5,_0xdf02d9,_0x1acb0c)=>{const _0x5ecfa3=this['_batchToChanges']['get'](_0xdf02d9);if(!_0x5ecfa3)return;const _0x314180=this['activeConversation']['getInteraction'](_0x5ecfa3['interactionId'])['getReply'](_0x5ecfa3['replyId']);_0x5ecfa3['indexes']['forEach'](_0x15c597=>_0x314180['setChangeGroupState'](_0x15c597,'accepted')),this['_batchToChanges']['delete'](_0xdf02d9),this['_batchToChanges']['set'](_0x1acb0c,_0x5ecfa3);});}async['loadConversation'](_0x2f73a7){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'](_0x2f73a7)['getConversation'](),await this['_startConversationSafely'](_0x2f73a7),this['updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x2f73a7,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x2fb32b){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x2f73a7}),this['_logError'](new _0x70c77e('ai-chat-conversation-not-found',this,{'error':_0x2fb32b}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}async['_getLastCreatedConversationId'](){const _0x441563=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x5dcae2=await _0x441563['getConversations']();return _0x5dcae2['length']?_0x5dcae2[0x0]['id']:'new';}catch(_0x56c194){return this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x4689d1()}),this['_logError'](new _0x70c77e('ai-chat-conversation-init-failed',this,{'error':_0x56c194})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}['handleRemovedConversation'](_0xf5c8d4){this['activeConversation']['id']===_0xf5c8d4&&this['_startConversationSafely']();}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x21023d=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x21023d),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x403b09,attributes:_0x168950}){await this['_handleUIUserMessage']({'userMessage':_0x403b09,'attributes':_0x168950});}['getGroupId'](){const _0x37aed8=this['context']['config']['get']('collaboration.channelId');if(!_0x37aed8)throw new _0x70c77e('ai-chat-missing-channel-id',this);return _0x37aed8;}async['_startConversationSafely'](_0x437d6c){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x437d6c);}catch(_0x1fabba){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x437d6c||_0x4689d1()}),console['error'](_0x1fabba),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x385cf0){let _0x309f2a;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x385cf0||!this['activeConversation']?_0x309f2a=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x309f2a=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x2585c0=this['getGroupId'](),_0x32689e=_0x385cf0||_0x4689d1();this['activeConversation']=new _t({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x309f2a,'conversationId':_0x32689e,'group':_0x2585c0,'getEditor':()=>T(this['context']),'isFromHistory':!!_0x385cf0}),this['activeConversation']['delegate']('toolDataReceived','interactionStarted')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x4e0d13,_0x5c64c4)=>{this['_aiChatUi']['createConversation'](_0x5c64c4),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x385cf0||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x2b2e1f,_0x42f744)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x42f744['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x5f6fbb,_0x54fde5)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x54fde5);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x1d7de7=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x1d7de7);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x2f8682=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x2f8682);}),this['activeConversation']['on']('webSearchFinished',(_0x114662,_0x1086ee)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x1086ee,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x5862cc,_0x1b404f)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x1b404f,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x371cca,_0x1797c3)=>{this['_aiChatUi']['removeFeedInteraction'](_0x1797c3['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x1b37ab,_0x1da752,_0xadc83f)=>{this['updateConversationTitle'](_0x1da752,_0xadc83f);}),this['activeConversation']['on']('replyCreated',(_0x7733e3,_0x3396ff)=>{'text'===_0x3396ff['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x3396ff):this['_aiChatUi']['addFeedItemAISuggestion'](_0x3396ff);}),this['activeConversation']['on']('replyContentUpdated',async(_0x4f2c66,_0x4a5b8e)=>{await this['_updateReplyContent']({'reply':_0x4a5b8e});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x3a4c52,{reply:_0x197b04,index:_0x4c27bc,state:_0x306006})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x197b04['id'],'index':_0x4c27bc,'state':_0x306006}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x197b04['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x4c27bc&&this['_aiChatBalloon']?.['setState'](_0x306006);}),this['activeConversation']['on']('contextItemAdded',(_0x25ccef,_0x505e7d)=>{if(this['_aiChatUi']['addContextItem'](_0x505e7d['contextItem'],_0x505e7d['isLoading']),'selection'===_0x505e7d['contextItem']['type']){const _0x4f1b0b=[...T(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x4f1b0b,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x4611b9,_0x927f7c)=>{this['_aiChatUi']['removeContextItem'](_0x927f7c['uiId']),'current-document'==_0x927f7c['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x927f7c['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x59b3cd,_0x48db0a)=>{this['_aiChatUi']['setContextItemLoading'](_0x48db0a['contextItem']['uiId'],_0x48db0a['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x4e761d,_0x2d23f6)=>{this['_aiChatUi']['setConversationContext'](_0x2d23f6['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x34ddf2,_0x3cdf24)=>{this['_aiChatUi']['setAddContextOptions'](_0x3cdf24['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x1886f1,_0x307d30)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x307d30['sourceId'],_0x307d30['source'],_0x307d30['resources'],_0x307d30['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x3ade50,_0x3abfa6)=>{this['_aiChatUi']['updateResourceState'](_0x3abfa6['sourceId'],_0x3abfa6['resourceId'],_0x3abfa6['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0xf18e,_0x5a2766)=>{this['_aiChatUi']['updateCapabilities'](_0x5a2766);}),this['activeConversation']['on']('modelSelected',async(_0x29c490,_0x1afc80)=>{const _0x1fb7d4=(await this['_aiChatModels']['getAll']())['find'](_0x27e0e4=>_0x27e0e4['id']===_0x1afc80['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x1fb7d4,_0x1afc80['isDisabled']);}),this['activeConversation']['on']('error',(_0xbe1023,{error:_0x4a3a6b,interactionId:_0x494088,fileName:_0x3d9e8a,url:_0x31db9e,sourceId:_0x245a69,sourceLabel:_0x5ac469})=>{const _0x32952a=_0x494088?_0x494088+':'+_0x4689d1():_0x4689d1();_0x4a3a6b['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':i(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x32952a}):_0x4a3a6b['message']['startsWith']('ai-chat-conversation-init-failed')||_0x4a3a6b['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x32952a}),this['_logError'](_0x4a3a6b)):_0x4a3a6b['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x3d9e8a),'id':_0x32952a}):_0x4a3a6b['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x31db9e),'id':_0x32952a}):_0x4a3a6b['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x32952a}):_0x4a3a6b['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x32952a}):_0x4a3a6b['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x245a69&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x245a69),this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x5ac469||'source'),'id':_0x32952a}),this['_logError'](_0x4a3a6b)):_0x4a3a6b['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x32952a}),this['_logError'](_0x4a3a6b)):_0x4a3a6b['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x32952a}),this['_logError'](_0x4a3a6b)):_0x4a3a6b['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x32952a}),this['_logError'](_0x4a3a6b)):_0x4a3a6b['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x32952a}),this['_logError'](_0x4a3a6b)):_0x4a3a6b['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':_0x32952a}),this['_logError'](_0x4a3a6b)):_0x4a3a6b['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':_0x32952a}),this['_logError'](_0x4a3a6b)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x32952a}),this['_logError'](_0x4a3a6b));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x385cf0||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x9767af,attributes:_0x8c1224}){if(!this['activeConversation'])throw new _0x70c77e('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x748f4=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x748f4);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x9767af,'attributes':_0x8c1224});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x585efc){this['_aiChatUi']['setIsMaximized'](_0x585efc);}['_logError'](_0x3dfda7){gt(_0x3dfda7['message']);}['_removeFromContext'](_0x561ca4){this['activeConversation']?.['removeFromContext'](_0x561ca4);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x3d5f70){const [_0x518d72,_0x520cde]=_0x3d5f70['split'](':'),_0x4524e2=this['activeConversation']['getInteraction'](_0x518d72),_0x1f8d1d=_0x4524e2['getReply'](_0x520cde);return{'interaction':_0x4524e2,'reply':_0x1f8d1d};}['_scrollToSuggestionRange'](_0x43600b,_0x42ce95=!0x1){const _0x223aef=T(this['context']),_0x22866f={'target':_0x223aef['editing']['view']['domConverter']['viewRangeToDom'](_0x223aef['editing']['mapper']['toViewRange'](_0x43600b)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x42ce95};_0x42ce95&&(_0x22866f['alignToTop']=!0x0),_0x29d957(_0x22866f);}['updateConversationTitle'](_0x3cc6bd,_0x2dbe1d=!0x1){this['_aiChatUi']['setConversationTitle'](_0x3cc6bd||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x2dbe1d);}async['_updateReplyContent']({reply:_0x466a00,renderingStrategy:_0x3e6cbd}){const {id:_0x4d01e6,interactionId:_0x4e6568,isDone:_0x2e71bb,type:_0x569abb,parsedContent:_0x10c039}=_0x466a00,_0x3c5eca=_0x4e6568+':'+_0x4d01e6;if('modification'===_0x569abb){const _0x58dbd5=_0x466a00['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x3c5eca,'parts':_0x58dbd5,'renderingStrategy':_0x3e6cbd,'isDone':_0x2e71bb});}else'text'===_0x569abb&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x3c5eca,'parsedContent':_0x10c039,'renderingStrategy':_0x3e6cbd,'isDone':_0x2e71bb});_0x2e71bb&&_0x466a00['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x3c5eca,_0x466a00['sources']);}async['_stopLastInteraction'](){const _0xa8da25=this['activeConversation']?.['lastInteraction'];_0xa8da25&&(_0xa8da25['stop'](),this['_aiChatUi']['stopInteraction'](_0xa8da25));}async['_flushLastInteractionUI'](){const _0x59cf22=this['activeConversation']?.['lastInteraction'];if(_0x59cf22){for await(const _0x305b7c of _0x59cf22['replies'])await this['_updateReplyContent']({'reply':_0x305b7c,'renderingStrategy':'static'});}}['_updateRatings'](_0x35317e){const _0x15b9b8={'positiveCount':_0x35317e['changeGroups']['filter'](_0x5151d9=>'accepted'===_0x5151d9['state'])['length'],'totalCount':_0x35317e['changeGroups']['length'],'modificationId':_0x35317e['id']},_0x5954f4=this['activeConversation']['getInteraction'](_0x35317e['interactionId'])['messageId'];_0x5954f4&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x5954f4,_0x15b9b8);}['_registerToolDataCallback'](_0x23b2e0){let _0x4506ba=null,_0x3482a7=null;this['on']('toolDataReceived',(_0x4a29a6,_0x5999de,_0x120404)=>{_0x120404['id']!==_0x4506ba&&(_0x4506ba=_0x120404['id'],_0x3482a7=this['_getAIChatInteractionAPI'](_0x120404)),_0x23b2e0(_0x5999de,_0x3482a7);});}['_getAIChatInteractionAPI'](_0x5c68a6){const _0x4e01a2=this['_aiChatUi'],_0x534956=()=>{_0x5c68a6['resetWebSearchState'](),_0x5c68a6['resetReasoningState'](),_0x4e01a2['clearLoadingMessage']();},_0x2f3e06=()=>{_0x5c68a6['currentReply']&&(_0x5c68a6['currentReply']['done'](),_0x5c68a6['currentReply']=void 0x0);};return{'insertTextReply':(_0x17d329,_0x1fc987)=>{_0x2f3e06(),_0x534956();const _0x4d86a2=_0x5c68a6['currentReply']=_0x5c68a6['createReply']({'type':'text','interactionId':_0x5c68a6['id'],'content':_0x17d329,'id':_0x1fc987||_0x4689d1()});return _0x2f3e06(),_0x4d86a2;},'insertCustomElement':async(_0x5965be,_0x34b061)=>(_0x2f3e06(),_0x534956(),_0x4e01a2['addFeedItemCustomElement'](_0x5965be,_0x34b061||_0x4689d1())),'setLoadingMessage':_0x46f0d8=>{_0x4e01a2['setLoadingMessage'](_0x46f0d8);},'clearLoadingMessage':()=>{_0x4e01a2['clearLoadingMessage']();}};}}const R='ai-selection';class D extends _0x2536b2{constructor(_0x165b68){super(_0x165b68),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 _0x235ff4=T(this['context']),_0x42b500=_0x235ff4['plugins']['has']('RealTimeCollaborationClient')&&_0x235ff4['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x42b500||_0x4689d1();}return this['_sessionId'];}async['getDocumentData'](){const _0xb5bed4=T(this['context']),_0x43f5dd=_0xb5bed4['model'],_0x5b27c4=_0xb5bed4['data']['toView'](_0x43f5dd['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x39883f=new Dt(_0xb5bed4['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x5b27c4,_0x39883f);let _0x5885a3=await this['_getDocumentDataStringFromView'](_0x5b27c4);const _0x510a00=this['_getMarkersInDocumentOrder'](),_0x48f0da=[];for(const _0xfbc5c3 of _0x510a00){const _0x5ada8c='<'+_0xfbc5c3['name']+':start></'+_0xfbc5c3['name']+':start>',_0xa7ac54=_0x5885a3['indexOf'](_0x5ada8c);_0x5885a3=_0x5885a3['substring'](0x0,_0xa7ac54)+_0x5885a3['substring'](_0xa7ac54+_0x5ada8c['length']);const _0x1289c3='<'+_0xfbc5c3['name']+':end></'+_0xfbc5c3['name']+':end>',_0x1c739b=_0x5885a3['indexOf'](_0x1289c3);_0x5885a3=_0x5885a3['substring'](0x0,_0x1c739b)+_0x5885a3['substring'](_0x1c739b+_0x1289c3['length']),_0x48f0da['push']({'markerName':_0xfbc5c3['name'],'start':_0xa7ac54,'end':_0x1c739b,'htmlFragment':_0x5885a3['substring'](_0xa7ac54,_0x1c739b)});}return{'content':_0x5885a3,'version':_0xb5bed4['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x48f0da};}async['afterInit'](){this['context']instanceof dt?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x53f44b,_0x5a236a)=>{_0x5a236a['on']('ready',()=>{this['_integrateEditor'](_0x5a236a);});});}['_setOutputDataProcessor'](_0x3d9dff){this['_outputDataProcessor']=_0x3d9dff;}async['_getDocumentDataStringFromView'](_0x5bbc5e){let _0x4d18bb;const _0x59e74e=T(this['context']);if(this['_outputDataProcessor']){const _0x578d16=_0x59e74e['data']['processor']['domConverter']['viewToDom'](_0x5bbc5e),_0x4e7eb9=await this['_outputDataProcessor'](_0x578d16);_0x4d18bb=_0x59e74e['data']['processor']['htmlWriter']['getHtml'](_0x4e7eb9);}else _0x4d18bb=_0x59e74e['data']['processor']['toData'](_0x5bbc5e);return _0x4d18bb;}['_integrateEditor'](_0x2e9d3e){_0x2e9d3e['conversion']['for']('editingDowncast')['markerToHighlight']({'model':R,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x2e9d3e['conversion']['for']('dataDowncast')['markerToElement']({'model':R,'view':(_0x2bb6a8,{writer:_0x115c51,options:_0x112b1d})=>_0x112b1d['convertAiChatSelectionMarker']?_0x115c51['createUIElement'](_0x2bb6a8['markerName']+':'+(_0x2bb6a8['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x5b885f,_0x3dd943,_0x1e1478=!0x1,_0x1e36ef=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x1e36ef)return!0x1;const _0x15aef1=T(this['context'])['model'];return _0x15aef1['change'](_0x541317=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x3dd943,this['_displayedFakeSelectionLocked']=_0x1e1478;let _0x1c7604=0x0;for(let _0x25c0a2 of _0x5b885f){const _0x9b68f6=R+':'+_0x1c7604;if(_0x25c0a2['start']['isAtEnd']){const _0x4298db=_0x25c0a2['start']['getLastMatchingPosition'](({item:_0x5d1cae})=>!_0x15aef1['schema']['isContent'](_0x5d1cae),{'boundaries':_0x25c0a2});_0x25c0a2=_0x541317['createRange'](_0x4298db,_0x25c0a2['end']);}_0x541317['addMarker'](_0x9b68f6,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x25c0a2}),_0x1c7604++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x28d0cc){if(this['_displayedFakeSelectionId']!=_0x28d0cc)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x3f668a=T(this['context']),_0x5eb77e=_0x3f668a['model']['markers']['getMarkersGroup'](R);return _0x3f668a['model']['change'](_0x2cbe94=>{for(const _0x14315e of _0x5eb77e)_0x2cbe94['removeMarker'](_0x14315e);}),!0x0;}async['modelToDataWithIds'](_0x44b865){const _0x5596df=T(this['context']),_0x36581c=_0x5596df['data']['toView'](_0x44b865),_0x3fc27f=new Dt(_0x5596df['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x36581c,_0x3fc27f),this['_getDocumentDataStringFromView'](_0x36581c);}['_setDataIdsOnChildren'](_0x469b4b,_0x4f5826){let _0x433511=!0x1;const _0xf049a0=new Set();for(const _0x175f68 of _0x469b4b['getChildren']()){const _0x1fd9c7=_0x175f68['is']('emptyElement')||_0x175f68['is']('containerElement');if(!_0x175f68['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x175f68,_0x4f5826)||_0x1fd9c7)&&(_0x4f5826['setAttribute']('data-id',this['_nextDataId'](_0xf049a0),_0x175f68),_0x433511=!0x0);}return _0x433511;}['_nextDataId'](_0x4b5826){let _0x43048b;do{_0x43048b='';for(let _0x4a28cb=0x0;_0x4a28cb<0x4;_0x4a28cb++)_0x43048b+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x4b5826['has'](_0x43048b));return _0x4b5826['add'](_0x43048b),_0x43048b;}['getSelectionText'](){const {model:_0x18fd9f}=T(this['context']),_0x2d2fd7=_0x18fd9f['document']['selection'],_0x5d5582=[];for(const _0x24bf6e of _0x2d2fd7['getRanges']())for(const _0x51cd37 of _0x24bf6e['getItems']())_0x51cd37['is']('$textProxy')?_0x5d5582['push'](_0x51cd37['data']):_0x51cd37['is']('element')&&_0x5d5582['length']>0x0&&'\x20'!==_0x5d5582[_0x5d5582['length']-0x1]&&_0x5d5582['push']('\x20');return _0x5d5582['length']?'\x22'+_0x5d5582['join']('')['trim']()+'\x22':i(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_getMarkersInDocumentOrder'](){const _0xe83bf4=T(this['context'])['model'];return Array['from'](_0xe83bf4['markers']['getMarkersGroup'](R))['sort']((_0x547d25,_0x2575dd)=>_0x547d25['getStart']()['isBefore'](_0x2575dd['getStart']())?-0x1:_0x547d25['getStart']()['isAfter'](_0x2575dd['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(_0x3000b0){this['options']={'delay':_0x3000b0['delay']??0x14,'textNodeStyle':_0x3000b0['textNodeStyle'],'onStreamUpdate':_0x3000b0['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x463983,targetElement:_0x587274,abortSignal:_0x57d833}){this['isStreaming']&&this['stop'](),_0x57d833?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x11b822(_0x463983,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x2ffd75=0x0;_0x2ffd75<this['currentIndex'];_0x2ffd75++)this['nodesList'][_0x2ffd75]['shouldBeStreamed']=!0x0;do{const _0x5b3055=Date['now'](),_0x3ce44a=this['nodesList'][this['currentIndex']],_0x5d82ff=_0x5b3055-this['lastUpdateTime'];if(_0x3ce44a){_0x3ce44a['shouldBeStreamed']=!0x0;let _0x1714da=_0x3ce44a['parent'];for(;_0x1714da;)_0x1714da['shouldBeStreamed']=!0x0,_0x1714da=_0x1714da['parent'];}if(_0x5d82ff<this['options']['delay'])try{const {promise:_0x5f3535,abortController:_0x5d4d56}=Os(this['options']['delay']-_0x5d82ff);this['timeoutAbortController']=_0x5d4d56,await _0x5f3535;}catch(_0x121f83){return;}_0x5e40b6(_0x587274,'<'+_0x587274['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x587274['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:_0x3180e4}){Array['from'](_0x3180e4['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x2fb53d=>{_0x2fb53d['replaceWith'](_0x2fb53d['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x3136e8){let _0x3232c4='';if(function(_0x32894d){return _0x52a1d6(_0x32894d);}(_0x3136e8)){for(const _0x486f72 of _0x3136e8['children'])_0x3232c4+=this['renderNode'](_0x486f72);}else{if(Ls(_0x3136e8)){if(!_0x3136e8['shouldBeStreamed'])return'';const _0x3de169=_0x3136e8,_0x3fc6eb=Object['entries'](_0x3de169['attribs'])['map'](([_0x2a0b28,_0x336dd7])=>_0x2a0b28+'=\x22'+_0x336dd7+'\x22')['join']('\x20');_0x3232c4+='<'+_0x3de169['tagName']+(_0x3fc6eb?'\x20'+_0x3fc6eb:'')+'>';for(const _0xf7c699 of _0x249feb(_0x3de169))_0x3232c4+=this['renderNode'](_0xf7c699);_0x3232c4+='</'+_0x3de169['tagName']+'>';}else{if(!Ts(_0x3136e8))return'';if(!_0x3136e8['shouldBeStreamed'])return'';!function(_0x214106){if(!_0x214106['parent']||!Ls(_0x214106['parent']))return!0x1;if(!ys['includes'](_0x214106['parent']['tagName']))return!0x1;return!_0x49ccfa(_0x214106)['match'](/^\s*[<>]\s*$/);}(_0x3136e8)?_0x3232c4+=_0x21dae7(_0x3136e8):_0x3232c4+=_0x21dae7(new _0x29a7aa('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x3136e8]));}}return _0x3232c4;}['getParsedDocumentNodeList'](){const _0x461af1=[];return function(_0x173ab0,_0x51d997){const _0x4e3340=_0x234cd5=>{if(_0x51d997(_0x234cd5),_0x234cd5 instanceof _0x1736d2)for(let _0x840854=0x0;_0x840854<_0x234cd5['children']['length'];_0x840854++){const _0x42752a=_0x234cd5['children'][_0x840854];_0x4e3340(_0x42752a);}};for(let _0x356ab3=0x0;_0x356ab3<_0x173ab0['children']['length'];_0x356ab3++)_0x4e3340(_0x173ab0['children'][_0x356ab3]);}(this['document'],_0x1bd82a=>{if(Ts(_0x1bd82a)){const _0x413b1f=this['splitTextNodeIntoWordNodes'](_0x1bd82a);_0x413b1f['length']&&_0x461af1['push'](..._0x413b1f);}_0x1bd82a['isWordSplitSource']||_0x1bd82a['isWordSplitResult']||_0x461af1['push'](_0x1bd82a);}),_0x461af1;}['splitTextNodeIntoWordNodes'](_0x1ca752){if(_0x1ca752['isWordSplitSource']||_0x1ca752['isWordSplitResult'])return[];const _0x459c98=_0x49ccfa(_0x1ca752)['match'](/(?:\s*\S+\s*)/g),_0x2c7eb5=[];if(_0x459c98&&_0x459c98['length']>0x1){for(const _0x19dd4e of _0x459c98){const _0x2fba57=new _0x5a5d84(_0x19dd4e);_0x2fba57['isWordSplitResult']=!0x0,_0x5cae71(_0x1ca752,_0x2fba57),_0x2c7eb5['push'](_0x2fba57);}_0x1ca752['isWordSplitSource']=!0x0,_0x49d15d(_0x1ca752);}return _0x2c7eb5;}}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(_0x2e16d6){return _0x111077(_0x2e16d6);}function Ls(_0x4d9465){return _0x3810c4(_0x4d9465);}function Os(_0x297bcc){const _0x5f15a1=new AbortController();return{'promise':new Promise((_0xb4640b,_0x31f951)=>{const _0x2806d6=setTimeout(_0xb4640b,_0x297bcc);_0x5f15a1['signal']['addEventListener']('abort',()=>{clearTimeout(_0x2806d6),_0x31f951();});}),'abortController':_0x5f15a1};}class Fr extends _0x10e3da{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x3bbc52){super();const _0x29f7d2=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']=_0x3bbc52,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x29f7d2['if']('isDone','ck-ai-chat__feed__item_done'),_0x29f7d2['if']('isVisible','ck-hidden',_0x230de3=>!_0x230de3),'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'](_0x4541df=>{_0x4541df['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x127fd0,_0x42e2bc,_0x1f6e6e){await this['htmlStreamer']['stream']({'document':_0x127fd0,'targetElement':_0x42e2bc,'abortSignal':_0x1f6e6e});}}class oa extends _0x10e3da{['showChangesToggleView'];constructor(_0x43f3ed,_0xe9ebb){super(_0x43f3ed),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Zn(_0x43f3ed),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':i(_0x43f3ed,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0xe9ebb['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x5220ff=>_0x5220ff?_0x437493:_0x4568be),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x4248e7=new _0x5d3550();_0x4248e7['content']=_0x29872c,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0xe9ebb['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x4248e7,{'tag':'span','children':[i(_0x43f3ed,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Zn extends _0x42f5cd{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const Or={'accepted':_0x1ee526,'rejected':_0x31cb58,'outdated':_0x31cb58};class ws extends _0x10e3da{['stateIconView'];constructor(_0x162220){super(_0x162220);const _0x470741=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',_0x470741['to']('state',_0x51b22b=>'ck-ai-suggestion__content-part-state_'+_0x51b22b),_0x470741['if']('isVisible','ck-hidden',_0x42f036=>!_0x42f036)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x470741['to']('state',_0x10b00b=>{switch(_0x10b00b){case'accepted':return i(_0x162220,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return i(_0x162220,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return i(_0x162220,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x2cdf1a){this['state']=_0x2cdf1a;}}class Nr extends _0x5d3550{constructor(){super(),this['set']('state','accepted'),this['content']=Or[this['state']],this['on']('change:state',()=>{this['content']=Or[this['state']];});}}class cs extends _0x243ac0{['_applyButton'];['_suggestButton'];constructor(_0x2d7e1b,_0xed56ca,_0x41a7ff){super(_0x2d7e1b);const _0x31405b=Boolean(_0x41a7ff);this['set']('isEnabled',!_0x31405b),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0xde0177=[];if(_0x31405b){const _0x300c91=new _0x42f5cd(_0x2d7e1b);_0x300c91['set']({'label':i(_0x2d7e1b,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':tc}),_0xde0177['push'](_0x300c91);}else{_0xed56ca['includes']('applySuggestion')&&(this['_applyButton']=new _0x42f5cd(_0x2d7e1b),this['_applyButton']['set']({'label':i(_0x2d7e1b,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x1ee526}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0xde0177['push'](this['_applyButton'])),_0xed56ca['includes']('insertSuggestion')&&(this['_suggestButton']=new _0x42f5cd(_0x2d7e1b),this['_suggestButton']['set']({'label':i(_0x2d7e1b,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x13fc41}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0xde0177['push'](this['_suggestButton']));const _0x50883b=new _0x42f5cd(_0x2d7e1b);_0x50883b['set']({'label':i(_0x2d7e1b,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x31cb58}),_0x50883b['bind']('isEnabled')['to'](this),_0x50883b['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0xde0177['push'](_0x50883b);}this['items']['addMany'](_0xde0177);const _0x35d188=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x35d188['if']('isVisible','ck-hidden',_0x341669=>!_0x341669)]}});}['setButtonsVisibility']({showApplyButton:_0x102502,showSuggestButton:_0x53b982}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x102502),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x53b982);}}class vn extends _0x10e3da{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x3dfcfb,{part:_0x1ec5cf,uiIndex:_0x5995b4,availableActions:_0x2a7a6f,areActionsDisabled:_0x5c1a7b}){super(_0x3dfcfb),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new cs(_0x3dfcfb,_0x2a7a6f,_0x5c1a7b),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x1ec5cf['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x1ec5cf['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x1ec5cf['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new ws(_0x3dfcfb),this['titleLabelView']=new Sn(_0x3dfcfb,_0x5995b4),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',(_0x4d4f2d,_0x336842,_0x2ce101,_0x5e1d10)=>{'pending'===_0x5e1d10?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x2ce101?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x2ce101),this['children']['add'](this['stateView']));});}}class Sn extends _0x10e3da{constructor(_0x85daf9,_0x22fb1d){super(_0x85daf9),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[i(_0x85daf9,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x22fb1d['toString']())]});}}class as extends _0x10e3da{['htmlStreamer'];constructor(_0x3b4e77){super(_0x3b4e77),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:_0x25934d,renderingStrategy:_0x2e64c7,abortSignal:_0x36f9ee}){'streaming'===_0x2e64c7?await this['htmlStreamer']['stream']({'document':_0x25934d['content'],'targetElement':this['element'],'abortSignal':_0x36f9ee}):this['element']['innerHTML']=Tt(_0x25934d['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class na extends _0x10e3da{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x52b8a4,{part:_0x3a5783,uiIndex:_0x3c1b1e,areActionsDisabled:_0x15790a,availableActions:_0x138168}){super(_0x52b8a4);const _0x43ea4d=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x4f9ee3=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x15790a;};this['on']('change:state',_0x4f9ee3),this['on']('change:isDone',_0x4f9ee3),_0x4f9ee3(),this['_children']=this['createCollection'](),this['_headerView']=new vn(_0x52b8a4,{'part':_0x3a5783,'uiIndex':_0x3c1b1e,'availableActions':_0x138168,'areActionsDisabled':_0x15790a}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...ut)['to'](this),this['_streamableContentView']=new as(_0x52b8a4),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x43ea4d['to']('state',_0x434544=>'ck-ai-suggestion__body__content-part_'+_0x434544),_0x43ea4d['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x43ea4d['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x43ea4d['if']('isVisible','ck-hidden',_0x369272=>!_0x369272)]},'children':this['_children'],'on':{'mouseenter':_0x43ea4d['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x3a5783['index']});}),'mouseleave':_0x43ea4d['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x3a5783['index']});}),'click':_0x43ea4d['to'](_0x420d38=>{const _0x477265=_0x420d38['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x477265)&&this['fire']('showChangeInText',{'index':_0x3a5783['index']});})}});}async['updateContent']({part:_0x49ba3a,renderingStrategy:_0x1732a3,showUnchangedParts:_0x1e7277=!0x1,abortSignal:_0x33aeff}){this['partDefinition']=_0x49ba3a,this['isVisible']=this['partDefinition']['hasChanges']||_0x1e7277,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x49ba3a,'renderingStrategy':_0x1732a3,'abortSignal':_0x33aeff});}['markAsDone'](){this['isDone']=!0x0;}}class z extends _0x5d9d11(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0xe15e53){const _0x139fca=this['createTask'](_0xe15e53);return this['queue']['push'](_0x139fca),this['_processQueue'](),_0x139fca['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(_0x21db57=>{this['once']('_queueEmpty',()=>{_0x21db57();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x371e5b=this['queue']['shift']();try{await _0x371e5b['callback'](this['_abortController']['signal']),_0x371e5b['resolve']();}catch(_0x37c146){_0x371e5b['reject'](_0x37c146);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x684e55){let _0xc55876,_0x525f7a;const _0x26a5bc=new Promise((_0x358fac,_0x37f510)=>{_0xc55876=_0x358fac,_0x525f7a=_0x37f510;});return{'callback':_0x684e55,'resolve':_0xc55876,'reject':_0x525f7a,'completePromise':_0x26a5bc};}}class mi extends Fr{constructor(_0x1e6d20){super(_0x1e6d20),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x1e6d20['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x396546){this['element']['innerHTML']=_0x396546;}}const ot=['applySuggestion','insertSuggestion'];class ra extends _0x10e3da{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x22d798,_0x2e0025=[...ot],_0x3c8e1b){super(_0x22d798);const _0x451607=this['bindTemplate'],_0x113c70=Boolean(_0x3c8e1b);if(this['set']('isEnabled',!_0x113c70),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x113c70){const _0x3c5153=new _0x42f5cd(_0x22d798);_0x3c5153['set']({'label':i(_0x22d798,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':tc});const _0x545e3e=new _0x10e3da(_0x22d798);_0x545e3e['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[i(_0x22d798,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x3c5153]}]}),this['children']['add'](_0x545e3e);}else this['_applyChangesButton']=new _0x42f5cd(_0x22d798),this['_applyChangesButton']['set']({'label':i(_0x22d798,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x2e0025['includes']('applySuggestion'),'class':'ck-ai-button-primary'}),this['_insertSuggestionsButton']=new _0x42f5cd(_0x22d798),this['_insertSuggestionsButton']['set']({'label':i(_0x22d798,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x2e0025['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'](_0x2e381a=>{_0x2e381a['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',_0x451607['if']('isVisible','ck-hidden',_0x6f7842=>!_0x6f7842)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x31ca0c){this['isVisible']=_0x31ca0c;}['_switchButtonLabelsPlurality'](_0xdb645b){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0xdb645b?(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 _0x10e3da{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x55cf79,_0x51793d){super(_0x55cf79),this['bodyCollection']=_0x51793d,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',_0x16dcce=>!_0x16dcce)]},'children':this['children']});const _0x11732a=new _0x10e3da(this['locale']),_0x4392e6=new _0x5d3550();_0x4392e6['content']=_0x35cba2,_0x11732a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x4392e6,{'tag':'span','children':[{'text':i(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x11732a),this['_setupBalloonPanel'](_0x55cf79);}['addSource'](_0x5545ab){this['children']['add'](new qr(this['locale'],_0x5545ab,this['balloonPanelView']));}['_setupBalloonPanel'](_0x3e30a9){this['balloonPanelView']=new _0x54c977(_0x3e30a9),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class qr extends _0x42f5cd{['balloonPanelView'];['source'];constructor(_0x4aa328,_0x20ae61,_0x1c737f){super(_0x4aa328),this['source']=_0x20ae61,this['balloonPanelView']=_0x1c737f,this['set']({'label':_0x20ae61['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x2c2d52=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x2c2d52['to'](()=>{window['open'](_0x20ae61['url'],'_blank');}),'mouseenter':_0x2c2d52['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x2c2d52['to'](()=>{this['_hideTooltip']();})}}),_0x20ae61['favicon']){const _0x71c1b7=new _0x10e3da(_0x4aa328);_0x71c1b7['setTemplate']({'tag':'img','attributes':{'src':_0x20ae61['favicon']||_0x35cba2,'alt':_0x20ae61['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x71c1b7);}else this['set']('icon',_0x35cba2);}['_createTooltipContentView'](_0x1e3e39,_0x53c1af){const _0x2f8473=new _0x10e3da(_0x1e3e39),_0x8b7a9b=[];let _0x32e397;_0x53c1af?.['favicon']?(_0x32e397=new _0x10e3da(_0x1e3e39),_0x32e397['setTemplate']({'tag':'img','attributes':{'src':_0x53c1af['favicon'],'alt':_0x53c1af['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x32e397=new _0x5d3550(),_0x32e397['content']=_0x35cba2,_0x32e397['extendTemplate']({'attributes':{'alt':_0x53c1af['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x8b7a9b['push'](_0x32e397);const _0x14fbea=new _0x10e3da(_0x1e3e39);_0x14fbea['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x53c1af['url']},'children':[{'text':new URL(_0x53c1af['url'])?.['hostname']}]}),_0x8b7a9b['push'](_0x14fbea);const _0x3ba9c6=new _0x10e3da(_0x1e3e39);_0x3ba9c6['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x8b7a9b});const _0x2ba3f8=new _0x10e3da(_0x1e3e39);return _0x2ba3f8['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x53c1af['title']['length']>0x190?_0x53c1af['title']['substring'](0x0,0x190)+'...':_0x53c1af['title']}]}),_0x2f8473['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x3ba9c6,_0x2ba3f8]}),_0x2f8473;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[_0x54c977['defaultPositions']['northArrowSouth'],_0x54c977['defaultPositions']['northArrowSouthWest'],_0x54c977['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 _0x244a20=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x244a20);}}class ca extends _0x10e3da{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x2cef4c,_0x19504b){super(_0x2cef4c);const {areActionsDisabled:_0x588f70,showUnchangedParts:_0x367116,availableActions:_0x469688}=_0x19504b;this['_areActionsDisabled']=_0x588f70,this['_showUnchangedParts']=_0x367116,this['_availableActions']=_0x469688,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(_0x2cef4c,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new ra(_0x2cef4c,_0x19504b['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sr(this['locale'],_0x19504b['bodyCollection']),_0x19504b['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:_0x40a3d4,renderingStrategy:_0x1b78cf,abortSignal:_0x2692b4}){this['_children']['length']?_0x40a3d4['forEach'](_0x22c2d3=>{const _0x51f8cf=this['_cachedContentParts']['findIndex'](_0x4919bc=>_0x4919bc['index']==_0x22c2d3['index']);-0x1===_0x51f8cf?this['_cachedContentParts']['push'](_0x22c2d3):this['_cachedContentParts'][_0x51f8cf]=_0x22c2d3;}):this['_cachedContentParts']=_0x40a3d4;const _0x391dcf=this['_showUnchangedParts']?_0x40a3d4:_0x40a3d4['filter'](_0x1e6e8b=>_0x1e6e8b['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x391dcf['length']>0x1);for(const _0x427781 of _0x391dcf)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x17e567=>{let _0x2d1c52=this['getPartView'](_0x427781['index']);_0x2d1c52||(_0x2d1c52=new na(this['locale'],{'part':_0x427781,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x2d1c52['delegate'](...ut)['to'](this),this['_children']['add'](_0x2d1c52),this['hasPendingParts']=!0x0),await _0x2d1c52['updateContent']({'part':_0x427781,'renderingStrategy':_0x1b78cf,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x17e567}),_0x2d1c52['markAsDone']();});return _0x2692b4?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x241e9e,_0x3432c7){const _0xabe8b4=this['getPartView'](_0x241e9e);_0xabe8b4&&(_0xabe8b4['state']=_0x3432c7),this['hasPendingParts']='pending'==_0x3432c7||Array['from'](this['_children'])['some'](_0x1ec551=>'pending'==_0x1ec551['state']);}['setPartActive'](_0xba3d94,_0x1e9477){if(!0x1===_0xba3d94){for(const _0x12b838 of this['_children'])_0x12b838['isActive']=!0x1;}else{const _0x441664=this['getPartView'](_0xba3d94);_0x441664&&(_0x441664['isActive']=_0x1e9477);}}['updateSources'](_0x2624ba){_0x2624ba['forEach'](_0x454bc1=>this['_sourcesView']['addSource'](_0x454bc1)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x128709){return this['_children']['find'](_0x112b26=>_0x112b26['partDefinition']['index']==_0x128709)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x2cef2c=!this['_cachedContentParts']['find'](({hasChanges:_0x6f0cf6})=>_0x6f0cf6),_0x1033b0=!!this['_cachedContentParts']['find'](({hasChanges:_0xaeba77})=>!_0xaeba77);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x1033b0,_0x2cef2c?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'](_0x33cef9=>_0x33cef9['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0xebfa9e=>_0xebfa9e['partDefinition']['hasChanges'])['length']>0x0;}}class gn extends _0x10e3da{['bodyView'];['children'];['headerView'];constructor(_0x1fb42d,_0x3cb39f,_0x55fe14){super(_0x1fb42d);const {showDiff:_0x342029,areActionsDisabled:_0xdbefba,showUnchangedParts:_0x33d821,availableActions:_0x780c52}=_0x3cb39f;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new oa(_0x1fb42d,{'showDiff':_0x342029}),this['headerView']['on']('toggleShowChanges',(_0x5d6197,_0x3cc345)=>{this['areChangesVisible']=_0x3cc345['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x3cc345['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new ca(_0x1fb42d,{'areActionsDisabled':_0xdbefba,'showUnchangedParts':!!_0x33d821,'availableActions':_0x780c52,'bodyCollection':_0x55fe14}),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'](_0x2ea093){await this['bodyView']['updateContentParts'](_0x2ea093);}['updateSources'](_0x48f856){this['bodyView']['updateSources'](_0x48f856);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class ai extends Fr{['containerView'];constructor(_0x469a8c,_0x355c37,_0x1963c4){super(_0x355c37),this['set']('isTrackChangesOn',!0x1),this['containerView']=new gn(_0x469a8c,{'showDiff':_0x355c37['showDiff'],'areActionsDisabled':_0x355c37['areActionsDisabled'],'availableActions':_0x355c37['availableActions']},_0x1963c4),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x19ad05,_0x426b84)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x426b84['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',(_0x1f62f4,{index:_0x35e94a})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x35e94a});}),this['containerView']['on']('applySuggestion',(_0xf63a03,{index:_0x5d7bce}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x5d7bce});}),this['containerView']['on']('insertSuggestion',(_0x4102d1,{index:_0x5b3ef4}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x5b3ef4});}),this['containerView']['on']('rejectSuggestion',(_0x447cda,{index:_0xe6cbc5})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0xe6cbc5});}),this['containerView']['on']('mouseOverSuggestion',(_0x194ef0,{index:_0x30555a})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x30555a});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x3d591b,{index:_0x403372})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x403372});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x3bc29e){await this['containerView']['updateContent'](_0x3bc29e);}['updatePartState'](_0x5b7d40,_0x43a386){this['containerView']['bodyView']['updatePartState'](_0x5b7d40,_0x43a386);}['setPartActive'](_0x1c2d21,_0x42e95a){!0x1===_0x1c2d21?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x1c2d21,_0x42e95a);}['updateSources'](_0x4653d7){this['containerView']['updateSources'](_0x4653d7);}['getPartView'](_0x535a4c){return this['containerView']['bodyView']['getPartView'](_0x535a4c);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class di extends Fr{['replyContainer'];['_bodyCollection'];constructor(_0x567f90,_0x4ceece,_0x47cadd){super(_0x4ceece),this['_bodyCollection']=_0x47cadd,this['locale']=_0x567f90,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x10e3da(),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:_0x4c0fc0,renderingStrategy:_0x4be215,abortSignal:_0x5b5684}){'streaming'===_0x4be215?await this['streamIntoElement'](_0x4c0fc0,this['replyContainer']['element'],_0x5b5684):this['replyContainer']['element']['innerHTML']=_0x21dae7(_0x4c0fc0);}['updateSources'](_0x416d71){const _0x338b52=new Sr(this['locale'],this['_bodyCollection']);_0x338b52['children']['addMany'](_0x416d71['map'](_0x2dde66=>new qr(this['locale'],_0x2dde66,_0x338b52['balloonPanelView']))),_0x338b52['isVisible']=!0x0,this['children']['add'](_0x338b52);}}class pi extends _0x4d3539{constructor(_0x3ae6b0=void 0x0){super();const _0x487f1d=_0x3ae6b0?'ck-ai-spinner_'+_0x3ae6b0:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x487f1d]}});}}const xn={'file':_0x3d17c6,'document':_0x502d01,'web-resource':_0x31c7e3,'text':_0x3d17c6,'selection':_0xff1518,'mcp-tool-context':_0x502d01},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 _0x42f5cd{constructor(_0x28209f,_0x2ea9fe,_0x403e25,_0x337f54,_0x25193a=!0x1){super(_0x28209f),this['_isAnimationOnEnterEnabled']=_0x337f54,this['_initializeProperties'](_0x2ea9fe,_0x403e25,_0x25193a),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'](_0x575605,_0x38d09b,_0x3add97){this['set']('label',_0x575605['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x575605['type']),this['set']('id',_0x575605['uiId']),this['set']('readonly',_0x38d09b),this['set']('isLoading',_0x3add97);}['_setupTemplate'](){const _0x355384=this['_createIconView'](),_0x4a845e=this['_createRemoveButton'](),_0x566e0c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x566e0c),'children':this['_createTemplateChildren'](_0x355384,_0x4a845e,_0x566e0c)});}['_createTemplateAttributes'](_0x89eac1){return{'class':[Ur,_0x89eac1['if']('itemType',Yr,_0x29875f=>'document'==_0x29875f),_0x89eac1['if']('itemType',Wr,_0x1858b7=>'selection'==_0x1858b7)],'data-cke-tooltip-text':_0x89eac1['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':Xr};}['_createTemplateChildren'](_0x2ec353,_0x437153,_0x1456e5){const _0xa7b560=this['_createLabelElement'](_0x1456e5),_0x38455f=this['_createLoaderIcon']();return this['readonly']?[_0x2ec353,_0xa7b560]:[_0x2ec353,_0x38455f,_0xa7b560,_0x437153];}['_createLabelElement'](_0x1eae83){return{'tag':'span','attributes':{'class':$r},'children':[{'text':_0x1eae83['to']('label')}]};}['_createRemoveButton'](){const _0x30a97c=new _0x42f5cd(this['locale']);return _0x30a97c['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x1e97a7}),this['_setupRemoveButtonEvent'](_0x30a97c),_0x30a97c;}['_setupRemoveButtonEvent'](_0x6439cc){_0x6439cc['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x2f045b=this['bindTemplate'],_0xcd0472=new _0x5d3550();return _0xcd0472['content']=xn[this['itemType']],_0xcd0472['extendTemplate']({'attributes':{'class':[Qr,_0x2f045b['if']('isLoading','ck-hidden',_0x5a46b0=>_0x5a46b0)]}}),_0xcd0472;}['_handleAnimationEndOnce'](_0x54ba63,_0x4831a1){if(!_0x54ba63)return;const _0x249093=()=>{_0x4831a1(),_0x54ba63['removeEventListener']('animationend',_0x249093),_0x54ba63['removeEventListener']('webkitAnimationEnd',_0x249093);};_0x54ba63['addEventListener']('animationend',_0x249093),_0x54ba63['addEventListener']('webkitAnimationEnd',_0x249093);}['_createLoaderIcon'](){const _0x5bd91c=new pi('small');return _0x5bd91c['bind']('isVisible')['to'](this,'isLoading',_0x3e3848=>_0x3e3848),_0x5bd91c;}}function In(_0x391be3){if(!_0x391be3)return _0x391be3;if(_0x391be3['length']<=0x78)return _0x391be3;const _0x50054c=_0x391be3['slice'](0x0,0x78),_0x3c401a=_0x50054c['lastIndexOf']('\x20');return(_0x3c401a>0x0?_0x50054c['slice'](0x0,_0x3c401a):_0x50054c)+'…';}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(_0x15054c,_0xe910a5,_0x18a9f4,_0x4e4dbc,_0x1b7b0b){this['_locale']=_0x15054c,this['_visibleChips']=_0xe910a5,this['_config']={...hn,..._0x18a9f4,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x18a9f4['cssClasses']}},this['_overflowChips']=new _0x305a6b(),this['_bodyCollection']=_0x4e4dbc,this['_parentView']=_0x1b7b0b||null;}['setContainerElement'](_0x38c8cb){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x38c8cb,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 _0x5b0974=[...this['_visibleChips'],...this['_overflowChips']],_0x5f458e=this['_createCalculationContainer'](),_0x3222d7=this['_calculateOverflowInContainer'](_0x5f458e,_0x5b0974),_0x444eaa=_0x5f458e['_ancestorsToRestore'];_0x444eaa&&this['_restoreAncestorVisibility'](_0x444eaa),_0x5f458e['remove'](),this['_applyOverflowResults'](_0x5b0974,_0x3222d7);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x4fafed({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x584291=new _0x42f5cd(this['_locale']);_0x584291['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x428aa4=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x428aa4['push'](this['_config']['cssClasses']['controlsButton']),_0x584291['extendTemplate']({'attributes':{'class':_0x428aa4}}),_0x584291;}['_createShowMoreBalloonPanelView'](){const _0x471ee8=new _0x54c977(this['_locale']);return _0x471ee8['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x471ee8),_0x471ee8;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0xb40ea9=>{_0xb40ea9['disableAnimationOnEnter']();});const _0x3d2e63=new _0x10e3da(this['_locale']);_0x3d2e63['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x3d2e63);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0xfa2d95=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0xfa2d95?'':'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'](_0xa28f3){const _0x10c80b=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x58bbad=this['_containerElement']?.['classList'];if(_0x58bbad){const _0x2e870b=_0x58bbad[0x0]||'',_0x17f344=_0xa28f3['querySelector']('.'+_0x2e870b),_0x5419eb=_0xa28f3['querySelector'](_0x10c80b);return _0x17f344||_0x5419eb||_0xa28f3;}return _0xa28f3['querySelector'](_0x10c80b)||_0xa28f3;}['_calculateContainerWidth'](){const _0x2933cc=this['_parentView']?.['element']||this['_containerElement'];if(!_0x2933cc)return an;const _0x1b7ccd=window['getComputedStyle'](_0x2933cc)['width'];if('auto'===_0x1b7ccd||'0px'===_0x1b7ccd||!_0x1b7ccd){const _0x300438=_0x2933cc['parentElement'];if(_0x300438){const _0x2a2536=window['getComputedStyle'](_0x300438);return'auto'!==_0x2a2536['width']?_0x2a2536['width']:an;}return an;}return _0x1b7ccd;}['_applyCalculationStyles'](_0x46b195,_0x321269){this['_config']['cssClasses']['calculationContainer']&&_0x46b195['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x46b195['style']['width']=_0x321269,_0x46b195['style']['position']='absolute',_0x46b195['style']['top']='-9999px',_0x46b195['style']['left']='-9999px',_0x46b195['style']['opacity']='0',_0x46b195['style']['pointerEvents']='none',_0x46b195['style']['zIndex']='-1',_0x46b195['style']['visibility']='visible\x20!important',_0x46b195['style']['display']='block\x20!important',_0x46b195['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x1298c3){_0x1298c3['forEach'](({element:_0x289792,originalDisplay:_0x362252,originalVisibility:_0x3f1b71})=>{_0x289792['style']['display']=_0x362252,_0x289792['style']['visibility']=_0x3f1b71;});}['_makeAncestorsVisible'](_0xf734ab){const _0x3cb9f9=[];let _0xbb1f4f=_0xf734ab;for(;_0xbb1f4f&&_0xbb1f4f!==document['body'];){const _0x3f87fa=window['getComputedStyle'](_0xbb1f4f);'none'!==_0x3f87fa['display']&&'hidden'!==_0x3f87fa['visibility']||(_0x3cb9f9['push']({'element':_0xbb1f4f,'originalDisplay':_0xbb1f4f['style']['display'],'originalVisibility':_0xbb1f4f['style']['visibility']}),_0xbb1f4f['style']['display']='block',_0xbb1f4f['style']['visibility']='visible'),_0xbb1f4f=_0xbb1f4f['parentElement'];}return _0x3cb9f9;}['_createContainerElements'](){let _0x47a627,_0x5e7a99;return this['_parentView']?.['element']?(_0x47a627=this['_parentView']['element']['cloneNode'](!0x0),_0x5e7a99=this['_findTargetContainer'](_0x47a627)):(_0x47a627=document['createElement']('div'),_0x5e7a99=_0x47a627),{'calculationContainer':_0x47a627,'targetContainer':_0x5e7a99};}['_createCalculationContainer'](){const {calculationContainer:_0xe3641f,targetContainer:_0x3838f2}=this['_createContainerElements'](),_0x269a2a=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0xe3641f,_0x269a2a);const _0x54f7e6=this['_parentView']?.['element']||this['_containerElement'],_0xe831cb=_0x54f7e6?.['parentElement'];_0xe831cb?_0xe831cb['appendChild'](_0xe3641f):document['body']['appendChild'](_0xe3641f),_0xe3641f['_targetContainer']=_0x3838f2;const _0x22c0bd=this['_makeAncestorsVisible'](_0xe831cb||null);return _0xe3641f['offsetWidth'],_0xe3641f['_ancestorsToRestore']=_0x22c0bd,_0xe3641f;}['_calculateOverflowInContainer'](_0x52874b,_0x4b5535){const _0x12062e=_0x52874b['_targetContainer']||_0x52874b,_0x2c0783=[],{rowCount:_0x50cac6}=this['_renderChipsAndCountRows'](_0x12062e,_0x4b5535);if(_0x50cac6<=this['_config']['maxVisibleRows'])return _0x2c0783;const _0x557b0a=_0x4b5535['slice']();for(;_0x557b0a['length']>0x0;){if(this['_testButtonFit'](_0x52874b,_0x12062e,_0x557b0a)){const _0x1795d5=_0x4b5535['filter'](_0x124b9b=>!_0x557b0a['includes'](_0x124b9b));_0x2c0783['push'](..._0x1795d5);break;}if(!_0x557b0a['pop']())break;}return _0x2c0783;}['_renderChipsAndCountRows'](_0x5550b2,_0x43caef){_0x5550b2['innerHTML']='',_0x43caef['forEach'](_0x5c72c2=>{if(_0x5c72c2['element']){const _0x15fe95=_0x5c72c2['element']['cloneNode'](!0x0);_0x5550b2['appendChild'](_0x15fe95);}}),_0x5550b2['offsetWidth'];const _0x584b6f=_0x5550b2['children'],_0x51d61e=[];return Array['from'](_0x584b6f)['forEach'](_0x21ff2d=>{const _0x283e78=_0x21ff2d['getBoundingClientRect']()['top'];_0x51d61e['some'](_0x5c8a9d=>Math['abs'](_0x5c8a9d-_0x283e78)<this['_config']['rowDetectionTolerance'])||_0x51d61e['push'](_0x283e78);}),{'rowCount':_0x51d61e['length']};}['_createMockButton'](){const _0x17b315=document['createElement']('button');return _0x17b315['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x17b315['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x17b315['textContent']='+\x201',_0x17b315;}['_testButtonFit'](_0x48c463,_0xc66da8,_0x1f847b){this['_renderChipsAndCountRows'](_0xc66da8,_0x1f847b);const _0x40e337=this['_createMockButton']();_0x48c463['appendChild'](_0x40e337),_0x48c463['offsetWidth'];const _0x38ce9f=[..._0xc66da8['children'],_0x40e337],_0xcf2f94=[];_0x38ce9f['forEach'](_0x2f7d0e=>{const _0x5675be=_0x2f7d0e['getBoundingClientRect']()['top'];_0xcf2f94['some'](_0x1695d1=>Math['abs'](_0x1695d1-_0x5675be)<this['_config']['rowDetectionTolerance'])||_0xcf2f94['push'](_0x5675be);});const _0x287958=_0xcf2f94['length'];return _0x40e337['remove'](),_0x287958<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x17a179,_0x5dbbd4){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x17a179['forEach'](_0x348623=>{_0x5dbbd4['includes'](_0x348623)?this['_overflowChips']['add'](_0x348623):this['_visibleChips']['add'](_0x348623);});}['_updateOverflowUI'](_0x4a6778){if(_0x4a6778>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x4a6778>0x0&&this['_showMoreButtonView']){const _0x53ae73=''+this['_config']['showMoreLabelPrefix']+(_0x4a6778<0x63?_0x4a6778:'99');this['_showMoreButtonView']['label']=_0x53ae73;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x166e55,_0x916e90){this['_distributeChips'](_0x166e55,_0x916e90),this['_updateOverflowUI'](_0x916e90['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x4e82e9=>{_0x4e82e9[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 _0x5c8ebc=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x5c8ebc['width']||0x0===_0x5c8ebc['height'])return!0x1;const _0x303b6f=window['innerHeight']||document['documentElement']['clientHeight'],_0x210442=window['innerWidth']||document['documentElement']['clientWidth'],_0xa8531a=0xc8;return _0x5c8ebc['bottom']>=-0xc8&&_0x5c8ebc['top']<=_0x303b6f+_0xa8531a&&_0x5c8ebc['right']>=-0xc8&&_0x5c8ebc['left']<=_0x210442+_0xa8531a;}}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 _0x10e3da{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x32d31b,_0x3c36a6,_0x2b8bda){super(_0x32d31b),this['_bodyCollection']=_0x2b8bda,this['_createContextChips'](_0x3c36a6);const _0x571e34={'cssClasses':{'showMoreButton':_a,'showMoreBalloon':Aa,'overflowContainer':ua,'controlsButton':da}};this['_overflowManager']=new Ro(_0x32d31b,this['_contextChips'],_0x571e34,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 _0x31f129=this['element']['querySelector']('.'+la);_0x31f129&&(this['_overflowManager']['setContainerElement'](_0x31f129),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x5a384a){for(const _0x26759a of _0x5a384a){const _0x3a9284=new Vo(this['locale'],_0x26759a,!0x0,!0x1);this['_contextChips']['add'](_0x3a9284);}}}class li extends Fr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x1a2ada,_0x16b8ab,_0x4b6c1d){super(_0x16b8ab),this['_locale']=_0x1a2ada,this['_bodyCollection']=_0x4b6c1d,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'](_0x59b494=>!_0x59b494['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x10e3da(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(_0x2567a1,_0x604552){super(_0x604552);const {isWebSearchEnabled:_0x5a3cca,isReasoningEnabled:_0x20f00c}=_0x604552['capabilities'],_0x57af21=[];let _0x1e9a4e='';_0x5a3cca&&_0x20f00c?(_0x1e9a4e=i(_0x2567a1,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x57af21['push'](aa(_0x35cba2)),_0x57af21['push'](aa(_0x508bba))):_0x5a3cca?(_0x1e9a4e=i(_0x2567a1,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x57af21['push'](aa(_0x35cba2))):_0x20f00c&&(_0x1e9a4e=i(_0x2567a1,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x57af21['push'](aa(_0x508bba))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x1e9a4e?'':'ck-hidden']}});const _0x13b657=new _0x10e3da();_0x13b657['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x57af21,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x1e9a4e]}]}),this['children']['add'](_0x13b657),this['capabilities']=_0x604552['capabilities'];}}function aa(_0x3f21b9){const _0x2d185e=new _0x5d3550();return _0x2d185e['content']=_0x3f21b9,_0x2d185e;}const Fs=['wheel','touchstart','pointerdown','keydown'],qs=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class gi{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x28bf7e){this['element']=_0x28bf7e,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x48d5d0 of Fs){const _0x82d557='keydown'!==_0x48d5d0;this['element']['addEventListener'](_0x48d5d0,this['_onUserEvent']['bind'](this),{'passive':_0x82d557,'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'](_0x3eaece){if(this['isRunning']){if('keydown'===_0x3eaece['type']){const _0x305454=_0x3eaece['key'];if(!qs['includes'](_0x305454))return;}_0x3eaece instanceof WheelEvent?_0x3eaece['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x31353e,scrollHeight:_0x15d1ef,clientHeight:_0x11438c}=this['element'];return _0x15d1ef-_0x31353e-_0x11438c<=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 _0x10e3da{constructor(_0x47f706,_0x2faa89){super(_0x47f706),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x2faa89)});}['_createSkeletonItems'](_0x471671){const _0x5a9b22=['ck','ck-ai-skeleton__item'];return _0x471671['map'](_0x2aea01=>{let _0x7d116a='';switch(_0x2aea01['attributes']['align']){case'right':_0x7d116a='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x7d116a='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x7d116a='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x2aea01['tag'],'attributes':{'class':[..._0x5a9b22,_0x2aea01['attributes']['class']?_0x2aea01['attributes']['class']:''],'style':'width:\x20'+_0x2aea01['attributes']['width']+';\x20height:\x20'+_0x2aea01['attributes']['height']+';'+_0x7d116a}};});}}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(_0xb10451,_0x34f277,_0x59827a,_0x1fc467){return new Array(_0xb10451)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x34f277,'height':_0x59827a,'align':_0x1fc467}}));}class wi extends Fr{constructor(_0x192513){super(_0x192513),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 _0x10e3da{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x4d6eb6,_0x2eceb6){super(_0x4d6eb6),this['_bodyCollection']=_0x2eceb6,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'](_0x55e7be,_0x7197da){let _0xf48c31;return'ai-reply'===_0x55e7be?_0xf48c31=new di(this['locale'],_0x7197da,this['_bodyCollection']):'ai-suggestion-reply'===_0x55e7be?(_0xf48c31=new ai(this['locale'],_0x7197da,this['_bodyCollection']),_0xf48c31['bind']('isTrackChangesOn')['to'](this)):_0xf48c31='user-message'===_0x55e7be?new li(this['locale'],_0x7197da,this['_bodyCollection']):'interaction-header'===_0x55e7be?new Mt(this['locale'],_0x7197da):'custom-element'===_0x55e7be?new wi(_0x7197da):new mi(_0x7197da),this['children']['add'](_0xf48c31),_0xf48c31;}async['updateReplyItem']({id:_0x3c346a,parsedContent:_0x4cf9db,renderingStrategy:_0x169671,abortSignal:_0x5f035d}){const _0x420bf9=this['getItemById'](_0x3c346a);if(!(_0x420bf9 instanceof di))throw new _0x70c77e('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x420bf9,'id':_0x3c346a,'parsedContent':_0x4cf9db});await _0x420bf9['updateContent']({'parsedContent':_0x4cf9db,'renderingStrategy':_0x169671,'abortSignal':_0x5f035d});}async['updateWebSources'](_0x1cfaab,_0x324aed){const _0x50d9b5=this['getItemById'](_0x1cfaab);if(_0x50d9b5 instanceof ai)_0x50d9b5['updateSources'](_0x324aed);else{if(!(_0x50d9b5 instanceof di))throw new _0x70c77e('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x50d9b5,'id':_0x1cfaab,'sources':_0x324aed});_0x50d9b5['updateSources'](_0x324aed);}}async['updateSuggestionItem']({id:_0x5cf535,parts:_0x40be8b,renderingStrategy:_0x23bffa,abortSignal:_0x4c9ceb}){const _0x2e6ddb=this['getItemById'](_0x5cf535);if(!(_0x2e6ddb instanceof ai))throw new _0x70c77e('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x2e6ddb,'id':_0x5cf535,'parts':_0x40be8b});await _0x2e6ddb['updateContent']({'parts':_0x40be8b,'renderingStrategy':_0x23bffa,'abortSignal':_0x4c9ceb});}['updateSuggestionPartState']({id:_0x391342,index:_0x41c5a0,state:_0x59022e}){const _0x36de04=this['getItemById'](_0x391342);if(!(_0x36de04 instanceof ai))throw new _0x70c77e('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x391342});_0x36de04['updatePartState'](_0x41c5a0,_0x59022e);}['setSuggestionPartActive']({id:_0x3f19f1,index:_0x312917,isActive:_0x7d2484}){const _0x299970=this['getItemById'](_0x3f19f1);if(!(_0x299970 instanceof ai))throw new _0x70c77e('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x3f19f1});this['children']['filter'](_0x531604=>_0x531604 instanceof ai)['forEach'](_0x129f64=>{_0x129f64['setPartActive'](!0x1);}),_0x299970['setPartActive'](_0x312917,_0x7d2484);}['markItemAsDone'](_0x2edebb){this['getItemById'](_0x2edebb)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x37c2b5=>_0x37c2b5['options']['id']);}['removeItem'](_0x16f53f){this['children']['remove'](this['getItemById'](_0x16f53f));}['hasItem'](_0x5d8031){return!!this['children']['find'](_0x4c5f8b=>_0x4c5f8b['options']['id']['includes'](_0x5d8031));}['scrollToSuggestion'](_0x13f31e,_0x54d14b){const _0x44b7a2=this['getItemById'](_0x13f31e);if(!(_0x44b7a2 instanceof ai))return void _0x580cf6('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x13f31e,'partIndex':_0x54d14b});const _0x24200a=_0x44b7a2['getPartView'](_0x54d14b);_0x24200a?_0x3facc1(_0x24200a['element'],0x14,this['element']['parentElement'],!0x0,!0x0):_0x580cf6('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x13f31e,'partIndex':_0x54d14b});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x4ef0c5=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x4ef0c5,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x23fc11=new ui(this['locale'],fi['aiFeed']);return _0x23fc11['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x4ab2d4=>!_0x4ab2d4)]}}),_0x23fc11;}['_createFeedItems'](){const _0x46b0cf=new _0x10e3da(this['locale']);return _0x46b0cf['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x46b0cf;}['_createFeedLoader'](){const _0x457020=new _0x10e3da(this['locale']);return _0x457020['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x1a1a4c=>!_0x1a1a4c)]},'children':this['_createLoaderChildren']()}),_0x457020;}['_createLoaderChildren'](){const _0x2563fe=new pi();return _0x2563fe['isVisible']=!0x0,[_0x2563fe,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x5df9e6){const _0x3e7763=this['children']['find'](_0x2ff943=>_0x2ff943['options']['id']['includes'](_0x5df9e6));if(!_0x3e7763)throw new _0x70c77e('ai-chat-feed-view-item-not-found',this,{'id':_0x5df9e6});return _0x3e7763;}['setLoadingMessage'](_0x441bc4){this['set']('loadingMessage',_0x441bc4);}['toggleLoadingSkeleton'](_0x3cc83a){this['set']('isLoadingSkeletonVisible',_0x3cc83a);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class ph extends _0x49312a{['filter'](){let _0x393564=0x0;for(const _0x573b74 of this['items'])_0x393564+=_0x573b74['items']['length'];return{'resultsCount':_0x393564,'totalItemsCount':_0x393564};}}const uh='ck-ai-chat__prompt-input_highlighted';class _s extends _0x183750{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x255fa3,_0x337e8d){super(_0x255fa3,{'queryView':{'label':'','creator':_0x42eb25,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new ph(_0x255fa3),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x337e8d,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',(_0x18a180,_0x130a2e)=>!_0x18a180&&!_0x130a2e),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x556cfb,_0x56221c)=>{this['isUploadInProgress']||this['isEmpty']||_0x556cfb['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x56221c());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x2f13f8=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x2f13f8)return this['queryView']['errorText']=i(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x423b17=_0x32cd9f(_0x2f13f8);this['fire']('sendUserMessage',_0x423b17),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x4c7dfe){this['queryView']['fieldView']['set']('placeholder',_0x4c7dfe);}['focus'](_0x38d49b=!0x1){super['focus'](),_0x38d49b&&(this['element']['classList']['contains'](uh)||(this['element']['classList']['add'](uh),setTimeout(()=>{this['element']['classList']['remove'](uh);},0x320)));}['_createSubmitButton'](){const _0x4b721e=new _0x42f5cd(this['locale']);return _0x4b721e['set']({'icon':_0x5b571b,'label':i(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x4b721e['on']('execute',()=>{this['submit']();}),_0x4b721e;}['setIsUploadInProgress'](_0x48d0c6){this['isUploadInProgress']=_0x48d0c6;}['_setUpAddContextButtonPositioning'](){const _0x5b99d4=this['locale'],_0x39d1f3=()=>{_0x468ca9['window']['requestAnimationFrame'](()=>{if(_0x1081a2(this['element'])){const _0x2268c2=new _0x7d114a(this['queryView']['fieldView']['element']),_0x33e209=new _0x7d114a(this['_addContextButtonView']['element']),_0x4594ed=_0x2268c2['width'],_0x4d2ade='rtl'===_0x5b99d4['uiLanguageDirection']?'right':'left';_0x2268c2['excludeScrollbarsAndBorders']();const _0x5ef6e0=_0x4594ed-_0x2268c2['width']+0x1;this['_addContextButtonView']['element']['style'][_0x4d2ade]='calc('+(_0x4594ed-_0x33e209['width']-_0x5ef6e0)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x39d1f3),this['on']('render',()=>{_0x39d1f3(),this['_queryViewResizeObserver']=new _0x2ee52(this['queryView']['fieldView']['element'],()=>{_0x39d1f3();});});}}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 _0x10e3da{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x504083){super(_0x504083),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',_0x4eb6e2=>'selector'===_0x4eb6e2),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x85e20a=>_0x85e20a?this['_modelSelectionDropdown']['buttonView']['label']:i(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x18346c=>_0x18346c),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0xaf4a73=>_0xaf4a73),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x54d303=>i(this['locale'],_0x54d303?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x544a8c=>_0x544a8c),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x5439a9=>i(this['locale'],_0x5439a9?'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 _0x305a6b(),_0x3c2b1d(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x4ca1c9,_0x5e9366){if(_0x5e9366)this['set']('modelDisplayMode','hidden');else{const _0x5a6235=0x1===_0x4ca1c9['length'];this['set']('modelDisplayMode',_0x5a6235?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x4ca1c9?.['length'])for(const _0x1d43ec of _0x4ca1c9){const _0x6ed29=new _0x4f6c60({'label':_0x1d43ec['name'],'withText':!0x0,'role':'menuitemradio','id':_0x1d43ec['id'],'model':_0x1d43ec});_0x6ed29['bind']('isOn')['to'](this,'activeModelId',_0x233e06=>_0x233e06===_0x1d43ec['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x6ed29,'labelView':new Sa(this['locale'],_0x1d43ec)});}}['setWebSearch'](_0x1c33a6){this['set']('webSearchActive',_0x1c33a6);}['setReasoning'](_0x449073){this['set']('reasoningActive',_0x449073);}['setModel'](_0x4d59ad){if(!_0x4d59ad)return;this['activeModelId']=_0x4d59ad['id'],this['activeModelName']=_0x4d59ad['name']||_0x4d59ad['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x4d59ad['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x4d59ad['name']);const _0x2e93b4=_0x4d59ad['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x2e93b4),this['_webSearchButton']['set']('isVisible',_0x2e93b4);const _0x3ff696=_0x4d59ad['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x3ff696),this['_reasoningButton']['set']('isVisible',_0x3ff696);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x3ca6bb){this['set']('modelSelectorEnabled',!0x1),_0x3ca6bb&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x5a7e20=new _0x42f5cd();return _0x5a7e20['set']({'label':i(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x35cba2,'class':Ia,'isToggleable':!0x0,'tooltipPosition':fa}),_0x5a7e20['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x5a7e20;}['_createReasoningButton'](){const _0x74193f=new _0x42f5cd();return _0x74193f['set']({'label':i(this['locale'],'AI_CHAT_REASONING'),'icon':_0x508bba,'class':Ia,'isToggleable':!0x0,'tooltipPosition':fa}),_0x74193f['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x74193f;}['_createCommandsButton'](){const _0x228e56=new _0x42f5cd();return _0x228e56['set']({'label':i(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x2dc11,'withText':!0x0,'class':Ia,'isToggleable':!0x0,'tooltip':i(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':fa}),_0x228e56['extendTemplate']({'attributes':{'class':[Ea]}}),_0x228e56['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x228e56;}['_createModelSelectionDropdown'](){const _0x9a23b6=_0x46177f(this['locale']);return _0x9a23b6['set']({'panelPosition':'ne','class':[Ta]}),_0x9a23b6['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':fa,'class':pa}),this['listenTo'](_0x9a23b6,'execute',_0x32846e=>{this['fire']('selectModel',_0x32846e['source']['model']);}),_0x9a23b6;}['_createModelNameView'](){const _0x1c4c59=new ba(this['locale']);return _0x1c4c59['bind']('text')['to'](this,'activeModelName',_0x5dac5d=>_0x5dac5d??''),_0x1c4c59['bind']('isVisible')['to'](this,'modelDisplayMode',_0x5eb2cc=>'name'===_0x5eb2cc),_0x1c4c59;}}let Sa=class extends _0x3d9772{constructor(_0x358033,_0x25590e){super();const _0x6c9207=this['bindTemplate'],_0x4961e4=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x6c9207['to']('style'),'id':_0x6c9207['to']('id')},'children':[{'tag':'div','attributes':{'class':[ma]},'children':[{'text':_0x6c9207['to']('text')}]},{'tag':'div','attributes':{'class':[Ca]},'children':[{'tag':'span','children':[{'text':_0x25590e['description']}]}]},{'tag':'div','attributes':{'class':[wa]},'children':_0x4961e4}]}),_0x4961e4['addMany'](this['_getCapabilityParts'](_0x358033,_0x35cba2,'AI_CHAT_SEARCH_WEB',_0x25590e['capabilities']['webSearch']?.['enabled']??!0x1)),_0x4961e4['addMany'](this['_getCapabilityParts'](_0x358033,_0x508bba,'AI_CHAT_REASONING',_0x25590e['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x112a35,_0x4fc77b,_0x35f73c,_0x2cfdc9){const _0x5a32cc=new _0x5d3550();_0x5a32cc['content']=_0x4fc77b;const _0x13224b=new _0x10e3da(_0x112a35);_0x13224b['setTemplate']({'tag':'span','children':[{'text':i(_0x112a35,_0x35f73c)+':\x20'}]});const _0xa28a86=new _0x10e3da(_0x112a35);return _0xa28a86['setTemplate']({'tag':'span','children':[{'text':i(_0x112a35,_0x2cfdc9?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x5a32cc,_0x13224b,_0xa28a86];}},ba=class extends _0x10e3da{constructor(_0x2a5121){super(_0x2a5121),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x3ce2e0=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x3ce2e0['if']('isVisible','ck-hidden',_0x4b01a2=>!_0x4b01a2)]},'children':[{'text':_0x3ce2e0['to']('text')}]});}};const Ra='ck-ai-chat-context-controls__url-form',Oa='ck-ai-chat-context-controls__url-input-section';class Po extends _0x10e3da{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x1195b7){super(_0x1195b7),this['focusTracker']=new _0x3295cb(),this['keystrokes']=new _0x4259de(),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 _0xb86ebf({'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'](_0x37d596=>{this['focusTracker']['add'](_0x37d596['element']),this['keystrokes']['listenTo'](_0x37d596['element']);}),_0x2355c2({'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'](_0x494d19){this['urlInputField']['errorText']=_0x494d19,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x421873=new _0x42f5cd(this['locale']);return _0x421873['set']({'icon':_0x2a9d1b,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x37d9eb,_0x3326d2,_0x4df7de)=>{_0x421873['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x4df7de?'':'\x20ck-hidden')]});}),_0x421873;}['_createUrlInputField'](){const _0x111bca=new _0x558a3e(this['locale'],_0x11afad);return _0x111bca['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x111bca['fieldView']['set']({'placeholder':i(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x111bca;}['_createConfirmButton'](){const _0x34200d=new _0x42f5cd(this['locale']);return _0x34200d['set']({'icon':_0x4ddc06,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x34200d;}['_setupTemplate'](){const _0x166ae8=new _0x3571c0(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'});_0x166ae8['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Ra,'tabindex':'-1'},'children':[_0x166ae8,{'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',_0x1e9548=>{_0x1e9548['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0xda3b89,_0x5171e0)=>{this['clear'](),this['fire']('cancel'),_0x5171e0();});}['_handleSubmit'](){const _0x4766e9=this['getValue']()['trim']();_0x4766e9?this['_isValidUrl'](_0x4766e9)?(this['clearError'](),this['fire']('submitUrl',_0x4766e9)):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x48acb1=this['getValue']()['trim'](),_0x30ebe6=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x48acb1['length']>0x0&&!_0x30ebe6;}['_isValidUrl'](_0x4831cf){try{return!!new URL(_0x4831cf);}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 _0x5f33aa{['resource'];['_titleView'];['_iconView'];constructor(_0x5df94c,_0x58e21c){super(_0x5df94c),this['resource']=_0x58e21c,this['set']('isInContext',!!_0x58e21c['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x4b2f9a){if(_0x4b2f9a['isInContext'])return _0x4ddc06;switch(_0x4b2f9a['type']){case Be['DOCUMENT']:return _0x502d01;case Be['URL']:return _0x31c7e3;case Be['FILE']:case Be['TEXT']:return _0x3d17c6;default:return _0x13d87b;}}['highlightText'](_0x18bb73){if(!_0x18bb73||''===_0x18bb73['trim']())return void this['_titleView']['highlightText'](null);const _0x2f7f1a=new RegExp(_0x2d9edc(_0x18bb73),'gi');this['_titleView']['highlightText'](_0x2f7f1a);}['updateResourceState'](_0x111ac3){this['resource']['isInContext']=_0x111ac3,this['isInContext']=_0x111ac3,this['_updateIcon']();}['_createTitleView'](){const _0x2a4f0c=new _0x1324a5();return _0x2a4f0c['text']=this['resource']['label'],_0x2a4f0c['extendTemplate']({'tag':'span','attributes':{'class':[ya]}}),_0x2a4f0c;}['_createIconView'](){const _0x281ec5=new _0x5d3550();return _0x281ec5['content']=this['getResourceIcon'](this['resource']),_0x281ec5;}['_setupTemplate'](){const _0x371697=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[ka,_0x371697['if']('isVisible','ck-hidden',_0x1b1a1f=>!_0x1b1a1f),_0x371697['if']('isInContext',Na)]},'children':[{'tag':'div','attributes':{'class':[va]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x371697['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const xa='ck-ai-chat-resources__list';class Lr extends _0x49312a{['_source'];constructor(_0x2af796,_0x56c0e0){super(_0x2af796),this['_source']=_0x56c0e0,this['extendTemplate']({'attributes':{'class':[xa]}});}['setResources'](_0x5ef9a9,_0x5a8110){this['items']['clear']();let _0x2d10fe=_0x5ef9a9;if(this['_source']['useDefaultFiltering']&&_0x5a8110&&''!==_0x5a8110['trim']()){const _0x20792a=new RegExp(_0x5a8110['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x2d10fe=_0x5ef9a9['filter'](_0x312cee=>_0x20792a['test'](_0x312cee['label']));}for(const _0x2b91fb of _0x2d10fe){const _0x37fc34=new hc(this['locale'],_0x2b91fb);_0x37fc34['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x2b91fb);}),this['items']['add'](_0x37fc34);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x5a8110);}['highlightText'](_0x14b89c){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x44a7aa=>{_0x44a7aa['highlightText'](_0x14b89c);});}['updateResourceState'](_0x4455cf,_0x2722ab){for(const _0x2a85e0 of this['items']){const _0x4dfd46=_0x2a85e0;_0x4dfd46['resource']['id']===_0x4455cf&&_0x4dfd46['updateResourceState'](_0x2722ab);}}['_handleResourceSelection'](_0x2069a9,_0xc9b922){this['fire']('addResourceToContext',{'source':_0x2069a9,'resource':_0xc9b922});}}class Tr extends _0x558a3e{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x509ce4){const t=_0x509ce4['t'],_0x15e703={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x11afad,'label':i(_0x509ce4,'AI_CHAT_SEARCH_RESOURCES')};super(_0x509ce4,_0x15e703['creator']),this['label']=_0x15e703['label'],this['_viewConfig']=_0x15e703,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x509ce4,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x1e54c8){this['fire']('search',_0x1e54c8);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x5d3550(),this['iconView']['content']=_0x3b3312,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x5cec4c,t){this['resetButtonView']=new _0x42f5cd(_0x5cec4c),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x42f179,'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',_0x1ef49f=>!_0x1ef49f),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 _0x10e3da{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x426822,_0x4e0c85){super(_0x426822),this['_source']=_0x4e0c85['source'],this['_searchInputVisibleFrom']=_0x4e0c85['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 _0x229fa2([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 _0xa19c33=new _0x10e3da(this['locale']);return _0xa19c33['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x340578,_0x3a469c)=>{this['loadResources'](_0x3a469c),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x3a469c);}),_0xa19c33;}['_createResourcesListView'](){const _0x485934=new Lr(this['locale'],this['_source']);return _0x485934['delegate']('addResourceToContext')['to'](this),_0x485934['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x485934;}['_createSkeletonView'](){const _0x484d7d=new ui(this['locale'],fi['aiChatResources']);return _0x484d7d['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x49a887=>!_0x49a887)]}}),_0x484d7d;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x151dce){const _0x5dbc55=_0x4689d1();this['_latestLoadResourcesUid']=_0x5dbc55,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x151dce,'uid':_0x5dbc55}),this['isLoading']=!0x0;}['setResources'](_0x1a13cc,_0x5d4f8d){if(_0x5d4f8d&&_0x5d4f8d!==this['_latestLoadResourcesUid'])return;const _0x52a0b9=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x1a13cc,_0x52a0b9),_0x1a13cc['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x42c4ee,_0xdda706){this['_resourcesListView']['updateResourceState'](_0x42c4ee,_0xdda706);}}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(_0x242b17,_0x5ae903,_0x333ec5){this['_locale']=_0x242b17,this['_bodyCollection']=_0x5ae903,this['_config']=_0x333ec5;}['showSourceResourcesBalloon']({source:_0x299cbe,withBackButton:_0x5abebf}){let _0x3a67cf=this['_sourceResourceBalloons']['get'](_0x299cbe['id']);_0x3a67cf||(_0x3a67cf=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x299cbe['id'],_0x3a67cf),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x3a67cf)),this['_addSourceResourceContent']({'balloonPanel':_0x3a67cf,'source':_0x299cbe,'withBackButton':_0x5abebf}),_0x3a67cf['show']();const _0x164401=this['_config']['getTargetElement']();_0x164401&&_0x3a67cf['pin']({'target':_0x164401,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x23117f,_0x3bc7a6,_0x365fcb){const _0x4a1549=this['_sourceResourceBalloons']['get'](_0x23117f);if(!_0x4a1549)return;const _0x373020=this['_getResourcesViewFromBalloon'](_0x4a1549);_0x373020&&(_0x373020['setResources'](_0x3bc7a6,_0x365fcb),_0x373020['once']('change:isLoading',()=>{_0x4a1549['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x33feed){const _0x49dcd3=this['_sourceResourceBalloons']['get'](_0x33feed);_0x49dcd3&&requestAnimationFrame(()=>{_0x49dcd3['hide'](),this['_sourceResourceBalloons']['delete'](_0x33feed),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x5e648 of this['_sourceResourceBalloons']['values']())if(_0x5e648['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x2c7899,_0x526fd8,_0x2672c9){const _0x40295e=this['_sourceResourceBalloons']['get'](_0x2c7899);if(!_0x40295e||!_0x40295e['isVisible'])return;const _0x32955d=this['_config']['getTargetElement']();if(!_0x32955d)return;_0x40295e['pin']({'target':_0x32955d,'limiter':this['_config']['getLimiterElement']()});const _0x3815af=this['_getResourcesViewFromBalloon'](_0x40295e);_0x3815af&&_0x3815af['updateResourceState'](_0x526fd8,_0x2672c9);}['destroy'](){for(const _0x2cafee of this['_sourceResourceBalloons']['values']())_0x2cafee['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x4d6715=new _0x54c977(this['_locale']);return _0x4d6715['extendTemplate']({'attributes':{'class':La}}),this['_bodyCollection']['add'](_0x4d6715),_0x4d6715;}['_addSourceResourceContent']({balloonPanel:_0x26601,source:_0x4eb4bb,withBackButton:_0x2425b8}){_0x26601['content']['clear']();const _0x72c16d=this['_createBalloonHeader']({'balloonPanel':_0x26601,'source':_0x4eb4bb,'withBackButton':_0x2425b8});_0x26601['content']['add'](_0x72c16d);const _0x58aeba=this['_createBalloonResourcesView'](_0x4eb4bb);_0x26601['content']['add'](_0x58aeba);}['_createBalloonHeader']({balloonPanel:_0x30aa19,source:_0x9429b0,withBackButton:_0x56551b}){const _0x1eb0d2=new _0x3571c0(this['_locale'],{'label':_0x9429b0['label'],'class':Pa});return _0x56551b&&_0x1eb0d2['children']['add'](this['_createBackButton'](_0x30aa19),0x0),_0x1eb0d2;}['_createBackButton'](_0x8e63bb){const _0x3dc59b=new _0x42f5cd(this['_locale']);return _0x3dc59b['set']({'icon':_0x2a9d1b,'tooltip':i(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Da}),_0x3dc59b['on']('execute',()=>{_0x8e63bb['hide'](),this['_config']['onBackToContext']();}),_0x3dc59b;}['_createBalloonResourcesView'](_0x19c325){const _0x202360=new lc(this['_locale'],{'source':_0x19c325,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x202360['on']('loadSourceResources',(_0x2c623f,_0x14e295)=>{this['_config']['onLoadSourceResources'](_0x14e295);}),_0x202360['on']('addResourceToContext',(_0x39f369,_0xd315b7)=>{this['_config']['onResourceSelected'](_0xd315b7['source'],_0xd315b7['resource']),this['closeSourceResourceBalloon'](_0x19c325['id']);}),_0x202360;}['_getResourcesViewFromBalloon'](_0x4f7da8){const _0x599e04=_0x4f7da8['content']['get'](0x1);return _0x599e04 instanceof lc?_0x599e04:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x38724b){_0x4fafed({'emitter':_0x38724b,'contextElements':[_0x38724b['element']],'callback':()=>{_0x38724b['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x38724b['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=[_0x54c977['defaultPositions']['northArrowSouthWest'],_0x54c977['defaultPositions']['northArrowSouth'],_0x54c977['defaultPositions']['northArrowSouthEast'],_0x54c977['defaultPositions']['southArrowNorthWest'],_0x54c977['defaultPositions']['southArrowNorth'],_0x54c977['defaultPositions']['southArrowNorthEast']];class Is extends _0x10e3da{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x320c6e,_0x1991b0){super(_0x320c6e),this['bodyCollection']=_0x1991b0['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x320c6e),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x320c6e),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x320c6e),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x320c6e,_0x1991b0);const _0x1a1dc6={'cssClasses':{'showMoreButton':$o,'showMoreBalloon':Wo,'overflowContainer':Do,'controlsButton':Xo}};this['_overflowManager']=new Ro(_0x320c6e,this['_currentContextsChips'],_0x1a1dc6,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'](_0x387a03,_0x1dc51c){const _0x14bc1f=this['_createContextButton'](_0x387a03,'current',!0x0,_0x1dc51c);this['_addContextToCollection'](_0x14bc1f,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x55968b){this['_removeContextFromCollection'](_0x55968b,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x55968b,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x5a122e,_0x2ce6fe){let _0x5251fc=this['_currentContextsChips']['find'](_0x51eff9=>_0x51eff9['id']===_0x5a122e);_0x5251fc||(_0x5251fc=this['_overflowManager']['overflowChips']['find'](_0xe0e051=>_0xe0e051['id']===_0x5a122e)),_0x5251fc&&(_0x5251fc['isLoading']=_0x2ce6fe);}['setConversationContext'](_0x436946){this['_conversationContextsChips']['clear']();for(const _0x43e4da of _0x436946){const _0x3674c6=this['_createContextButton'](_0x43e4da,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x3674c6,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x34fcb0,_0x44da37,_0x27faf4){this['_resourcesBalloonView']['updateResourceState'](_0x34fcb0,_0x44da37,_0x27faf4);}['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:_0x27baae,withBackButton:_0x100afc}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x27baae,'withBackButton':_0x100afc}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x34a1b4,_0x374e52,_0x4ff95c,_0x554736){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x34a1b4,_0x4ff95c,_0x554736);}['closeSourceResourceBalloon'](_0x3d0c76){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x3d0c76),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x508f27){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x508f27),this['_setAddContextButtonEnabled'](_0x508f27);}['_setAddContextButtonEnabled'](_0x555efe){const _0x52272b=!_0x555efe['document']['isHidden']&&_0x555efe['document']['enabled'],_0x43e536=_0x555efe['urls']['enabled'],_0x41324a=_0x555efe['files']['enabled'],_0x2e88df=_0x555efe['sources']['length']>0x0,_0x38ddf9=_0x555efe['customItems']&&_0x555efe['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x52272b||_0x43e536||_0x41324a||_0x2e88df||_0x38ddf9;}['_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'](_0x36062c){const _0x1282b6=new _0x42f5cd(_0x36062c);return _0x1282b6['set']({'label':i(_0x36062c,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Xo+'\x20'+Mo,'icon':_0x1a2027,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x1282b6;}['_createAddContextBalloonPanelView'](_0x46308d){return this['_createBaseBalloonPanel'](_0x46308d,No);}['_createUrlBalloonPanelView'](_0x339a5d){const _0x202ffb=this['_createBaseBalloonPanel'](_0x339a5d,Ho);return this['_addUrlContent'](_0x202ffb,_0x339a5d),_0x202ffb;}['_createResourcesBalloonView'](_0x2983eb,_0xffd155){const _0x1a6e62={'searchInputVisibleFrom':_0xffd155['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo});},'onResourceSelected':(_0x4bec74,_0x19a9ce)=>{this['fire']('addResourceToContext',{'source':_0x4bec74,'resource':_0x19a9ce});},'onLoadSourceResources':_0x3d72db=>{this['fire']('loadSourceResources',_0x3d72db);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Oo(_0x2983eb,_0xffd155['bodyCollection'],_0x1a6e62);}['_getLimiterElement'](){return this['element']?.['closest']('.'+qo)||document['body'];}['_createBaseBalloonPanel'](_0x2cfdca,_0x9d4c50){const _0x37c68c=new _0x54c977(_0x2cfdca);return _0x37c68c['extendTemplate']({'attributes':{'class':_0x9d4c50}}),this['bodyCollection']['add'](_0x37c68c),_0x37c68c;}['_setBalloonPanelContent'](_0x305bc8,_0xff4957,_0x5aeb0a){if(_0x305bc8['content']['clear'](),!_0x5aeb0a['document']['isHidden']&&_0x5aeb0a['document']['enabled']){const _0x2a102c=this['_createBalloonButton'](_0xff4957,{'label':i(_0xff4957,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x502d01});_0x2a102c['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x305bc8['content']['add'](_0x2a102c);}if(_0x5aeb0a['urls']['enabled']){const _0x22efb6=this['_createBalloonButton'](_0xff4957,{'label':i(_0xff4957,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x31c7e3});_0x22efb6['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo}),this['_urlInputView']['focus']();}),_0x305bc8['content']['add'](_0x22efb6);}if(_0x5aeb0a['files']['enabled']){const _0x3ca472=new _0x322600(_0xff4957);_0x3ca472['set']({'label':i(_0xff4957,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x1d6eec,'withText':!0x0,'tooltip':!0x0,'class':jo,'allowMultipleFiles':!0x0}),_0x3ca472['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x3ca472['on']('done',(_0x4cfa21,_0x44bc7f)=>{this['fire']('addFileToContext',_0x44bc7f);}),_0x3ca472['tooltip']=!0x0,_0x305bc8['content']['add'](_0x3ca472);}for(const _0x3e6157 of _0x5aeb0a['sources']){const _0x16b9a3=this['_createBalloonButton'](_0xff4957,{'label':_0x3e6157['label'],'icon':_0x3e6157['icon']||_0x13d87b,'type':'source'});_0x305bc8['content']['add'](_0x16b9a3),_0x16b9a3['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x3e6157,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0xe2a52b of _0x5aeb0a['customItems']||[]){const _0x384766=this['_createBalloonButton'](_0xff4957,{'label':_0xe2a52b['label'],'icon':_0xe2a52b['icon']||_0x13d87b,'type':'customItem'});_0x305bc8['content']['add'](_0x384766),_0x384766['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0xe2a52b);});}this['_hasExactlyOneSource']=0x1===_0x305bc8['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x22d869,_0x5cb335){this['_urlInputView']=new Po(_0x5cb335),this['_urlInputView']['on']('submitUrl',(_0x582b81,_0x290638)=>{this['_handleUrlSubmit'](_0x290638);}),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});}),_0x22d869['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x419d0b,_0x52c10e){const _0x1f14bd='source'===_0x52c10e['type']?new Ha(_0x419d0b):new _0x42f5cd(_0x419d0b);return _0x1f14bd['set']({'label':_0x52c10e['label'],'icon':_0x52c10e['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':jo}),_0x1f14bd;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x4fafed({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x325a4e){const _0x5c92d5=this['_addContextBalloonConfig'];_0x5c92d5['buttonView']['isOn']=_0x325a4e,_0x325a4e?_0x5c92d5['balloonView']['show']():_0x5c92d5['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x2c244b,buttonView:_0x31dad0,hideMethod:_0xf9ce57}=this['_addContextBalloonConfig'];_0x4fafed({'emitter':_0x2c244b,'contextElements':[_0x2c244b['element'],_0x31dad0['element']],'callback':()=>{_0xf9ce57();},'activator':()=>_0x31dad0['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x555080,_0x4877c3,_0x40fde8=!0x1,_0x5cb32d=!0x1){const _0x43ade8='conversation'===_0x4877c3||!0x0===_0x555080['isReadOnly'],_0x53b69e=new Vo(this['locale'],_0x555080,_0x43ade8,_0x40fde8,_0x5cb32d);return _0x43ade8||_0x53b69e['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x53b69e['id']);}),_0x53b69e;}['_addContextToCollection'](_0x5cc347,_0x50e597){_0x50e597['add'](_0x5cc347,0x0);}['_removeContextFromCollection'](_0x280875,_0x1cb183){const _0x54f06a=_0x1cb183['find'](_0x1fc756=>_0x1fc756['id']===_0x280875);_0x54f06a&&_0x1cb183['remove'](_0x54f06a);}['_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'](_0x5b7118){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x5b7118);}}class Ha extends _0x42f5cd{['arrowView'];constructor(_0x19536e){super(_0x19536e),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 _0x332150=new _0x5d3550();return _0x332150['content']=_0x24c88e,_0x332150['extendTemplate']({'attributes':{'class':Fo+'__arrow'}}),_0x332150;}}class Cs extends _0x10e3da{['_cancelButtonView'];['_loaderView'];constructor(_0x3d09d0){super(_0x3d09d0),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 _0x43213d=new _0x42f5cd(this['locale']);return _0x43213d['set']({'label':i(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x4641d7}),_0x43213d['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x43213d;}['_createLoaderView'](){const _0x3b7bf9=new _0x10e3da(this['locale']);return _0x3b7bf9['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')}]}),_0x3b7bf9;}}class ki extends _0x10e3da{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x352214,_0x543224){super(_0x352214),this['_contextPanelView']=this['_createContextPanelView'](_0x352214,{'bodyCollection':_0x543224['bodyCollection'],'searchInputVisibleFrom':_0x543224['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x352214),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x352214),this['_loaderView']=this['_createLoaderView'](_0x352214),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x352214),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 _0x3c21b1=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x3c21b1['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x3c21b1['if']('isLoading','ck-hidden',_0x3ae0d5=>_0x3ae0d5||!this['isModelAvailable']),_0x3c21b1['if']('isModelAvailable','ck-hidden',_0x21802a=>!_0x21802a||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x3c21b1['if']('isLoading','ck-hidden',_0x3401d9=>!_0x3401d9)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x3c21b1['if']('isModelAvailable','ck-hidden',_0x1803fb=>_0x1803fb)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x4fafed({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x47fcf0,_0x401b2a){return new Is(_0x47fcf0,_0x401b2a);}['_createPromptInputView'](_0x531540){return new _s(_0x531540,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x212e22){return new vs(_0x212e22);}['_createLoaderView'](_0x654eb8){return new Cs(_0x654eb8);}['_createModelUnavailableMessageView'](_0x1e48cd){const _0x23c431=new As(_0x1e48cd);return _0x23c431['delegate']('startConversation')['to'](this),_0x23c431;}['_handlePromptInputFocus'](_0x32e782,_0x31a880,_0x480776){_0x480776?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0xb598b1,_0x44980b){this['_contextPanelView']['addContextItem'](_0xb598b1,_0x44980b);}['removeContextItem'](_0xea2e0b){this['_contextPanelView']['removeContextItem'](_0xea2e0b);}['setContextItemLoading'](_0x2dd62b,_0xbe6955){this['_contextPanelView']['setContextItemLoading'](_0x2dd62b,_0xbe6955);}['setIsUploadInProgress'](_0x1be2e5){this['_promptInputView']['setIsUploadInProgress'](_0x1be2e5);}['setConversationContext'](_0x1526bd){this['_contextPanelView']['setConversationContext'](_0x1526bd);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x34c04e,_0x1c6362,_0x2489e4){this['_contextPanelView']['updateResourceState'](_0x34c04e,_0x1c6362,_0x2489e4);}['setWebSearch'](_0x379214){this['_promptCapabilitiesView']['setWebSearch'](_0x379214);}['setReasoning'](_0xf1faa){this['_promptCapabilitiesView']['setReasoning'](_0xf1faa);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x316277){this['_contextPanelView']['setAddContextOptions'](_0x316277);}['setInputPlaceholder'](_0x277f0e){this['_promptInputView']['setPlaceholderText'](_0x277f0e);}['setModelList'](_0x4db22d,_0x2aa7b9){this['_promptCapabilitiesView']['setModelList'](_0x4db22d,_0x2aa7b9);}['setModel'](_0x3e6cca){_0x3e6cca?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x3e6cca)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x454bcd){this['_promptCapabilitiesView']['disableModelSelector'](_0x454bcd);}['populateSourceResourceBalloon'](_0x31e236,_0x1a8ca2,_0x436479,_0x386e0a){this['_contextPanelView']['populateSourceResourceBalloon'](_0x31e236,_0x1a8ca2,_0x436479,_0x386e0a);}['closeSourceResourceBalloon'](_0x2e2b49){this['_contextPanelView']['closeSourceResourceBalloon'](_0x2e2b49);}['focusPromptInput'](_0x4acdb1=!0x1){this['_promptInputView']['focus'](_0x4acdb1);}['setPromptInputValue'](_0x146e9a){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x146e9a;}}class As extends _0x10e3da{constructor(_0x3905f7){super(_0x3905f7);const _0x2b6e45=new _0x42f5cd(_0x3905f7);_0x2b6e45['set']({'label':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x2b6e45['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'},_0x2b6e45]}]});}}class vi extends _0x3571c0{['conversationStartButton'];['resizeButton'];constructor(_0x4b53be,_0x585631){super(_0x4b53be,{'label':i(_0x4b53be,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':vt}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x4b53be),this['children']['add'](this['conversationStartButton']),_0x585631&&(this['resizeButton']=Hs(_0x4b53be,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x52cb0a){const _0x592663=new _0x42f5cd(_0x52cb0a);return _0x592663['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x5251eb,'class':'ck-ai-chat__start-conversation'}),_0x592663['on']('execute',()=>{this['fire']('startConversation');}),_0x592663;}}class bi extends _0x10e3da{constructor(_0x1f802b){super(_0x1f802b),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':i(_0x1f802b,'AI_DISCLAIMER_TEXT')}]}]});}}class Pt extends _0x10e3da{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x290a53,_0x55e8d3){super(_0x290a53),this['_bodyCollection']=new _0x5669fa(_0x290a53),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new vi(_0x290a53,_0x55e8d3['showResizeButton']),this['chatHeader']['delegate'](...bt)['to'](this),this['chatFeed']=new ji(_0x290a53,this['_bodyCollection']),this['chatFeed']['delegate'](...bt)['to'](this),this['chatControls']=new ki(_0x290a53,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x55e8d3['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...bt)['to'](this),this['chatDisclaimer']=new bi(_0x290a53),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x290a53['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x829869,_0x1fb8d1,_0x4abfc6,_0xd3fa51){this['chatControls']['populateSourceResourceBalloon'](_0x829869,_0x1fb8d1,_0x4abfc6,_0xd3fa51);}['closeSourceResourceBalloon'](_0x51f298){this['chatControls']['closeSourceResourceBalloon'](_0x51f298);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class ct extends _0x2536b2{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(_0x1876f5){super(_0x1876f5);const _0x49d6ec=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new z(),this['_view']=new Pt(this['context']['locale'],{'showResizeButton':_0x49d6ec['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...bt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x28b708,{showDiff:_0x15b94e})=>{this['showDiff']=_0x15b94e;}),_0x49d6ec['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',_0x44a9a8=>_0x44a9a8),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x324502=>_0x324502),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x6a60cf){const _0x15eb2c=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'](_0x6a60cf['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x15eb2c}),this['fire']('conversationCreated');}['addFeedItemStaticMessage']({id:_0x308652,staticMessage:_0x572978}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x308652,'initialContent':'<p>'+_0x572978+'</p>'});}['addFeedItemUserMessage'](_0x581ef6){const _0x117db9=_0x581ef6['attributes']?.['displayedPrompt']||_0x581ef6['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x581ef6['contextItems']['values']()),'initialContent':'<p>'+_0x117db9+'</p>','id':_0x581ef6['id']});}['addFeedItemError']({errorMessage:_0x5aa15e,id:_0x4220c5}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x5aa15e+'</p>','id':_0x4220c5});}['addFeedItemAIReply'](_0x2f6d8c){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x2f6d8c['interactionId']+':'+_0x2f6d8c['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x555cc5){const _0x2bd123=T(this['context']);let _0x226253=_0x2bd123['config']['get']('ai.availableReplyActions')||[...ot];if(_0x2bd123['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x561ee1=_0x2bd123['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x561ee1,'value');}}else _0x226253=_0x226253['filter'](_0x1d006a=>'insertSuggestion'!=_0x1d006a);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x555cc5['interactionId']+':'+_0x555cc5['id'],'areActionsDisabled':_0x555cc5['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x226253}),this['clearLoadingMessage']();});}['addFeedInteractionHeader'](_0x892eb4,_0x4e6fe1){const _0x37f034=this['_view']['chatFeed']['children']['last'];if(_0x37f034 instanceof Mt)return this['_view']['chatFeed']['children']['remove'](_0x37f034),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x892eb4['id'],'capabilities':{'isWebSearchEnabled':_0x37f034['capabilities']['isWebSearchEnabled']||_0x4e6fe1['isWebSearchEnabled'],'isReasoningEnabled':_0x37f034['capabilities']['isReasoningEnabled']||_0x4e6fe1['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x892eb4['id'],'capabilities':_0x4e6fe1});}async['addFeedItemCustomElement'](_0x208d38,_0x120653){let _0x5ec69e;return await this['_promiseQueue']['enqueue'](async()=>{_0x5ec69e=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x208d38,'id':_0x120653});}),_0x5ec69e;}['removeFeedItem'](_0x385236){this['_view']['chatFeed']['removeItem'](_0x385236);}['hasFeedItem'](_0xa20101){return this['_view']['chatFeed']['hasItem'](_0xa20101);}['updateFeedInteractionHeader'](_0x343c6d){const _0x1ba13e=this['_view']['chatFeed']['children']['find'](_0x341fc7=>_0x341fc7['options']['id']==_0x343c6d['id']&&_0x341fc7 instanceof Mt);_0x1ba13e&&_0x1ba13e['set']('isVisible',_0x343c6d['isVisible']);}async['updateFeedItemAIReplyContent'](_0x3ea725){const _0x46e76a=_0x3ea725['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x236c67=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x3ea725,'abortSignal':_0x236c67,'renderingStrategy':_0x46e76a}),_0x3ea725['isDone']&&this['markFeedItemAsDone'](_0x3ea725['id']);});}['updateFeedItemAIReplySources'](_0xc91401,_0x46af64){this['_view']['chatFeed']['updateWebSources'](_0xc91401,_0x46af64);}async['updateFeedItemAIReplySuggestionContent'](_0x23b50c){const _0x4fc401=_0x23b50c['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x275506=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x23b50c,'abortSignal':_0x275506,'renderingStrategy':_0x4fc401}),_0x23b50c['isDone']&&this['markFeedItemAsDone'](_0x23b50c['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x258799){this['_view']['chatFeed']['updateSuggestionPartState'](_0x258799);}['setFeedItemAIReplySuggestionPartActive'](_0xe32798){this['_view']['chatFeed']['setSuggestionPartActive'](_0xe32798);}['markFeedItemAsDone'](_0x977452){this['_view']['chatFeed']['markItemAsDone'](_0x977452);}['removeFeedInteraction'](_0x3c9859){this['_view']['chatFeed']['getItemIds']()['filter'](_0x494fed=>_0x494fed['startsWith'](_0x3c9859))['forEach'](_0xe9509c=>this['_view']['chatFeed']['removeItem'](_0xe9509c));}['startInteraction'](){const _0x5e77c5=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x5e77c5),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x5a0215){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x5e7a7b=>_0x5e7a7b['startsWith'](_0x5a0215['id']))['forEach'](_0x23a501=>this['markFeedItemAsDone'](_0x23a501)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x2e921a,_0x584988){this['_view']['chatControls']['addContextItem'](_0x2e921a,_0x584988);}['removeContextItem'](_0x4dac59){this['_view']['chatControls']['removeContextItem'](_0x4dac59);}['setContextItemLoading'](_0x4c9ffb,_0x47c2df){this['_view']['chatControls']['setContextItemLoading'](_0x4c9ffb,_0x47c2df);}['setIsUploadInProgress'](_0xb29d0e){this['_view']['chatControls']['setIsUploadInProgress'](_0xb29d0e);}['setConversationContext'](_0x4cc2c1){this['_view']['chatControls']['setConversationContext'](_0x4cc2c1);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x31862c,_0x68a356,_0x15a68a){this['_view']['chatControls']['updateResourceState'](_0x31862c,_0x68a356,_0x15a68a);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x55d1e3){this['_view']['chatControls']['setAddContextOptions'](_0x55d1e3);}['updateCapabilities'](_0x48aa01){this['_view']['chatControls']['setWebSearch'](_0x48aa01['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x48aa01['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x48aa01));}['setSelectedModel'](_0x4d52f1,_0x265610){this['_view']['chatControls']['setModel'](_0x4d52f1),_0x265610&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x20cea7){this['feedItemRenderingStrategy']=_0x20cea7;}['toggleLoadingSkeleton'](_0x5a7fc2){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x5a7fc2);}['resetConversationTitle'](){this['setConversationTitle'](i(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0xf73092,_0x422074=!0x1){if(_0x422074&&!Rt()&&_0xf73092['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0xf73092);this['_view']['chatHeader']['label']=_0xf73092;}['setLoadingMessage'](_0x4c1aba){this['_view']['chatFeed']['setLoadingMessage'](_0x4c1aba);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x357602){let _0x2515b9=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x357602[_0x2515b9],_0x2515b9++,_0x2515b9===_0x357602['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x17236c){this['_view']['chatHeader']['isMaximized']=_0x17236c;}['prepareLoadingMessage'](_0x32c247){return _0x32c247['isWebSearchEnabled']&&_0x32c247['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x32c247['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x32c247['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x8275d3){return _0x8275d3?_0x8275d3['isWebSearchEnabled']&&_0x8275d3['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x8275d3['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x8275d3['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'](_0x2bc898,_0x6c8ffa,_0x104ffa,_0x3d1ebd){this['_view']['populateSourceResourceBalloon'](_0x2bc898,_0x6c8ffa,_0x104ffa,_0x3d1ebd);}['closeSourceResourceBalloon'](_0x354eba){this['_view']['closeSourceResourceBalloon'](_0x354eba);}['setPromptInputValue'](_0x3c4d4b){this['_view']['chatControls']['setPromptInputValue'](_0x3c4d4b);}['focusPromptInput'](_0x4cf895=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x4cf895);}['scrollFeedToSuggestion'](_0x496bbd,_0x3fb1af){this['_view']['chatFeed']['scrollToSuggestion'](_0x496bbd,_0x3fb1af);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class Ri extends _0x49312a{['sections'];constructor(_0x243ec5,_0x587e93){super(_0x243ec5),this['sections']=_0x587e93,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x45499e){let _0x399aa4=0x0,_0x2e6bb4=0x0;for(const _0x4cef50 of this['sections']){const {resultsCount:_0x1e3e7a,totalItemsCount:_0x4dbc55}=_0x4cef50['filter'](_0x45499e);_0x399aa4+=_0x1e3e7a,_0x2e6bb4+=_0x4dbc55;}return{'resultsCount':_0x399aa4,'totalItemsCount':_0x2e6bb4};}}class Mi extends _0x5f33aa{['title'];['itemsViews'];['_itemsListView'];constructor(_0x23720d,{title:_0x21c7bc,items:_0x5fe506}){super(_0x23720d);const _0x2c3a69=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x21c7bc,this['itemsViews']=_0x5fe506;const _0x5e767c=new _0x10e3da(_0x23720d);_0x5e767c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x49312a(_0x23720d),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x2c3a69['if']('isVisible','ck-hidden',_0x12d6ca=>!_0x12d6ca)]},'children':[_0x5e767c,this['_itemsListView']]});}['filter'](_0xf17b19){const _0x3366ac=this['itemsViews']['length'];let _0x31e002=0x0;for(const _0x55c9c2 of this['itemsViews']){if(_0xf17b19){const _0x210f25=_0x55c9c2['isMatching'](_0xf17b19);_0x55c9c2['isVisible']=!!_0x210f25,_0x55c9c2['highlightText'](_0xf17b19);}else _0x55c9c2['isVisible']=!0x0,_0x55c9c2['highlightText'](null);_0x55c9c2['isVisible']&&_0x31e002++;}return this['isVisible']=_0x31e002>0x0,{'resultsCount':_0x31e002,'totalItemsCount':_0x3366ac};}['getItem'](_0x1e38b0){return this['itemsViews']['find'](_0x448bb8=>_0x448bb8['id']===_0x1e38b0);}['removeItem'](_0x3b39c1){const _0x3e6f90=this['itemsViews']['indexOf'](_0x3b39c1);-0x1!==_0x3e6f90&&(this['itemsViews']['splice'](_0x3e6f90,0x1),this['_itemsListView']['items']['remove'](_0x3b39c1));}}class xi extends/* #__PURE__ -- @preserve */
|
|
27
|
-
_0x4a6ce8(_0x5f33aa){['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(_0x2c20c3,_0x4b6bb1){super(_0x2c20c3);const _0x223cca=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x4b6bb1['pinned']),this['set']('loadingState',null),this['id']=_0x4b6bb1['id'];const {title:_0x5d6490,createdAt:_0x2c39df,active:_0x3b3b88=!0x1}=_0x4b6bb1;this['_titleView']=new _0x1324a5(),this['_titleView']['text']=_0x5d6490,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x19a54a=this['_createCheckView'](),_0x484a0d=this['_createPinButtonView'](_0x2c20c3),_0x54fefc=this['_createMenuDropdownView'](),_0x4527ad=this['_createEditInputView'](_0x2c20c3,_0x5d6490),_0x2801a9=this['_createAcceptEditButtonView'](_0x2c20c3,_0x4527ad),_0x43ca60=this['_createCancelEditButtonView'](_0x2c20c3,_0x4527ad);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x484a0d),this['actions']['add'](_0x54fefc),this['on']('change:isEdit',(_0x84eb5d,_0x4222f5,_0x7cf139)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x7cf139?(this['actions']['add'](_0x2801a9),this['actions']['add'](_0x43ca60),this['mainContent']['add'](_0x4527ad),_0x4527ad['element']['focus']()):(this['actions']['add'](_0x484a0d),this['actions']['add'](_0x54fefc),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x3b3b88?'ck-ai-chat-history__item--active':'',_0x223cca['if']('isVisible','ck-hidden',_0x4d9784=>!_0x4d9784),_0x223cca['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',_0x223cca['if']('loadingState','ck-hidden',_0x5ccaec=>!!_0x5ccaec)]},'children':_0x3b3b88?[_0x19a54a]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x223cca['if']('loadingState','ck-hidden',_0x2e302d=>!_0x2e302d)]},'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',_0x223cca['if']('loadingState','ck-hidden',_0x46d13e=>!!_0x46d13e)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x223cca['if']('loadingState','ck-hidden',_0x3ee972=>!_0x3ee972)]},'children':[{'text':_0x223cca['to']('loadingState',_0x5d20e7=>_0x5d20e7?i(this['locale'],xi['LOADING_LABELS'][_0x5d20e7]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x2c39df]}]},{'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'](_0x380e62){this['_titleView']['text']=_0x32cd9f(_0x380e62);}['updateLoadingState'](_0x5c74cd,_0x541f0e){this['set']('loadingState',_0x541f0e?_0x5c74cd:null);}['_createCheckView'](){const _0x1345d1=new _0x5d3550();return _0x1345d1['set']({'content':_0x4bc037}),_0x1345d1;}['_createPinButtonView'](_0x2d6d88){const _0xe34f99=new _0x42f5cd(_0x2d6d88);return _0xe34f99['set']({'label':i(_0x2d6d88,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0xc5e5e8,'withText':!0x1,'tooltip':!0x0}),_0xe34f99['bind']('isOn')['to'](this,'pinned'),_0xe34f99['on']('execute',()=>{const _0x187561=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x187561});}),_0xe34f99;}['_createMenuDropdownView'](){const _0x31b0f1=_0x46177f(this['locale'],_0x4cf5ee),_0x52e685=_0x31b0f1['panelView']['children'];_0x31b0f1['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x5aa290}),_0x31b0f1['panelPosition']='sw';const _0x58b711=new _0x42f5cd(this['locale']);_0x58b711['label']=i(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x58b711['withText']=!0x0,_0x58b711['on']('execute',()=>{this['isEdit']=!0x0;});const _0xad9043=new _0x42f5cd(this['locale']);_0xad9043['label']=i(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0xad9043['withText']=!0x0,_0xad9043['on']('execute',()=>{this['showConfirm'](i(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x14a430=new _0x49312a(this['locale']),_0x40ab29=new _0x5f33aa(this['locale']);_0x40ab29['children']['add'](_0x58b711);const _0x2303ed=new _0x5f33aa(this['locale']);return _0x2303ed['children']['add'](_0xad9043),_0x14a430['items']['addMany']([_0x40ab29,_0x2303ed]),_0x52e685['add'](_0x14a430),_0x31b0f1;}['_createEditInputView'](_0x23d12e,_0x4cc4cf){const _0x3254bc=new _0x4221dd(_0x23d12e),_0x3702c5=_0x3254bc['bindTemplate'];return _0x3254bc['value']=_0x4cc4cf,_0x3254bc['extendTemplate']({'on':{'keydown':_0x3702c5['to'](_0x2e6eba=>{'Enter'==_0x2e6eba['key']&&this['_commitEditInputValue'](_0x3254bc);})}}),_0x3254bc;}['_createAcceptEditButtonView'](_0x258d65,_0x14d639){const _0x40df44=new _0x42f5cd(_0x258d65);return _0x40df44['set']({'icon':_0x4bc037,'withText':!0x1,'tooltip':i(_0x258d65,'AI_CHAT_HISTORY_ACCEPT')}),_0x40df44['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x40df44['on']('execute',()=>{this['_commitEditInputValue'](_0x14d639);}),_0x40df44;}['_commitEditInputValue'](_0x33afbc){const _0x2caeab=_0x33afbc['element']['value']||'';this['_titleView']['text']=_0x2caeab,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x2caeab});}['_createCancelEditButtonView'](_0x64b8f0,_0x1a2dc3){const _0x2653a2=new _0x42f5cd(_0x64b8f0);return _0x2653a2['set']({'icon':_0x42f179,'withText':!0x1,'tooltip':i(_0x64b8f0,'AI_CHAT_HISTORY_CANCEL')}),_0x2653a2['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x2653a2['on']('execute',()=>{this['isEdit']=!0x1,_0x1a2dc3['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x2653a2;}['_createSpinnerView'](){const _0x2df9ce=new pi('tiny');return _0x2df9ce['isVisible']=!0x0,_0x2df9ce;}['isMatching'](_0x26cccd){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x26cccd)?{'title':!0x0}:null;}['highlightText'](_0x1223e3){this['_titleView']['highlightText'](_0x1223e3);}}class wt extends _0x10e3da{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x519a48,_0x34b278){super(_0x519a48),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 _0x23d2e5=new _0x3571c0(_0x519a48,{'label':i(_0x519a48,'AI_CHAT_HISTORY_HEADING'),'icon':Nt,'class':'ck-ai-header\x20ck-ai-header_history'});_0x34b278&&(this['resizeButton']=Hs(_0x519a48,this),_0x23d2e5['children']['add'](this['resizeButton'])),this['sectionsView']=new Ri(_0x519a48,[]),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',_0x76e577=>!_0x76e577)]}}),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':[_0x23d2e5,{'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 _0x45af3d=new _0x362dba(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x13aa62=>i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x13aa62),'secondary':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x3f648a=this['_createErrorView']();return _0x3f648a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x2b95e1=>!_0x2b95e1)]}}),_0x45af3d['on']('render',()=>{_0x45af3d['children']['add'](_0x3f648a,0x1);}),_0x45af3d['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x5b1c5a=>!_0x5b1c5a)]}}),_0x45af3d;}['_createSkeletonView'](){const _0x330804=new ui(this['locale'],fi['aiHistory']);return _0x330804['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x43e7da=>!_0x43e7da)]}}),_0x330804;}['_createErrorView'](){const _0x331281=new _0x10e3da(this['locale']),_0x431c88=new _0x42f5cd(this['locale']);_0x431c88['set']({'withText':!0x1,'icon':_0x42f179,'class':'ck-ai-notification_error__dismiss-button'}),_0x431c88['bind']('isVisible')['to'](this,'hasItems',_0x4dc1f1=>!!_0x4dc1f1),_0x431c88['on']('execute',()=>{this['errorMessage']='';});const _0x4aa974=this['bindTemplate'];return _0x331281['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x4aa974['to']('errorMessage')}]},_0x431c88]}),_0x331281;}['_createEmptyStateView'](){const _0x504fdb=new _0x42f5cd(this['locale']);_0x504fdb['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x5251eb,'class':'ck-ai-chat__start-conversation'}),_0x504fdb['on']('execute',()=>{this['fire']('openChat');});const _0x4edf56=new _0x10e3da(this['locale']);return _0x4edf56['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x26460b=>!_0x26460b)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[i(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x504fdb]}),_0x4edf56;}['_createListItemViews'](_0x20343a,_0x3f1c6d){const _0x2c5f61=[];for(const _0x3a9492 of _0x20343a){const _0x3fe303=new xi(_0x3f1c6d,_0x3a9492);_0x3fe303['delegate'](...Li)['to'](this),_0x2c5f61['push'](_0x3fe303);}return _0x2c5f61;}['updateHistoryItemsWithCategories'](_0x10af0f){const _0x38ccf3=this['locale']||'en',_0x3d3164=[];for(const _0x1dfa9f of _0x10af0f){const _0x209ad7=this['_createListItemViews'](_0x1dfa9f['items'],_0x38ccf3);_0x3d3164['push'](new Mi(_0x38ccf3,{'title':_0x1dfa9f['title'],'items':_0x209ad7}));}this['sectionsView']['sections']=_0x3d3164,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x3d3164),this['hasItems']=_0x10af0f['some'](_0x392d74=>_0x392d74['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x42e17d){for(const _0x10fb38 of this['sectionsView']['sections']){const _0x565b23=_0x10fb38['getItem'](_0x42e17d);if(_0x565b23){if(_0x10fb38['removeItem'](_0x565b23),0x0===_0x10fb38['itemsViews']['length']){const _0x5b78bd=this['sectionsView']['sections']['indexOf'](_0x10fb38);-0x1!==_0x5b78bd&&(this['sectionsView']['sections']['splice'](_0x5b78bd,0x1),this['sectionsView']['items']['remove'](_0x10fb38));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x10561d,_0x21f25c){for(const _0x22a908 of this['sectionsView']['sections']){const _0x5220e2=_0x22a908['getItem'](_0x10561d);if(_0x5220e2){_0x5220e2['updateTitle'](_0x21f25c);break;}}}['updateItemLoadingState'](_0x2da332,_0x9c7175,_0x478a76){for(const _0x223382 of this['sectionsView']['sections']){const _0x180e2d=_0x223382['getItem'](_0x2da332);if(_0x180e2d){_0x180e2d['updateLoadingState'](_0x9c7175,_0x478a76);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x9aea56=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x9aea56);}}}const Li=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class xt extends _0x2536b2{static get['requires'](){return[pt];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3d36f5){super(_0x3d36f5);const _0x1a8c4d=this['context']['plugins']['get']('AITabs');this['_historyView']=new wt(this['context']['locale'],_0x1a8c4d['showResizeButton']),this['_historyView']['delegate'](...Li)['to'](this),_0x1a8c4d['view']['addTab']({'id':'history','buttonLabel':i(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Nt,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x340952){this['_historyView']['removeHistoryItem'](_0x340952);}['updateItems'](_0x5da335){this['_historyView']['updateHistoryItemsWithCategories'](_0x5da335);}['updateItemTitle'](_0x3e5d1b,_0x55ca78){this['_historyView']['updateItemTitle'](_0x3e5d1b,_0x55ca78);}['updateItemLoadingState'](_0x4029ad,_0x3d985b,_0x44752a){this['_historyView']['updateItemLoadingState'](_0x4029ad,_0x3d985b,_0x44752a);}['setLoadingSkeleton'](_0x317209){this['_historyView']['isLoading']=_0x317209;}['showError'](_0x18f0d8){this['_historyView']['errorMessage']=_0x18f0d8;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x455360){this['_historyView']['isMaximized']=_0x455360;}}class ir extends ts(){['id'];['createdAt'];constructor({id:_0x40973e,title:_0x138e8f,createdAt:_0x4c2e00,updatedAt:_0x58db82,pinned:_0x4b4c64}){super(),this['id']=_0x40973e,this['createdAt']=new Date(_0x4c2e00),this['set']('title',_0x138e8f),this['set']('updatedAt',_0x58db82?new Date(_0x58db82):null),this['set']('pinned',_0x4b4c64||!0x1);}['updateTitle'](_0x3088da){this['set']('title',_0x32cd9f(_0x3088da)),this['updatedAt']=new Date();}['updatePinned'](_0x4cdd3c){this['set']('pinned',_0x4cdd3c),this['updatedAt']=new Date();}}class Ht extends _0x5d9d11(){['items']=[];['connector'];['group'];constructor({connector:_0x5bd6bf,group:_0x13cef8}){super(),this['connector']=_0x5bd6bf,this['group']=_0x13cef8;}async['init'](){try{const _0x355679=this['connector']['fetchConversations'](this['group']),_0x3fd0d1=await _0x355679['getConversations']();this['loadItems'](_0x3fd0d1);}catch(_0xe8de87){this['fire']('error',{'error':_0xe8de87,'operation':'init'});}}['addItem'](_0x3a3d45){this['items']['push'](_0x3a3d45);}async['removeItem'](_0x342c5c){const _0x2c8da7=this['items']['findIndex'](_0x48f27b=>_0x48f27b['id']===_0x342c5c);if(-0x1===_0x2c8da7)return!0x1;try{return await this['connector']['deleteConversation'](_0x342c5c)['execute'](),this['items']['splice'](_0x2c8da7,0x1),this['fire']('itemRemoved',{'itemId':_0x342c5c}),!0x0;}catch(_0x3314c8){return this['fire']('error',{'error':_0x3314c8,'operation':'removeItem','itemId':_0x342c5c}),!0x1;}}['getItem'](_0x594438){return this['items']['find'](_0x4ab8c8=>_0x4ab8c8['id']===_0x594438);}async['updateItemTitle'](_0x354c4e,_0x338675){const _0x49cf97=this['getItem'](_0x354c4e);if(!_0x49cf97)return!0x1;try{return await this['connector']['updateConversation'](_0x354c4e,{'title':_0x338675})['getResult'](),_0x49cf97['updateTitle'](_0x338675),this['fire']('itemUpdated',{'itemId':_0x354c4e,'updates':{'title':_0x338675}}),!0x0;}catch(_0x49b1a1){return this['fire']('error',{'error':_0x49b1a1,'operation':'updateItemTitle','itemId':_0x354c4e}),!0x1;}}async['updateItemPinned'](_0x49b3ff,_0x28661e){const _0x5d4f96=this['getItem'](_0x49b3ff);if(!_0x5d4f96)return!0x1;try{return await this['connector']['updateConversation'](_0x49b3ff,{'pinned':_0x28661e})['getResult'](),_0x5d4f96['updatePinned'](_0x28661e),this['fire']('itemUpdated',{'itemId':_0x49b3ff,'updates':{'pinned':_0x28661e}}),!0x0;}catch(_0x3c3bae){return this['fire']('error',{'error':_0x3c3bae,'operation':'updateItemPinned','itemId':_0x49b3ff}),!0x1;}}['loadItems'](_0x1b46e0){try{this['items']=[],_0x1b46e0['map'](_0x297b35=>{this['addItem'](new ir(_0x297b35));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x3d07a2){this['fire']('error',{'error':_0x3d07a2,'operation':'loadItems'});}}['getItems'](_0x2ebaa8={}){const _0x44fca9=void 0x0!==_0x2ebaa8['pinned']&&_0x2ebaa8['pinned'],_0x283371=_0x2ebaa8['from']?new Date(_0x2ebaa8['from']['getFullYear'](),_0x2ebaa8['from']['getMonth'](),_0x2ebaa8['from']['getDate']()):null,_0x134ab8=_0x2ebaa8['to']?new Date(_0x2ebaa8['to']['getFullYear'](),_0x2ebaa8['to']['getMonth'](),_0x2ebaa8['to']['getDate']()):null;return this['items']['filter'](_0x4de585=>{if(_0x4de585['pinned']!==_0x44fca9)return!0x1;if(_0x134ab8){const _0x3c0282=new Date(_0x4de585['createdAt']['getFullYear'](),_0x4de585['createdAt']['getMonth'](),_0x4de585['createdAt']['getDate']());return _0x283371?_0x283371['getTime']()===_0x134ab8['getTime']()?_0x3c0282['getTime']()===_0x283371['getTime']():_0x3c0282<_0x134ab8&&_0x3c0282>=_0x283371:_0x3c0282<_0x134ab8;}return!0x0;});}}class jt extends _0x2536b2{['_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 _0x1db79b=this['context']['plugins']['get'](pt);try{const _0x1dbf62=this['_aiChatController']['getGroupId']();this['history']=new Ht({'connector':this['_aiConnector'],'group':_0x1dbf62}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x4fa58f,_0x4def25)=>{this['_setItemLoading'](_0x4def25['id'],'remove'),this['_handleRemove'](_0x4def25['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0xb6aeff,_0x576bb2)=>{this['_setItemLoading'](_0x576bb2['id'],'rename'),this['_handleEditTitle'](_0x576bb2['id'],_0x576bb2['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x3a334b,_0x1225ee)=>{void 0x0!==_0x1225ee['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x1225ee['itemId'],_0x1225ee['updates']['title']),void 0x0!==_0x1225ee['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x1225ee['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x4e11cb,_0x39eeb2)=>{this['_aiChatController']['handleRemovedConversation'](_0x39eeb2['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x39eeb2['itemId']),this['_clearItemLoading'](_0x39eeb2['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x11de55,_0x4dc663)=>{this['_handleHistoryErrorUI'](_0x4dc663['error'],_0x4dc663['operation'],_0x4dc663['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x2c0065,_0x3e1c27)=>{this['_handleSelectConversation'](_0x3e1c27['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x391652,_0x28a058)=>{const _0xcca3d7=_0x28a058['pinned']?'pin':'unpin';this['_setItemLoading'](_0x28a058['id'],_0xcca3d7),this['_handleTogglePin'](_0x28a058['id'],_0x28a058['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x1db79b['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x1db79b['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x1db79b,'resizedTabs',(_0x3fd4ce,_0xb6ed8b)=>{this['_setIsMaximized'](_0xb6ed8b);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x1db79b['resize']();});}catch(_0x33c6a8){this['_handleHistoryErrorUI'](_0x33c6a8,'init');}}async['_handleEditTitle'](_0x59a422,_0x7f354f){await this['history']['updateItemTitle'](_0x59a422,_0x7f354f);}async['_handleTogglePin'](_0x32f619,_0x1916a0){await this['history']['updateItemPinned'](_0x32f619,_0x1916a0);}async['_handleRemove'](_0x359f56){await this['history']['removeItem'](_0x359f56);}async['_handleSelectConversation'](_0x39d374){await this['_aiChatController']['loadConversation'](_0x39d374);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x36bdc5=this['_aiChatController']['activeConversation']?.['id'],_0x3a4893=this['_getCategorizedItems']()['map'](_0x20e928=>({'title':_0x20e928['title'],'items':_0x20e928['items']['map'](_0x2ca61d=>({'id':_0x2ca61d['id'],'title':_0x2ca61d['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x2ca61d['createdAt'])['toLocaleDateString'](),'active':_0x2ca61d['id']===_0x36bdc5,'pinned':_0x2ca61d['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x3a4893);}['_setItemLoading'](_0x1d0e5d,_0x2f7b39){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x1d0e5d,_0x2f7b39,!0x0);}['_clearItemLoading'](_0x5564b4){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x5564b4,null,!0x1);}['_handleHistoryErrorUI'](_0xa12059,_0x1d3508,_0x5e248a){const _0xff91ca=this['_generateErrorMessage'](_0x1d3508,_0x5e248a);this['_aiChatHistoryUi']['showError'](_0xff91ca),_0x5e248a&&this['_clearItemLoading'](_0x5e248a),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x2baa93,_0x51a9d6){const _0x7ba3f5=_0x51a9d6?this['history']['getItem'](_0x51a9d6):null,_0x2a3e74=_0x7ba3f5?.['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x2baa93){case'updateItemTitle':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x2a3e74);case'updateItemPinned':{const _0x3182bc=i(this['context']['locale'],_0x7ba3f5?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x3182bc,_0x2a3e74]);}case'removeItem':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x2a3e74);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 _0x2327dc=new Date(),_0x2a9ac8=new Date(_0x2327dc['getFullYear'](),_0x2327dc['getMonth'](),_0x2327dc['getDate']()),_0x24059c=new Date(_0x2a9ac8);_0x24059c['setDate'](_0x24059c['getDate']()-0x1);const _0x59f536=new Date(_0x2a9ac8);_0x59f536['setDate'](_0x59f536['getDate']()-0xe);const _0x411317=this['history']['getItems']({'pinned':!0x0}),_0x384a2e=this['history']['getItems']({'from':_0x2a9ac8,'to':_0x2a9ac8}),_0x33effc=this['history']['getItems']({'from':_0x24059c,'to':_0x24059c}),_0x2b9a64=this['history']['getItems']({'from':_0x59f536,'to':_0x24059c}),_0x47ccdb=this['history']['getItems']({'to':_0x59f536}),_0xd36d59=[];return _0x411317['length']>0x0&&_0xd36d59['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x411317}),_0x384a2e['length']>0x0&&_0xd36d59['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x384a2e}),_0x33effc['length']>0x0&&_0xd36d59['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x33effc}),_0x2b9a64['length']>0x0&&_0xd36d59['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x2b9a64}),_0x47ccdb['length']>0x0&&_0xd36d59['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x47ccdb}),_0xd36d59;}['_setIsMaximized'](_0x309c5b){this['_aiChatHistoryUi']['setIsMaximized'](_0x309c5b);}}class ht extends _0x2536b2{static get['requires'](){return[jt,xt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ma extends _0x2536b2{static get['requires'](){return[at,D,ct,ht];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x103723){super(_0x103723),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:_0x2d8c8c,attributes:_0x3affe7}){await this['context']['plugins']['get'](at)['sendMessage']({'message':_0x2d8c8c,'attributes':_0x3affe7});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](at)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](at)['focusPromptInput']();}['registerToolDataCallback'](_0x2fd516){this['context']['plugins']['get'](at)['_registerToolDataCallback'](_0x2fd516);}}class fs extends _0x42f5cd{['id'];constructor(_0x3c5aff,_0x24eb5f){super(_0x3c5aff);const {id:_0x5c7b13,type:_0x47991f,icon:_0x1c05e4}=_0x24eb5f;this['id']=_0x5c7b13,this['set']({'label':_0x24eb5f['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x24eb5f['id']}}),_0x1c05e4?this['icon']=_0x1c05e4:'chat'===_0x47991f?this['icon']=_0x29a1be:'review'===_0x47991f?this['icon']=_0x1cb916:'translate'===_0x47991f&&(this['icon']=Vt);}}class kt extends _0x10e3da{['listView'];constructor(_0x478fe6,_0x214f83){super(_0x478fe6);const _0x2aa438=_0x214f83['map'](_0x4b5d87=>{const _0x3ce1f5=new _0x5f33aa(this['locale']),_0x392f94=new fs(this['locale'],_0x4b5d87);return _0x3ce1f5['children']['add'](_0x392f94),_0x392f94['delegate']('execute')['to'](this),_0x3ce1f5;});this['listView']=new _0x49312a(this['locale']),this['listView']['items']['addMany'](_0x2aa438),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const Ut='chat-shortcuts';var Ua=function(_0x25df82){return _0x25df82['CHAT']='chat',_0x25df82['REVIEW']='review',_0x25df82['TRANSLATE']='translate',_0x25df82;}({});class Va extends _0x2536b2{['_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 _0x22afed=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x22afed['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x22afed,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x444390=Object['values'](Ua);this['_shortcuts']['forEach'](_0x32385c=>{let _0x13b05c=!0x0;if(_0x32385c['id']&&_0x32385c['label']&&_0x444390['includes'](_0x32385c['type'])?'chat'===_0x32385c['type']&&(_0x13b05c='string'==typeof _0x32385c['prompt']):_0x13b05c=!0x1,!_0x13b05c)throw new _0x70c77e('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x32385c});});}['_injectShortcuts'](){const _0x51e548=this['context']['plugins']['get'](ct);this['_shortcutsView']=new kt(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x51e548['addFeedItemCustomElement'](this['_shortcutsView']['element'],Ut),this['_shortcutsView']['on']('execute',_0x17d50d=>{const _0x577d27=_0x17d50d['source']['id'];this['_executeShortcut'](_0x577d27);});}['_removeShortcuts'](){const _0x1889f2=this['context']['plugins']['get'](ct);_0x1889f2['hasFeedItem'](Ut)&&_0x1889f2['removeFeedItem'](Ut),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x18ffe2){const _0x59d6f4=this['_shortcuts']['find'](_0x68ed24=>_0x68ed24['id']===_0x18ffe2),_0xfd1a7d=_0x59d6f4['type'];'chat'===_0xfd1a7d?this['_runChatShortcut'](_0x59d6f4):'review'===_0xfd1a7d?_0x59d6f4['check']?this['_runReviewShortcut'](_0x59d6f4):this['_switchTab']('reviewMode'):'translate'===_0xfd1a7d&&(_0x59d6f4['language']?this['_runTranslateShortcut'](_0x59d6f4):this['_switchTab']('translate'));}['_switchTab'](_0x2eb262){if(!this['context']['plugins']['has']('AITabs'))throw new _0x70c77e('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x2eb262});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x2eb262);}async['_runChatShortcut']({prompt:_0x3a82fb,draftMode:_0x2d9825,useWebSearch:_0x198af0=!0x1,useReasoning:_0x4c0d76=!0x1,model:_0x3c78ad}){const _0x149ff7=this['context']['plugins']['get']('AIChat'),_0x3b7aa8=this['context']['plugins']['get']('AIChatController'),_0xa87cf4=_0x3b7aa8['activeConversation'];let _0x27e761;_0x27e761=_0x3c78ad?await _0xa87cf4['chatModels']['getModel'](_0x3c78ad):await _0xa87cf4['chatModels']['getDefault'](),_0x27e761&&await _0xa87cf4['setModel'](_0x27e761),_0xa87cf4['setWebSearch'](_0x198af0),_0xa87cf4['setReasoning'](_0x4c0d76),_0x3b7aa8['addCurrentDocumentToChatContext'](),_0x2d9825?(this['_aiChatUI']['setPromptInputValue'](_0x3a82fb),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x149ff7['sendMessage']({'message':_0x3a82fb});}['_runReviewShortcut']({check:_0x2a96e6,model:_0x1deb93,prompt:_0x5291c3,params:_0x1036d6}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new _0x70c77e('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x2a3395={'id':_0x2a96e6,'isCustom':'custom'===_0x2a96e6};_0x1deb93&&_0x5291c3&&(_0x2a3395['args']={'model':_0x1deb93,'prompt':_0x5291c3}),_0x1036d6&&(_0x2a3395['params']=_0x1036d6),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x2a3395);}['_runTranslateShortcut']({language:_0x219a54}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new _0x70c77e('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x219a54,'args':{'language':_0x219a54}});}}class io extends Lt{constructor(_0x189ec7){super(_0x189ec7);const _0x4bdc5f=_0x189ec7['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x4bdc5f,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x4268f5=this['editor']['plugins']['get']('AITabs')['view'];_0x4268f5['isVisible']=!_0x4268f5['isVisible'];}}class qt extends _0x4d60c6{static get['requires'](){return[pt];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x21a331=this['editor'];_0x21a331['commands']['add']('toggleAi',new io(_0x21a331)),_0x21a331['ui']['componentFactory']['add']('toggleAi',()=>{const _0x22e4ca=this['_createAIUIButton'](_0x42f5cd);return _0x22e4ca['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x22e4ca;}),_0x21a331['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x393742=this['_createAIUIButton'](_0xa34e7b);return _0x393742['set']({'role':'menuitemcheckbox'}),_0x393742;});}['_createAIUIButton'](_0x37f775){const _0x1d97fd=this['editor'],_0x2d8fd5=_0x1d97fd['commands']['get']('toggleAi'),_0x2ef278=new _0x37f775(_0x1d97fd['locale']);return _0x2ef278['set']({'label':i(_0x1d97fd['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x5cbeee,'isToggleable':!0x0}),_0x2ef278['bind']('isEnabled')['to'](_0x2d8fd5),_0x2ef278['bind']('isOn')['to'](_0x2d8fd5,'value',_0x6710c3=>!!_0x6710c3),this['listenTo'](_0x2ef278,'execute',()=>{_0x2d8fd5['execute']();}),_0x2ef278;}}const F=['applySuggestion','insertSuggestion','showNext','showPrevious'];class ls extends _0x10e3da{['_errorView'];constructor(_0x11b248){super(_0x11b248),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x5ab4bb){this['showError'](_0x5ab4bb);}['showError'](_0xb63228){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0xb63228,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x1f19cb=new _0x10e3da(this['locale']),_0x2daf7f=new _0x10e3da(this['locale']);return _0x2daf7f['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x1f19cb['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x5ec28b=>!_0x5ec28b)]},'children':[_0x2daf7f]}),_0x1f19cb;}}const $=0xa;class Q extends _0x2536b2{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'](_0x133592){const {id:_0x3af9a4}=this['_currentConfig']??{};this['_currentConfig']=_0x133592;const {id:_0x7bdc45}=this['_currentConfig'];this['isOpen']&&_0x3af9a4===_0x7bdc45?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x15e001=T(this['context'])['plugins']['get']('Dialog');_0x15e001['isOpen']&&this['_currentConfig']&&_0x15e001['id']===this['_currentConfig']['id']&&_0x15e001['hide']();}['_updateDialog'](){const _0x4289f5=T(this['context'])['plugins']['get']('Dialog'),{icon:_0x30a13f,title:_0x4e1902}=this['_currentConfig'];_0x4289f5['view']?.['headerView']&&(_0x4289f5['view']['headerView']['label']=_0x4e1902,_0x4289f5['view']['headerView']['iconView']&&_0x30a13f&&(_0x4289f5['view']['headerView']['iconView']['content']=_0x30a13f)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x4289f5['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](D)['showFakeVisualSelection'](this['_currentConfig']['ranges'],'ai-balloon-'+this['_currentConfig']['index'],!0x0,!0x0);}['_hideFakeVisualSelection'](_0x2c67f2){this['context']['plugins']['get'](D)['hideFakeVisualSelection']('ai-balloon-'+_0x2c67f2);}['_showDialog'](){const _0x571ab3=T(this['context'])['plugins']['get']('Dialog'),{id:_0x171d7d,title:_0x5d4996,icon:_0x3933e6,class:_0x9d775c,mainView:_0x4305ca}=this['_currentConfig'];_0x4305ca['delegate'](...F)['to'](this),_0x571ab3['show']({'title':_0x5d4996,'icon':_0x3933e6,'hasCloseButton':!0x0,'id':_0x171d7d,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x9d775c||''),'content':_0x4305ca,'onShow':_0x1c6ce3=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0xe2f4b0=this['_getSelectionElements']();_0xe2f4b0&&_0xe2f4b0[0x0]&&_0x29d957({'target':_0xe2f4b0[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x1c6ce3['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x171d7d});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](this['_currentConfig']['index']),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x171d7d}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x2eb64,_0x145f65){if(!_0x145f65)return null;const _0x214526=this['_getSelectionElements']();if(!_0x214526||0x0===_0x214526['length'])return{'left':Math['round'](_0x145f65['left']+_0x145f65['width']/0x2-_0x2eb64['width']/0x2),'top':Math['round'](_0x145f65['top']+_0x145f65['height']/0x2-_0x2eb64['height']/0x2)};const _0x5cc8b8=Math['round'](_0x145f65['left']+_0x145f65['width']/0x2-_0x2eb64['width']/0x2),_0x6558d5=_0x214526['map'](_0x564d80=>new _0x7d114a(_0x564d80)),_0x3216f1=_0x2eb64['height'];return{'left':_0x5cc8b8,'top':this['_calculateOptimalTopPosition'](_0x6558d5,_0x3216f1,_0x145f65)};}['_calculateOptimalTopPosition'](_0x35368b,_0x281980,_0x1c0e25){const _0x13e526=new _0x7d114a(_0x468ca9['window']),_0x327741=_0x35368b['map'](_0x265edf=>_0x265edf['getVisible']())['filter'](_0x42dbbe=>_0x42dbbe),_0x3ef246=_0x7d114a['getBoundingRect'](_0x327741);if(!_0x3ef246)return Math['round'](_0x1c0e25['top']+_0x1c0e25['height']/0x2);const _0x7c510d=_0x13e526['getIntersection'](_0x3ef246);if(!_0x7c510d)return Math['round'](_0x1c0e25['top']+_0x1c0e25['height']/0x2);const _0x4f210f=_0x1c0e25['getVisible'](),_0x11550d=_0x4f210f&&_0x3ef246['height']>_0x4f210f['height'],_0x5e2055=_0x7c510d['top'],_0x3efcab=_0x7c510d['bottom'];if(_0x11550d){const _0x25e987=(_0x4f210f||_0x13e526)['height']/0x2-_0x281980/0x2,_0x34bfd5=_0x5e2055-$-_0x1c0e25['top'],_0x2a289d=_0x1c0e25['bottom']-_0x3efcab-$;return _0x34bfd5>=_0x281980?Math['max']($,_0x5e2055-_0x281980-$):_0x2a289d>=_0x281980?_0x3efcab+$:Math['max']($,_0x25e987);}const _0x2604e3=_0x5e2055-_0x281980,_0x450edd=_0x1c0e25['bottom']-_0x3efcab-$,_0x9485f8=_0x5e2055-$-_0x1c0e25['top'];let _0x19b345;if(_0x450edd>=_0x281980)_0x19b345=_0x3efcab+$;else{if(_0x9485f8>=_0x281980)_0x19b345=_0x2604e3-$;else _0x19b345=_0x5e2055+_0x3ef246['height']/0x2-_0x281980/0x2;}return _0x19b345;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x3bf96c=T(this['context']);this['listenTo'](_0x3bf96c['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x4f284d,data:{newRange:_0x3f62ec}}of _0x3bf96c['model']['document']['differ']['getChangedMarkers']())if(_0x4f284d['startsWith'](R+':')&&(_0x3f62ec&&(_0x3f62ec['start']['isEqual'](_0x3f62ec['end'])||'$graveyard'==_0x3f62ec['root']['rootName'])||null==_0x3f62ec)){const _0x59c8b4=i(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x59c8b4),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x13f047=T(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x13f047['model']['document']);}['_getSelectionElements'](){const _0x9080e1=T(this['context']);return _0x4ca3b4(_0x9080e1['editing'],[..._0x9080e1['model']['markers']['getMarkersGroup']('ai-selection'),..._0x9080e1['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class us extends _0x243ac0{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x3d060b,_0x4b8001={}){super(_0x3d060b),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x4b8001};const _0x235a9a=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x235a9a?'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'](_0x1c80b6){this['showChangesButton']['isEnabled']=_0x1c80b6;}['_setupRatingButtons'](){this['likeButton']=new _0x42f5cd(this['locale']),this['likeButton']['set']({'icon':_0x49f028,'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 _0x42f5cd(this['locale']),this['dislikeButton']['set']({'icon':_0x1adf0b,'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 _0x42f5cd(this['locale']),this['copyButton']['set']({'icon':_0x3ccaab,'label':i(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x19aa95=new _0x5d3550();_0x19aa95['set']({'content':_0x4ddc06}),_0x19aa95['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'](_0x19aa95);}['_setupShowChangesButton'](){this['showChangesButton']=new _0x42f5cd(this['locale']),this['showChangesButton']['set']({'icon':_0x2046d4,'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',_0x5009d8=>_0x5009d8?_0x37f7c4:_0x2046d4),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(_0x3271d4,_0x55d64c){super(_0x3271d4);const _0x32fbfc=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _0x3295cb(),this['_keystrokes']=new _0x4259de(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0xb86ebf({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x55d64c,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new as(_0x3271d4),this['_partToolbarView']=new cs(_0x3271d4,_0x55d64c['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x55d64c),this['_stateView']=new ws(_0x3271d4),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new us(_0x3271d4,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new ms(_0x3271d4,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x5bb948,_0x2206df,_0xe1e543,_0x1f76f1)=>{let _0x346de9,_0x3381b3;'pending'===_0x1f76f1?(_0x346de9=this['_partToolbarView'],_0x3381b3=this['_stateView']):(_0x346de9=this['_stateView'],_0x3381b3=this['_partToolbarView']),this['_stateView']['setState'](_0xe1e543),_0x346de9['isVisible']=!0x1,_0x3381b3['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x32fbfc['to']('_state',_0x1b98f1=>'ck-ai-chat-balloon-main_state_'+_0x1b98f1)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x55d64c);});}['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'](_0xf04270){_0xf04270?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0xf04270);}['setState'](_0x113eee){this['_state']=_0x113eee;}['showError'](_0x274810){super['showError'](_0x274810),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0xb1edc7){super['showBlockingError'](_0xb1edc7),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x2bf982){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x2bf982;}['togglePartToolbarEnabled'](_0xeb0ec8){this['_partToolbarView']['isEnabled']=_0xeb0ec8;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x2a4991,showSuggestButton:_0xdb083d}){_0x2a4991=_0x2a4991&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0xdb083d=_0xdb083d&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x2a4991,'showSuggestButton':_0xdb083d});}['_createNextButtonView'](){const _0xb6e6a1=new _0x42f5cd(this['locale']);return _0xb6e6a1['set']({'icon':_0x3b0b4d,'label':i(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0xb6e6a1['on']('execute',()=>{this['fire']('showNext');}),_0xb6e6a1;}['_createPreviousButtonView'](){const _0x54179d=new _0x42f5cd(this['locale']);return _0x54179d['set']({'icon':_0x22916d,'label':i(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x54179d['on']('execute',()=>{this['fire']('showPrevious');}),_0x54179d;}}class ms extends _0x10e3da{constructor(_0x38b00e,_0x3dac44){super(_0x38b00e),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x3dac44});}}class Ot extends _0x4d60c6{static get['requires'](){return[_0x2e97ba,Q];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x39bd23){super(_0x39bd23),this['set']('showDiff',!0x1);}['open'](_0x29b3f6){const _0x38d039=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x38d039['plugins']['get']('AIBalloon')['open']({..._0x29b3f6,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x29b3f6['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x29b3f6['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x2c2fd5){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x2c2fd5);}['setState'](_0x8692c){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x8692c);}['_createChatBalloonView'](){const _0x1a15dc=this['editor'],_0x518b09=_0x1a15dc['plugins']['get']('AIBalloon'),_0x1bfea4=_0x1a15dc['commands']['get']('trackChanges');let _0x207fdf=_0x1a15dc['config']['get']('ai.availableReplyActions')||[...ot];_0x1a15dc['plugins']['has']('TrackChanges')||(_0x207fdf=_0x207fdf['filter'](_0x26c5ab=>'insertSuggestion'!=_0x26c5ab));const _0x614a4=new lt(_0x1a15dc['locale'],{'availableActions':_0x207fdf,'showApplyButton':!0x0,'showSuggestButton':!!_0x1bfea4});return _0x614a4['bind']('showDiff')['to'](this),_0x614a4['delegate'](...ut)['to'](this),_0x614a4['delegate']('showPrevious','showNext')['to'](this),_0x518b09['delegate']('dialogClosed')['to'](this),_0x614a4['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x614a4['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x614a4['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x1bfea4&&_0x614a4['bind']('isTrackChangesOn')['to'](_0x1bfea4,'value'),_0x614a4['render'](),_0x614a4;}['_toggleRotatorButtonsInDialogHeader'](_0x323a3c){const _0x2089a5=this['editor'],_0x379301=_0x2089a5['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x323a3c),_0x379301['has'](this['_chatBalloonView']['previousButtonView'])||(_0x379301['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x2089a5['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x379301['remove'](this['_chatBalloonView']['previousButtonView']),_0x379301['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class Ba extends _0x4d60c6{static get['requires'](){return[qt,Ot,zt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Zt(_0x51e48c){const {editor:_0x48aca3,action:_0x863b13,withText:_0x8a94da=!0x1,withIcon:_0x415f42=!0x0,isInDropdown:_0x466f94=!0x0,shouldPreventFocus:_0x1b781c=!0x1}=_0x51e48c;return()=>{const _0x4416a5=_0x48aca3['locale'],_0x52601f=new _0x42f5cd(_0x4416a5),_0x4a456b=_0x52601f['bindTemplate'];_0x466f94&&_0x52601f['extendTemplate']({'on':{'mouseenter':_0x4a456b['to'](()=>{_0x1b781c&&_0x1b781c()||_0x52601f['focus']();})}});const _0x53b8f8=_0x863b13['icon']??_0x863b13['parent']?.['icon'];return _0x52601f['set']({'label':_0x863b13['displayedPrompt'],'withText':_0x8a94da,'role':'menuitem','icon':_0x415f42?_0x53b8f8??_0x376ad5:void 0x0,'tooltip':!_0x8a94da,'class':'ck-ai-quick-actions-button','isEnabled':_0x863b13['isEnabled']}),_0x52601f['on']('execute',()=>{_0x48aca3['editing']['view']['focus'](),_0x48aca3['commands']['execute']('aiQuickAction',_0x863b13);}),_0x52601f;};}class Gs extends _0xee7128{['arrowView'];constructor(_0x746a98,_0x3641dc){super(_0x746a98,_0x3641dc);const _0x14cc28=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',_0x464001=>String(_0x464001)),'data-cke-tooltip-disabled':_0x14cc28['to']('isOn')},'on':{'mouseenter':_0x14cc28['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x13d6ee=new _0x5d3550();return _0x13d6ee['content']=_0x24c88e,_0x13d6ee['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x13d6ee;}}class Ks extends _0x49312a{['_allListItems'];['_allSearchableItems'];constructor(_0x31730a,_0x2262ae,_0x33b000){super(_0x31730a),this['_allListItems']=_0x2262ae,this['_allSearchableItems']=_0x33b000;}['filter'](_0x46f73f){if(!_0x46f73f)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x3f69db=_0x46f73f['source']['toLowerCase']()['trim'](),_0x578f9a=this['_allSearchableItems']['filter'](_0x207994=>(_0x207994['groupLabel']?_0x207994['label']+'\x20('+_0x207994['groupLabel']+')':_0x207994['label'])['toLowerCase']()['includes'](_0x3f69db));return this['items']['clear'](),this['items']['addMany'](_0x578f9a['sort']((_0x565252,_0x20ef26)=>{const _0x393b30=_0x565252['groupLabel'],_0x2adea4=_0x20ef26['groupLabel'];return _0x393b30||_0x2adea4?_0x393b30?0x1:-0x1:0x0;})['map'](_0x5df412=>_0x5df412['item'])),this['_highlightQuery'](_0x3f69db,_0x578f9a),{'resultsCount':_0x578f9a['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x3e02ce,_0x4537ff){if(!_0x3e02ce)return;const _0x22546b=new RegExp(_0x2d9edc(_0x3e02ce),'gi');_0x4537ff['forEach'](_0x1064cf=>{_0x1064cf['highlightViews']&&_0x1064cf['highlightViews']['forEach'](_0x1e9000=>{'function'==typeof _0x1e9000['highlightText']&&_0x1e9000['highlightText'](_0x22546b);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x5257cd=>{_0x5257cd['highlightViews']&&_0x5257cd['highlightViews']['forEach'](_0xb36fbb=>{'function'==typeof _0xb36fbb['highlightText']&&_0xb36fbb['highlightText'](null);});});}}const Js='menu',Ws='menuitem';class co extends _0x10e3da{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x4a15ef,_0x3e1e66,_0x3629fe,_0x422adb,_0x468a6c=!0x1){const _0x1d2cf6=_0x4a15ef['locale'];super(_0x1d2cf6),this['_bodyCollection']=_0x422adb,this['_hasSearch']=_0x468a6c;const _0x6f8779=this['_createListItems'](_0x4a15ef,_0x3e1e66,_0x3629fe);this['optionsListView']=new Ks(_0x1d2cf6,_0x6f8779,this['_allSearchableItems']),this['optionsListView']['role']=Js,this['optionsListView']['items']['addMany'](_0x6f8779),this['focusTracker']=new _0x3295cb(),this['keystrokes']=new _0x4259de(),_0x468a6c&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x6f8779,this['focusCycler']=new _0xb86ebf({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x468a6c&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x3433f6=_0x468a6c&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x229fa2(_0x3433f6),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x1d2cf6['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x362dba(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 _0x393966=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x393966);}['_createListItems'](_0x163e98,_0x3cdf1b,_0x59c9a9){const _0x13f65b=new _0x229fa2();return _0x3cdf1b['forEach'](_0x1a91be=>{if('actions'in _0x1a91be){const {listItem:_0x8b69c}=this['_createActionGroupButton'](_0x163e98,_0x1a91be,_0x59c9a9);_0x13f65b['add'](_0x8b69c),_0x1a91be['actions']['forEach'](_0x503158=>{this['_createActionButton'](_0x163e98,_0x503158,_0x1a91be['label'],_0x1a91be['icon']);const {listItem:_0x2a095a,highlightViews:_0x738b87}=this['_createSearchResultActionButton'](_0x163e98,_0x503158,_0x1a91be['label'],_0x1a91be['icon']);this['_allSearchableItems']['push']({'item':_0x2a095a,'label':_0x503158['displayedPrompt'],'groupLabel':_0x1a91be['label'],'highlightViews':_0x738b87});});}else{const {listItem:_0x1b753d}=this['_createActionButton'](_0x163e98,_0x1a91be);_0x13f65b['add'](_0x1b753d);const _0x2f3fe2=_0x1b753d['children']['first'];if(_0x2f3fe2){const {listItem:_0x23cdc1,highlightViews:_0x2a8c34}=this['_createSearchResultActionButton'](_0x163e98,_0x1a91be);this['_allSearchableItems']['push']({'item':_0x23cdc1,'label':_0x2f3fe2['label']||'','highlightViews':_0x2a8c34});}}}),_0x13f65b;}['_createActionButton'](_0x16d8f9,_0x9bb69e,_0x387502,_0x16af41){const _0xdc945b=new _0x5f33aa(this['locale']);if(_0x387502&&_0x16af41){const _0x36768e=new _0x42f5cd(this['locale']),_0x59b24c=_0x36768e['bindTemplate'],_0x178740=new _0x1324a5();_0x178740['text']=_0x9bb69e['displayedPrompt'];const _0x573691=new _0x1324a5();_0x573691['text']=_0x387502;const _0x5ab98f=new _0x5d3550();_0x5ab98f['content']=_0x16af41,_0x5ab98f['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x589583=new _0x10e3da(this['locale']);_0x589583['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x153ef4=new _0x10e3da(this['locale']);return _0x153ef4['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x36768e['set']({'label':_0x9bb69e['displayedPrompt']+'\x20('+_0x387502+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x36768e['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':[_0x178740,_0x589583,_0x5ab98f,_0x573691,_0x153ef4],'on':{'mouseenter':_0x59b24c['to'](()=>{this['_isSearchFocused']()||_0x36768e['focus']();}),'click':_0x59b24c['to'](()=>{_0x36768e['fire']('execute');})}}),_0x36768e['on']('execute',()=>{_0x16d8f9['editing']['view']['focus'](),_0x16d8f9['commands']['execute']('aiQuickAction',_0x9bb69e);}),_0xdc945b['children']['add'](_0x36768e),{'listItem':_0xdc945b,'highlightViews':[_0x178740,_0x573691]};}{const _0x13338d=new _0x4afaa0(),_0x4d729c=new _0x42f5cd(this['locale'],_0x13338d),_0x335993=_0x4d729c['bindTemplate'],_0x13631e=_0x9bb69e['icon']??_0x9bb69e['parent']?.['icon'],_0x5b2475=void 0x0!==_0x9bb69e['icon'];return _0x4d729c['set']({'label':_0x9bb69e['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':_0x5b2475?_0x13631e??_0x376ad5:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x4d729c['extendTemplate']({'on':{'mouseenter':_0x335993['to'](()=>{this['_isSearchFocused']()||_0x4d729c['focus']();})}}),_0x4d729c['on']('execute',()=>{_0x16d8f9['editing']['view']['focus'](),_0x16d8f9['commands']['execute']('aiQuickAction',_0x9bb69e);}),_0xdc945b['children']['add'](_0x4d729c),{'listItem':_0xdc945b,'highlightViews':[_0x13338d]};}}['_createSearchResultActionButton'](_0x1a9ffb,_0x210a09,_0x4e6ab5,_0x20b1f6){return _0x4e6ab5&&_0x20b1f6?this['_createSearchResultGroupedActionButton'](_0x1a9ffb,_0x210a09,_0x4e6ab5,_0x20b1f6):this['_createSearchResultIndividualActionButton'](_0x1a9ffb,_0x210a09);}['_createSearchResultGroupedActionButton'](_0x134fdf,_0x398ecb,_0x183cdf,_0x4667e9){const _0x326d77=new _0x5f33aa(this['locale']),_0x55a38a=new _0x42f5cd(this['locale']),_0x39a83f=_0x55a38a['bindTemplate'],{view:_0x8beccc,highlightView:_0x44cd49}=this['_createSearchResultGroupRow'](_0x183cdf,_0x4667e9),{view:_0x2f1b2d,highlightView:_0x2b395e}=this['_createSearchResultActionRow'](_0x398ecb['displayedPrompt']),_0xeac93c=this['_createSearchResultContentView'](_0x8beccc,_0x2f1b2d);return _0x55a38a['set']({'label':_0x398ecb['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}),_0x55a38a['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':[_0xeac93c],'on':{'mouseenter':_0x39a83f['to'](()=>{this['_isSearchFocused']()||_0x55a38a['focus']();}),'click':_0x39a83f['to'](()=>{this['_handleSearchResultButtonClick'](_0x55a38a);})}}),this['_setupActionButtonExecution'](_0x55a38a,_0x134fdf,_0x398ecb),_0x326d77['children']['add'](_0x55a38a),{'listItem':_0x326d77,'highlightViews':[_0x44cd49,_0x2b395e]};}['_createSearchResultIndividualActionButton'](_0x50fedb,_0x42c73a){const _0x22fa0b=new _0x5f33aa(this['locale']),_0x5d8506=new _0x4afaa0(),_0x36a313=new _0x42f5cd(this['locale'],_0x5d8506),_0x51f279=_0x36a313['bindTemplate'];return _0x36a313['set']({'label':_0x42c73a['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x36a313['extendTemplate']({'on':{'mouseenter':_0x51f279['to'](()=>{this['_isSearchFocused']()||_0x36a313['focus']();})}}),this['_setupActionButtonExecution'](_0x36a313,_0x50fedb,_0x42c73a),_0x22fa0b['children']['add'](_0x36a313),{'listItem':_0x22fa0b,'highlightViews':[_0x5d8506]};}['_createSearchResultGroupRow'](_0x4e2183,_0x2d2750){const _0x3531f8=new _0x10e3da(this['locale']),_0x5c8fb6=new _0x5d3550();_0x5c8fb6['content']=_0x2d2750,_0x5c8fb6['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x4f73c1=new _0x1324a5();return _0x4f73c1['text']=_0x4e2183,_0x3531f8['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x5c8fb6,_0x4f73c1]}),{'view':_0x3531f8,'highlightView':_0x4f73c1};}['_createSearchResultActionRow'](_0x112183){const _0x42adde=new _0x10e3da(this['locale']),_0x4f5e8e=new _0x1324a5();return _0x4f5e8e['text']=_0x112183,_0x42adde['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x4f5e8e]}),{'view':_0x42adde,'highlightView':_0x4f5e8e};}['_createSearchResultContentView'](_0x561d12,_0x6d10ff){const _0x327923=new _0x10e3da(this['locale']);return _0x327923['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x561d12,_0x6d10ff]}),_0x327923;}['_setupActionButtonExecution'](_0x56d57c,_0x52b2c0,_0x508d6d){_0x56d57c['on']('execute',()=>{_0x52b2c0['editing']['view']['focus'](),_0x52b2c0['commands']['execute']('aiQuickAction',_0x508d6d);});}['_createActionGroupButton'](_0x208337,_0x30793f,_0x5af128){const _0xd99efa=new _0x5f33aa(this['locale']),_0x18614e=new _0x4afaa0(),_0x2b30d6=new Gs(this['locale'],_0x18614e),_0x59889d=_0x2b30d6['bindTemplate'],_0x38fe56=this['_getPanelKeystroke'](_0x5af128),_0x1dcbd5=this['_createGroupActionsList'](_0x208337,_0x30793f['actions'],_0x5af128);_0x2b30d6['set']({'label':_0x30793f['label'],'withText':!0x0,'role':Ws,'icon':_0x30793f['icon']??_0x376ad5,'isEnabled':_0x30793f['actions']['some'](_0x56fae7=>_0x56fae7['isEnabled'])}),_0x2b30d6['extendTemplate']({'on':{'mouseenter':_0x59889d['to'](()=>{this['_isSearchFocused']()||_0x2b30d6['focus']();})}});const _0x891c60=new _0x54c977(this['locale']);return _0x891c60['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x59889d['to'](_0x33213f=>{this['_handlePanelKeydown'](_0x33213f,_0x38fe56,_0x2b30d6,_0x891c60);})}}),_0x2b30d6['bind']('isOn')['to'](_0x891c60,'isVisible'),this['_bodyCollection']['add'](_0x891c60),_0x891c60['content']['add'](_0x1dcbd5),this['_setupGroupMenuBehavior'](_0x2b30d6,_0x891c60),_0xd99efa['children']['add'](_0x2b30d6),{'listItem':_0xd99efa,'highlightView':_0x18614e};}['_createGroupActionsList'](_0x138f35,_0x217edb,_0x4638c4){const _0x517cfe=new _0x49312a(this['locale']);return _0x517cfe['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x217edb['forEach'](_0x1da4fe=>{const _0x5b42d7=new _0x5f33aa(this['locale']),_0x338715=Zt({'editor':_0x138f35,'action':_0x1da4fe,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x5b42d7['children']['add'](_0x338715),_0x4638c4['focusTracker']['add'](_0x338715),_0x517cfe['items']['add'](_0x5b42d7);}),_0x517cfe;}['_setupGroupMenuBehavior'](_0x55ac81,_0xa33415){const _0x4c8aed=_0x55ac81['bindTemplate'],_0x5ccc69=this['_getButtonKeystroke'](_0x55ac81);_0x55ac81['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x4c8aed['to'](()=>{this['_showNestedPanel'](_0xa33415,_0x55ac81);}),'mouseleave':_0x4c8aed['to'](_0x5496c7=>{const _0x385ba3=_0x5496c7['relatedTarget'];this['_isMovingToNestedMenu'](_0x385ba3,_0xa33415)||this['_hideNestedPanel'](_0xa33415);}),'keydown':_0x4c8aed['to'](_0x115c1f=>{_0x115c1f['key']==_0x5ccc69&&(this['_showNestedPanel'](_0xa33415,_0x55ac81),_0xa33415['content']['get'](0x0)['focus']());})}}),_0xa33415['on']('render',()=>{_0xa33415['element']?.['addEventListener']('mouseleave',_0x1b1007=>{const _0x33f667=_0x1b1007['relatedTarget'];_0x55ac81['element']?.['contains'](_0x33f667)||this['_isMovingToNestedMenu'](_0x33f667,_0xa33415)||this['_hideNestedPanel'](_0xa33415);});});}['_showNestedPanel'](_0x56f373,_0x4b6cef){this['_openNestedPanels']['forEach'](_0xbf298a=>{_0xbf298a!==_0x56f373&&_0xbf298a['isVisible']&&_0xbf298a['hide']();}),_0x56f373['show'](),_0x56f373['pin']({'positions':[_0x3c3478['eastSouth']],'target':_0x4b6cef['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x56f373);}['_hideNestedPanel'](_0x265d7a){_0x265d7a['hide'](),this['_openNestedPanels']['delete'](_0x265d7a);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x3812f9=>_0x3812f9['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x2b59ec,_0x22e0b6){if(!_0x2b59ec)return!0x1;if(_0x22e0b6['element']?.['contains'](_0x2b59ec))return!0x0;const _0x38759f=_0x2b59ec;return _0x38759f['closest']&&(null!==_0x38759f['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x38759f['closest']('.ck-ai-quick-actions-group-list')||null!==_0x38759f['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'](_0xeafc4d){return'rtl'===_0xeafc4d['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x3f8f9b){return'rtl'===_0x3f8f9b['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x5fa610,_0x456963,_0x588708,_0x10276d){_0x5fa610['key']==_0x456963&&(_0x588708['focus'](),this['_hideNestedPanel'](_0x10276d));}['_handleSearchResultButtonClick'](_0x4f4ce4){_0x4f4ce4['fire']('execute');}}function Xt(_0x3acc0a){const {editor:_0x4abebb,content:_0x45d8ed,buttonDefinition:_0xdae311,bodyCollection:_0x11f6e6,hasSearch:_0x5e9883=!0x1}=_0x3acc0a;return()=>{const _0x3b770c=_0x4abebb['locale'],_0x13d1f6=_0x46177f(_0x3b770c);_0x13d1f6['buttonView']['set']({'icon':_0xdae311['icon']??_0x376ad5,'label':_0xdae311['label'],'tooltip':!0x0}),_0x13d1f6['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x32fdae=new co(_0x4abebb,_0x45d8ed,_0x13d1f6,_0x11f6e6,_0x5e9883);if(_0x13d1f6['panelView']['children']['add'](_0x32fdae),_0x5e9883){const _0x24baba='ai-quick-actions-dropdown-selection';_0x13d1f6['on']('change:isOpen',(_0x15f6d7,_0x5bce9c,_0x296512)=>{if(_0x296512){if(_0x4abebb['plugins']['has']('AIEditing')){const _0x45762b=_0x4abebb['plugins']['get'](D),_0x23bdc9=_0x4abebb['model']['document']['selection'],_0x540c9b=Array['from'](_0x23bdc9['getRanges']());_0x540c9b['length']>0x0&&_0x45762b['showFakeVisualSelection'](_0x540c9b,_0x24baba,!0x1,!0x0);}}else _0x4abebb['plugins']['has']('AIEditing')&&_0x4abebb['plugins']['get'](D)['hideFakeVisualSelection'](_0x24baba),_0x32fdae['resetSearch']();});}return _0x13d1f6;};}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(_0x27d811){return _0x27d811['CHAT']='CHAT',_0x27d811['ACTION']='ACTION',_0x27d811['REVIEW']='REVIEW',_0x27d811;}({}),Ga=function(_0x53bfd1){return _0x53bfd1['CHAT']='AIChat',_0x53bfd1['ACTION']='AIActions',_0x53bfd1['REVIEW']='AIReviewMode',_0x53bfd1;}({});class ii extends _0x4d60c6{static get['requires'](){return[te,q];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x4be89d=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x4be89d),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x374cfe){return function(_0x1937e9){const _0x42ad64=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x1937e9['uiLanguage']),_0x185589=_0x42ad64||'English',_0x3d7ece=[{'id':'ask-ai','displayedPrompt':i(_0x1937e9,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Gt},{'id':'chat-commands','label':i(_0x1937e9,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Gt,'actions':[{'id':'explain','displayedPrompt':i(_0x1937e9,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':ee['replace']('%0',_0x185589),'type':'CHAT'},{'id':'summarize','displayedPrompt':i(_0x1937e9,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':ie['replace']('%0',_0x185589),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':i(_0x1937e9,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':ne['replace']('%0',_0x185589),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':i(_0x1937e9,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Bt},{'id':'continue','displayedPrompt':i(_0x1937e9,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Ft},{'id':'fix-grammar','displayedPrompt':i(_0x1937e9,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Wt},{'id':'adjust-length','label':i(_0x1937e9,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Kt,'actions':[{'id':'make-shorter','displayedPrompt':i(_0x1937e9,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':i(_0x1937e9,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':i(_0x1937e9,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Yt,'actions':[{'id':'make-tone-casual','displayedPrompt':i(_0x1937e9,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':i(_0x1937e9,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':i(_0x1937e9,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':i(_0x1937e9,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':i(_0x1937e9,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':i(_0x1937e9,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Vt,'actions':[{'id':'translate-to-english','displayedPrompt':i(_0x1937e9,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':i(_0x1937e9,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':i(_0x1937e9,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':i(_0x1937e9,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':i(_0x1937e9,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':i(_0x1937e9,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':i(_0x1937e9,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':i(_0x1937e9,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':i(_0x1937e9,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':i(_0x1937e9,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':i(_0x1937e9,'AI_QUICK_ACTIONS_OTHER'),'icon':Jt,'actions':[]}];return _0x3d7ece;}(_0x374cfe);}async['_getDefaultAndCustomActions'](){const _0x26ab43=ii['getDefaultQuickActions'](this['editor']['locale']),_0x53259b=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x433d7a=[];try{_0x433d7a=await new It({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0xe97ce5){const _0x1ce4ee=new _0x70c77e('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0xe97ce5});gt(_0x1ce4ee['message']);}finally{const _0x54879a=_0x53259b['map'](_0x2d2d44=>({..._0x2d2d44,'icon':void 0x0}));_0x26ab43['find'](_0xe9d418=>'other'===_0xe9d418['id'])['actions']['push'](..._0x54879a),_0x26ab43['forEach'](_0x17e950=>{if('actions'in _0x17e950)_0x17e950['actions']['forEach'](_0x41f9c8=>{if(_0x41f9c8['isEnabled']=!!_0x433d7a['find'](_0x33e442=>_0x33e442['id']===_0x41f9c8['model'])||void 0x0===_0x41f9c8['model'],!_0x41f9c8['isEnabled']){const _0x459a4a=new _0x70c77e('ai-quick-actions-unavailable-model',this,{'actionId':_0x41f9c8['id'],'modelId':_0x41f9c8['model']});gt(_0x459a4a['message']);}});else{if(_0x17e950['isEnabled']=!!_0x433d7a['find'](_0x20571d=>_0x20571d['id']===_0x17e950['model'])||void 0x0===_0x17e950['model'],!_0x17e950['isEnabled']){const _0x39dc5d=new _0x70c77e('ai-quick-actions-unavailable-model',this,{'actionId':_0x17e950['id'],'modelId':_0x17e950['model']});gt(_0x39dc5d['message']);}}});}return _0x26ab43;}['_initializeQuickActionsComponentsAndCommands'](){const _0x1bb821=new _0x5669fa(this['editor']['locale']);_0x1bb821['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x1bb821),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x1bb821);}['_initializeQuickActionsDropdown'](_0x412971){const _0x5d9d4a=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Xt({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x376ad5,'label':i(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x412971,'hasSearch':_0x5d9d4a}));}['_prepareQuickActionsDefinition'](_0x1ae434){this['_quickActionsDefinition']=_0x1ae434['map'](_0x5b19d0=>{if('actions'in _0x5b19d0){const _0x484cc5=_0x5b19d0;return{..._0x484cc5,'actions':_0x484cc5['actions']['map'](_0x23d373=>{const {actions:_0x52d633,..._0x7d43a7}=_0x484cc5;return{..._0x23d373,'parent':_0x7d43a7};})['filter'](_0x1752e9=>this['_shouldIncludeAction'](_0x1752e9))};}return _0x5b19d0;})['filter'](_0x52e2f3=>'actions'in _0x52e2f3?_0x52e2f3['actions']['length']>0x0:this['_shouldIncludeAction'](_0x52e2f3));}['_shouldIncludeAction'](_0x3a4258){const _0x177f99=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ga[_0x3a4258['type']])&&!_0x177f99['includes'](_0x3a4258['id'])&&!('CHAT'===_0x3a4258['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x4c7211){this['_quickActionsDefinition']['forEach'](_0x469b0b=>{if('actions'in _0x469b0b){const _0x2dceb8=Xt({'editor':this['editor'],'content':_0x469b0b['actions'],'buttonDefinition':_0x469b0b,'bodyCollection':_0x4c7211});this['editor']['ui']['componentFactory']['add'](_0x469b0b['id'],_0x2dceb8),_0x469b0b['actions']['forEach'](_0x138f1e=>{const _0x1d7d60=Zt({'editor':this['editor'],'action':_0x138f1e});this['editor']['ui']['componentFactory']['add'](_0x138f1e['id'],_0x1d7d60);});}else{const _0x389f25=Zt({'editor':this['editor'],'action':_0x469b0b,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x469b0b['id'],_0x389f25);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x5b19f6=>{const _0x4b2f76=new _0x42db8e(_0x5b19f6),_0x20049b=i(_0x5b19f6,'AI_QUICK_ACTIONS_HEADING');_0x4b2f76['buttonView']['set']({'label':_0x20049b,'icon':_0x376ad5});const _0x3d0878=new _0x43c130(_0x5b19f6);_0x3d0878['set']({'ariaLabel':_0x20049b,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x524fb1=>{if('actions'in _0x524fb1){const _0x16cefc=_0x524fb1,_0x1c3b27=new _0x47412e(_0x5b19f6,_0x4b2f76),_0x3546da=new _0x42db8e(_0x5b19f6),_0x1e4559=new _0x43c130(_0x5b19f6);_0x3546da['buttonView']['set']({'label':_0x16cefc['label'],'icon':_0x16cefc['icon']}),_0x16cefc['actions']['forEach'](_0x5e3fef=>{const _0x248a18=new _0x47412e(_0x5b19f6,_0x3546da),_0x158e89=new _0xa34e7b(_0x5b19f6);_0x158e89['set']({'label':_0x5e3fef['displayedPrompt'],'icon':_0x5e3fef['icon'],'role':'menuitem','isEnabled':_0x5e3fef['isEnabled']}),_0x158e89['on']('execute',()=>{this['_executeQuickAction'](_0x5e3fef);}),_0x158e89['delegate']('execute')['to'](_0x3546da),_0x248a18['children']['add'](_0x158e89),_0x1e4559['items']['add'](_0x248a18);}),_0x3546da['panelView']['children']['add'](_0x1e4559),_0x1c3b27['children']['add'](_0x3546da),_0x3d0878['items']['add'](_0x1c3b27);}else{const _0x2e0e27=_0x524fb1,_0x39f4bd=new _0x47412e(_0x5b19f6,_0x4b2f76),_0x2ab831=new _0xa34e7b(_0x5b19f6);_0x2ab831['set']({'label':_0x2e0e27['displayedPrompt'],'icon':_0x2e0e27['icon'],'role':'menuitem','isEnabled':_0x2e0e27['isEnabled']}),_0x2ab831['on']('execute',()=>{this['_executeQuickAction'](_0x2e0e27);}),_0x2ab831['delegate']('execute')['to'](_0x4b2f76),_0x39f4bd['children']['add'](_0x2ab831),_0x3d0878['items']['add'](_0x39f4bd);}});const _0x5c733c=Object['values'](Ga)['some'](_0x311fa7=>this['editor']['plugins']['has'](_0x311fa7));return _0x4b2f76['set']({'isEnabled':_0x5c733c}),_0x4b2f76['panelView']['children']['add'](_0x3d0878),_0x4b2f76;});}['_executeQuickAction'](_0x50f78a){const _0x347a1f=this['editor'];_0x347a1f['editing']['view']['focus'](),_0x347a1f['commands']['execute']('aiQuickAction',_0x50f78a);const _0x3bd112=_0x347a1f['ui']['view']['menuBarView'];_0x3bd112&&_0x3bd112['close']&&_0x3bd112['close']();}}class ci extends Lt{['execute'](_0x36cced){switch(this['_expandSelectionIfCollapsed'](),_0x36cced['type']){case Qt['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x538c3c=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x70c77e('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x538c3c});}this['_handleAIChatAction'](_0x36cced);break;case Qt['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x445e89=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x70c77e('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x445e89});}this['_handleAIActionsAction'](_0x36cced);break;case Qt['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x39e523=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x70c77e('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x39e523});}this['_handleAIReviewAction'](_0x36cced);}}async['_handleAIChatAction'](_0x4d5821){const _0x5ea28f=this['editor']['plugins']['get']('AIChat'),_0x44531b=this['editor']['plugins']['get']('AIChatController'),_0x4b7001=this['editor']['plugins']['get']('AITabs')['view'];if(_0x4b7001['isVisible']||(_0x4b7001['isVisible']=!0x0),'chat'!==_0x4b7001['activeTab']&&_0x4b7001['activateTab']('chat'),'ask-ai'===_0x4d5821['id'])_0x44531b['removeSelectionFromChatContext'](),await _0x5ea28f['addSelectionToChatContext'](),_0x5ea28f['focusPromptInput']();else await _0x5ea28f['startConversation'](),_0x44531b['removeSelectionFromChatContext'](),await _0x5ea28f['addSelectionToChatContext'](),_0x5ea28f['focusPromptInput'](),await _0x5ea28f['sendMessage']({'message':_0x4d5821['prompt']||_0x4d5821['displayedPrompt'],'attributes':{'quickActionData':{'id':_0x4d5821['id']},'displayedPrompt':_0x4d5821['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x3c9b5b=this['editor'],_0x42d230=_0x3c9b5b['model']['document']['selection'];if(!_0x42d230['isCollapsed'])return;const _0xfba15a=_0x147222(_0x42d230['getSelectedBlocks']())||_0x3c9b5b['model']['schema']['getLimitElement'](_0x42d230);_0x3c9b5b['model']['change'](_0x52f609=>{_0x52f609['setSelection'](_0xfba15a,'in');});}['_handleAIActionsActionLabel'](_0x36c2a3){return _0x36c2a3['parent']?.['label']&&'other'!==_0x36c2a3['parent']?.['id']?_0x36c2a3['parent']['label']+':\x20'+_0x36c2a3['displayedPrompt']:_0x36c2a3['displayedPrompt'];}async['_handleAIActionsAction'](_0x27cc02){const _0x302f24=this['editor']['plugins']['get']('AIActions'),_0x39dab4=_0x27cc02['prompt']?{'userMessage':_0x27cc02['prompt'],'model':_0x27cc02['model']}:{'actionName':_0x27cc02['actionName']||_0x27cc02['id'],'args':_0x27cc02['args']},_0x360d48=this['_handleAIActionsActionLabel'](_0x27cc02);await _0x302f24['executeAction'](_0x39dab4,_0x360d48,_0x27cc02['icon']);}async['_handleAIReviewAction'](_0x5ef95f){console['log']('handleAIReviewAction',_0x5ef95f);}}class ti extends _0x4d60c6{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x101a0f=this['editor'],_0x10e7ba=new ci(this['editor']);if(_0x101a0f['commands']['add']('aiQuickAction',_0x10e7ba),_0x101a0f['plugins']['has']('AIChat')){const _0x2f2495=this['editor']['plugins']['get']('AIChat');_0x101a0f['model']['document']['selection']['on']('change:range',(_0x5d2554,_0x294362)=>{_0x294362['directChange']&&_0x2f2495['removeSelectionFromChatContext']();});}}}class Ge extends He{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x4acc27=this['documentContextContent']['children']['map'](_0x3a8ba6=>({'node':_0x3a8ba6,'id':At(_0x3a8ba6,'data-id')})),_0x23283e=this['parsedMergedContent']['children']['map'](_0x5afde5=>({'node':_0x5afde5,'id':At(_0x5afde5,'data-id')||_0x4689d1()})),_0x260c1e=_0x27d3f3(_0x4acc27,_0x23283e,{'comparator':(_0x4c133b,_0x46a73b)=>_0x4c133b['id']==_0x46a73b['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x260c1e['length']&&_0x260c1e[_0x260c1e['length']-0x1]['removed'];)_0x260c1e['pop']();}const _0x3f3ba5=_0x260c1e['map'](_0x3cd35f=>{const _0x5865d0=_0x3cd35f['added']?'new':_0x3cd35f['removed']?'removed':'modified';return{'node':_0x3cd35f['value'][0x0]['node'],'type':_0x5865d0,'id':_0x3cd35f['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x3f3ba5,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x4f79fd,_0x454161){return _0x454161;}}class W extends Fe{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x483fd6){super(_0x483fd6),this['content']=_0x483fd6['content'],this['version']=_0x483fd6['version'],this['actionName']=_0x483fd6['actionName'],this['args']=_0x483fd6['args'],this['userMessage']=_0x483fd6['userMessage'],this['model']=_0x483fd6['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'](_0x1004bc){const _0x47a7ae=new Ge({'editor':this['editor'],'documentContextContent':this['content'],..._0x1004bc});return this['replies']['push'](_0x47a7ae),_0x47a7ae['delegate'](...ze)['to'](this),this['fire']('replyCreated',_0x47a7ae),_0x47a7ae;}}class Bn extends _0x243ac0{constructor(_0x43a7cc,_0x2bddc4=!0x0,_0x1a5bda=!0x0){super(_0x43a7cc),this['set']('isEnabled',!0x1),_0x2bddc4&&(this['applyButton']=this['_createButton'](i(_0x43a7cc,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x1a5bda&&(this['suggestButton']=this['_createButton'](i(_0x43a7cc,'AI_BALLOON_SUGGEST_BUTTON'),_0x2bddc4?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x2bddc4,'showSuggestButton':_0x1a5bda}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x55d41f,showSuggestButton:_0x238bd2}){this['applyButton']&&(this['applyButton']['isVisible']=_0x55d41f),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x238bd2);}['_createButton'](_0x548f61,_0x309264){const _0x1a7e9d=new _0x42f5cd(this['locale']);return _0x1a7e9d['set']({'label':_0x548f61,'class':_0x309264,'isVisible':!0x0,'withText':!0x0}),_0x1a7e9d;}}class yn extends _0x10e3da{constructor(_0x29e6d5){super(_0x29e6d5),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(_0x29e6d5,'AI_DISCLAIMER_TEXT')}]}]});}}class Nn extends _0x10e3da{constructor(_0x56e343){super(_0x56e343),this['set']('isVisible',!0x0);const _0x18ccad=new pi('small');_0x18ccad['isVisible']=!0x0;const _0x1fe666=new _0x10e3da(this['locale']);_0x1fe666['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',_0x5e1a7f=>!_0x5e1a7f)]},'children':[_0x18ccad,_0x1fe666]});}}class rt extends ls{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x402e7c,_0x75b46a){super(_0x402e7c),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x75b46a,this['_focusTracker']=new _0x3295cb(),this['_keystrokes']=new _0x4259de(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0xb86ebf({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x229fa2(),this['_addContentWrapper'](_0x75b46a),this['_addDisclaimerView'](),this['_addToolbar'](_0x75b46a),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'](_0x75b46a);});}['render'](){super['render']();for(const _0x4c0f66 of this['_focusables'])this['_focusTracker']['add'](_0x4c0f66['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0xcab385){-0x1===_0xcab385?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x1dbff0){this['_isLoading']=_0x1dbff0;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x486a0d){super['showError'](_0x486a0d),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x578fe8){super['showBlockingError'](_0x578fe8),this['setErrorState']();}['addMiniToolbarItem'](_0x2a13ec){this['_miniToolbarView']['items']['has'](_0x2a13ec)||this['_miniToolbarView']['items']['add'](_0x2a13ec);}['removeMiniToolbarItem'](_0x20fa69){this['_miniToolbarView']['items']['has'](_0x20fa69)&&this['_miniToolbarView']['items']['remove'](_0x20fa69);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x592551,showSuggestButton:_0x229681}){_0x592551=_0x592551&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x229681=_0x229681&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x592551,'showSuggestButton':_0x229681});}async['updateContent'](_0x2a0b04){await this['_streamableContentView']['update'](_0x2a0b04);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x19b8c2){this['_contentWrapper']=new _0x10e3da(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'](_0x19b8c2['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new yn(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x248ae0,showSuggestButton:_0x44f87f}){this['_toolbarView']=new Bn(this['locale'],_0x248ae0,_0x44f87f),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',(_0x4b0c5d,_0x46058e,_0x4ae673)=>!(_0x4b0c5d||_0x46058e||_0x4ae673)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x248ae0,'showSuggestButton':_0x44f87f}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x25a57f){return this['_miniToolbarView']=new us(this['locale'],_0x25a57f),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',(_0x4a0974,_0x1460be)=>!(_0x4a0974||_0x1460be)),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 _0x35ac04=new _0x42f5cd(this['locale']),_0x9dcc1e=new _0x42f5cd(this['locale']),_0x49ae82=new Ln(this['locale']),_0x14e971=new _0x42f5cd(this['locale']);_0x35ac04['set']({'icon':_0x7940fe,'label':i(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x9dcc1e['set']({'icon':_0x2a9d1b,'tooltip':i(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x14e971['set']({'icon':_0x453dbb,'tooltip':i(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x35ac04['bind']('isEnabled')['to'](this,'isBusy',_0x403b6a=>!_0x403b6a),_0x35ac04['on']('execute',()=>{this['fire']('tryAgain');}),_0x9dcc1e['bind']('isEnabled')['to'](this,'isBusy',_0x4fe082=>!_0x4fe082),_0x9dcc1e['on']('execute',()=>{this['fire']('showPrevious');}),_0x14e971['bind']('isEnabled')['to'](this,'isBusy',_0x59389e=>!_0x59389e),_0x14e971['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x9dcc1e,this['_navigationCounter']=_0x49ae82,this['_navigationNextButton']=_0x14e971,this['_navigationTryAgainButton']=_0x35ac04;}['updateMiniToolbarButtons'](_0x2a50ee,_0x2ea9f3){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x41b0c1=_0x2a50ee>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x41b0c1){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x2e2006=_0x2a50ee-_0x2ea9f3;this['_navigationCounter']['setInteractionCount'](_0x2e2006+'/'+_0x2a50ee),this['_navigationPreviousButton']['isEnabled']=_0x2ea9f3<_0x2a50ee-0x1,this['_navigationNextButton']['isEnabled']=_0x2ea9f3>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'](_0xd72ec4){this['_isLoading']=_0xd72ec4;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x2d40dd=this['_getScrollableElement']();_0x2d40dd&&!this['_scrollManager']&&(this['_scrollManager']=new gi(_0x2d40dd));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class Ln extends _0x10e3da{constructor(_0x2cf065){super(_0x2cf065);const _0x196c9d=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x196c9d['to']('interactionCount')}]});}['setInteractionCount'](_0x416f91){this['set']('interactionCount',_0x416f91);}}class ri extends _0x4d60c6{static get['requires'](){return[q,_0x2e97ba,D,Q,_0x587691];}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(_0x381054){super(_0x381054),this['_bodyCollection']=new _0x5669fa(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'](_0x44c346,_0x5e3867,_0x38790a){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x59460e,anchorData:_0x5dd25a}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x44c346,_0x59460e,_0x5dd25a,_0x5e3867,_0x38790a);}}const {modelFragment:_0x15b958,anchorData:_0x11cb10}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x44c346,_0x15b958,_0x11cb10,_0x5e3867,_0x38790a);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x51c94f=this['editor']['plugins']['has']('TrackChanges');let _0x12bae3=this['editor']['config']['get']('ai.availableReplyActions')||[...ot];_0x51c94f||(_0x12bae3=_0x12bae3['filter'](_0x1e2539=>'insertSuggestion'!=_0x1e2539));const _0x44cd67=this['editor']['commands']['get']('trackChanges'),_0x4aa2bb=new rt(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x51c94f,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x12bae3});return _0x4aa2bb['bind']('isBusy')['to'](this),_0x44cd67&&_0x4aa2bb['bind']('isTrackChangesOn')['to'](_0x44cd67,'value'),_0x4aa2bb['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x4aa2bb['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x4aa2bb['on']('showNext',()=>{this['_navigateToNext']();}),_0x4aa2bb;}['_getExecuteDataRegular'](){const _0x4fb4e2=this['editor']['model']['document']['selection'];if(_0x4fb4e2['isCollapsed']){const _0x2ff254=_0x147222(_0x4fb4e2['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x4fb4e2);this['editor']['model']['change'](_0x43fa2c=>{_0x43fa2c['setSelection'](_0x2ff254,'in');});}const _0x10c527=_0x4fb4e2['getFirstRange'](),_0xcb81f5=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x4fb4e2),_0x10c527['start'],_0x10c527['end']);this['_copyMarkersToFragment'](_0xcb81f5,_0x4fb4e2,{'isTableSelection':!0x1});const _0x45a0a2=_0x4fb4e2['getFirstRange']()['start'],_0x5b6f73=new Map();let _0x549e0c=_0xcb81f5;for(let _0x3ce971=0x0;_0x3ce971<_0x45a0a2['path']['length'];_0x3ce971++)_0x5b6f73['set'](_0x549e0c,_0x45a0a2['path'][_0x3ce971]),_0x549e0c=_0x549e0c['getChild'](0x0);return{'modelFragment':_0xcb81f5,'anchorData':_0x5b6f73};}['_getExecuteDataInTable'](){const _0x3c6da9=this['editor']['model']['document']['selection'],_0x29de64=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0xcc6498=_0x3c6da9['getFirstRange']()['start']['parent']['parent'],_0x41271e=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0xcc6498),this['editor']['model']['createPositionAfter'](_0xcc6498)),_0x441087=this['_wrapWithCommonAncestors'](_0x29de64,_0x41271e['start'],_0x41271e['end']);this['_copyMarkersToFragment'](_0x441087,_0x3c6da9,{'isTableSelection':!0x0});const _0x464cbd=_0x3c6da9['getFirstRange']()['start'],_0x3499c4=new Map();let _0x43083b=_0x441087;for(let _0x44912a=0x0;_0x44912a<_0x464cbd['path']['length'];_0x44912a++)if(_0x3499c4['set'](_0x43083b,_0x464cbd['path'][_0x44912a]),_0x44912a<_0x464cbd['path']['length']-0x1)_0x43083b=_0x43083b['getChild'](0x0);else{let _0x24ab7d=_0x43083b['nextSibling'];for(;_0x24ab7d;)_0x3499c4['set'](_0x24ab7d,_0x464cbd['path'][_0x44912a]),_0x24ab7d=_0x24ab7d['nextSibling'];}return{'modelFragment':_0x441087,'anchorData':_0x3499c4};}async['_executeAction'](_0x20f375,_0x3aef74,_0x4d7154,_0x133e38,_0x44f511){const _0xf050cf=this['editor']['plugins']['get'](D),_0x4c6ee8=this['editor']['plugins']['get'](Q),_0x54e0ae=this['editor']['model']['document']['selection'],_0x568ad5=await _0xf050cf['modelToDataWithIds'](_0x3aef74),_0xc5c4da=this['editor']['model']['document']['version'],_0x5cf951=[..._0x54e0ae['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),_0x4c6ee8['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x133e38,'icon':_0x44f511||_0x376ad5,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x5cf951,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x4c6ee8),this['_interactionParams']={'action':_0x20f375,'content':_0x568ad5,'version':_0xc5c4da,'aiBalloon':_0x4c6ee8,'modelFragment':_0x3aef74,'anchorData':_0x4d7154},this['_setupApplyListeners'](),this['listenTo'](_0x4c6ee8,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x4c6ee8,'dialogClosed',(_0x52f33c,{id:_0x519233})=>{if('aiActionsBalloon'===_0x519233){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x4d9cdd=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x864be4=_0x4d9cdd['changeGroups'][0x0];_0x864be4&&'pending'===_0x864be4['state']&&_0x4d9cdd['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x4c6ee8);}}),this['_createInteraction'](_0x568ad5,_0xc5c4da,_0x4c6ee8,_0x20f375);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x16f540,anchorData:_0x2cb4d0}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x16f540,_0x2cb4d0,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x16f540,_0x2cb4d0,!0x0);});}['_wrapWithCommonAncestors'](_0x5c818f,_0x57e4ec,_0x10a13e){const _0x1cb8fb=this['editor']['model']['createRange'](_0x57e4ec,_0x10a13e)['getCommonAncestor'](),_0x1adb58=_0x1cb8fb['is']('documentFragment')?[]:_0x1cb8fb['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x1adb58['length']){const _0xeb303c=_0x1adb58['map'](_0x2667b8=>_0x2667b8['_clone'](!0x1));for(let _0x5ecb75=0x1;_0x5ecb75<_0xeb303c['length'];_0x5ecb75++)_0xeb303c[_0x5ecb75-0x1]['_appendChild'](_0xeb303c[_0x5ecb75]);return _0xeb303c[_0xeb303c['length']-0x1]['_appendChild'](_0x5c818f),new tt(_0xeb303c[0x0]);}return _0x5c818f;}['_copyMarkersToFragment'](_0x511e7c,_0x372b5d,_0x46135a={'isTableSelection':!0x1}){const _0x2d43a4=this['editor']['model'],_0xd6d910=Array['from'](_0x372b5d['getRanges']()),_0x37bc02=_0x372b5d['getFirstRange']()['start'];for(const _0x2189ae of _0x2d43a4['markers']){if(_0x2189ae['name']['startsWith'](R)||!_0x2189ae['affectsData'])continue;const _0x1fec84=_0x2189ae['getRange']();if(!_0xd6d910['some'](_0x3a77d5=>_0x3a77d5['containsRange'](_0x1fec84,!0x0)))continue;const _0x4ac59f=this['_regularCalculateMarkerPath'](_0x1fec84['start'],_0x37bc02,_0x46135a['isTableSelection']),_0x30cef2=this['_regularCalculateMarkerPath'](_0x1fec84['end'],_0x37bc02,_0x46135a['isTableSelection']),_0x53afc9=_0x2d43a4['createPositionFromPath'](_0x511e7c,_0x4ac59f),_0x34700d=_0x2d43a4['createPositionFromPath'](_0x511e7c,_0x30cef2);if(!_0x53afc9['isEqual'](_0x34700d)){const _0x32254f=_0x2d43a4['createRange'](_0x53afc9,_0x34700d);_0x511e7c['markers']['set'](_0x2189ae['name'],_0x32254f);}}}['_regularCalculateMarkerPath'](_0xa4af7b,_0x44fc4f,_0x115279=!0x1){const _0x16f676=[..._0xa4af7b['path']['slice']()];for(let _0x181e85=0x0;_0x181e85<Math['max'](_0x44fc4f['path']['length'],_0xa4af7b['path']['length']);_0x181e85++){const _0xf401b=_0x44fc4f['path'][_0x181e85]||0x0,_0x40d688=(_0xa4af7b['path'][_0x181e85]||0x0)-_0xf401b;if(_0x16f676[_0x181e85]=_0x40d688,0x0!==_0x40d688&&!_0x115279)break;}return _0x16f676;}async['_createInteraction'](_0x141c50,_0x57a790,_0x3937cc,_0x27ef70){const _0x5e979c=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x27ef70,'content':_0x141c50,'version':_0x57a790,'aiBalloon':_0x3937cc,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x342caa=new W({'connector':this['_aiConnector'],'editor':_0x5e979c,'content':_0x141c50,'version':_0x57a790,..._0x27ef70});this['_interactions']['push'](_0x342caa);const _0xe331cd=(_0x2716a3,_0x13c5ac=!0x1,_0x1624d5='streaming')=>this['_promiseQueue']['enqueue'](async _0x48a409=>{try{const _0x437a2d=J({'editor':_0x5e979c,'changeGroups':_0x2716a3['changeGroups'],'documentContextContent':_0x2716a3['documentContextContent'],'showDiff':_0x13c5ac,'trimUnchanged':!0x1});_0x437a2d['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x437a2d[0x0],'renderingStrategy':_0x1624d5,'abortSignal':_0x48a409});}catch(_0x5d8d70){if(this['_isAbortError'](_0x5d8d70))return;throw _0x5d8d70;}});this['_interaction']['on']('replyCreated',(_0x1d8b3f,_0xffbb60)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0xe331cd(_0xffbb60)['catch'](_0xc9d9e6=>{this['_isAbortError'](_0xc9d9e6)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0xc9d9e6),this['_setErrorState'](_0x342caa));});}),this['_interaction']['on']('replyContentUpdated',(_0x5e5018,_0x3aa1c6)=>{_0xe331cd(_0x3aa1c6)['catch'](_0x773ead=>{this['_isAbortError'](_0x773ead)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x773ead),this['_setErrorState'](_0x342caa));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x214e64){this['_isAbortError'](_0x214e64)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x214e64),this['_setErrorState'](_0x342caa));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x1a3e3c,{showDiff:_0x138c17})=>{try{this['_balloonShowDiff']=_0x138c17;const _0x36f2cd=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x36f2cd&&await _0xe331cd(_0x36f2cd,_0x138c17,'static');}catch(_0x3b7b8f){this['_isAbortError'](_0x3b7b8f)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x3b7b8f),this['_setErrorState'](_0x342caa));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x47c818,{reply:_0x1ddfc9})=>{const _0x81ba9f={'positiveCount':_0x1ddfc9['changeGroups']['filter'](_0x154903=>'accepted'===_0x154903['state'])['length'],'totalCount':_0x1ddfc9['changeGroups']['length']},_0x3e6271=this['_interaction']['actionCallId'],_0x2a3474=this['_interaction']['actionName'];_0x2a3474?this['_aiConnector']['upsertAIActionRating'](_0x2a3474,_0x3e6271,_0x81ba9f):this['_aiConnector']['upsertCustomAIActionRating'](_0x3e6271,_0x81ba9f);}),this['_setLoadingState']();try{const _0x115669=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x115669;}catch(_0x1a773d){if(this['_isAbortError'](_0x1a773d))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x342caa);}}['_applyChanges'](_0x4907a2,_0x4434c4,_0x5473b3){const _0x285d72=this['editor'];if(_0x5473b3&&!_0x285d72['plugins']['has']('TrackChanges'))throw new _0x70c77e('ai-no-track-changes',null);const _0x35bc5d=this['editor']['plugins']['get'](_0x587691),_0x321907=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x321907||!_0x321907['replies']['length'])return;const _0x545afc=_0x321907['replies'][_0x321907['replies']['length']-0x1],_0x1eccc5=_0x545afc['changeGroups'];_0x545afc['setChangeGroupState'](0x0,'accepted');let _0x1e78d5=Z({'editor':_0x285d72,'reply':_0x545afc,'interaction':_0x321907,'groups':_0x1eccc5,'transform':!0x1,'documentCompare':_0x35bc5d,'documentCompareOptions':{'anchor':_0x285d72['model']['createPositionAt'](_0x4907a2,0x0),'markDeletions':_0x5473b3}});_0x1e78d5=this['_filterOperationsOutsideRange'](_0x1e78d5,_0x4434c4);for(const _0x21d343 of _0x1e78d5)this['_anchorOperation'](_0x4434c4,_0x21d343,_0x285d72['model']['document']['getRoot']());const _0x44d88e=_0x321907['getDocumentContext']()['version'],_0x561dda=_0x285d72['model']['document']['history']['getOperations'](_0x44d88e),_0x4bc428={'document':_0x285d72['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x521b30=nt(_0x1e78d5,_0x561dda,_0x4bc428)['operationsA'];_0x285d72['model']['change'](_0x2fe22b=>{if(_0x2fe22b['setSelection'](_0x285d72['model']['document']['selection']['focus']),_0x5473b3)_0x285d72['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x521b30);else{for(const _0x2dbc49 of _0x521b30)_0x2dbc49['baseVersion']=_0x285d72['model']['document']['version'],Y(_0x285d72,_0x2dbc49),_0x2fe22b['batch']['addOperation'](_0x2dbc49),_0x285d72['model']['applyOperation'](_0x2dbc49);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x162542,_0x512bff){return _0x162542['filter'](_0x8b56ec=>{if('rename'==_0x8b56ec['type']){const _0x12b56e=_0x8b56ec['position']['nodeAfter'];return!_0x512bff['has'](_0x12b56e);}if(_0x8b56ec['type']['indexOf']('Attribute')>-0x1){const _0x126576=_0x8b56ec['range']['start']['nodeAfter'];return!_0x512bff['has'](_0x126576);}return!0x0;});}['_anchorOperation'](_0x4bae59,_0x7c52a6,_0xcd146c){const _0x12a197=_0x7c52a6['clone']();for(const _0x146143 in _0x7c52a6){const _0x31df20=_0x7c52a6[_0x146143];_0x31df20 instanceof it?_0x7c52a6[_0x146143]=new it(_0x47718b(_0x31df20['start']),_0x47718b(_0x31df20['end'])):_0x31df20 instanceof st&&(_0x7c52a6[_0x146143]=_0x47718b(_0x31df20));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x12a197['type'])){if(_0x12a197['isDocumentOperation']=!0x1,_0x12a197['baseVersion']=null,'remove'==_0x12a197['type']){const _0x9c73c3=_0x12a197['sourcePosition'],_0x5e884e=_0x12a197['howMany'];new et(_0x9c73c3,_0x5e884e)['_execute']();}else _0x12a197['_execute']();}function _0x47718b(_0x5293f9){if('$graveyard'==_0x5293f9['root']['rootName'])return _0x5293f9;const _0xe9ee12=[];let _0x2c417f=_0x5293f9['root'];for(let _0xb11483=0x0;_0xb11483<_0x5293f9['path']['length'];_0xb11483++){const _0x515ced=_0x4bae59['get'](_0x2c417f)||0x0;_0xe9ee12[_0xb11483]=_0x5293f9['path'][_0xb11483]+_0x515ced,_0x2c417f=_0x2c417f['getChildAtOffset'](_0x5293f9['path'][_0xb11483]);}return new st(_0xcd146c,_0xe9ee12,_0x5293f9['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x268e89,content:_0xc2172,version:_0x460357,aiBalloon:_0x48a147}=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'](_0xc2172,_0x460357,_0x48a147,_0x268e89)['catch'](_0x4d70f8=>{this['_isAbortError'](_0x4d70f8)||console['error']('Error\x20refreshing\x20interaction:',_0x4d70f8);});}['_isAbortError'](_0xd01f49){return!!_0xd01f49['message']&&_0xd01f49['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 _0x3d3416=this['_interactions']['length'];this['_currentInteractionIndex']<_0x3d3416-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x499dac){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x499dac;const _0x4dd608=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x4dd608)return;if(_0x4dd608['hasError'])return this['_setErrorState'](_0x4dd608),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x4dd608['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x6564fb=_0x4dd608['replies'][_0x4dd608['replies']['length']-0x1];if(_0x6564fb){const _0x20ddee=this['editor'];try{const _0x1dc74c=J({'editor':_0x20ddee,'changeGroups':_0x6564fb['changeGroups'],'documentContextContent':_0x6564fb['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x3abf69=>setTimeout(_0x3abf69,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x1dc74c[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x2a3bb0){this['_isAbortError'](_0x2a3bb0)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x2a3bb0);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x1ecf65){const _0x36bbba=i(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x36bbba),_0x1ecf65['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 _0x4d60c6{static get['requires'](){return[ii,ti,ri];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1ee781){super(_0x1ee781),_0x1ee781['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class gr extends _0x10e3da{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x3591a9,_0x3911ed){super(_0x3591a9),this['id']=_0x3911ed,this['set']('status','pending'),this['set']('changeId',_0x3911ed),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',(_0x325c02,_0x47646c)=>{_0x47646c&&_0x47646c['target']&&'A'===_0x47646c['target']['tagName']&&_0x47646c['preventDefault'](),this['fire']('activateChange',{'id':_0x3911ed,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x3911ed,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x3911ed,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x30c0f=new _0x10e3da(this['locale']);return _0x30c0f['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',_0xb6c8bc=>!_0xb6c8bc)]}}),_0x30c0f;}['_createAcceptButtonView'](){const _0x532485=new _0x42f5cd(this['locale']);return _0x532485['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x532485['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x559be7=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x559be7['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0xd2e01c=>'pending'!==_0xd2e01c&&'accepted'!==_0xd2e01c),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-accept-button',_0x4b5bd8=>'pending'===_0x4b5bd8),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x47a885=>'accepted'===_0x47a885)]}}),this['on']('change:status',(_0x4e9449,_0x2a7f7a,_0x3ef27a)=>{_0x532485['isEnabled']='pending'===_0x3ef27a,'accepted'===_0x3ef27a&&(_0x532485['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x532485['icon']=_0x4bc037);}),_0x532485;}['_createDismissButtonView'](){const _0x175450=new _0x42f5cd(this['locale']);return _0x175450['set']({'label':i(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x175450['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x115587=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x115587['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary',this['bindTemplate']['if']('status','ck-hidden',_0x3e4562=>'pending'!==_0x3e4562&&'rejected'!==_0x3e4562),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x5ce903=>'pending'===_0x5ce903),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x3caaac=>'rejected'===_0x3caaac)]}}),this['on']('change:status',(_0x2c9f33,_0x4da014,_0x15e584)=>{_0x175450['isEnabled']='pending'===_0x15e584,'rejected'===_0x15e584&&(_0x175450['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x175450['icon']=_0x42f179);}),_0x175450;}['_createInfoButtonView'](){const _0x2b82b9=new _0x42f5cd(this['locale']);return _0x2b82b9['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'}),_0x2b82b9['bind']('isOn')['to'](this,'isInfoToggleOn',_0x3946c7=>_0x3946c7),_0x2b82b9['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x2b82b9;}['_createOutdatedButtonView'](){const _0x55a87c=new _0x42f5cd(this['locale']);return _0x55a87c['set']({'label':i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':_0x1fabb6,'withText':!0x0,'isEnabled':!0x1}),_0x55a87c['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x3ce67e=>'outdated'!==_0x3ce67e)],'disabled':'disabled'}}),_0x55a87c;}}class me extends _0x54c977{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x384546,_0x8cb25e){super(_0x384546),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']()),_0x8cb25e['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x1cc9b2){this['resultItemView']['changeId']=_0x1cc9b2['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x1cc9b2['contentDiffed'];}['showBalloon'](_0x4e721b,_0x4e5360,_0x2a409f,_0xff9064,_0x3e0c3c,_0x48fbaf){const _0x57ed57=_0x4e5360();if(!_0x57ed57)return;this['updateContent'](_0x4e721b),this['show']();const _0xfcfa46=Array['from'](_0x57ed57['getClientRects']())['reverse'](),_0x1782e8=this['_getPointedRectIndexFromEvent'](_0x2a409f,_0xfcfa46),_0x5eeed6=_0xfcfa46[_0x1782e8??0x0];'click'===_0xff9064?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x4e5360(),_0x1782e8,_0x4e721b['id'],_0x3e0c3c,_0x48fbaf)||_0x5eeed6})):'hover'===_0xff9064&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x4e5360(),_0x1782e8,_0x4e721b['id'])||_0x5eeed6}));}['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'](){_0x4fafed({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x4f58ab=[this['element']];return this['_pinnedTargetElement']&&_0x4f58ab['push'](this['_pinnedTargetElement']),_0x4f58ab;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x59b93f=new _0x10e3da();return this['resultItemView']=new gr(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x59b93f['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']]}]}),_0x59b93f;}['_getBestRectPositionOnClick'](_0x1054a1,_0x3e641d,_0x2c42d2,_0xa7dbb7,_0x10e36e){if(!_0x1054a1)return null;const _0x363521=this['position']['replace']('arrow_',''),_0x39f445=Array['from'](_0x1054a1['getClientRects']());let _0x5056a9,_0x4c8597=_0x39f445['reverse']();return void 0x0!==_0x3e641d&&this['_isPinnedRectVisible'](_0x4c8597[_0x3e641d],_0xa7dbb7,_0x10e36e)?(_0x5056a9=_0x4c8597[_0x3e641d],this['_pinnedRectIndex']=_0x3e641d):this['_isPinnedRectVisible'](_0x4c8597[0x0],_0xa7dbb7,_0x10e36e)&&void 0x0===_0x3e641d?_0x5056a9=_0x4c8597[0x0]:(_0x4c8597='s'==_0x363521[0x0]?[..._0x39f445]['reverse']():_0x39f445,_0x4c8597['forEach'](_0x5f0651=>{this['_isPinnedRectVisible'](_0x5f0651,_0xa7dbb7,_0x10e36e)&&(_0x5056a9=_0x5f0651);})),this['_pinnedTargetChangeId']=_0x2c42d2,this['_pinnedTargetElement']=_0x1054a1,_0x5056a9||_0x1054a1['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x3bce5f,_0x3bcb4f,_0x323c9b){if(!_0x3bce5f)return null;const _0xcd43a6=Array['from'](_0x3bce5f['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x3bcb4f&&this['_pinnedTargetChangeId']!==_0x323c9b)return this['_pinnedRectIndex']=_0x3bcb4f,this['_pinnedTargetElement']=_0x3bce5f,this['_pinnedTargetChangeId']=_0x323c9b,_0xcd43a6[_0x3bcb4f];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x323c9b){if(_0x3bce5f!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0xcd43a6[this['_pinnedRectIndex']];}return void 0x0!==_0x3bcb4f&&this['_pinnedTargetChangeId']!==_0x323c9b?(this['_pinnedRectIndex']=_0x3bcb4f,this['_pinnedTargetElement']=_0x3bce5f,this['_pinnedTargetChangeId']=_0x323c9b,_0xcd43a6[_0x3bcb4f]):_0x3bce5f['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x48a4e0,_0x2c429c){if(_0x48a4e0)for(let _0x51dbd6=0x0;_0x51dbd6<_0x2c429c['length'];_0x51dbd6++){const _0x1e8feb=_0x2c429c[_0x51dbd6];if(_0x48a4e0['clientX']>=_0x1e8feb['left']-0x3&&_0x48a4e0['clientX']<=_0x1e8feb['right']+0x3&&_0x48a4e0['clientY']>=_0x1e8feb['top']-0x3&&_0x48a4e0['clientY']<=_0x1e8feb['bottom']+0x3)return _0x51dbd6;}}['_isPinnedRectVisible'](_0x5b0fd2,_0x4fed88,_0x9d06b1){const _0x249f86=new _0x7d114a(_0x5b0fd2),_0xa6bc11=_0x4fed88||document['documentElement'],_0x13788f=_0x249f86['getIntersection'](_0x5676c9(_0x9d06b1)),_0x2f5d14=new _0x7d114a(_0xa6bc11)['getIntersection'](_0x249f86);return!!(_0x13788f&&_0x2f5d14&&_0x249f86['width']>0x0);}}const ih=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class Me extends _0x2536b2{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[pt];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x566f43){super(_0x566f43),this['_bodyCollection']=new _0x5669fa(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 _0x2dd702=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x2dd702);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x52990a){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x57dc55=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x52990a,_0x57dc55);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x209f42){_0x209f42&&('error-general'!==_0x209f42['status']?'error-chunk'!==_0x209f42['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x43e682){this['_mainView']['addCheckRunResult'](_0x43e682);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x3af08e){this['_mainView']['showGeneralReviewCoreErrorView'](_0x3af08e??i(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x498ced,_0x2c0bcb){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x498ced,_0x2c0bcb);}['setActiveStateInResults'](_0x1f07b0){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x3717b5=>{_0x3717b5['id']===_0x1f07b0&&_0x3717b5['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x519472=>_0x519472['setItemAsInactive']());}['updateChangeState'](_0x1e316e,_0x36a18d){'accepted'===_0x36a18d||'rejected'===_0x36a18d||'outdated'===_0x36a18d?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x1e316e,_0x36a18d):this['_mainView']['reviewCheckResultsView']['showResult'](_0x1e316e,_0x36a18d);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x64525a,_0x9fe8c5,_0x5db7ce,_0x442e99,_0x2a5280,_0x3ae5e2){this['_balloonSuggestionView']['showBalloon'](_0x64525a,_0x9fe8c5,_0x5db7ce,_0x442e99,_0x2a5280,_0x3ae5e2);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x49ddce){const _0x2ffa17=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x2de89b=>_0x2de89b['id']===_0x49ddce);return _0x2ffa17?_0x2ffa17['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class sh extends _0x10e3da{constructor(_0x2ddda2){super(_0x2ddda2),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x5b3b6e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x5b3b6e['if']('isVisible','ck-hidden',_0x3de153=>!_0x3de153)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x5b3b6e['to']('errorMessage')}]}]});}}class Ae extends _0x10e3da{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x2ba043,_0xe3685c){super(_0x2ba043),this['reviewCoreHeader']=_0xe3685c['header'],this['generalErrorView']=new sh(_0x2ba043),this['reviewCheckListView']=_0xe3685c['list'],this['reviewCheckListView']['delegate'](...ih)['to'](this),this['reviewCheckResultsView']=_0xe3685c['results'],this['reviewCheckResultsView']['delegate'](...ih)['to'](this),this['reviewCompletedView']=_0xe3685c['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'](_0x2d9158){this['reviewCheckResultsView']['addResult'](_0x2d9158),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'](_0x506208){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x506208;}['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 _0x42f5cd{constructor(_0x2593ff,_0x1574e5){super(_0x1574e5),this['set']({'label':_0x2593ff,'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class Ve extends _0x5f33aa{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x4dc643,_0x29c317){super(_0x4dc643),this['_contents']=_0x29c317,this['_resultViews']=new _0x229fa2(),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(_0x4dc643),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 _0x21bf7d=this['_createCombinedSkeletonLoader'](),_0x306459=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x306459['if']('isLoading','ck-ai_review__check-run_loading',_0x19c964=>_0x19c964),_0x306459['if']('isResultReady','ck-ai_review__check-run_ready',_0x1c700c=>_0x1c700c),_0x306459['if']('isVisible','ck-hidden',_0xadb49d=>!_0xadb49d)]},'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',_0x5a73e1=>_0x5a73e1)]},'children':this['_resultViews']},_0x21bf7d]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x571573){const _0x25e62c=new gr(this['locale'],_0x571573['id']);_0x25e62c['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x25e62c),_0x25e62c['resultResponseView']['element']['innerHTML']=_0x571573['contentDiffed'];}['hideResult'](_0x19eeb0,_0x284fb9){if('pending'===_0x284fb9)return;const _0x180181=this['_resultViews']['find'](_0xb43dda=>_0xb43dda['id']===_0x19eeb0);_0x180181&&(_0x180181['status']=_0x284fb9,_0x180181['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x3b46a7,_0x52d5d5){if('pending'!==_0x52d5d5)return;const _0x2898ea=this['_resultViews']['find'](_0x2095ce=>_0x2095ce['id']===_0x3b46a7);_0x2898ea&&(_0x2898ea['status']=_0x52d5d5,_0x2898ea['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x4cb222,_0x3523a6){this['headerTitle']=_0x4cb222,this['headerSubtitle']=_0x3523a6||'';}['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 _0x50f82d=new _0x10e3da(this['locale']),_0x59640b=[];for(let _0x39c30d=0x0;_0x39c30d<0x10;_0x39c30d++){const _0x1ac284=this['_createSkeletonLoader']();_0x1ac284['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x59640b['push'](_0x1ac284);}return _0x50f82d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x3b8f41=>!_0x3b8f41)]},'children':_0x59640b}),_0x50f82d;}['_createErrorView'](){const _0x2eeaee=new _0x10e3da(this['locale']),_0x58cd64=new _0x42f5cd(this['locale']),t=this['locale']['t'];return _0x2eeaee['delegate']('retryReview')['to'](this),_0x58cd64['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai_review__check-run-error-retry-button'}),_0x58cd64['on']('execute',()=>{this['fire']('retryReview');}),_0x2eeaee['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x35dfaa=>!_0x35dfaa),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x389a18=>'chunk'===_0x389a18)]},'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',_0x1726fc=>'chunk'===_0x1726fc)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x331460=>'general'!==_0x331460)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0xa9ccbd=>'chunk'!==_0xa9ccbd)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x58cd64]}),_0x2eeaee;}['_createCancelButtonView'](){const _0x168a04=new _0x42f5cd(this['locale']);return _0x168a04['set']({'label':i(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x4641d7}),_0x168a04['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x5fa421=>_0x5fa421),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x57e36f=>_0x57e36f)]}}),_0x168a04['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x168a04;}['_createToggleDiffButtonView'](){const _0x10f58a=new _0x42f5cd(this['locale']);_0x10f58a['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x10f58a['bind']('isEnabled')['to'](this,'isError',_0x12e69a=>!_0x12e69a),_0x10f58a['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x48eeff=>!_0x48eeff),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2ad731=>_0x2ad731)]}});const _0x2268de=i(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x1a7224=i(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x10f58a['bind']('isOn')['to'](this,'isToggleDiffOn',_0x430b94=>_0x430b94),_0x10f58a['bind']('icon')['to'](this,'isToggleDiffOn',_0x168b43=>_0x168b43?_0x124680:_0x11edaf),_0x10f58a['bind']('label')['to'](this,'isToggleDiffOn',_0x1a3692=>_0x1a3692?_0x2268de:_0x1a7224),_0x10f58a['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x10f58a;}['_createAcceptAllButtonView'](){const _0x414960=new _0x42f5cd(this['locale']);return _0x414960['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x414960['bind']('isEnabled')['to'](this,'isError',_0x2b0cdf=>!_0x2b0cdf),_0x414960['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x381aeb=>!_0x381aeb),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x58d7ad=>_0x58d7ad)]}}),_0x414960['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x414960;}['_createExitReviewButtonView'](){const _0x21863a=new _0x42f5cd(this['locale']);return _0x21863a['set']({'label':i(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x21863a['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary','ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x594dec=>!_0x594dec),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2ab711=>_0x2ab711)]}}),_0x21863a['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x21863a;}['_createResultHeaderView'](){const _0x24328f=new _0x10e3da(this['locale']),_0x5beb6d=this['_createTitleView']();return _0x24328f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x33baa9=>_0x33baa9)]},'children':[_0x5beb6d,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x24328f;}['_createTitleView'](){const _0x6bed0=new _0x10e3da(this['locale']),_0x2ef6c8=new pi();return _0x2ef6c8['bind']('isVisible')['to'](this,'isResultReady',_0x450880=>!_0x450880),_0x6bed0['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x2ef6c8,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1eaf9a=>_0x1eaf9a)]},'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',_0x1aa784=>!_0x1aa784)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x6bed0;}['_createFinishReviewButtonView'](){const _0x13aa03=new _r(i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x13aa03['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x34a532=>!_0x34a532)]}}),_0x13aa03['delegate']('finishReview')['to'](this),_0x13aa03;}}class be extends _0x5f33aa{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x2df483,_0x436677){super(_0x2df483),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x436677['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x436677['headerText']);const _0x31f545=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x31f545['if']('isVisible','ck-hidden',_0x5327e2=>!_0x5327e2)]},'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':_0x436677['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x120518){const _0x2f3443=new _r(_0x120518,this['locale']);return _0x2f3443['delegate']('finishReview')['to'](this),_0x2f3443;}['_createResultHeaderView'](_0x8e4cf5){const _0xfadb20=new _0x10e3da(this['locale']);return _0xfadb20['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':_0x8e4cf5}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0xfadb20;}}class Dr extends _0x10e3da{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x4a3713,_0x1148db){super(_0x4a3713),this['_defaultValue']=_0x1148db['default']||(_0x1148db['data']['length']>0x0?_0x1148db['data'][0x0]['id']:''),this['_defaultLabel']=_0x1148db['data']['find'](_0x4e50ec=>_0x4e50ec['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x46177f(this['locale']);const _0x3f2181=this['_prepareListOptions'](_0x1148db['data']);_0x3c2b1d(this['_dropdownView'],_0x3f2181,{'role':'menu','ariaLabel':_0x1148db['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xd0fcc3=>{_0xd0fcc3['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x18015c=>{this['formValue']=_0x18015c['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x18015c['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'](_0x1d06be=[]){const _0x21aa7c=new _0x305a6b();this['resetToDefault']();for(const _0x86ed19 of _0x1d06be){const _0x401071=new _0x4f6c60({'label':_0x86ed19['label'],'withText':!0x0,'role':'menuitemradio','id':_0x86ed19['id'],'model':_0x86ed19});_0x401071['bind']('isOn')['to'](this,'formValue',_0x125678=>_0x125678===_0x401071['id']);const _0x47c324={'type':'button','model':_0x401071};_0x21aa7c['add'](_0x47c324);}return _0x21aa7c;}}class cc extends _0x5f33aa{['_formItem']=null;constructor(_0x23e1d4,_0x1adc56,_0x1451e8){super(_0x23e1d4),this['argsKey']=_0x1adc56?.['argsKey'];if('dropdown'===_0x1adc56['formType'])this['_formItem']=new Dr(this['locale'],_0x1adc56);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x267d90=new _0x4c5ad6(this['locale'],{'children':[this['_formItem']],'class':[_0x1451e8?'ck-form__row_with-submit':'']});_0x1451e8&&_0x267d90['children']['add'](_0x1451e8),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x267d90]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class po extends _0x13279b{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x33c796){super(_0x33c796),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x4259de(),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 _0x10e3da{['focusTracker']=new _0x3295cb();['keystrokes']=new _0x4259de();['focusCycler'];['_focusables']=new _0x229fa2();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x2f7d4a,_0x264888,_0x48cf28=!0x1){super(_0x2f7d4a),this['_check']=_0x264888,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x264888['defaultModel']?_0x264888['defaultModel']['id']:'',this['_defaultLabel']=_0x264888['defaultModel']?_0x264888['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x558a3e(this['locale'],()=>new po(_0x2f7d4a)),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 _0x305a6b(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x48cf28),_0x3c2b1d(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x4c5ad6(this['locale'],{'children':[this['promptInputView']]}),new _0x4c5ad6(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x29be0a,_0x5cee32)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x5cee32()):_0x5cee32();}),this['focusCycler']=new _0xb86ebf({'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'](_0x25fd47=>{this['_focusables']['add'](_0x25fd47),this['focusTracker']['add'](_0x25fd47['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 _0x2dcb3b of this['_getFormValidators']()){const _0x2466cd=_0x2dcb3b();if(_0x2466cd)return this['promptInputView']['errorText']=_0x2466cd,!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 _0x2e6601=new _0x42f5cd(this['locale']),t=this['locale']['t'];return _0x2e6601['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x2e6601['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x2e6601;}['_createCancelButtonView'](){const _0x12eca9=new _0x42f5cd(this['locale']),t=this['locale']['t'];return _0x12eca9['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary'}),_0x12eca9['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4b6495=>{_0x4b6495['stopPropagation']();})}}),_0x12eca9['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x12eca9;}['_setModelList'](_0x1ae1a3){this['_modelSelectionDropdownItems']['clear']();const _0x3ce671=this['_check']['models'];if(_0x1ae1a3)this['set']('modelDisplayMode','hidden');else{const _0x1ca7c4=0x1===_0x3ce671['length'];this['set']('modelDisplayMode',_0x1ca7c4?'name':'selector');}if(this['resetToDefault'](),_0x3ce671?.['length']){0x1===_0x3ce671['length']&&this['set']('activeModelName',_0x3ce671[0x0]['name']||_0x3ce671[0x0]['id']);for(const _0x27e301 of _0x3ce671){const _0x2f6aa3=new _0x4f6c60({'label':_0x27e301['name'],'withText':!0x0,'role':'menuitemradio','id':_0x27e301['id'],'model':_0x27e301});_0x2f6aa3['bind']('isOn')['to'](this,'modelId',_0x29412f=>_0x29412f===_0x27e301['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x2f6aa3,'labelView':new ko(this['locale'],_0x27e301)});}}}['_createModelSelectionDropdown'](){const _0x4bf164=_0x46177f(this['locale']);return _0x4bf164['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x4bf164['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),_0x4bf164['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x1d5455=>'selector'===_0x1d5455),this['listenTo'](_0x4bf164,'execute',_0x5bfa37=>{this['modelId']=_0x5bfa37['source']['model']['id'],_0x4bf164['buttonView']['label']=_0x5bfa37['source']['label'];}),_0x4bf164;}['_createModelNameView'](){const _0x567fec=new _o(this['locale']);return _0x567fec['bind']('text')['to'](this,'activeModelName',_0x445ddc=>_0x445ddc??''),_0x567fec['bind']('isVisible')['to'](this,'modelDisplayMode',_0xaa7ed5=>'name'===_0xaa7ed5),_0x567fec;}['_createActionsFooterView'](){const _0x453987=new _0x10e3da(this['locale']);return _0x453987['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']]}]}),_0x453987;}}class _o extends _0x10e3da{constructor(_0x14a29e){super(_0x14a29e),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x57bbe6=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x57bbe6['if']('isVisible','ck-hidden',_0x352c03=>!_0x352c03)]},'children':[{'text':_0x57bbe6['to']('text')}]});}}class ko extends _0x3d9772{constructor(_0x4c8cf1,_0x1f31a4){super();const _0x26df80=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x26df80['to']('style'),'id':_0x26df80['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x26df80['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x1f31a4['description']||'']}]}]});}}class ic extends _0x5f33aa{['_formItemsCollection']=new _0x229fa2();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x57d85a,_0x2a656f,_0xa5b992,_0x542154=!0x1){super(_0x57d85a),this['_hideModels']=_0x542154,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x2a656f['isParameterized']);const _0x52bfb5=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',_0x5c6cc2=>_0x5c6cc2),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x229c81=>_0x229c81)],'style':{'--ck-ai-review-check-list-item-index':_0xa5b992}},'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':_0x2a656f['title']}]},_0x52bfb5]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x2a656f['description']?[{'text':_0x2a656f['description']}]:[]}]}]},..._0x2a656f['isParameterized']?[this['_createParameterizedView'](_0x2a656f)]:[],...'custom'===_0x2a656f['id']?[this['_createCustomView'](_0x2a656f,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x2a656f['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x2a656f['id'],'args':_0x2a656f['useArgs']?_0x2a656f['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x4fafed({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x24c93c=>{_0x24c93c['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x2ba3ba=new _0x5d3550();return _0x2ba3ba['content']=_0x38d106,_0x2ba3ba['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x2ba3ba;}['_createParameterizedView'](_0x3a5def){const _0x3099be=new _0x10e3da(),_0x2e6e00=this['_createFormView'](_0x3a5def);return _0x3099be['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x5abba8=>!_0x5abba8)]},'children':[_0x2e6e00]}),_0x3099be;}['_createFormView'](_0x25e446){const _0x50a255=new _0x10e3da(),_0x4ec104=Array['isArray'](_0x25e446['options'])?_0x25e446['options']:[],_0x5b8947=new _0x42f5cd(this['locale']),t=this['locale']['t'];_0x5b8947['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x5b8947['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x207633=>{_0x207633['stopPropagation']();})}}),_0x5b8947['on']('execute',()=>{const _0x25740d=[],_0x243978={};this['_formItemsCollection']['forEach'](_0x58fbbd=>{_0x25740d['push'](_0x58fbbd['value']),_0x25e446['useArgs']&&_0x25e446['options']&&(_0x243978[_0x58fbbd['argsKey']]=_0x58fbbd['value']);}),this['fire']('runReviewCheck',{'id':_0x25e446['id'],'params':_0x25740d['length']?_0x25740d:void 0x0,'args':Object['keys'](_0x243978)['length']?_0x243978:void 0x0});});const _0x364139=_0x4ec104['length'];return _0x4ec104['forEach']((_0x426076,_0x1b3d23)=>{const _0x1a2a6c=_0x1b3d23===_0x364139-0x1;this['_formItemsCollection']['add'](new cc(this['locale'],_0x426076,_0x1a2a6c?_0x5b8947:null));}),_0x50a255['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x50a255;}['_createCustomView'](_0x5bf6dc,_0xd1738c=!0x1){return this['_customCheckView']=new rc(this['locale'],_0x5bf6dc,_0xd1738c),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',_0x108d56=>!_0x108d56)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x1c7225,_0x461153,_0x366eb1)=>{_0x366eb1||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class je extends _0x5f33aa{['_checkViews'];constructor(_0x42e70d){super(_0x42e70d),this['_checkViews']=new _0x229fa2(),this['_setupTemplate']();}['setChecks'](_0x1b8667,_0x302578=!0x1){this['_checkViews']['clear']();for(const [_0x560332,_0x130949]of _0x1b8667['entries']()){const _0x3a0d42=new ic(this['locale'],_0x130949,_0x560332,_0x302578);_0x3a0d42['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x3a0d42);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x1e932c of this['_checkViews'])_0x1e932c instanceof ic&&_0x1e932c['resetToDefault']();}['_setupTemplate'](){const _0x356151=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x356151['if']('isVisible','ck-hidden',_0x17ec20=>!_0x17ec20)]},'children':this['_checkViews']});}}class ge extends Me{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x55306d=this['context']['locale'],_0x357409=new _0x3571c0(_0x55306d,{'label':i(_0x55306d,'AI_REVIEW_MODE'),'icon':_0x359b2f,'class':'ck-ai-header\x20ck-ai-header_review'});return new Ae(this['context']['locale'],{'header':_0x357409,'list':new je(_0x55306d),'results':new Ve(_0x55306d,{'generalErrorText':i(_0x55306d,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0x55306d,{'headerText':i(_0x55306d,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':i(_0x55306d,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x55306d,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x11e57c=this['context']['plugins']['get']('AITabs');_0x11e57c['view']['on']('activateTab',(_0x41b1e3,_0x99d705)=>{'reviewMode'===_0x99d705?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x11e57c['view']['addTab']({'id':'reviewMode','buttonLabel':i(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x359b2f,'order':0x0,'content':this['_mainView']});}}const fe='review-';class de extends _0x2536b2{static get['requires'](){return[_0x587691,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(_0x4a1ea7){super(_0x4a1ea7),this['_domEmitter']=new(_0x2ba8ea())(),this['_eventEmitter']=new(_0x5d9d11())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x51a6b6=T(this['context']);_0x51a6b6['conversion']['for']('editingDowncast')['markerToElement']({'model':fe+'insert','view':(_0x4bd713,{writer:_0x311cc1})=>{const _0x2337b1=this['_markers']['get'](_0x4bd713['markerName']),_0x6e7ddb={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x2337b1?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x4bd713['markerName']};return _0x311cc1['createUIElement']('span',_0x6e7ddb,function(_0x4c7223){const _0x3d89b8=this['toDomElement'](_0x4c7223);return _0x3d89b8['innerHTML']=_0x2337b1?.['content']?.['asString']||'',_0x3d89b8;});}}),_0x51a6b6['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-only','view':_0x5c89cc=>{const _0xf111af=this['_markers']['get'](_0x5c89cc['markerName']),_0x1b8445=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0xf111af?.['id']||'')&&_0x1b8445['push']('ck-ai_review__change_active'),{'classes':_0x1b8445,'attributes':{'data-marker-id':_0x5c89cc['markerName']}};}}),_0x51a6b6['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-context','view':_0x181824=>{const _0xccc53b=this['_markers']['get'](_0x181824['markerName']),_0x5b6077=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0xccc53b?.['id']||'')&&_0x5b6077['push']('ck-ai_review__change_active'),{'classes':_0x5b6077,'attributes':{'data-marker-id':_0x181824['markerName']}};}}),_0x51a6b6['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-text','view':_0x59711f=>{const _0x2003e4=this['_markers']['get'](_0x59711f['markerName']),_0x4fdcf0=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x2003e4?.['id']||'')&&_0x4fdcf0['push']('ck-ai_review__change_active'),{'classes':_0x4fdcf0,'attributes':{'data-marker-id':_0x59711f['markerName']}};}}),_0x51a6b6['conversion']['for']('dataDowncast')['markerToElement']({'model':fe+'suggestion-context','view':(_0x22c3d6,{writer:_0x2dd676})=>_0x2dd676['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x22c3d6['isOpening']?'start':'end')})}),_0x51a6b6['conversion']['for']('downcast')['attributeToAttribute']({'model':Ct,'view':_0xaec028});const _0x10f74f=_0x51a6b6['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x10f74f,'mouseup',(_0x522eee,_0x3abae1)=>{const _0x155661=_0x3abae1['target'],_0x37535b=this['_findMarkerElement'](_0x155661);if(!_0x37535b)return;const _0x40eeb1=_0x37535b['getAttribute']('data-marker-id'),_0x4b7465=_0x40eeb1['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x40eeb1,'changeId':_0x4b7465,'markerElement':()=>this['_findMarkerElementById'](_0x40eeb1),'domEvent':_0x3abae1});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x10f74f,'mouseover',(_0x33bef3,_0x2c8c71)=>{const _0x255a28=_0x2c8c71['target'],_0x137f2d=_0x2c8c71['relatedTarget'];let _0x226641=this['_findMarkerElement'](_0x255a28);if(!_0x226641&&_0x137f2d&&(_0x226641=this['_findMarkerElement'](_0x137f2d)),!_0x226641)return;const _0x543f1a=_0x226641['getAttribute']('data-marker-id'),_0x22d33e=_0x543f1a['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x22d33e,'markerElement':()=>this['_findMarkerElementById'](_0x543f1a),'domEvent':_0x2c8c71});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x1b9d98((_0x29ba7a,_0x5c215b)=>{const _0x211fdc=_0x5c215b['target'];if(this['_findMarkerElement'](_0x211fdc))return;_0x211fdc['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x51a6b6['model']['document']['registerPostFixer'](_0x644b28=>this['_validateMarkers'](_0x51a6b6,_0x644b28)),_0x51a6b6['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x51a6b6));}['getDocumentData'](){const _0x2ec64d=this['context']['plugins']['get']('AIEditing'),_0x35c681=T(this['context']),_0x9abd4=_0x35c681['model'],_0x3082a4=new tt();for(const _0x18f2ab of _0x9abd4['document']['getRoot']()['getChildren']()){const _0x43a3d7=_0x18f2ab['_clone'](!0x0);_0x3082a4['_appendChild'](_0x43a3d7);}for(const _0x2fb2a8 of _0x9abd4['markers'])_0x3082a4['markers']['set'](_0x2fb2a8['name'],this['_changeRangeOwnerDocument'](_0x2fb2a8['getRange']()['clone'](),_0x3082a4));const _0x37ead8=new _0x4a224a({'ignoreElementEnd':!0x0,'startPosition':_0x9abd4['createPositionAt'](_0x3082a4,0x0)}),_0xfb456e=new Set(),_0x4c25d2=new Map();for(const {item:_0x59e1bd}of _0x37ead8){if(!_0x59e1bd['is']('$textProxy'))continue;const _0x5b3a61=_0x59e1bd['parent'];if(_0x5b3a61&&_0x5b3a61['is']('element')){const _0x570ef1=this['_upsertDataId'](_0x5b3a61,()=>_0x2ec64d['_nextDataId'](_0xfb456e));_0xfb456e['add'](_0x570ef1);for(const _0x156d39 of _0x5b3a61['getChildren']())_0x156d39['is']('element')&&_0xfb456e['add'](this['_upsertDataId'](_0x156d39,()=>_0x2ec64d['_nextDataId'](_0xfb456e)));let _0x291796=_0x5b3a61;for(;_0x291796['parent']&&!_0x291796['parent']['is']('documentFragment');)_0x291796=_0x291796['parent'],_0x291796['hasAttribute'](Ct)&&_0x291796['_removeAttribute'](Ct);_0x4c25d2['set'](_0x570ef1,{'path':_0x5b3a61['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x291796['_clone'](!0x0),_0x570ef1,_0x35c681['data'])}),_0x37ead8['jumpTo'](_0x9abd4['createPositionAfter'](_0x5b3a61));}}return{'content':_0x35c681['data']['processor']['toData'](_0x35c681['data']['toView'](_0x3082a4)),'version':_0x35c681['model']['document']['version'],'elements':_0x4c25d2};}['diffContent'](_0x5ef890,_0x42328a,_0x444f4a=!0x1){const _0x14ac22=[],_0x3b8c2c=T(this['context']),_0x336f8c=_0x3b8c2c['data']['parse'](_0x42328a,'$documentFragment'),_0x46fcbc=_0x3b8c2c['data']['parse'](_0x5ef890,'$documentFragment'),_0x586992=_0x3b8c2c['model']['createPositionAt'](_0x46fcbc,0x0);if(this['_haveSingleTopLevelElement'](_0x336f8c)){if(!this['_hasSameTopLevelElement'](_0x46fcbc,_0x336f8c))return _0x14ac22;}else{const _0x520dc9=_0x3b8c2c['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x46fcbc,_0x520dc9)||!this['_haveOnlyInlineContent'](_0x336f8c,_0x520dc9))return _0x14ac22;}const _0x56f73e=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x5ef890,_0x42328a,{'anchor':_0x586992,'markDeletions':!0x0})['getOperations']()['filter'](_0x16feb5=>'insert'===_0x16feb5['type']||'marker'===_0x16feb5['type']&&_0x16feb5['name']['startsWith']('$markedRemove')),_0x8764c1=this['_groupAdjacentOperations'](_0x56f73e),_0x507ad5=[];if(_0x444f4a){if(_0x8764c1['length']){const _0x4b2c49=_0x8764c1[0x0]['operations'][0x0],_0x3e1fec='insert'===_0x4b2c49['type']?_0x4b2c49['position']:_0x4b2c49['newRange']['start'],_0x35e25e=this['_getPositionLimitingRange'](_0x3e1fec,_0x3b8c2c,'inside'),_0x2c14db=_0x35e25e?_0x336f8c['getChild'](0x0)['getChildren']():_0x336f8c['getChildren'](),_0x121fea=_0x35e25e||_0x3b8c2c['model']['createRangeIn'](_0x46fcbc),_0x102508=[new _0x314055('$markedRemove:synthetic'+_0x4689d1(),null,_0x121fea,_0x3b8c2c['model']['document']['model']['markers'],!0x0,_0x3b8c2c['model']['document']['version']+0x1),new _0x58675e(_0x121fea['end'],_0x2c14db,_0x3b8c2c['model']['document']['version']+0x2)];_0x507ad5['push']({'operations':_0x102508,'operationsIsolated':_0x102508,'groupOffset':0x0});}}else _0x507ad5['push'](..._0x8764c1);let _0x45b77b=0x0;return _0x3b8c2c['model']['change'](_0x10e352=>{for(let _0x3207ca=0x0;_0x3207ca<_0x507ad5['length'];_0x3207ca++){const _0x594035=_0x507ad5[_0x3207ca],_0x12bf3a=_0x10e352['createDocumentFragment']();for(const _0xc93fb0 of _0x46fcbc['getChildren']())_0x10e352['append'](_0xc93fb0['_clone'](!0x0),_0x12bf3a);for(const _0x5ceca2 of _0x594035['operationsIsolated'])if('insert'===_0x5ceca2['type']){const _0x34e0d8=_0x5ceca2;_0x34e0d8['baseVersion']=null,_0x34e0d8['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x34e0d8,_0x12bf3a),_0x10e352['batch']['addOperation'](_0x5ceca2),_0x3b8c2c['model']['applyOperation'](_0x5ceca2);const _0x4a75cc='suggestion:insertion:id:authorId:'+_0x45b77b++,_0xc62a9c=_0x3b8c2c['model']['createRange'](_0x34e0d8['position'],_0x34e0d8['position']['getShiftedBy'](_0x34e0d8['howMany']));_0x12bf3a['markers']['set'](_0x4a75cc,_0xc62a9c);}else{if('marker'===_0x5ceca2['type']&&_0x5ceca2['name']['startsWith']('$markedRemove')){const _0x40d73e=_0x5ceca2,_0x4a89dd='suggestion:deletion:id:authorId:'+_0x45b77b++;this['_changeOperationOwnerDocument'](_0x40d73e,_0x12bf3a),_0x12bf3a['markers']['set'](_0x4a89dd,_0x40d73e['newRange']);}}if(_0x444f4a)_0x14ac22['push']({..._0x594035,'context':this['_createGetContentFn'](_0x46fcbc,_0x3b8c2c['data']),'content':this['_createGetContentFn'](_0x46fcbc,_0x3b8c2c['data'])});else{const _0x3a614b=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x594035['operationsIsolated'][0x0]),_0x12bf3a),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x594035['operationsIsolated'][_0x594035['operationsIsolated']['length']-0x1]),_0x12bf3a));_0x12bf3a['markers']['set'](fe+'suggestion-context',new it(_0x3a614b['start'],_0x3a614b['end'])),_0x14ac22['push']({..._0x594035,'context':this['_createGetContextFn'](_0x12bf3a,_0x3b8c2c['data'],{'ellipsisBefore':_0x3a614b['hasContentBefore'],'ellipsisAfter':_0x3a614b['hasContentAfter']}),'content':this['_createGetContentFn'](_0x12bf3a,_0x3b8c2c['data'])});}}}),_0x14ac22;}['markChangePositionInEditorContent'](_0x4832c7,_0x27298a){if(!_0x4832c7['length'])return;const _0x465f8c=_0x4832c7[0x0]['parent']['id'],_0x4046f8=_0x27298a['elements']['get'](_0x465f8c);if(!_0x4046f8)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x465f8c);const _0x54d5c6=_0x4046f8['path'],_0x3e62e9=T(this['context']),_0x310861=_0x3e62e9['model']['document']['history']['getOperations'](_0x27298a['version']),_0x104271=[];for(const _0xdf4435 of _0x4832c7){const _0x36ac28=_0xdf4435['operationsIsolated']['map'](_0x13f0f5=>this['_translateOperationToEditorContent'](_0x13f0f5,_0x54d5c6,_0x3e62e9['model']['document']['getRoots']()[0x0]));if(!_0x36ac28||!_0x36ac28['length'])continue;const _0x451cc9=_0x36ac28['every'](_0x194c18=>'marker'===_0x194c18['type']&&_0x194c18['name']['startsWith']('$markedRemove')),_0x55882d={'document':_0x3e62e9['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x164771=nt(_0x36ac28,_0x310861,_0x55882d)['operationsA'];for(const _0x462edc of _0x164771)if('insert'===_0x462edc['type']){const _0x4c0319=_0x462edc,_0x1abb55=_0x4c0319['nodes'];_0x3e62e9['model']['change'](_0x77c57c=>{const _0x3f323e=_0x77c57c['createDocumentFragment']();for(const _0x27b374 of _0x1abb55)_0x77c57c['append'](_0x27b374['_clone'](!0x0),_0x3f323e);_0x104271['push']({'start':_0x4c0319['position'],'end':_0x4c0319['position'],'type':'insert','groupId':_0xdf4435['id'],'content':{'asString':this['_createGetContentFn'](_0x3f323e,_0x3e62e9['data'])(),'asFragment':_0x3f323e}});});}else{if('marker'===_0x462edc['type']&&_0x462edc['name']['startsWith']('$markedRemove')){const _0x5a886c=_0x462edc;let _0x15efd0='remove-text';if(_0x451cc9){const _0x3c5fb2=this['_findAdjacentContextDistance'](_0x5a886c['newRange']['start'],'backward',_0x3e62e9['model']['schema']),_0x35bb0f=this['_findAdjacentContextDistance'](_0x5a886c['newRange']['end'],'forward',_0x3e62e9['model']['schema']);if(_0x3c5fb2||_0x35bb0f){const _0x331ca8=_0x5a886c['newRange']['start']['getShiftedBy'](-_0x3c5fb2),_0x5995ff=_0x5a886c['newRange']['end']['getShiftedBy'](_0x35bb0f);_0x104271['push']({'start':_0x331ca8,'end':_0x5995ff,'groupId':_0xdf4435['id'],'type':'remove-context'});}else _0x15efd0='remove-only';}_0x104271['push']({'start':_0x5a886c['newRange']['start'],'end':_0x5a886c['newRange']['end'],'groupId':_0xdf4435['id'],'type':_0x15efd0});}}}this['_insertMarkers'](_0x104271);}['clearAllMarkers'](){const _0x368e94=T(this['context']);_0x368e94['model']['change'](_0x2dc957=>{for(const _0x484c27 of this['_markers']['keys']())_0x368e94['model']['markers']['get'](_0x484c27)&&_0x2dc957['removeMarker'](_0x484c27);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){T(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){T(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x3e2075){const _0x16f46c=T(this['context']),_0x2802ca=_0x16f46c['model'],_0x107098=_0x3e2075['map'](_0x990ba7=>this['_getMarkersDataForGroup'](_0x990ba7))['flat']();_0x2802ca['change'](_0x56f142=>{for(const _0x178473 of _0x107098){const _0x104866=_0x16f46c['model']['markers']['get'](_0x178473['id']);if(_0x104866){if('insert'===_0x178473['type']){if(!_0x178473['content'])continue;_0x2802ca['insertContent'](_0x178473['content']['asFragment']||null,_0x104866['getRange']()['start']);}else'remove-text'!==_0x178473['type']&&'remove-only'!==_0x178473['type']||_0x2802ca['deleteContent'](_0x2802ca['createSelection'](_0x104866['getRange']()));_0x56f142['removeMarker'](_0x178473['id']),this['_markers']['delete'](_0x178473['id']);}}});}['rejectChange'](_0x3f78fd){const _0x284d4e=T(this['context']),_0x1709b0=this['_getMarkersDataForGroup'](_0x3f78fd);_0x284d4e['model']['change'](_0x1b5de0=>{for(const _0x3fab80 of _0x1709b0)_0x1b5de0['removeMarker'](_0x3fab80['id']),this['_markers']['delete'](_0x3fab80['id']);});}['getEditor'](){return T(this['context']);}['getMarkerElementForChange'](_0x565f7a){const _0x57b9da=Array['from'](this['_markers']['values']())['filter'](_0x36e6b5=>_0x36e6b5['groupId']===_0x565f7a);if(!_0x57b9da['length'])return null;const _0x1fab29=0x1===_0x57b9da['length']?_0x57b9da[0x0]:this['_sortMarkers'](_0x57b9da)[0x0],_0x59d7c5=T(this['context'])['model']['markers']['get'](_0x1fab29['id']);if(!_0x59d7c5)return null;return{'modelRange':_0x59d7c5['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x1fab29['id'])};}['getContentElementForChange'](_0x417c26){const _0x2626dd=Array['from'](this['_markers']['values']())['filter'](_0x4b0192=>_0x4b0192['groupId']===_0x417c26);if(!_0x2626dd['length'])return null;const _0xbffefc=0x1===_0x2626dd['length']?_0x2626dd[0x0]:this['_sortMarkers'](_0x2626dd)[0x0],_0x40d018=T(this['context']),_0x9045b0=_0x40d018['model']['markers']['get'](_0xbffefc['id']);if(!_0x9045b0)return null;const _0x241da1=_0x9045b0['getRange'](),_0x644cb3=_0x40d018['editing']['view']['getDomRoot']();if(!_0x644cb3||!_0x241da1)return null;let _0x818c56=_0x241da1['start']['parent'];for(;_0x818c56['parent']&&'$root'!==_0x818c56['parent']['name'];)_0x818c56=_0x818c56['parent'];if(!_0x818c56||!_0x818c56['name'])return null;const _0x40ceae=_0x644cb3['querySelector']('[data-marker-id=\x22'+_0xbffefc['id']+'\x22]');if(!_0x40ceae)return null;let _0x39b2ca=null;_0x40d018['model']['change'](_0x2c5fe7=>{_0x39b2ca=_0x2c5fe7['createDocumentFragment'](),_0x2c5fe7['append'](_0x818c56['_clone'](!0x0),_0x39b2ca);});const _0xc8e122=_0x40d018['data']['toView'](_0x39b2ca)['getChild'](0x0);return _0x40ceae['closest'](_0xc8e122['name']);}['reactivateMarkers'](_0x527157){const _0x47181c=this['_getMarkersDataForGroup'](_0x527157);if(!_0x47181c['length'])return;const _0x5e28af=Array['from'](this['_activeMarkers'])['sort'](),_0x256814=Array['from'](new Set(_0x47181c['map'](_0x5c9524=>_0x5c9524['id'])))['sort']();_0x5e28af['join']('|')!==_0x256814['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x527157));}['setMarkersInElementAsActive'](_0x59ea58){const _0x369bbb=this['_getMarkersDataForGroup'](_0x59ea58);if(!_0x369bbb['length'])return;const _0x56aef2=T(this['context']),_0x3d87bc=new Set(_0x369bbb['map'](_0x52b769=>_0x52b769['id'])),_0x293612=Array['from'](_0x3d87bc['values']())['map'](_0x3bdfe3=>_0x56aef2['model']['markers']['get'](_0x3bdfe3))['filter'](_0x437be7=>!!_0x437be7);_0x3d87bc['forEach'](_0x3a7715=>{this['_activeMarkers']['add'](_0x3a7715);}),_0x56aef2['model']['change'](()=>{_0x293612['forEach'](_0x45d780=>{_0x56aef2['editing']['reconvertMarker'](_0x45d780);});});}['setAllMarkersAsInactive'](){const _0x1997d7=Array['from'](this['_activeMarkers']);if(!_0x1997d7['length'])return;this['_activeMarkers']['clear']();const _0x3140e5=T(this['context']),_0x4457fc=_0x1997d7['map'](_0x16a45d=>_0x3140e5['model']['markers']['get'](_0x16a45d))['filter'](_0x20587b=>!!_0x20587b);_0x3140e5['model']['change'](()=>{_0x4457fc['forEach'](_0x720447=>{_0x3140e5['editing']['reconvertMarker'](_0x720447);});});}['_getPositionLimitingRange'](_0x13f5e8,_0x2917f8,_0x4144c3='outside'){if(!_0x13f5e8)return null;let _0x4cb7b6=_0x13f5e8['parent'];for(;_0x4cb7b6&&_0x4cb7b6['parent']&&'$root'!==_0x4cb7b6['parent']['name']&&!_0x2917f8['model']['schema']['isLimit'](_0x4cb7b6)&&!_0x2917f8['model']['schema']['isBlock'](_0x4cb7b6);)_0x4cb7b6=_0x4cb7b6['parent'];if(!_0x4cb7b6||!_0x4cb7b6['name']||'$root'===_0x4cb7b6['name'])return null;let _0x2536ae=null;return _0x2917f8['model']['change'](_0x7d1389=>{_0x2536ae='inside'===_0x4144c3?_0x7d1389['createRangeIn'](_0x4cb7b6):_0x7d1389['createRangeOn'](_0x4cb7b6);}),_0x2536ae;}['_validateMarkers'](_0x3f8a90,_0x1988a0){const _0x4790aa=Array['from'](this['_markers']['keys']()),_0x10d7b9=new Map();for(const _0x570afb of _0x4790aa){const _0x4c0b00=_0x3f8a90['model']['markers']['get'](_0x570afb);if(!_0x4c0b00)continue;const _0xd20a6f=_0x4c0b00['getStart']()['path'][0x0];_0x10d7b9['has'](_0xd20a6f)||_0x10d7b9['set'](_0xd20a6f,[]),_0x10d7b9['get'](_0xd20a6f)['push'](_0x4c0b00);}const _0x17b576=new Set();for(const _0x3050d5 of _0x3f8a90['model']['document']['differ']['getChanges']()){let _0x512450=-0x1,_0x47c2fb=null;if('insert'===_0x3050d5['type'])_0x47c2fb=new it(_0x3050d5['position'],_0x3050d5['position']['getShiftedBy'](_0x3050d5['length'])),_0x512450=_0x3050d5['position']['path'][0x0];else{if('remove'!==_0x3050d5['type'])continue;_0x47c2fb=new it(_0x3050d5['position']),_0x512450=_0x3050d5['position']['path'][0x0];}const _0x4b8356=_0x10d7b9['get'](_0x512450)||[];if(_0x4b8356['length']){for(const _0x50e790 of _0x4b8356)if(_0x47c2fb['root']['rootName']===_0x50e790['getRange']()['root']['rootName']&&('insert'!==_0x3050d5['type']||!_0x47c2fb['containsRange'](_0x50e790['getRange']()))&&(_0x47c2fb['isIntersecting'](_0x50e790['getRange']())||_0x47c2fb['start']['isTouching'](_0x50e790['getRange']()['end'])||_0x47c2fb['end']['isTouching'](_0x50e790['getRange']()['start']))){const _0x45bd0f=this['_parseMarkerName'](_0x50e790['name']);Array['from'](this['_markers']['values']())['filter'](_0x329b1e=>_0x329b1e['groupId']===_0x45bd0f['groupId'])['forEach'](_0x3956c2=>_0x17b576['add'](_0x3956c2['id']));}}}if(_0x17b576['size']){for(const _0x2feef2 of _0x17b576)_0x1988a0['removeMarker'](_0x2feef2);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x222fd0){for(const {name:_0x46c08c,data:_0x416522}of _0x222fd0['model']['document']['differ']['getChangedMarkers']()){if(!_0x46c08c['startsWith'](fe))continue;const _0x1b2e56=_0x416522['oldRange'],_0x3d07c0=_0x416522['newRange'],_0x1b942c=_0x1b2e56&&'$graveyard'===_0x1b2e56['root']['rootName'],_0x249068=_0x3d07c0&&'$graveyard'===_0x3d07c0['root']['rootName'];if(_0x1b942c&&_0x249068)continue;const _0x1b63e6=this['_parseMarkerName'](_0x46c08c);this['_markers']['get'](_0x46c08c)&&(_0x249068||!_0x3d07c0?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x46c08c,'changeId':_0x1b63e6['groupId']}):_0x1b942c&&_0x3d07c0&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x46c08c,'changeId':_0x1b63e6['groupId']}));}}['_parseMarkerName'](_0x36e904){const _0x3c2d6=_0x36e904['split'](':'),_0x1c97c1=(_0x3c2d6[0x1]||'')['split']('_');return{'prefix':_0x3c2d6[0x0],'groupId':_0x1c97c1[0x0],'suffix':_0x1c97c1[0x1]};}['_translateOperationToEditorContent'](_0x190869,_0x5ae755,_0x5c633a){if('insert'===_0x190869['type']){const _0x4f859b=_0x190869;return new _0x58675e(this['_changePosition'](_0x5ae755['concat'](_0x4f859b['position']['offset']),_0x5c633a),_0x4f859b['nodes'],_0x4f859b['baseVersion']);}if('marker'===_0x190869['type']&&_0x190869['name']['startsWith']('$markedRemove')){const _0x2fc79e=_0x190869;return new _0x314055(_0x2fc79e['name'],_0x2fc79e['oldRange'],this['_changeRange'](_0x2fc79e['newRange'],_0x5ae755['concat'](_0x2fc79e['newRange']['start']['offset']),_0x5ae755['concat'](_0x2fc79e['newRange']['end']['offset']),_0x5c633a),_0x2fc79e['_markers'],_0x2fc79e['affectsData'],_0x2fc79e['baseVersion']);}return _0x190869;}['_groupAdjacentOperations'](_0x503b4c){if(!_0x503b4c['length'])return[];const _0x318de2=[];let _0x3b5e35=0x0,_0x16084d=0x0,_0x4f266e=[];for(let _0x3205c4=0x0;_0x3205c4<=_0x503b4c['length'];_0x3205c4++){const _0x3492b1=_0x503b4c[_0x3205c4],_0x338be6=_0x503b4c[_0x3205c4-0x1];!_0x3492b1||_0x338be6&&!this['_getOperationEnd'](_0x338be6)['isTouching'](this['_getOperationStart'](_0x3492b1))?(_0x318de2['push']({'operations':_0x4f266e,'operationsIsolated':_0x4f266e['map'](_0xa6da80=>this['_shiftOperation'](_0xa6da80['clone'](),-_0x16084d)),'groupOffset':_0x3b5e35}),_0x4f266e=_0x3492b1?[_0x3492b1]:[],_0x16084d+=_0x3b5e35,_0x3b5e35=0x0):_0x4f266e['push'](_0x3492b1),_0x3492b1&&'insert'===_0x3492b1['type']&&(_0x3b5e35+=_0x3492b1['howMany']);}return _0x318de2;}['_findAdjacentContextDistance'](_0x1ae8ea,_0x1b9dc2,_0x3c5321,_0x286f64=0x1){const _0x33fc6a=new _0x4a224a({'startPosition':_0x1ae8ea,'direction':_0x1b9dc2});let _0x1f24fd=0x0;for(let _0x18cf0d=0x0;_0x18cf0d<_0x286f64;_0x18cf0d++){let _0x35f86b=0x0,_0x520f6f=!0x1,_0x3c20c9='forward'===_0x1b9dc2?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x57ef85}of _0x33fc6a)if(_0x57ef85['is']('$textProxy')){const _0x1fae7d=_0x3c20c9['exec'](_0x57ef85['data']);if(_0x1fae7d&&_0x1fae7d['length']){if(_0x35f86b+='forward'===_0x1b9dc2?_0x1fae7d['index']+_0x1fae7d[0x0]['length']:_0x57ef85['data']['length']-_0x1fae7d['index'],_0x1fae7d[0x0]['length']!==_0x57ef85['data']['length'])break;_0x520f6f=!0x0,_0x3c20c9='forward'===_0x1b9dc2?/^\w+/:/\w+$/;}else{if(_0x520f6f)break;_0x35f86b+=_0x57ef85['offsetSize'];}}else{if(_0x57ef85['is']('element')){_0x3c5321['isInline'](_0x57ef85)&&!_0x520f6f&&(_0x35f86b+=0x1);break;}}_0x1f24fd+=_0x35f86b,_0x33fc6a['jumpTo'](_0x1ae8ea['getShiftedBy']('forward'===_0x1b9dc2?_0x1f24fd:-_0x1f24fd));}return _0x1f24fd;}['_getChangeContext'](_0x5be56c,_0x561cba){const _0x425b79=T(this['context'])['model']['schema'],_0x55d47c=this['_findAdjacentContextDistance'](_0x5be56c,'backward',_0x425b79,0x6),_0x3717a1=this['_findAdjacentContextDistance'](_0x561cba,'forward',_0x425b79,0x6),_0x52d383=_0x5be56c['getShiftedBy'](-_0x55d47c),_0x57db3d=_0x561cba['getShiftedBy'](_0x3717a1);return{'start':_0x52d383,'end':_0x57db3d,'hasContentBefore':!_0x52d383['isAtStart'],'hasContentAfter':!_0x57db3d['isAtEnd']};}['_insertMarkers'](_0x2e927f){const _0x1b5de1=this['context']['plugins']['get']('AIEditing'),_0x4382a9=new Set();T(this['context'])['model']['change'](_0x5e8051=>{for(const _0x15da32 of _0x2e927f){const _0x40ba1a=''+fe+_0x15da32['type']+':'+_0x15da32['groupId']+'_'+_0x1b5de1['_nextDataId'](_0x4382a9);this['_markers']['set'](_0x40ba1a,{'id':_0x40ba1a,'groupId':_0x15da32['groupId'],'type':_0x15da32['type'],'content':_0x15da32['content']}),_0x5e8051['addMarker'](_0x40ba1a,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5e8051['createRange'](_0x15da32['start'],_0x15da32['end'])});}});}['_createGetContextFn'](_0x2846fb,_0x4f93d2,_0x48b00b){let _0xfb4f76='';return()=>{if(!_0xfb4f76){const _0x39e627=_0x4f93d2['toView'](_0x2846fb,{'showSuggestionHighlights':!0x0});let _0x2af506=_0x39e627['getChild'](0x0);if(_0x2af506['is']('containerElement')||(_0x2af506=_0x39e627),!_0x2af506)return'';let _0x1f9a98=!0x1;const _0x3a3bf1=[];for(const _0x46e70e of _0x2af506['getChildren']())_0x46e70e['is']('element','span')&&_0x46e70e['hasClass']('ck-ai_review-marker_context-end')&&(_0x1f9a98=!0x1),_0x1f9a98&&_0x3a3bf1['push'](_0x46e70e),_0x46e70e['is']('element','span')&&_0x46e70e['hasClass']('ck-ai_review-marker_context-start')&&(_0x1f9a98=!0x0);_0x2af506['_removeChildren'](0x0,_0x2af506['childCount']),_0x48b00b?.['ellipsisBefore']&&_0x2af506['_appendChild']('…'),_0x2af506['_appendChild'](_0x3a3bf1),_0x48b00b?.['ellipsisAfter']&&_0x2af506['_appendChild']('…');const _0x50852e=_0x4f93d2['htmlProcessor']['domConverter']['viewToDom'](_0x39e627),_0x15f0fe=_0x4f93d2['htmlProcessor']['htmlWriter']['getHtml'](_0x50852e);_0xfb4f76=_0x15f0fe;}return _0xfb4f76;};}['_createGetContentFn'](_0x45cf51,_0x258a8c){let _0x7630f5='';return()=>(_0x7630f5||(_0x7630f5=_0x258a8c['stringify'](_0x45cf51,{'showSuggestionHighlights':!0x0})),_0x7630f5);}['_createGetContentUsingDataIdFn'](_0x1fec37,_0x279d97,_0x5c8fd7){let _0x3f8b2c='';return()=>{if(!_0x3f8b2c){const _0x168f38=_0x5c8fd7['toView'](new tt(_0x1fec37)),_0x3c64e2=_0x5c8fd7['htmlProcessor']['domConverter']['viewToDom'](_0x168f38)['querySelector']('[data-id=\x22'+_0x279d97+'\x22]');_0x3f8b2c=_0x3c64e2?.['outerHTML']||'';}return _0x3f8b2c;};}['_findMarkerElement'](_0x2db3ca,_0xf23c2e=0x5){let _0x58a6ce=_0x2db3ca,_0x4a0fda=null;for(let _0x941964=0x0;_0x941964<_0xf23c2e&&_0x58a6ce;_0x941964++){if(!_0x58a6ce['className']){_0x58a6ce=_0x58a6ce['parentElement'];continue;}if(!(''+_0x58a6ce['className'])['includes']('ck-ai_review-marker_')){_0x58a6ce=_0x58a6ce['parentElement'];continue;}if(!_0x58a6ce['getAttribute']('data-marker-id'))break;_0x4a0fda=_0x58a6ce;break;}return _0x4a0fda;}['_findMarkerElementById'](_0x3f5cd0){const _0x1b3448=T(this['context']),_0x1b5ca7=_0x1b3448['model']['markers']['get'](_0x3f5cd0);return _0x1b5ca7?_0x2c5ad7(_0x1b3448['editing'],_0x1b5ca7):null;}['_getMarkersDataForGroup'](_0x4ba31c){return Array['from'](this['_markers']['values']())['filter'](_0x8b25f=>_0x8b25f['groupId']===_0x4ba31c);}['_getOperationStart'](_0x1c1527){return'insert'===_0x1c1527['type']?_0x1c1527['position']:_0x1c1527['newRange']['start'];}['_getOperationEnd'](_0x1d2fbd,_0x568361=!0x1){return'insert'===_0x1d2fbd['type']?_0x568361?_0x1d2fbd['position']:_0x1d2fbd['position']['getShiftedBy'](_0x1d2fbd['howMany']):_0x1d2fbd['newRange']['end'];}['_shiftOperation'](_0x56c731,_0x52969f){return'insert'===_0x56c731['type']?_0x56c731['position']=_0x56c731['position']['getShiftedBy'](_0x52969f):'marker'===_0x56c731['type']&&_0x56c731['newRange']&&(_0x56c731['newRange']=new it(_0x56c731['newRange']['start']['getShiftedBy'](_0x52969f),_0x56c731['newRange']['end']['getShiftedBy'](_0x52969f))),_0x56c731;}['_changeOperationOwnerDocument'](_0x40f037,_0x1f9808){'insert'===_0x40f037['type']?_0x40f037['position']=this['_changePositionOwnerDocument'](_0x40f037['position'],_0x1f9808):'marker'===_0x40f037['type']&&_0x40f037['newRange']&&(_0x40f037['newRange']=this['_changeRangeOwnerDocument'](_0x40f037['newRange'],_0x1f9808));}['_changePositionOwnerDocument'](_0x15248e,_0xeb73fa){return new st(_0xeb73fa,_0x15248e['path']);}['_changeRangeOwnerDocument'](_0x4d56c3,_0x1c6a2e){return new it(this['_changePositionOwnerDocument'](_0x4d56c3['start'],_0x1c6a2e),this['_changePositionOwnerDocument'](_0x4d56c3['end'],_0x1c6a2e));}['_changePosition'](_0x35d0b1,_0x225f0f){return new st(_0x225f0f,[..._0x35d0b1]);}['_changeRange'](_0x24db37,_0x5a574e,_0x1f4dd1,_0x5efdc3){return new it(this['_changePosition'](_0x5a574e,_0x5efdc3),this['_changePosition'](_0x1f4dd1,_0x5efdc3));}['_sortMarkers'](_0x406a42){const _0x4b661c=_0x1e9f2a=>{switch(_0x1e9f2a){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x406a42['sort']((_0x5ef6f9,_0x1d4f99)=>_0x4b661c(_0x5ef6f9['type'])-_0x4b661c(_0x1d4f99['type']));}['_hasSameTopLevelElement'](_0xa0d78d,_0xa7e5c6){const _0x473dbc=_0xa0d78d['getChild'](0x0),_0x1642ec=_0xa7e5c6['getChild'](0x0);return!(!_0x473dbc||!_0x1642ec)&&((!_0x473dbc['is']('element')||!_0x1642ec['is']('element')||_0x473dbc['name']===_0x1642ec['name'])&&!(_0x473dbc['is']('element')&&!_0x1642ec['is']('element')||!_0x473dbc['is']('element')&&_0x1642ec['is']('element')));}['_haveSingleTopLevelElement'](_0x5046be){return 0x1===_0x5046be['childCount'];}['_haveOnlyInlineContent'](_0x40cc23,_0x2f05c0){for(const _0x138157 of _0x40cc23['getChildren']())if(_0x138157['is']('element')&&!_0x2f05c0['isInline'](_0x138157))return!0x1;return!0x0;}['_upsertDataId'](_0x487ce0,_0xdf19c0){let _0x464199=_0x487ce0['getAttribute'](Ct);return _0x464199||(_0x464199=_0xdf19c0(),_0x487ce0['_setAttribute'](Ct,_0x464199)),_0x464199;}}class Zs extends _0x5d9d11(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x391cc2,contentNew:_0x57ef6a,contentInitial:_0x1cf81f,documentVersion:_0xa4cb13}){super(),this['id']=_0x391cc2,this['contentNew']=_0x57ef6a,this['contentInitial']=_0x1cf81f,this['documentVersion']=_0xa4cb13;}}class th extends ts(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x4b862f,_0x4e86fb,_0x4aec03){super(),this['id']=_0x4b862f,this['parent']=_0x4aec03,this['_data']=_0x4e86fb,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']=_0x4689d1();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x32e9ad,_0xcf1f66,_0x1e793f,_0x380b2c,_0x585d65){super(),this['_sourceCheck']=_0xcf1f66,this['_documentData']=_0x32e9ad,this['_aiConnector']=_0x1e793f,this['_reviewParams']=_0x380b2c,this['_reviewArgs']=_0x585d65,this['on']('change:status',(_0x35c0c1,_0x336892,_0x184aff)=>{'aborted'==_0x184aff&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x184aff,'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'](_0x5b1d91=>'pending'===_0x5b1d91['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x394f44){this['_documentData']=_0x394f44;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x38a287=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x96341a of _0x38a287)'unmodified'!==_0x96341a['data']['operation']&&('error'!==_0x96341a['data']['operation']?'review-metadata'!==_0x96341a['event']?this['_addReviewCheckResult'](_0x96341a['data']['dataId'],_0x96341a['data']['textDelta']):this['callId']=_0x96341a['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(_0x205825){this['_currentError']=_0x205825,_0x205825 instanceof Error&&_0x205825['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'](_0x34b3a1,_0x461084){const _0x33b7af=this['_results']['get'](_0x34b3a1);if(!_0x33b7af)return;if(0x0===_0x461084['length'])return;const _0x4e1893=[];_0x461084['forEach']((_0x4acc80,_0x49766f)=>{const _0x48b288=new th(_0x33b7af['id']+'-'+_0x49766f,_0x4acc80,_0x33b7af);_0x48b288['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x48b288,'status':_0x48b288['status']});}),_0x48b288['on']('change:isActivated',()=>{_0x48b288['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x48b288}):this['fire']('reviewCheckResultDeactivated',{'change':_0x48b288});}),this['_changes']['push'](_0x48b288),_0x4e1893['push'](_0x48b288);}),this['fire']('reviewCheckResultReady',{'changes':_0x4e1893,'result':_0x33b7af,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x4a35d3){const _0x457804=this['_changes']['find'](_0x7beb5b=>_0x7beb5b['id']===_0x4a35d3);return!(!_0x457804||'pending'!==_0x457804['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x2d7a77=>!0x0===_0x2d7a77['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x2f69cd=>'pending'===_0x2f69cd['status']);}['getChangeById'](_0x4e3c64){return this['_changes']['find'](_0x27d591=>_0x27d591['id']===_0x4e3c64);}['markAllChangesAsAccepted'](){for(const _0x767299 of this['_changes'])'pending'===_0x767299['status']&&(_0x767299['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x4c3ba9){const _0x5d4187=this['_changes']['find'](_0x24553f=>_0x24553f['id']===_0x4c3ba9);_0x5d4187&&'pending'===_0x5d4187['status']&&(_0x5d4187['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x1ddc40){const _0xffff00=this['_changes']['find'](_0x9e9f4d=>_0x9e9f4d['id']===_0x1ddc40);_0xffff00&&'pending'===_0xffff00['status']&&(_0xffff00['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x3d29e2){const _0x53d698=this['_changes']['find'](_0x366e60=>_0x366e60['id']===_0x3d29e2);_0x53d698&&'pending'===_0x53d698['status']&&(_0x53d698['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x4da0f1){const _0x4174ab=this['_changes']['find'](_0x9f3086=>_0x9f3086['id']===_0x4da0f1);_0x4174ab&&'outdated'===_0x4174ab['status']&&(_0x4174ab['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x8a5ed8){this['_changes']['filter'](_0x2dc53d=>_0x2dc53d['isActivated']&&_0x2dc53d['id']!==_0x8a5ed8)['forEach'](_0x4daf42=>{_0x4daf42['isActivated']=!0x1;});const _0x2d5ae5=this['_changes']['find'](_0x1d613a=>_0x1d613a['id']===_0x8a5ed8);_0x2d5ae5&&'pending'===_0x2d5ae5['status']&&(_0x2d5ae5['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x21e08d=>_0x21e08d['isActivated'])['forEach'](_0x5c34b0=>{_0x5c34b0['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x2a1de2){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x5bfea7;if(_0x2a1de2){const _0x533fc6=this['_changes']['find'](_0x20e368=>_0x20e368['id']===_0x2a1de2);if(_0x533fc6&&_0x533fc6['isRated'])return;_0x533fc6&&(_0x5bfea7=_0x533fc6['parent']['id'],_0x533fc6['isRated']=!0x0);}const _0x58d27a={'positiveCount':this['_changes']['filter'](_0x134652=>'accepted'===_0x134652['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x58d27a,this['callId'],_0x5bfea7);}['_addReviewCheckResult'](_0x2313be,_0x3008af){const _0x3060eb=this['_documentData']['elements']['get'](_0x2313be);if(!_0x3060eb)return;const _0x5b8da7=_0x3060eb['getContent']();if(_0x5b8da7===_0x3008af)return;const _0x24f0a4=new Zs({'id':_0x2313be,'contentInitial':_0x5b8da7,'contentNew':_0x3008af,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x24f0a4['id'],_0x24f0a4),this['fire']('reviewCheckResultAdded',{'result':_0x24f0a4,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x1a607e=>'pending'===_0x1a607e['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x200d49=>'pending'===_0x200d49['status'])['length']&&(this['status']='finished'));}}class si extends eh{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x59cd6f=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x81d4e3=0x0;_0x81d4e3<this['_reviewParams']['length'];_0x81d4e3++){if(!this['_reviewParams'][_0x81d4e3]||!this['_sourceCheck']['options'][_0x81d4e3])continue;const _0x2674fb=this['_sourceCheck']['options'][_0x81d4e3],_0x403155=_0x2674fb['data']?.['find'](_0xd6c7f=>_0xd6c7f['id']===this['_reviewParams'][_0x81d4e3]);_0x403155&&_0x59cd6f['push'](_0x403155['label']);}return _0x59cd6f['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x3204b0,_0x4c01a7,_0x31ebbc){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x4c01a7,_0x3204b0,_0x31ebbc);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class ve extends _0x2536b2{['_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(_0x3df423,_0x213da8)=>{const _0x36f1bb=this['_aiReviewCheckList']['getCheckById'](_0x213da8['id']);if(_0x36f1bb){this['_onReviewCheckRun'](_0x213da8),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x213da8,_0x36f1bb),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x38c2c7,_0x402c41)=>{switch(_0x402c41['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x402c41);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 _0x70c77e('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new _0x70c77e('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'!==_0x402c41['status']&&'error-chunk'!==_0x402c41['status']&&'error-general'!==_0x402c41['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x388588,_0x363ca8)=>{if(!this['_currentReviewCheckRun'])throw new _0x70c77e('ai-review-mode-no-current-check-run',this);const _0x4e3c25=this['_diffContent'](_0x363ca8['result']['contentInitial'],_0x363ca8['result']['contentNew']);_0x363ca8['source']['addResultChanges'](_0x363ca8['result']['id'],_0x4e3c25);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x1bf5ca,_0x596248)=>{for(const _0x54b360 of _0x596248['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x54b360);this['_markChangePositionInEditorContent'](_0x596248['changes'],_0x596248['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x5e9178,_0x2b4f75)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x2b4f75['change']['id'],_0x2b4f75['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x46cb2f,_0x4b966e)=>{this['_onReviewCheckResultActivated'](_0x4b966e);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x152c14){_0x152c14 instanceof Error&&_0x152c14['message']['includes']('ai-request-aborted')||(_0x152c14 instanceof _0x70c77e?this['_logError'](_0x152c14):this['_logError'](new _0x70c77e('ai-review-mode-check-run-failed',this,void 0x0,_0x152c14)));}}else this['_logError'](new _0x70c77e('ai-review-mode-source-check-not-found',this,{'checkId':_0x213da8['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 _0x5919b1=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x5919b1['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x5919b1['map'](_0x108259=>_0x108259['id']));const _0x3c8111=this['_currentReviewCheckRun'];_0x3c8111['markAllChangesAsAccepted'](),_0x3c8111['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x826129,_0x1f1fd2)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x1f1fd2['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x1f1fd2['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x1f1fd2['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x1f1fd2['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0xd92bd,_0x5404fb)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x5404fb['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x5404fb['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x5404fb['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x5404fb['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',(_0x3ca942,_0x555fd5)=>{this['_onActivateChange'](_0x555fd5);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0xdf9975,_0x3a42de)=>{this['_onDeactivateChange'](_0x3a42de);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x44df66,_0xa4c989)=>{this['_onChangeMarkerClicked'](_0x44df66,_0xa4c989);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x1329c1,_0x34e95e)=>{this['_onChangeMarkerHovered'](_0x1329c1,_0x34e95e);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x4079ad,_0x3d81a8)=>{this['_onChangeMarkerRemoved'](_0x4079ad,_0x3d81a8);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x19834f,_0x208073)=>{this['_onChangeMarkerRestored'](_0x19834f,_0x208073);});}['_createReviewCheckRun'](_0xca43da,_0x4c18d6){return new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0x4c18d6,this['_aiConnector'],_0xca43da['params'],_0xca43da['args']);}['_onChangeMarkerRemoved'](_0x7c066f,_0x3bb2a0){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x3bb2a0['changeId']);}['_onChangeMarkerRestored'](_0x64fef4,_0xc6b1cb){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0xc6b1cb['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x29d5df=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x29d5df&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x2ae247=this['_aiReviewCoreEditing']['getEditor']();_0x2ae247&&_0x2ae247['editing']['view']['change'](_0x1dd164=>{const _0x3054e2=_0x2ae247['editing']['view']['document']['getRoot']();_0x1dd164['removeClass']('ck-ai_review-diff',_0x3054e2),_0x1dd164['removeClass']('ck-ai_review-highlights',_0x3054e2),_0x1dd164['removeClass']('ck-ai-translate-mode-content',_0x3054e2);});}['_getTranslationWithDefault'](_0x4713e2,_0x305402){const _0x296e6a=i(this['context']['locale'],_0x4713e2);return _0x296e6a===_0x4713e2?_0x305402:_0x296e6a;}['_logError'](_0x17b182,_0x4054c8=!0x1){gt(_0x17b182['message']),_0x4054c8||(_0x17b182['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x1c658e){if('content'===this['_changeActivationSource']){const _0x4ce184=this['_aiReviewCoreUi']['getChangeElement'](_0x1c658e);_0x4ce184&&_0x3facc1(_0x4ce184['closest']('.ck-ai_review__check-run-result')||_0x4ce184);}else{if('panel'===this['_changeActivationSource']){const _0x564257=this['_getChangeContentElement'](_0x1c658e);if(!_0x564257)return;_0x29d957({'target':_0x564257,'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(_0xf2488e){this['id']=_0xf2488e['id'],this['commandId']=_0xf2488e['commandId'],this['title']=_0xf2488e['title'],this['description']=_0xf2488e['description'],this['isParameterized']=_0xf2488e['isParameterized'],this['useArgs']=_0xf2488e['useArgs'],this['options']=_0xf2488e['options'],this['args']=_0xf2488e['args'];}}class vo extends ts(){['_checks']=[];['setupChecks'](_0x13c266){this['_checks']=_0x13c266['map'](_0x38f356=>new Ys(_0x38f356));}get['checks'](){return this['_checks'];}['getCheckById'](_0x421239){return this['checks']['find'](_0x5dc745=>_0x5dc745['id']===_0x421239);}['removeCheckById'](_0x157f6){this['_checks']=this['_checks']['filter'](_0x55cbe0=>_0x55cbe0['id']!==_0x157f6);}}class ke extends Ys{['_models']=[];['_defaultModel']=null;constructor(_0x6f11c6,_0x1ca2ef,_0x52b9ef){super(_0x6f11c6),this['_models']=_0x1ca2ef,this['_defaultModel']=_0x52b9ef;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class Ie extends Ys{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x12c9a6,_0x5c580e,_0xcc6aba){super(_0x12c9a6),this['prompt']=_0x12c9a6['prompt'],this['model']=_0x12c9a6['model'],this['model']?this['_defaultModel']=_0x5c580e['find'](_0x3c2b6c=>_0x3c2b6c['id']===this['model'])||null:this['_defaultModel']=_0xcc6aba;}get['defaultModel'](){return this['_defaultModel'];}}class _e extends vo{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x4f07f0,_0x33c490,_0x98c8ad){super(),this['_allModels']=_0x4f07f0,this['_recommendedModels']=_0x33c490,this['_defaultModel']=_0x98c8ad;}['setupChecks'](_0xac6706){this['_checks']=_0xac6706['map'](_0x377117=>!0x0===_0x377117['isExtra']?new Ie(_0x377117,this['_allModels'],this['_defaultModel']):'custom'===_0x377117['id']?new ke(_0x377117,this['_recommendedModels'],this['_defaultModel']):new Ys(_0x377117));}}class Ce extends eh{['_prompt'];['_model'];constructor(_0x56f578,_0x48c250,_0x18e596,_0x320342,_0x3916e2){super(_0x18e596,_0x320342,_0x3916e2),this['_prompt']=_0x56f578,this['_model']=_0x48c250;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x1e8246,_0xab5e0c,_0x282c4f){return this['_aiConnector']['upsertCustomAIReviewRating'](_0xab5e0c,_0x1e8246,_0x282c4f);}}class Re extends Ce{get['subTitle'](){return'';}set['prompt'](_0x352d29){this['_prompt']=_0x352d29;}set['model'](_0x8d44ed){this['_model']=_0x8d44ed;}}class pe extends ve{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x484a8c){super(_0x484a8c),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',we['map'](_0x47e431=>_0x47e431['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x4c194a,_0x2f37f3)=>{this['_isDiffOn']=_0x2f37f3['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x2d174c,_0x29c41e){return _0x2d174c['isCustom']?new Ce(_0x2d174c['args']['prompt'],_0x2d174c['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x29c41e,this['_aiConnector']):_0x29c41e['isExtra']?new Re(_0x29c41e['prompt'],_0x29c41e['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x29c41e,this['_aiConnector']):new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0x29c41e,this['_aiConnector'],_0x2d174c['params'],_0x2d174c['args']);}['_onReviewCheckResultActivated'](_0x5b49e6){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x5b49e6['change']['id']),this['_scrollToChange'](_0x5b49e6['change']['id']);const _0x29a7d0=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x5b49e6['change']['id']);if(!_0x29a7d0)return;const _0x5f5024=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x5b49e6['change'],()=>_0x29a7d0['getElement'](),void 0x0,'click',_0x5f5024?.['editing']?.['view']?.['getDomRoot'](),_0x5f5024?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x5b49e6['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x42e8a9){this['_currentReviewCheckRun']&&'click'===_0x42e8a9['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x42e8a9['id']));}['_onDeactivateChange'](_0x218367){this['_currentReviewCheckRun']&&'balloon'===_0x218367['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x2f152c,_0x4056e0){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x4056e0['changeId']);const _0x33d7dd=this['_currentReviewCheckRun']['getChangeById'](_0x4056e0['changeId']);if(!_0x33d7dd)return;const _0x1c8545=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x33d7dd,_0x4056e0['markerElement'],_0x4056e0['domEvent'],'click',_0x1c8545?.['editing']?.['view']?.['getDomRoot'](),_0x1c8545?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x463caf,_0x12d460){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x49ec4a=this['_currentReviewCheckRun']['getChangeById'](_0x12d460['changeId']);if(!_0x49ec4a)return;const _0x75cfff=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x49ec4a,_0x12d460['markerElement'],_0x12d460['domEvent'],'hover',_0x75cfff?.['editing']?.['view']?.['getDomRoot'](),_0x75cfff?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x1eec57){const _0x560946=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x1eec57);return _0x560946?_0x560946['getElement']():null;}['_markChangePositionInEditorContent'](_0x46c2ce,_0x125c15){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x46c2ce,_0x125c15);}['_diffContent'](_0x7fca76,_0x331591){return this['_aiReviewCoreEditing']['diffContent'](_0x7fca76,_0x331591);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x3c1919){const _0x254158=this['_aiReviewCoreEditing']['getEditor']();_0x3c1919?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x254158&&_0x254158['editing']['view']['change'](_0x4f7b25=>{const _0x2695fd=_0x254158['editing']['view']['document']['getRoot']();for(const _0x3b710a of _0x2695fd['getClassNames']())_0x3b710a['startsWith']('ck-ai_review-')&&_0x4f7b25['removeClass'](_0x3b710a,_0x2695fd);_0x4f7b25['addClass'](_0x3c1919?'ck-ai_review-diff':'ck-ai_review-highlights',_0x2695fd);});}async['_getChecksList'](){const _0x17d352=[...we,...this['_getExtraChecks']()],_0x337aee=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x337aee,_0x17d352);let _0x1f8d59=_0x17d352;this['_hasDefaultAvailableCommands']||(_0x1f8d59=_0x337aee['map'](_0x328205=>_0x17d352['find'](_0xd32d86=>_0xd32d86['id']===_0x328205))['filter'](_0x4e04cd=>!!_0x4e04cd)),_0x1f8d59=_0x1f8d59['map'](_0x1e3b82=>_0x1e3b82['isExtra']?_0x1e3b82:this['_translateReviewCheck'](_0x1e3b82));const _0x572ee0=_0x1f8d59['some'](_0xdb62c3=>_0xdb62c3['isExtra']||'custom'===_0xdb62c3['id']);let _0x54abe9=[],_0x2642e3=[],_0x57de39=null;if(_0x572ee0){const _0x32221c=await this['_getModels']();_0x54abe9=_0x32221c['all'],_0x2642e3=_0x32221c['recommended'],_0x57de39=_0x32221c['default'];}const _0x378746=new _e(_0x54abe9,_0x2642e3,_0x57de39);return _0x378746['setupChecks'](_0x1f8d59),_0x572ee0&&this['_filterChecksWithMissingModel'](_0x378746),_0x378746;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x3beae1=>({'id':_0x3beae1['id'],'commandId':_0x3beae1['id'],'title':_0x3beae1['label'],'description':_0x3beae1['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x3beae1['prompt'],'model':_0x3beae1['model']}));}['_logErrorForNonExistentChecks'](_0x634c41,_0x100a20){const _0x28c63f=_0x634c41['filter'](_0x3722ae=>!_0x100a20['some'](_0x891d13=>_0x891d13['id']===_0x3722ae));_0x28c63f['length']&&this['_logError'](new _0x70c77e('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x28c63f['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x4a0277=new It({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x4a0277['getAll'](),'recommended':await _0x4a0277['getAvailableModels'](),'default':await _0x4a0277['getDefault']()};}catch(_0x109320){return this['_logError'](new _0x70c77e('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x109320)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x2919b5){const _0x45e392='AI_REVIEW_CHECK_'+_0x2919b5['id']['toUpperCase']()['replaceAll']('-','_'),_0x1e689c={..._0x2919b5,'title':this['_getTranslationWithDefault'](_0x45e392+'_TITLE',_0x2919b5['title']),'description':this['_getTranslationWithDefault'](_0x45e392+'_DESCRIPTION',_0x2919b5['description'])};return _0x2919b5['options']&&(_0x1e689c['options']=_0x2919b5['options']['map'](_0x2c8dde=>({..._0x2c8dde,'label':this['_getTranslationWithDefault'](_0x45e392+'_OPTIONS_LABEL',_0x2c8dde['label']||''),'data':_0x2c8dde['data']?_0x2c8dde['data']['map'](_0x438fd3=>({..._0x438fd3,'label':this['_getTranslationWithDefault'](_0x45e392+'_OPTIONS_DATA_'+_0x438fd3['id']['toUpperCase'](),_0x438fd3['label'])})):void 0x0}))),_0x1e689c;}['_filterChecksWithMissingModel'](_0x337059){const _0x56ea3f=[];_0x337059['checks']['forEach'](_0x2bec44=>{(_0x2bec44 instanceof Ie&&!_0x2bec44['defaultModel']||_0x2bec44 instanceof ke&&!_0x2bec44['models']['length'])&&_0x56ea3f['push'](_0x2bec44['id']);}),_0x56ea3f['length']&&_0x56ea3f['forEach'](_0xb2f188=>{_0x337059['removeCheckById'](_0xb2f188),this['_logError'](new _0x70c77e('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0xb2f188}),!0x0);});}}class Ka extends _0x2536b2{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'](_0x11b90e){this['_checks']=_0x11b90e['map'](_0x4b7522=>new jr(_0x4b7522));}}class Se extends si{['_title'];constructor(_0x249998,_0x1070b8,_0x4a7626,_0x5e0e51,_0x1510be,_0x5bd1eb){super(_0x249998,_0x1070b8,_0x4a7626,_0x1510be,_0x5bd1eb),this['_title']=_0x5e0e51;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class rr extends ve{static get['pluginName'](){return'AITranslateController';}constructor(_0xe0b23d){super(_0xe0b23d),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'](_0x33f7d6,_0x32a21c){return new Se(this['_aiReviewCoreEditing']['getDocumentData'](),_0x32a21c,this['_aiConnector'],i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x33f7d6['params'],_0x33f7d6['args']);}['_onReviewCheckResultActivated'](_0x34c832){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x34c832['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x34c832['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x54ad83){this['_currentReviewCheckRun']&&('hover'===_0x54ad83['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x54ad83['id'])),'click'===_0x54ad83['uiInteraction']&&this['_scrollToChange'](_0x54ad83['id']));}['_onDeactivateChange'](_0xd302ab){this['_currentReviewCheckRun']&&'panel'===_0xd302ab['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x1df30b,_0x5e2c36){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x5e2c36['changeId']),this['_scrollToChange'](_0x5e2c36['changeId']));}['_onChangeMarkerHovered'](_0x504ff8,_0x10d683){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x10d683['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x10d683['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x45990a){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x45990a);}['_markChangePositionInEditorContent'](_0x430db0,_0xa687ad){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x430db0,_0xa687ad);}['_diffContent'](_0x45ada1,_0x39f96e){return this['_aiReviewCoreEditing']['diffContent'](_0x45ada1,_0x39f96e,!0x0);}['_onReviewCheckRun'](){const _0x414c0f=this['_aiReviewCoreEditing']['getEditor']();_0x414c0f&&_0x414c0f['editing']['view']['change'](_0xfba448=>{const _0xf0e1ca=_0x414c0f['editing']['view']['document']['getRoot']();for(const _0x15cd94 of _0xf0e1ca['getClassNames']())(_0x15cd94['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x15cd94)&&_0xfba448['removeClass'](_0x15cd94,_0xf0e1ca);_0xfba448['addClass']('ck-ai-translate-mode-content',_0xf0e1ca);});}async['_getChecksList'](){const _0x384b5b=[],_0x21a98e=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x2db1b2 of _0x21a98e)_0x384b5b['push']({'title':_0x2db1b2['label'],'id':_0x2db1b2['id'],'commandId':_0x2db1b2['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x2db1b2['id']}});const _0x3c9315=new Pe();return _0x3c9315['setupChecks'](this['_translateChecks'](_0x384b5b)),_0x3c9315;}['_translateChecks'](_0x3472de){return _0x3472de['map'](_0x2483a3=>{const _0x39067d='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x2483a3['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x2483a3,'title':this['_getTranslationWithDefault'](_0x39067d,_0x2483a3['title'])};});}}class Le extends Ve{constructor(_0x3d5bfd,_0x679976){super(_0x3d5bfd,_0x679976),this['on']('set:isLoading',(_0x306a18,_0x1ed86c,_0x30082a)=>{_0x30082a&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x4da67a,_0x2b8823,_0x3e9d48)=>{_0x3e9d48&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x1f4040=super['_createAcceptAllButtonView']();return _0x1f4040['set']('label',i(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x1f4040;}['_createExitReviewButtonView'](){const _0x4fa6bd=super['_createExitReviewButtonView']();return _0x4fa6bd['set']('label',i(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x4fa6bd;}}class Ne extends je{['_setupTemplate'](){const _0x1074cb=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x1074cb['if']('isVisible','ck-hidden',_0x2e7c86=>!_0x2e7c86)]},'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',_0x1074cb['if']('isVisible','ck-hidden',_0x371861=>!_0x371861)]},'children':this['_checkViews']}]});}}class tr extends Me{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x53b737=this['context']['locale'],_0x12da25=new _0x3571c0(_0x53b737,{'label':i(_0x53b737,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x4469ec,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x2c2b22=new Ae(_0x53b737,{'header':_0x12da25,'list':new Ne(_0x53b737),'results':new Le(_0x53b737,{'generalErrorText':i(_0x53b737,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0x53b737,{'headerText':i(_0x53b737,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':i(_0x53b737,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x53b737,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x2c2b22['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x2c2b22;}['registerTab'](){const _0x51d298=this['context']['plugins']['get']('AITabs');_0x51d298['view']['on']('activateTab',(_0x375317,_0x1b47ac)=>{'translate'===_0x1b47ac?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x51d298['view']['addTab']({'id':'translate','buttonLabel':i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x4469ec,'order':0x0,'content':this['_mainView']});}}class Wa extends _0x2536b2{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};
|
|
23
|
+
import{Plugin as _0x5adfee,Command as At,ContextPlugin as _0x37abb2,Editor as _0x5a6451}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x3d8ab5,IconCheck as _0x1dd94c,IconError as _0x5325ee,IconSubmit as _0x13c99b,IconAIHistory as ot,IconMagicWand as _0x342837,IconRobotPencil as ti,IconMaximize as _0x2b97b8,IconMinimize as _0x3bc269,IconShowChangesOn as _0x455aeb,IconShowChangesOff as _0x3da748,IconDocument as _0x2040cd,IconBoxWithCross as _0x1e0042,IconBoxWithCheck as _0x45fb55,IconBoxWithMarker as _0x44249d,IconInfo as tc,IconLoupe as _0x31f317,IconCancel as _0x3b3d8d,IconStop as _0x30c4f4,IconAIChat as tt,IconPlus as _0xa967bf,IconPin as _0x44d873,IconThreeHorizontalDots as _0x21a59b,IconChevronDown as _0x222cc5,IconChevronUp as _0x68c9f1,IconOutdated as _0x35296c,IconEye as _0x1ef78b,IconEyeCrossedOut as _0x4d2895,IconChevronRight as _0x1ee0fb,IconAIReview as _0x3867f9,IconAITranslate as _0x1dbdc4}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x3e4e8c,CKEditorError as _0x1500e8,ObservableMixin as Vt,global as _0x3537fe,isVisible as _0x48958f,Rect as _0x34633d,Collection as _0x53af97,FocusTracker as ts,KeystrokeHandler as _0x356454,first as _0x33a8c,toArray as _0x503037,EmitterMixin as Ft,logWarning as Zt,logError as _0x4dee23,scrollViewportToShowTarget as _0x54e791,scrollAncestorsToShowTarget as _0x917d7b,ResizeObserver as _0x1a199c,_isMotionReduced as _0x6e294d,getConstrainedViewportRect as _0x2a7169,DomEmitterMixin as Rt}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x1b7f91,ButtonView as _0x3fc85a,View as _0x538d57,SpinnerView as _0x29d2d8,IconView as _0x1a5580,AutocompleteView as _0x6213f1,ListView as _0x1b0a54,ListItemGroupView as _0x1728c0,ListItemView as _0x5749b5,ButtonLabelView as _0x3ffbe5,FocusCycler as _0x19c87e,createLabeledTextarea as _0x550e60,Dialog as _0xc82d75,createDropdown as _0x238494,addMenuToDropdown as _0x30ebf6,MenuBarMenuView as _0x3c114,MenuBarMenuListItemButtonView as _0x58fafd,DialogViewPosition as _0x5e4c8a,MenuBarMenuListView as _0x3301ef,MenuBarMenuListItemView as _0x4dbed9,BodyCollection as _0x4b2ab0,BalloonPanelView as _0x51e059,clickOutsideHandler as _0x23d932,addListToDropdown as _0x57d60a,UIModel as _0x584377,submitHandler as _0x2d4a6e,LabeledFieldView as _0x449567,createLabeledInputText as _0x279926,FormHeaderView as _0x2c8dbc,HighlightedTextView as _0xe11984,ViewCollection as _0x4f2c93,FileDialogButtonView as _0x4b66f3,InputTextView as _0x1cab27,SearchTextView as _0x8635d1,ListItemButtonView as _0xa6313b,ButtonLabelWithHighlightView as _0x1eaeda,DropdownMenuPanelPositioningFunctions as _0x1a2e34,BalloonToolbar as Et,FormRowView as _0x553dac,TextareaView as _0x170ffb}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as nt,ClipboardMarkersUtils as _0x524068}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as ct,ViewDataTransfer as ut,ViewUpcastWriter as _0x3be1ca,Matcher as _0xf012f3,_DetachOperation as _0x34bf3b,_insertIntoModelNodeList as _0xdd4fe8,_removeFromModelNodeList as to,ModelRange as _0x1f26a0,transformOperationSets as _0x104b8e,ViewDowncastWriter as ft,ModelDocumentFragment as _0x27a70e,ModelPosition as _0x128f8a,ModelTreeWalker as Dt,MarkerOperation as Mt,InsertOperation as $t}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x4e5df5,escape as Wt,escapeRegExp as _0x32442b,debounce as Ht}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x978f5f,InvokeModelWithResponseStreamCommand as _0x438d78,InvokeModelCommand as _0x31c8cb}from'@aws-sdk/client-bedrock-runtime';import{createParser as gt}from'eventsource-parser';import{parseDocument as _0x13b8bc}from'htmlparser2';import{isTag as _0x32b8a9,findOne as _0x32e3c1,getParent as _0x11e924,findAll as _0x51c105,removeElement as _0x7119c8,replaceElement as _0x3d5dcc,prepend as _0x4512fa,prependChild as _0x56829d,appendChild as _0x56184d,append as _0x4dcf7a,find as _0x83201e,isComment as _0x10a170,getChildren as _0x5ecbbf,textContent as _0x4fc42c}from'domutils';import _0x2aee41 from'dom-serializer';import{Document as _0x175d6b,Element as _0x309db4,Text as _0x28e1e3,cloneNode as _0x257863,isDocument as _0x5de66b,isText as _0x211c5d,NodeWithChildren as _0x5329aa}from'domhandler';import{MarkdownGfmMdToHtml as _0x7213b8}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0xf97f88,DocumentCompare as _0x4f58a6,DATA_ID_MODEL_ATTRIBUTE as _0x1707b9,ConfirmMixin as _0x531f3e,LateFocusDropdownButtonView as _0x117d83,getAllMarkersDomElementsSorted as _0x589705,SuggestionsConversion as jt,DATA_ID_VIEW_ATTRIBUTE as Bt,getMarkerDomElement as Gt}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x4879b0}from'es-toolkit';import _0x1cf580 from'morphdom';import{IconWeb as _0x1904ed,IconClose as _0x223b2d,IconDocument as _0x59e6a4,IconSelection as _0x33062f,IconFileUpload as _0x2f42c6,IconLink as _0x1afd05,IconBulb as _0x2190ec,IconAI as _0x235661,IconPreviousArrow as _0x41367a,IconCheck as _0x28d1ec,IconDocumentOutline as _0x40ab64,IconPaperClip as _0x2509b0,IconBrowseFiles as _0x5ec29a,IconDropdownArrow as _0x41c19f,IconAIChat as _0x50a176,IconAIReview as _0xbfad04,IconAITranslate as St,IconAIAskAI as _0x2cc560,IconThumbUp as _0x235fb2,IconThumbDown as _0x176db2,IconCopy as _0x404dc2,IconShowChangesOff as _0x2b23b3,IconShowChangesOn as _0x5ce6ec,IconAIQuickActions as _0x5d0a10,IconAIChatCommands as Tt,IconAIImproveWriting as Ct,IconAIContinueWriting as kt,IconAIGrammarCheck as Nt,IconAIAdjustLength as yt,IconAIChangeTone as _t,IconAIOther as Qt,IconRefresh as _0x49b8b4,IconNextArrow as _0x5695ec}from'@ckeditor/ckeditor5-icons/dist/index.js';import{diffArrays as _0x3682e4}from'diff';const li='_ungrouppedCommands';function ne(_0x4b6b82,_0x3c8530){const _0x31573b=(0x0,_0x3c8530['t'])('Other');return _0x4b6b82['length']?'groupId'in _0x4b6b82[0x0]?_0x4b6b82:[{'groupId':li,'groupLabel':_0x31573b,'order':0x1/0x0,'commands':_0x4b6b82}]:[{'groupId':li,'groupLabel':_0x31573b,'order':0x1/0x0,'commands':[]}];}const Wn=globalThis['DataTransfer'],wt='ai-ui';class te extends _0x5adfee{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x1fed07}=this,_0xb8d286=['ck-fake-ai-selection'];_0x1fed07['config']['get']('ai.assistant.useTheme')&&_0xb8d286['push']('ck-ai-assistant-ui_theme'),_0x1fed07['conversion']['for']('editingDowncast')['markerToHighlight']({'model':wt,'view':{'classes':_0xb8d286,'priority':0xc}}),_0x1fed07['conversion']['for']('editingDowncast')['markerToElement']({'model':wt,'view':(_0x291bf0,{writer:_0x2803ec})=>{if(!_0x291bf0['markerRange']['isCollapsed'])return null;const _0x2fb50c=_0x2803ec['createUIElement']('span');return _0x2803ec['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x2fb50c),_0x2fb50c;}});}['afterInit'](){!async function(_0x1a7896){const _0x1f9430=_0x3b8704([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]),_0x4f6e03=0x3dffc4e1,_0x3357e4=0x3df840e9^_0x4f6e03,_0x4432aa=window[_0x3b8704([0x44,0x61,0x74,0x65])][_0x3b8704([0x6e,0x6f,0x77])](),_0x1efcfe=_0x1a7896[_0x3b8704([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x478239=new window[(_0x3b8704([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x27f86d=>{_0x1efcfe[_0x3b8704([0x6f,0x6e,0x63,0x65])](_0x3b8704([0x72,0x65,0x61,0x64,0x79]),_0x27f86d);}),_0x45d371={[_0x3b8704([0x6b,0x74,0x79])]:_0x3b8704([0x45,0x43]),[_0x3b8704([0x75,0x73,0x65])]:_0x3b8704([0x73,0x69,0x67]),[_0x3b8704([0x63,0x72,0x76])]:_0x3b8704([0x50,0x2d,0x32,0x35,0x36]),[_0x3b8704([0x78])]:_0x3b8704([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]),[_0x3b8704([0x79])]:_0x3b8704([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]),[_0x3b8704([0x61,0x6c,0x67])]:_0x3b8704([0x45,0x53,0x32,0x35,0x36])},_0x234798=_0x1efcfe[_0x3b8704([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x3b8704([0x67,0x65,0x74])](_0x3b8704([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x5b59c7(){let _0xc585fe,_0x32c7fd=null,_0x5e6ca8=null;try{if(_0x234798==_0x3b8704([0x47,0x50,0x4c]))return _0x3b8704([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0xc585fe=_0x433fbb(),!_0xc585fe)return _0x3b8704([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0xc585fe[_0x3b8704([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x5e6ca8=_0x99e44c(_0xc585fe[_0x3b8704([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0xc585fe[_0x3b8704([0x6a,0x74,0x69])])),await _0x59c6ca()?_0x5d671f()?_0x2e9d76()?_0x3b8704([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x2d5202()?(_0xc585fe[_0x3b8704([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x3b8704([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x32c7fd=_0x53b08b(_0x3b8704([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x462b48()):_0x3b8704([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x3b8704([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x3b8704([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x3b8704([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x2e9d76(){const _0x17b5e2=[_0x3b8704([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x3b8704([0x74,0x72,0x69,0x61,0x6c])][_0x3b8704([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xc585fe[_0x3b8704([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x4432aa/0x3e8:0xe10*_0x3357e4;return _0xc585fe[_0x3b8704([0x65,0x78,0x70])]<_0x17b5e2;}function _0x5d671f(){const _0x482427=_0xc585fe[_0x3b8704([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x482427&&(!!_0x482427[_0x3b8704([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3b8704([0x2a]))||!!_0x482427[_0x3b8704([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3b8704([0x41,0x49])));}function _0x2d5202(){const _0x30aa35=_0xc585fe[_0x3b8704([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x30aa35||0x0==_0x30aa35[_0x3b8704([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x592763}=new URL(window[_0x3b8704([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x30aa35[_0x3b8704([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x592763))return!0x0;const _0x5fdad1=_0x592763[_0x3b8704([0x73,0x70,0x6c,0x69,0x74])](_0x3b8704([0x2e]));return _0x30aa35[_0x3b8704([0x66,0x69,0x6c,0x74,0x65,0x72])](_0xd72ce3=>_0xd72ce3[_0x3b8704([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3b8704([0x2a])))[_0x3b8704([0x6d,0x61,0x70])](_0x5660c9=>_0x5660c9[_0x3b8704([0x73,0x70,0x6c,0x69,0x74])](_0x3b8704([0x2e])))[_0x3b8704([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x55b149=>_0x55b149[_0x3b8704([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x5fdad1[_0x3b8704([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x3b8704([0x6d,0x61,0x70])](_0x496420=>Array(_0x5fdad1[_0x3b8704([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x496420[_0x3b8704([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x3b8704([0x66,0x69,0x6c,0x6c])](_0x496420[0x0]===_0x3b8704([0x2a])?_0x3b8704([0x2a]):'')[_0x3b8704([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x496420))[_0x3b8704([0x73,0x6f,0x6d,0x65])](_0x4a34e3=>_0x5fdad1[_0x3b8704([0x65,0x76,0x65,0x72,0x79])]((_0x481bbc,_0x3a0c3d)=>_0x4a34e3[_0x3a0c3d]===_0x481bbc||_0x4a34e3[_0x3a0c3d]===_0x3b8704([0x2a])));}function _0x462b48(){return _0x32c7fd&&_0x5e6ca8?new window[(_0x3b8704([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3127a1,_0x317f34)=>{_0x32c7fd[_0x3b8704([0x74,0x68,0x65,0x6e])](_0x3127a1,_0x317f34),_0x5e6ca8[_0x3b8704([0x74,0x68,0x65,0x6e])](_0x573fe5=>{_0x573fe5!=_0x3b8704([0x56,0x61,0x6c,0x69,0x64])&&_0x3127a1(_0x573fe5);},_0x317f34);}):_0x32c7fd||_0x5e6ca8||_0x3b8704([0x56,0x61,0x6c,0x69,0x64]);}}function _0x99e44c(_0x4eebce,_0x199861){return new window[(_0x3b8704([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4379ff=>{if(_0x32d0c2())return _0x4379ff(_0x3b8704([0x56,0x61,0x6c,0x69,0x64]));_0x599445(),_0x1efcfe[_0x3b8704([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x3b8704([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0xb1c4c1=!0x1;const _0x473594=_0x3e4e8c();function _0x400985(_0x494b03){return!!_0x494b03&&(typeof _0x494b03===_0x3b8704([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x494b03===_0x3b8704([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x494b03[_0x3b8704([0x74,0x68,0x65,0x6e])]===_0x3b8704([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x494b03[_0x3b8704([0x63,0x61,0x74,0x63,0x68])]===_0x3b8704([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x106510(_0x521244){_0x50a02a(_0x521244)[_0x3b8704([0x74,0x68,0x65,0x6e])](_0x32e4e4=>{if(!_0x32e4e4||_0x32e4e4[_0x3b8704([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x3b8704([0x6f,0x6b]))return _0x3b8704([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x443584(_0x3da2a2(_0x473594+_0x199861))!=_0x32e4e4[_0x3b8704([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x3b8704([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x3b8704([0x56,0x61,0x6c,0x69,0x64]);})[_0x3b8704([0x74,0x68,0x65,0x6e])](_0xa65a=>(_0x5e7343(),_0xa65a),()=>{const _0x32ce5b=_0x33a489();return null==_0x32ce5b?(_0x5e7343(),_0x3b8704([0x56,0x61,0x6c,0x69,0x64])):_0x3b8704(_0x4432aa-_0x32ce5b>(0x19f340e1^_0x4f6e03)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x3b8704([0x74,0x68,0x65,0x6e])](_0x4379ff)[_0x3b8704([0x63,0x61,0x74,0x63,0x68])](()=>{_0x4379ff(_0x3b8704([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0xd8464=0x3dc92a61^_0x4f6e03;function _0x5e7343(){const _0x43d23b=_0x3b8704([0x6c,0x6c,0x63,0x74,0x2d])+_0x443584(_0x3da2a2(_0x4eebce)),_0x145199=_0x15b397(_0x443584(window[_0x3b8704([0x4d,0x61,0x74,0x68])][_0x3b8704([0x63,0x65,0x69,0x6c])](_0x4432aa/_0xd8464)));window[_0x3b8704([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3b8704([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x43d23b,_0x145199);}function _0x33a489(){const _0x3105f8=_0x3b8704([0x6c,0x6c,0x63,0x74,0x2d])+_0x443584(_0x3da2a2(_0x4eebce)),_0xf1ddd2=window[_0x3b8704([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3b8704([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3105f8);return _0xf1ddd2?window[_0x3b8704([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x15b397(_0xf1ddd2),0x10)*_0xd8464:null;}function _0x50a02a(_0x327896){return new window[(_0x3b8704([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0xe189dd,_0x4987f5)=>{_0x327896[_0x3b8704([0x74,0x68,0x65,0x6e])](_0xe189dd,_0x4987f5),window[_0x3b8704([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x4987f5,0x3dfe1021^_0x4f6e03);});}}_0x1efcfe[_0x3b8704([0x6f,0x6e])](_0x3b8704([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x383edf,_0x3f55ba)=>{if(_0x3f55ba[0x0]!=_0x4eebce)return _0x4379ff(_0x3b8704([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x3f55ba[0x1]={..._0x3f55ba[0x1],[_0x3b8704([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x473594};},{[_0x3b8704([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3b8704([0x68,0x69,0x67,0x68])}),_0x1efcfe[_0x3b8704([0x6f,0x6e])](_0x3b8704([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x2daeea=>{_0x400985(_0x2daeea[_0x3b8704([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0xb1c4c1=!0x0,_0x106510(_0x2daeea[_0x3b8704([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x3b8704([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3b8704([0x6c,0x6f,0x77])}),_0x478239[_0x3b8704([0x74,0x68,0x65,0x6e])](()=>{_0xb1c4c1||_0x4379ff(_0x3b8704([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x32d0c2(){return _0x1efcfe[_0x3b8704([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3b8704([0x76,0x69,0x65,0x77])][_0x3b8704([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x3b8704([0x61,0x75,0x74,0x6f]);}function _0x599445(){_0x1efcfe[_0x3b8704([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3b8704([0x76,0x69,0x65,0x77])][_0x3b8704([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x3b8704([0x61,0x75,0x74,0x6f]);}}function _0x53b08b(_0x8daa79){const _0x139032=[new window[(_0x3b8704([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x57f3a0=>setTimeout(_0x57f3a0,0x3df6fa2d^_0x4f6e03)),_0x478239[_0x3b8704([0x74,0x68,0x65,0x6e])](()=>new window[(_0x3b8704([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x36ff64=>{let _0x4ccd8d=0x0;_0x1efcfe[_0x3b8704([0x6d,0x6f,0x64,0x65,0x6c])][_0x3b8704([0x6f,0x6e])](_0x3b8704([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0xf36d27,_0x1f1477)=>{_0x1f1477[0x0][_0x3b8704([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x4ccd8d++,_0x4ccd8d==(0x3dffc109^_0x4f6e03)&&(_0x36ff64(),_0xf36d27[_0x3b8704([0x6f,0x66,0x66])]());});}))];return window[_0x3b8704([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x3b8704([0x72,0x61,0x63,0x65])](_0x139032)[_0x3b8704([0x74,0x68,0x65,0x6e])](()=>_0x8daa79);}async function _0x1420d0(){await _0x478239,_0x1efcfe[_0x3b8704([0x6d,0x6f,0x64,0x65,0x6c])][_0x3b8704([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x69e6ac,_0x1efcfe[_0x3b8704([0x6d,0x6f,0x64,0x65,0x6c])][_0x3b8704([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x69e6ac,_0x1efcfe[_0x3b8704([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x3b8704([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x475238(_0x5c44da){const _0x2eb078=_0x97fa8b();_0x1efcfe[_0x2eb078]=_0x3b8704([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x5c44da,_0x5c44da!=_0x3b8704([0x56,0x61,0x6c,0x69,0x64])&&_0x1420d0();}function _0x97fa8b(){const _0x312660=window[_0x3b8704([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x3b8704([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x3b8704([0x6e,0x6f,0x77])]())[_0x3b8704([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x3b8704([0x2e]),'');let _0x22b1ed=_0x3b8704([0x6e]);for(let _0x58a629=0x0;_0x58a629<_0x312660[_0x3b8704([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x58a629+=0x2){let _0x1e34f4=window[_0x3b8704([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x312660[_0x3b8704([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x58a629,_0x58a629+0x2));_0x1e34f4>=_0x1f9430[_0x3b8704([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x1e34f4-=_0x1f9430[_0x3b8704([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x22b1ed+=_0x1f9430[_0x1e34f4];}return _0x22b1ed;}function _0x433fbb(){const _0x4734d8=_0x234798[_0x3b8704([0x73,0x70,0x6c,0x69,0x74])](_0x3b8704([0x2e]));if(0x3!=_0x4734d8[_0x3b8704([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x3ef300(_0x4734d8[0x1]);function _0x3ef300(_0x3125ff){const _0x3b8cca=_0x38668b(_0x3125ff);return _0x3b8cca&&_0x50b80f()?_0x3b8cca:null;function _0x50b80f(){const _0x149a36=_0x3b8cca[_0x3b8704([0x6a,0x74,0x69])],_0xd9116a=window[_0x3b8704([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x149a36[_0x3b8704([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x149a36[_0x3b8704([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x18afa4={..._0x3b8cca,[_0x3b8704([0x6a,0x74,0x69])]:_0x149a36[_0x3b8704([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x149a36[_0x3b8704([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x18afa4[_0x3b8704([0x76,0x63])],_0x3da2a2(_0x18afa4)==_0xd9116a;}}}async function _0x59c6ca(){let _0x538908=!0x0;try{const _0xa8e716=_0x234798[_0x3b8704([0x73,0x70,0x6c,0x69,0x74])](_0x3b8704([0x2e])),[_0x594e1a,_0x3e2132,_0x170963]=_0xa8e716;return _0x3451e2(_0x594e1a),await _0xa570f6(_0x594e1a,_0x3e2132,_0x170963),_0x538908;}catch{return!0x1;}function _0x3451e2(_0x2e5cc0){const _0x53498f=_0x38668b(_0x2e5cc0);_0x53498f&&_0x53498f[_0x3b8704([0x61,0x6c,0x67])]==_0x3b8704([0x45,0x53,0x32,0x35,0x36])||(_0x538908=!0x1);}async function _0xa570f6(_0xc372b3,_0x3ca196,_0x17583b){const _0x2819c7=window[_0x3b8704([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x3b8704([0x66,0x72,0x6f,0x6d])](_0x13b077(_0x17583b),_0x1b7102=>_0x1b7102[_0x3b8704([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x3b3080=new window[(_0x3b8704([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x3b8704([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0xc372b3+_0x3b8704([0x2e])+_0x3ca196),_0x53d5c9=window[_0x3b8704([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x3b8704([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x53d5c9)return;const _0x343ec8=await _0x53d5c9[_0x3b8704([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x3b8704([0x6a,0x77,0x6b]),_0x45d371,{[_0x3b8704([0x6e,0x61,0x6d,0x65])]:_0x3b8704([0x45,0x43,0x44,0x53,0x41]),[_0x3b8704([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x3b8704([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x3b8704([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x53d5c9[_0x3b8704([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x3b8704([0x6e,0x61,0x6d,0x65])]:_0x3b8704([0x45,0x43,0x44,0x53,0x41]),[_0x3b8704([0x68,0x61,0x73,0x68])]:{[_0x3b8704([0x6e,0x61,0x6d,0x65])]:_0x3b8704([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x343ec8,_0x2819c7,_0x3b3080)||(_0x538908=!0x1);}}function _0x38668b(_0x2fc55c){return _0x2fc55c[_0x3b8704([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x3b8704([0x65,0x79]))?JSON[_0x3b8704([0x70,0x61,0x72,0x73,0x65])](_0x13b077(_0x2fc55c)):null;}function _0x13b077(_0x5c4291){return window[_0x3b8704([0x61,0x74,0x6f,0x62])](_0x5c4291[_0x3b8704([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x3b8704([0x2b]))[_0x3b8704([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x3b8704([0x2f])));}function _0x3da2a2(_0x24e26f){let _0x39ff80=0x1505;function _0x44430d(_0x404633){for(let _0x1c0897=0x0;_0x1c0897<_0x404633[_0x3b8704([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1c0897++){const _0x35b934=_0x404633[_0x3b8704([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x1c0897);_0x39ff80=(_0x39ff80<<0x5)+_0x39ff80+_0x35b934,_0x39ff80&=_0x39ff80;}}function _0x38ac81(_0x27711d){Array[_0x3b8704([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x27711d)?_0x27711d[_0x3b8704([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x38ac81):_0x27711d&&typeof _0x27711d==_0x3b8704([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x3b8704([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x27711d)[_0x3b8704([0x73,0x6f,0x72,0x74])]()[_0x3b8704([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x2e20c3,_0x328a03])=>{_0x44430d(_0x2e20c3),_0x38ac81(_0x328a03);}):_0x44430d(window[_0x3b8704([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x27711d));}return _0x38ac81(_0x24e26f),_0x39ff80>>>0x0;}function _0x443584(_0x5bb233){return _0x5bb233[_0x3b8704([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x3b8704([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x3b8704([0x30]));}function _0x15b397(_0x28891c){return _0x28891c[_0x3b8704([0x73,0x70,0x6c,0x69,0x74])]('')[_0x3b8704([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x3b8704([0x6a,0x6f,0x69,0x6e])]('');}function _0x69e6ac(){}function _0x3b8704(_0x5a94c4){return _0x5a94c4['map'](_0x20ba0d=>String['fromCharCode'](_0x20ba0d))['join']('');}_0x475238(await _0x5b59c7());}(this);}['showFakeVisualSelection'](){const _0x20a018=this['editor']['model'];_0x20a018['change'](_0x11bc55=>{const _0x52ae13=_0x20a018['document']['selection']['getRanges']();let _0x458239=0x0;for(const _0xb63c3a of _0x52ae13){const _0xcd3920=wt+':'+_0x458239;if(_0x20a018['markers']['has'](_0xcd3920))_0x11bc55['updateMarker'](_0xcd3920,{'range':_0xb63c3a});else{if(_0xb63c3a['start']['isAtEnd']){const _0x2a04a2=_0xb63c3a['start']['getLastMatchingPosition'](({item:_0x147693})=>!_0x20a018['schema']['isContent'](_0x147693),{'boundaries':_0xb63c3a});_0x11bc55['addMarker'](_0xcd3920,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x11bc55['createRange'](_0x2a04a2,_0xb63c3a['end'])});}else _0x11bc55['addMarker'](_0xcd3920,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xb63c3a});}_0x458239++;}});}['hideFakeVisualSelection'](){const _0x422bd0=this['editor']['model'],_0x56332f=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](wt));_0x56332f['length']&&_0x422bd0['change'](_0x2dd5f4=>{_0x56332f['forEach'](_0x3dcca8=>{_0x2dd5f4['removeMarker'](_0x3dcca8);});});}['insertContent'](_0x35c86d,_0x52a291){const _0x13ad0b=this['_getAISelection'](),_0x4edb08=_0x52a291||_0x13ad0b['getFirstRange']();this['editor']['model']['canEditAt'](_0x4edb08)&&this['editor']['model']['change'](_0x354c24=>{this['hideFakeVisualSelection'](),_0x52a291||this['_resetContentOfSelectedTableCells'](_0x354c24,_0x13ad0b),this['_pasteHTMLUsingClipboard']({'insertAt':_0x4edb08,'writer':_0x354c24,'html':_0x35c86d});});}['insertContentBelow'](_0x198a15){const {model:_0x539c02}=this['editor'],_0x313080=this['_getAISelection']();_0x539c02['change'](()=>{const _0x23527b=this['_prepareTableInsertBelowPosition'](_0x198a15,_0x313080)||this['_getDefaultInsertBelowPosition'](_0x313080);this['insertContent'](_0x198a15,_0x23527b);});}['_getAISelection'](){const _0x4cc1c7=this['editor']['model'],_0x523e83=Array['from'](_0x4cc1c7['markers']['getMarkersGroup'](wt))['map'](_0x28709d=>_0x28709d['getRange']());return _0x4cc1c7['createSelection'](_0x523e83);}['_pasteHTMLUsingClipboard']({writer:_0x47c6b6,html:_0x2a73f1,insertAt:_0x269ac8}){const {view:_0x3200c6}=this['editor']['editing'],_0x559794=this['editor']['plugins']['get'](nt),_0x113877=new Wn();_0x113877['setData']('text/html',_0x2a73f1);const _0x29fd2d=new ClipboardEvent('paste',{'clipboardData':_0x113877}),_0x515681=new ct(_0x3200c6,_0x29fd2d,{'dataTransfer':new ut(_0x113877)});_0x47c6b6['setSelection'](_0x269ac8);const _0x47dbce=(_0x1a064b,_0xe3938e)=>{_0xe3938e['resultRange']&&_0x47c6b6['setSelection'](_0xe3938e['resultRange']);};_0x559794['once']('contentInsertion',_0x47dbce,{'priority':'lowest'}),_0x3200c6['document']['fire']('paste',_0x515681),_0x559794['off']('contentInsertion',_0x47dbce);}['_getDefaultInsertBelowPosition'](_0x4cded7){const {model:_0x4a0295}=this['editor'],_0x11f081=Array['from'](_0x4cded7['getSelectedBlocks']());return _0x11f081['length']?_0x4a0295['createPositionAfter'](_0x11f081['pop']()):_0x4cded7['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x3e4c46,_0x6bbfd1){const {model:_0x1dd2a9,plugins:_0x570afd}=this['editor'];if(_0x570afd['has']('TableUtils')){const _0xc0ed3b=_0x570afd['get']('TableUtils')['getSelectedTableCells'](_0x6bbfd1);if(_0xc0ed3b['length']){const _0x55c3f0=this['_getTableRowCountFromContent'](_0x3e4c46),_0x30b8c7=this['_createEmptyTableRows'](_0xc0ed3b,_0x55c3f0);return _0x1dd2a9['createPositionAt'](_0x30b8c7,0x0);}}return null;}['_getTableRowCountFromContent'](_0x4a7d53){const _0x200f32=this['editor']['plugins']['get']('TableUtils'),_0x5a4841=this['editor']['data']['parse'](_0x4a7d53),_0x52c103=Array['from'](_0x5a4841['getChildren']())['filter'](_0x574453=>_0x574453['is']('element','table'));let _0x46235c=0x0;return _0x52c103['forEach'](_0x2252b7=>{_0x46235c+=_0x200f32['getRows'](_0x2252b7);}),_0x46235c;}['_createEmptyTableRows'](_0x45e941,_0x562fad){const _0x4452f9=this['editor']['plugins']['get']('TableUtils'),_0x4a9ad5=_0x4452f9['getRowIndexes'](_0x45e941),_0x2c06c4=_0x4452f9['getColumnIndexes'](_0x45e941),_0x5d2d85=_0x4a9ad5['last']+0x1,_0x1fa60f=_0x2c06c4['first'],_0x415d92=_0x45e941[0x0]['findAncestor']('table');for(let _0x11097c=0x0;_0x11097c<_0x562fad;_0x11097c++)_0x4452f9['insertRows'](_0x415d92,{'at':_0x5d2d85});return _0x415d92['getChild'](_0x5d2d85)['getChild'](_0x1fa60f);}['_resetContentOfSelectedTableCells'](_0x462a8b,_0x619b57){const {plugins:_0x1e1fff}=this['editor'],{model:_0x8c7538}=_0x462a8b;if(!_0x1e1fff['has']('TableUtils'))return;_0x1e1fff['get']('TableUtils')['getSelectedTableCells'](_0x619b57)['length']&&_0x8c7538['deleteContent'](_0x619b57);}}class hi extends _0x5adfee{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x1500e8('aiadapter-text-adapter-not-set',null);}}class er extends Error{constructor(_0x44941c){super(_0x44941c),this['name']='AIRequestError';}}function Yn(_0x160341,_0x327b3e,_0x29725e){const t=_0x160341['t'];switch(_0x327b3e){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',_0x29725e);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x29725e);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'},_0x29725e);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 _0x327b3e;}}class di extends At{['_commandDefinitions'];constructor(_0x25710c,_0x438d11){super(_0x25710c),this['_commandDefinitions']=_0x438d11,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x25a7e7,_0x54b369,_0x587760)=>{this['isEnabled']&&(this['enabledCommandsIds']=js(this['_commandDefinitions'],_0x587760));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x15f0c,_0x5ad5b4,_0x3b8a89)=>{this['enabledCommandsIds']=_0x3b8a89?js(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x1122a4=this['editor']['model'];this['_hasContext']=function(_0x2559c1){const _0x252379=_0x2559c1['document']['selection'];return _0x252379['isCollapsed']?0x0!==[..._0x252379['getSelectedBlocks']()]['length']&&![..._0x252379['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x2559c1['hasContent'](_0x252379['getFirstRange']());}(_0x1122a4);const _0x15d04e=_0x1122a4['document']['selection'],_0x2e7c5f=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x2d8b02 of _0x15d04e['getRanges']())for(const _0x4f271d of _0x2d8b02['getItems']())if(_0x4f271d['is']('element')&&_0x2e7c5f['includes'](_0x4f271d['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x23efdb='',_0xda98bc='',_0xaa0777='custom'){this['editor']['plugins']['get'](ee)['showUI'](_0x23efdb,_0xda98bc,_0xaa0777);}}function js(_0x585c19,_0x562927){const _0xa026bf=new Set();for(const _0x56b146 of _0x585c19['values']())(_0x562927||!0x1===_0x56b146['requiresContent'])&&_0xa026bf['add'](_0x56b146['id']);return Array['from'](_0xa026bf);}const vs=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class ui extends/* #__PURE__ -- @preserve */
|
|
24
|
+
Vt(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x59c02a,_0x5ed35e,_0xc8c4b9){super(),this['editor']=_0x59c02a,this['textAdapter']=_0x5ed35e,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0xc8c4b9,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x3885e6,_0xd20f48,_0x5012e7)=>{this['view']['value']=this['_sanitizeHTML'](_0x5012e7);}),this['listenTo'](this['view'],'submitPrompt',(_0x39edd6,_0x26303d)=>{const _0xaa800f=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x26303d,_0xaa800f,'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:_0x389166,query:_0x124b7c,htmlContent:_0x5a1082,label:_0x3a3d94,mainActionLabel:_0x417811}){this['view']['prompt']=_0x3a3d94,this['view']['mainAction']=_0x417811,this['initialContext']=_0x5a1082,_0x124b7c&&(this['view']['isRendered']?this['_handleQuery'](_0x124b7c,_0x5a1082,_0x389166,_0x3a3d94):this['view']['once']('render',()=>{this['_handleQuery'](_0x124b7c,_0x5a1082,_0x389166,_0x3a3d94);}));}['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'](_0x4c8ccf,_0x486e4b,_0x5a976c,_0x547364){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x486e4b,this['previousQuery']=_0x4c8ccf,this['previousLabel']=_0x547364||_0x4c8ccf,this['previousActionId']=_0x5a976c,new Promise(_0x5956a2=>{this['textAdapter']['makeRequest']({'query':_0x4c8ccf,'context':_0x486e4b,'onData':_0x38e6af=>{this['currentResponse']=_0x38e6af,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x5a976c})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x454337=>{_0x454337 instanceof er?this['view']['handleError'](_0x454337['message']):this['view']['handleError'](),_0x5956a2();})['finally'](()=>{this['stopProcessing'](),_0x5956a2();});});}['_parseAndNormalizeContent'](_0x5307a6,_0x4a91cf=!0x1){const _0x17303c=vs['exec'](_0x5307a6);_0x5307a6=_0x17303c?_0x5307a6['substring'](_0x17303c[0x1]['length']):_0x5307a6['length']<0x64&&!_0x4a91cf?'':this['_stripMarkdownSyntax'](_0x5307a6);const _0x526f4d=this['_domParser']['parseFromString'](_0x5307a6,'text/html');if(_0x17303c){const _0x23c771=Array['from'](_0x526f4d['body']['childNodes']);_0x23c771['reverse']();for(const _0x2ef603 of _0x23c771){if(_0x2ef603['nodeType']==Node['ELEMENT_NODE'])break;_0x2ef603['remove']();}}const _0x4dd625=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x526f4d['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x4dd625);const _0x4de2a6=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x362f96=this['editor']['data']['toModel'](_0x4dd625);return _0x4de2a6||_0x362f96['markers']['clear'](),this['editor']['data']['stringify'](_0x362f96);}['_normalizeResponseHeadings'](_0x17a402){const _0x52f311=new _0x3be1ca(this['editor']['editing']['view']['document']),_0x1a40f4=new _0xf012f3({'name':/^h[1-5]$/}),_0xa519fe=[];let _0x37fd78=!0x1;for(const _0x214a77 of _0x17a402)_0x214a77['is']('element')&&_0x1a40f4['match'](_0x214a77)&&(_0xa519fe['push'](_0x214a77),'h1'==_0x214a77['name']&&(_0x37fd78=!0x0));if(_0x37fd78){for(const _0x583c0e of _0xa519fe)_0x52f311['rename']('h'+(parseInt(_0x583c0e['name'][0x1])+0x1),_0x583c0e);}}['_isH1TagSupportEnabled'](){const {data:_0x298645,editing:_0x1d780a}=this['editor'],_0x500b20=_0x298645['htmlProcessor']['toView']('<h1></h1>'),_0x2b59f3=_0x298645['toView'](_0x298645['toModel'](_0x500b20));return!!_0x1d780a['view']['domConverter']['viewToDom'](_0x2b59f3)['querySelector']('h1');}['_sanitizeHTML'](_0x4e6dbc){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x4e6dbc),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x31b5c4){const _0x2e7f82=_0x31b5c4['trim']();return _0x2e7f82['startsWith']('```html')?_0x2e7f82['endsWith']('```')?_0x2e7f82['substring'](0x7,_0x2e7f82['length']-0x3):_0x2e7f82['substring'](0x7):_0x31b5c4;}}const fi={'REPLACE':'replace','INSERT':'insert'};class Pr extends _0x1b7f91{constructor(_0x2ec1a5){super(_0x2ec1a5),this['set']('isVisible',!0x1),this['set']('mainAction',fi['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x334966=>Yn(_0x2ec1a5,'AI_'+_0x334966['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Yn(_0x2ec1a5,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Yn(_0x2ec1a5,'Try\x20again')),this['stopButton']=this['_createButton'](Yn(_0x2ec1a5,'Stop'));const _0x54f1dc=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x54f1dc['if']('isVisible','ck-hidden',_0x3c7674=>!_0x3c7674)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x27ecab,_0x52e103){const _0x28c3cf=new _0x3fc85a(this['locale']);return _0x28c3cf['set']({'label':_0x27ecab,'class':_0x52e103||'','isVisible':!0x0,'withText':!0x0}),_0x28c3cf;}}class Ir extends _0x538d57{['contentFieldView'];['copyButtonView'];constructor(_0x844fbc,_0x44da1a=''){super(_0x844fbc),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x2fbee4=this['bindTemplate'];this['contentFieldView']=new $n(_0x844fbc,_0x44da1a),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x2fbee4['if']('isVisible','ck-hidden',_0x15f8c3=>!_0x15f8c3)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x2fbee4['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 _0x14fcaf=!0x1;this['on']('change:value',(_0x1105bc,_0x11b0a3,_0x255d47)=>{const _0x521f55=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x255d47),this['isProcessing']&&_0x521f55&&!_0x14fcaf&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x90aa7e,_0x577416,_0x2e5ec0)=>{_0x14fcaf=!0x1,_0x2e5ec0?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x14fcaf=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x14fcaf=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x15cc5b=this['locale'],_0x545394=new _0x3fc85a(this['locale']),_0x4fdaaa='ck-ai-form__copy-button';return _0x545394['set']({'label':Yn(_0x15cc5b,'Copy'),'icon':_0x3d8ab5,'class':_0x4fdaaa,'tooltip':!0x0}),_0x545394['bind']('isVisible')['to'](this,'value',_0x168ef6=>!!_0x168ef6),_0x545394['bind']('isEnabled')['to'](this,'isProcessing',_0x2f8398=>!_0x2f8398),_0x545394['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x545394['icon']=_0x1dd94c,_0x545394['class']=_0x4fdaaa+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x545394['icon']=_0x3d8ab5,_0x545394['class']=_0x4fdaaa;},0x3e8);}),_0x545394;}['_copyHTMLToClipboard'](_0x1eb2df){const {window:_0x792cce,document:_0x43b379}=_0x3537fe;if(_0x792cce['ClipboardItem']){const {Blob:_0x46a191,ClipboardItem:_0x5220f5}=_0x792cce,_0x2fe219=[new _0x5220f5({'text/html':new _0x46a191([_0x1eb2df['innerHTML']],{'type':'text/html'}),'text/plain':new _0x46a191([_0x1eb2df['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x2fe219);}else{const _0x30c0a3=_0x43b379['createElement']('div');_0x30c0a3['style']['position']='absolute',_0x30c0a3['style']['left']='-9999px',_0x30c0a3['innerHTML']='<span>[</span>'+_0x1eb2df['innerHTML']+'<span>]</span>',_0x43b379['body']['appendChild'](_0x30c0a3);const _0x59bfe1=_0x43b379['createRange']();_0x59bfe1['setStartAfter'](_0x30c0a3['firstElementChild']),_0x59bfe1['setEndBefore'](_0x30c0a3['lastElementChild']);const _0x2140a6=_0x792cce['getSelection']();_0x2140a6['removeAllRanges'](),_0x2140a6['addRange'](_0x59bfe1),_0x43b379['execCommand']('copy'),_0x30c0a3['remove']();}}}class $n extends _0x538d57{constructor(_0x3ebb56,_0x2dfdd3=''){super(_0x3ebb56),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x2dfdd3,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x2e8ab2){this['element']['innerHTML']=_0x2e8ab2;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x1c7b37=new _0x538d57(),_0x120bc1=this['locale'],_0x205dcf=new _0x29d2d8();return _0x205dcf['isVisible']=!0x0,_0x1c7b37['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x205dcf,{'text':Yn(_0x120bc1,'AI\x20is\x20writing...')}]}),_0x1c7b37['render'](),_0x1c7b37;}}class Vr extends _0x538d57{constructor(_0x4807e1,_0x32e36f=''){super(_0x4807e1);const _0x36e7e5=new _0x1a5580(),_0xf32393=this['bindTemplate'];this['set']('text',_0x32e36f),_0x36e7e5['content']=_0x5325ee,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x36e7e5,{'text':_0xf32393['to']('text')}]});}}class Hr extends _0x6213f1{['submitButtonView'];['showHistoryButtonView'];constructor(_0x9b1096,_0x526bf5){super(_0x9b1096,_0x526bf5),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',(_0xc4e136,_0x32841c)=>{_0xc4e136['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x32841c());});}['_createSubmitButton'](){const _0x153c43=new _0x3fc85a(this['locale']),_0x459ee7=this['locale'];return _0x153c43['set']({'icon':_0x13c99b,'label':Yn(_0x459ee7,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x153c43['on']('execute',()=>{this['submit']();}),_0x153c43['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x6b8a6f,_0xf0c287)=>!_0x6b8a6f&&_0xf0c287),_0x153c43;}['_createShowHistoryButton'](){const _0x27e761=new _0x3fc85a(this['locale']),_0x538b35=this['resultsView'],_0x56e314=this['locale'];_0x27e761['set']({'label':Yn(_0x56e314,'History'),'withText':!0x1,'icon':ot,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x27e761['bind']('isOn')['to'](_0x538b35,'isVisible'),_0x27e761['bind']('isEnabled')['to'](this,'isEnabled'),_0x27e761['on']('execute',()=>{_0x538b35['isVisible']=!_0x538b35['isVisible'],_0x538b35['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x13bfae=()=>{_0x3537fe['window']['requestAnimationFrame'](()=>{if(_0x48958f(this['element'])){const _0x380bbd=new _0x34633d(this['queryView']['fieldView']['element']),_0x7e6cda=_0x380bbd['width'],_0x5972bc='rtl'===_0x56e314['uiLanguageDirection']?'left':'right';_0x380bbd['excludeScrollbarsAndBorders'](),_0x27e761['element']['style'][_0x5972bc]=_0x7e6cda-_0x380bbd['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x13bfae),this['on']('render',_0x13bfae),_0x27e761;}['submit'](){const _0x397407=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x397407);}['focus'](_0x523af4){-0x1===_0x523af4?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Rr extends _0x1b0a54{['historyGroupView'];['clearHistoryButton'];constructor(_0x522dd7){super(_0x522dd7),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x1728c0(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Yn(_0x522dd7,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x42bb7e=0x0;for(const _0x1e5bea of this['items'])_0x42bb7e+=_0x1e5bea['items']['length'];return{'resultsCount':_0x42bb7e,'totalItemsCount':_0x42bb7e};}['_createClearHistoryButton'](){const _0x13f62d=this['locale'],_0x3008cf=new _0x3fc85a(this['locale']);return _0x3008cf['set']({'label':'('+Yn(_0x13f62d,'Clear')+')','withText':!0x0}),_0x3008cf['on']('execute',()=>this['fire']('clearHistory')),_0x3008cf;}}class Br extends _0x5749b5{constructor(_0x5edca8){super();const _0x2f667c=new _0x3ffbe5(),_0x176845=new _0x3fc85a(this['locale'],_0x2f667c);this['children']['add'](_0x176845),_0x176845['set']({'label':_0x5edca8['prompt'],'withText':!0x0}),_0x176845['on']('execute',()=>{this['fire']('execute',{'value':_0x4e5df5(_0x5edca8['prompt'])});});}}const Sr='CKEditor/AIFormView/PromptHistory';class qr extends _0x53af97{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0xd3228a,_0x3970c9)=>{const _0x1e0a0e=Fr(_0x3970c9['prompt']);for(const _0x15714a of this)if(_0x15714a!=_0x3970c9&&Fr(_0x15714a['prompt'])===_0x1e0a0e){this['remove'](_0x15714a);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x5a2dff=sessionStorage['getItem'](Sr)||'[]';this['addMany'](JSON['parse'](_0x5a2dff));}['_saveToSessionStorage'](){sessionStorage['setItem'](Sr,JSON['stringify'](this['map'](_0x1e721f=>_0x1e721f)));}}function Fr(_0x519a30){return _0x519a30['toLowerCase']()['trim']();}class pi extends _0x538d57{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x294e6d,_0x1056ec,_0x238603=''){super(_0x294e6d),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',fi['REPLACE']),this['_promptHistory']=new qr(),this['errorView']=new Vr(_0x294e6d),this['contentArea']=new Ir(_0x294e6d,_0x238603),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 ts(),this['keystrokes']=new _0x356454(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x19c87e({'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 _0x5b5896=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x1056ec],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x5b5896['if']('isError','ck-hidden',_0x4a8bc9=>!_0x4a8bc9)]},'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'](_0x38073e=0x1){-0x1===_0x38073e?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 _0x5ec883=this['locale'],_0x4ecc=new Hr(_0x5ec883,{'queryView':{'label':Yn(_0x5ec883,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x550e60,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Yn(_0x5ec883,'Empty\x20history'),'secondary':Yn(_0x5ec883,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x4ecc['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x134213,_0x4bd04f)=>_0x134213&&!_0x4bd04f),this['listenTo'](_0x4ecc,'submit',(_0x4c3d32,_0x17edd5)=>{this['prompt']=_0x17edd5;const _0x3cf170=Wt(_0x17edd5);this['fire']('submitPrompt',_0x3cf170),_0x17edd5['trim']()&&this['_promptHistory']['add']({'prompt':_0x3cf170},0x0);},{'priority':'high'}),_0x4ecc;}['_createHistoryView'](){const _0x523a6a=new Rr(this['locale']);return _0x523a6a['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Br),_0x523a6a['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x523a6a;}['_createToolbar'](){const _0x2a86f2=new Pr(this['locale']);return _0x2a86f2['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x33298e,_0x15080c,_0x41d7fa)=>_0x33298e&&!_0x15080c&&!!_0x41d7fa),_0x2a86f2['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x2a86f2['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x39007c,_0x139cb7,_0x205fb4)=>_0x39007c&&!_0x139cb7&&!!_0x205fb4),_0x2a86f2['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x2a86f2['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x414e27,_0xafc6ab)=>_0x414e27&&!_0xafc6ab),_0x2a86f2['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x2a86f2['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x2a86f2['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x2a86f2;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x2cb558=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Yn(_0x2cb558,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0xe4b011){const _0x440174=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0xe4b011||Yn(_0x440174,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const lt=globalThis['DataTransfer'];class ee extends _0x5adfee{['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[_0x524068,te,hi,_0xc82d75];}constructor(_0x1a74e7){super(_0x1a74e7),_0x1a74e7['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x1a74e7['config']['define']('ai.assistant.contentAreaCssClass',''),_0x1a74e7['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x1a74e7['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x56f7ee}=this;this['_aiAdapter']=_0x56f7ee['plugins']['get'](hi),this['_dialog']=_0x56f7ee['plugins']['get'](_0xc82d75),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x1b34e0=new di(_0x56f7ee,Array['from'](this['_commandDefinitions']['values']()));_0x56f7ee['commands']['add']('showAIAssistant',_0x1b34e0),_0x56f7ee['ui']['componentFactory']['add']('aiCommands',_0x1dee28=>{const _0x5550ef=_0x238494(_0x1dee28);return _0x5550ef['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x5550ef['buttonView']['set']({'label':Yn(_0x1dee28,'AI\x20Commands'),'icon':_0x342837,'tooltip':!0x0}),_0x5550ef['on']('execute',_0x5dee33=>this['_onExecute'](_0x5dee33['source']['id'])),_0x30ebf6(_0x5550ef,_0x56f7ee['ui']['view']['body'],function(_0x14b6ad){const _0x5d103d=ne(_0x14b6ad['config']['get']('ai.assistant.commands'),_0x14b6ad['locale']),_0x469609=gi(_0x14b6ad,_0x5d103d)['filter'](_0x5634ca=>_0x5634ca['commands']['length']);if(0x1===_0x469609['length'])return gi(_0x14b6ad,_0x469609[0x0]['commands'])['map'](_0x313344=>({'id':_0x313344['id'],'label':_0x313344['label']}));return _0x469609['map'](_0x2056d4=>{const {groupId:_0x1af14b,groupLabel:_0x1fee53,commands:_0x5469d4}=_0x2056d4,_0x3bbb82=gi(_0x14b6ad,_0x5469d4)['map'](_0x14c89b=>({'id':_0x14c89b['id'],'label':_0x14c89b['label']}));return{'id':_0x1af14b,'menu':_0x1fee53||_0x1af14b,'children':_0x3bbb82};});}(_0x56f7ee),{'ariaLabel':Yn(_0x1dee28,'AI\x20Commands')}),_0x5550ef['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x1b34e0['on']('change:enabledCommandsIds',_0x4a1518),_0x5550ef['menuView']['once']('render',_0x4a1518),_0x5550ef;function _0x4a1518(){_0x5550ef['isEnabled']=_0x1b34e0['enabledCommandsIds']['length']>0x0;for(const _0x12f66d of _0x5550ef['menuView']['buttons'])_0x12f66d['isEnabled']=_0x1b34e0['enabledCommandsIds']['includes'](_0x12f66d['id']);}}),_0x56f7ee['ui']['componentFactory']['add']('menuBar:aiCommands',_0x289dc0=>{const _0x4c3c26=new _0x3c114(_0x289dc0);_0x4c3c26['buttonView']['set']({'label':Yn(_0x289dc0,'AI\x20Commands'),'icon':_0x342837}),_0x4c3c26['bind']('isEnabled')['to'](_0x1b34e0,'enabledCommandsIds',_0x2b4df8=>_0x2b4df8['length']>0x0);const _0x134ae2=ne(_0x56f7ee['config']['get']('ai.assistant.commands'),_0x289dc0);return this['_populateMenuBarMenu'](_0x1b34e0,_0x4c3c26,_0x134ae2,_0x2e8dc1=>this['_onExecute'](_0x2e8dc1)),_0x4c3c26;}),_0x56f7ee['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x373a18=this['_createAIAssistantUIButton'](_0x3fc85a);return _0x373a18['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x373a18;}),_0x56f7ee['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x39a309=this['_createAIAssistantUIButton'](_0x58fafd);return _0x39a309['set']({'role':'menuitemcheckbox'}),_0x39a309;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x131dd9=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0xf88d1c;for(const _0x57691b in _0x131dd9){const _0x267a2e=_0x57691b,_0x1ba112=_0x131dd9[_0x267a2e];if('aiLicenseKeyValid'==_0x1ba112||'aiLicenseKeyInvalid'==_0x1ba112||'aiLicenseKeyExpired'==_0x1ba112||'aiLicenseKeyDomainLimit'==_0x1ba112||'aiLicenseKeyNotAllowed'==_0x1ba112||'aiLicenseKeyEvaluationLimit'==_0x1ba112||'aiLicenseKeyUsageLimit'==_0x1ba112){delete _0x131dd9[_0x267a2e],_0xf88d1c=_0x1ba112,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0xf88d1c&&_0x131dd9['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0xf88d1c&&_0x131dd9['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0xf88d1c&&_0x131dd9['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0xf88d1c&&_0x131dd9['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0xf88d1c&&_0x131dd9['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0xf88d1c&&_0x131dd9['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x446975='',_0xcadf5d='',_0x193fd8='custom'){const _0x3e30c=this['editor'],_0x446fa8=_0x3e30c['editing']['view'],_0x2f41da=_0x3e30c['plugins']['get'](te),_0x4e02e2=_0x3e30c['plugins']['get'](_0x524068);_0x2f41da['showFakeVisualSelection']();const _0x28a49a=new lt(),_0x5b7a8c=new ClipboardEvent('copy',{'clipboardData':_0x28a49a}),_0xf5e56=new ut(_0x28a49a),_0x490812=new ct(_0x446fa8,_0x5b7a8c,{'dataTransfer':_0xf5e56});_0x4e02e2['_forceMarkersCopy']('comment',()=>{_0x446fa8['document']['fire']('copy',_0x490812);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new ui(_0x3e30c,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x25d948=_0xf5e56['getData']('text/html');const _0x1b152c=_0x3e30c['model']['document']['selection'],_0x1a65ac=Array['from'](_0x1b152c['getRanges']());0x1===_0x1a65ac['length']&&_0x1a65ac[0x0]['isFlat']&&!_0x1b152c['getSelectedElement']()&&''!==_0x25d948['replace'](/ /g,'')['trim']()&&(_0x25d948='<p>'+_0x25d948+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x193fd8,'query':_0x446975,'htmlContent':_0x25d948,'label':_0xcadf5d,'mainActionLabel':fi[_0x3e30c['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':ti,'title':Yn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x5e4c8a['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x2f41da['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x3ad671=new Map(),_0x1c342f=ne(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0xfc6ed1 of _0x1c342f)for(const _0x4ca1d9 of _0xfc6ed1['commands'])_0x3ad671['set'](_0x4ca1d9['id'],{..._0x4ca1d9,'groupId':_0xfc6ed1['groupId'],'groupLabel':_0xfc6ed1['groupLabel']||_0xfc6ed1['groupId']});return _0x3ad671;}['_createAIAssistantUIButton'](_0x242bee){const _0x5cb26f=this['editor'],_0x5bbb71=_0x5cb26f['commands']['get']('showAIAssistant'),_0x1a60b5=new _0x242bee(_0x5cb26f['locale']);return _0x1a60b5['set']({'label':Yn(_0x5cb26f['locale'],'AI\x20Assistant'),'icon':ti,'isToggleable':!0x0}),_0x1a60b5['bind']('isEnabled')['to'](_0x5bbb71),_0x1a60b5['bind']('isOn')['to'](this['_dialog'],'id',_0x2ef3c9=>'aiAssistant'===_0x2ef3c9),this['listenTo'](_0x1a60b5,'execute',()=>{_0x1a60b5['isOn']?this['hideUI']():_0x5bbb71['execute']();}),_0x1a60b5;}['_initView'](){const _0x1b39fc=this['editor']['plugins']['get'](te);this['_formView']=new pi(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',()=>{_0x1b39fc['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x1b39fc['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x2df792,ui:{ariaLiveAnnouncer:_0x2885a6}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x5837e9,_0x2826c8,_0x48f720)=>{const _0x319692=this['_aiAssistantController']['currentContext'];_0x48f720?_0x2885a6['announce'](Yn(_0x2df792,'AI\x20is\x20writing')):_0x319692&&_0x2885a6['announce'](Yn(_0x2df792,'Generated\x20content:\x20%0',_0x319692),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x3a5b6b,_0xee3309,_0x1472eb)=>{if(_0x1472eb){const _0x2f35a5=this['_formView']['errorView']['text'];_0x2885a6['announce'](Yn(_0x2df792,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2f35a5));}});}['_onExecute'](_0x148919){const _0x7af901=this['_commandDefinitions']['get'](_0x148919),_0x115275=this['editor'],_0x58cb19=_0x115275['model']['document']['selection'],_0xf0d42=_0x115275['commands']['get']('showAIAssistant'),_0x293a2d=_0x115275['plugins']['get'](te),_0x57490e=''+(_0x7af901['groupId']!==li?_0x7af901['groupLabel']+':\x20':'')+_0x7af901['label'];if(!0x1!==_0x7af901['requiresContent']&&_0x58cb19['isCollapsed']){const _0x384083=_0x33a8c(_0x58cb19['getSelectedBlocks']())||_0x115275['model']['schema']['getLimitElement'](_0x58cb19);_0x115275['model']['change'](_0x300a9f=>{_0x300a9f['setSelection'](_0x384083,'in');});}_0x293a2d['showFakeVisualSelection'](),_0xf0d42['execute'](_0x7af901['prompt'],_0x57490e,'command:'+_0x148919);}['_populateMenuBarMenu'](_0x46f0cb,_0x2ef6ed,_0x3cd6b2,_0x1fc2da){const _0x85268a=this['editor'],_0xe2eb4e=_0x85268a['locale'],_0x243506=new _0x3301ef(_0xe2eb4e),_0x4f86ec=gi(_0x85268a,_0x3cd6b2)['filter'](_0x244dde=>_0x244dde['commands']['length']);0x1===_0x4f86ec['length']?this['_getMenuBarGroupButtons']({'command':_0x46f0cb,'commands':_0x4f86ec[0x0]['commands'],'parentMenuView':_0x2ef6ed,'onExecute':_0x1fc2da})['forEach'](_0x517aee=>_0x243506['items']['add'](_0x517aee)):_0x4f86ec['forEach'](({groupId:_0x32cb33,groupLabel:_0x2db3f0,commands:_0x53504a})=>{const _0x5f10ed=new _0x4dbed9(_0xe2eb4e,_0x2ef6ed),_0x18a198=new _0x3c114(_0xe2eb4e),_0x58e232=new _0x3301ef(_0xe2eb4e),_0x1565f8=this['_getMenuBarGroupButtons']({'command':_0x46f0cb,'commands':_0x53504a,'parentMenuView':_0x18a198,'onExecute':_0x1fc2da});_0x18a198['buttonView']['set']({'label':_0x2db3f0||_0x32cb33}),_0x18a198['delegate']('execute')['to'](_0x2ef6ed),_0x58e232['items']['addMany'](_0x1565f8),_0x18a198['panelView']['children']['add'](_0x58e232),_0x5f10ed['children']['add'](_0x18a198),_0x243506['items']['add'](_0x5f10ed);}),_0x2ef6ed['panelView']['children']['add'](_0x243506);}['_getMenuBarGroupButtons']({command:_0x46a743,commands:_0x16acd2,parentMenuView:_0x3f9e85,onExecute:_0x5a165f}){const _0x167725=this['editor'],_0x57634a=_0x167725['locale'];return gi(_0x167725,_0x16acd2)['map'](_0x3a8718=>{const _0x160df9=new _0x4dbed9(_0x57634a,_0x3f9e85),_0x10e1b0=new _0x58fafd(_0x57634a);return _0x10e1b0['set']({'label':_0x3a8718['label']}),_0x10e1b0['delegate']('execute')['to'](_0x3f9e85),_0x10e1b0['on']('execute',()=>_0x5a165f(_0x3a8718['id'])),_0x10e1b0['bind']('isEnabled')['to'](_0x46a743,'enabledCommandsIds',_0x5da7a8=>_0x5da7a8['includes'](_0x3a8718['id'])),_0x160df9['children']['add'](_0x10e1b0),_0x160df9;});}}function wi(_0x488146,_0x50f588){return void 0x0!==_0x488146['order']&&void 0x0===_0x50f588['order']?0x1:void 0x0===_0x488146['order']&&void 0x0!==_0x50f588['order']?-0x1:void 0x0!==_0x488146['order']&&void 0x0!==_0x50f588['order']?_0x488146['order']-_0x50f588['order']:0x0;}function gi(_0x417377,_0x3733b0){_0x3733b0['sort'](wi);const _0x83b0dc={},_0x451485=[];for(const _0x7371f1 of _0x3733b0)if(void 0x0!==_0x7371f1['order']){if(_0x7371f1['order']in _0x83b0dc)throw new _0x1500e8('ai-commands-config-order-collision',_0x417377,{'conflictingDefinitions':[_0x7371f1,_0x83b0dc[_0x7371f1['order']]]});_0x83b0dc[_0x7371f1['order']]=_0x7371f1,_0x451485['splice'](_0x7371f1['order'],0x0,_0x7371f1);}else _0x451485['push'](_0x7371f1);return _0x451485;}class qn extends _0x5adfee{static get['requires'](){return[ee,te];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x80e28d){super(_0x80e28d);const _0x1e21c8=_0x80e28d['config'],_0x9b4cd0=_0x80e28d['locale'];_0x1e21c8['define']('ai.assistant.preserveComments',!0x0),_0x1e21c8['define']('ai.assistant.commands',Qn(_0x9b4cd0)),_0x1e21c8['define']('ai.assistant.extraCommandGroups',[]),_0x1e21c8['define']('ai.assistant.removeCommands',[]);let _0x427362=ne(_0x1e21c8['get']('ai.assistant.commands'),_0x9b4cd0);const _0x48cdf3=_0x1e21c8['get']('ai.assistant.extraCommandGroups'),_0x304e35=_0x1e21c8['get']('ai.assistant.removeCommands');_0x48cdf3['forEach'](_0x329405=>{const _0x194fef=_0x427362['find'](_0x366b23=>_0x366b23['groupId']===_0x329405['groupId']);_0x194fef?_0x194fef['commands']=_0x194fef['commands']['concat'](_0x329405['commands']):_0x427362['push'](_0x329405);}),_0x427362=_0x427362['filter'](_0x1a8e57=>!_0x304e35['includes'](_0x1a8e57['groupId'])),_0x427362['forEach'](_0x25e860=>{_0x25e860['commands']=_0x25e860['commands']['filter'](_0x3824c3=>!_0x304e35['includes'](_0x3824c3['id']));}),_0x1e21c8['set']('ai.assistant.commands',_0x427362);}}function Qn(_0x439d2e){return[{'groupId':'editOrReview','groupLabel':Yn(_0x439d2e,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Yn(_0x439d2e,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Yn(_0x439d2e,'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':Yn(_0x439d2e,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Yn(_0x439d2e,'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':Yn(_0x439d2e,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Yn(_0x439d2e,'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':Yn(_0x439d2e,'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':Yn(_0x439d2e,'Change\x20tone'),'commands':[{'id':'professional','label':Yn(_0x439d2e,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Yn(_0x439d2e,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Yn(_0x439d2e,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Yn(_0x439d2e,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Yn(_0x439d2e,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Yn(_0x439d2e,'Change\x20style'),'commands':[{'id':'business','label':Yn(_0x439d2e,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Yn(_0x439d2e,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Yn(_0x439d2e,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Yn(_0x439d2e,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Yn(_0x439d2e,'Translate'),'commands':[{'id':'translateEnglish','label':Yn(_0x439d2e,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Yn(_0x439d2e,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Yn(_0x439d2e,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Yn(_0x439d2e,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Yn(_0x439d2e,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Yn(_0x439d2e,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Yn(_0x439d2e,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Yn(_0x439d2e,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class qe extends _0x5adfee{['abortController'];static get['requires'](){return[hi];}constructor(_0x4bb824){super(_0x4bb824),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](hi)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x4475ab){return this['sendRequest'](_0x4475ab)['catch'](_0x550884=>{if(_0x550884 instanceof er)return Promise['reject'](_0x550884);if('AbortError'==_0x550884['name'])return Promise['resolve']();throw console['error'](_0x550884),new _0x1500e8('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x115162,_0x1f3724){const _0x257ab0=this['editor']['locale'],_0x4eafd6={'Content-Type':'application/json'};if('object'==typeof _0x115162)Object['assign'](_0x4eafd6,_0x115162);else{if(_0x115162)try{const _0x1a9c35=await _0x115162(_0x1f3724);Object['assign'](_0x4eafd6,_0x1a9c35);}catch{return Promise['reject'](new er(Yn(_0x257ab0,'AI_ERROR_GET_HEADERS')));}}return _0x4eafd6;}async['_prepareRequestParameters'](_0xd3dcd1,_0x102c00){const _0x248d56=this['editor']['locale'];if('object'==typeof _0xd3dcd1)return _0xd3dcd1;try{return await _0xd3dcd1(_0x102c00);}catch{return Promise['reject'](new er(Yn(_0x248d56,'AI_ERROR_GET_PARAMETERS')));}}}class Xn extends qe{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x1c77c0){super(_0x1c77c0),_0x1c77c0['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x1c77c0['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x1c77c0['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x1c77c0['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x1c77c0['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x1c77c0['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x3850fb,context:_0x20cdab,onData:_0x26a61a,actionId:_0x578b8d}){const _0xafe56b=this['editor']['locale'],_0x2e1703=await this['prepareMessages'](_0x3850fb,_0x20cdab,_0x578b8d),_0x2d667d=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x578b8d),_0x3df2d1=await this['_prepareRequestParameters'](this['_requestParameters'],_0x578b8d),_0x37319d={'messages':_0x2e1703,..._0x3df2d1},_0x342486={'method':'POST','headers':_0x2d667d,'body':JSON['stringify'](_0x37319d),'signal':this['abortController']['signal']},_0x10a29b=await fetch(this['_apiUrl'],_0x342486);if(_0x10a29b['ok'])return _0x3df2d1['stream']?await this['_readStreamableResponse'](_0x10a29b,_0x26a61a):await this['_readStaticResponse'](_0x10a29b,_0x26a61a),Promise['resolve']();{const _0x3587a5=await _0x10a29b['text']();return _0x3587a5['includes']('context_length_exceeded')?Promise['reject'](new er(Yn(_0xafe56b,'AI_ERROR_CONTEXT_LENGTH'))):_0x3587a5['includes']('Moderation')?Promise['reject'](new er(Yn(_0xafe56b,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x3587a5));}}async['prepareMessages'](_0x335ac8,_0x327778,_0x304408){let _0x24dc6b,_0x518459;return _0x327778?(_0x24dc6b='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.',_0x518459='Instruction:\x0a'+_0x335ac8+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x327778):(_0x24dc6b='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.',_0x518459=_0x335ac8),[{'role':'system','content':_0x24dc6b},{'role':'user','content':_0x518459}];}async['_readStreamableResponse'](_0x1fe465,_0x21bf76){const _0xcb105c=_0x1fe465['body']['getReader'](),_0x29d8ac=new TextDecoder();let _0x2101c8='',_0x2299c7='',_0x429e66='',_0x3211c7=!0x1;for(;!_0x3211c7;){const {done:_0x399aba,value:_0x5e71c5}=await _0xcb105c['read'](),_0x873162=_0x2101c8+_0x29d8ac['decode'](_0x5e71c5);let _0x2415c2='';_0x3211c7=_0x399aba;try{_0x2415c2=this['_cleanUpData'](_0x873162),_0x2101c8='';}catch{_0x2101c8=_0x873162;continue;}_0x2299c7+=_0x2415c2,!_0x3211c7&&this['_isBufferIncomplete'](_0x2299c7)||_0x2299c7&&(_0x429e66+=_0x2299c7,_0x2299c7='',_0x21bf76(_0x429e66));}return Promise['resolve']();}async['_readStaticResponse'](_0xe8e60b,_0x38dcbc){return _0x38dcbc((await _0xe8e60b['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x2a8797){const _0x46f80a=_0x2a8797['split']('<')['length']!==_0x2a8797['split']('>')['length'],_0xc3f3f7=_0x2a8797['length']<0x1e;return _0x46f80a&&_0xc3f3f7;}['_cleanUpData'](_0x10b0a1){return _0x10b0a1['split'](/\n(?![^{]*\})/g)['map'](_0x3ad556=>_0x3ad556['replace']('data:\x20',''))['filter'](_0x4ed128=>_0x4ed128&&_0x4ed128['length']>0x0&&'[DONE]'!==_0x4ed128)['map'](_0x48c08c=>{const {choices:_0x1303af}=JSON['parse'](_0x48c08c);if(_0x1303af[0x0]?.['delta']?.['content'])return _0x1303af[0x0]['delta']['content'];})['filter'](_0x539e9d=>_0x539e9d)['join']('');}}class zn extends qe{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x1f81cc){super(_0x1f81cc),_0x1f81cc['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x1f81cc['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']=_0x1f81cc['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x1f81cc['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x1f81cc['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x1f81cc['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x240e32,context:_0x12fa85,onData:_0x4f2951,actionId:_0x84348e}){const {model:_0x3cb261,stream:_0x1f792c,..._0x1bc8c2}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x84348e),_0x199485={'prompt':await this['preparePrompt'](_0x240e32,_0x12fa85,_0x3cb261,_0x84348e),..._0x1bc8c2};this['_apiUrl']?await this['_processProxyRequest'](_0x199485,_0x3cb261,_0x1f792c,_0x4f2951,_0x84348e):await this['_processAWSRequest'](_0x199485,_0x3cb261,_0x1f792c,_0x4f2951);}async['preparePrompt'](_0x8c50c7,_0x5fba36,_0x33588a,_0x32ad0b){let _0x1ea9a9,_0x508894;return _0x5fba36?(_0x1ea9a9='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.',_0x508894='Instruction:\x0a'+_0x8c50c7+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x5fba36):(_0x1ea9a9='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.',_0x508894=_0x8c50c7),'meta.llama'==this['getModelFamily'](_0x33588a)?'<<SYS>>\x0a'+_0x1ea9a9+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x508894+'\x0a[/INST]':'Human:\x0a'+_0x1ea9a9+'\x0a'+_0x508894+'\x0a\x0aAssistant:';}['getModelFamily'](_0x60c059){if(/^anthropic\.claude/['test'](_0x60c059))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x60c059))return'ai21.j2';if(/^cohere\.command/['test'](_0x60c059))return'cohere.command';if(/^meta\.llama/['test'](_0x60c059))return'meta.llama';throw new er(Yn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x60c059));}async['_processProxyRequest'](_0x186d2c,_0x15fa67,_0x2ba023,_0x890548,_0x310283){const _0xc79158={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x310283),'body':JSON['stringify']({..._0x186d2c,'model':_0x15fa67,'stream':_0x2ba023}),'signal':this['abortController']['signal']},_0x426e2a=await fetch(this['_apiUrl'],_0xc79158);_0x2ba023?await this['_readStreamableResponse'](_0x426e2a,_0x15fa67,_0x890548):await this['_readStaticResponse'](_0x426e2a,_0x15fa67,_0x890548);}async['_processAWSRequest'](_0x4bfd2b,_0x2c1cfa,_0x244b15,_0x1452a5){const _0x38cb2b=new _0x978f5f(this['_bedrockClientConfig']),_0x4df590={'body':JSON['stringify'](_0x4bfd2b),'contentType':'application/json','accept':'application/json','modelId':_0x2c1cfa};let _0x5ebce;if(_0x244b15){const _0x44dd1b=new _0x438d78(_0x4df590);_0x5ebce=await _0x38cb2b['send'](_0x44dd1b,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x5ebce,_0x2c1cfa,_0x1452a5);}else{const _0x7007c5=new _0x31c8cb(_0x4df590);_0x5ebce=await _0x38cb2b['send'](_0x7007c5,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x5ebce,_0x2c1cfa,_0x1452a5);}}async['_readAsyncIterableResponse'](_0x4bdfc4,_0x5754ce,_0x47bc0d){const _0xc96036=_0x4bdfc4['body'],_0x53f469=new TextDecoder('utf-8');let _0x40b841='';for await(const _0x534825 of _0xc96036)if(_0x534825['chunk']){const _0x3a6349=_0x53f469['decode'](_0x534825['chunk']['bytes']),_0x4c7912=JSON['parse'](_0x3a6349);_0x40b841+=this['_getGeneratedText'](_0x4c7912,_0x5754ce),_0x47bc0d(_0x40b841);}return Promise['resolve']();}async['_readStreamableResponse'](_0x46a418,_0xe8e1d2,_0x538e97){const _0x4b560a=_0x46a418['body'],_0x33b1c5=new TextDecoder('utf-8'),_0x37bb97=_0x4b560a['getReader']();let _0x2aea46='',_0x157190='',_0x3c9340=!0x1;for(;!_0x3c9340;){const {done:_0x2025b6,value:_0x519298}=await _0x37bb97['read']();if(_0x3c9340=_0x2025b6,_0x3c9340)break;const _0x442a06=(_0x2aea46+_0x33b1c5['decode'](_0x519298))['split']('\x0a')['map'](_0x39b3a9=>{try{return _0x2aea46='',JSON['parse'](_0x39b3a9);}catch{return _0x2aea46=_0x39b3a9,null;}})['filter'](_0x15f394=>null!==_0x15f394);_0x442a06['length']&&(_0x157190+=_0x442a06['map'](_0x4f5b9f=>this['_getGeneratedText'](_0x4f5b9f,_0xe8e1d2))['join'](''),_0x538e97(_0x157190));}return Promise['resolve']();}async['_readStaticResponse'](_0x2d7178,_0x12c9f7,_0x27e029){let _0x343871;return _0x343871=_0x2d7178 instanceof Response?await _0x2d7178['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x2d7178['body'])),(_0x27e029(this['_getGeneratedText'](_0x343871,_0x12c9f7)),Promise['resolve']());}['_getGeneratedText'](_0x2074db,_0x272168){switch(this['getModelFamily'](_0x272168)){case'anthropic.claude':return _0x2074db['completion'];case'ai21.j2':return _0x2074db['completions'][0x0]['data']['text'];case'cohere.command':return _0x2074db['generations'][0x0]['text'];case'meta.llama':return _0x2074db['generation'];}}}class ia extends _0x3fc85a{constructor(_0x382cdd,_0x27d90e={}){super(_0x382cdd),this['isToggleable']=!0x0,this['set']('side',_0x27d90e['side']||'top');const _0x556fe0=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x503037(_0x27d90e['class']||[]),_0x556fe0['to']('side',_0x319219=>'ck-tab-button_'+_0x319219),_0x556fe0['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x538d57{['children'];constructor(_0x1a8847,_0x383984={}){super(_0x1a8847);const _0x2a7a27=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x503037(_0x383984['class']||[]),_0x2a7a27['to']('class'),_0x2a7a27['if']('isVisible','ck-hidden',_0xaf1b3a=>!_0xaf1b3a)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x538d57{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x51dbab,_0x14d4ca={}){super(_0x51dbab),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x14d4ca['side']||'top'),this['set']('isMaximized',!0x1);const _0xf5c86e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x503037(_0x14d4ca['class']||[]),_0xf5c86e['to']('side',_0x214d44=>'ck-tabs_'+_0x214d44),_0xf5c86e['to']('class'),_0xf5c86e['to']('isMaximized',_0x26d6d7=>_0x26d6d7?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0xf5c86e['to']('side',_0x22368e=>'ck-tabs__buttons-container_'+_0x22368e)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0xf5c86e['to']('side',_0x2a1294=>'ck-tabs__panels-container_'+_0x2a1294)]},'children':this['panelViews']},..._0x503037(_0x14d4ca['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x344ff8){const _0x2ba2fd=this['_tabs']['get'](_0x344ff8);return _0x2ba2fd||null;}['addTab'](_0x1e3bb9){const _0x2302c7=this['_setupButton']({'id':_0x1e3bb9['id'],'label':_0x1e3bb9['buttonLabel'],'icon':_0x1e3bb9['buttonIcon'],'order':_0x1e3bb9['order']}),_0x2adc64=new ea(this['locale']);return _0x2adc64['render'](),_0x1e3bb9['content']&&_0x2adc64['children']['add'](_0x1e3bb9['content']),this['panelViews']['add'](_0x2adc64),this['_tabs']['set'](_0x1e3bb9['id'],{'button':_0x2302c7,'panel':_0x2adc64,'order':void 0x0!==_0x1e3bb9['order']?_0x1e3bb9['order']:null}),this['fire']('addTab:'+_0x1e3bb9['id'],{'id':_0x1e3bb9['id'],'button':_0x2302c7,'panel':_0x2adc64}),null===this['activeTab']?this['activateTab'](_0x1e3bb9['id']):this['_hidePanel'](_0x1e3bb9['id']),{'button':_0x2302c7,'panel':_0x2adc64};}['activateTab'](_0x5540a2){if(null!==_0x5540a2&&!this['getTab'](_0x5540a2))throw new _0x1500e8('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x5540a2});this['activeTab']!==_0x5540a2&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x5540a2,_0x5540a2&&this['_showPanel'](_0x5540a2),this['fire']('activateTab:'+_0x5540a2,_0x5540a2));}['showTab'](_0x3cd810){if(!this['getTab'](_0x3cd810))throw new _0x1500e8('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x3cd810});this['_showPanel'](_0x3cd810),this['_showButton'](_0x3cd810),this['fire']('show:'+_0x3cd810,_0x3cd810);}['hideTab'](_0x4f5365){if(!this['getTab'](_0x4f5365))throw new _0x1500e8('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x4f5365});const _0x24d28b=this['activeTab'];this['_hidePanel'](_0x4f5365),this['_hideButton'](_0x4f5365);const _0x369f9=this['getTabIds']();_0x24d28b===_0x4f5365&&_0x369f9['length']>0x1&&this['activateTab'](_0x369f9['find'](_0x50fe25=>_0x50fe25!==_0x4f5365)),this['fire']('hide:'+_0x4f5365,_0x4f5365);}['_getPanel'](_0x1bec31){const _0x30fa09=this['_tabs']['get'](_0x1bec31);return _0x30fa09?_0x30fa09['panel']:null;}['_showPanel'](_0x38a9a5){null!==this['activeTab']&&this['activeTab']!==_0x38a9a5||this['_getPanel'](_0x38a9a5)['show']();}['_hidePanel'](_0x4ef127){const _0x17491e=this['_getPanel'](_0x4ef127);_0x17491e['isVisible']&&(this['activeTab']===_0x4ef127&&(this['activeTab']=null),_0x17491e['hide']());}['_getButton'](_0x3abbeb){const _0x16bf18=this['_tabs']['get'](_0x3abbeb);return _0x16bf18?_0x16bf18['button']:null;}['_showButton'](_0x5cf3fa){this['_getButton'](_0x5cf3fa)['show']();}['_hideButton'](_0x34e7e3){this['_getButton'](_0x34e7e3)['hide']();}['_setupButton'](_0x52e78c){const _0x49144c=new ia(this['locale'],{'side':this['side']}),_0xbae0b6=this['buttonViews'];if(_0x49144c['set']({'label':_0x52e78c['label'],'icon':_0x52e78c['icon'],'tooltip':!0x0,'withText':!0x0}),_0x49144c['bind']('isOn')['to'](this,'activeTab',_0x28a215=>_0x28a215===_0x52e78c['id']),_0x49144c['bind']('side')['to'](this,'side'),_0x52e78c['order']){const _0x134e8d=[...this['_tabs']]['reduce']((_0x167a32,_0x2b8194)=>{const _0x581a44=_0x2b8194[0x0],{order:_0x363c60}=_0x2b8194[0x1];return!_0x363c60||_0x363c60>_0x52e78c['order']?_0x167a32:_0x363c60>=_0x167a32['order']?{'id':_0x581a44,'order':_0x363c60}:_0x167a32;},{'id':'','order':0x0}),_0x257cc9=_0xbae0b6['getIndex'](this['_getButton'](_0x134e8d['id']));_0xbae0b6['add'](_0x49144c,_0x257cc9+0x1);}else _0xbae0b6['add'](_0x49144c);return _0x49144c['on']('execute',()=>{this['activateTab'](_0x52e78c['id']);}),_0x49144c;}}const Ti=['overlay','sidebar','custom'],yi=['left','right'];class bi extends ss{constructor(_0x5b17ec,_0xf4f23f={}){super(_0x5b17ec,_0xf4f23f),this['set']('type',_0xf4f23f['type']||'sidebar'),this['set']('side',_0xf4f23f['side']||'right'),this['set']('isVisible',_0xf4f23f['visibleByDefault']??!0x0);const _0x1a5385=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x1a5385['if']('type','ck-ai-tabs__overlay',_0x5519cd=>'overlay'===_0x5519cd),_0x1a5385['if']('type','ck-ai-tabs__sidebar',_0x569139=>'sidebar'===_0x569139),_0x1a5385['if']('isVisible','ck-hidden',_0x348e00=>!_0x348e00)]}}),this['buttonViews']['on']('add',(_0x500cb6,_0x396a83)=>{_0x396a83['set']('withText',!0x1);});}}class H extends _0x37abb2{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2e0a73){super(_0x2e0a73);const _0x291c41=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x291c41)throw new _0x1500e8('ai-tabs-configuration-not-found');if(void 0x0!==_0x291c41['showResizeButton']&&(this['showResizeButton']=_0x291c41['showResizeButton']),'sidebar'!==_0x291c41['type']&&'overlay'!==_0x291c41['type']||_0x291c41['side']&&(this['side']=_0x291c41['side']),'sidebar'===_0x291c41['type']){if(this['container']=_0x291c41['element'],this['set']('type','sidebar'),!this['container'])throw new _0x1500e8('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x291c41['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new bi(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x291c41['visibleByDefault']||_0x291c41['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 _0x5a6451&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x4f9990){if(_0x4f9990&&this['type']!==_0x4f9990){if(!Ti['includes'](_0x4f9990))throw new _0x1500e8('ai-tabs-unsupported-ui-type');this['type']=_0x4f9990;}}['switchSide'](_0x3bc225){if(_0x3bc225&&this['side']!==_0x3bc225){if(!yi['includes'](_0x3bc225))throw new _0x1500e8('ai-tabs-unsupported-ui-side');this['side']=_0x3bc225;}}['resize'](){this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class s extends _0x37abb2{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x25e2f3){super(_0x25e2f3),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 _0x5d433c=this['context']['plugins']['get']('CloudServices');if(!_0x5d433c['token'])throw new _0x1500e8('ai-missing-token',this);this['_token']=_0x5d433c['token'];}['startConversation'](_0x469600,_0x562537){const _0x57d5ce=this['_sendApiRequest']('/conversations','POST',{'id':_0x469600,'group':_0x562537});return{'getConversation':async()=>(await _0x57d5ce['request'])['json'](),'abortController':_0x57d5ce['abortController']};}['queryAssistant']({message:_0x37b8c4,conversationId:_0x3aa650,parts:_0x1be833,capabilities:_0x312205,model:_0x563aaf,attributes:_0x4f561b}){const _0x163f35={'prompt':_0x37b8c4,'content':_0x1be833,'model':_0x563aaf,..._0x312205&&{'capabilities':_0x312205},..._0x4f561b&&{'attributes':_0x4f561b}},_0x45cca0=this['_sendApiRequest']('/conversations/'+_0x3aa650+'/messages','POST',_0x163f35);return{'getStream':async()=>{const _0x1f71e0=(await _0x45cca0['request'])['body'];return this['_getStreamReader'](_0x1f71e0);},'abortController':_0x45cca0['abortController']};}['executeCustomAction']({content:_0x4277e9,message:_0xec2f01,model:_0x507787,outputFormat:_0x4ce40}){const _0x2fbd75={'content':[{'type':'text','content':_0x4277e9}],'prompt':_0xec2f01,'model':_0x507787,'outputFormat':_0x4ce40},_0x1e4459=this['_sendApiRequest']('/actions/custom/calls','POST',_0x2fbd75);return{'getStream':async()=>{const _0x2dab19=(await _0x1e4459['request'])['body'];return this['_getStreamReader'](_0x2dab19);},'abortController':_0x1e4459['abortController']};}['executeAction']({actionName:_0x594167,content:_0x2c6498,args:_0x1b6a0e}){const _0x12920f={'content':[{'type':'text','content':_0x2c6498}],'args':_0x1b6a0e},_0x158443=this['_sendApiRequest']('/actions/system/'+_0x594167+'/calls','POST',_0x12920f);return{'getStream':async()=>{const _0x20f055=(await _0x158443['request'])['body'];return this['_getStreamReader'](_0x20f055);},'abortController':_0x158443['abortController']};}['uploadFile'](_0x7dcc3a,_0x48881f,_0x20094b){const _0x28107e=new FormData();_0x28107e['append']('file',_0x48881f,_0x48881f['name']),_0x20094b&&_0x28107e['append']('attributes',JSON['stringify'](_0x20094b));const _0x4a4739=this['_sendApiRequest']('/conversations/'+_0x7dcc3a+'/files','POST',_0x28107e);return{'getId':async()=>(await _0x4a4739['request'])['json'](),'abortController':_0x4a4739['abortController']};}['fetchDocument'](_0x1a6d6d,_0x19c1e0){const _0x497a5a=this['_sendApiRequest']('/conversations/'+_0x1a6d6d+'/documents/'+_0x19c1e0,'GET');return{'getDocument':async()=>(await _0x497a5a['request'])['json'](),'abortController':_0x497a5a['abortController']};}['uploadDocument'](_0x59b468,_0x693390,_0x14934a){const _0x47c602={'content':_0x693390};_0x14934a&&(_0x47c602['attributes']=_0x14934a);const _0x2a82b1=this['_sendApiRequest']('/conversations/'+_0x59b468+'/documents','POST',_0x47c602);return{'getId':async()=>(await _0x2a82b1['request'])['json'](),'abortController':_0x2a82b1['abortController']};}['fetchConversations'](_0x22142a,_0x4ed75e={}){const _0x1ad596=new URLSearchParams();_0x1ad596['append']('group',_0x22142a),_0x1ad596['append']('excludeEmpty',!0x1!==_0x4ed75e['excludeEmpty']?'true':'false'),_0x1ad596['append']('limit',_0x4ed75e['limit']?_0x4ed75e['limit']['toString']():'100'),_0x1ad596['append']('sortBy',_0x4ed75e['sortBy']?_0x4ed75e['sortBy']:'createdAt'),_0x1ad596['append']('order',_0x4ed75e['order']?_0x4ed75e['order']:'desc');const _0x5f1753=this['_sendApiRequest']('/conversations?'+_0x1ad596['toString'](),'GET');return{'getConversations':async()=>{const _0x39a51c=await _0x5f1753['request'];return(await _0x39a51c['json']())['items'];},'abortController':_0x5f1753['abortController']};}['deleteConversation'](_0x47a662){const _0x11be49=this['_sendApiRequest']('/conversations/'+_0x47a662,'DELETE');return{'execute':async()=>{await _0x11be49['request'];},'abortController':_0x11be49['abortController']};}['updateConversation'](_0x5b8159,_0x17f3aa){const _0x47eead=this['_sendApiRequest']('/conversations/'+_0x5b8159,'PATCH',_0x17f3aa);return{'getResult':async()=>(await _0x47eead['request'],_0x17f3aa),'abortController':_0x47eead['abortController']};}['fetchConversation'](_0x139056){const _0x312888=this['_sendApiRequest']('/conversations/'+_0x139056,'GET');return{'getConversation':async()=>(await _0x312888['request'])['json'](),'abortController':_0x312888['abortController']};}['fetchConversationMessages'](_0x4f4d5a){const _0x231bf7=this['_sendApiRequest']('/conversations/'+_0x4f4d5a+'/messages','GET');return{'getMessages':async()=>{const _0x4c5959=await _0x231bf7['request'];return(await _0x4c5959['json']())['items'];},'abortController':_0x231bf7['abortController']};}['uploadUrl'](_0x48c978,_0xbe7149,_0x8e0678){const _0x20dbd0=this['_sendApiRequest']('/conversations/'+_0x48c978+'/web-resources','POST',{'url':_0xbe7149,'attributes':_0x8e0678});return{'getId':async()=>(await _0x20dbd0['request'])['json'](),'abortController':_0x20dbd0['abortController']};}['getModels'](_0x138bb3='en'){const _0x44625e=new URLSearchParams();_0x44625e['append']('language',_0x138bb3);const _0x391d58='/models/1?'+_0x44625e['toString'](),_0xf7f1e5=this['_sendApiRequest'](_0x391d58,'GET');return{'list':async()=>await(await _0xf7f1e5['request'])['json'](),'abortController':_0xf7f1e5['abortController']};}['deleteFile'](_0x2e7de9,_0x50d26d){const _0x227333=this['_sendApiRequest']('/conversations/'+_0x2e7de9+'/files/'+_0x50d26d,'DELETE');return{'execute':async()=>{await _0x227333['request'];},'abortController':_0x227333['abortController']};}['deleteDocument'](_0x166796,_0x5ef208){const _0x2ec76d=this['_sendApiRequest']('/conversations/'+_0x166796+'/documents/'+_0x5ef208,'DELETE');return{'execute':async()=>{await _0x2ec76d['request'];},'abortController':_0x2ec76d['abortController']};}['deleteWebResource'](_0xdf3550,_0x1599fb){const _0x3cb30b=this['_sendApiRequest']('/conversations/'+_0xdf3550+'/web-resources/'+_0x1599fb,'DELETE');return{'execute':async()=>{await _0x3cb30b['request'];},'abortController':_0x3cb30b['abortController']};}['callSystemReview']({reviewName:_0xced7f6,content:_0x2bd62,args:_0x13517a}){const _0x497ec9=this['_sendApiRequest']('/reviews/system/'+_0xced7f6+'/calls','POST',{'content':[{'type':'text','content':_0x2bd62}],'args':_0x13517a});return{'getStream':async()=>{const _0x20934f=(await _0x497ec9['request'])['body'];return this['_getStreamReader'](_0x20934f);},'abortController':_0x497ec9['abortController']};}['callCustomReview']({content:_0x2f3b57,prompt:_0x12a25a,model:_0x536a62}){const _0x113ed8=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x2f3b57}],'prompt':_0x12a25a,'model':_0x536a62});return{'getStream':async()=>{const _0x15e0a0=(await _0x113ed8['request'])['body'];return this['_getStreamReader'](_0x15e0a0);},'abortController':_0x113ed8['abortController']};}['upsertAIChatRating'](_0x90d302,_0x3fae02,_0x5e2b3e){const _0xc0e3de=this['_sendApiRequest']('/conversations/'+_0x90d302+'/messages/'+_0x3fae02+'/ratings','PUT',{'positiveCount':_0x5e2b3e['positiveCount'],'totalCount':_0x5e2b3e['totalCount'],'modificationId':_0x5e2b3e['modificationId']});return{'execute':async()=>{await _0xc0e3de['request'];},'abortController':_0xc0e3de['abortController']};}['upsertAIActionRating'](_0x469fd2,_0x188fad,_0x511efb){const _0x5e0d39=this['_sendApiRequest']('/actions/system/'+_0x469fd2+'/calls/'+_0x188fad+'/ratings','PUT',{'positiveCount':_0x511efb['positiveCount'],'totalCount':_0x511efb['totalCount']});return{'execute':async()=>{await _0x5e0d39['request'];},'abortController':_0x5e0d39['abortController']};}['upsertCustomAIActionRating'](_0x2257ca,_0x5a9fff){const _0x406a5f=this['_sendApiRequest']('/actions/custom/calls/'+_0x2257ca+'/ratings','PUT',{'positiveCount':_0x5a9fff['positiveCount'],'totalCount':_0x5a9fff['totalCount']});return{'execute':async()=>{await _0x406a5f['request'];},'abortController':_0x406a5f['abortController']};}['upsertAIReviewRating'](_0x2f9c09,_0x4a08d3,_0x3af337,_0x7cb0cb){const _0x2b1143=this['_sendApiRequest']('/reviews/system/'+_0x2f9c09+'/calls/'+_0x4a08d3+'/ratings','PUT',{'positiveCount':_0x3af337['positiveCount'],'totalCount':_0x3af337['totalCount'],'dataId':_0x7cb0cb});return{'execute':async()=>{await _0x2b1143['request'];},'abortController':_0x2b1143['abortController']};}['upsertCustomAIReviewRating'](_0x5eafc9,_0x34f114,_0x1f3ca3){const _0x531472=this['_sendApiRequest']('/reviews/custom/calls/'+_0x5eafc9+'/ratings','PUT',{'positiveCount':_0x34f114['positiveCount'],'totalCount':_0x34f114['totalCount'],'dataId':_0x1f3ca3});return{'execute':async()=>{await _0x531472['request'];},'abortController':_0x531472['abortController']};}['_sendApiRequest'](_0x440eea,_0x1244ba,_0x1d513f){const _0x239f29=new AbortController(),_0x565b09=_0x1d513f instanceof FormData,_0x21bbf9={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x1d513f&&!_0x565b09&&(_0x21bbf9['Content-Type']='application/json');const _0x9e83db={'method':_0x1244ba,'headers':_0x21bbf9,'signal':_0x239f29['signal']};return _0x1d513f&&(_0x9e83db['body']=_0x565b09?_0x1d513f:JSON['stringify'](_0x1d513f)),{'request':fetch(''+this['_apiUrl']+_0x440eea,_0x9e83db)['catch'](_0x43584b=>{this['_handleError'](_0x43584b);})['then'](_0x164c08=>_0x164c08['ok']?_0x164c08:_0x164c08['json']()['then'](_0x36a95d=>{throw{'url':this['_apiUrl'],'path':_0x440eea,'method':_0x1244ba,'body':_0x1d513f,'status':(_0x164c08||{})['status'],'statusText':(_0x164c08||{})['statusText'],'code':_0x36a95d['code'],'message':_0x36a95d['message'],'traceId':_0x36a95d['traceId']};})),'abortController':_0x239f29};}async*['_getStreamReader'](_0x2521f9){const _0xc2db25=[],_0x17c978=_0x2521f9['getReader'](),_0x40e5e8=gt({'onError':_0x4eb933=>{this['_handleError'](_0x4eb933);},'onEvent':_0xc8ebe1=>{_0xc8ebe1['data']=JSON['parse'](_0xc8ebe1['data']),_0xc2db25['push'](_0xc8ebe1);}});try{let _0x29b934=!0x1;for(;!_0x29b934;){const {done:_0x9c575,value:_0x412a90}=await _0x17c978['read']();_0x9c575&&(_0x29b934=!0x0),_0x40e5e8['feed'](this['_decoder']['decode'](_0x412a90,{'stream':!0x0})),yield*_0xc2db25,_0xc2db25['length']=0x0;}}catch(_0x1b5d71){this['_handleError'](_0x1b5d71);}finally{_0x17c978['releaseLock'](),_0x40e5e8['reset']();}}['_handleError'](_0x391908){if(_0x391908 instanceof _0x1500e8)throw _0x391908;if(_0x391908 instanceof Error&&'AbortError'===_0x391908['name'])throw new _0x1500e8('ai-request-aborted',this,{'originalError':_0x391908});throw new _0x1500e8('ai-request-failed',this,{'originalError':_0x391908});}}function m(_0x17900d,_0x10ebab,_0x462d2d){const t=_0x17900d['t'];switch(_0x10ebab){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'},_0x462d2d);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.'},_0x462d2d);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.'},_0x462d2d);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.'},_0x462d2d);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'},_0x462d2d);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x462d2d);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'},_0x462d2d);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.'},_0x462d2d);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.'},_0x462d2d);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.'},_0x462d2d);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.'},_0x462d2d);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'},_0x462d2d);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.'},_0x462d2d);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 _0x10ebab;}}function Cs(_0xe8d494,_0x506bf5){const _0x601a5e=new _0x3fc85a(_0xe8d494),_0x120cec=m(_0xe8d494,'AI_TABS_LABEL_MINIMIZE'),_0xe1b38d=m(_0xe8d494,'AI_TABS_LABEL_MAXIMIZE');return _0x601a5e['set']({'withText':!0x1,'icon':_0x2b97b8,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary'}),_0x601a5e['bind']('label')['to'](_0x506bf5,'isMaximized',_0x3cdc1=>_0x3cdc1?_0x120cec:_0xe1b38d),_0x601a5e['bind']('icon')['to'](_0x506bf5,'isMaximized',_0x3f7eaf=>_0x3f7eaf?_0x3bc269:_0x2b97b8),_0x601a5e['bind']('isOn')['to'](_0x506bf5,'isMaximized'),_0x601a5e['on']('execute',()=>{_0x506bf5['fire']('resizeTabs');}),_0x601a5e;}function Qe(_0x9ea90e){return _0x13b8bc(_0x9ea90e);}function Y(_0x1bb8c8){return _0x2aee41(_0x1bb8c8);}function Z(_0x28d802,_0x1e7d90,_0x37af93){const _0x146206=null!==_0x1e7d90?_0x14d4f8=>_0x14d4f8['attribs'][_0x28d802]===_0x1e7d90:_0x28190e=>Boolean(_0x28190e['attribs'][_0x28d802]);return _0x32e3c1(_0x3619af=>_0x32b8a9(_0x3619af)&&_0x146206(_0x3619af),_0x37af93);}function Ki(_0x5720d6,_0x3b64e1,_0x5ea439){const _0x3141cd=null!==_0x3b64e1?_0x5605cb=>_0x5605cb['attribs'][_0x5720d6]===_0x3b64e1:_0x22bfbd=>Boolean(_0x22bfbd['attribs'][_0x5720d6]);return _0x51c105(_0x2bf3f9=>_0x32b8a9(_0x2bf3f9)&&_0x3141cd(_0x2bf3f9),_0x5ea439);}function q(_0x4cd465,_0x4d7200){return _0x4cd465&&_0x32b8a9(_0x4cd465)?_0x4cd465['attribs'][_0x4d7200]:null;}function Es(_0x2716c4,_0x583a47,_0x31c9dc){_0x32b8a9(_0x2716c4)&&(null===_0x31c9dc?delete _0x2716c4['attribs'][_0x583a47]:_0x2716c4['attribs'][_0x583a47]=_0x31c9dc);}function Zi(_0x1fff1c,_0x7c69ea,_0x274a5e){const _0x1294ee=_0x7c69ea['cloneNode'](!0x0);'beforebegin'===_0x274a5e?_0x4512fa(_0x1fff1c,_0x1294ee):'afterbegin'===_0x274a5e?_0x56829d(_0x1fff1c,_0x1294ee):'beforeend'===_0x274a5e?_0x56184d(_0x1fff1c,_0x1294ee):'afterend'===_0x274a5e&&_0x4dcf7a(_0x1fff1c,_0x1294ee);}function Ke(_0x79ee04){const _0x42176f=[];let _0x61f828=_0x79ee04;for(;_0x61f828;)_0x61f828=_0x11e924(_0x61f828),_0x61f828&&_0x42176f['push'](_0x61f828);return _0x42176f;}function Jn(_0x33747f){return _0x33747f['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Ss(_0xe47165){let _0x4c1ad=0x0;for(;_0xe47165['parentNode'];)_0xe47165=_0xe47165['parentNode'],_0x4c1ad++;return _0x4c1ad;}function Ws(_0x13c893){const _0x571cc4=[];let _0x169172=_0x13c893['nextSibling'];for(;_0x169172;)_0x571cc4['push'](_0x169172),_0x169172=_0x169172['nextSibling'];_0x571cc4['forEach'](_0x5c2776=>{_0x7119c8(_0x5c2776);});}class Ze extends/* #__PURE__ -- @preserve */
|
|
25
|
+
Vt(){['_m2html'];constructor(){super(),this['_m2html']=new _0x7213b8();}['convertMarkdownToHTML'](_0x6b4cf1){const _0xc832be=this['_m2html']['parse'](_0x6b4cf1);return this['parseAndNormalizeHTML'](_0xc832be);}['parseAndNormalizeHTML'](_0x5164e0){return this['_parseHTML'](_0x5164e0);}['_parseHTML'](_0x385e25){const _0x3240d1=Qe('<dummy>'+_0x385e25['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x3240d1['children']=_0x3240d1['children'][0x0]['children'],_0x3240d1;}}class $e extends/* #__PURE__ -- @preserve */
|
|
26
|
+
Vt(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x57a1ad){super(),this['_generateUid']=_0x57a1ad||_0x3e4e8c;}['merge'](_0xf32982,_0x561cb2,_0x4371fd){const _0x1dc309=_0xf32982['cloneNode'](!0x0);if(0x0===_0x561cb2['childNodes']['length']){const _0x2fc45a=[];return Ki('data-id','new-element',_0x1dc309)['forEach'](_0x542e6d=>{const _0x10305c=this['_generateUid']();Es(_0x542e6d,'data-id',_0x10305c),_0x2fc45a['push'](_0x10305c);}),this['_removeSpecialComments'](_0x1dc309),{'parsedContent':_0x1dc309,'newNodeIds':_0x2fc45a,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x4371fd&&_0x4371fd['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x1dc309),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Ki('data-id',null,_0x561cb2)['map'](_0x5b86a3=>q(_0x5b86a3,'data-id'))['filter'](_0x5ba948=>!!_0x5ba948));let _0x25a19c=-0x1,_0x42e5de=!0x1;const _0x3cecf9=_0x1dc309['childNodes'],_0x105d56=Array['from'](_0x3cecf9)['filter'](_0x3a5a54=>!(0x3===_0x3a5a54['nodeType']&&''===Y(_0x3a5a54)['trim']())),_0x599d8f=_0x105d56['length'];for(let _0x3327cb=0x0;_0x3327cb<_0x599d8f;_0x3327cb++){const _0x308a8d=_0x105d56[_0x3327cb],_0x1fc8e4=_0x105d56[_0x3327cb+0x1];if(this['_isNewNode'](_0x308a8d)){if(-0x1===_0x25a19c&&(_0x25a19c=_0x3327cb),this['_markWrappedElements'](_0x308a8d),!this['_isNewNode'](_0x1fc8e4)){const [_0x1c6c0c,_0x251c7d]=this['_findReferenceNode'](_0x308a8d,_0x42e5de,_0x561cb2);if(_0x1c6c0c){const _0xc03fbc=Array['from'](_0x105d56)['slice'](_0x25a19c,_0x3327cb+0x1);this['_insertNodes'](_0x1c6c0c,_0xc03fbc,_0x251c7d),_0x25a19c=-0x1;}}}else{if(this['_isExistingContentComment'](_0x308a8d))_0x42e5de=!0x0;else{if(this['_isExistingNode'](_0x308a8d)){const _0x31fd00=q(_0x308a8d,'data-id');if(_0x31fd00&&this['_existingDataIds']['has'](_0x31fd00)){const _0x2bfd6e=Z('data-id',_0x31fd00,_0x561cb2);this['_replaceNode'](_0x2bfd6e,_0x308a8d);}if(this['_touchedNodesState']['removedIds']['includes'](_0x31fd00)){const _0x15017e=this['_touchedNodesState']['removedIds']['indexOf'](_0x31fd00);this['_touchedNodesState']['removedIds']['splice'](_0x15017e,0x1);}}else{if(this['_isDelNode'](_0x308a8d)){const _0x5c6244=q(_0x308a8d,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x5c6244)||this['_storeDeletedElementIds'](_0x308a8d);}}}}}for(const _0x48c01d of this['_touchedNodesState']['removedIds']){const _0xc9b521=Z('data-id',_0x48c01d,_0x561cb2);if(_0xc9b521){if(_0x4371fd&&_0x4371fd['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x48c01d;const _0x514836=_0x4371fd['replaceRemovedWith']['cloneNode'](!0x0);Es(_0x514836,'data-id',_0x48c01d),Es(_0x514836,'data-removed','true'),_0x3d5dcc(_0xc9b521,_0x514836);}else _0x7119c8(_0xc9b521);}}if(Ki('data-wrapped-id',null,_0x561cb2)['forEach'](_0x36d9a9=>{const _0x500085=Z('data-id',q(_0x36d9a9,'data-wrapped-id'),_0x561cb2);var _0x2e2bf5,_0x215a11;_0x500085&&(_0x215a11=_0x36d9a9,_0x7119c8(_0x2e2bf5=_0x500085),_0x3d5dcc(_0x215a11,_0x2e2bf5));}),Ki('data-id','new-element',_0x561cb2)['forEach'](_0x106482=>{const _0x4a5bb4=this['_getUid'](_0x106482);Es(_0x106482,'data-id',_0x4a5bb4),this['_touchedNodesState']['newIds']['push'](_0x4a5bb4);}),this['_removeSpecialComments'](_0x561cb2),_0x4371fd&&_0x4371fd['markUnstableElements']&&this['_markUnstableElements'](_0x561cb2,_0x4371fd['markUnstableElementsDepth']||0x0),_0x4371fd&&_0x4371fd['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x39e46b=Z('data-id',this['_touchedNodesState']['lastTouchedId'],_0x561cb2);for(;_0x39e46b;)Ws(_0x39e46b),_0x39e46b=_0x39e46b['parentNode'];}return{'parsedContent':_0x561cb2,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x3ff1b7,_0x48eef5,_0x5d8bdb){for(const _0x41b1ea of _0x48eef5){const _0x3687d1=this['_getUid'](_0x41b1ea);Es(_0x41b1ea,'data-id',_0x3687d1),this['_touchedNodesState']['newIds']['push'](_0x3687d1),this['_touchedNodesState']['lastTouchedId']=_0x3687d1;}const _0x49ef22='afterbegin'===_0x5d8bdb||'afterend'===_0x5d8bdb?_0x48eef5['reverse']():_0x48eef5;for(const _0x323e2b of _0x49ef22)Zi(_0x3ff1b7,_0x323e2b,_0x5d8bdb);}['_replaceNode'](_0x3b134a,_0x403db7){if(!_0x3b134a)return;if(_0x20fb07=_0x403db7,Jn(Y(_0x3b134a))===Jn(Y(_0x20fb07)))return;var _0x20fb07;const _0x5cffcc=this['_getUid'](_0x3b134a);Es(_0x403db7,'data-id',_0x5cffcc),this['_touchedNodesState']['modifiedIds']['push'](_0x5cffcc),this['_touchedNodesState']['lastTouchedId']=_0x5cffcc,_0x3d5dcc(_0x3b134a,_0x403db7['cloneNode'](!0x0));}['_findReferenceNode'](_0x5c6ce4,_0x1dc857,_0x288464){const _0x41e30e=this['_findPrevElementWithDataId'](_0x5c6ce4,!0x1);if(_0x41e30e){const _0x120cfc=this['_getNodeDataId'](_0x41e30e),_0x5b1065=Z('data-id',_0x120cfc,_0x288464);if(_0x5b1065)return[_0x5b1065,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x120cfc);}const _0x2fc355=this['_findNextElementWithDataId'](_0x5c6ce4,!0x1);if(_0x2fc355){const _0x45248e=this['_getNodeDataId'](_0x2fc355),_0x5d1a13=Z('data-id',_0x45248e,_0x288464);if(_0x5d1a13)return[_0x5d1a13,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x45248e);}return _0x1dc857?_0x5c6ce4['nextSibling']?this['_findFallbackReferenceNode'](_0x5c6ce4,_0x288464):[_0x288464['childNodes'][_0x288464['childNodes']['length']-0x1],'afterend']:[_0x288464['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x11cfbe,_0x3c288a){const _0x26c177=[],_0x2d8ffc=this['_findPrevElementWithDataId'](_0x11cfbe,!0x0);if(_0x2d8ffc){const _0x5a93d0=Z('data-id',this['_getNodeDataId'](_0x2d8ffc),_0x3c288a);_0x5a93d0&&_0x26c177['push']([_0x5a93d0,'afterend']);}const _0x5c5e4c=this['_findNextElementWithDataId'](_0x11cfbe,!0x0);if(_0x5c5e4c){const _0x252366=Z('data-id',this['_getNodeDataId'](_0x5c5e4c),_0x3c288a);_0x252366&&_0x26c177['push']([_0x252366,'beforebegin']);}if(_0x26c177['length']>0x1)return Ss(_0x26c177[0x0][0x0])<=Ss(_0x26c177[0x1][0x0])?_0x26c177[0x0]:_0x26c177[0x1];return 0x1===_0x26c177['length']?_0x26c177[0x0]:[_0x3c288a['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x56905f,_0x4e2ddb){let _0x1bad2b=_0x56905f['nextSibling'],_0x8162a5=null,_0x3a1ed9=!0x1;for(;_0x1bad2b;){if(_0x10a170(_0x1bad2b)){if(this['_isDelNode'](_0x1bad2b)&&(_0x8162a5=_0x1bad2b),this['_isExistingContentComment'](_0x1bad2b)&&_0x4e2ddb&&!_0x3a1ed9){_0x3a1ed9=!0x0,_0x1bad2b=_0x1bad2b['nextSibling'];continue;}break;}const _0x32ba63=q(_0x1bad2b,'data-id');if(_0x32ba63&&'new-element'!==_0x32ba63&&this['_existingDataIds']['has'](_0x32ba63)){_0x8162a5=_0x1bad2b;break;}_0x1bad2b=_0x1bad2b['nextSibling'];}return _0x8162a5;}['_findPrevElementWithDataId'](_0x2c4175,_0x226ba9){let _0x5d7fa2=_0x2c4175['previousSibling'],_0x491839=null,_0x11281e=!0x1;for(;_0x5d7fa2;){if(_0x10a170(_0x5d7fa2)){if(this['_isDelNode'](_0x5d7fa2)&&(_0x491839=_0x5d7fa2),this['_isExistingContentComment'](_0x5d7fa2)&&_0x226ba9&&!_0x11281e){_0x11281e=!0x0,_0x5d7fa2=_0x5d7fa2['previousSibling'];continue;}break;}const _0x3e4d24=q(_0x5d7fa2,'data-id');if(_0x3e4d24&&'new-element'!==_0x3e4d24&&this['_existingDataIds']['has'](_0x3e4d24)){_0x491839=_0x5d7fa2;break;}_0x5d7fa2=_0x5d7fa2['previousSibling'];}return _0x491839;}['_markWrappedElements'](_0x1fee71){_0x32b8a9(_0x1fee71)&&Ki('data-id',null,_0x1fee71)['forEach'](_0x4e546e=>{this['_isExistingNode'](_0x4e546e)&&!this['_hasWrappedParent'](_0x4e546e)&&(Es(_0x4e546e,'data-wrapped-id',q(_0x4e546e,'data-id')),Es(_0x4e546e,'data-id',null));});}['_getNodeDataId'](_0x56baa5){if(!_0x56baa5)return null;if(_0x32b8a9(_0x56baa5))return q(_0x56baa5,'data-id');if(_0x10a170(_0x56baa5)){const _0x199011=Y(_0x56baa5)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x199011&&_0x199011[0x1])return _0x199011[0x1];}return null;}['_storeDeletedElementIds'](_0x1fdeb6){if(_0x10a170(_0x1fdeb6)){const _0x46fb11=Y(_0x1fdeb6)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x46fb11&&_0x46fb11[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x46fb11[0x1]);}}['_getUid'](_0x5a2a4e){return this['_isExistingNode'](_0x5a2a4e)?q(_0x5a2a4e,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x284c02){(function(_0x1442f3){return _0x83201e(_0x506862=>_0x10a170(_0x506862),_0x1442f3,!0x0,0x1/0x0);}(_0x284c02)['filter'](_0x3e31bc=>this['_isDelNode'](_0x3e31bc)||this['_isExistingContentComment'](_0x3e31bc))['forEach'](_0x33ebff=>{_0x7119c8(_0x33ebff);}));}['_markLastTagElementUnstable'](_0x27fee2){const _0x20e6c7=_0x27fee2['childNodes'],_0x5ce50e=_0x20e6c7[_0x20e6c7['length']-0x1];_0x5ce50e&&_0x32b8a9(_0x5ce50e)&&Es(_0x5ce50e,'data-unstable','true');}['_markUnstableElements'](_0x3b7532,_0x85abe2){const _0x27e3d2=Z('data-unstable','true',_0x3b7532);if(!_0x27e3d2)return;const _0x46274f=Ke(_0x27e3d2)['slice'](0x0,-0x1),_0x95b9fe=_0x46274f['length'];let _0x5a7127=_0x27e3d2;if(_0x95b9fe>_0x85abe2){let _0x2de385=_0x95b9fe,_0x233b6b=null;for(;_0x2de385>_0x85abe2&&_0x2de385>=0x0;)_0x2de385--,_0x233b6b=_0x46274f[_0x2de385];_0x233b6b&&(_0x5a7127=_0x233b6b,Es(_0x27e3d2,'data-unstable',null),Es(_0x233b6b,'data-unstable','true'));}else{if(_0x95b9fe<_0x85abe2){let _0xb4a205=_0x95b9fe,_0x191b44=_0x27e3d2;for(;_0xb4a205<_0x85abe2;){const _0x301bb0=_0x191b44['childNodes']['filter'](_0x571fa5=>_0x32b8a9(_0x571fa5));if(0x0===_0x301bb0['length'])break;_0xb4a205++,_0x191b44=_0x301bb0[_0x301bb0['length']-0x1];}_0x191b44&&(_0x5a7127=_0x191b44,Es(_0x27e3d2,'data-unstable',null),Es(_0x191b44,'data-unstable','true'));}}let _0x3739fd=_0x5a7127;for(;_0x3739fd;){for(;_0x3739fd['nextSibling'];)_0x3739fd=_0x3739fd['nextSibling'],_0x32b8a9(_0x3739fd)&&Es(_0x3739fd,'data-unstable','true');_0x3739fd=_0x3739fd['parentNode'];}}['_isNewNode'](_0x32e4c5){return Boolean('new-element'===q(_0x32e4c5,'data-id'));}['_isExistingNode'](_0x3d395d){return Boolean((q(_0x3d395d,'data-id')||'')['length']>0x0&&'new-element'!==q(_0x3d395d,'data-id'));}['_isDelNode'](_0xd1fd82){return!!_0xd1fd82&&Boolean(_0x10a170(_0xd1fd82)&&Y(_0xd1fd82)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x5c5a34){let _0x1f5c79=_0x5c5a34['parentNode'];for(;_0x1f5c79;){if(q(_0x1f5c79,'data-wrapped-id'))return!0x0;_0x1f5c79=_0x1f5c79['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x3dd556){return Boolean(_0x10a170(_0x3dd556)&&Y(_0x3dd556)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function f({editor:_0x253071,changeGroups:_0x54444d,documentContextContent:_0x2c1fde,showDiff:_0x5978aa,trimUnchanged:_0x27f6d1=!0x0}){return _0x54444d['map'](_0xd74dc8=>{const _0x469d9d=new _0x175d6b([]),_0x18d2d0=new _0x175d6b([]);for(const _0x556ca3 of _0xd74dc8['changes'])if(_0x5978aa&&'removed'==_0x556ca3['type']||_0x18d2d0['children']['push'](_0x556ca3['node']['cloneNode'](!0x0)),'new'!=_0x556ca3['type']&&(_0x5978aa||'removed'!=_0x556ca3['type'])){const _0x4402f8=_0x32e3c1(_0x565730=>q(_0x565730,'data-id')==_0x556ca3['id'],_0x2c1fde,!0x0);_0x4402f8&&_0x469d9d['children']['push'](_0x4402f8['cloneNode'](!0x0));}const {content:_0xfb269d,hasChanges:_0x4c0dc3}=function(_0x4b9dae,_0x436291,_0x502362,_0xfafc26,_0x4517c4=!0x0){const _0x5c59e5=_0x4b9dae['plugins']['get']('DocumentCompare'),_0x90dd46=Y(_0x436291),_0x2f636=Y(_0x502362),_0x40d6e1=_0x4b9dae['data']['parse'](_0x90dd46,'$root'),_0x5a0e58=_0x4b9dae['model']['createPositionAt'](_0x40d6e1,0x0),_0x15dbfc=_0x5c59e5['getDiff'](_0x90dd46,_0x2f636,{'anchor':_0x5a0e58,'markDeletions':_0xfafc26}),_0x33cd9a=_0x15dbfc['getOperations']();if(0x0==_0x33cd9a['length'])return{'content':_0x436291['cloneNode'](!0x0),'hasChanges':!0x1};_0xfafc26?function(_0x51b2f3,_0x201e37,_0x11a1a8){if(0x0==_0x51b2f3['length'])return;const _0x18cea2=_0x11a1a8['plugins']['get']('DocumentCompare'),_0x32ae9d=_0x11a1a8['plugins']['get']('SuggestionsConversion');_0x11a1a8['model']['change'](_0x5cf092=>{const _0x1a90e0=new Set();for(let _0x1efe33=0x0;_0x1efe33<_0x51b2f3['length'];_0x1efe33++){const _0x46a3f2=_0x51b2f3[_0x1efe33];if(_0x46a3f2['baseVersion']=null,_0x46a3f2['isDocumentOperation']=!0x1,_0x18cea2['isMarkedRemoveOperation'](_0x46a3f2)){const _0x395f61=_0xf97f88(_0x46a3f2['newRange'],_0x11a1a8['model']),_0x4c0d5d='suggestion:deletion:'+_0x3e4e8c()+':$aiSuggestion';_0x201e37['markers']['set'](_0x4c0d5d,_0x395f61);}else switch(_0x46a3f2['type']){case'rename':{if(_0x46a3f2['oldName']==_0x46a3f2['newName'])break;_0x5cf092['batch']['addOperation'](_0x46a3f2),_0x11a1a8['model']['applyOperation'](_0x46a3f2);const _0x411de6='$elementName',_0x46cae8=_0x46a3f2['position'],_0x538254=_0x11a1a8['model']['createRange'](_0x46cae8,_0x11a1a8['model']['createPositionAt'](_0x46cae8['nodeAfter'],'end')),_0x36126e='suggestion:attribute:'+_0x411de6+':'+_0x3e4e8c()+':$aiSuggestion';_0x201e37['markers']['set'](_0x36126e,_0x538254);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x46a3f2['oldValue']==_0x46a3f2['newValue'])break;_0x5cf092['batch']['addOperation'](_0x46a3f2),_0x11a1a8['model']['applyOperation'](_0x46a3f2);const _0x3dd76c=_0x46a3f2['key'];if(!_0x32ae9d['isRegisteredAttribute'](_0x3dd76c))break;const _0x5e592c=_0xf97f88(_0x46a3f2['range'],_0x11a1a8['model']),_0x1fcc9c='suggestion:attribute:'+_0x3dd76c+':'+_0x3e4e8c()+':$aiSuggestion';_0x201e37['markers']['set'](_0x1fcc9c,_0x5e592c);break;}case'insert':{_0x5cf092['batch']['addOperation'](_0x46a3f2),_0x11a1a8['model']['applyOperation'](_0x46a3f2);if(_0x51b2f3[_0x1efe33+0x1]&&'move'==_0x51b2f3[_0x1efe33+0x1]['type']){no(_0x201e37,_0x46a3f2);break;}const _0x4eac17=_0x46a3f2['position'],_0x38f7dd=_0x46a3f2['howMany'],_0x1bb792=_0xf97f88(_0x11a1a8['model']['createRange'](_0x4eac17,_0x4eac17['getShiftedBy'](_0x38f7dd)),_0x11a1a8['model']),_0xd7c0c8='suggestion:insertion:'+_0x3e4e8c()+':$aiSuggestion';_0x201e37['markers']['set'](_0xd7c0c8,_0x1bb792);break;}case'split':{_0x5cf092['batch']['addOperation'](_0x46a3f2),_0x11a1a8['model']['applyOperation'](_0x46a3f2);const _0x5c27e0=_0x46a3f2['splitPosition'],_0x49e969=_0x46a3f2['moveTargetPosition'],_0x1349ab=_0x11a1a8['model']['createRange'](_0x5c27e0,_0x49e969),_0x572df='suggestion:insertion:'+_0x3e4e8c()+':$aiSuggestion';_0x201e37['markers']['set'](_0x572df,_0x1349ab);break;}case'move':{_0x5cf092['batch']['addOperation'](_0x46a3f2),_0x11a1a8['model']['applyOperation'](_0x46a3f2),_0x51b2f3[_0x1efe33-0x1]&&'insert'==_0x51b2f3[_0x1efe33-0x1]['type']&&no(_0x201e37,_0x46a3f2);const _0x6dc664=_0x46a3f2['getMovedRangeStart'](),_0x45e802=_0x46a3f2['howMany'];for(let _0x3d9843=0x0;_0x3d9843<_0x45e802;_0x3d9843++){const _0x98750d=_0x6dc664['getShiftedBy'](_0x3d9843)['nodeAfter'];_0x1a90e0['add'](_0x98750d);}break;}case'remove':{const _0x2eecc9=_0x46a3f2['sourcePosition'],_0x5f4d0b=_0x46a3f2['howMany'],_0x333815=new _0x34bf3b(_0x2eecc9,_0x5f4d0b);_0x5cf092['batch']['addOperation'](_0x333815),_0x11a1a8['model']['applyOperation'](_0x333815);break;}}}for(const _0x51d86a of _0x1a90e0){const _0x13d490=_0x11a1a8['model']['createRangeOn'](_0x51d86a),_0x1fb9a6='suggestion:formatBlock:$fakeWrap:'+_0x3e4e8c()+':$aiSuggestion';_0x201e37['markers']['set'](_0x1fb9a6,_0xf97f88(_0x13d490,_0x11a1a8['model']));}});}(_0x33cd9a,_0x40d6e1,_0x4b9dae):_0x4b9dae['model']['change'](_0x1bc9fd=>{for(const _0x4708b4 of _0x33cd9a)if('remove'==_0x4708b4['type']){const _0x3ed767=_0x4708b4['sourcePosition'],_0x236c8a=_0x4708b4['howMany'],_0x4d6a08=new _0x34bf3b(_0x3ed767,_0x236c8a);_0x1bc9fd['batch']['addOperation'](_0x4d6a08),_0x4b9dae['model']['applyOperation'](_0x4d6a08);}else{if('marker'==_0x4708b4['type']){const _0x1790a7=_0x4708b4['name'],_0x32773e=_0x4708b4['newRange'];null!==_0x32773e?_0x40d6e1['markers']['set'](_0x1790a7,_0x32773e):_0x40d6e1['markers']['delete'](_0x1790a7);}else _0x4708b4['baseVersion']=null,_0x4708b4['isDocumentOperation']=!0x1,_0x1bc9fd['batch']['addOperation'](_0x4708b4),_0x4b9dae['model']['applyOperation'](_0x4708b4);}});if(_0x4517c4){const _0x3ac255=W(_0x4b9dae,_0x33cd9a,_0x40d6e1);G(_0x4b9dae['model'],_0x3ac255),function(_0x145934,_0x4fa9a7){const _0x5ebdd7=_0x4fa9a7['getFirstRange']()['start'];let _0x48e6b1=_0x4fa9a7['getFirstRange']()['end'];const _0x1ced87=_0x5ebdd7['root'];(_0x48e6b1['textNode']||_0x48e6b1['nodeAfter']&&_0x48e6b1['nodeAfter']['is']('$text'))&&(_0xdd4fe8(_0x48e6b1,'...'),_0x48e6b1=_0x48e6b1['getShiftedBy'](0x3)),(_0x5ebdd7['textNode']||_0x5ebdd7['nodeBefore']&&_0x5ebdd7['nodeBefore']['is']('$text'))&&(_0xdd4fe8(_0x5ebdd7,'...'),function(_0x872773,_0x351163,_0x3a0176){for(let [_0x2455e0,_0x52d103]of _0x872773['markers']){const _0x2ce001=_0x52d103['_getTransformedByInsertion'](_0x351163,_0x3a0176,!0x1);_0x52d103=_0x2ce001[0x0],_0x872773['markers']['set'](_0x2455e0,_0x52d103);}}(_0x1ced87,_0x5ebdd7,0x3),_0x5ebdd7['parent']==_0x48e6b1['parent']&&(_0x48e6b1=_0x48e6b1['getShiftedBy'](0x3)));const _0x4b1219=_0x145934['createRange'](_0x145934['createPositionAt'](_0x1ced87,0x0),_0x5ebdd7),_0x147323=_0x145934['createRange'](_0x48e6b1,_0x145934['createPositionAt'](_0x1ced87,'end')),_0xd51d8a=[..._0x4b1219['getMinimalFlatRanges'](),..._0x147323['getMinimalFlatRanges']()];_0xd51d8a['reverse']();for(const _0x160c7c of _0xd51d8a)to(_0x160c7c),Zn(_0x1ced87,_0x160c7c);}(_0x4b9dae['model'],_0x3ac255);}const _0x434dc8=_0x4b9dae['data']['stringify'](_0x40d6e1,{'showSuggestionHighlights':!0x0});return{'content':Qe(_0x434dc8),'hasChanges':!0x0};}(_0x253071,_0x469d9d,_0x18d2d0,_0x5978aa,_0x27f6d1);return{'type':_0xd74dc8['changes'][0x0]['type'],'index':_0xd74dc8['index'],'content':_0xfb269d,'hasChanges':_0x4c0dc3};});}function no(_0x33ab10,_0x5df962){for(const [_0x5ab8f7,_0x522136]of _0x33ab10['markers']){const _0x47107a=_0x1f26a0['_createFromRanges'](_0x522136['getTransformedByOperation'](_0x5df962));_0x33ab10['markers']['set'](_0x5ab8f7,_0x47107a);}}function W(_0x1e5d5d,_0x34b4b4,_0x39b507){const _0x13200a=_0x1e5d5d['plugins']['get']('DocumentCompare');let _0x3dacdb=_0x1e5d5d['model']['createPositionAt'](_0x39b507,Number['POSITIVE_INFINITY']),_0x3acaf=_0x1e5d5d['model']['createPositionAt'](_0x39b507,0x0);for(const _0x2ab3ad of _0x34b4b4){let _0x34bd74,_0x32c916;if(_0x13200a['isMarkedRemoveOperation'](_0x2ab3ad))_0x34bd74=_0x2ab3ad['newRange']['start'],_0x32c916=_0x2ab3ad['newRange']['end'];else switch(_0x3dacdb=_0x3dacdb['getTransformedByOperation'](_0x2ab3ad),_0x3acaf=_0x3acaf['getTransformedByOperation'](_0x2ab3ad),_0x2ab3ad['type']){case'rename':_0x34bd74=_0x2ab3ad['position'],_0x32c916=_0x34bd74['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x34bd74=_0x2ab3ad['range']['start'],_0x32c916=_0x2ab3ad['range']['end'];break;case'insert':_0x34bd74=_0x2ab3ad['position'],_0x32c916=_0x34bd74['getShiftedBy'](_0x2ab3ad['howMany']);break;case'split':_0x34bd74=_0x2ab3ad['splitPosition'],_0x32c916=_0x2ab3ad['moveTargetPosition'];break;case'merge':{const _0x24877a=_0x2ab3ad['targetPosition']['path']['slice'](0x0,-0x1);_0x34bd74=_0x1e5d5d['model']['createPositionFromPath'](_0x39b507,_0x24877a),_0x32c916=_0x34bd74['getShiftedBy'](0x1);break;}case'remove':{const _0x204442=_0x2ab3ad['howMany'],_0x23d644=_0x2ab3ad['sourcePosition']['_getTransformedByInsertion'](_0x2ab3ad['targetPosition'],_0x204442),_0x4a449b=_0x2ab3ad['getMovedRangeStart']();'remove'==_0x2ab3ad['type']?(_0x34bd74=_0x23d644,_0x32c916=_0x23d644):(_0x34bd74=_0x4a449b,_0x32c916=_0x4a449b['getShiftedBy'](_0x204442));break;}}_0x34bd74&&_0x34bd74['isBefore'](_0x3dacdb)&&(_0x3dacdb=_0x34bd74['clone'](),_0x3dacdb['stickiness']='toNone'),_0x32c916&&_0x32c916['isAfter'](_0x3acaf)&&(_0x3acaf=_0x32c916['clone'](),_0x3acaf['stickiness']='toNone');}return _0x1e5d5d['model']['createSelection'](_0x1e5d5d['model']['createRange'](_0x3dacdb,_0x3acaf));}function G(_0x2c5e83,_0x54f441){ro(_0x2c5e83,_0x54f441,'forward');const _0x232e07=_0x54f441['getFirstRange']();_0x54f441['setTo']([]),_0x54f441['setTo'](_0x232e07,{'backward':!0x0}),ro(_0x2c5e83,_0x54f441,'backward');}function ro(_0x2641e8,_0x20e077,_0x216f1b){let _0x423731=0x14;for(;_0x423731;){_0x2641e8['modifySelection'](_0x20e077,{'unit':'word','direction':_0x216f1b}),_0x423731--;const _0x41f724=_0x20e077['focus']['forward'==_0x216f1b?'nodeBefore':'nodeAfter'];if(_0x41f724&&_0x41f724['is']('element')&&_0x2641e8['schema']['isBlock'](_0x41f724)&&_0x2641e8['schema']['isObject'](_0x41f724))break;}}function Zn(_0x5b0d6,_0x2f6f9e){for(const [_0x228a07,_0x36afe1]of _0x5b0d6['markers']){const _0x19bb58=_0x36afe1['_getTransformedByDeletion'](_0x2f6f9e['start'],_0x2f6f9e['end']['offset']-_0x2f6f9e['start']['offset']);null!=_0x19bb58?_0x5b0d6['markers']['set'](_0x228a07,_0x19bb58):_0x5b0d6['markers']['delete'](_0x228a07);}}class pe extends Vt(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x175d6b([]);['parsedMergedContent']=new _0x175d6b([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x3798e0,content:_0x50941c='',isDone:_0x1006b8=!0x1,interactionId:_0xdb1c75,areActionsDisabled:_0x13b4f1,documentContextContent:_0x1776a3,editor:_0x3f2b3f,id:_0x99fcdd}){super(),this['id']=_0x99fcdd||_0x3e4e8c(),this['interactionId']=_0xdb1c75,this['type']=_0x3798e0,this['areActionsDisabled']=!!_0x13b4f1,this['editor']=_0x3f2b3f,this['aiResponseParser']=new Ze(),this['aiResponseApplier']=new $e(),this['documentContextContent']=Qe(_0x1776a3||''),this['set']('isDone',_0x1006b8),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x50941c);}['appendContent'](_0x3b559c){this['set']('content',this['content']+_0x3b559c);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x289632,_0x39e303){this['changeGroups'][_0x289632]['state']=_0x39e303,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x289632,'state':_0x39e303});}['getContentParts']({showDiff:_0x461c6c,groupIndex:_0x1e859a}){if(!this['editor'])throw new _0x1500e8('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x42f134=this['_getCachedContentParts'](_0x461c6c,_0x1e859a);if(_0x42f134)return _0x42f134;let _0x408361=[];if(void 0x0===_0x1e859a)_0x408361=this['changeGroups'];else{const _0x5dba6a=this['changeGroups']['find'](({index:_0x20f650})=>_0x20f650===_0x1e859a);if(!_0x5dba6a)throw new _0x1500e8('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x1e859a});_0x408361=[_0x5dba6a];}const _0x5608ac=f({'editor':this['editor'],'showDiff':_0x461c6c,'changeGroups':_0x408361,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x461c6c,_0x5608ac),_0x5608ac;}['_getCachedContentParts'](_0x2c536c,_0x24c769){const _0x1a99e6=_0x2c536c?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x1a99e6]['length'])return null;const _0x21ee70=this['cachedSuggestionContentParts'][_0x1a99e6];if(void 0x0===_0x24c769)return _0x21ee70['length']>0x0&&_0x21ee70['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x2c536c,null),null):_0x4879b0(_0x21ee70);{const _0x1bc941=_0x21ee70['find'](({index:_0x115c0d})=>_0x115c0d===_0x24c769);if(_0x1bc941)return[_0x4879b0(_0x1bc941)];}return null;}['_setCachedContentParts'](_0x2193e5,_0x478f4b){const _0x46a636=_0x2193e5?'withDiff':'withoutDiff';_0x478f4b?_0x478f4b['forEach'](_0x5cadd8=>{const _0x44f546=this['cachedSuggestionContentParts'][_0x46a636],_0xff1c95=_0x44f546['find'](({index:_0x130f18})=>_0x130f18===_0x5cadd8['index']);if(_0xff1c95){const _0x5271b4=_0x44f546['indexOf'](_0xff1c95);_0x44f546['splice'](_0x5271b4,0x1,_0x5cadd8);}else _0x44f546['push'](_0x5cadd8);}):this['cachedSuggestionContentParts'][_0x46a636]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x2c4b61=this['changeGroups'];this['updateChangeGroups']();const _0x127867=this['_getDifferentChangeGroups'](_0x2c4b61,this['changeGroups']);(_0x127867['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x127867),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x5d4b06,_0x414fd3){const _0x36a341=[];for(const _0xfc6a6b of _0x414fd3){const _0x1b66b1=_0x5d4b06[_0xfc6a6b['index']];_0x1b66b1?_0x1b66b1['changes']['length']!==_0xfc6a6b['changes']['length']?_0x36a341['push'](_0xfc6a6b):_0x1b66b1['changes']['forEach']((_0x516660,_0x1c2af2)=>{const _0x391260=_0xfc6a6b['changes'][_0x1c2af2];_0x516660['id']!==_0x391260['id']&&_0x36a341['push'](_0xfc6a6b);}):_0x36a341['push'](_0xfc6a6b);}return _0x36a341;}['updateChangeGroups'](){const _0x125532=new _0x309db4('p',{},[new _0x309db4('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x28e1e3(m(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x53ab77=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x125532,'cutAfterLastChange':!this['isDone']});if(!_0x53ab77['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x53ab77['parsedContent'];let _0x4ec0ea=[];if(_0x51c105(_0x8adffc=>{const _0x595ae4=q(_0x8adffc,'data-id');if(!_0x595ae4||!_0x5b69cd(_0x595ae4))return!0x1;const _0x5ef227=[_0x8adffc,...Ke(_0x8adffc)]['at'](-0x2);if(_0x8adffc!=_0x5ef227){const _0x36dcfb=q(_0x5ef227,'data-id');_0x5b69cd(_0x36dcfb)||(_0x4ec0ea['push']({'node':_0x5ef227,'id':_0x36dcfb,'type':'modified'}),_0x53ab77['modifiedNodeIds']['push'](_0x36dcfb));}else _0x53ab77['modifiedNodeIds']['includes'](_0x595ae4)?_0x4ec0ea['push']({'node':_0x8adffc,'type':'modified','id':_0x595ae4}):_0x53ab77['newNodeIds']['includes'](_0x595ae4)?_0x4ec0ea['push']({'node':_0x8adffc,'type':'new','id':_0x595ae4,'anchorId':q(_0x8adffc['previousSibling'],'data-id')}):_0x4ec0ea['push']({'node':_0x8adffc,'type':'removed','id':_0x595ae4});return!0x0;},this['parsedMergedContent']),_0x4ec0ea=_0x4ec0ea['filter'](({node:_0x23483c})=>[...Ke(_0x23483c),_0x23483c]['every'](_0x4944e3=>!q(_0x4944e3,'data-unstable'))),0x0==_0x4ec0ea['length'])return;const _0x550d33=[[_0x4ec0ea[0x0]]];for(let _0xe8ac38=0x1;_0xe8ac38<_0x4ec0ea['length'];_0xe8ac38++){const _0x363a50=_0x550d33[_0x550d33['length']-0x1],_0x38f3b2=_0x363a50[_0x363a50['length']-0x1];_0x4ec0ea[_0xe8ac38]['node']['previousSibling']==_0x38f3b2['node']&&'modified'!=_0x4ec0ea[_0xe8ac38]['type']&&'modified'!=_0x38f3b2['type']?_0x363a50['push'](_0x4ec0ea[_0xe8ac38]):_0x550d33['push']([_0x4ec0ea[_0xe8ac38]]);}for(const _0xe6cb29 of _0x550d33){const _0x1960ff=_0xe6cb29[0x0],_0x4713ef=_0xe6cb29[_0xe6cb29['length']-0x1],_0xa8d44b=_0x5cb674(_0x1960ff['node']['previousSibling']);_0xa8d44b&&_0xe6cb29['unshift'](_0xa8d44b);const _0x386040=_0x5cb674(_0x4713ef['node']['nextSibling']);_0x386040&&_0xe6cb29['push'](_0x386040);}function _0x5b69cd(_0x32384f){return _0x53ab77['modifiedNodeIds']['includes'](_0x32384f)||_0x53ab77['newNodeIds']['includes'](_0x32384f)||_0x53ab77['removedNodeIds']['includes'](_0x32384f);}function _0x5cb674(_0x138178){if(_0x138178&&q(_0x138178,'data-id')&&!q(_0x138178,'data-unstable')){const _0x591b00=q(_0x138178,'data-id');if(!_0x5b69cd(_0x591b00))return{'node':_0x138178,'type':'context','id':_0x591b00};}return null;}this['changeGroups']=_0x550d33['map']((_0x32c653,_0x151292)=>({'changes':_0x32c653,'state':'pending','index':_0x151292}));}}const zt=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class qt extends Ft(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x2dc890,editor:_0x4b6d2b}){super(),this['id']=_0x3e4e8c(),this['connector']=_0x2dc890,this['isStopped']=!0x0,this['editor']=_0x4b6d2b;}async['start'](){const _0x1054e0=[];let _0x3f3b3d,_0x2630d7,_0x131794;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x230b77=await this['currentRequest']['getStream']();for await(const _0x533be1 of _0x230b77){if(this['isStopped'])return;if('error'==_0x533be1['event'])return void this['fire']('error',{'error':new _0x1500e8('ai-chat-interaction-error',this)});switch(_0x533be1['event']){case'message-metadata':this['messageId']=_0x533be1['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x533be1['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x533be1['data']['conversationTitle'],!0x0);break;case'source':_0x1054e0['push'](_0x533be1['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'](),_0x3f3b3d='modification-delta'==_0x533be1['event']?'modification':'text',_0x2630d7='modification-delta'==_0x533be1['event']?_0x533be1['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x3f3b3d&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x3f3b3d,'interactionId':this['id'],'id':_0x2630d7}),'modification'==_0x3f3b3d&&(this['currentReply']['sources']=_0x1054e0['splice'](0x0))),this['currentReply']['appendContent'](_0x533be1['data']['textDelta']);break;case'mcp-tool-result':_0x131794=JSON['parse'](_0x533be1['data']['result']),this['_handleToolResultData']({'toolName':_0x533be1['data']['toolName'],'data':_0x131794['data'],'attributes':_0x131794['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x533be1['data']['toolName'],'data':_0x533be1['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x1054e0['length']>0x0&&(this['currentReply']['sources']=_0x1054e0['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x20a768){return this['replies']['find'](_0x1d3b33=>_0x1d3b33['id']===_0x20a768);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x2fd547=>_0x2fd547['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x4e0263){const _0x2d161d=new pe({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x4e0263});return this['replies']['push'](_0x2d161d),_0x2d161d['delegate'](...zt)['to'](this),this['fire']('replyCreated',_0x2d161d),_0x2d161d;}['setConversationTitle'](_0x45fa3d,_0x42f17b=!0x1){this['fire']('setConversationTitle',_0x45fa3d,_0x42f17b);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x45f591){this['fire']('toolDataReceived',{'type':'result','toolName':_0x45f591['toolName'],'data':structuredClone(_0x45f591['data']||{}),'attributes':structuredClone(_0x45f591['attributes']||{})},this);}['_handleToolNotificationData'](_0x16c6de){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x16c6de['toolName'],'data':structuredClone(_0x16c6de['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var Jt=function(_0x3143cd){return _0x3143cd['TOOL']='mcp-tool-context',_0x3143cd['FILE']='file',_0x3143cd['DOCUMENT']='document',_0x3143cd['URL']='web-resource',_0x3143cd['TEXT']='text',_0x3143cd['SELECTION']='selection',_0x3143cd;}({}),Xt=function(_0x4b4e48){return _0x4b4e48['TEXT']='text',_0x4b4e48['MARKDOWN']='markdown',_0x4b4e48['HTML']='html',_0x4b4e48;}({});const Yt=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']]),xe=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class be extends Vt(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x25268f,config:_0x518782,ownerId:_0x41beda}){super(),this['_connector']=_0x25268f,this['_config']=_0x518782,this['_ownerId']=_0x41beda;}['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'](_0x32f0fe){const _0x3779d5=await this['_createContextItemFromContent'](_0x32f0fe);return this['_addToConversationContextItem'](_0x3779d5),'current-document'===_0x3779d5['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x3779d5;}async['_createContextItemFromContent'](_0x3b0a80){if(_0x3b0a80['type']===Jt['DOCUMENT']){const _0x5034c3=await this['_connector']['fetchDocument'](this['_ownerId'],_0x3b0a80['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x3b0a80['type'],'content':_0x5034c3['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x5034c3['attributes']?.['version'],'sessionId':_0x5034c3['attributes']?.['sessionId']};}if(_0x3b0a80['type']===Jt['TOOL'])return{'id':_0x3b0a80['id'],'uiId':_0x3b0a80['id'],'label':_0x3b0a80['data']?.['label']||_0x3b0a80['id'],'type':Jt['TOOL'],'mcpServerName':_0x3b0a80['mcpServerName'],'toolName':_0x3b0a80['toolName'],'data':_0x3b0a80['data']||{}};return{'id':_0x3b0a80['id'],'uiId':_0x3b0a80['id'],'label':_0x3b0a80['attributes']?.['label']||_0x3b0a80['name']||_0x3b0a80['url']||_0x3b0a80['id'],'type':_0x3b0a80['type'],..._0x3b0a80?.['attributes']?.['resourceId']?{'resourceId':_0x3b0a80['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x173db5){const _0x139786=this['_pendingContextItems']['get'](_0x173db5);_0x139786?.['isReadOnly']||this['_removeContextItem'](_0x173db5);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x46a829 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x46a829['uiId']);const _0x344905=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x344905&&this['_addContextItem']({..._0x344905,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x3f2a9a){for(const _0xce962a of _0x3f2a9a['values']())this['_addToConversationContextItem'](_0xce962a);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'](_0x107901){return Array['from'](_0x107901['values']())['map'](_0x2eff93=>this['_mapContextItemToRequestData'](_0x2eff93))['filter'](_0x46a452=>null!==_0x46a452);}async['addFilesToContext'](_0x3dc3b0,_0x202441,_0x5b17cc=Jt['FILE']){const _0xbe6d63='files-'+_0x3e4e8c();this['_startUploadOperation'](_0xbe6d63);try{await Promise['all'](_0x3dc3b0['map'](async _0x4ffdf1=>{const _0x5b4b69='file-'+_0x3e4e8c(),_0x1cfdad=Wt(_0x4ffdf1['name']);try{this['_addContextItem']({'type':_0x5b17cc,'label':_0x202441?.['label']||_0x1cfdad,'uiId':_0x5b4b69,'resourceId':_0x202441?.['resourceId']},!0x0);const _0x54e418=this['_connector']['uploadFile'](this['_ownerId'],_0x4ffdf1,_0x202441);this['_ongoingUploads']['set'](_0x5b4b69,_0x54e418['abortController']);const {id:_0x11a194}=await _0x54e418['getId']();this['_ongoingUploads']['delete'](_0x5b4b69),this['_finishContextItemLoading']({'type':_0x5b17cc,'id':_0x11a194,'label':_0x202441?.['label']||_0x1cfdad,'uiId':_0x5b4b69,'resourceId':_0x202441?.['resourceId']},!0x1);}catch(_0x4f41e3){this['_ongoingUploads']['delete'](_0x5b4b69);if(!(_0x4f41e3 instanceof _0x1500e8&&_0x4f41e3['message']['startsWith']('ai-request-aborted'))){const _0x35a420=Yt['get'](_0x4f41e3['code'])||'ai-chat-file-upload-failed',_0x462769=new _0x1500e8(_0x35a420,null,{'fileName':_0x1cfdad,..._0x4f41e3});_0x462769['stack']=_0x4f41e3['stack'],this['fire']('error',{'error':_0x462769});}this['_removeContextItem'](_0x5b4b69);}}));}finally{this['_finishUploadOperation'](_0xbe6d63);}}['addCurrentDocumentToContext'](_0x437b85){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x5186a7={'type':Jt['DOCUMENT'],'uiId':'current-document','label':_0x437b85,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x5186a7);}async['updateCurrentDocument'](_0xcf690c,_0x283b67,_0x472c38,_0xad8a35){const _0x40e6cd=this['_pendingContextItems']['get']('current-document');if(_0x40e6cd&&_0xcf690c){_0x40e6cd['selection']=_0xad8a35?_0xad8a35['map'](_0x222eb1=>({'start':_0x222eb1['start'],'end':_0x222eb1['end']})):[];try{if(_0x40e6cd['version']===_0x283b67)return;const {id:_0x208813}=await this['_connector']['uploadDocument'](this['_ownerId'],_0xcf690c,{'version':_0x283b67,'sessionId':_0x472c38})['getId']();_0x40e6cd['id']=_0x208813,_0x40e6cd['content']=_0xcf690c,_0x40e6cd['version']=_0x283b67,_0x40e6cd['sessionId']=_0x472c38;}catch(_0x14f9c2){const _0x3d5d6b=new _0x1500e8('ai-chat-document-upload-failed',null);_0x3d5d6b['stack']=_0x14f9c2['stack'],this['fire']('error',{'error':_0x3d5d6b});}}}['addSelectionToContext'](_0x4937c1){this['_addContextItem']({'type':Jt['SELECTION'],'label':_0x4937c1,'uiId':'selection','content':_0x4937c1});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x2a072c,_0x3f3063){const _0x3de2b5='url-'+_0x3e4e8c();this['_startUploadOperation'](_0x3de2b5);const _0x4f7fa0='url-'+_0x3e4e8c();try{this['_addContextItem']({'type':Jt['URL'],'label':_0x3f3063?.['label']||_0x2a072c,'uiId':_0x4f7fa0,'resourceId':_0x3f3063?.['resourceId']},!0x0);const _0x577811=this['_connector']['uploadUrl'](this['_ownerId'],_0x2a072c,_0x3f3063);this['_ongoingUploads']['set'](_0x4f7fa0,_0x577811['abortController']);const {id:_0x111b96}=await _0x577811['getId']();this['_ongoingUploads']['delete'](_0x4f7fa0),this['_finishContextItemLoading']({'type':Jt['URL'],'id':_0x111b96,'label':_0x3f3063?.['label']||_0x2a072c,'uiId':_0x4f7fa0,'resourceId':_0x3f3063?.['resourceId']},!0x1);}catch(_0x5ab03f){this['_ongoingUploads']['delete'](_0x4f7fa0),(_0x5ab03f['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x1500e8('ai-chat-url-upload-failed',this,{'url':_0x2a072c,'originalError':_0x5ab03f}),'url':_0x2a072c}),this['_removeContextItem'](_0x4f7fa0));}finally{this['_finishUploadOperation'](_0x3de2b5);}}['addToolItemToContext'](_0x51034b){_0x51034b['id']=_0x51034b['id']??_0x3e4e8c()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x51034b['uiId'],_0x51034b),this['fire']('contextItemAdded',{'contextItem':_0x51034b,'isLoading':!0x1});}async['loadSourceResources'](_0x490132,_0x2ad32e,_0x4e0a97){const _0x2d8c27=this['_addContextOptionsState']['sources']['find'](_0x48c0bc=>_0x48c0bc['id']===_0x490132);if(!_0x2d8c27)return this['fire']('error',{'error':new _0x1500e8('ai-chat-source-not-found',this,{'sourceId':_0x490132}),'sourceId':_0x490132}),[];try{const _0x9f197d=(await _0x2d8c27['getResources'](_0x2ad32e))['map'](_0x1635fb=>{const _0x3ed9ac=this['_isResourceInContext'](_0x1635fb['id']);return{..._0x1635fb,'isInContext':_0x3ed9ac};});return _0x2d8c27['resources']=_0x9f197d,this['fire']('sourceResourcesLoaded',{'sourceId':_0x490132,'source':_0x2d8c27,'resources':_0x9f197d,'uid':_0x4e0a97}),_0x9f197d;}catch(_0x2cbf2b){return this['fire']('error',{'error':new _0x1500e8('ai-chat-source-resources-load-failed',this,{'sourceId':_0x490132,'originalError':_0x2cbf2b}),'sourceId':_0x490132,'sourceLabel':_0x2d8c27['label']}),[];}}async['addResourceToContext'](_0x4ee8ed,_0x4d8b50){if(this['_isResourceInContext'](_0x4d8b50['id']))return;let _0x3c24c8=_0x4d8b50['data'];if(!_0x3c24c8&&_0x4ee8ed['getData'])try{_0x3c24c8=await _0x4ee8ed['getData'](_0x4d8b50['id']);}catch(_0x28f2b7){return void this['fire']('error',{'error':new _0x1500e8('ai-chat-resource-load-failed',this,{'resourceId':_0x4d8b50['id'],'sourceId':_0x4ee8ed['id'],'originalError':_0x28f2b7}),'resourceId':_0x4d8b50['id'],'sourceId':_0x4ee8ed['id']});}if(_0x3c24c8)switch(_0x4d8b50['type']){case Jt['URL']:if('string'!=typeof _0x3c24c8)return void this['fire']('error',{'error':new _0x1500e8('ai-chat-context-invalid-data',this,{'resourceId':_0x4d8b50['id'],'sourceId':_0x4ee8ed['id'],'expectedType':'string','actualType':typeof _0x3c24c8}),'resourceId':_0x4d8b50['id'],'sourceId':_0x4ee8ed['id']});await this['addUrlToContext'](_0x3c24c8,{'label':_0x4d8b50['label'],'resourceId':_0x4d8b50['id']});break;case Jt['FILE']:if(!(_0x3c24c8 instanceof File))return void this['fire']('error',{'error':new _0x1500e8('ai-chat-context-invalid-data',this,{'resourceId':_0x4d8b50['id'],'sourceId':_0x4ee8ed['id'],'expectedType':'File','actualType':typeof _0x3c24c8}),'resourceId':_0x4d8b50['id'],'sourceId':_0x4ee8ed['id']});await this['addFilesToContext']([_0x3c24c8],{'label':_0x4d8b50['label'],'resourceId':_0x4d8b50['id']});break;case Jt['TEXT']:if('object'!=typeof _0x3c24c8||!('content'in _0x3c24c8)||!('type'in _0x3c24c8))return void this['fire']('error',{'error':new _0x1500e8('ai-chat-context-invalid-data',this,{'resourceId':_0x4d8b50['id'],'sourceId':_0x4ee8ed['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x3c24c8}),'resourceId':_0x4d8b50['id'],'sourceId':_0x4ee8ed['id']});_0x3c24c8=be['_convertTextResourceToFile'](_0x3c24c8,_0x4d8b50['label']),await this['addFilesToContext']([_0x3c24c8],{'label':_0x4d8b50['label'],'resourceId':_0x4d8b50['id']},Jt['TEXT']);break;case Jt['TOOL']:break;default:this['fire']('error',{'error':new _0x1500e8('ai-chat-context-unsupported-type',this,{'resourceId':_0x4d8b50['id'],'sourceId':_0x4ee8ed['id'],'resourceType':_0x4d8b50['type']}),'resourceId':_0x4d8b50['id'],'sourceId':_0x4ee8ed['id']});}else this['fire']('error',{'error':new _0x1500e8('ai-chat-resource-no-data',this,{'resourceId':_0x4d8b50['id'],'sourceId':_0x4ee8ed['id']}),'resourceId':_0x4d8b50['id'],'sourceId':_0x4ee8ed['id']});}static['_convertTextResourceToFile'](_0x515586,_0x4d2189){switch(_0x515586['type']){case Xt['MARKDOWN']:return new File([_0x515586['content']],_0x4d2189,{'type':'text/markdown'});case Xt['HTML']:return new File([_0x515586['content']],_0x4d2189,{'type':'text/html'});default:return new File([_0x515586['content']],_0x4d2189,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x5703b6){switch(_0x5703b6['type']){case Jt['FILE']:return{'type':Jt['FILE'],'id':_0x5703b6['id']};case Jt['URL']:return{'type':Jt['URL'],'id':_0x5703b6['id']};case Jt['DOCUMENT']:return{'type':Jt['DOCUMENT'],'id':_0x5703b6['id'],..._0x5703b6['selection']?.['length']&&{'selection':_0x5703b6['selection']}};case Jt['TEXT']:return{'type':Jt['FILE'],'id':_0x5703b6['id']};case Jt['TOOL']:{const _0x25b487=_0x5703b6;return{'type':Jt['TOOL'],'mcpServerName':_0x25b487['mcpServerName'],'toolName':_0x25b487['toolName'],'data':_0x25b487['data'],'id':_0x25b487['id']};}default:return null;}}['_addContextItem'](_0x1f3e05,_0x5c35cc=!0x1){if(this['_pendingContextItems']['set'](_0x1f3e05['uiId'],_0x1f3e05),_0x1f3e05['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x1f3e05,'isLoading':_0x5c35cc}),'current-document'===_0x1f3e05['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x1f3e05['resourceId']){const _0x21a8bc=this['_findSourceIdsByResourceId'](_0x1f3e05['resourceId']);_0x21a8bc&&_0x21a8bc['forEach'](_0x249de7=>{this['_updateResourceInContextState'](_0x249de7,_0x1f3e05['resourceId'],!0x0);});}}['_removeContextItem'](_0x5daf02){const _0x56855b=this['_pendingContextItems']['get'](_0x5daf02),_0x23b0d0=this['_ongoingUploads']['get'](_0x5daf02);if(_0x23b0d0&&(_0x23b0d0['abort'](),this['_ongoingUploads']['delete'](_0x5daf02)),_0x56855b?.['resourceId']){const _0x3c14c1=this['_findSourceIdsByResourceId'](_0x56855b['resourceId']);_0x3c14c1&&_0x3c14c1['forEach'](_0x97bcaf=>{this['_updateResourceInContextState'](_0x97bcaf,_0x56855b['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x5daf02),this['fire']('contextItemRemoved',{'uiId':_0x5daf02,'type':_0x56855b?.['type']}),'current-document'===_0x5daf02&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x56f110,_0x59ac9e){if(this['_pendingContextItems']['has'](_0x56f110['uiId'])&&(this['_pendingContextItems']['set'](_0x56f110['uiId'],_0x56f110),this['fire']('contextItemLoadingEnded',{'contextItem':_0x56f110,'isLoading':_0x59ac9e}),_0x56f110['resourceId'])){const _0x411786=this['_findSourceIdsByResourceId'](_0x56f110['resourceId']);_0x411786&&_0x411786['forEach'](_0x9494e6=>{this['_updateResourceInContextState'](_0x9494e6,_0x56f110['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x4ae8e2){this['_conversationContextItems']['set'](_0x4ae8e2['uiId'],_0x4ae8e2);}['_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'](_0x3c0434=>({..._0x3c0434,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x20ac62=>({..._0x20ac62,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x234232=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x234232,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x1c018d){for(const _0x1bcf14 of this['_pendingContextItems']['values']())if(_0x1bcf14['resourceId']===_0x1c018d)return!0x0;for(const _0x3759d0 of this['_conversationContextItems']['values']())if(_0x3759d0['resourceId']===_0x1c018d)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x39390d){const _0xa56e01=[];for(const _0x3f29d5 of this['_addContextOptionsState']['sources']){_0x3f29d5['resources']['find'](_0x5acff4=>_0x5acff4['id']===_0x39390d)&&_0xa56e01['push'](_0x3f29d5['id']);}return 0x0===_0xa56e01['length']?null:_0xa56e01;}['_updateResourceInContextState'](_0x43a336,_0x10e169,_0x28cbb3){const _0x15617c=this['_addContextOptionsState']['sources']['find'](_0x22b3d2=>_0x22b3d2['id']===_0x43a336);if(!_0x15617c)return;const _0x31405f=_0x15617c['resources']['find'](_0x22cd6e=>_0x22cd6e['id']===_0x10e169);_0x31405f&&(_0x31405f['isInContext']=_0x28cbb3,this['fire']('resourceStateChanged',{'sourceId':_0x43a336,'resourceId':_0x10e169,'isInContext':_0x28cbb3}));}['_startUploadOperation'](_0x51cf7c){this['_ongoingUploadOperations']['set'](_0x51cf7c,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x2a7020){this['_ongoingUploadOperations']['delete'](_0x2a7020),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Me=['capabilitiesUpdated'];class ye extends Ft(){['_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'](_0x1f9957){const _0x5e45ff={};return _0x1f9957&&_0x1f9957['isWebSearchEnabled']&&(_0x5e45ff['webSearch']={}),_0x1f9957&&_0x1f9957['isReasoningEnabled']&&(_0x5e45ff['reasoning']={}),_0x5e45ff;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x4b147d){_0x4b147d!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x4b147d,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x372067){_0x372067!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x372067,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Se extends qt{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['attributes'];constructor(_0x3b74d5){super(_0x3b74d5),this['conversationId']=_0x3b74d5['conversationId'],this['contextItems']=_0x3b74d5['contextItems'],this['capabilities']=_0x3b74d5['capabilities'],this['userMessage']=_0x3b74d5['userMessage'],this['model']=_0x3b74d5['model'],this['attributes']=_0x3b74d5['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':be['mapContextItemsToRequestData'](this['contextItems']),'capabilities':ye['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class F extends Ft(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x4cb5ea){super(),this['options']=_0x4cb5ea,this['connector']=_0x4cb5ea['connector'],this['chatModels']=_0x4cb5ea['chatModels'],this['id']=_0x4cb5ea['conversationId'],this['isFromHistory']=_0x4cb5ea['isFromHistory'];}async['init'](_0x26baa7){try{this['chatContext']=new be({'connector':this['connector'],'config':_0x26baa7,'ownerId':this['id']}),this['chatContext']['delegate'](...xe)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new ye(),this['chatCapabilities']['delegate'](...Me)['to'](this),this['chatCapabilities']['init']();const _0x3befb9=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x3befb9});const _0x2f8d66=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x2f8d66&&await this['setModel'](_0x2f8d66);}catch(_0x40180e){const _0x24c9dd=new _0x1500e8('ai-chat-conversation-init-failed',null,{'message':_0x40180e['message']||_0x40180e});_0x24c9dd['stack']=_0x40180e['stack'],this['fire']('error',{'error':_0x24c9dd});}}async['start'](){if(this['isStarted'])throw new _0x1500e8('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x1500e8('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x396cff}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x396cff,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x39e130){const _0x550a58=new _0x1500e8('ai-chat-conversation-start-failed',null,{'message':_0x39e130['message'],'conversationId':this['id']});throw _0x550a58['stack']=_0x39e130['stack'],this['fire']('error',{'error':_0x550a58}),_0x550a58;}}async['load'](_0x1d3b46,_0x490092){try{const _0x1b35aa=await this['connector']['fetchConversation'](_0x1d3b46)['getConversation'](),_0xc916e8=await this['connector']['fetchConversationMessages'](_0x1d3b46)['getMessages'](),_0x3563ed=_0xc916e8[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x1b35aa['id'],'title'in _0x1b35aa?this['fire']('setConversationTitle',_0x1b35aa['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0xea4208=(await this['chatModels']['getAll']())['find'](_0x33ea9f=>_0x33ea9f['id']['toLowerCase']()===_0x3563ed['toLowerCase']());return this['selectedModel']=_0xea4208,this['fire']('modelSelected',{'selectedModel':_0xea4208,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0xc916e8,_0x490092,_0x3563ed),this['currentInteraction']=void 0x0,this;}catch(_0x4803b3){const _0x100f31=new _0x1500e8('ai-chat-conversation-init-from-id-failed',null,{'message':_0x4803b3['message'],'conversationId':_0x1d3b46});throw _0x100f31['stack']=_0x4803b3['stack'],this['fire']('error',{'error':_0x100f31}),_0x100f31;}}async['_processMessagesToInteractions'](_0x31a5a3,_0x1b9929,_0x3c559c){let _0x4da35e;for(const _0x31cb6c of _0x31a5a3)if('user'===_0x31cb6c['role']){const _0x256fb6=await this['_extractContextItems'](_0x31cb6c),_0x26cbe1={'isReasoningEnabled':Object['hasOwn'](_0x31cb6c['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x31cb6c['capabilities'],'webSearch')};_0x4da35e=this['createInteraction']({'userMessage':_0x31cb6c['prompt'],'contextItems':_0x256fb6,'capabilities':_0x26cbe1,'modelId':_0x3c559c,'attributes':_0x31cb6c['attributes']}),this['currentInteraction']=_0x4da35e,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x31cb6c['role']&&_0x4da35e){const _0x324181=[];for(const _0x18a370 of _0x31cb6c['content'])switch(_0x18a370['type']){case'text':case'modification':{const _0x4d4f64=_0x4da35e['getDocumentContext']()?.['sessionId']!==_0x1b9929;_0x4da35e['currentReply']=_0x4da35e['createReply']({'type':_0x18a370['type'],'isDone':!0x0,'interactionId':_0x4da35e['id'],'areActionsDisabled':_0x4d4f64}),_0x4da35e['currentReply']['appendContent'](_0x18a370['content']),_0x324181['length']>0x0&&(_0x4da35e['currentReply']['sources']=_0x324181['splice'](0x0));break;}case'url':_0x324181['push'](_0x18a370);break;case'mcp-tool-result':{const {data:_0x1acc05,attributes:_0x5bbb11}=JSON['parse'](_0x18a370['content']);_0x4da35e['_handleToolResultData']({'toolName':_0x18a370['toolName'],'data':_0x1acc05,'attributes':_0x5bbb11});break;}}}}}async['_extractContextItems'](_0x5fb04){const _0x2d8b4f=new Map();if(!_0x5fb04['content'])return _0x2d8b4f;for(const _0x2f468d of _0x5fb04['content']){const _0x2d4ab9=await this['chatContext']['populateFromMessage'](_0x2f468d);_0x2d4ab9&&_0x2d8b4f['set'](_0x2d4ab9['id'],_0x2d4ab9);}return _0x2d8b4f;}async['handleUserInteraction']({userMessage:_0x2a2863,attributes:_0x4740c2}){if(!this['isStarted'])throw new _0x1500e8('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x1500e8('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x5f4785=this['chatContext']['getPendingContextItems'](),_0x31984c=this['chatCapabilities']['getCapabilitiesConfig'](),_0x4950fd=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x2a2863,'contextItems':_0x5f4785,'capabilities':_0x31984c,'modelId':_0x4950fd,'attributes':_0x4740c2}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x555818){if(_0x555818 instanceof _0x1500e8)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x555818});else{const _0x293f61=Yt['get'](_0x555818['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new _0x1500e8(_0x293f61,null,{'error':_0x555818})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x2dcdd3,contextItems:_0x3fb45c,capabilities:_0x315c39,modelId:_0x3c8bf5,attributes:_0x34ed8a}){const _0x26e80e=new Se({'userMessage':_0x2dcdd3,'contextItems':_0x3fb45c,'capabilities':_0x315c39,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x3c8bf5,'attributes':_0x34ed8a});return _0x26e80e['delegate'](...zt)['to'](this),this['interactions']['push'](_0x26e80e),this['fire']('interactionCreated',_0x26e80e),_0x26e80e;}['getInteraction'](_0x5efa59){return this['interactions']['find'](_0x22a0f4=>_0x22a0f4['id']===_0x5efa59);}['removeInteraction'](_0x3094a9){const _0x458c78=this['getInteraction'](_0x3094a9);_0x458c78&&(_0x458c78['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x458c78),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x46c9ed){this['chatContext']['addCurrentDocumentToContext'](_0x46c9ed);}async['updateCurrentDocumentInContext']({content:_0x380a3c,version:_0x102b32,sessionId:_0x2e23a7,selections:_0x1cb025}){await this['chatContext']['updateCurrentDocument'](_0x380a3c,_0x102b32,_0x2e23a7,_0x1cb025);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x24e8bd){this['chatContext']['addSelectionToContext'](_0x24e8bd);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x40d382){this['chatContext']['addFilesToContext'](_0x40d382);}['addUrlToContext'](_0x38b5e3){this['chatContext']['addUrlToContext'](_0x38b5e3);}['addToolItemToContext'](_0x41c084){this['chatContext']['addToolItemToContext'](_0x41c084);}['addResourceToContext'](_0x2b8a59,_0x54da1a){this['chatContext']['addResourceToContext'](_0x2b8a59,_0x54da1a);}['loadSourceResources'](_0x536c6c,_0x1b1e30,_0x52f6db){return this['chatContext']['loadSourceResources'](_0x536c6c,_0x1b1e30,_0x52f6db);}['removeFromContext'](_0x385455){this['chatContext']['removeFromContext'](_0x385455);}['setWebSearch'](_0x3b1709){this['chatCapabilities']['setWebSearch'](_0x3b1709);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x45ee20){this['chatCapabilities']['setReasoning'](_0x45ee20);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x18ec66){_0x18ec66?!0x1===await this['chatModels']['isAvailable'](_0x18ec66)&&(Zt('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x18ec66}),_0x18ec66=(await this['chatModels']['getAvailableModels']())[0x0]):(Zt('ai-chat-conversation-set-model-null',{'conversation':this}),_0x18ec66=(await this['chatModels']['getAvailableModels']())[0x0]),_0x18ec66['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x18ec66,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x18ec66}));}}class X extends Ft(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x10c746,config:_0x292c0d,locale:_0x4e3a9f}){super(),this['_connector']=_0x10c746,this['_config']=_0x292c0d,this['_locale']=_0x4e3a9f;}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 _0x53d2a9=await this['getAll']();let _0x1daa9b;return _0x1daa9b=this['_availableModels']?this['_filterModels'](_0x53d2a9,this['_availableModels']):_0x53d2a9['filter'](_0x52405b=>_0x52405b['recommended']),_0x1daa9b;}async['getModel'](_0xfa4685){const _0x528baa=await this['getAll']();if(!_0x528baa['length'])return null;if(_0xfa4685){const _0x2ac4bd=this['_getModelById'](_0x528baa,_0xfa4685);if(_0x2ac4bd)return _0x2ac4bd;Zt('ai-chat-model-id-unrecognized',{'modelId':_0xfa4685,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x3e88e8=await this['getAvailableModels']();if(!_0x3e88e8['length'])return null;if(this['_defaultModelId']){const _0x296680=this['_getModelById'](_0x3e88e8,this['_defaultModelId']);if(_0x296680)return _0x296680;Zt('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x3e88e8[0x0]['id']});}return _0x3e88e8[0x0];}async['isAvailable'](_0x5b1cc5){return(await this['getAvailableModels']())['some'](_0x5b1e38=>_0x5b1e38['name']===_0x5b1cc5['name']&&_0x5b1e38['provider']===_0x5b1cc5['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x5c0816=this['_locale']['uiLanguage']||'en',_0xf12fce=this['_connector']['getModels'](_0x5c0816),_0x37905f=await _0xf12fce['list']();this['_modelList']=_0x37905f['items']['map'](_0x115dbd=>ze(_0x115dbd)?{..._0x115dbd,'name':m(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x115dbd);}catch(_0x44cbdd){throw _0x4dee23('ai-models-unable-to-retrieve',{'error':_0x44cbdd}),_0x44cbdd;}return[...this['_modelList']];}['_filterModels'](_0x256bc1,_0x4915c5){let _0x3e4f23;if(_0x4915c5){_0x3e4f23=[];const _0x31e281=new Set(),_0x85be8d='string'==typeof _0x4915c5?[_0x4915c5['toLocaleLowerCase']()]:_0x4915c5['map'](_0xd01aad=>_0xd01aad['toLocaleLowerCase']());for(const _0x2a84ad of _0x85be8d)for(const _0x37e335 of _0x256bc1)!_0x31e281['has'](_0x37e335['id'])&&this['_isMatchingFilter'](_0x37e335,_0x2a84ad)&&(_0x3e4f23['push'](_0x37e335),_0x31e281['add'](_0x37e335['id']));}else _0x3e4f23=_0x256bc1;return _0x3e4f23;}['_isMatchingFilter'](_0x1a3e75,_0x1ae01c){const _0x106823=_0x1a3e75['id']['toLocaleLowerCase'](),_0x5b604c=_0x1a3e75['name']['toLocaleLowerCase'](),_0x48729b=_0x1a3e75['provider']['toLocaleLowerCase']();return _0x106823===_0x1ae01c||_0x5b604c===_0x1ae01c||ze(_0x1a3e75)&&'auto'===_0x1ae01c||_0x48729b===_0x1ae01c||_0x106823['startsWith'](_0x1ae01c);}['_getModelById'](_0x48de18,_0x5491ab){return _0x48de18['find'](_0x145619=>ze(_0x145619)&&'auto'===_0x5491ab?_0x145619:_0x145619['id']===_0x5491ab)||null;}}function ze(_0xa13998){return _0xa13998['id']['startsWith']('agent');}function D(_0x4e79ab){if(_0x4e79ab instanceof _0x5a6451)return _0x4e79ab;if(_0x4e79ab?.['editors']&&_0x4e79ab['editors']['get'](0x0))return _0x4e79ab['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.'),_0x4e79ab['editors']['get'](0x0);throw new _0x1500e8('ai-get-editor-from-context-no-editor');}function y({editor:_0x115f37,interaction:_0x1f09cd,reply:_0x74b28e,groups:_0x2d4a9f,transform:_0x589fcc,documentCompare:_0x3aa300,documentCompareOptions:_0x5664a5}){const _0x209c10=_0x1f09cd['getDocumentContext']();if(!_0x209c10)return[];const _0x52cc87=_0x209c10['content'],_0x25ffcc=_0x209c10['version'],_0x534696=_0x74b28e['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x1ce9db}of _0x2d4a9f){const _0x4e1d60=_0x1ce9db['filter'](_0x43a446=>'new'!=_0x43a446['type'])['map'](_0x1bdb66=>Z('data-id',_0x1bdb66['id'],_0x534696)),_0x5769e4=_0x1ce9db['filter'](_0x3bd228=>'removed'!=_0x3bd228['type'])['map'](_0x20a725=>_0x20a725['node']['cloneNode'](!0x0));let _0x179228=null;if(_0x4e1d60['length']){_0x179228=_0x4e1d60[0x0]['previousSibling'];for(let _0x3df406=0x0;_0x3df406<_0x4e1d60['length'];_0x3df406++)_0x7119c8(_0x4e1d60[_0x3df406]);}if(_0x5769e4['length']){_0x179228||(_0x1ce9db[0x0]['anchorId']?_0x179228=Z('data-id',_0x1ce9db[0x0]['anchorId'],_0x534696):(_0x179228=_0x5769e4['shift'](),_0x56829d(_0x534696,_0x179228)));for(let _0x1e8c4e=0x0;_0x1e8c4e<_0x5769e4['length'];_0x1e8c4e++)_0x4dcf7a(_0x179228,_0x5769e4[_0x1e8c4e]),_0x179228=_0x5769e4[_0x1e8c4e];}}const _0x231772=Y(_0x534696),_0x23304d=_0x3aa300['getDiff'](_0x52cc87,_0x231772,_0x5664a5)['getOperations']();if(_0x589fcc){const _0x1a52d7=_0x115f37['model']['document']['history']['getOperations'](_0x25ffcc),_0x2e4f3f={'document':_0x115f37['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x104b8e(_0x23304d,_0x1a52d7,_0x2e4f3f)['operationsA'];}return _0x23304d;}function d(_0xb99f27,_0xffa192){if('marker'!=_0xffa192['type'])return;const _0x1b7e68=_0xb99f27['model']['markers']['get'](_0xffa192['name']);_0x1b7e68&&(_0xffa192['oldRange']=_0x1b7e68['getRange']());}class x extends _0x37abb2{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[s,_0x4f58a6];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new _0x4b2ab0(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 X({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x441d5b=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x516b25,_0x192065)=>{this['_handleUIUserMessage']({'userMessage':_0x192065});}),this['listenTo'](_0x441d5b,'resizedTabs',(_0x1f1d93,_0x4d6b35)=>{this['_setIsMaximized'](_0x4d6b35);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x441d5b['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',(_0x54e011,_0x4e5441)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x4e5441));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x31e878,_0x2518d9)=>{this['activeConversation']?.['addUrlToContext'](_0x2518d9);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x1c6caa,_0x26283d)=>{_0x26283d['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x3d488d,_0x31c184)=>{this['activeConversation']?.['addResourceToContext'](_0x31c184['source'],_0x31c184['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x18307e,_0x490a37)=>{this['_removeFromContext'](_0x490a37);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x29c485,_0x15400a)=>{this['activeConversation']?.['loadSourceResources'](_0x15400a['sourceId'],_0x15400a['query'],_0x15400a['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x15799f,_0x4fcacf)=>{this['activeConversation']?.['setModel'](_0x4fcacf);}),this['listenTo'](this['_aiChatUi'],'like',(_0x5ec921,{replyId:_0x5ca32e})=>{console['log']('Liked\x20response',_0x5ca32e);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x1acb4d,{replyId:_0x2366c7})=>{console['log']('Disliked\x20response',_0x2366c7);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x1abf7b,_0x405e81)=>{this['_insertSuggestion'](_0x405e81);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x1a0922,{replyId:_0xbc32b0,partIndex:_0x37c84f})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0xbc32b0,_0x37c84f);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x1427a9,{replyId:_0x19bad9,partIndex:_0x804ac3})=>{const _0x4f9ba3=this['_getDocumentRangeForReplyChanges'](_0x19bad9,_0x804ac3);_0x4f9ba3&&'$graveyard'!=_0x4f9ba3['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x4f9ba3['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x53c143,_0x2331fe)=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over'),this['_applySuggestion'](_0x2331fe);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x39177b,{replyId:_0x2252ae,showDiff:_0x1bcbd9})=>{const {reply:_0x52f3d}=this['getInteractionAndReplyById'](_0x2252ae),_0x3daecc=_0x52f3d['getContentParts']({'showDiff':_0x1bcbd9});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x52f3d['id'],'parts':_0x3daecc,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x4322ef,{replyId:_0x1dbef4,partIndex:_0x117170})=>{this['_rejectSuggestion']({'replyId':_0x1dbef4,'partIndex':_0x117170}),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:_0x3fdb9a,partIndex:_0x20d7c7}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x144efc}=this['getInteractionAndReplyById'](_0x3fdb9a),_0x43649f=_0x144efc['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x20d7c7});this['_aiChatBalloon']['updateContent']({'part':_0x43649f[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x323b1e,partIndex:_0x4f0fe2}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x323b1e,'partIndex':_0x4f0fe2}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x353280,partIndex:_0x5614e}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x353280,'partIndex':_0x5614e}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x4a209d,partIndex:_0x3aec92}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x4a209d,'partIndex':_0x3aec92}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0x1b0baf,partIndex:_0x5862ba}=this['_currentPreviewedChangeGroup'],_0x1753ea=this['_getPresentableSiblingContentPartIndex'](_0x1b0baf,_0x5862ba,'next');null!==_0x1753ea&&this['_openBalloonFor'](_0x1b0baf,_0x1753ea);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0xbe135d,partIndex:_0x1d247e}=this['_currentPreviewedChangeGroup'],_0xbe93da=this['_getPresentableSiblingContentPartIndex'](_0xbe135d,_0x1d247e,'previous');null!==_0xbe93da&&this['_openBalloonFor'](_0xbe135d,_0xbe93da);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x4ecabb,{id:_0x2f137b})=>{if('aiChatBalloon'!==_0x2f137b)return;const {replyId:_0x2f62e7,partIndex:_0x310697}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x2f62e7,'index':_0x310697,'isActive':!0x1});}));}async['afterInit'](){this['context']instanceof _0x5a6451?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x440013,_0xc7143)=>{_0xc7143['on']('ready',()=>{this['_integrateEditor'](_0xc7143);});});const _0x4e917b=this['context']['config']['get']('ai.chat.initialConversation');let _0x138179=_0x4e917b;if('lastCreated'!=_0x4e917b||(_0x138179=await this['_getLastCreatedConversationId'](),_0x138179))return'new'==_0x138179?this['_startConversationSafely']():this['loadConversation'](_0x138179);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_insertSuggestion'](_0x423465){const _0x3ff092=D(this['context']);if(!_0x3ff092['plugins']['has']('TrackChanges'))throw new _0x1500e8('ai-no-track-changes',null);const _0xcc42fe=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x4d2ed5,interaction:_0x2ebf51}=this['getInteractionAndReplyById'](_0x423465['replyId']),_0x98d78c=this['_getDocumentRangeForReplyChanges'](_0x423465['replyId'],_0x423465['partIndex']),_0x123c31=void 0x0!==_0x423465['partIndex']?[_0x4d2ed5['changeGroups'][_0x423465['partIndex']]]:_0x4d2ed5['changeGroups']['filter'](_0x27276f=>'pending'==_0x27276f['state']),_0x7af6e6=_0x123c31['map'](_0x38dd85=>_0x4d2ed5['changeGroups']['indexOf'](_0x38dd85));if(!_0x98d78c||'$graveyard'==_0x98d78c['range']['root']['rootName'])return void _0x7af6e6['forEach'](_0x418860=>_0x4d2ed5['setChangeGroupState'](_0x418860,'outdated'));_0x7af6e6['forEach'](_0x2eec77=>_0x4d2ed5['setChangeGroupState'](_0x2eec77,'accepted'));const _0x3c66a3=y({'editor':_0x3ff092,'reply':_0x4d2ed5,'interaction':_0x2ebf51,'groups':_0x123c31,'transform':!0x0,'documentCompare':_0xcc42fe,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x3de377;_0x98d78c&&this['_scrollToSuggestionRange'](_0x98d78c['range']),_0x3ff092['model']['change'](_0x4b6e8e=>{_0x3de377=_0x4b6e8e['batch'],_0x3ff092['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x3c66a3),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x3de377,{'interactionId':_0x2ebf51['id'],'replyId':_0x4d2ed5['id'],'indexes':_0x7af6e6['slice']()}),this['_updateRatings'](_0x4d2ed5);}['_applySuggestion'](_0x4e24d8){const _0x5ec2ec=D(this['context']),_0x4f87d9=this['context']['plugins']['get'](_0x4f58a6),{reply:_0x501332,interaction:_0x22da37}=this['getInteractionAndReplyById'](_0x4e24d8['replyId']),_0x59d42a=this['_getDocumentRangeForReplyChanges'](_0x4e24d8['replyId'],_0x4e24d8['partIndex']),_0x2f7ca4=void 0x0!==_0x4e24d8['partIndex']?[_0x501332['changeGroups'][_0x4e24d8['partIndex']]]:_0x501332['changeGroups']['filter'](_0x305813=>'pending'==_0x305813['state']),_0x25126e=_0x2f7ca4['map'](_0x367b6f=>_0x501332['changeGroups']['indexOf'](_0x367b6f));if(!_0x59d42a||'$graveyard'==_0x59d42a['range']['root']['rootName'])return void _0x25126e['forEach'](_0x14fc94=>_0x501332['setChangeGroupState'](_0x14fc94,'outdated'));_0x25126e['forEach'](_0x2794be=>_0x501332['setChangeGroupState'](_0x2794be,'accepted'));const _0x4d876e=y({'editor':_0x5ec2ec,'reply':_0x501332,'interaction':_0x22da37,'groups':_0x2f7ca4,'transform':!0x0,'documentCompare':_0x4f87d9,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x521f10;_0x59d42a&&this['_scrollToSuggestionRange'](_0x59d42a['range']),_0x5ec2ec['model']['change'](_0x22091a=>{_0x521f10=_0x22091a['batch'];for(const _0x3a5314 of _0x4d876e)_0x3a5314['baseVersion']=_0x5ec2ec['model']['document']['version'],d(_0x5ec2ec,_0x3a5314),_0x22091a['batch']['addOperation'](_0x3a5314),_0x5ec2ec['model']['applyOperation'](_0x3a5314);}),this['_batchToChanges']['set'](_0x521f10,{'interactionId':_0x22da37['id'],'replyId':_0x501332['id'],'indexes':_0x25126e['slice']()}),this['_updateRatings'](_0x501332);}['_rejectSuggestion'](_0xee1d30){const {reply:_0x122602}=this['getInteractionAndReplyById'](_0xee1d30['replyId']);_0x122602['setChangeGroupState'](_0xee1d30['partIndex'],'rejected');}['_openBalloonFor'](_0x511ecd,_0x46bc96){if(!this['_aiChatBalloon'])return;const {reply:_0x3f592f}=this['getInteractionAndReplyById'](_0x511ecd),_0x482fbd=_0x3f592f['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x4cc6eb,_0x14087b;if(void 0x0!==_0x46bc96?(_0x14087b=_0x482fbd['find'](_0x5a900b=>_0x5a900b['index']==_0x46bc96),_0x4cc6eb=_0x14087b?.['index']):(_0x14087b=_0x482fbd[0x0],_0x4cc6eb=_0x14087b['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x511ecd&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x4cc6eb)return;const _0x965fe6=this['_getUserPresentableContentPartDocumentRange'](_0x511ecd,_0x3f592f,_0x14087b);if(!_0x965fe6)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x511ecd,'partIndex':_0x4cc6eb},this['_scrollToSuggestionRange'](_0x965fe6,!0x0);const _0x487a7d=this['_getPresentableSiblingContentPartIndex'](_0x511ecd,_0x4cc6eb,'next');this['_aiChatBalloon']['updateContent']({'part':_0x14087b,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x4cc6eb,'title':m(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x4cc6eb+0x1)['toString']()),'showRotator':null!==_0x487a7d,'ranges':[_0x965fe6],'areActionsDisabled':_0x3f592f['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x511ecd,_0x4cc6eb),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x511ecd,'index':_0x4cc6eb,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x4fcdb9,_0x1eb333,_0x1362a6){const {reply:_0x414a2a}=this['getInteractionAndReplyById'](_0x4fcdb9),_0x16de30=_0x414a2a['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x16de30['length'])return null;const _0x3a73a2=_0x16de30['findIndex'](_0x269543=>_0x269543['index']==_0x1eb333),_0x2b77a2='next'==_0x1362a6?0x1:-0x1;let _0x26b430=_0x16de30['at']((_0x3a73a2+_0x2b77a2)%_0x16de30['length'])['index'],_0x1b294b=_0x16de30[_0x26b430];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x4fcdb9,_0x414a2a,_0x1b294b);){if(_0x26b430=_0x16de30['at']((_0x26b430+_0x2b77a2)%_0x16de30['length'])['index'],_0x26b430===_0x3a73a2)return null;_0x1b294b=_0x16de30[_0x26b430];}return _0x26b430;}['_getUserPresentableContentPartDocumentRange'](_0x2e3b36,_0x4c460d,_0x59afeb){const _0x4c9e1c=_0x4c460d['changeGroups'];if(!_0x59afeb['hasChanges'])return null;const _0xe98bdb=_0x4c9e1c['find'](_0x1cc56c=>_0x1cc56c['index']==_0x59afeb['index']);if('pending'!==_0xe98bdb?.['state'])return null;const _0x370f7c=this['_getDocumentRangeForReplyChanges'](_0x2e3b36,_0x59afeb['index']);if(!_0x370f7c)return null;const {range:_0x408b05,currentIndex:_0x1ae86d}=_0x370f7c;return'$graveyard'==_0x408b05['root']['rootName']?(_0x4c460d['setChangeGroupState'](_0x1ae86d,'outdated'),null):_0x370f7c['range'];}['_getDocumentRangeForReplyChanges'](_0x152363,_0x85916c){const _0x451372=D(this['context']),{reply:_0x3e3921,interaction:_0x585f3c}=this['getInteractionAndReplyById'](_0x152363),_0x1e321a=_0x3e3921['changeGroups']['filter'](_0x101891=>'pending'==_0x101891['state']),_0x58f45e=_0x1e321a['map'](_0x272c0a=>_0x3e3921['changeGroups']['indexOf'](_0x272c0a));void 0x0===_0x85916c&&(_0x85916c=_0x58f45e[0x0]);const _0x1c2610=_0x58f45e['indexOf'](_0x85916c);if(-0x1==_0x1c2610)return null;const _0x3da5e7=_0x1e321a[_0x1c2610],_0x87668c=new _0x175d6b([]),_0x496273=new _0x175d6b([]);for(const _0xd65080 of _0x3da5e7['changes'])if('removed'!=_0xd65080['type']&&_0x496273['children']['push'](_0xd65080['node']['cloneNode'](!0x0)),'new'!=_0xd65080['type']){const _0x1dad29=_0x32e3c1(_0x1ef5fc=>q(_0x1ef5fc,'data-id')==_0xd65080['id'],_0x3e3921['documentContextContent'],!0x0);_0x87668c['children']['push'](_0x1dad29['cloneNode'](!0x0));}if(0x0==_0x87668c['children']['length']){if(_0x3da5e7['changes'][0x0]['anchorId']){const _0x117dda=Z('data-id',_0x3da5e7['changes'][0x0]['anchorId'],_0x3e3921['documentContextContent']);_0x87668c['children']['unshift'](_0x117dda['cloneNode'](!0x0)),_0x496273['children']['unshift'](_0x117dda['cloneNode'](!0x0)),_0x117dda['nextSibling']&&(_0x87668c['children']['push'](_0x117dda['nextSibling']['cloneNode'](!0x0)),_0x496273['children']['push'](_0x117dda['nextSibling']['cloneNode'](!0x0)));}else{const _0x578b10=_0x3e3921['documentContextContent']['children'][0x0];if(!_0x578b10)return null;_0x87668c['children']['push'](_0x578b10['cloneNode'](!0x0)),_0x496273['children']['push'](_0x578b10['cloneNode'](!0x0));}}const _0x3c8555=_0x585f3c['getDocumentContext'](),_0x4ae76f=_0x451372['data']['parse'](_0x3c8555['content']),_0x3ec360=Y(_0x87668c),_0x3b9a92=_0x451372['data']['parse'](_0x3ec360),_0x24ae47=_0x451372['data']['parse'](_0x3ec360),_0x1e5c9d=_0x451372['model']['createPositionAt'](_0x3b9a92,0x0),_0x4ee245=Y(_0x496273),_0x395175={'anchor':_0x1e5c9d,'markDeletions':!0x1},_0x105965=_0x451372['plugins']['get'](_0x4f58a6)['getDiff'](_0x3ec360,_0x4ee245,_0x395175)['getOperations']();if(!_0x105965['length'])return null;_0x451372['model']['change'](_0x37b74d=>{for(const _0x284b9a of _0x105965)if('remove'==_0x284b9a['type']){const _0x2f7226=_0x284b9a['sourcePosition'],_0x51dc95=_0x284b9a['howMany'],_0x5ac0ec=new _0x34bf3b(_0x2f7226,_0x51dc95);_0x37b74d['batch']['addOperation'](_0x5ac0ec),_0x451372['model']['applyOperation'](_0x5ac0ec);}else'marker'!==_0x284b9a['type']&&(_0x284b9a['baseVersion']=null,_0x284b9a['isDocumentOperation']=!0x1,_0x37b74d['batch']['addOperation'](_0x284b9a),_0x451372['model']['applyOperation'](_0x284b9a));});const _0x5b6e51=W(_0x451372,_0x105965,_0x3b9a92);G(_0x451372['model'],_0x5b6e51);const _0x188041=_0x5b6e51['getFirstRange']()['start']['path']['slice'](),_0x59eed4=_0x5b6e51['getFirstRange']()['end']['path']['slice'](),_0x3f8db3=[];let _0x1b6992=_0x3b9a92,_0xc552d0=_0x24ae47;for(let _0x407ce3=0x0;_0x407ce3<_0x59eed4['length'];_0x407ce3++){const _0x2dec4e=_0x1b6992['maxOffset']-_0x59eed4[_0x407ce3];_0x3f8db3[_0x407ce3]=_0xc552d0['maxOffset']-_0x2dec4e,_0x1b6992=_0x1b6992['getChildAtOffset'](_0x59eed4[_0x407ce3]),_0xc552d0=_0xc552d0['getChildAtOffset'](_0x3f8db3[_0x407ce3]);}const _0x1d07c2=_0x451372['model']['createRange'](_0x451372['model']['createPositionFromPath'](_0x24ae47,_0x188041),_0x451372['model']['createPositionFromPath'](_0x24ae47,_0x3f8db3)),_0x52a7bd=_0x24ae47['getChild'](0x0)['getAttribute'](_0x1707b9),_0x50fc51=Array['from'](_0x4ae76f['getChildren']())['find'](_0x4ffd6b=>_0x4ffd6b['getAttribute'](_0x1707b9)==_0x52a7bd)['getPath'](),_0x540895=_0x1d07c2['start']['path']['slice'](),_0x52959a=_0x1d07c2['end']['path']['slice']();_0x540895[0x0]=_0x50fc51[0x0]+_0x540895[0x0],_0x52959a[0x0]=_0x50fc51[0x0]+_0x52959a[0x0];let _0x355308=_0x451372['model']['createRange'](_0x451372['model']['createPositionFromPath'](_0x451372['model']['document']['getRoot'](),_0x540895),_0x451372['model']['createPositionFromPath'](_0x451372['model']['document']['getRoot'](),_0x52959a));const _0x30df1a=_0x451372['model']['document']['history']['getOperations'](_0x3c8555['version']);for(const _0x3175e8 of _0x30df1a)_0x355308=_0x1f26a0['_createFromRanges'](_0x355308['getTransformedByOperation'](_0x3175e8));return{'range':_0x355308,'currentIndex':_0x85916c};}['_integrateEditor'](_0x5976ae){if(!_0x5976ae['plugins']['has']('Undo'))return;const _0x10c6a9=_0x5976ae['commands']['get']('undo'),_0x48b065=_0x5976ae['commands']['get']('redo');this['listenTo'](_0x10c6a9,'revert',(_0x2dc1b9,_0x58c2f0,_0x3f95b4)=>{const _0x5d341f=this['_batchToChanges']['get'](_0x58c2f0);if(!_0x5d341f)return;const _0x5b3ffe=this['activeConversation']['getInteraction'](_0x5d341f['interactionId'])['getReply'](_0x5d341f['replyId']);_0x5d341f['indexes']['forEach'](_0x3561bb=>_0x5b3ffe['setChangeGroupState'](_0x3561bb,'pending')),this['_batchToChanges']['delete'](_0x58c2f0),this['_batchToChanges']['set'](_0x3f95b4,_0x5d341f);}),this['listenTo'](_0x48b065,'revert',(_0x5b3f4e,_0x208092,_0x37153e)=>{const _0x2df425=this['_batchToChanges']['get'](_0x208092);if(!_0x2df425)return;const _0x6bdf8c=this['activeConversation']['getInteraction'](_0x2df425['interactionId'])['getReply'](_0x2df425['replyId']);_0x2df425['indexes']['forEach'](_0x42e701=>_0x6bdf8c['setChangeGroupState'](_0x42e701,'accepted')),this['_batchToChanges']['delete'](_0x208092),this['_batchToChanges']['set'](_0x37153e,_0x2df425);});}async['loadConversation'](_0x1ea26c){this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),(this['context']['plugins']['get'](H)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x1ea26c)['getConversation'](),await this['_startConversationSafely'](_0x1ea26c),this['updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x1ea26c,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x1f3b95){this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x1ea26c}),this['_logError'](new _0x1500e8('ai-chat-conversation-not-found',this,{'error':_0x1f3b95}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}async['_getLastCreatedConversationId'](){const _0x347315=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x359376=await _0x347315['getConversations']();return _0x359376['length']?_0x359376[0x0]['id']:'new';}catch(_0x57a763){return this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x3e4e8c()}),this['_logError'](new _0x1500e8('ai-chat-conversation-init-failed',this,{'error':_0x57a763})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}['handleRemovedConversation'](_0x29d9ee){this['activeConversation']['id']===_0x29d9ee&&this['_startConversationSafely']();}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](m(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x186ea9=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x186ea9),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x24d9b7,attributes:_0x4fb17a}){await this['_handleUIUserMessage']({'userMessage':_0x24d9b7,'attributes':_0x4fb17a});}['getGroupId'](){const _0x2e2812=this['context']['config']['get']('collaboration.channelId');if(!_0x2e2812)throw new _0x1500e8('ai-chat-missing-channel-id',this);return _0x2e2812;}async['_startConversationSafely'](_0x2d5d61){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x2d5d61);}catch(_0x538c5f){this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x2d5d61||_0x3e4e8c()}),console['error'](_0x538c5f),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x476afc){let _0x4ac835;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x476afc||!this['activeConversation']?_0x4ac835=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x4ac835=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x4b5478=this['getGroupId'](),_0x449ba7=_0x476afc||_0x3e4e8c();this['activeConversation']=new F({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x4ac835,'conversationId':_0x449ba7,'group':_0x4b5478,'getEditor':()=>D(this['context']),'isFromHistory':!!_0x476afc}),this['activeConversation']['delegate']('toolDataReceived','interactionStarted')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x15b46e,_0x566919)=>{this['_aiChatUi']['createConversation'](_0x566919),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x476afc||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x397033,_0x76d24c)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x76d24c['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x200c64,_0x1acd24)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x1acd24);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0xaa06b4=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0xaa06b4);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x506245=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x506245);}),this['activeConversation']['on']('webSearchFinished',(_0x2d9e52,_0x553171)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x553171,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x535263,_0x119eec)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x119eec,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0xa628a8,_0x13ba03)=>{this['_aiChatUi']['removeFeedInteraction'](_0x13ba03['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x3cae7c,_0x1bbe79,_0x297e5f)=>{this['updateConversationTitle'](_0x1bbe79,_0x297e5f);}),this['activeConversation']['on']('replyCreated',(_0x138423,_0x5f179b)=>{'text'===_0x5f179b['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x5f179b):this['_aiChatUi']['addFeedItemAISuggestion'](_0x5f179b);}),this['activeConversation']['on']('replyContentUpdated',async(_0x35b847,_0x2f5eb5)=>{await this['_updateReplyContent']({'reply':_0x2f5eb5});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x18ba15,{reply:_0x57dd46,index:_0x583bf8,state:_0x32de00})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x57dd46['id'],'index':_0x583bf8,'state':_0x32de00}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x57dd46['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x583bf8&&this['_aiChatBalloon']?.['setState'](_0x32de00);}),this['activeConversation']['on']('contextItemAdded',(_0x25992f,_0x50a892)=>{if(this['_aiChatUi']['addContextItem'](_0x50a892['contextItem'],_0x50a892['isLoading']),'selection'===_0x50a892['contextItem']['type']){const _0x455d5b=[...D(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x455d5b,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x1afaf5,_0x8a1a9f)=>{this['_aiChatUi']['removeContextItem'](_0x8a1a9f['uiId']),'current-document'==_0x8a1a9f['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x8a1a9f['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x5ad17a,_0xf85c29)=>{this['_aiChatUi']['setContextItemLoading'](_0xf85c29['contextItem']['uiId'],_0xf85c29['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x18d466,_0x5289be)=>{this['_aiChatUi']['setConversationContext'](_0x5289be['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x24240b,_0x583ce2)=>{this['_aiChatUi']['setAddContextOptions'](_0x583ce2['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x14edd1,_0x1440d9)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x1440d9['sourceId'],_0x1440d9['source'],_0x1440d9['resources'],_0x1440d9['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x10b7eb,_0xad45a6)=>{this['_aiChatUi']['updateResourceState'](_0xad45a6['sourceId'],_0xad45a6['resourceId'],_0xad45a6['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x46dcb8,_0x362bb2)=>{this['_aiChatUi']['updateCapabilities'](_0x362bb2);}),this['activeConversation']['on']('modelSelected',async(_0x3982f2,_0x519ed4)=>{const _0x32d1b0=(await this['_aiChatModels']['getAll']())['find'](_0x492332=>_0x492332['id']===_0x519ed4['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x32d1b0,_0x519ed4['isDisabled']);}),this['activeConversation']['on']('error',(_0x7c7708,{error:_0x3e4ef6,interactionId:_0x4ab590,fileName:_0x311f2b,url:_0x537f68,sourceId:_0x59b807,sourceLabel:_0x4e4b6e})=>{const _0x1a5a2a=_0x4ab590?_0x4ab590+':'+_0x3e4e8c():_0x3e4e8c();_0x3e4ef6['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':m(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x1a5a2a}):_0x3e4ef6['message']['startsWith']('ai-chat-conversation-init-failed')||_0x3e4ef6['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x1a5a2a}),this['_logError'](_0x3e4ef6)):_0x3e4ef6['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x311f2b),'id':_0x1a5a2a}):_0x3e4ef6['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x537f68),'id':_0x1a5a2a}):_0x3e4ef6['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x1a5a2a}):_0x3e4ef6['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x1a5a2a}):_0x3e4ef6['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x59b807&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x59b807),this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x4e4b6e||'source'),'id':_0x1a5a2a}),this['_logError'](_0x3e4ef6)):_0x3e4ef6['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x1a5a2a}),this['_logError'](_0x3e4ef6)):_0x3e4ef6['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x1a5a2a}),this['_logError'](_0x3e4ef6)):_0x3e4ef6['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x1a5a2a}),this['_logError'](_0x3e4ef6)):_0x3e4ef6['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x1a5a2a}),this['_logError'](_0x3e4ef6)):_0x3e4ef6['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x1a5a2a}),this['_logError'](_0x3e4ef6)):_0x3e4ef6['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x1a5a2a}),this['_logError'](_0x3e4ef6)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x1a5a2a}),this['_logError'](_0x3e4ef6));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x476afc||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x285888,attributes:_0x5c5bda}){if(!this['activeConversation'])throw new _0x1500e8('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x564c73=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x564c73);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x285888,'attributes':_0x5c5bda});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x322f59){this['_aiChatUi']['setIsMaximized'](_0x322f59);}['_logError'](_0xaf7c72){_0x4dee23(_0xaf7c72['message']);}['_removeFromContext'](_0x8d1a63){this['activeConversation']?.['removeFromContext'](_0x8d1a63);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x2bac73){const [_0x43a53e,_0x591c7d]=_0x2bac73['split'](':'),_0x41b2bb=this['activeConversation']['getInteraction'](_0x43a53e),_0x5d9e6b=_0x41b2bb['getReply'](_0x591c7d);return{'interaction':_0x41b2bb,'reply':_0x5d9e6b};}['_scrollToSuggestionRange'](_0x571913,_0x35032c=!0x1){const _0x17deba=D(this['context']),_0x348cda={'target':_0x17deba['editing']['view']['domConverter']['viewRangeToDom'](_0x17deba['editing']['mapper']['toViewRange'](_0x571913)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x35032c};_0x35032c&&(_0x348cda['alignToTop']=!0x0),_0x54e791(_0x348cda);}['updateConversationTitle'](_0x163417,_0x189556=!0x1){this['_aiChatUi']['setConversationTitle'](_0x163417||m(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x189556);}async['_updateReplyContent']({reply:_0xda5182,renderingStrategy:_0x315508}){const {id:_0x457ca2,interactionId:_0x856423,isDone:_0x226eba,type:_0x336713,parsedContent:_0x1ca63d}=_0xda5182,_0x3164a0=_0x856423+':'+_0x457ca2;if('modification'===_0x336713){const _0x35fc22=_0xda5182['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x3164a0,'parts':_0x35fc22,'renderingStrategy':_0x315508,'isDone':_0x226eba});}else'text'===_0x336713&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x3164a0,'parsedContent':_0x1ca63d,'renderingStrategy':_0x315508,'isDone':_0x226eba});_0x226eba&&_0xda5182['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x3164a0,_0xda5182['sources']);}async['_stopLastInteraction'](){const _0x5d91e3=this['activeConversation']?.['lastInteraction'];_0x5d91e3&&(_0x5d91e3['stop'](),this['_aiChatUi']['stopInteraction'](_0x5d91e3));}async['_flushLastInteractionUI'](){const _0x553275=this['activeConversation']?.['lastInteraction'];if(_0x553275){for await(const _0x1d56b9 of _0x553275['replies'])await this['_updateReplyContent']({'reply':_0x1d56b9,'renderingStrategy':'static'});}}['_updateRatings'](_0xf05f45){const _0x56a525={'positiveCount':_0xf05f45['changeGroups']['filter'](_0x4c1a87=>'accepted'===_0x4c1a87['state'])['length'],'totalCount':_0xf05f45['changeGroups']['length'],'modificationId':_0xf05f45['id']},_0x238917=this['activeConversation']['getInteraction'](_0xf05f45['interactionId'])['messageId'];_0x238917&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x238917,_0x56a525);}['_registerToolDataCallback'](_0x55ca11){let _0x3c65f=null,_0x23f0a9=null;this['on']('toolDataReceived',(_0x547876,_0xab67fb,_0x225279)=>{_0x225279['id']!==_0x3c65f&&(_0x3c65f=_0x225279['id'],_0x23f0a9=this['_getAIChatInteractionAPI'](_0x225279)),_0x55ca11(_0xab67fb,_0x23f0a9);});}['_getAIChatInteractionAPI'](_0x2510eb){const _0x3631b4=this['_aiChatUi'],_0x2a1f99=()=>{_0x2510eb['resetWebSearchState'](),_0x2510eb['resetReasoningState'](),_0x3631b4['clearLoadingMessage']();},_0x24f219=()=>{_0x2510eb['currentReply']&&(_0x2510eb['currentReply']['done'](),_0x2510eb['currentReply']=void 0x0);};return{'insertTextReply':(_0x544ae5,_0x11be64)=>{_0x24f219(),_0x2a1f99();const _0x440b38=_0x2510eb['currentReply']=_0x2510eb['createReply']({'type':'text','interactionId':_0x2510eb['id'],'content':_0x544ae5,'id':_0x11be64||_0x3e4e8c()});return _0x24f219(),_0x440b38;},'insertCustomElement':async(_0x301395,_0x30ad98)=>(_0x24f219(),_0x2a1f99(),_0x3631b4['addFeedItemCustomElement'](_0x301395,_0x30ad98||_0x3e4e8c())),'setLoadingMessage':_0x135bc6=>{_0x3631b4['setLoadingMessage'](_0x135bc6);},'clearLoadingMessage':()=>{_0x3631b4['clearLoadingMessage']();}};}}const a='ai-selection';class o extends _0x37abb2{constructor(_0x1daf6a){super(_0x1daf6a),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 _0x13b169=D(this['context']),_0x21f5ca=_0x13b169['plugins']['has']('RealTimeCollaborationClient')&&_0x13b169['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x21f5ca||_0x3e4e8c();}return this['_sessionId'];}async['getDocumentData'](){const _0x322def=D(this['context']),_0x5c7edc=_0x322def['model'],_0x2e469a=_0x322def['data']['toView'](_0x5c7edc['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x1b8eae=new ft(_0x322def['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x2e469a,_0x1b8eae);let _0x436595=await this['_getDocumentDataStringFromView'](_0x2e469a);const _0x26c48c=this['_getMarkersInDocumentOrder'](),_0x4e1b55=[];for(const _0x1914a0 of _0x26c48c){const _0x31921f='<'+_0x1914a0['name']+':start></'+_0x1914a0['name']+':start>',_0x2167ec=_0x436595['indexOf'](_0x31921f);_0x436595=_0x436595['substring'](0x0,_0x2167ec)+_0x436595['substring'](_0x2167ec+_0x31921f['length']);const _0xb9b1d2='<'+_0x1914a0['name']+':end></'+_0x1914a0['name']+':end>',_0x2a1a92=_0x436595['indexOf'](_0xb9b1d2);_0x436595=_0x436595['substring'](0x0,_0x2a1a92)+_0x436595['substring'](_0x2a1a92+_0xb9b1d2['length']),_0x4e1b55['push']({'markerName':_0x1914a0['name'],'start':_0x2167ec,'end':_0x2a1a92,'htmlFragment':_0x436595['substring'](_0x2167ec,_0x2a1a92)});}return{'content':_0x436595,'version':_0x322def['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x4e1b55};}async['afterInit'](){this['context']instanceof _0x5a6451?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x241f42,_0x297a7b)=>{_0x297a7b['on']('ready',()=>{this['_integrateEditor'](_0x297a7b);});});}['_setOutputDataProcessor'](_0x397e45){this['_outputDataProcessor']=_0x397e45;}async['_getDocumentDataStringFromView'](_0x5bce39){let _0x454bc6;const _0xb0a00=D(this['context']);if(this['_outputDataProcessor']){const _0x5e20f1=_0xb0a00['data']['processor']['domConverter']['viewToDom'](_0x5bce39),_0x28ea53=await this['_outputDataProcessor'](_0x5e20f1);_0x454bc6=_0xb0a00['data']['processor']['htmlWriter']['getHtml'](_0x28ea53);}else _0x454bc6=_0xb0a00['data']['processor']['toData'](_0x5bce39);return _0x454bc6;}['_integrateEditor'](_0x11503f){_0x11503f['conversion']['for']('editingDowncast')['markerToHighlight']({'model':a,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x11503f['conversion']['for']('dataDowncast')['markerToElement']({'model':a,'view':(_0x2ad973,{writer:_0x4eb535,options:_0x1725bb})=>_0x1725bb['convertAiChatSelectionMarker']?_0x4eb535['createUIElement'](_0x2ad973['markerName']+':'+(_0x2ad973['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x58a9b4,_0x2ffd6f,_0x35cec6=!0x1,_0x1b0fd0=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x1b0fd0)return!0x1;const _0x2b1386=D(this['context'])['model'];return _0x2b1386['change'](_0x4b0c45=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x2ffd6f,this['_displayedFakeSelectionLocked']=_0x35cec6;let _0x439229=0x0;for(let _0x30be1c of _0x58a9b4){const _0x56b329=a+':'+_0x439229;if(_0x30be1c['start']['isAtEnd']){const _0x10b82d=_0x30be1c['start']['getLastMatchingPosition'](({item:_0x2cc1f6})=>!_0x2b1386['schema']['isContent'](_0x2cc1f6),{'boundaries':_0x30be1c});_0x30be1c=_0x4b0c45['createRange'](_0x10b82d,_0x30be1c['end']);}_0x4b0c45['addMarker'](_0x56b329,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x30be1c}),_0x439229++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x417d85){if(this['_displayedFakeSelectionId']!=_0x417d85)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x4e47e9=D(this['context']),_0x163c0c=_0x4e47e9['model']['markers']['getMarkersGroup'](a);return _0x4e47e9['model']['change'](_0x5c2ff9=>{for(const _0x587e05 of _0x163c0c)_0x5c2ff9['removeMarker'](_0x587e05);}),!0x0;}async['modelToDataWithIds'](_0x468ce5){const _0x260833=D(this['context']),_0x12eee9=_0x260833['data']['toView'](_0x468ce5),_0x1c3867=new ft(_0x260833['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x12eee9,_0x1c3867),this['_getDocumentDataStringFromView'](_0x12eee9);}['_setDataIdsOnChildren'](_0x441cf2,_0x260e92){let _0x5699c2=!0x1;const _0x17a5e9=new Set();for(const _0x5a9626 of _0x441cf2['getChildren']()){const _0x2e688c=_0x5a9626['is']('emptyElement')||_0x5a9626['is']('containerElement');if(!_0x5a9626['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x5a9626,_0x260e92)||_0x2e688c)&&(_0x260e92['setAttribute']('data-id',this['_nextDataId'](_0x17a5e9),_0x5a9626),_0x5699c2=!0x0);}return _0x5699c2;}['_nextDataId'](_0x50c12c){let _0xdce210;do{_0xdce210='';for(let _0x1b298b=0x0;_0x1b298b<0x4;_0x1b298b++)_0xdce210+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x50c12c['has'](_0xdce210));return _0x50c12c['add'](_0xdce210),_0xdce210;}['getSelectionText'](){const {model:_0x401e47}=D(this['context']),_0x3fe767=_0x401e47['document']['selection'],_0x1bfa15=[];for(const _0x142654 of _0x3fe767['getRanges']())for(const _0x4c4cf2 of _0x142654['getItems']())_0x4c4cf2['is']('$textProxy')?_0x1bfa15['push'](_0x4c4cf2['data']):_0x4c4cf2['is']('element')&&_0x1bfa15['length']>0x0&&'\x20'!==_0x1bfa15[_0x1bfa15['length']-0x1]&&_0x1bfa15['push']('\x20');return _0x1bfa15['length']?'\x22'+_0x1bfa15['join']('')['trim']()+'\x22':m(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_getMarkersInDocumentOrder'](){const _0x381ada=D(this['context'])['model'];return Array['from'](_0x381ada['markers']['getMarkersGroup'](a))['sort']((_0x368e50,_0x45ce4f)=>_0x368e50['getStart']()['isBefore'](_0x45ce4f['getStart']())?-0x1:_0x368e50['getStart']()['isAfter'](_0x45ce4f['getStart']())?0x1:0x0);}}const V=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],it=[...V,'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(_0x4b47d7){this['options']={'delay':_0x4b47d7['delay']??0x14,'textNodeStyle':_0x4b47d7['textNodeStyle'],'onStreamUpdate':_0x4b47d7['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x139241,targetElement:_0x46ea48,abortSignal:_0x24a3d2}){this['isStreaming']&&this['stop'](),_0x24a3d2?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x257863(_0x139241,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x586f8d=0x0;_0x586f8d<this['currentIndex'];_0x586f8d++)this['nodesList'][_0x586f8d]['shouldBeStreamed']=!0x0;do{const _0x46c84e=Date['now'](),_0x26c100=this['nodesList'][this['currentIndex']],_0x1ee038=_0x46c84e-this['lastUpdateTime'];if(_0x26c100){_0x26c100['shouldBeStreamed']=!0x0;let _0x172bf4=_0x26c100['parent'];for(;_0x172bf4;)_0x172bf4['shouldBeStreamed']=!0x0,_0x172bf4=_0x172bf4['parent'];}if(_0x1ee038<this['options']['delay'])try{const {promise:_0x19c6e9,abortController:_0x3e33f9}=Os(this['options']['delay']-_0x1ee038);this['timeoutAbortController']=_0x3e33f9,await _0x19c6e9;}catch(_0x412051){return;}_0x1cf580(_0x46ea48,'<'+_0x46ea48['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x46ea48['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:_0x57c0fe}){Array['from'](_0x57c0fe['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x4a825a=>{_0x4a825a['replaceWith'](_0x4a825a['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x1db65d){let _0x14142f='';if(function(_0x364d72){return _0x5de66b(_0x364d72);}(_0x1db65d)){for(const _0x18a9a8 of _0x1db65d['children'])_0x14142f+=this['renderNode'](_0x18a9a8);}else{if(Ls(_0x1db65d)){if(!_0x1db65d['shouldBeStreamed'])return'';const _0x415ae2=_0x1db65d,_0x3ce96c=Object['entries'](_0x415ae2['attribs'])['map'](([_0x164c3b,_0x5c5d2c])=>_0x164c3b+'=\x22'+_0x5c5d2c+'\x22')['join']('\x20');_0x14142f+='<'+_0x415ae2['tagName']+(_0x3ce96c?'\x20'+_0x3ce96c:'')+'>';for(const _0x5594ac of _0x5ecbbf(_0x415ae2))_0x14142f+=this['renderNode'](_0x5594ac);_0x14142f+='</'+_0x415ae2['tagName']+'>';}else{if(!Ts(_0x1db65d))return'';if(!_0x1db65d['shouldBeStreamed'])return'';!function(_0xde3479){if(!_0xde3479['parent']||!Ls(_0xde3479['parent']))return!0x1;if(!ys['includes'](_0xde3479['parent']['tagName']))return!0x1;return!_0x4fc42c(_0xde3479)['match'](/^\s*[<>]\s*$/);}(_0x1db65d)?_0x14142f+=_0x2aee41(_0x1db65d):_0x14142f+=_0x2aee41(new _0x309db4('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x1db65d]));}}return _0x14142f;}['getParsedDocumentNodeList'](){const _0x48ab35=[];return function(_0x307306,_0x232e04){const _0x3fcba7=_0x5e4f1a=>{if(_0x232e04(_0x5e4f1a),_0x5e4f1a instanceof _0x5329aa)for(let _0x17b0e7=0x0;_0x17b0e7<_0x5e4f1a['children']['length'];_0x17b0e7++){const _0x10609d=_0x5e4f1a['children'][_0x17b0e7];_0x3fcba7(_0x10609d);}};for(let _0x42d127=0x0;_0x42d127<_0x307306['children']['length'];_0x42d127++)_0x3fcba7(_0x307306['children'][_0x42d127]);}(this['document'],_0x3958e7=>{if(Ts(_0x3958e7)){const _0x126d75=this['splitTextNodeIntoWordNodes'](_0x3958e7);_0x126d75['length']&&_0x48ab35['push'](..._0x126d75);}_0x3958e7['isWordSplitSource']||_0x3958e7['isWordSplitResult']||_0x48ab35['push'](_0x3958e7);}),_0x48ab35;}['splitTextNodeIntoWordNodes'](_0x31d2fc){if(_0x31d2fc['isWordSplitSource']||_0x31d2fc['isWordSplitResult'])return[];const _0x22e2c1=_0x4fc42c(_0x31d2fc)['match'](/(?:\s*\S+\s*)/g),_0x210337=[];if(_0x22e2c1&&_0x22e2c1['length']>0x1){for(const _0x30ae5c of _0x22e2c1){const _0x5dd940=new _0x28e1e3(_0x30ae5c);_0x5dd940['isWordSplitResult']=!0x0,_0x4512fa(_0x31d2fc,_0x5dd940),_0x210337['push'](_0x5dd940);}_0x31d2fc['isWordSplitSource']=!0x0,_0x7119c8(_0x31d2fc);}return _0x210337;}}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(_0x27296e){return _0x211c5d(_0x27296e);}function Ls(_0x6d98c3){return _0x32b8a9(_0x6d98c3);}function Os(_0x1a3195){const _0x313cc3=new AbortController();return{'promise':new Promise((_0x486e07,_0x1435ea)=>{const _0x367e60=setTimeout(_0x486e07,_0x1a3195);_0x313cc3['signal']['addEventListener']('abort',()=>{clearTimeout(_0x367e60),_0x1435ea();});}),'abortController':_0x313cc3};}class xr extends _0x538d57{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x55aa85){super();const _0x59072e=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']=_0x55aa85,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x59072e['if']('isDone','ck-ai-chat__feed__item_done'),_0x59072e['if']('isVisible','ck-hidden',_0x5aa240=>!_0x5aa240),'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'](_0x141f7a=>{_0x141f7a['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x48fd3e,_0x59872b,_0x3c0872){await this['htmlStreamer']['stream']({'document':_0x48fd3e,'targetElement':_0x59872b,'abortSignal':_0x3c0872});}}class oa extends _0x538d57{['showChangesToggleView'];constructor(_0x306c22,_0x5da5ff){super(_0x306c22),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Or(_0x306c22),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':m(_0x306c22,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x5da5ff['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x579f89=>_0x579f89?_0x455aeb:_0x3da748),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0xd5bb8b=new _0x1a5580();_0xd5bb8b['content']=_0x2040cd,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x5da5ff['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0xd5bb8b,{'tag':'span','children':[m(_0x306c22,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Or extends _0x3fc85a{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const Wr={'accepted':_0x45fb55,'rejected':_0x1e0042,'outdated':_0x1e0042};class as extends _0x538d57{['stateIconView'];constructor(_0x5aa9b2){super(_0x5aa9b2);const _0x95f3dd=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new Yr(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x95f3dd['to']('state',_0x1650e3=>'ck-ai-suggestion__content-part-state_'+_0x1650e3),_0x95f3dd['if']('isVisible','ck-hidden',_0xce82b1=>!_0xce82b1)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x95f3dd['to']('state',_0x3a8b48=>{switch(_0x3a8b48){case'accepted':return m(_0x5aa9b2,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return m(_0x5aa9b2,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return m(_0x5aa9b2,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x28d9bf){this['state']=_0x28d9bf;}}class Yr extends _0x1a5580{constructor(){super(),this['set']('state','accepted'),this['content']=Wr[this['state']],this['on']('change:state',()=>{this['content']=Wr[this['state']];});}}class os extends _0x1b7f91{['_applyButton'];['_suggestButton'];constructor(_0xd7ac61,_0x258e28,_0x1bcb93){super(_0xd7ac61);const _0x14a4de=Boolean(_0x1bcb93);this['set']('isEnabled',!_0x14a4de),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x160197=[];if(_0x14a4de){const _0xd0b36=new _0x3fc85a(_0xd7ac61);_0xd0b36['set']({'label':m(_0xd7ac61,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':tc}),_0x160197['push'](_0xd0b36);}else{_0x258e28['includes']('applySuggestion')&&(this['_applyButton']=new _0x3fc85a(_0xd7ac61),this['_applyButton']['set']({'label':m(_0xd7ac61,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x45fb55}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x160197['push'](this['_applyButton'])),_0x258e28['includes']('insertSuggestion')&&(this['_suggestButton']=new _0x3fc85a(_0xd7ac61),this['_suggestButton']['set']({'label':m(_0xd7ac61,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x44249d}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x160197['push'](this['_suggestButton']));const _0x59a530=new _0x3fc85a(_0xd7ac61);_0x59a530['set']({'label':m(_0xd7ac61,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x1e0042}),_0x59a530['bind']('isEnabled')['to'](this),_0x59a530['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x160197['push'](_0x59a530);}this['items']['addMany'](_0x160197);const _0x339864=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x339864['if']('isVisible','ck-hidden',_0x106810=>!_0x106810)]}});}['setButtonsVisibility']({showApplyButton:_0xc2d564,showSuggestButton:_0x357e8f}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0xc2d564),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x357e8f);}}class vn extends _0x538d57{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x4907a3,{part:_0x2e34de,uiIndex:_0x58b2b6,availableActions:_0x17db5a,areActionsDisabled:_0x3bb961}){super(_0x4907a3),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new os(_0x4907a3,_0x17db5a,_0x3bb961),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x2e34de['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x2e34de['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x2e34de['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new as(_0x4907a3),this['titleLabelView']=new Sn(_0x4907a3,_0x58b2b6),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',(_0x47f94c,_0x33954f,_0x4e59f3,_0x4baf08)=>{'pending'===_0x4baf08?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x4e59f3?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x4e59f3),this['children']['add'](this['stateView']));});}}class Sn extends _0x538d57{constructor(_0x598e82,_0x392e80){super(_0x598e82),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[m(_0x598e82,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x392e80['toString']())]});}}class es extends _0x538d57{['htmlStreamer'];constructor(_0x67e089){super(_0x67e089),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:_0x207a4f,renderingStrategy:_0x14e7dc,abortSignal:_0x19d82d}){'streaming'===_0x14e7dc?await this['htmlStreamer']['stream']({'document':_0x207a4f['content'],'targetElement':this['element'],'abortSignal':_0x19d82d}):this['element']['innerHTML']=Y(_0x207a4f['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class na extends _0x538d57{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x4b4079,{part:_0x379804,uiIndex:_0xa8ab35,areActionsDisabled:_0x611bf5,availableActions:_0x36d04c}){super(_0x4b4079);const _0x5d3e56=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x3c1c1c=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x611bf5;};this['on']('change:state',_0x3c1c1c),this['on']('change:isDone',_0x3c1c1c),_0x3c1c1c(),this['_children']=this['createCollection'](),this['_headerView']=new vn(_0x4b4079,{'part':_0x379804,'uiIndex':_0xa8ab35,'availableActions':_0x36d04c,'areActionsDisabled':_0x611bf5}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...V)['to'](this),this['_streamableContentView']=new es(_0x4b4079),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x5d3e56['to']('state',_0x3e457b=>'ck-ai-suggestion__body__content-part_'+_0x3e457b),_0x5d3e56['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x5d3e56['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x5d3e56['if']('isVisible','ck-hidden',_0x5b55a=>!_0x5b55a)]},'children':this['_children'],'on':{'mouseenter':_0x5d3e56['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x379804['index']});}),'mouseleave':_0x5d3e56['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x379804['index']});}),'click':_0x5d3e56['to'](_0x10f313=>{const _0x2ceff7=_0x10f313['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x2ceff7)&&this['fire']('showChangeInText',{'index':_0x379804['index']});})}});}async['updateContent']({part:_0x576f2f,renderingStrategy:_0x2ae0bd,showUnchangedParts:_0x5b68a3=!0x1,abortSignal:_0x3b2d5b}){this['partDefinition']=_0x576f2f,this['isVisible']=this['partDefinition']['hasChanges']||_0x5b68a3,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x576f2f,'renderingStrategy':_0x2ae0bd,'abortSignal':_0x3b2d5b});}['markAsDone'](){this['isDone']=!0x0;}}class g extends Ft(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x47586f){const _0x5e3178=this['createTask'](_0x47586f);return this['queue']['push'](_0x5e3178),this['_processQueue'](),_0x5e3178['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(_0x123fce=>{this['once']('_queueEmpty',()=>{_0x123fce();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x188a9d=this['queue']['shift']();try{await _0x188a9d['callback'](this['_abortController']['signal']),_0x188a9d['resolve']();}catch(_0x4af24e){_0x188a9d['reject'](_0x4af24e);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x957dc0){let _0x2854eb,_0x5c12f2;const _0x1de4d9=new Promise((_0x282c78,_0x35634b)=>{_0x2854eb=_0x282c78,_0x5c12f2=_0x35634b;});return{'callback':_0x957dc0,'resolve':_0x2854eb,'reject':_0x5c12f2,'completePromise':_0x1de4d9};}}class Pe extends xr{constructor(_0x21f703){super(_0x21f703),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x21f703['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x1c0160){this['element']['innerHTML']=_0x1c0160;}}const S=['applySuggestion','insertSuggestion'];class ra extends _0x538d57{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x5ea3eb,_0x28386b=[...S],_0x2885d9){super(_0x5ea3eb);const _0x425dab=this['bindTemplate'],_0x1985ce=Boolean(_0x2885d9);if(this['set']('isEnabled',!_0x1985ce),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x1985ce){const _0x50a073=new _0x3fc85a(_0x5ea3eb);_0x50a073['set']({'label':m(_0x5ea3eb,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':tc});const _0x239a67=new _0x538d57(_0x5ea3eb);_0x239a67['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[m(_0x5ea3eb,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x50a073]}]}),this['children']['add'](_0x239a67);}else this['_applyChangesButton']=new _0x3fc85a(_0x5ea3eb),this['_applyChangesButton']['set']({'label':m(_0x5ea3eb,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x28386b['includes']('applySuggestion'),'class':'ck-ai-button-primary'}),this['_insertSuggestionsButton']=new _0x3fc85a(_0x5ea3eb),this['_insertSuggestionsButton']['set']({'label':m(_0x5ea3eb,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x28386b['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'](_0x4a2e8d=>{_0x4a2e8d['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',_0x425dab['if']('isVisible','ck-hidden',_0x3796ee=>!_0x3796ee)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x102bff){this['isVisible']=_0x102bff;}['_switchButtonLabelsPlurality'](_0x243cc5){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x243cc5?(this['_applyChangesButton']['label']=m(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=m(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=m(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=m(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class yr extends _0x538d57{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x990f4,_0x32fc73){super(_0x990f4),this['bodyCollection']=_0x32fc73,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',_0x2358de=>!_0x2358de)]},'children':this['children']});const _0x5a7b40=new _0x538d57(this['locale']),_0x3172a1=new _0x1a5580();_0x3172a1['content']=_0x1904ed,_0x5a7b40['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x3172a1,{'tag':'span','children':[{'text':m(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x5a7b40),this['_setupBalloonPanel'](_0x990f4);}['addSource'](_0x54e78d){this['children']['add'](new Cr(this['locale'],_0x54e78d,this['balloonPanelView']));}['_setupBalloonPanel'](_0x4a11cb){this['balloonPanelView']=new _0x51e059(_0x4a11cb),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class Cr extends _0x3fc85a{['balloonPanelView'];['source'];constructor(_0x13a4a1,_0x298235,_0x311594){super(_0x13a4a1),this['source']=_0x298235,this['balloonPanelView']=_0x311594,this['set']({'label':_0x298235['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x488004=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x488004['to'](()=>{window['open'](_0x298235['url'],'_blank');}),'mouseenter':_0x488004['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x488004['to'](()=>{this['_hideTooltip']();})}}),_0x298235['favicon']){const _0x3607fd=new _0x538d57(_0x13a4a1);_0x3607fd['setTemplate']({'tag':'img','attributes':{'src':_0x298235['favicon']||_0x1904ed,'alt':_0x298235['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x3607fd);}else this['set']('icon',_0x1904ed);}['_createTooltipContentView'](_0x58350f,_0x5f5c61){const _0x31da=new _0x538d57(_0x58350f),_0x55d30b=[];let _0x485c2f;_0x5f5c61?.['favicon']?(_0x485c2f=new _0x538d57(_0x58350f),_0x485c2f['setTemplate']({'tag':'img','attributes':{'src':_0x5f5c61['favicon'],'alt':_0x5f5c61['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x485c2f=new _0x1a5580(),_0x485c2f['content']=_0x1904ed,_0x485c2f['extendTemplate']({'attributes':{'alt':_0x5f5c61['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x55d30b['push'](_0x485c2f);const _0x1716b5=new _0x538d57(_0x58350f);_0x1716b5['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x5f5c61['url']},'children':[{'text':new URL(_0x5f5c61['url'])?.['hostname']}]}),_0x55d30b['push'](_0x1716b5);const _0x265aa1=new _0x538d57(_0x58350f);_0x265aa1['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x55d30b});const _0x30b6d1=new _0x538d57(_0x58350f);return _0x30b6d1['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x5f5c61['title']['length']>0x190?_0x5f5c61['title']['substring'](0x0,0x190)+'...':_0x5f5c61['title']}]}),_0x31da['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x265aa1,_0x30b6d1]}),_0x31da;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[_0x51e059['defaultPositions']['northArrowSouth'],_0x51e059['defaultPositions']['northArrowSouthWest'],_0x51e059['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 _0x17afe5=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x17afe5);}}class ga extends _0x538d57{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x7ef0d7,_0x1a4a95){super(_0x7ef0d7);const {areActionsDisabled:_0x14cda2,showUnchangedParts:_0x485835,availableActions:_0xed5c5f}=_0x1a4a95;this['_areActionsDisabled']=_0x14cda2,this['_showUnchangedParts']=_0x485835,this['_availableActions']=_0xed5c5f,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new g(),this['_emptyPartsWarningView']=new Pe({'id':'empty-parts-warning','initialContent':m(_0x7ef0d7,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new ra(_0x7ef0d7,_0x1a4a95['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new yr(this['locale'],_0x1a4a95['bodyCollection']),_0x1a4a95['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...V)['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:_0x1a12a1,renderingStrategy:_0x11a831,abortSignal:_0x50733b}){this['_children']['length']?_0x1a12a1['forEach'](_0x3c9201=>{const _0x334162=this['_cachedContentParts']['findIndex'](_0x34f036=>_0x34f036['index']==_0x3c9201['index']);-0x1===_0x334162?this['_cachedContentParts']['push'](_0x3c9201):this['_cachedContentParts'][_0x334162]=_0x3c9201;}):this['_cachedContentParts']=_0x1a12a1;const _0x49fbaf=this['_showUnchangedParts']?_0x1a12a1:_0x1a12a1['filter'](_0x374db7=>_0x374db7['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x49fbaf['length']>0x1);for(const _0x39a5de of _0x49fbaf)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x3568cf=>{let _0x10fda3=this['getPartView'](_0x39a5de['index']);_0x10fda3||(_0x10fda3=new na(this['locale'],{'part':_0x39a5de,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x10fda3['delegate'](...V)['to'](this),this['_children']['add'](_0x10fda3),this['hasPendingParts']=!0x0),await _0x10fda3['updateContent']({'part':_0x39a5de,'renderingStrategy':_0x11a831,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x3568cf}),_0x10fda3['markAsDone']();});return _0x50733b?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x1cce4e,_0xb33d2){const _0x5da3f5=this['getPartView'](_0x1cce4e);_0x5da3f5&&(_0x5da3f5['state']=_0xb33d2),this['hasPendingParts']='pending'==_0xb33d2||Array['from'](this['_children'])['some'](_0x2375e1=>'pending'==_0x2375e1['state']);}['setPartActive'](_0x5c964c,_0x589ca7){if(!0x1===_0x5c964c){for(const _0x139caf of this['_children'])_0x139caf['isActive']=!0x1;}else{const _0x92881=this['getPartView'](_0x5c964c);_0x92881&&(_0x92881['isActive']=_0x589ca7);}}['updateSources'](_0x1a5906){_0x1a5906['forEach'](_0x48ba6c=>this['_sourcesView']['addSource'](_0x48ba6c)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x584921){return this['_children']['find'](_0xd5789b=>_0xd5789b['partDefinition']['index']==_0x584921)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x1e2c5c=!this['_cachedContentParts']['find'](({hasChanges:_0x3c792f})=>_0x3c792f),_0x51d1e3=!!this['_cachedContentParts']['find'](({hasChanges:_0x18ddb0})=>!_0x18ddb0);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x51d1e3,_0x1e2c5c?this['_emptyPartsWarningView']['setContent'](m(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](m(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_children']['forEach'](_0x1ee7d4=>_0x1ee7d4['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0x4d9223=>_0x4d9223['partDefinition']['hasChanges'])['length']>0x0;}}class hn extends _0x538d57{['bodyView'];['children'];['headerView'];constructor(_0x395daf,_0x25b314,_0x5063e5){super(_0x395daf);const {showDiff:_0x3b2b29,areActionsDisabled:_0x57ff09,showUnchangedParts:_0x25dcb7,availableActions:_0x48c9a6}=_0x25b314;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new oa(_0x395daf,{'showDiff':_0x3b2b29}),this['headerView']['on']('toggleShowChanges',(_0x139484,_0x48bd37)=>{this['areChangesVisible']=_0x48bd37['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x48bd37['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new ga(_0x395daf,{'areActionsDisabled':_0x57ff09,'showUnchangedParts':!!_0x25dcb7,'availableActions':_0x48c9a6,'bodyCollection':_0x5063e5}),this['bodyView']['delegate'](...V)['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'](_0x3d3ff7){await this['bodyView']['updateContentParts'](_0x3d3ff7);}['updateSources'](_0x263af7){this['bodyView']['updateSources'](_0x263af7);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class ke extends xr{['containerView'];constructor(_0x1f98cf,_0x3ea5dd,_0x274efb){super(_0x3ea5dd),this['set']('isTrackChangesOn',!0x1),this['containerView']=new hn(_0x1f98cf,{'showDiff':_0x3ea5dd['showDiff'],'areActionsDisabled':_0x3ea5dd['areActionsDisabled'],'availableActions':_0x3ea5dd['availableActions']},_0x274efb),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x321003,_0xcaa591)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0xcaa591['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',(_0x1d40b1,{index:_0xf69551})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0xf69551});}),this['containerView']['on']('applySuggestion',(_0x54458b,{index:_0x83ea9e}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x83ea9e});}),this['containerView']['on']('insertSuggestion',(_0x38b36b,{index:_0x3c2c4b}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3c2c4b});}),this['containerView']['on']('rejectSuggestion',(_0xfbdc8f,{index:_0x41b4ad})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x41b4ad});}),this['containerView']['on']('mouseOverSuggestion',(_0xafc64c,{index:_0x401264})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x401264});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x5316a8,{index:_0x3a87b7})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3a87b7});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x34134d){await this['containerView']['updateContent'](_0x34134d);}['updatePartState'](_0x285a6e,_0x4a1581){this['containerView']['bodyView']['updatePartState'](_0x285a6e,_0x4a1581);}['setPartActive'](_0x219d04,_0x43d273){!0x1===_0x219d04?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x219d04,_0x43d273);}['updateSources'](_0x2aca66){this['containerView']['updateSources'](_0x2aca66);}['getPartView'](_0xe70b77){return this['containerView']['bodyView']['getPartView'](_0xe70b77);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class je extends xr{['replyContainer'];['_bodyCollection'];constructor(_0x38a996,_0x4e97a7,_0x414651){super(_0x4e97a7),this['_bodyCollection']=_0x414651,this['locale']=_0x38a996,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x538d57(),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':Qe(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x1f83a2,renderingStrategy:_0x5a4c04,abortSignal:_0x2f5905}){'streaming'===_0x5a4c04?await this['streamIntoElement'](_0x1f83a2,this['replyContainer']['element'],_0x2f5905):this['replyContainer']['element']['innerHTML']=_0x2aee41(_0x1f83a2);}['updateSources'](_0x5ba726){const _0x5f4607=new yr(this['locale'],this['_bodyCollection']);_0x5f4607['children']['addMany'](_0x5ba726['map'](_0x3cf102=>new Cr(this['locale'],_0x3cf102,_0x5f4607['balloonPanelView']))),_0x5f4607['isVisible']=!0x0,this['children']['add'](_0x5f4607);}}class De extends _0x29d2d8{constructor(_0x2ab724=void 0x0){super();const _0x2af4f3=_0x2ab724?'ck-ai-spinner_'+_0x2ab724:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x2af4f3]}});}}const xn={'file':_0x2f42c6,'document':_0x59e6a4,'web-resource':_0x1afd05,'text':_0x2f42c6,'selection':_0x33062f,'mcp-tool-context':_0x59e6a4},$r='ck-ai-chat-context-chip',Qr='ck-ai-chat-context-chip_wide',Xr='ck-ai-chat-context-chip_document',Zr='ck-ai-chat-context-chip__label',la='ck-ai-chat-context-chip__type-icon',ua='ck-ai-chat-context-controls__chip-tooltip',In='n';class xo extends _0x3fc85a{constructor(_0x5205b4,_0x45121b,_0x400e4e,_0x4a966a,_0x44f1b8=!0x1){super(_0x5205b4),this['_isAnimationOnEnterEnabled']=_0x4a966a,this['_initializeProperties'](_0x45121b,_0x400e4e,_0x44f1b8),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'](_0x457648,_0x966cf6,_0x837f1d){this['set']('label',_0x457648['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x457648['type']),this['set']('id',_0x457648['uiId']),this['set']('readonly',_0x966cf6),this['set']('isLoading',_0x837f1d);}['_setupTemplate'](){const _0x1830dc=this['_createIconView'](),_0x3b20d9=this['_createRemoveButton'](),_0x3d95c0=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x3d95c0),'children':this['_createTemplateChildren'](_0x1830dc,_0x3b20d9,_0x3d95c0)});}['_createTemplateAttributes'](_0x30b48b){return{'class':[$r,_0x30b48b['if']('itemType',Xr,_0xb8b5ec=>'document'==_0xb8b5ec),_0x30b48b['if']('itemType',Qr,_0x388c4f=>'selection'==_0x388c4f)],'data-cke-tooltip-text':_0x30b48b['to']('label',On),'data-cke-tooltip-position':In,'data-cke-tooltip-class':ua};}['_createTemplateChildren'](_0x2b3a69,_0x16f373,_0x2c9bde){const _0x5789b8=this['_createLabelElement'](_0x2c9bde),_0x4ef365=this['_createLoaderIcon']();return this['readonly']?[_0x2b3a69,_0x5789b8]:[_0x2b3a69,_0x4ef365,_0x5789b8,_0x16f373];}['_createLabelElement'](_0x74fa94){return{'tag':'span','attributes':{'class':Zr},'children':[{'text':_0x74fa94['to']('label')}]};}['_createRemoveButton'](){const _0x1d672c=new _0x3fc85a(this['locale']);return _0x1d672c['set']({'label':m(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x223b2d}),this['_setupRemoveButtonEvent'](_0x1d672c),_0x1d672c;}['_setupRemoveButtonEvent'](_0x6f939b){_0x6f939b['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x415923=this['bindTemplate'],_0x209eca=new _0x1a5580();return _0x209eca['content']=xn[this['itemType']],_0x209eca['extendTemplate']({'attributes':{'class':[la,_0x415923['if']('isLoading','ck-hidden',_0x58e9d2=>_0x58e9d2)]}}),_0x209eca;}['_handleAnimationEndOnce'](_0x31f903,_0x5579fb){if(!_0x31f903)return;const _0x128b60=()=>{_0x5579fb(),_0x31f903['removeEventListener']('animationend',_0x128b60),_0x31f903['removeEventListener']('webkitAnimationEnd',_0x128b60);};_0x31f903['addEventListener']('animationend',_0x128b60),_0x31f903['addEventListener']('webkitAnimationEnd',_0x128b60);}['_createLoaderIcon'](){const _0x5950e0=new De('small');return _0x5950e0['bind']('isVisible')['to'](this,'isLoading',_0x521ef0=>_0x521ef0),_0x5950e0;}}function On(_0x4d1138){if(!_0x4d1138)return _0x4d1138;if(_0x4d1138['length']<=0x78)return _0x4d1138;const _0x417cd7=_0x4d1138['slice'](0x0,0x78),_0x31fbe8=_0x417cd7['lastIndexOf']('\x20');return(_0x31fbe8>0x0?_0x417cd7['slice'](0x0,_0x31fbe8):_0x417cd7)+'…';}const an={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},wn='300px';class fo{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x19e519,_0x2ee825,_0x1ab650,_0x3e0864,_0x574e66){this['_locale']=_0x19e519,this['_visibleChips']=_0x2ee825,this['_config']={...an,..._0x1ab650,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x1ab650['cssClasses']}},this['_overflowChips']=new _0x53af97(),this['_bodyCollection']=_0x3e0864,this['_parentView']=_0x574e66||null;}['setContainerElement'](_0x4b91cb){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x4b91cb,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 _0x49d1ec=[...this['_visibleChips'],...this['_overflowChips']],_0xfd4a2d=this['_createCalculationContainer'](),_0x3e2fc0=this['_calculateOverflowInContainer'](_0xfd4a2d,_0x49d1ec),_0x96e6a8=_0xfd4a2d['_ancestorsToRestore'];_0x96e6a8&&this['_restoreAncestorVisibility'](_0x96e6a8),_0xfd4a2d['remove'](),this['_applyOverflowResults'](_0x49d1ec,_0x3e2fc0);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x23d932({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x222f0d=new _0x3fc85a(this['_locale']);_0x222f0d['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x24be8e=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x24be8e['push'](this['_config']['cssClasses']['controlsButton']),_0x222f0d['extendTemplate']({'attributes':{'class':_0x24be8e}}),_0x222f0d;}['_createShowMoreBalloonPanelView'](){const _0x75aba0=new _0x51e059(this['_locale']);return _0x75aba0['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x75aba0),_0x75aba0;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x3c7771=>{_0x3c7771['disableAnimationOnEnter']();});const _0x812ec7=new _0x538d57(this['_locale']);_0x812ec7['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x812ec7);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x938403=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x938403?'':'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'](_0x24d5cd){const _0x52c994=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x17ce2b=this['_containerElement']?.['classList'];if(_0x17ce2b){const _0x39399e=_0x17ce2b[0x0]||'',_0x4c344d=_0x24d5cd['querySelector']('.'+_0x39399e),_0x4d0fe1=_0x24d5cd['querySelector'](_0x52c994);return _0x4c344d||_0x4d0fe1||_0x24d5cd;}return _0x24d5cd['querySelector'](_0x52c994)||_0x24d5cd;}['_calculateContainerWidth'](){const _0x7131d2=this['_parentView']?.['element']||this['_containerElement'];if(!_0x7131d2)return wn;const _0x52c6bf=window['getComputedStyle'](_0x7131d2)['width'];if('auto'===_0x52c6bf||'0px'===_0x52c6bf||!_0x52c6bf){const _0x1dd5a3=_0x7131d2['parentElement'];if(_0x1dd5a3){const _0x4c6d20=window['getComputedStyle'](_0x1dd5a3);return'auto'!==_0x4c6d20['width']?_0x4c6d20['width']:wn;}return wn;}return _0x52c6bf;}['_applyCalculationStyles'](_0x483865,_0x4132b5){this['_config']['cssClasses']['calculationContainer']&&_0x483865['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x483865['style']['width']=_0x4132b5,_0x483865['style']['position']='absolute',_0x483865['style']['top']='-9999px',_0x483865['style']['left']='-9999px',_0x483865['style']['opacity']='0',_0x483865['style']['pointerEvents']='none',_0x483865['style']['zIndex']='-1',_0x483865['style']['visibility']='visible\x20!important',_0x483865['style']['display']='block\x20!important',_0x483865['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x24bee4){_0x24bee4['forEach'](({element:_0x2eb6ed,originalDisplay:_0x207642,originalVisibility:_0x4678ff})=>{_0x2eb6ed['style']['display']=_0x207642,_0x2eb6ed['style']['visibility']=_0x4678ff;});}['_makeAncestorsVisible'](_0x488476){const _0x3f750d=[];let _0x1b218c=_0x488476;for(;_0x1b218c&&_0x1b218c!==document['body'];){const _0x877a79=window['getComputedStyle'](_0x1b218c);'none'!==_0x877a79['display']&&'hidden'!==_0x877a79['visibility']||(_0x3f750d['push']({'element':_0x1b218c,'originalDisplay':_0x1b218c['style']['display'],'originalVisibility':_0x1b218c['style']['visibility']}),_0x1b218c['style']['display']='block',_0x1b218c['style']['visibility']='visible'),_0x1b218c=_0x1b218c['parentElement'];}return _0x3f750d;}['_createContainerElements'](){let _0x21e2af,_0x2acda9;return this['_parentView']?.['element']?(_0x21e2af=this['_parentView']['element']['cloneNode'](!0x0),_0x2acda9=this['_findTargetContainer'](_0x21e2af)):(_0x21e2af=document['createElement']('div'),_0x2acda9=_0x21e2af),{'calculationContainer':_0x21e2af,'targetContainer':_0x2acda9};}['_createCalculationContainer'](){const {calculationContainer:_0x310561,targetContainer:_0x3db9f6}=this['_createContainerElements'](),_0x1c1417=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x310561,_0x1c1417);const _0x1c77a0=this['_parentView']?.['element']||this['_containerElement'],_0x23fa6b=_0x1c77a0?.['parentElement'];_0x23fa6b?_0x23fa6b['appendChild'](_0x310561):document['body']['appendChild'](_0x310561),_0x310561['_targetContainer']=_0x3db9f6;const _0x3f3ee1=this['_makeAncestorsVisible'](_0x23fa6b||null);return _0x310561['offsetWidth'],_0x310561['_ancestorsToRestore']=_0x3f3ee1,_0x310561;}['_calculateOverflowInContainer'](_0x54182a,_0x47043e){const _0x2f7ea4=_0x54182a['_targetContainer']||_0x54182a,_0xa5d981=[],{rowCount:_0x161462}=this['_renderChipsAndCountRows'](_0x2f7ea4,_0x47043e);if(_0x161462<=this['_config']['maxVisibleRows'])return _0xa5d981;const _0x4d794c=_0x47043e['slice']();for(;_0x4d794c['length']>0x0;){if(this['_testButtonFit'](_0x54182a,_0x2f7ea4,_0x4d794c)){const _0x452304=_0x47043e['filter'](_0x42f3f0=>!_0x4d794c['includes'](_0x42f3f0));_0xa5d981['push'](..._0x452304);break;}if(!_0x4d794c['pop']())break;}return _0xa5d981;}['_renderChipsAndCountRows'](_0x4b1dfc,_0x47b442){_0x4b1dfc['innerHTML']='',_0x47b442['forEach'](_0x207aff=>{if(_0x207aff['element']){const _0xe40faa=_0x207aff['element']['cloneNode'](!0x0);_0x4b1dfc['appendChild'](_0xe40faa);}}),_0x4b1dfc['offsetWidth'];const _0x574420=_0x4b1dfc['children'],_0x42f225=[];return Array['from'](_0x574420)['forEach'](_0x563821=>{const _0xdedf6c=_0x563821['getBoundingClientRect']()['top'];_0x42f225['some'](_0x4b2761=>Math['abs'](_0x4b2761-_0xdedf6c)<this['_config']['rowDetectionTolerance'])||_0x42f225['push'](_0xdedf6c);}),{'rowCount':_0x42f225['length']};}['_createMockButton'](){const _0x1d1199=document['createElement']('button');return _0x1d1199['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x1d1199['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x1d1199['textContent']='+\x201',_0x1d1199;}['_testButtonFit'](_0x4cbe8f,_0x5d5db3,_0x1b5f55){this['_renderChipsAndCountRows'](_0x5d5db3,_0x1b5f55);const _0x1db0ff=this['_createMockButton']();_0x4cbe8f['appendChild'](_0x1db0ff),_0x4cbe8f['offsetWidth'];const _0x2faab3=[..._0x5d5db3['children'],_0x1db0ff],_0x5364c9=[];_0x2faab3['forEach'](_0x32d637=>{const _0x607ee1=_0x32d637['getBoundingClientRect']()['top'];_0x5364c9['some'](_0x4d625d=>Math['abs'](_0x4d625d-_0x607ee1)<this['_config']['rowDetectionTolerance'])||_0x5364c9['push'](_0x607ee1);});const _0x2cfd7a=_0x5364c9['length'];return _0x1db0ff['remove'](),_0x2cfd7a<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x13b7c0,_0x469af3){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x13b7c0['forEach'](_0x47a0ac=>{_0x469af3['includes'](_0x47a0ac)?this['_overflowChips']['add'](_0x47a0ac):this['_visibleChips']['add'](_0x47a0ac);});}['_updateOverflowUI'](_0x1a04f9){if(_0x1a04f9>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x1a04f9>0x0&&this['_showMoreButtonView']){const _0x5ee162=''+this['_config']['showMoreLabelPrefix']+(_0x1a04f9<0x63?_0x1a04f9:'99');this['_showMoreButtonView']['label']=_0x5ee162;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x4586f4,_0x3631a3){this['_distributeChips'](_0x4586f4,_0x3631a3),this['_updateOverflowUI'](_0x3631a3['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x39352f=>{_0x39352f[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 _0x4a54c8=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x4a54c8['width']||0x0===_0x4a54c8['height'])return!0x1;const _0x112d51=window['innerHeight']||document['documentElement']['clientHeight'],_0x4e07a6=window['innerWidth']||document['documentElement']['clientWidth'],_0x3cbf00=0xc8;return _0x4a54c8['bottom']>=-0xc8&&_0x4a54c8['top']<=_0x112d51+_0x3cbf00&&_0x4a54c8['right']>=-0xc8&&_0x4a54c8['left']<=_0x4e07a6+_0x3cbf00;}}const da='ck-ai-chat__feed__context-chips',Aa='ck-ai-chat-context-chips-wrapper',Ia='ck-ai-chat-context-chips-wrapper-balloon',Ea='ck-ai-chat-controls-button',pa='ck-ai-chat-controls_context_show-more-button',Ta='ck-ai-chat-context-controls__show-more-balloon-panel';class ah extends _0x538d57{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x5867ff,_0x281cd1,_0x5a8bfa){super(_0x5867ff),this['_bodyCollection']=_0x5a8bfa,this['_createContextChips'](_0x281cd1);const _0x395e4b={'cssClasses':{'showMoreButton':pa,'showMoreBalloon':Ta,'overflowContainer':Ia,'controlsButton':Ea}};this['_overflowManager']=new fo(_0x5867ff,this['_contextChips'],_0x395e4b,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[da,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Aa},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x40d387=this['element']['querySelector']('.'+Aa);_0x40d387&&(this['_overflowManager']['setContainerElement'](_0x40d387),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x2aae06){for(const _0x226fd6 of _0x2aae06){const _0x296710=new xo(this['locale'],_0x226fd6,!0x0,!0x1);this['_contextChips']['add'](_0x296710);}}}class Ve extends xr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x33cabb,_0x3c09de,_0x1b659e){super(_0x3c09de),this['_locale']=_0x33cabb,this['_bodyCollection']=_0x1b659e,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 ah(this['_locale'],this['options']['contextItems']['filter'](_0x410871=>!_0x410871['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x538d57(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 et extends xr{['capabilities'];constructor(_0x37f39f,_0x59e5fc){super(_0x59e5fc);const {isWebSearchEnabled:_0x30689c,isReasoningEnabled:_0xaece58}=_0x59e5fc['capabilities'],_0x4f1b77=[];let _0x117993='';_0x30689c&&_0xaece58?(_0x117993=m(_0x37f39f,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x4f1b77['push'](ca(_0x1904ed)),_0x4f1b77['push'](ca(_0x2190ec))):_0x30689c?(_0x117993=m(_0x37f39f,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x4f1b77['push'](ca(_0x1904ed))):_0xaece58&&(_0x117993=m(_0x37f39f,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x4f1b77['push'](ca(_0x2190ec))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x117993?'':'ck-hidden']}});const _0x1c9649=new _0x538d57();_0x1c9649['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x4f1b77,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x117993]}]}),this['children']['add'](_0x1c9649),this['capabilities']=_0x59e5fc['capabilities'];}}function ca(_0xc45502){const _0x582bf9=new _0x1a5580();return _0x582bf9['content']=_0xc45502,_0x582bf9;}const Fs=['wheel','touchstart','pointerdown','keydown'],qs=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class Fe{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x8c06b1){this['element']=_0x8c06b1,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x75a739 of Fs){const _0x4843df='keydown'!==_0x75a739;this['element']['addEventListener'](_0x75a739,this['_onUserEvent']['bind'](this),{'passive':_0x4843df,'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'](_0xaae677){if(this['isRunning']){if('keydown'===_0xaae677['type']){const _0x1d8d22=_0xaae677['key'];if(!qs['includes'](_0x1d8d22))return;}_0xaae677 instanceof WheelEvent?_0xaae677['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x5862af,scrollHeight:_0x2d8c1c,clientHeight:_0x769c9f}=this['element'];return _0x2d8c1c-_0x5862af-_0x769c9f<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class Oe extends _0x538d57{constructor(_0x471211,_0x3d2b07){super(_0x471211),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x3d2b07)});}['_createSkeletonItems'](_0x2a3ce6){const _0x38f4df=['ck','ck-ai-skeleton__item'];return _0x2a3ce6['map'](_0xd0c1f9=>{let _0x20d14e='';switch(_0xd0c1f9['attributes']['align']){case'right':_0x20d14e='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x20d14e='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x20d14e='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0xd0c1f9['tag'],'attributes':{'class':[..._0x38f4df,_0xd0c1f9['attributes']['class']?_0xd0c1f9['attributes']['class']:''],'style':'width:\x20'+_0xd0c1f9['attributes']['width']+';\x20height:\x20'+_0xd0c1f9['attributes']['height']+';'+_0x20d14e}};});}}const Be={'aiFeed':[{'tag':'div','attributes':{'width':'100%','height':'72px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}},{'tag':'div','attributes':{'width':'150px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'140px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}}],'aiHistory':ta(0x5,'100%','44px','right'),'aiChatResources':ta(0x8,'100%','24px','right'),'aiReviewChecks':[{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}}]};function ta(_0x3d3004,_0x5a6afc,_0x43b21c,_0x1952ac){return new Array(_0x3d3004)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x5a6afc,'height':_0x43b21c,'align':_0x1952ac}}));}class We extends xr{constructor(_0x1f02b9){super(_0x1f02b9),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 Ci extends _0x538d57{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x591821,_0x36db87){super(_0x591821),this['_bodyCollection']=_0x36db87,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...it)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Fe(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x8be157,_0x4081b0){let _0x399ba9;return'ai-reply'===_0x8be157?_0x399ba9=new je(this['locale'],_0x4081b0,this['_bodyCollection']):'ai-suggestion-reply'===_0x8be157?(_0x399ba9=new ke(this['locale'],_0x4081b0,this['_bodyCollection']),_0x399ba9['bind']('isTrackChangesOn')['to'](this)):_0x399ba9='user-message'===_0x8be157?new Ve(this['locale'],_0x4081b0,this['_bodyCollection']):'interaction-header'===_0x8be157?new et(this['locale'],_0x4081b0):'custom-element'===_0x8be157?new We(_0x4081b0):new Pe(_0x4081b0),this['children']['add'](_0x399ba9),_0x399ba9;}async['updateReplyItem']({id:_0x51c9d3,parsedContent:_0x299d21,renderingStrategy:_0x2493f2,abortSignal:_0x366771}){const _0x1d6cdb=this['getItemById'](_0x51c9d3);if(!(_0x1d6cdb instanceof je))throw new _0x1500e8('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x1d6cdb,'id':_0x51c9d3,'parsedContent':_0x299d21});await _0x1d6cdb['updateContent']({'parsedContent':_0x299d21,'renderingStrategy':_0x2493f2,'abortSignal':_0x366771});}async['updateWebSources'](_0x1996aa,_0x3c0aa0){const _0x4b39f9=this['getItemById'](_0x1996aa);if(_0x4b39f9 instanceof ke)_0x4b39f9['updateSources'](_0x3c0aa0);else{if(!(_0x4b39f9 instanceof je))throw new _0x1500e8('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x4b39f9,'id':_0x1996aa,'sources':_0x3c0aa0});_0x4b39f9['updateSources'](_0x3c0aa0);}}async['updateSuggestionItem']({id:_0x57620d,parts:_0x350af2,renderingStrategy:_0x273381,abortSignal:_0x9bf109}){const _0x46087b=this['getItemById'](_0x57620d);if(!(_0x46087b instanceof ke))throw new _0x1500e8('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x46087b,'id':_0x57620d,'parts':_0x350af2});await _0x46087b['updateContent']({'parts':_0x350af2,'renderingStrategy':_0x273381,'abortSignal':_0x9bf109});}['updateSuggestionPartState']({id:_0x546cd1,index:_0x5a807a,state:_0x2c4ee1}){const _0x110838=this['getItemById'](_0x546cd1);if(!(_0x110838 instanceof ke))throw new _0x1500e8('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x546cd1});_0x110838['updatePartState'](_0x5a807a,_0x2c4ee1);}['setSuggestionPartActive']({id:_0x3eb13b,index:_0x4f89b8,isActive:_0x2cc1ca}){const _0x2d77ca=this['getItemById'](_0x3eb13b);if(!(_0x2d77ca instanceof ke))throw new _0x1500e8('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x3eb13b});this['children']['filter'](_0x1a3bd1=>_0x1a3bd1 instanceof ke)['forEach'](_0x36e3e7=>{_0x36e3e7['setPartActive'](!0x1);}),_0x2d77ca['setPartActive'](_0x4f89b8,_0x2cc1ca);}['markItemAsDone'](_0x5bcc31){this['getItemById'](_0x5bcc31)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x29b671=>_0x29b671['options']['id']);}['removeItem'](_0x222149){this['children']['remove'](this['getItemById'](_0x222149));}['hasItem'](_0x512dc3){return!!this['children']['find'](_0x47873e=>_0x47873e['options']['id']['includes'](_0x512dc3));}['scrollToSuggestion'](_0xeb0f02,_0x54cb26){const _0x52925b=this['getItemById'](_0xeb0f02);if(!(_0x52925b instanceof ke))return void Zt('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0xeb0f02,'partIndex':_0x54cb26});const _0x4dd1ac=_0x52925b['getPartView'](_0x54cb26);_0x4dd1ac?_0x917d7b(_0x4dd1ac['element'],0x14,this['element']['parentElement'],!0x0,!0x0):Zt('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0xeb0f02,'partIndex':_0x54cb26});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x4e0a22=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x4e0a22,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x43acb7=new Oe(this['locale'],Be['aiFeed']);return _0x43acb7['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x1f72cd=>!_0x1f72cd)]}}),_0x43acb7;}['_createFeedItems'](){const _0x40866b=new _0x538d57(this['locale']);return _0x40866b['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x40866b;}['_createFeedLoader'](){const _0x5811b3=new _0x538d57(this['locale']);return _0x5811b3['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x8f0e3a=>!_0x8f0e3a)]},'children':this['_createLoaderChildren']()}),_0x5811b3;}['_createLoaderChildren'](){const _0x2a1a9d=new De();return _0x2a1a9d['isVisible']=!0x0,[_0x2a1a9d,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x4500b5){const _0xe9cd20=this['children']['find'](_0x35fd9b=>_0x35fd9b['options']['id']['includes'](_0x4500b5));if(!_0xe9cd20)throw new _0x1500e8('ai-chat-feed-view-item-not-found',this,{'id':_0x4500b5});return _0xe9cd20;}['setLoadingMessage'](_0x12c777){this['set']('loadingMessage',_0x12c777);}['toggleLoadingSkeleton'](_0x2a518e){this['set']('isLoadingSkeletonVisible',_0x2a518e);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class dh extends _0x1b0a54{['filter'](){let _0x4da721=0x0;for(const _0x1a24f8 of this['items'])_0x4da721+=_0x1a24f8['items']['length'];return{'resultsCount':_0x4da721,'totalItemsCount':_0x4da721};}}const _h='ck-ai-chat__prompt-input_highlighted';class ms extends _0x6213f1{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x2f7869,_0x19990a){super(_0x2f7869,{'queryView':{'label':'','creator':_0x550e60,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new dh(_0x2f7869),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x19990a,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=ms['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=ms['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',(_0x443703,_0x55bd9c)=>!_0x443703&&!_0x55bd9c),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x5c1ada,_0x55e030)=>{this['isUploadInProgress']||this['isEmpty']||_0x5c1ada['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x55e030());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x400851=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x400851)return this['queryView']['errorText']=m(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x422e3c=Wt(_0x400851);this['fire']('sendUserMessage',_0x422e3c),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x13b29d){this['queryView']['fieldView']['set']('placeholder',_0x13b29d);}['focus'](_0xf01622=!0x1){super['focus'](),_0xf01622&&(this['element']['classList']['contains'](_h)||(this['element']['classList']['add'](_h),setTimeout(()=>{this['element']['classList']['remove'](_h);},0x320)));}['_createSubmitButton'](){const _0x4b2cdb=new _0x3fc85a(this['locale']);return _0x4b2cdb['set']({'icon':_0x13c99b,'label':m(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x4b2cdb['on']('execute',()=>{this['submit']();}),_0x4b2cdb;}['setIsUploadInProgress'](_0x4f9bfd){this['isUploadInProgress']=_0x4f9bfd;}['_setUpAddContextButtonPositioning'](){const _0x4840b1=this['locale'],_0x5a37b9=()=>{_0x3537fe['window']['requestAnimationFrame'](()=>{if(_0x48958f(this['element'])){const _0x5b4679=new _0x34633d(this['queryView']['fieldView']['element']),_0x93c348=new _0x34633d(this['_addContextButtonView']['element']),_0x4cd1e4=_0x5b4679['width'],_0x30f0f3='rtl'===_0x4840b1['uiLanguageDirection']?'right':'left';_0x5b4679['excludeScrollbarsAndBorders']();const _0x11ec62=_0x4cd1e4-_0x5b4679['width']+0x1;this['_addContextButtonView']['element']['style'][_0x30f0f3]='calc('+(_0x4cd1e4-_0x93c348['width']-_0x11ec62)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x5a37b9),this['on']('render',()=>{_0x5a37b9(),this['_queryViewResizeObserver']=new _0x1a199c(this['queryView']['fieldView']['element'],()=>{_0x5a37b9();});});}}const ma='ck-ai-chat__prompt-capabilities',Ca='ck-ai-chat-controls-button',wa='ck-ai-chat-controls-button--commands',fa='ck-ai-button-tertiary',Sa='ck-ai-chat-controls__model-selection',ba='ck-ai-chat-controls__model-selection__item-name',Ra='ck-ai-chat-controls__model-selection__item-description',Oa='ck-ai-chat-controls__model-selection__item-capabilities',ka='n';class ds extends _0x538d57{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x2e6fb2){super(_0x2e6fb2),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',_0x679131=>'selector'===_0x679131),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x2a832c=>_0x2a832c?this['_modelSelectionDropdown']['buttonView']['label']:m(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0xdad200=>_0xdad200),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x3cd36a=>_0x3cd36a),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x25c5b1=>m(this['locale'],_0x25c5b1?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x2d67e1=>_0x2d67e1),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x330fe3=>m(this['locale'],_0x330fe3?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[ma]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x53af97(),_0x57d60a(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x44083d,_0x461e8b){if(_0x461e8b)this['set']('modelDisplayMode','hidden');else{const _0x4349d4=0x1===_0x44083d['length'];this['set']('modelDisplayMode',_0x4349d4?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x44083d?.['length'])for(const _0x23b2e2 of _0x44083d){const _0x1a0dae=new _0x584377({'label':_0x23b2e2['name'],'withText':!0x0,'role':'menuitemradio','id':_0x23b2e2['id'],'model':_0x23b2e2});_0x1a0dae['bind']('isOn')['to'](this,'activeModelId',_0x22eb23=>_0x22eb23===_0x23b2e2['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x1a0dae,'labelView':new Na(this['locale'],_0x23b2e2)});}}['setWebSearch'](_0x1f6345){this['set']('webSearchActive',_0x1f6345);}['setReasoning'](_0x286896){this['set']('reasoningActive',_0x286896);}['setModel'](_0x2958c0){if(!_0x2958c0)return;this['activeModelId']=_0x2958c0['id'],this['activeModelName']=_0x2958c0['name']||_0x2958c0['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x2958c0['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x2958c0['name']);const _0x1f715b=_0x2958c0['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x1f715b),this['_webSearchButton']['set']('isVisible',_0x1f715b);const _0x28b7c3=_0x2958c0['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x28b7c3),this['_reasoningButton']['set']('isVisible',_0x28b7c3);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x781d8f){this['set']('modelSelectorEnabled',!0x1),_0x781d8f&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x57c612=new _0x3fc85a();return _0x57c612['set']({'label':m(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x1904ed,'class':Ca,'isToggleable':!0x0,'tooltipPosition':ka}),_0x57c612['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x57c612;}['_createReasoningButton'](){const _0x14073c=new _0x3fc85a();return _0x14073c['set']({'label':m(this['locale'],'AI_CHAT_REASONING'),'icon':_0x2190ec,'class':Ca,'isToggleable':!0x0,'tooltipPosition':ka}),_0x14073c['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x14073c;}['_createCommandsButton'](){const _0x2f2679=new _0x3fc85a();return _0x2f2679['set']({'label':m(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x235661,'withText':!0x0,'class':Ca,'isToggleable':!0x0,'tooltip':m(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':ka}),_0x2f2679['extendTemplate']({'attributes':{'class':[wa]}}),_0x2f2679['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x2f2679;}['_createModelSelectionDropdown'](){const _0x3623d0=_0x238494(this['locale']);return _0x3623d0['set']({'panelPosition':'ne','class':[Sa]}),_0x3623d0['buttonView']['set']({'label':m(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':ka,'class':fa}),this['listenTo'](_0x3623d0,'execute',_0x4a8f26=>{this['fire']('selectModel',_0x4a8f26['source']['model']);}),_0x3623d0;}['_createModelNameView'](){const _0x3e9cf2=new ya(this['locale']);return _0x3e9cf2['bind']('text')['to'](this,'activeModelName',_0x33d349=>_0x33d349??''),_0x3e9cf2['bind']('isVisible')['to'](this,'modelDisplayMode',_0x2bcd3e=>'name'===_0x2bcd3e),_0x3e9cf2;}}let Na=class extends _0x3ffbe5{constructor(_0x3ba446,_0x2eba17){super();const _0x3b6e3f=this['bindTemplate'],_0x51475c=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x3b6e3f['to']('style'),'id':_0x3b6e3f['to']('id')},'children':[{'tag':'div','attributes':{'class':[ba]},'children':[{'text':_0x3b6e3f['to']('text')}]},{'tag':'div','attributes':{'class':[Ra]},'children':[{'tag':'span','children':[{'text':_0x2eba17['description']}]}]},{'tag':'div','attributes':{'class':[Oa]},'children':_0x51475c}]}),_0x51475c['addMany'](this['_getCapabilityParts'](_0x3ba446,_0x1904ed,'AI_CHAT_SEARCH_WEB',_0x2eba17['capabilities']['webSearch']?.['enabled']??!0x1)),_0x51475c['addMany'](this['_getCapabilityParts'](_0x3ba446,_0x2190ec,'AI_CHAT_REASONING',_0x2eba17['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x4a5b7b,_0x551a69,_0xfcfbe9,_0x1833bc){const _0x2b709a=new _0x1a5580();_0x2b709a['content']=_0x551a69;const _0x57f4c8=new _0x538d57(_0x4a5b7b);_0x57f4c8['setTemplate']({'tag':'span','children':[{'text':m(_0x4a5b7b,_0xfcfbe9)+':\x20'}]});const _0x580a79=new _0x538d57(_0x4a5b7b);return _0x580a79['setTemplate']({'tag':'span','children':[{'text':m(_0x4a5b7b,_0x1833bc?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x2b709a,_0x57f4c8,_0x580a79];}},ya=class extends _0x538d57{constructor(_0x506005){super(_0x506005),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x5b245e=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x5b245e['if']('isVisible','ck-hidden',_0x1b9204=>!_0x1b9204)]},'children':[{'text':_0x5b245e['to']('text')}]});}};const va='ck-ai-chat-context-controls__url-form',xa='ck-ai-chat-context-controls__url-input-section';class Io extends _0x538d57{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x3ab6cd){super(_0x3ab6cd),this['focusTracker']=new ts(),this['keystrokes']=new _0x356454(),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 _0x19c87e({'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'](_0x1bbc51=>{this['focusTracker']['add'](_0x1bbc51['element']),this['keystrokes']['listenTo'](_0x1bbc51['element']);}),_0x2d4a6e({'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'](_0x1c4e5c){this['urlInputField']['errorText']=_0x1c4e5c,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x3a87e9=new _0x3fc85a(this['locale']);return _0x3a87e9['set']({'icon':_0x41367a,'tooltip':m(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x3782ae,_0x30cd6d,_0x4dca98)=>{_0x3a87e9['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x4dca98?'':'\x20ck-hidden')]});}),_0x3a87e9;}['_createUrlInputField'](){const _0x3c9431=new _0x449567(this['locale'],_0x279926);return _0x3c9431['set']({'label':m(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x3c9431['fieldView']['set']({'placeholder':m(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x3c9431;}['_createConfirmButton'](){const _0x5e3323=new _0x3fc85a(this['locale']);return _0x5e3323['set']({'icon':_0x28d1ec,'tooltip':m(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x5e3323;}['_setupTemplate'](){const _0x518129=new _0x2c8dbc(this['locale'],{'label':m(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x518129['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':va,'tabindex':'-1'},'children':[_0x518129,{'tag':'div','attributes':{'class':xa},'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',_0x262365=>{_0x262365['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x227cf0,_0x5470ae)=>{this['clear'](),this['fire']('cancel'),_0x5470ae();});}['_handleSubmit'](){const _0x26bc2d=this['getValue']()['trim']();_0x26bc2d?this['_isValidUrl'](_0x26bc2d)?(this['clearError'](),this['fire']('submitUrl',_0x26bc2d)):this['setError'](m(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](m(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0xd41f72=this['getValue']()['trim'](),_0x18ba3f=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0xd41f72['length']>0x0&&!_0x18ba3f;}['_isValidUrl'](_0x2823fc){try{return!!new URL(_0x2823fc);}catch{return!0x1;}}}const La='ck-ai-chat-resources__item',Da='ck-ai-chat-resources__item--in-context',Pa='ck-ai-chat-resources__item-title',Ha='ck-ai-chat-resources__item__icon';class hc extends _0x5749b5{['resource'];['_titleView'];['_iconView'];constructor(_0x4e7ddd,_0x16bc79){super(_0x4e7ddd),this['resource']=_0x16bc79,this['set']('isInContext',!!_0x16bc79['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x152481){if(_0x152481['isInContext'])return _0x28d1ec;switch(_0x152481['type']){case Jt['DOCUMENT']:return _0x59e6a4;case Jt['URL']:return _0x1afd05;case Jt['FILE']:case Jt['TEXT']:return _0x2f42c6;default:return _0x40ab64;}}['highlightText'](_0x4b5891){if(!_0x4b5891||''===_0x4b5891['trim']())return void this['_titleView']['highlightText'](null);const _0x5541c6=new RegExp(_0x32442b(_0x4b5891),'gi');this['_titleView']['highlightText'](_0x5541c6);}['updateResourceState'](_0x34e3ac){this['resource']['isInContext']=_0x34e3ac,this['isInContext']=_0x34e3ac,this['_updateIcon']();}['_createTitleView'](){const _0x200d0d=new _0xe11984();return _0x200d0d['text']=this['resource']['label'],_0x200d0d['extendTemplate']({'tag':'span','attributes':{'class':[Pa]}}),_0x200d0d;}['_createIconView'](){const _0x41eb95=new _0x1a5580();return _0x41eb95['content']=this['getResourceIcon'](this['resource']),_0x41eb95;}['_setupTemplate'](){const _0x1bbfbb=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[La,_0x1bbfbb['if']('isVisible','ck-hidden',_0x3225d7=>!_0x3225d7),_0x1bbfbb['if']('isInContext',Da)]},'children':[{'tag':'div','attributes':{'class':[Ha]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x1bbfbb['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const Ma='ck-ai-chat-resources__list';class Ur extends _0x1b0a54{['_source'];constructor(_0x3098ac,_0x2d3172){super(_0x3098ac),this['_source']=_0x2d3172,this['extendTemplate']({'attributes':{'class':[Ma]}});}['setResources'](_0x3620d4,_0x360bda){this['items']['clear']();let _0x72c8de=_0x3620d4;if(this['_source']['useDefaultFiltering']&&_0x360bda&&''!==_0x360bda['trim']()){const _0x28bfc9=new RegExp(_0x360bda['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x72c8de=_0x3620d4['filter'](_0x105515=>_0x28bfc9['test'](_0x105515['label']));}for(const _0x2fe363 of _0x72c8de){const _0x4842a1=new hc(this['locale'],_0x2fe363);_0x4842a1['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x2fe363);}),this['items']['add'](_0x4842a1);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x360bda);}['highlightText'](_0x25ac54){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x384050=>{_0x384050['highlightText'](_0x25ac54);});}['updateResourceState'](_0x539cbf,_0x2dfbee){for(const _0xe9774c of this['items']){const _0x2439b7=_0xe9774c;_0x2439b7['resource']['id']===_0x539cbf&&_0x2439b7['updateResourceState'](_0x2dfbee);}}['_handleResourceSelection'](_0x5e84a1,_0x46b386){this['fire']('addResourceToContext',{'source':_0x5e84a1,'resource':_0x46b386});}}class zr extends _0x449567{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x300e97){const t=_0x300e97['t'],_0x2d1380={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x279926,'label':m(_0x300e97,'AI_CHAT_SEARCH_RESOURCES')};super(_0x300e97,_0x2d1380['creator']),this['label']=_0x2d1380['label'],this['_viewConfig']=_0x2d1380,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x300e97,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x17b970){this['fire']('search',_0x17b970);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x1a5580(),this['iconView']['content']=_0x31f317,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x147ba9,t){this['resetButtonView']=new _0x3fc85a(_0x147ba9),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x3b3d8d,'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',_0x55bd3b=>!_0x55bd3b),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 nc extends _0x538d57{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x474ba5,_0x433932){super(_0x474ba5),this['_source']=_0x433932['source'],this['_searchInputVisibleFrom']=_0x433932['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 _0x4f2c93([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new zr(this['locale']);}['_createSearchSection'](){const _0x3f99db=new _0x538d57(this['locale']);return _0x3f99db['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x14f1b0,_0x129c64)=>{this['loadResources'](_0x129c64),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x129c64);}),_0x3f99db;}['_createResourcesListView'](){const _0x1ff34f=new Ur(this['locale'],this['_source']);return _0x1ff34f['delegate']('addResourceToContext')['to'](this),_0x1ff34f['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x1ff34f;}['_createSkeletonView'](){const _0x39ea1a=new Oe(this['locale'],Be['aiChatResources']);return _0x39ea1a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x179acb=>!_0x179acb)]}}),_0x39ea1a;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x488d9b){const _0x1573b5=_0x3e4e8c();this['_latestLoadResourcesUid']=_0x1573b5,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x488d9b,'uid':_0x1573b5}),this['isLoading']=!0x0;}['setResources'](_0xf7e304,_0xe86f82){if(_0xe86f82&&_0xe86f82!==this['_latestLoadResourcesUid'])return;const _0x96df7d=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0xf7e304,_0x96df7d),_0xf7e304['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x17b2da,_0x2eaca0){this['_resourcesListView']['updateResourceState'](_0x17b2da,_0x2eaca0);}}const Ua='ck-ai-chat-context-controls__source-balloon-panel',Va='ck-button-icon\x20ck-button-back',Ba='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Po{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0xa1bb77,_0x465327,_0x19458b){this['_locale']=_0xa1bb77,this['_bodyCollection']=_0x465327,this['_config']=_0x19458b;}['showSourceResourcesBalloon']({source:_0x97d63e,withBackButton:_0x15e456}){let _0x3e51e3=this['_sourceResourceBalloons']['get'](_0x97d63e['id']);_0x3e51e3||(_0x3e51e3=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x97d63e['id'],_0x3e51e3),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x3e51e3)),this['_addSourceResourceContent']({'balloonPanel':_0x3e51e3,'source':_0x97d63e,'withBackButton':_0x15e456}),_0x3e51e3['show']();const _0xd6f747=this['_config']['getTargetElement']();_0xd6f747&&_0x3e51e3['pin']({'target':_0xd6f747,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x5a5fd6,_0x4c5978,_0x317694){const _0xf46629=this['_sourceResourceBalloons']['get'](_0x5a5fd6);if(!_0xf46629)return;const _0x5eb2e1=this['_getResourcesViewFromBalloon'](_0xf46629);_0x5eb2e1&&(_0x5eb2e1['setResources'](_0x4c5978,_0x317694),_0x5eb2e1['once']('change:isLoading',()=>{_0xf46629['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x47418b){const _0x373c04=this['_sourceResourceBalloons']['get'](_0x47418b);_0x373c04&&requestAnimationFrame(()=>{_0x373c04['hide'](),this['_sourceResourceBalloons']['delete'](_0x47418b),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x1adf86 of this['_sourceResourceBalloons']['values']())if(_0x1adf86['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x1a9006,_0x1f678e,_0x5a7445){const _0x1f965e=this['_sourceResourceBalloons']['get'](_0x1a9006);if(!_0x1f965e||!_0x1f965e['isVisible'])return;const _0x25df86=this['_config']['getTargetElement']();if(!_0x25df86)return;_0x1f965e['pin']({'target':_0x25df86,'limiter':this['_config']['getLimiterElement']()});const _0x7f5399=this['_getResourcesViewFromBalloon'](_0x1f965e);_0x7f5399&&_0x7f5399['updateResourceState'](_0x1f678e,_0x5a7445);}['destroy'](){for(const _0x2e85a8 of this['_sourceResourceBalloons']['values']())_0x2e85a8['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x5af3b1=new _0x51e059(this['_locale']);return _0x5af3b1['extendTemplate']({'attributes':{'class':Ua}}),this['_bodyCollection']['add'](_0x5af3b1),_0x5af3b1;}['_addSourceResourceContent']({balloonPanel:_0x193eff,source:_0x3a2bb5,withBackButton:_0x50d81a}){_0x193eff['content']['clear']();const _0x53ffd9=this['_createBalloonHeader']({'balloonPanel':_0x193eff,'source':_0x3a2bb5,'withBackButton':_0x50d81a});_0x193eff['content']['add'](_0x53ffd9);const _0x962e9b=this['_createBalloonResourcesView'](_0x3a2bb5);_0x193eff['content']['add'](_0x962e9b);}['_createBalloonHeader']({balloonPanel:_0x509c07,source:_0x53f629,withBackButton:_0x52316e}){const _0x99ddc8=new _0x2c8dbc(this['_locale'],{'label':_0x53f629['label'],'class':Ba});return _0x52316e&&_0x99ddc8['children']['add'](this['_createBackButton'](_0x509c07),0x0),_0x99ddc8;}['_createBackButton'](_0x39fdbb){const _0x4d59bb=new _0x3fc85a(this['_locale']);return _0x4d59bb['set']({'icon':_0x41367a,'tooltip':m(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Va}),_0x4d59bb['on']('execute',()=>{_0x39fdbb['hide'](),this['_config']['onBackToContext']();}),_0x4d59bb;}['_createBalloonResourcesView'](_0x57cb18){const _0x5e0fa6=new nc(this['_locale'],{'source':_0x57cb18,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x5e0fa6['on']('loadSourceResources',(_0xe0e7d2,_0x57b0c4)=>{this['_config']['onLoadSourceResources'](_0x57b0c4);}),_0x5e0fa6['on']('addResourceToContext',(_0x51235b,_0x474840)=>{this['_config']['onResourceSelected'](_0x474840['source'],_0x474840['resource']),this['closeSourceResourceBalloon'](_0x57cb18['id']);}),_0x5e0fa6;}['_getResourcesViewFromBalloon'](_0x519d4e){const _0xc26807=_0x519d4e['content']['get'](0x1);return _0xc26807 instanceof nc?_0xc26807:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x4a2db5){_0x23d932({'emitter':_0x4a2db5,'contextElements':[_0x4a2db5['element']],'callback':()=>{_0x4a2db5['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x4a2db5['isVisible']});}}const gs=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Ro='ck-ai-chat-context-controls',So='ck-ai-chat-context-controls__pending-contexts',Oo='ck-ai-chat-context-controls__add-context-balloon-panel',Uo='ck-ai-chat-context-controls__add-context-button',Lo='ck-ai-chat-context-controls__url-balloon-panel',No='ck-ai-chat-context-controls__balloon-button',Ho='ck-ai-chat-context-controls__balloon-button-source',jo='ck-ai-chat-controls-button',Fo='ck-ai-chat-context-chips-wrapper-balloon',Bo='ck-ai-chat-controls_context_show-more-button',Mo='ck-ai-chat-context-controls__show-more-balloon-panel',Xo='ck-ai-chat',yo=[_0x51e059['defaultPositions']['northArrowSouthWest'],_0x51e059['defaultPositions']['northArrowSouth'],_0x51e059['defaultPositions']['northArrowSouthEast'],_0x51e059['defaultPositions']['southArrowNorthWest'],_0x51e059['defaultPositions']['southArrowNorth'],_0x51e059['defaultPositions']['southArrowNorthEast']];class bs extends _0x538d57{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x4c64ac,_0x4d73c3){super(_0x4c64ac),this['bodyCollection']=_0x4d73c3['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x4c64ac),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x4c64ac),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x4c64ac),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x4c64ac,_0x4d73c3);const _0x4197d1={'cssClasses':{'showMoreButton':Bo,'showMoreBalloon':Mo,'overflowContainer':Fo,'controlsButton':jo}};this['_overflowManager']=new fo(_0x4c64ac,this['_currentContextsChips'],_0x4197d1,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'](_0x1b516d,_0x393bfa){const _0x47efcc=this['_createContextButton'](_0x1b516d,'current',!0x0,_0x393bfa);this['_addContextToCollection'](_0x47efcc,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x4ed3f5){this['_removeContextFromCollection'](_0x4ed3f5,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x4ed3f5,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x3d2374,_0x4ceff5){let _0x392ab=this['_currentContextsChips']['find'](_0xd5dc24=>_0xd5dc24['id']===_0x3d2374);_0x392ab||(_0x392ab=this['_overflowManager']['overflowChips']['find'](_0x24477c=>_0x24477c['id']===_0x3d2374)),_0x392ab&&(_0x392ab['isLoading']=_0x4ceff5);}['setConversationContext'](_0x59e368){this['_conversationContextsChips']['clear']();for(const _0x53ea9a of _0x59e368){const _0x33f4b7=this['_createContextButton'](_0x53ea9a,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x33f4b7,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x3cf2bf,_0x104c7d,_0x50366d){this['_resourcesBalloonView']['updateResourceState'](_0x3cf2bf,_0x104c7d,_0x50366d);}['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:_0x5b2512,withBackButton:_0x4e9c38}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x5b2512,'withBackButton':_0x4e9c38}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x173dd9,_0xc64a7d,_0x535b65,_0x493f1d){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x173dd9,_0x535b65,_0x493f1d);}['closeSourceResourceBalloon'](_0x1f24b6){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x1f24b6),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x5b8bf9){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x5b8bf9),this['_setAddContextButtonEnabled'](_0x5b8bf9);}['_setAddContextButtonEnabled'](_0x53d550){const _0x5186a9=!_0x53d550['document']['isHidden']&&_0x53d550['document']['enabled'],_0x14bc41=_0x53d550['urls']['enabled'],_0x3db11e=_0x53d550['files']['enabled'],_0x51ad3f=_0x53d550['sources']['length']>0x0,_0x7e284b=_0x53d550['customItems']&&_0x53d550['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x5186a9||_0x14bc41||_0x3db11e||_0x51ad3f||_0x7e284b;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Ro,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':So},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x20bca4){const _0x5e46eb=new _0x3fc85a(_0x20bca4);return _0x5e46eb['set']({'label':m(_0x20bca4,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':jo+'\x20'+Uo,'icon':_0x2509b0,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x5e46eb;}['_createAddContextBalloonPanelView'](_0x47ea0f){return this['_createBaseBalloonPanel'](_0x47ea0f,Oo);}['_createUrlBalloonPanelView'](_0xd267bc){const _0xc63c0e=this['_createBaseBalloonPanel'](_0xd267bc,Lo);return this['_addUrlContent'](_0xc63c0e,_0xd267bc),_0xc63c0e;}['_createResourcesBalloonView'](_0x4bba03,_0x4fb4aa){const _0x7cbd72={'searchInputVisibleFrom':_0x4fb4aa['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':yo});},'onResourceSelected':(_0x96b7ab,_0x514e2e)=>{this['fire']('addResourceToContext',{'source':_0x96b7ab,'resource':_0x514e2e});},'onLoadSourceResources':_0x33a289=>{this['fire']('loadSourceResources',_0x33a289);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Po(_0x4bba03,_0x4fb4aa['bodyCollection'],_0x7cbd72);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Xo)||document['body'];}['_createBaseBalloonPanel'](_0x820c46,_0x4794ad){const _0x24ae45=new _0x51e059(_0x820c46);return _0x24ae45['extendTemplate']({'attributes':{'class':_0x4794ad}}),this['bodyCollection']['add'](_0x24ae45),_0x24ae45;}['_setBalloonPanelContent'](_0xf37768,_0xaf8ba9,_0x27eb93){if(_0xf37768['content']['clear'](),!_0x27eb93['document']['isHidden']&&_0x27eb93['document']['enabled']){const _0x155857=this['_createBalloonButton'](_0xaf8ba9,{'label':m(_0xaf8ba9,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x59e6a4});_0x155857['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0xf37768['content']['add'](_0x155857);}if(_0x27eb93['urls']['enabled']){const _0x4fe60f=this['_createBalloonButton'](_0xaf8ba9,{'label':m(_0xaf8ba9,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x1afd05});_0x4fe60f['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':yo}),this['_urlInputView']['focus']();}),_0xf37768['content']['add'](_0x4fe60f);}if(_0x27eb93['files']['enabled']){const _0x5c05cb=new _0x4b66f3(_0xaf8ba9);_0x5c05cb['set']({'label':m(_0xaf8ba9,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x5ec29a,'withText':!0x0,'tooltip':!0x0,'class':No,'allowMultipleFiles':!0x0}),_0x5c05cb['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x5c05cb['on']('done',(_0x519dd6,_0x414313)=>{this['fire']('addFileToContext',_0x414313);}),_0x5c05cb['tooltip']=!0x0,_0xf37768['content']['add'](_0x5c05cb);}for(const _0x3d5f7b of _0x27eb93['sources']){const _0x4cbc28=this['_createBalloonButton'](_0xaf8ba9,{'label':_0x3d5f7b['label'],'icon':_0x3d5f7b['icon']||_0x40ab64,'type':'source'});_0xf37768['content']['add'](_0x4cbc28),_0x4cbc28['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x3d5f7b,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x5cca86 of _0x27eb93['customItems']||[]){const _0x4ac8e5=this['_createBalloonButton'](_0xaf8ba9,{'label':_0x5cca86['label'],'icon':_0x5cca86['icon']||_0x40ab64,'type':'customItem'});_0xf37768['content']['add'](_0x4ac8e5),_0x4ac8e5['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x5cca86);});}this['_hasExactlyOneSource']=0x1===_0xf37768['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0xbed4f8,_0x3e4c27){this['_urlInputView']=new Io(_0x3e4c27),this['_urlInputView']['on']('submitUrl',(_0x5cf2a4,_0x5ac25e)=>{this['_handleUrlSubmit'](_0x5ac25e);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':yo}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':yo});}),_0xbed4f8['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x50efa7,_0x6584d9){const _0x3f9803='source'===_0x6584d9['type']?new Ga(_0x50efa7):new _0x3fc85a(_0x50efa7);return _0x3f9803['set']({'label':_0x6584d9['label'],'icon':_0x6584d9['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':No}),_0x3f9803;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x23d932({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x19d64e){const _0x1830d4=this['_addContextBalloonConfig'];_0x1830d4['buttonView']['isOn']=_0x19d64e,_0x19d64e?_0x1830d4['balloonView']['show']():_0x1830d4['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x574dfa,buttonView:_0x32a8a3,hideMethod:_0x3a8bc7}=this['_addContextBalloonConfig'];_0x23d932({'emitter':_0x574dfa,'contextElements':[_0x574dfa['element'],_0x32a8a3['element']],'callback':()=>{_0x3a8bc7();},'activator':()=>_0x32a8a3['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x238b26,_0x2893af,_0x403a54=!0x1,_0x151980=!0x1){const _0x2e6c35='conversation'===_0x2893af||!0x0===_0x238b26['isReadOnly'],_0xfc2992=new xo(this['locale'],_0x238b26,_0x2e6c35,_0x403a54,_0x151980);return _0x2e6c35||_0xfc2992['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0xfc2992['id']);}),_0xfc2992;}['_addContextToCollection'](_0x5667f6,_0x55e6ce){_0x55e6ce['add'](_0x5667f6,0x0);}['_removeContextFromCollection'](_0x2c5de6,_0x4009b5){const _0x4605d4=_0x4009b5['find'](_0x35478c=>_0x35478c['id']===_0x2c5de6);_0x4605d4&&_0x4009b5['remove'](_0x4605d4);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':yo}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x256b45){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x256b45);}}class Ga extends _0x3fc85a{['arrowView'];constructor(_0x388a8d){super(_0x388a8d),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Ho]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x593d9e=new _0x1a5580();return _0x593d9e['content']=_0x41c19f,_0x593d9e['extendTemplate']({'attributes':{'class':Ho+'__arrow'}}),_0x593d9e;}}class ws extends _0x538d57{['_cancelButtonView'];['_loaderView'];constructor(_0x111d0c){super(_0x111d0c),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 _0x308107=new _0x3fc85a(this['locale']);return _0x308107['set']({'label':m(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x30c4f4}),_0x308107['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x308107;}['_createLoaderView'](){const _0x275872=new _0x538d57(this['locale']);return _0x275872['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':m(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x275872;}}class xi extends _0x538d57{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x136b37,_0x3c925a){super(_0x136b37),this['_contextPanelView']=this['_createContextPanelView'](_0x136b37,{'bodyCollection':_0x3c925a['bodyCollection'],'searchInputVisibleFrom':_0x3c925a['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x136b37),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x136b37),this['_loaderView']=this['_createLoaderView'](_0x136b37),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x136b37),this['_shouldRestorePromptInputFocus']=!0x1,this['_promptInputView']['delegate']('sendUserMessage')['to'](this),this['_loaderView']['delegate']('abortPromptStream')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleWebSearch')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleReasoning')['to'](this),this['_promptCapabilitiesView']['delegate']('selectModel')['to'](this),this['_contextPanelView']['delegate'](...gs)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x381b85=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x381b85['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x381b85['if']('isLoading','ck-hidden',_0xf12e15=>_0xf12e15||!this['isModelAvailable']),_0x381b85['if']('isModelAvailable','ck-hidden',_0x1e0fbd=>!_0x1e0fbd||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x381b85['if']('isLoading','ck-hidden',_0x137c7a=>!_0x137c7a)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x381b85['if']('isModelAvailable','ck-hidden',_0xf6c90e=>_0xf6c90e)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x23d932({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x4bf278,_0x570eb1){return new bs(_0x4bf278,_0x570eb1);}['_createPromptInputView'](_0x1e14c2){return new ms(_0x1e14c2,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x444871){return new ds(_0x444871);}['_createLoaderView'](_0x10299b){return new ws(_0x10299b);}['_createModelUnavailableMessageView'](_0x256e12){const _0x3da4d3=new _s(_0x256e12);return _0x3da4d3['delegate']('startConversation')['to'](this),_0x3da4d3;}['_handlePromptInputFocus'](_0x54b34e,_0x17fcd3,_0x54c858){_0x54c858?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x2bfd9d,_0x202bd8){this['_contextPanelView']['addContextItem'](_0x2bfd9d,_0x202bd8);}['removeContextItem'](_0x18c011){this['_contextPanelView']['removeContextItem'](_0x18c011);}['setContextItemLoading'](_0x3f11bd,_0x3e1e19){this['_contextPanelView']['setContextItemLoading'](_0x3f11bd,_0x3e1e19);}['setIsUploadInProgress'](_0x1ab7b4){this['_promptInputView']['setIsUploadInProgress'](_0x1ab7b4);}['setConversationContext'](_0x53e965){this['_contextPanelView']['setConversationContext'](_0x53e965);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x30f4f4,_0xd86a75,_0x478882){this['_contextPanelView']['updateResourceState'](_0x30f4f4,_0xd86a75,_0x478882);}['setWebSearch'](_0x415eec){this['_promptCapabilitiesView']['setWebSearch'](_0x415eec);}['setReasoning'](_0x4c6843){this['_promptCapabilitiesView']['setReasoning'](_0x4c6843);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x4d369b){this['_contextPanelView']['setAddContextOptions'](_0x4d369b);}['setInputPlaceholder'](_0x43f93d){this['_promptInputView']['setPlaceholderText'](_0x43f93d);}['setModelList'](_0x3fbcb1,_0x49db02){this['_promptCapabilitiesView']['setModelList'](_0x3fbcb1,_0x49db02);}['setModel'](_0x4a324f){_0x4a324f?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x4a324f)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x210f2f){this['_promptCapabilitiesView']['disableModelSelector'](_0x210f2f);}['populateSourceResourceBalloon'](_0xdcd3cd,_0x4c1622,_0x47965d,_0x52ce1e){this['_contextPanelView']['populateSourceResourceBalloon'](_0xdcd3cd,_0x4c1622,_0x47965d,_0x52ce1e);}['closeSourceResourceBalloon'](_0x5f0425){this['_contextPanelView']['closeSourceResourceBalloon'](_0x5f0425);}['focusPromptInput'](_0xaad71a=!0x1){this['_promptInputView']['focus'](_0xaad71a);}['setPromptInputValue'](_0x515d91){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x515d91;}}class _s extends _0x538d57{constructor(_0x348a82){super(_0x348a82);const _0x4c8e61=new _0x3fc85a(_0x348a82);_0x4c8e61['set']({'label':m(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x4c8e61['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':m(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x4c8e61]}]});}}class Si extends _0x2c8dbc{['conversationStartButton'];['resizeButton'];constructor(_0x516b32,_0x19f351){super(_0x516b32,{'label':m(_0x516b32,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':tt}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x516b32),this['children']['add'](this['conversationStartButton']),_0x19f351&&(this['resizeButton']=Cs(_0x516b32,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x5b8694){const _0x27287f=new _0x3fc85a(_0x5b8694);return _0x27287f['set']({'label':m(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0xa967bf,'class':'ck-ai-chat__start-conversation'}),_0x27287f['on']('execute',()=>{this['fire']('startConversation');}),_0x27287f;}}class Bi extends _0x538d57{constructor(_0x563612){super(_0x563612),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':m(_0x563612,'AI_DISCLAIMER_TEXT')}]}]});}}class K extends _0x538d57{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x136eba,_0x581a2e){super(_0x136eba),this['_bodyCollection']=new _0x4b2ab0(_0x136eba),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new Si(_0x136eba,_0x581a2e['showResizeButton']),this['chatHeader']['delegate'](...it)['to'](this),this['chatFeed']=new Ci(_0x136eba,this['_bodyCollection']),this['chatFeed']['delegate'](...it)['to'](this),this['chatControls']=new xi(_0x136eba,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x581a2e['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...it)['to'](this),this['chatDisclaimer']=new Bi(_0x136eba),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x136eba['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x4c4831,_0x48b93d,_0x1b02d8,_0x194683){this['chatControls']['populateSourceResourceBalloon'](_0x4c4831,_0x48b93d,_0x1b02d8,_0x194683);}['closeSourceResourceBalloon'](_0x2a055b){this['chatControls']['closeSourceResourceBalloon'](_0x2a055b);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class P extends _0x37abb2{static get['requires'](){return[H];}['_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(_0x42c2d7){super(_0x42c2d7);const _0x38e2f0=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new g(),this['_view']=new K(this['context']['locale'],{'showResizeButton':_0x38e2f0['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...it)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x12f9d1,{showDiff:_0x368350})=>{this['showDiff']=_0x368350;}),_0x38e2f0['view']['addTab']({'id':'chat','buttonLabel':m(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':tt,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x40600f=>_0x40600f),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x48d63b=>_0x48d63b),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0xfd9ad3){const _0x4a7cc1=this['context']['config']['get']('ai.chat.welcomeMessage')??m(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0xfd9ad3['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x4a7cc1}),this['fire']('conversationCreated');}['addFeedItemStaticMessage']({id:_0x98adc7,staticMessage:_0x1f2919}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x98adc7,'initialContent':'<p>'+_0x1f2919+'</p>'});}['addFeedItemUserMessage'](_0x432485){const _0x4558e5=_0x432485['attributes']?.['displayedPrompt']||_0x432485['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x432485['contextItems']['values']()),'initialContent':'<p>'+_0x4558e5+'</p>','id':_0x432485['id']});}['addFeedItemError']({errorMessage:_0x4a443e,id:_0x5ac3ba}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x4a443e+'</p>','id':_0x5ac3ba});}['addFeedItemAIReply'](_0x4d97e8){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x4d97e8['interactionId']+':'+_0x4d97e8['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x48a600){const _0x296eb5=D(this['context']);let _0x41e095=_0x296eb5['config']['get']('ai.availableReplyActions')||[...S];if(_0x296eb5['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x130eb7=_0x296eb5['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x130eb7,'value');}}else _0x41e095=_0x41e095['filter'](_0x415b8c=>'insertSuggestion'!=_0x415b8c);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x48a600['interactionId']+':'+_0x48a600['id'],'areActionsDisabled':_0x48a600['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x41e095}),this['clearLoadingMessage']();});}['addFeedInteractionHeader'](_0x41de16,_0x16abb9){const _0x177d4f=this['_view']['chatFeed']['children']['last'];if(_0x177d4f instanceof et)return this['_view']['chatFeed']['children']['remove'](_0x177d4f),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x41de16['id'],'capabilities':{'isWebSearchEnabled':_0x177d4f['capabilities']['isWebSearchEnabled']||_0x16abb9['isWebSearchEnabled'],'isReasoningEnabled':_0x177d4f['capabilities']['isReasoningEnabled']||_0x16abb9['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x41de16['id'],'capabilities':_0x16abb9});}async['addFeedItemCustomElement'](_0x4b6f9b,_0x3ff8cf){let _0x42c14b;return await this['_promiseQueue']['enqueue'](async()=>{_0x42c14b=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x4b6f9b,'id':_0x3ff8cf});}),_0x42c14b;}['removeFeedItem'](_0x4e642f){this['_view']['chatFeed']['removeItem'](_0x4e642f);}['hasFeedItem'](_0x363334){return this['_view']['chatFeed']['hasItem'](_0x363334);}['updateFeedInteractionHeader'](_0x1e8d02){const _0x191d91=this['_view']['chatFeed']['children']['find'](_0x384843=>_0x384843['options']['id']==_0x1e8d02['id']&&_0x384843 instanceof et);_0x191d91&&_0x191d91['set']('isVisible',_0x1e8d02['isVisible']);}async['updateFeedItemAIReplyContent'](_0x370866){const _0x152c0c=_0x370866['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x4e2100=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x370866,'abortSignal':_0x4e2100,'renderingStrategy':_0x152c0c}),_0x370866['isDone']&&this['markFeedItemAsDone'](_0x370866['id']);});}['updateFeedItemAIReplySources'](_0x1ac7fe,_0x36a70f){this['_view']['chatFeed']['updateWebSources'](_0x1ac7fe,_0x36a70f);}async['updateFeedItemAIReplySuggestionContent'](_0x4d5c17){const _0x38ff0c=_0x4d5c17['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x2e3b6b=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x4d5c17,'abortSignal':_0x2e3b6b,'renderingStrategy':_0x38ff0c}),_0x4d5c17['isDone']&&this['markFeedItemAsDone'](_0x4d5c17['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0xb225f2){this['_view']['chatFeed']['updateSuggestionPartState'](_0xb225f2);}['setFeedItemAIReplySuggestionPartActive'](_0x464961){this['_view']['chatFeed']['setSuggestionPartActive'](_0x464961);}['markFeedItemAsDone'](_0x31049b){this['_view']['chatFeed']['markItemAsDone'](_0x31049b);}['removeFeedInteraction'](_0x4e67e3){this['_view']['chatFeed']['getItemIds']()['filter'](_0x33d235=>_0x33d235['startsWith'](_0x4e67e3))['forEach'](_0x3994a6=>this['_view']['chatFeed']['removeItem'](_0x3994a6));}['startInteraction'](){const _0x2f28d7=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x2f28d7),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0xdba771){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x52d62a=>_0x52d62a['startsWith'](_0xdba771['id']))['forEach'](_0x7f5dc=>this['markFeedItemAsDone'](_0x7f5dc)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x824a9b,_0x75f9bb){this['_view']['chatControls']['addContextItem'](_0x824a9b,_0x75f9bb);}['removeContextItem'](_0xd4fa0d){this['_view']['chatControls']['removeContextItem'](_0xd4fa0d);}['setContextItemLoading'](_0x342f78,_0xbf7e6a){this['_view']['chatControls']['setContextItemLoading'](_0x342f78,_0xbf7e6a);}['setIsUploadInProgress'](_0x5a63d5){this['_view']['chatControls']['setIsUploadInProgress'](_0x5a63d5);}['setConversationContext'](_0x2b66ac){this['_view']['chatControls']['setConversationContext'](_0x2b66ac);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x27b172,_0x2ad85f,_0x2617e2){this['_view']['chatControls']['updateResourceState'](_0x27b172,_0x2ad85f,_0x2617e2);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x375958){this['_view']['chatControls']['setAddContextOptions'](_0x375958);}['updateCapabilities'](_0x59e4d2){this['_view']['chatControls']['setWebSearch'](_0x59e4d2['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x59e4d2['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x59e4d2));}['setSelectedModel'](_0x33685f,_0x513123){this['_view']['chatControls']['setModel'](_0x33685f),_0x513123&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x4e401d){this['feedItemRenderingStrategy']=_0x4e401d;}['toggleLoadingSkeleton'](_0x255ce7){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x255ce7);}['resetConversationTitle'](){this['setConversationTitle'](m(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x37cab5,_0x4cd2c9=!0x1){if(_0x4cd2c9&&!_0x6e294d()&&_0x37cab5['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x37cab5);this['_view']['chatHeader']['label']=_0x37cab5;}['setLoadingMessage'](_0x172e6d){this['_view']['chatFeed']['setLoadingMessage'](_0x172e6d);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x36a24b){let _0x3a82c5=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x36a24b[_0x3a82c5],_0x3a82c5++,_0x3a82c5===_0x36a24b['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x16f018){this['_view']['chatHeader']['isMaximized']=_0x16f018;}['prepareLoadingMessage'](_0x17487c){return _0x17487c['isWebSearchEnabled']&&_0x17487c['isReasoningEnabled']?m(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x17487c['isWebSearchEnabled']?m(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x17487c['isReasoningEnabled']?m(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):m(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x1d2336){return _0x1d2336?_0x1d2336['isWebSearchEnabled']&&_0x1d2336['isReasoningEnabled']?m(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x1d2336['isWebSearchEnabled']?m(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x1d2336['isReasoningEnabled']?m(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):m(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):m(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x6e5831,_0x24cd69,_0x26617d,_0x5c13f8){this['_view']['populateSourceResourceBalloon'](_0x6e5831,_0x24cd69,_0x26617d,_0x5c13f8);}['closeSourceResourceBalloon'](_0x55adf4){this['_view']['closeSourceResourceBalloon'](_0x55adf4);}['setPromptInputValue'](_0x45f988){this['_view']['chatControls']['setPromptInputValue'](_0x45f988);}['focusPromptInput'](_0x5ad31a=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x5ad31a);}['scrollFeedToSuggestion'](_0x58a357,_0xc87046){this['_view']['chatFeed']['scrollToSuggestion'](_0x58a357,_0xc87046);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class Fi extends _0x1b0a54{['sections'];constructor(_0x431b68,_0x4b5ade){super(_0x431b68),this['sections']=_0x4b5ade,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x385323){let _0x56412c=0x0,_0x3e8c09=0x0;for(const _0x1476d5 of this['sections']){const {resultsCount:_0x2c3a3c,totalItemsCount:_0x50f34f}=_0x1476d5['filter'](_0x385323);_0x56412c+=_0x2c3a3c,_0x3e8c09+=_0x50f34f;}return{'resultsCount':_0x56412c,'totalItemsCount':_0x3e8c09};}}class Pi extends _0x5749b5{['title'];['itemsViews'];['_itemsListView'];constructor(_0x479f6b,{title:_0x375ffc,items:_0x49244d}){super(_0x479f6b);const _0x2c51cc=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x375ffc,this['itemsViews']=_0x49244d;const _0xb08395=new _0x538d57(_0x479f6b);_0xb08395['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x1b0a54(_0x479f6b),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x2c51cc['if']('isVisible','ck-hidden',_0x533016=>!_0x533016)]},'children':[_0xb08395,this['_itemsListView']]});}['filter'](_0x4ba1af){const _0x316714=this['itemsViews']['length'];let _0x2a75fb=0x0;for(const _0x11af1c of this['itemsViews']){if(_0x4ba1af){const _0x3fff08=_0x11af1c['isMatching'](_0x4ba1af);_0x11af1c['isVisible']=!!_0x3fff08,_0x11af1c['highlightText'](_0x4ba1af);}else _0x11af1c['isVisible']=!0x0,_0x11af1c['highlightText'](null);_0x11af1c['isVisible']&&_0x2a75fb++;}return this['isVisible']=_0x2a75fb>0x0,{'resultsCount':_0x2a75fb,'totalItemsCount':_0x316714};}['getItem'](_0x1b633a){return this['itemsViews']['find'](_0x41774a=>_0x41774a['id']===_0x1b633a);}['removeItem'](_0x539058){const _0x31e5af=this['itemsViews']['indexOf'](_0x539058);-0x1!==_0x31e5af&&(this['itemsViews']['splice'](_0x31e5af,0x1),this['_itemsListView']['items']['remove'](_0x539058));}}class Ui extends/* #__PURE__ -- @preserve */
|
|
27
|
+
_0x531f3e(_0x5749b5){['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(_0x47b8c9,_0x4b7ab7){super(_0x47b8c9);const _0x2b71a6=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x4b7ab7['pinned']),this['set']('loadingState',null),this['id']=_0x4b7ab7['id'];const {title:_0x2e6889,createdAt:_0x21f1dc,active:_0x4a40c=!0x1}=_0x4b7ab7;this['_titleView']=new _0xe11984(),this['_titleView']['text']=_0x2e6889,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0xbf5451=this['_createCheckView'](),_0x316183=this['_createPinButtonView'](_0x47b8c9),_0x197cdc=this['_createMenuDropdownView'](),_0x320920=this['_createEditInputView'](_0x47b8c9,_0x2e6889),_0x175d4b=this['_createAcceptEditButtonView'](_0x47b8c9,_0x320920),_0x5c7219=this['_createCancelEditButtonView'](_0x47b8c9,_0x320920);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x316183),this['actions']['add'](_0x197cdc),this['on']('change:isEdit',(_0x15463c,_0x1ebf06,_0x163eb8)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x163eb8?(this['actions']['add'](_0x175d4b),this['actions']['add'](_0x5c7219),this['mainContent']['add'](_0x320920),_0x320920['element']['focus']()):(this['actions']['add'](_0x316183),this['actions']['add'](_0x197cdc),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x4a40c?'ck-ai-chat-history__item--active':'',_0x2b71a6['if']('isVisible','ck-hidden',_0x1c6de8=>!_0x1c6de8),_0x2b71a6['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',_0x2b71a6['if']('loadingState','ck-hidden',_0xb1486b=>!!_0xb1486b)]},'children':_0x4a40c?[_0xbf5451]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x2b71a6['if']('loadingState','ck-hidden',_0x3c7eca=>!_0x3c7eca)]},'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',_0x2b71a6['if']('loadingState','ck-hidden',_0x598e94=>!!_0x598e94)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x2b71a6['if']('loadingState','ck-hidden',_0x2a8838=>!_0x2a8838)]},'children':[{'text':_0x2b71a6['to']('loadingState',_0x56016b=>_0x56016b?m(this['locale'],Ui['LOADING_LABELS'][_0x56016b]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x21f1dc]}]},{'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'](_0x45df1b){this['_titleView']['text']=Wt(_0x45df1b);}['updateLoadingState'](_0x69afad,_0x3c4b38){this['set']('loadingState',_0x3c4b38?_0x69afad:null);}['_createCheckView'](){const _0x28512c=new _0x1a5580();return _0x28512c['set']({'content':_0x1dd94c}),_0x28512c;}['_createPinButtonView'](_0x1b369a){const _0x4bb5b9=new _0x3fc85a(_0x1b369a);return _0x4bb5b9['set']({'label':m(_0x1b369a,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x44d873,'withText':!0x1,'tooltip':!0x0}),_0x4bb5b9['bind']('isOn')['to'](this,'pinned'),_0x4bb5b9['on']('execute',()=>{const _0x144658=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x144658});}),_0x4bb5b9;}['_createMenuDropdownView'](){const _0x125d2c=_0x238494(this['locale'],_0x117d83),_0x5cec9c=_0x125d2c['panelView']['children'];_0x125d2c['buttonView']['set']({'label':m(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x21a59b}),_0x125d2c['panelPosition']='sw';const _0x39df50=new _0x3fc85a(this['locale']);_0x39df50['label']=m(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x39df50['withText']=!0x0,_0x39df50['on']('execute',()=>{this['isEdit']=!0x0;});const _0x1e2192=new _0x3fc85a(this['locale']);_0x1e2192['label']=m(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x1e2192['withText']=!0x0,_0x1e2192['on']('execute',()=>{this['showConfirm'](m(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x6bfb6d=new _0x1b0a54(this['locale']),_0x22ab0a=new _0x5749b5(this['locale']);_0x22ab0a['children']['add'](_0x39df50);const _0x182315=new _0x5749b5(this['locale']);return _0x182315['children']['add'](_0x1e2192),_0x6bfb6d['items']['addMany']([_0x22ab0a,_0x182315]),_0x5cec9c['add'](_0x6bfb6d),_0x125d2c;}['_createEditInputView'](_0x13602b,_0x248a80){const _0xa830eb=new _0x1cab27(_0x13602b),_0x52cc23=_0xa830eb['bindTemplate'];return _0xa830eb['value']=_0x248a80,_0xa830eb['extendTemplate']({'on':{'keydown':_0x52cc23['to'](_0x3f42d0=>{'Enter'==_0x3f42d0['key']&&this['_commitEditInputValue'](_0xa830eb);})}}),_0xa830eb;}['_createAcceptEditButtonView'](_0x56c26,_0x17b55d){const _0x517f5a=new _0x3fc85a(_0x56c26);return _0x517f5a['set']({'icon':_0x1dd94c,'withText':!0x1,'tooltip':m(_0x56c26,'AI_CHAT_HISTORY_ACCEPT')}),_0x517f5a['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x517f5a['on']('execute',()=>{this['_commitEditInputValue'](_0x17b55d);}),_0x517f5a;}['_commitEditInputValue'](_0x3ae25d){const _0x3e81ea=_0x3ae25d['element']['value']||'';this['_titleView']['text']=_0x3e81ea,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x3e81ea});}['_createCancelEditButtonView'](_0x455dc2,_0x37c6b3){const _0x24d61e=new _0x3fc85a(_0x455dc2);return _0x24d61e['set']({'icon':_0x3b3d8d,'withText':!0x1,'tooltip':m(_0x455dc2,'AI_CHAT_HISTORY_CANCEL')}),_0x24d61e['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x24d61e['on']('execute',()=>{this['isEdit']=!0x1,_0x37c6b3['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x24d61e;}['_createSpinnerView'](){const _0x19b087=new De('tiny');return _0x19b087['isVisible']=!0x0,_0x19b087;}['isMatching'](_0x194c6f){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x194c6f)?{'title':!0x0}:null;}['highlightText'](_0x94dbfb){this['_titleView']['highlightText'](_0x94dbfb);}}class at extends _0x538d57{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x17abf9,_0x9e1816){super(_0x17abf9),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 _0x564ac1=new _0x2c8dbc(_0x17abf9,{'label':m(_0x17abf9,'AI_CHAT_HISTORY_HEADING'),'icon':ot,'class':'ck-ai-header\x20ck-ai-header_history'});_0x9e1816&&(this['resizeButton']=Cs(_0x17abf9,this),_0x564ac1['children']['add'](this['resizeButton'])),this['sectionsView']=new Fi(_0x17abf9,[]),this['sectionsView']['delegate'](...Wi)['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',_0xce7510=>!_0xce7510)]}}),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':[_0x564ac1,{'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 _0x5b561d=new _0x8635d1(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':m(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x1263a4=>m(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x1263a4),'secondary':m(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x288eb3=this['_createErrorView']();return _0x288eb3['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x3fbf8f=>!_0x3fbf8f)]}}),_0x5b561d['on']('render',()=>{_0x5b561d['children']['add'](_0x288eb3,0x1);}),_0x5b561d['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x4739be=>!_0x4739be)]}}),_0x5b561d;}['_createSkeletonView'](){const _0x2d3b11=new Oe(this['locale'],Be['aiHistory']);return _0x2d3b11['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x1a572b=>!_0x1a572b)]}}),_0x2d3b11;}['_createErrorView'](){const _0x14588e=new _0x538d57(this['locale']),_0x451e6c=new _0x3fc85a(this['locale']);_0x451e6c['set']({'withText':!0x1,'icon':_0x3b3d8d,'class':'ck-ai-notification_error__dismiss-button'}),_0x451e6c['bind']('isVisible')['to'](this,'hasItems',_0x16d55a=>!!_0x16d55a),_0x451e6c['on']('execute',()=>{this['errorMessage']='';});const _0x44f7f2=this['bindTemplate'];return _0x14588e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x44f7f2['to']('errorMessage')}]},_0x451e6c]}),_0x14588e;}['_createEmptyStateView'](){const _0x43a5e5=new _0x3fc85a(this['locale']);_0x43a5e5['set']({'label':m(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0xa967bf,'class':'ck-ai-chat__start-conversation'}),_0x43a5e5['on']('execute',()=>{this['fire']('openChat');});const _0x533ba5=new _0x538d57(this['locale']);return _0x533ba5['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x3b146b=>!_0x3b146b)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[m(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x43a5e5]}),_0x533ba5;}['_createListItemViews'](_0x55c6f5,_0x24843b){const _0x33fce8=[];for(const _0x2bfc40 of _0x55c6f5){const _0x338d58=new Ui(_0x24843b,_0x2bfc40);_0x338d58['delegate'](...Wi)['to'](this),_0x33fce8['push'](_0x338d58);}return _0x33fce8;}['updateHistoryItemsWithCategories'](_0xb9ab0c){const _0x2a3551=this['locale']||'en',_0x4b812d=[];for(const _0x13f54a of _0xb9ab0c){const _0x1e523d=this['_createListItemViews'](_0x13f54a['items'],_0x2a3551);_0x4b812d['push'](new Pi(_0x2a3551,{'title':_0x13f54a['title'],'items':_0x1e523d}));}this['sectionsView']['sections']=_0x4b812d,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x4b812d),this['hasItems']=_0xb9ab0c['some'](_0x394bb6=>_0x394bb6['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x2448aa){for(const _0x3247c7 of this['sectionsView']['sections']){const _0x35f08d=_0x3247c7['getItem'](_0x2448aa);if(_0x35f08d){if(_0x3247c7['removeItem'](_0x35f08d),0x0===_0x3247c7['itemsViews']['length']){const _0x5959be=this['sectionsView']['sections']['indexOf'](_0x3247c7);-0x1!==_0x5959be&&(this['sectionsView']['sections']['splice'](_0x5959be,0x1),this['sectionsView']['items']['remove'](_0x3247c7));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x5403f5,_0x322830){for(const _0x37dfc3 of this['sectionsView']['sections']){const _0x42c3ef=_0x37dfc3['getItem'](_0x5403f5);if(_0x42c3ef){_0x42c3ef['updateTitle'](_0x322830);break;}}}['updateItemLoadingState'](_0x4711b4,_0x3b9933,_0x4bc964){for(const _0x349338 of this['sectionsView']['sections']){const _0x199961=_0x349338['getItem'](_0x4711b4);if(_0x199961){_0x199961['updateLoadingState'](_0x3b9933,_0x4bc964);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x598b78=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x598b78);}}}const Wi=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class st extends _0x37abb2{static get['requires'](){return[H];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5df664){super(_0x5df664);const _0x4b5c62=this['context']['plugins']['get']('AITabs');this['_historyView']=new at(this['context']['locale'],_0x4b5c62['showResizeButton']),this['_historyView']['delegate'](...Wi)['to'](this),_0x4b5c62['view']['addTab']({'id':'history','buttonLabel':m(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':ot,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x3550c4){this['_historyView']['removeHistoryItem'](_0x3550c4);}['updateItems'](_0x2162c9){this['_historyView']['updateHistoryItemsWithCategories'](_0x2162c9);}['updateItemTitle'](_0xc17618,_0x2552af){this['_historyView']['updateItemTitle'](_0xc17618,_0x2552af);}['updateItemLoadingState'](_0xaf0e66,_0x10346c,_0x492533){this['_historyView']['updateItemLoadingState'](_0xaf0e66,_0x10346c,_0x492533);}['setLoadingSkeleton'](_0x167bea){this['_historyView']['isLoading']=_0x167bea;}['showError'](_0x20a61d){this['_historyView']['errorMessage']=_0x20a61d;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x20f8fc){this['_historyView']['isMaximized']=_0x20f8fc;}}class Ue extends Vt(){['id'];['createdAt'];constructor({id:_0x37c0c4,title:_0x45c75d,createdAt:_0x3947c3,updatedAt:_0x3778c2,pinned:_0x69dc64}){super(),this['id']=_0x37c0c4,this['createdAt']=new Date(_0x3947c3),this['set']('title',_0x45c75d),this['set']('updatedAt',_0x3778c2?new Date(_0x3778c2):null),this['set']('pinned',_0x69dc64||!0x1);}['updateTitle'](_0x4c8a6f){this['set']('title',Wt(_0x4c8a6f)),this['updatedAt']=new Date();}['updatePinned'](_0x8538a5){this['set']('pinned',_0x8538a5),this['updatedAt']=new Date();}}class ht extends Ft(){['items']=[];['connector'];['group'];constructor({connector:_0x44c699,group:_0x369266}){super(),this['connector']=_0x44c699,this['group']=_0x369266;}async['init'](){try{const _0x1299e3=this['connector']['fetchConversations'](this['group']),_0xd6765f=await _0x1299e3['getConversations']();this['loadItems'](_0xd6765f);}catch(_0x43cb00){this['fire']('error',{'error':_0x43cb00,'operation':'init'});}}['addItem'](_0x1fa664){this['items']['push'](_0x1fa664);}async['removeItem'](_0x371ef6){const _0x289d2c=this['items']['findIndex'](_0x1130fe=>_0x1130fe['id']===_0x371ef6);if(-0x1===_0x289d2c)return!0x1;try{return await this['connector']['deleteConversation'](_0x371ef6)['execute'](),this['items']['splice'](_0x289d2c,0x1),this['fire']('itemRemoved',{'itemId':_0x371ef6}),!0x0;}catch(_0x48cfc8){return this['fire']('error',{'error':_0x48cfc8,'operation':'removeItem','itemId':_0x371ef6}),!0x1;}}['getItem'](_0x43a0e9){return this['items']['find'](_0x3ea963=>_0x3ea963['id']===_0x43a0e9);}async['updateItemTitle'](_0x4175b0,_0x239718){const _0x1a337a=this['getItem'](_0x4175b0);if(!_0x1a337a)return!0x1;try{return await this['connector']['updateConversation'](_0x4175b0,{'title':_0x239718})['getResult'](),_0x1a337a['updateTitle'](_0x239718),this['fire']('itemUpdated',{'itemId':_0x4175b0,'updates':{'title':_0x239718}}),!0x0;}catch(_0x58cbe3){return this['fire']('error',{'error':_0x58cbe3,'operation':'updateItemTitle','itemId':_0x4175b0}),!0x1;}}async['updateItemPinned'](_0x255d2e,_0x34329a){const _0x3e4a23=this['getItem'](_0x255d2e);if(!_0x3e4a23)return!0x1;try{return await this['connector']['updateConversation'](_0x255d2e,{'pinned':_0x34329a})['getResult'](),_0x3e4a23['updatePinned'](_0x34329a),this['fire']('itemUpdated',{'itemId':_0x255d2e,'updates':{'pinned':_0x34329a}}),!0x0;}catch(_0x323d87){return this['fire']('error',{'error':_0x323d87,'operation':'updateItemPinned','itemId':_0x255d2e}),!0x1;}}['loadItems'](_0x39591d){try{this['items']=[],_0x39591d['map'](_0x1d2589=>{this['addItem'](new Ue(_0x1d2589));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x47e83d){this['fire']('error',{'error':_0x47e83d,'operation':'loadItems'});}}['getItems'](_0x43e179={}){const _0x554572=void 0x0!==_0x43e179['pinned']&&_0x43e179['pinned'],_0x965c48=_0x43e179['from']?new Date(_0x43e179['from']['getFullYear'](),_0x43e179['from']['getMonth'](),_0x43e179['from']['getDate']()):null,_0x5a59a7=_0x43e179['to']?new Date(_0x43e179['to']['getFullYear'](),_0x43e179['to']['getMonth'](),_0x43e179['to']['getDate']()):null;return this['items']['filter'](_0x3a3421=>{if(_0x3a3421['pinned']!==_0x554572)return!0x1;if(_0x5a59a7){const _0x37a92f=new Date(_0x3a3421['createdAt']['getFullYear'](),_0x3a3421['createdAt']['getMonth'](),_0x3a3421['createdAt']['getDate']());return _0x965c48?_0x965c48['getTime']()===_0x5a59a7['getTime']()?_0x37a92f['getTime']()===_0x965c48['getTime']():_0x37a92f<_0x5a59a7&&_0x37a92f>=_0x965c48:_0x37a92f<_0x5a59a7;}return!0x0;});}}class rt extends _0x37abb2{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[s,x,st,H];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](s),this['_aiChatHistoryUi']=this['context']['plugins']['get'](st),this['_aiChatController']=this['context']['plugins']['get'](x);const _0x5a9d23=this['context']['plugins']['get'](H);try{const _0x4b6066=this['_aiChatController']['getGroupId']();this['history']=new ht({'connector':this['_aiConnector'],'group':_0x4b6066}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x2f4b2b,_0x3ad1dd)=>{this['_setItemLoading'](_0x3ad1dd['id'],'remove'),this['_handleRemove'](_0x3ad1dd['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x19858d,_0x3463b9)=>{this['_setItemLoading'](_0x3463b9['id'],'rename'),this['_handleEditTitle'](_0x3463b9['id'],_0x3463b9['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x50f925,_0x2f979d)=>{void 0x0!==_0x2f979d['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x2f979d['itemId'],_0x2f979d['updates']['title']),void 0x0!==_0x2f979d['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x2f979d['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x2094cb,_0x2b02a4)=>{this['_aiChatController']['handleRemovedConversation'](_0x2b02a4['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x2b02a4['itemId']),this['_clearItemLoading'](_0x2b02a4['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x1e6a4a,_0x2786c4)=>{this['_handleHistoryErrorUI'](_0x2786c4['error'],_0x2786c4['operation'],_0x2786c4['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x191ca3,_0x1d1570)=>{this['_handleSelectConversation'](_0x1d1570['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x4911ae,_0x3509d5)=>{const _0x2150ea=_0x3509d5['pinned']?'pin':'unpin';this['_setItemLoading'](_0x3509d5['id'],_0x2150ea),this['_handleTogglePin'](_0x3509d5['id'],_0x3509d5['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x5a9d23['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x5a9d23['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x5a9d23,'resizedTabs',(_0x31f186,_0x42249f)=>{this['_setIsMaximized'](_0x42249f);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x5a9d23['resize']();});}catch(_0x50085d){this['_handleHistoryErrorUI'](_0x50085d,'init');}}async['_handleEditTitle'](_0x44a1e7,_0x246bfd){await this['history']['updateItemTitle'](_0x44a1e7,_0x246bfd);}async['_handleTogglePin'](_0x125d5f,_0x3b9e69){await this['history']['updateItemPinned'](_0x125d5f,_0x3b9e69);}async['_handleRemove'](_0x4b2047){await this['history']['removeItem'](_0x4b2047);}async['_handleSelectConversation'](_0x55e59c){await this['_aiChatController']['loadConversation'](_0x55e59c);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x2e1591=this['_aiChatController']['activeConversation']?.['id'],_0x558cc4=this['_getCategorizedItems']()['map'](_0x8f6238=>({'title':_0x8f6238['title'],'items':_0x8f6238['items']['map'](_0x2cd525=>({'id':_0x2cd525['id'],'title':_0x2cd525['title']||m(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x2cd525['createdAt'])['toLocaleDateString'](),'active':_0x2cd525['id']===_0x2e1591,'pinned':_0x2cd525['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x558cc4);}['_setItemLoading'](_0x192ba5,_0x147a9e){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x192ba5,_0x147a9e,!0x0);}['_clearItemLoading'](_0x1ce30c){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x1ce30c,null,!0x1);}['_handleHistoryErrorUI'](_0x3bc14c,_0x387667,_0x20745b){const _0x4b7e1b=this['_generateErrorMessage'](_0x387667,_0x20745b);this['_aiChatHistoryUi']['showError'](_0x4b7e1b),_0x20745b&&this['_clearItemLoading'](_0x20745b),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x2b5756,_0x478168){const _0xe36f34=_0x478168?this['history']['getItem'](_0x478168):null,_0x20135a=_0xe36f34?.['title']||m(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x2b5756){case'updateItemTitle':return m(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x20135a);case'updateItemPinned':{const _0x1f6bcf=m(this['context']['locale'],_0xe36f34?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return m(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x1f6bcf,_0x20135a]);}case'removeItem':return m(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x20135a);case'init':case'loadItems':return m(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return m(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x40025e=new Date(),_0x7ae72d=new Date(_0x40025e['getFullYear'](),_0x40025e['getMonth'](),_0x40025e['getDate']()),_0x30c671=new Date(_0x7ae72d);_0x30c671['setDate'](_0x30c671['getDate']()-0x1);const _0x513ada=new Date(_0x7ae72d);_0x513ada['setDate'](_0x513ada['getDate']()-0xe);const _0x429c05=this['history']['getItems']({'pinned':!0x0}),_0x34e464=this['history']['getItems']({'from':_0x7ae72d,'to':_0x7ae72d}),_0x59d966=this['history']['getItems']({'from':_0x30c671,'to':_0x30c671}),_0x55bd22=this['history']['getItems']({'from':_0x513ada,'to':_0x30c671}),_0x449c2f=this['history']['getItems']({'to':_0x513ada}),_0x2c50e9=[];return _0x429c05['length']>0x0&&_0x2c50e9['push']({'title':m(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x429c05}),_0x34e464['length']>0x0&&_0x2c50e9['push']({'title':m(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x34e464}),_0x59d966['length']>0x0&&_0x2c50e9['push']({'title':m(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x59d966}),_0x55bd22['length']>0x0&&_0x2c50e9['push']({'title':m(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x55bd22}),_0x449c2f['length']>0x0&&_0x2c50e9['push']({'title':m(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x449c2f}),_0x2c50e9;}['_setIsMaximized'](_0x3ac9e2){this['_aiChatHistoryUi']['setIsMaximized'](_0x3ac9e2);}}class I extends _0x37abb2{static get['requires'](){return[rt,st];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Fa extends _0x37abb2{static get['requires'](){return[x,o,P,I];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4c2546){super(_0x4c2546),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'](x)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](x)['startConversation']();}async['sendMessage']({message:_0x37eebd,attributes:_0x3f8b2e}){await this['context']['plugins']['get'](x)['sendMessage']({'message':_0x37eebd,'attributes':_0x3f8b2e});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](x)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](x)['focusPromptInput']();}['registerToolDataCallback'](_0x53b35d){this['context']['plugins']['get'](x)['_registerToolDataCallback'](_0x53b35d);}}class ks extends _0x3fc85a{['id'];constructor(_0xd462b3,_0x407e67){super(_0xd462b3);const {id:_0xfe1ef4,type:_0x4bae76,icon:_0x1e80d4}=_0x407e67;this['id']=_0xfe1ef4,this['set']({'label':_0x407e67['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x407e67['id']}}),_0x1e80d4?this['icon']=_0x1e80d4:'chat'===_0x4bae76?this['icon']=_0x50a176:'review'===_0x4bae76?this['icon']=_0xbfad04:'translate'===_0x4bae76&&(this['icon']=St);}}class mt extends _0x538d57{['listView'];constructor(_0x4dce4b,_0x66ff86){super(_0x4dce4b);const _0x59c445=_0x66ff86['map'](_0x658cd9=>{const _0x5c599a=new _0x5749b5(this['locale']),_0x26968d=new ks(this['locale'],_0x658cd9);return _0x5c599a['children']['add'](_0x26968d),_0x26968d['delegate']('execute')['to'](this),_0x5c599a;});this['listView']=new _0x1b0a54(this['locale']),this['listView']['items']['addMany'](_0x59c445),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const dt='chat-shortcuts';var Ka=function(_0x58637f){return _0x58637f['CHAT']='chat',_0x58637f['REVIEW']='review',_0x58637f['TRANSLATE']='translate',_0x58637f;}({});class Wa extends _0x37abb2{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[P];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](P),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x4077c5=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x4077c5['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x4077c5,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x1c6560=Object['values'](Ka);this['_shortcuts']['forEach'](_0xf38223=>{let _0xecfd0a=!0x0;if(_0xf38223['id']&&_0xf38223['label']&&_0x1c6560['includes'](_0xf38223['type'])?'chat'===_0xf38223['type']&&(_0xecfd0a='string'==typeof _0xf38223['prompt']):_0xecfd0a=!0x1,!_0xecfd0a)throw new _0x1500e8('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0xf38223});});}['_injectShortcuts'](){const _0x5459ca=this['context']['plugins']['get'](P);this['_shortcutsView']=new mt(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x5459ca['addFeedItemCustomElement'](this['_shortcutsView']['element'],dt),this['_shortcutsView']['on']('execute',_0xef8468=>{const _0x4637a7=_0xef8468['source']['id'];this['_executeShortcut'](_0x4637a7);});}['_removeShortcuts'](){const _0x41c078=this['context']['plugins']['get'](P);_0x41c078['hasFeedItem'](dt)&&_0x41c078['removeFeedItem'](dt),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x89ea6e){const _0x1aa5c6=this['_shortcuts']['find'](_0x1dba8d=>_0x1dba8d['id']===_0x89ea6e),_0xfad76b=_0x1aa5c6['type'];'chat'===_0xfad76b?this['_runChatShortcut'](_0x1aa5c6):'review'===_0xfad76b?_0x1aa5c6['check']?this['_runReviewShortcut'](_0x1aa5c6):this['_switchTab']('reviewMode'):'translate'===_0xfad76b&&(_0x1aa5c6['language']?this['_runTranslateShortcut'](_0x1aa5c6):this['_switchTab']('translate'));}['_switchTab'](_0x59dd70){if(!this['context']['plugins']['has']('AITabs'))throw new _0x1500e8('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x59dd70});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x59dd70);}async['_runChatShortcut']({prompt:_0x2863de,draftMode:_0x257b24,useWebSearch:_0x4404e7=!0x1,useReasoning:_0x2d20cb=!0x1,model:_0x1889e3}){const _0x833461=this['context']['plugins']['get']('AIChat'),_0x2a65b4=this['context']['plugins']['get']('AIChatController'),_0x59f0a8=_0x2a65b4['activeConversation'];let _0x4fa939;_0x4fa939=_0x1889e3?await _0x59f0a8['chatModels']['getModel'](_0x1889e3):await _0x59f0a8['chatModels']['getDefault'](),_0x4fa939&&await _0x59f0a8['setModel'](_0x4fa939),_0x59f0a8['setWebSearch'](_0x4404e7),_0x59f0a8['setReasoning'](_0x2d20cb),_0x2a65b4['addCurrentDocumentToChatContext'](),_0x257b24?(this['_aiChatUI']['setPromptInputValue'](_0x2863de),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x833461['sendMessage']({'message':_0x2863de});}['_runReviewShortcut']({check:_0x2ba362,model:_0x5a0dbd,prompt:_0x37af4f,params:_0x435689}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new _0x1500e8('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x10195b={'id':_0x2ba362,'isCustom':'custom'===_0x2ba362};_0x5a0dbd&&_0x37af4f&&(_0x10195b['args']={'model':_0x5a0dbd,'prompt':_0x37af4f}),_0x435689&&(_0x10195b['params']=_0x435689),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x10195b);}['_runTranslateShortcut']({language:_0x11a836}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new _0x1500e8('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x11a836,'args':{'language':_0x11a836}});}}class io extends At{constructor(_0x59e2ac){super(_0x59e2ac);const _0x212241=_0x59e2ac['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x212241,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0xc596ac=this['editor']['plugins']['get']('AITabs')['view'];_0xc596ac['isVisible']=!_0xc596ac['isVisible'];}}class pt extends _0x5adfee{static get['requires'](){return[H];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x28caae=this['editor'];_0x28caae['commands']['add']('toggleAi',new io(_0x28caae)),_0x28caae['ui']['componentFactory']['add']('toggleAi',()=>{const _0xf8561d=this['_createAIUIButton'](_0x3fc85a);return _0xf8561d['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0xf8561d;}),_0x28caae['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x3b9096=this['_createAIUIButton'](_0x58fafd);return _0x3b9096['set']({'role':'menuitemcheckbox'}),_0x3b9096;});}['_createAIUIButton'](_0x5178ef){const _0x8757eb=this['editor'],_0x3bfb76=_0x8757eb['commands']['get']('toggleAi'),_0x2adc1b=new _0x5178ef(_0x8757eb['locale']);return _0x2adc1b['set']({'label':m(_0x8757eb['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x2cc560,'isToggleable':!0x0}),_0x2adc1b['bind']('isEnabled')['to'](_0x3bfb76),_0x2adc1b['bind']('isOn')['to'](_0x3bfb76,'value',_0x49caa9=>!!_0x49caa9),this['listenTo'](_0x2adc1b,'execute',()=>{_0x3bfb76['execute']();}),_0x2adc1b;}}const j=['applySuggestion','insertSuggestion','showNext','showPrevious'];class ns extends _0x538d57{['_errorView'];constructor(_0x2fe254){super(_0x2fe254),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x5138be){this['showError'](_0x5138be);}['showError'](_0x5e511d){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x5e511d,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0xbcfed5=new _0x538d57(this['locale']),_0x31d827=new _0x538d57(this['locale']);return _0x31d827['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0xbcfed5['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x20b325=>!_0x20b325)]},'children':[_0x31d827]}),_0xbcfed5;}}const L=0xa;class u extends _0x37abb2{static get['requires'](){return[o];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_isUpdatingMarkers']=!0x1;['open'](_0x1508a8){const {id:_0x5a4490}=this['_currentConfig']??{};this['_currentConfig']=_0x1508a8;const {id:_0xccb37c}=this['_currentConfig'];this['isOpen']&&_0x5a4490===_0xccb37c?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x3a6c80=D(this['context'])['plugins']['get']('Dialog');_0x3a6c80['isOpen']&&this['_currentConfig']&&_0x3a6c80['id']===this['_currentConfig']['id']&&_0x3a6c80['hide']();}['_updateDialog'](){const _0x1984a6=D(this['context'])['plugins']['get']('Dialog'),{icon:_0x919d,title:_0x3ea2fe}=this['_currentConfig'];_0x1984a6['view']?.['headerView']&&(_0x1984a6['view']['headerView']['label']=_0x3ea2fe,_0x1984a6['view']['headerView']['iconView']&&_0x919d&&(_0x1984a6['view']['headerView']['iconView']['content']=_0x919d)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x1984a6['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](o)['showFakeVisualSelection'](this['_currentConfig']['ranges'],'ai-balloon-'+this['_currentConfig']['index'],!0x0,!0x0);}['_hideFakeVisualSelection'](_0x325903){this['context']['plugins']['get'](o)['hideFakeVisualSelection']('ai-balloon-'+_0x325903);}['_showDialog'](){const _0x2ac34f=D(this['context'])['plugins']['get']('Dialog'),{id:_0x21cf15,title:_0x4819fa,icon:_0x51bb66,class:_0x42c84e,mainView:_0x266323}=this['_currentConfig'];_0x266323['delegate'](...j)['to'](this),_0x2ac34f['show']({'title':_0x4819fa,'icon':_0x51bb66,'hasCloseButton':!0x0,'id':_0x21cf15,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x42c84e||''),'content':_0x266323,'onShow':_0x18a2c1=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x197740=this['_getSelectionElements']();_0x197740&&_0x197740[0x0]&&_0x54e791({'target':_0x197740[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x18a2c1['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x21cf15});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](this['_currentConfig']['index']),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x21cf15}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x48ed4e,_0x1d730b){if(!_0x1d730b)return null;const _0x409f19=this['_getSelectionElements']();if(!_0x409f19||0x0===_0x409f19['length'])return{'left':Math['round'](_0x1d730b['left']+_0x1d730b['width']/0x2-_0x48ed4e['width']/0x2),'top':Math['round'](_0x1d730b['top']+_0x1d730b['height']/0x2-_0x48ed4e['height']/0x2)};const _0x35072c=Math['round'](_0x1d730b['left']+_0x1d730b['width']/0x2-_0x48ed4e['width']/0x2),_0x16162b=_0x409f19['map'](_0x1f9a02=>new _0x34633d(_0x1f9a02)),_0x55264c=_0x48ed4e['height'];return{'left':_0x35072c,'top':this['_calculateOptimalTopPosition'](_0x16162b,_0x55264c,_0x1d730b)};}['_calculateOptimalTopPosition'](_0x51a480,_0x34330b,_0x243772){const _0x4c6daa=new _0x34633d(_0x3537fe['window']),_0x242fc4=_0x51a480['map'](_0xd67ab=>_0xd67ab['getVisible']())['filter'](_0x1936a0=>_0x1936a0),_0x2f972b=_0x34633d['getBoundingRect'](_0x242fc4);if(!_0x2f972b)return Math['round'](_0x243772['top']+_0x243772['height']/0x2);const _0x5aca5e=_0x4c6daa['getIntersection'](_0x2f972b);if(!_0x5aca5e)return Math['round'](_0x243772['top']+_0x243772['height']/0x2);const _0x5df3c5=_0x243772['getVisible'](),_0x25361f=_0x5df3c5&&_0x2f972b['height']>_0x5df3c5['height'],_0x539e8a=_0x5aca5e['top'],_0x3ee431=_0x5aca5e['bottom'];if(_0x25361f){const _0x395d6a=(_0x5df3c5||_0x4c6daa)['height']/0x2-_0x34330b/0x2,_0xbda3b6=_0x539e8a-L-_0x243772['top'],_0xeb07f8=_0x243772['bottom']-_0x3ee431-L;return _0xbda3b6>=_0x34330b?Math['max'](L,_0x539e8a-_0x34330b-L):_0xeb07f8>=_0x34330b?_0x3ee431+L:Math['max'](L,_0x395d6a);}const _0x330ed8=_0x539e8a-_0x34330b,_0x4f591c=_0x243772['bottom']-_0x3ee431-L,_0x1f71b9=_0x539e8a-L-_0x243772['top'];let _0x43155d;if(_0x4f591c>=_0x34330b)_0x43155d=_0x3ee431+L;else{if(_0x1f71b9>=_0x34330b)_0x43155d=_0x330ed8-L;else _0x43155d=_0x539e8a+_0x2f972b['height']/0x2-_0x34330b/0x2;}return _0x43155d;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x5cd044=D(this['context']);this['listenTo'](_0x5cd044['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x10935a,data:{newRange:_0x11fde0}}of _0x5cd044['model']['document']['differ']['getChangedMarkers']())if(_0x10935a['startsWith'](a+':')&&(_0x11fde0&&(_0x11fde0['start']['isEqual'](_0x11fde0['end'])||'$graveyard'==_0x11fde0['root']['rootName'])||null==_0x11fde0)){const _0x4d13d4=m(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x4d13d4),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x23dead=D(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x23dead['model']['document']);}['_getSelectionElements'](){const _0x5d49c8=D(this['context']);return _0x589705(_0x5d49c8['editing'],[..._0x5d49c8['model']['markers']['getMarkersGroup']('ai-selection'),..._0x5d49c8['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class hs extends _0x1b7f91{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x59be04,_0x13220a={}){super(_0x59be04),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x13220a};const _0x3b14b9=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x3b14b9?'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'](_0x386b24){this['showChangesButton']['isEnabled']=_0x386b24;}['_setupRatingButtons'](){this['likeButton']=new _0x3fc85a(this['locale']),this['likeButton']['set']({'icon':_0x235fb2,'label':m(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x3fc85a(this['locale']),this['dislikeButton']['set']({'icon':_0x176db2,'label':m(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 _0x3fc85a(this['locale']),this['copyButton']['set']({'icon':_0x404dc2,'label':m(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x2a76e6=new _0x1a5580();_0x2a76e6['set']({'content':_0x28d1ec}),_0x2a76e6['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'](_0x2a76e6);}['_setupShowChangesButton'](){this['showChangesButton']=new _0x3fc85a(this['locale']),this['showChangesButton']['set']({'icon':_0x2b23b3,'label':m(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',_0x25a945=>_0x25a945?_0x5ce6ec:_0x2b23b3),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class B extends ns{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x334f5e,_0x18edf1){super(_0x334f5e);const _0x3bc40d=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new ts(),this['_keystrokes']=new _0x356454(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x19c87e({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x18edf1,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new es(_0x334f5e),this['_partToolbarView']=new os(_0x334f5e,_0x18edf1['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x18edf1),this['_stateView']=new as(_0x334f5e),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new hs(_0x334f5e,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new ls(_0x334f5e,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x3c223a,_0x480b1a,_0x2b7efd,_0x55a0e3)=>{let _0x4f17e2,_0x2982c4;'pending'===_0x55a0e3?(_0x4f17e2=this['_partToolbarView'],_0x2982c4=this['_stateView']):(_0x4f17e2=this['_stateView'],_0x2982c4=this['_partToolbarView']),this['_stateView']['setState'](_0x2b7efd),_0x4f17e2['isVisible']=!0x1,_0x2982c4['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x3bc40d['to']('_state',_0x1f5433=>'ck-ai-chat-balloon-main_state_'+_0x1f5433)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x18edf1);});}['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'](_0x398b3a){_0x398b3a?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x398b3a);}['setState'](_0x407069){this['_state']=_0x407069;}['showError'](_0x5201f7){super['showError'](_0x5201f7),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x2c11b1){super['showBlockingError'](_0x2c11b1),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x4af993){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x4af993;}['togglePartToolbarEnabled'](_0x21437d){this['_partToolbarView']['isEnabled']=_0x21437d;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x5b224f,showSuggestButton:_0x136c01}){_0x5b224f=_0x5b224f&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x136c01=_0x136c01&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x5b224f,'showSuggestButton':_0x136c01});}['_createNextButtonView'](){const _0x4a496f=new _0x3fc85a(this['locale']);return _0x4a496f['set']({'icon':_0x222cc5,'label':m(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x4a496f['on']('execute',()=>{this['fire']('showNext');}),_0x4a496f;}['_createPreviousButtonView'](){const _0x346e8f=new _0x3fc85a(this['locale']);return _0x346e8f['set']({'icon':_0x68c9f1,'label':m(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x346e8f['on']('execute',()=>{this['fire']('showPrevious');}),_0x346e8f;}}class ls extends _0x538d57{constructor(_0x45d6f3,_0x325cce){super(_0x45d6f3),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x325cce});}}class bt extends _0x5adfee{static get['requires'](){return[_0xc82d75,u];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x581bbb){super(_0x581bbb),this['set']('showDiff',!0x1);}['open'](_0x397175){const _0x5471ab=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x5471ab['plugins']['get']('AIBalloon')['open']({..._0x397175,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x397175['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x397175['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x581809){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x581809);}['setState'](_0x3ae237){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x3ae237);}['_createChatBalloonView'](){const _0x150019=this['editor'],_0x1d9a67=_0x150019['plugins']['get']('AIBalloon'),_0x50df7a=_0x150019['commands']['get']('trackChanges');let _0x51775b=_0x150019['config']['get']('ai.availableReplyActions')||[...S];_0x150019['plugins']['has']('TrackChanges')||(_0x51775b=_0x51775b['filter'](_0x57a7d0=>'insertSuggestion'!=_0x57a7d0));const _0x20c8f0=new B(_0x150019['locale'],{'availableActions':_0x51775b,'showApplyButton':!0x0,'showSuggestButton':!!_0x50df7a});return _0x20c8f0['bind']('showDiff')['to'](this),_0x20c8f0['delegate'](...V)['to'](this),_0x20c8f0['delegate']('showPrevious','showNext')['to'](this),_0x1d9a67['delegate']('dialogClosed')['to'](this),_0x20c8f0['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x20c8f0['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x20c8f0['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x50df7a&&_0x20c8f0['bind']('isTrackChangesOn')['to'](_0x50df7a,'value'),_0x20c8f0['render'](),_0x20c8f0;}['_toggleRotatorButtonsInDialogHeader'](_0x578389){const _0x1ac16e=this['editor'],_0x320a3b=_0x1ac16e['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x578389),_0x320a3b['has'](this['_chatBalloonView']['previousButtonView'])||(_0x320a3b['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x1ac16e['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x320a3b['remove'](this['_chatBalloonView']['previousButtonView']),_0x320a3b['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class Ya extends _0x5adfee{static get['requires'](){return[pt,bt,jt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Ot(_0x2894dd){const {editor:_0x219987,action:_0x23d5c4,withText:_0xd71065=!0x1,withIcon:_0x226b50=!0x0,isInDropdown:_0x5c63eb=!0x0,shouldPreventFocus:_0x473f5f=!0x1}=_0x2894dd;return()=>{const _0x37c8fc=_0x219987['locale'],_0x4ad92b=new _0x3fc85a(_0x37c8fc),_0xd59c22=_0x4ad92b['bindTemplate'];_0x5c63eb&&_0x4ad92b['extendTemplate']({'on':{'mouseenter':_0xd59c22['to'](()=>{_0x473f5f&&_0x473f5f()||_0x4ad92b['focus']();})}});const _0x26e999=_0x23d5c4['icon']??_0x23d5c4['parent']?.['icon'];return _0x4ad92b['set']({'label':_0x23d5c4['displayedPrompt'],'withText':_0xd71065,'role':'menuitem','icon':_0x226b50?_0x26e999??_0x5d0a10:void 0x0,'tooltip':!_0xd71065,'class':'ck-ai-quick-actions-button','isEnabled':_0x23d5c4['isEnabled']}),_0x4ad92b['on']('execute',()=>{_0x219987['editing']['view']['focus'](),_0x219987['commands']['execute']('aiQuickAction',_0x23d5c4);}),_0x4ad92b;};}class Ks extends _0xa6313b{['arrowView'];constructor(_0x2f8df1,_0x1bad36){super(_0x2f8df1,_0x1bad36);const _0x5e47f0=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',_0xe049d5=>String(_0xe049d5)),'data-cke-tooltip-disabled':_0x5e47f0['to']('isOn')},'on':{'mouseenter':_0x5e47f0['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x39fd9d=new _0x1a5580();return _0x39fd9d['content']=_0x41c19f,_0x39fd9d['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x39fd9d;}}class Hs extends _0x1b0a54{['_allListItems'];['_allSearchableItems'];constructor(_0x462ece,_0x35dc6f,_0x5ce85a){super(_0x462ece),this['_allListItems']=_0x35dc6f,this['_allSearchableItems']=_0x5ce85a;}['filter'](_0x2d4856){if(!_0x2d4856)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x235db5=_0x2d4856['source']['toLowerCase']()['trim'](),_0x1eb4fc=this['_allSearchableItems']['filter'](_0x399236=>(_0x399236['groupLabel']?_0x399236['label']+'\x20('+_0x399236['groupLabel']+')':_0x399236['label'])['toLowerCase']()['includes'](_0x235db5));return this['items']['clear'](),this['items']['addMany'](_0x1eb4fc['sort']((_0x4dd776,_0x183210)=>{const _0xec329b=_0x4dd776['groupLabel'],_0x9b85b5=_0x183210['groupLabel'];return _0xec329b||_0x9b85b5?_0xec329b?0x1:-0x1:0x0;})['map'](_0x340605=>_0x340605['item'])),this['_highlightQuery'](_0x235db5,_0x1eb4fc),{'resultsCount':_0x1eb4fc['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x11f916,_0x55a82d){if(!_0x11f916)return;const _0x5e0e3f=new RegExp(_0x32442b(_0x11f916),'gi');_0x55a82d['forEach'](_0x21f6fb=>{_0x21f6fb['highlightViews']&&_0x21f6fb['highlightViews']['forEach'](_0x3e74d3=>{'function'==typeof _0x3e74d3['highlightText']&&_0x3e74d3['highlightText'](_0x5e0e3f);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x4ad350=>{_0x4ad350['highlightViews']&&_0x4ad350['highlightViews']['forEach'](_0x484d23=>{'function'==typeof _0x484d23['highlightText']&&_0x484d23['highlightText'](null);});});}}const Js='menu',Xs='menuitem';class co extends _0x538d57{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x360528,_0x2fede4,_0x57e54e,_0x4be90b,_0x3111c6=!0x1){const _0x76d0e0=_0x360528['locale'];super(_0x76d0e0),this['_bodyCollection']=_0x4be90b,this['_hasSearch']=_0x3111c6;const _0x3f8db1=this['_createListItems'](_0x360528,_0x2fede4,_0x57e54e);this['optionsListView']=new Hs(_0x76d0e0,_0x3f8db1,this['_allSearchableItems']),this['optionsListView']['role']=Js,this['optionsListView']['items']['addMany'](_0x3f8db1),this['focusTracker']=new ts(),this['keystrokes']=new _0x356454(),_0x3111c6&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x3f8db1,this['focusCycler']=new _0x19c87e({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x3111c6&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x369f37=_0x3111c6&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x4f2c93(_0x369f37),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x76d0e0['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x8635d1(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':m(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':m(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x1389ef=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x1389ef);}['_createListItems'](_0x2e0ba,_0x3225d6,_0x228c4b){const _0xfc42da=new _0x4f2c93();return _0x3225d6['forEach'](_0x3c9ae8=>{if('actions'in _0x3c9ae8){const {listItem:_0x27de82}=this['_createActionGroupButton'](_0x2e0ba,_0x3c9ae8,_0x228c4b);_0xfc42da['add'](_0x27de82),_0x3c9ae8['actions']['forEach'](_0x1757a8=>{this['_createActionButton'](_0x2e0ba,_0x1757a8,_0x3c9ae8['label'],_0x3c9ae8['icon']);const {listItem:_0x55de5f,highlightViews:_0x5295de}=this['_createSearchResultActionButton'](_0x2e0ba,_0x1757a8,_0x3c9ae8['label'],_0x3c9ae8['icon']);this['_allSearchableItems']['push']({'item':_0x55de5f,'label':_0x1757a8['displayedPrompt'],'groupLabel':_0x3c9ae8['label'],'highlightViews':_0x5295de});});}else{const {listItem:_0x57c02d}=this['_createActionButton'](_0x2e0ba,_0x3c9ae8);_0xfc42da['add'](_0x57c02d);const _0x23f001=_0x57c02d['children']['first'];if(_0x23f001){const {listItem:_0x2d4c8b,highlightViews:_0x2d4b7d}=this['_createSearchResultActionButton'](_0x2e0ba,_0x3c9ae8);this['_allSearchableItems']['push']({'item':_0x2d4c8b,'label':_0x23f001['label']||'','highlightViews':_0x2d4b7d});}}}),_0xfc42da;}['_createActionButton'](_0x2abbc6,_0x421b19,_0x2b8be0,_0x181fbe){const _0x10b064=new _0x5749b5(this['locale']);if(_0x2b8be0&&_0x181fbe){const _0x3fb866=new _0x3fc85a(this['locale']),_0x3c04bc=_0x3fb866['bindTemplate'],_0xb914be=new _0xe11984();_0xb914be['text']=_0x421b19['displayedPrompt'];const _0x49a66b=new _0xe11984();_0x49a66b['text']=_0x2b8be0;const _0x4b3a3b=new _0x1a5580();_0x4b3a3b['content']=_0x181fbe,_0x4b3a3b['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x537d18=new _0x538d57(this['locale']);_0x537d18['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x2a61ff=new _0x538d57(this['locale']);return _0x2a61ff['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x3fb866['set']({'label':_0x421b19['displayedPrompt']+'\x20('+_0x2b8be0+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x3fb866['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':[_0xb914be,_0x537d18,_0x4b3a3b,_0x49a66b,_0x2a61ff],'on':{'mouseenter':_0x3c04bc['to'](()=>{this['_isSearchFocused']()||_0x3fb866['focus']();}),'click':_0x3c04bc['to'](()=>{_0x3fb866['fire']('execute');})}}),_0x3fb866['on']('execute',()=>{_0x2abbc6['editing']['view']['focus'](),_0x2abbc6['commands']['execute']('aiQuickAction',_0x421b19);}),_0x10b064['children']['add'](_0x3fb866),{'listItem':_0x10b064,'highlightViews':[_0xb914be,_0x49a66b]};}{const _0x5b322f=new _0x1eaeda(),_0x585d6c=new _0x3fc85a(this['locale'],_0x5b322f),_0x51ea82=_0x585d6c['bindTemplate'],_0x590f57=_0x421b19['icon']??_0x421b19['parent']?.['icon'],_0x789f1b=void 0x0!==_0x421b19['icon'];return _0x585d6c['set']({'label':_0x421b19['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':_0x789f1b?_0x590f57??_0x5d0a10:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x585d6c['extendTemplate']({'on':{'mouseenter':_0x51ea82['to'](()=>{this['_isSearchFocused']()||_0x585d6c['focus']();})}}),_0x585d6c['on']('execute',()=>{_0x2abbc6['editing']['view']['focus'](),_0x2abbc6['commands']['execute']('aiQuickAction',_0x421b19);}),_0x10b064['children']['add'](_0x585d6c),{'listItem':_0x10b064,'highlightViews':[_0x5b322f]};}}['_createSearchResultActionButton'](_0x3def68,_0x5e22f3,_0x18befc,_0x214567){return _0x18befc&&_0x214567?this['_createSearchResultGroupedActionButton'](_0x3def68,_0x5e22f3,_0x18befc,_0x214567):this['_createSearchResultIndividualActionButton'](_0x3def68,_0x5e22f3);}['_createSearchResultGroupedActionButton'](_0x5487fb,_0x2450c0,_0x4c15b3,_0x22dd65){const _0x44dda3=new _0x5749b5(this['locale']),_0x21aba7=new _0x3fc85a(this['locale']),_0x394ee7=_0x21aba7['bindTemplate'],{view:_0x1bf57b,highlightView:_0x446a93}=this['_createSearchResultGroupRow'](_0x4c15b3,_0x22dd65),{view:_0x4846b5,highlightView:_0x35c1a9}=this['_createSearchResultActionRow'](_0x2450c0['displayedPrompt']),_0xe471c0=this['_createSearchResultContentView'](_0x1bf57b,_0x4846b5);return _0x21aba7['set']({'label':_0x2450c0['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}),_0x21aba7['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':[_0xe471c0],'on':{'mouseenter':_0x394ee7['to'](()=>{this['_isSearchFocused']()||_0x21aba7['focus']();}),'click':_0x394ee7['to'](()=>{this['_handleSearchResultButtonClick'](_0x21aba7);})}}),this['_setupActionButtonExecution'](_0x21aba7,_0x5487fb,_0x2450c0),_0x44dda3['children']['add'](_0x21aba7),{'listItem':_0x44dda3,'highlightViews':[_0x446a93,_0x35c1a9]};}['_createSearchResultIndividualActionButton'](_0x487b31,_0x5e699f){const _0x151268=new _0x5749b5(this['locale']),_0xb1a08f=new _0x1eaeda(),_0x437677=new _0x3fc85a(this['locale'],_0xb1a08f),_0x249120=_0x437677['bindTemplate'];return _0x437677['set']({'label':_0x5e699f['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x437677['extendTemplate']({'on':{'mouseenter':_0x249120['to'](()=>{this['_isSearchFocused']()||_0x437677['focus']();})}}),this['_setupActionButtonExecution'](_0x437677,_0x487b31,_0x5e699f),_0x151268['children']['add'](_0x437677),{'listItem':_0x151268,'highlightViews':[_0xb1a08f]};}['_createSearchResultGroupRow'](_0x1f63d0,_0x12553d){const _0x10e360=new _0x538d57(this['locale']),_0x5c8569=new _0x1a5580();_0x5c8569['content']=_0x12553d,_0x5c8569['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x44d75e=new _0xe11984();return _0x44d75e['text']=_0x1f63d0,_0x10e360['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x5c8569,_0x44d75e]}),{'view':_0x10e360,'highlightView':_0x44d75e};}['_createSearchResultActionRow'](_0x4c9e2d){const _0x5a3c09=new _0x538d57(this['locale']),_0x9d8410=new _0xe11984();return _0x9d8410['text']=_0x4c9e2d,_0x5a3c09['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x9d8410]}),{'view':_0x5a3c09,'highlightView':_0x9d8410};}['_createSearchResultContentView'](_0x2aa3a2,_0x25af13){const _0x245c19=new _0x538d57(this['locale']);return _0x245c19['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x2aa3a2,_0x25af13]}),_0x245c19;}['_setupActionButtonExecution'](_0x28047c,_0x440429,_0x4fa05e){_0x28047c['on']('execute',()=>{_0x440429['editing']['view']['focus'](),_0x440429['commands']['execute']('aiQuickAction',_0x4fa05e);});}['_createActionGroupButton'](_0x1b1f3c,_0x5e3897,_0x37fb3c){const _0x41b1f9=new _0x5749b5(this['locale']),_0x36330e=new _0x1eaeda(),_0xb314c1=new Ks(this['locale'],_0x36330e),_0x39f3a6=_0xb314c1['bindTemplate'],_0x528f55=this['_getPanelKeystroke'](_0x37fb3c),_0xed0126=this['_createGroupActionsList'](_0x1b1f3c,_0x5e3897['actions'],_0x37fb3c);_0xb314c1['set']({'label':_0x5e3897['label'],'withText':!0x0,'role':Xs,'icon':_0x5e3897['icon']??_0x5d0a10,'isEnabled':_0x5e3897['actions']['some'](_0x1cd4e9=>_0x1cd4e9['isEnabled'])}),_0xb314c1['extendTemplate']({'on':{'mouseenter':_0x39f3a6['to'](()=>{this['_isSearchFocused']()||_0xb314c1['focus']();})}});const _0x14f810=new _0x51e059(this['locale']);return _0x14f810['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x39f3a6['to'](_0x4146ee=>{this['_handlePanelKeydown'](_0x4146ee,_0x528f55,_0xb314c1,_0x14f810);})}}),_0xb314c1['bind']('isOn')['to'](_0x14f810,'isVisible'),this['_bodyCollection']['add'](_0x14f810),_0x14f810['content']['add'](_0xed0126),this['_setupGroupMenuBehavior'](_0xb314c1,_0x14f810),_0x41b1f9['children']['add'](_0xb314c1),{'listItem':_0x41b1f9,'highlightView':_0x36330e};}['_createGroupActionsList'](_0x29c80c,_0x400f8,_0x57b8e9){const _0x4a639a=new _0x1b0a54(this['locale']);return _0x4a639a['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x400f8['forEach'](_0x3e3a3c=>{const _0x163473=new _0x5749b5(this['locale']),_0x42d988=Ot({'editor':_0x29c80c,'action':_0x3e3a3c,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x163473['children']['add'](_0x42d988),_0x57b8e9['focusTracker']['add'](_0x42d988),_0x4a639a['items']['add'](_0x163473);}),_0x4a639a;}['_setupGroupMenuBehavior'](_0x34653b,_0x1d45d6){const _0x4947f5=_0x34653b['bindTemplate'],_0x559e52=this['_getButtonKeystroke'](_0x34653b);_0x34653b['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x4947f5['to'](()=>{this['_showNestedPanel'](_0x1d45d6,_0x34653b);}),'mouseleave':_0x4947f5['to'](_0xfd457b=>{const _0x1ba7e4=_0xfd457b['relatedTarget'];this['_isMovingToNestedMenu'](_0x1ba7e4,_0x1d45d6)||this['_hideNestedPanel'](_0x1d45d6);}),'keydown':_0x4947f5['to'](_0x5cd96f=>{_0x5cd96f['key']==_0x559e52&&(this['_showNestedPanel'](_0x1d45d6,_0x34653b),_0x1d45d6['content']['get'](0x0)['focus']());})}}),_0x1d45d6['on']('render',()=>{_0x1d45d6['element']?.['addEventListener']('mouseleave',_0x21799f=>{const _0x5f5004=_0x21799f['relatedTarget'];_0x34653b['element']?.['contains'](_0x5f5004)||this['_isMovingToNestedMenu'](_0x5f5004,_0x1d45d6)||this['_hideNestedPanel'](_0x1d45d6);});});}['_showNestedPanel'](_0x2fbe81,_0x431584){this['_openNestedPanels']['forEach'](_0x5e2735=>{_0x5e2735!==_0x2fbe81&&_0x5e2735['isVisible']&&_0x5e2735['hide']();}),_0x2fbe81['show'](),_0x2fbe81['pin']({'positions':[_0x1a2e34['eastSouth']],'target':_0x431584['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x2fbe81);}['_hideNestedPanel'](_0x97d896){_0x97d896['hide'](),this['_openNestedPanels']['delete'](_0x97d896);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x19d13b=>_0x19d13b['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x5e2660,_0x25c71d){if(!_0x5e2660)return!0x1;if(_0x25c71d['element']?.['contains'](_0x5e2660))return!0x0;const _0x19ad6c=_0x5e2660;return _0x19ad6c['closest']&&(null!==_0x19ad6c['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x19ad6c['closest']('.ck-ai-quick-actions-group-list')||null!==_0x19ad6c['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'](_0x361319){return'rtl'===_0x361319['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x45784f){return'rtl'===_0x45784f['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x4cd162,_0x46933d,_0x498932,_0x463576){_0x4cd162['key']==_0x46933d&&(_0x498932['focus'](),this['_hideNestedPanel'](_0x463576));}['_handleSearchResultButtonClick'](_0x1f2a67){_0x1f2a67['fire']('execute');}}function xt(_0x2dfc30){const {editor:_0x40acab,content:_0x3cfa47,buttonDefinition:_0x1ea703,bodyCollection:_0x13a4cc,hasSearch:_0xeb693c=!0x1}=_0x2dfc30;return()=>{const _0x339f34=_0x40acab['locale'],_0x38cae7=_0x238494(_0x339f34);_0x38cae7['buttonView']['set']({'icon':_0x1ea703['icon']??_0x5d0a10,'label':_0x1ea703['label'],'tooltip':!0x0}),_0x38cae7['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x203032=new co(_0x40acab,_0x3cfa47,_0x38cae7,_0x13a4cc,_0xeb693c);if(_0x38cae7['panelView']['children']['add'](_0x203032),_0xeb693c){const _0x5ce7b7='ai-quick-actions-dropdown-selection';_0x38cae7['on']('change:isOpen',(_0x849c54,_0xbe4d40,_0x4dd328)=>{if(_0x4dd328){if(_0x40acab['plugins']['has']('AIEditing')){const _0xd04c51=_0x40acab['plugins']['get'](o),_0x4142c9=_0x40acab['model']['document']['selection'],_0x4f79ce=Array['from'](_0x4142c9['getRanges']());_0x4f79ce['length']>0x0&&_0xd04c51['showFakeVisualSelection'](_0x4f79ce,_0x5ce7b7,!0x1,!0x0);}}else _0x40acab['plugins']['has']('AIEditing')&&_0x40acab['plugins']['get'](o)['hideFakeVisualSelection'](_0x5ce7b7),_0x203032['resetSearch']();});}return _0x38cae7;};}const Ut='<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>',vt='<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>',Pt='<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 It=function(_0x371f42){return _0x371f42['CHAT']='CHAT',_0x371f42['ACTION']='ACTION',_0x371f42['REVIEW']='REVIEW',_0x371f42;}({}),$a=function(_0x1d6316){return _0x1d6316['CHAT']='AIChat',_0x1d6316['ACTION']='AIActions',_0x1d6316['REVIEW']='AIReviewMode',_0x1d6316;}({});class ki extends _0x5adfee{static get['requires'](){return[Et,s];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x570f74=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x570f74),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x141414){return function(_0xf18773){const _0x1cceab=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0xf18773['uiLanguage']),_0x289b4d=_0x1cceab||'English',_0x87f819=[{'id':'ask-ai','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Tt},{'id':'chat-commands','label':m(_0xf18773,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Tt,'actions':[{'id':'explain','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Ut['replace']('%0',_0x289b4d),'type':'CHAT'},{'id':'summarize','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':vt['replace']('%0',_0x289b4d),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Pt['replace']('%0',_0x289b4d),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Ct},{'id':'continue','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':kt},{'id':'fix-grammar','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Nt},{'id':'adjust-length','label':m(_0xf18773,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':yt,'actions':[{'id':'make-shorter','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':m(_0xf18773,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_t,'actions':[{'id':'make-tone-casual','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':m(_0xf18773,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':St,'actions':[{'id':'translate-to-english','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':m(_0xf18773,'AI_QUICK_ACTIONS_OTHER'),'icon':Qt,'actions':[]}];return _0x87f819;}(_0x141414);}async['_getDefaultAndCustomActions'](){const _0xfaba8f=ki['getDefaultQuickActions'](this['editor']['locale']),_0x2f268c=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x2b32ff=[];try{_0x2b32ff=await new X({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x2b7272){const _0x513943=new _0x1500e8('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x2b7272});_0x4dee23(_0x513943['message']);}finally{const _0x45d68d=_0x2f268c['map'](_0x5f2812=>({..._0x5f2812,'icon':void 0x0}));_0xfaba8f['find'](_0x4f3f57=>'other'===_0x4f3f57['id'])['actions']['push'](..._0x45d68d),_0xfaba8f['forEach'](_0x4bf819=>{if('actions'in _0x4bf819)_0x4bf819['actions']['forEach'](_0x1a67f8=>{if(_0x1a67f8['isEnabled']=!!_0x2b32ff['find'](_0x32babb=>_0x32babb['id']===_0x1a67f8['model'])||void 0x0===_0x1a67f8['model'],!_0x1a67f8['isEnabled']){const _0xfe852e=new _0x1500e8('ai-quick-actions-unavailable-model',this,{'actionId':_0x1a67f8['id'],'modelId':_0x1a67f8['model']});_0x4dee23(_0xfe852e['message']);}});else{if(_0x4bf819['isEnabled']=!!_0x2b32ff['find'](_0x35caee=>_0x35caee['id']===_0x4bf819['model'])||void 0x0===_0x4bf819['model'],!_0x4bf819['isEnabled']){const _0x3d6960=new _0x1500e8('ai-quick-actions-unavailable-model',this,{'actionId':_0x4bf819['id'],'modelId':_0x4bf819['model']});_0x4dee23(_0x3d6960['message']);}}});}return _0xfaba8f;}['_initializeQuickActionsComponentsAndCommands'](){const _0x5e46a5=new _0x4b2ab0(this['editor']['locale']);_0x5e46a5['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x5e46a5),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x5e46a5);}['_initializeQuickActionsDropdown'](_0x247224){const _0x12e449=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',xt({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x5d0a10,'label':m(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x247224,'hasSearch':_0x12e449}));}['_prepareQuickActionsDefinition'](_0x1e51bf){this['_quickActionsDefinition']=_0x1e51bf['map'](_0x14d44d=>{if('actions'in _0x14d44d){const _0x4a047f=_0x14d44d;return{..._0x4a047f,'actions':_0x4a047f['actions']['map'](_0x6d3f58=>{const {actions:_0x2bd76d,..._0x2dc4e2}=_0x4a047f;return{..._0x6d3f58,'parent':_0x2dc4e2};})['filter'](_0x9155=>this['_shouldIncludeAction'](_0x9155))};}return _0x14d44d;})['filter'](_0x49dc89=>'actions'in _0x49dc89?_0x49dc89['actions']['length']>0x0:this['_shouldIncludeAction'](_0x49dc89));}['_shouldIncludeAction'](_0x4153da){const _0x1e4bb4=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has']($a[_0x4153da['type']])&&!_0x1e4bb4['includes'](_0x4153da['id'])&&!('CHAT'===_0x4153da['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x43106b){this['_quickActionsDefinition']['forEach'](_0x3a0e21=>{if('actions'in _0x3a0e21){const _0x1e563c=xt({'editor':this['editor'],'content':_0x3a0e21['actions'],'buttonDefinition':_0x3a0e21,'bodyCollection':_0x43106b});this['editor']['ui']['componentFactory']['add'](_0x3a0e21['id'],_0x1e563c),_0x3a0e21['actions']['forEach'](_0x35ab81=>{const _0x720cb7=Ot({'editor':this['editor'],'action':_0x35ab81});this['editor']['ui']['componentFactory']['add'](_0x35ab81['id'],_0x720cb7);});}else{const _0x4d4577=Ot({'editor':this['editor'],'action':_0x3a0e21,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x3a0e21['id'],_0x4d4577);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x3f01a0=>{const _0x3123df=new _0x3c114(_0x3f01a0),_0x222c2e=m(_0x3f01a0,'AI_QUICK_ACTIONS_HEADING');_0x3123df['buttonView']['set']({'label':_0x222c2e,'icon':_0x5d0a10});const _0x447fdf=new _0x3301ef(_0x3f01a0);_0x447fdf['set']({'ariaLabel':_0x222c2e,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x50c60c=>{if('actions'in _0x50c60c){const _0x12bc92=_0x50c60c,_0x8b6ba4=new _0x4dbed9(_0x3f01a0,_0x3123df),_0xd197f4=new _0x3c114(_0x3f01a0),_0x157908=new _0x3301ef(_0x3f01a0);_0xd197f4['buttonView']['set']({'label':_0x12bc92['label'],'icon':_0x12bc92['icon']}),_0x12bc92['actions']['forEach'](_0x7fbb62=>{const _0x1ad5cd=new _0x4dbed9(_0x3f01a0,_0xd197f4),_0x5d13ea=new _0x58fafd(_0x3f01a0);_0x5d13ea['set']({'label':_0x7fbb62['displayedPrompt'],'icon':_0x7fbb62['icon'],'role':'menuitem','isEnabled':_0x7fbb62['isEnabled']}),_0x5d13ea['on']('execute',()=>{this['_executeQuickAction'](_0x7fbb62);}),_0x5d13ea['delegate']('execute')['to'](_0xd197f4),_0x1ad5cd['children']['add'](_0x5d13ea),_0x157908['items']['add'](_0x1ad5cd);}),_0xd197f4['panelView']['children']['add'](_0x157908),_0x8b6ba4['children']['add'](_0xd197f4),_0x447fdf['items']['add'](_0x8b6ba4);}else{const _0x5b1675=_0x50c60c,_0x25a7e=new _0x4dbed9(_0x3f01a0,_0x3123df),_0x5acac6=new _0x58fafd(_0x3f01a0);_0x5acac6['set']({'label':_0x5b1675['displayedPrompt'],'icon':_0x5b1675['icon'],'role':'menuitem','isEnabled':_0x5b1675['isEnabled']}),_0x5acac6['on']('execute',()=>{this['_executeQuickAction'](_0x5b1675);}),_0x5acac6['delegate']('execute')['to'](_0x3123df),_0x25a7e['children']['add'](_0x5acac6),_0x447fdf['items']['add'](_0x25a7e);}});const _0x47814b=Object['values']($a)['some'](_0x40762f=>this['editor']['plugins']['has'](_0x40762f));return _0x3123df['set']({'isEnabled':_0x47814b}),_0x3123df['panelView']['children']['add'](_0x447fdf),_0x3123df;});}['_executeQuickAction'](_0x438844){const _0x202552=this['editor'];_0x202552['editing']['view']['focus'](),_0x202552['commands']['execute']('aiQuickAction',_0x438844);const _0x2d2d0c=_0x202552['ui']['view']['menuBarView'];_0x2d2d0c&&_0x2d2d0c['close']&&_0x2d2d0c['close']();}}class Ii extends At{['execute'](_0x306775){switch(this['_expandSelectionIfCollapsed'](),_0x306775['type']){case It['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x5dc0a0=m(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x1500e8('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5dc0a0});}this['_handleAIChatAction'](_0x306775);break;case It['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x43815c=m(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x1500e8('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x43815c});}this['_handleAIActionsAction'](_0x306775);break;case It['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x5a55be=m(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x1500e8('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5a55be});}this['_handleAIReviewAction'](_0x306775);}}async['_handleAIChatAction'](_0x19208e){const _0x20ed7e=this['editor']['plugins']['get']('AIChat'),_0x20fde9=this['editor']['plugins']['get']('AIChatController'),_0x591774=this['editor']['plugins']['get']('AITabs')['view'];if(_0x591774['isVisible']||(_0x591774['isVisible']=!0x0),'chat'!==_0x591774['activeTab']&&_0x591774['activateTab']('chat'),'ask-ai'===_0x19208e['id'])_0x20fde9['removeSelectionFromChatContext'](),await _0x20ed7e['addSelectionToChatContext'](),_0x20ed7e['focusPromptInput']();else await _0x20ed7e['startConversation'](),_0x20fde9['removeSelectionFromChatContext'](),await _0x20ed7e['addSelectionToChatContext'](),_0x20ed7e['focusPromptInput'](),await _0x20ed7e['sendMessage']({'message':_0x19208e['prompt']||_0x19208e['displayedPrompt'],'attributes':{'quickActionData':{'id':_0x19208e['id']},'displayedPrompt':_0x19208e['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x3b8985=this['editor'],_0x55d303=_0x3b8985['model']['document']['selection'];if(!_0x55d303['isCollapsed'])return;const _0x4a1ee1=_0x33a8c(_0x55d303['getSelectedBlocks']())||_0x3b8985['model']['schema']['getLimitElement'](_0x55d303);_0x3b8985['model']['change'](_0x15e097=>{_0x15e097['setSelection'](_0x4a1ee1,'in');});}['_handleAIActionsActionLabel'](_0x2db0e5){return _0x2db0e5['parent']?.['label']&&'other'!==_0x2db0e5['parent']?.['id']?_0x2db0e5['parent']['label']+':\x20'+_0x2db0e5['displayedPrompt']:_0x2db0e5['displayedPrompt'];}async['_handleAIActionsAction'](_0x4dafdf){const _0x106ad3=this['editor']['plugins']['get']('AIActions'),_0x4d8864=_0x4dafdf['prompt']?{'userMessage':_0x4dafdf['prompt'],'model':_0x4dafdf['model']}:{'actionName':_0x4dafdf['actionName']||_0x4dafdf['id'],'args':_0x4dafdf['args']},_0x49f8a4=this['_handleAIActionsActionLabel'](_0x4dafdf);await _0x106ad3['executeAction'](_0x4d8864,_0x49f8a4,_0x4dafdf['icon']);}async['_handleAIReviewAction'](_0x4f7204){console['log']('handleAIReviewAction',_0x4f7204);}}class ji extends _0x5adfee{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3eedb7=this['editor'],_0xcbe3c2=new Ii(this['editor']);if(_0x3eedb7['commands']['add']('aiQuickAction',_0xcbe3c2),_0x3eedb7['plugins']['has']('AIChat')){const _0x3e7ee1=this['editor']['plugins']['get']('AIChat');_0x3eedb7['model']['document']['selection']['on']('change:range',(_0x357558,_0x2dbc44)=>{_0x2dbc44['directChange']&&_0x3e7ee1['removeSelectionFromChatContext']();});}}}class Kt extends pe{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x3d8ee4=this['documentContextContent']['children']['map'](_0x2c2dd1=>({'node':_0x2c2dd1,'id':q(_0x2c2dd1,'data-id')})),_0x5be06a=this['parsedMergedContent']['children']['map'](_0x825813=>({'node':_0x825813,'id':q(_0x825813,'data-id')||_0x3e4e8c()})),_0x170189=_0x3682e4(_0x3d8ee4,_0x5be06a,{'comparator':(_0x221df5,_0x6e62b7)=>_0x221df5['id']==_0x6e62b7['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x170189['length']&&_0x170189[_0x170189['length']-0x1]['removed'];)_0x170189['pop']();}const _0x504f45=_0x170189['map'](_0x33e545=>{const _0x135ee5=_0x33e545['added']?'new':_0x33e545['removed']?'removed':'modified';return{'node':_0x33e545['value'][0x0]['node'],'type':_0x135ee5,'id':_0x33e545['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x504f45,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x37c54d,_0x1bad0c){return _0x1bad0c;}}class h extends qt{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x34ec76){super(_0x34ec76),this['content']=_0x34ec76['content'],this['version']=_0x34ec76['version'],this['actionName']=_0x34ec76['actionName'],this['args']=_0x34ec76['args'],this['userMessage']=_0x34ec76['userMessage'],this['model']=_0x34ec76['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':Jt['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x359fc7){const _0x24508f=new Kt({'editor':this['editor'],'documentContextContent':this['content'],..._0x359fc7});return this['replies']['push'](_0x24508f),_0x24508f['delegate'](...zt)['to'](this),this['fire']('replyCreated',_0x24508f),_0x24508f;}}class Bn extends _0x1b7f91{constructor(_0x1af79e,_0x130932=!0x0,_0x3c0dd6=!0x0){super(_0x1af79e),this['set']('isEnabled',!0x1),_0x130932&&(this['applyButton']=this['_createButton'](m(_0x1af79e,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x3c0dd6&&(this['suggestButton']=this['_createButton'](m(_0x1af79e,'AI_BALLOON_SUGGEST_BUTTON'),_0x130932?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x130932,'showSuggestButton':_0x3c0dd6}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x32019a,showSuggestButton:_0x3a373f}){this['applyButton']&&(this['applyButton']['isVisible']=_0x32019a),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x3a373f);}['_createButton'](_0x3abada,_0x198248){const _0x1d7d5a=new _0x3fc85a(this['locale']);return _0x1d7d5a['set']({'label':_0x3abada,'class':_0x198248,'isVisible':!0x0,'withText':!0x0}),_0x1d7d5a;}}class yn extends _0x538d57{constructor(_0x567779){super(_0x567779),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':m(_0x567779,'AI_DISCLAIMER_TEXT')}]}]});}}class Nn extends _0x538d57{constructor(_0x5afe87){super(_0x5afe87),this['set']('isVisible',!0x0);const _0x249b16=new De('small');_0x249b16['isVisible']=!0x0;const _0x2d8a04=new _0x538d57(this['locale']);_0x2d8a04['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[m(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x3d75f9=>!_0x3d75f9)]},'children':[_0x249b16,_0x2d8a04]});}}class v extends ns{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x595439,_0x263efd){super(_0x595439),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x263efd,this['_focusTracker']=new ts(),this['_keystrokes']=new _0x356454(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x19c87e({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x4f2c93(),this['_addContentWrapper'](_0x263efd),this['_addDisclaimerView'](),this['_addToolbar'](_0x263efd),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'](_0x263efd);});}['render'](){super['render']();for(const _0x3883af of this['_focusables'])this['_focusTracker']['add'](_0x3883af['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x26fbcb){-0x1===_0x26fbcb?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x23b2fd){this['_isLoading']=_0x23b2fd;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x378cfc){super['showError'](_0x378cfc),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x489458){super['showBlockingError'](_0x489458),this['setErrorState']();}['addMiniToolbarItem'](_0x506bcf){this['_miniToolbarView']['items']['has'](_0x506bcf)||this['_miniToolbarView']['items']['add'](_0x506bcf);}['removeMiniToolbarItem'](_0x1adaf1){this['_miniToolbarView']['items']['has'](_0x1adaf1)&&this['_miniToolbarView']['items']['remove'](_0x1adaf1);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x36a1ec,showSuggestButton:_0x59d823}){_0x36a1ec=_0x36a1ec&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x59d823=_0x59d823&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x36a1ec,'showSuggestButton':_0x59d823});}async['updateContent'](_0x548b58){await this['_streamableContentView']['update'](_0x548b58);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x5962c0){this['_contentWrapper']=new _0x538d57(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'](_0x5962c0['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new yn(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x188a12,showSuggestButton:_0x2fa869}){this['_toolbarView']=new Bn(this['locale'],_0x188a12,_0x2fa869),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',(_0x5969d5,_0x457e9a,_0x1fc79f)=>!(_0x5969d5||_0x457e9a||_0x1fc79f)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x188a12,'showSuggestButton':_0x2fa869}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x3f6f99){return this['_miniToolbarView']=new hs(this['locale'],_0x3f6f99),this['_miniToolbarView']['delegate'](...V)['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',(_0x14835c,_0x5499e9)=>!(_0x14835c||_0x5499e9)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new Nn(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new es(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x3a5e00=new _0x3fc85a(this['locale']),_0x508c4e=new _0x3fc85a(this['locale']),_0x49b694=new Ln(this['locale']),_0x4fa457=new _0x3fc85a(this['locale']);_0x3a5e00['set']({'icon':_0x49b8b4,'label':m(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x508c4e['set']({'icon':_0x41367a,'tooltip':m(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x4fa457['set']({'icon':_0x5695ec,'tooltip':m(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x3a5e00['bind']('isEnabled')['to'](this,'isBusy',_0x17b79c=>!_0x17b79c),_0x3a5e00['on']('execute',()=>{this['fire']('tryAgain');}),_0x508c4e['bind']('isEnabled')['to'](this,'isBusy',_0x521b44=>!_0x521b44),_0x508c4e['on']('execute',()=>{this['fire']('showPrevious');}),_0x4fa457['bind']('isEnabled')['to'](this,'isBusy',_0x3f5e5d=>!_0x3f5e5d),_0x4fa457['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x508c4e,this['_navigationCounter']=_0x49b694,this['_navigationNextButton']=_0x4fa457,this['_navigationTryAgainButton']=_0x3a5e00;}['updateMiniToolbarButtons'](_0x2d9568,_0x448997){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x10f9d3=_0x2d9568>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x10f9d3){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x503f22=_0x2d9568-_0x448997;this['_navigationCounter']['setInteractionCount'](_0x503f22+'/'+_0x2d9568),this['_navigationPreviousButton']['isEnabled']=_0x448997<_0x2d9568-0x1,this['_navigationNextButton']['isEnabled']=_0x448997>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'](_0x349ce7){this['_isLoading']=_0x349ce7;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x363e81=this['_getScrollableElement']();_0x363e81&&!this['_scrollManager']&&(this['_scrollManager']=new Fe(_0x363e81));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class Ln extends _0x538d57{constructor(_0x151a0a){super(_0x151a0a);const _0x1ada18=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x1ada18['to']('interactionCount')}]});}['setInteractionCount'](_0x44d009){this['set']('interactionCount',_0x44d009);}}class qi extends _0x5adfee{static get['requires'](){return[s,_0xc82d75,o,u,_0x4f58a6];}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(_0x39e525){super(_0x39e525),this['_bodyCollection']=new _0x4b2ab0(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new g();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x2b992f,_0x26afe8,_0x90302a){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x4479df,anchorData:_0x278fd8}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x2b992f,_0x4479df,_0x278fd8,_0x26afe8,_0x90302a);}}const {modelFragment:_0x3174ee,anchorData:_0x4b4d69}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x2b992f,_0x3174ee,_0x4b4d69,_0x26afe8,_0x90302a);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x5dfc73=this['editor']['plugins']['has']('TrackChanges');let _0x511c5b=this['editor']['config']['get']('ai.availableReplyActions')||[...S];_0x5dfc73||(_0x511c5b=_0x511c5b['filter'](_0x166b27=>'insertSuggestion'!=_0x166b27));const _0x181740=this['editor']['commands']['get']('trackChanges'),_0x19855f=new v(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x5dfc73,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x511c5b});return _0x19855f['bind']('isBusy')['to'](this),_0x181740&&_0x19855f['bind']('isTrackChangesOn')['to'](_0x181740,'value'),_0x19855f['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x19855f['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x19855f['on']('showNext',()=>{this['_navigateToNext']();}),_0x19855f;}['_getExecuteDataRegular'](){const _0x4b2b91=this['editor']['model']['document']['selection'];if(_0x4b2b91['isCollapsed']){const _0x121a89=_0x33a8c(_0x4b2b91['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x4b2b91);this['editor']['model']['change'](_0x133e14=>{_0x133e14['setSelection'](_0x121a89,'in');});}const _0x471e6a=_0x4b2b91['getFirstRange'](),_0xf5d73f=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x4b2b91),_0x471e6a['start'],_0x471e6a['end']);this['_copyMarkersToFragment'](_0xf5d73f,_0x4b2b91,{'isTableSelection':!0x1});const _0x58b000=_0x4b2b91['getFirstRange']()['start'],_0x7a6e71=new Map();let _0x72ddaa=_0xf5d73f;for(let _0x35a13e=0x0;_0x35a13e<_0x58b000['path']['length'];_0x35a13e++)_0x7a6e71['set'](_0x72ddaa,_0x58b000['path'][_0x35a13e]),_0x72ddaa=_0x72ddaa['getChild'](0x0);return{'modelFragment':_0xf5d73f,'anchorData':_0x7a6e71};}['_getExecuteDataInTable'](){const _0x583ab3=this['editor']['model']['document']['selection'],_0x125768=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x403164=_0x583ab3['getFirstRange']()['start']['parent']['parent'],_0x43fa1d=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x403164),this['editor']['model']['createPositionAfter'](_0x403164)),_0x21b4ff=this['_wrapWithCommonAncestors'](_0x125768,_0x43fa1d['start'],_0x43fa1d['end']);this['_copyMarkersToFragment'](_0x21b4ff,_0x583ab3,{'isTableSelection':!0x0});const _0x54b76f=_0x583ab3['getFirstRange']()['start'],_0x9a568e=new Map();let _0x50d7de=_0x21b4ff;for(let _0x96f730=0x0;_0x96f730<_0x54b76f['path']['length'];_0x96f730++)if(_0x9a568e['set'](_0x50d7de,_0x54b76f['path'][_0x96f730]),_0x96f730<_0x54b76f['path']['length']-0x1)_0x50d7de=_0x50d7de['getChild'](0x0);else{let _0x178611=_0x50d7de['nextSibling'];for(;_0x178611;)_0x9a568e['set'](_0x178611,_0x54b76f['path'][_0x96f730]),_0x178611=_0x178611['nextSibling'];}return{'modelFragment':_0x21b4ff,'anchorData':_0x9a568e};}async['_executeAction'](_0x238f9c,_0x5759dc,_0x33c3d4,_0x25f73e,_0x245d78){const _0x33dc81=this['editor']['plugins']['get'](o),_0x3b9a78=this['editor']['plugins']['get'](u),_0x3447a9=this['editor']['model']['document']['selection'],_0x45b88b=await _0x33dc81['modelToDataWithIds'](_0x5759dc),_0x278af7=this['editor']['model']['document']['version'],_0x37a82b=[..._0x3447a9['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),_0x3b9a78['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x25f73e,'icon':_0x245d78||_0x5d0a10,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x37a82b,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x3b9a78),this['_interactionParams']={'action':_0x238f9c,'content':_0x45b88b,'version':_0x278af7,'aiBalloon':_0x3b9a78,'modelFragment':_0x5759dc,'anchorData':_0x33c3d4},this['_setupApplyListeners'](),this['listenTo'](_0x3b9a78,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x3b9a78,'dialogClosed',(_0x1b8af9,{id:_0x364df5})=>{if('aiActionsBalloon'===_0x364df5){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x19a7e8=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x8878c1=_0x19a7e8['changeGroups'][0x0];_0x8878c1&&'pending'===_0x8878c1['state']&&_0x19a7e8['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x3b9a78);}}),this['_createInteraction'](_0x45b88b,_0x278af7,_0x3b9a78,_0x238f9c);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x1d9e06,anchorData:_0x29f69a}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x1d9e06,_0x29f69a,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x1d9e06,_0x29f69a,!0x0);});}['_wrapWithCommonAncestors'](_0x50ad0f,_0x39daf8,_0x394218){const _0x27e7f3=this['editor']['model']['createRange'](_0x39daf8,_0x394218)['getCommonAncestor'](),_0x310adc=_0x27e7f3['is']('documentFragment')?[]:_0x27e7f3['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x310adc['length']){const _0x35d1cd=_0x310adc['map'](_0x381e1a=>_0x381e1a['_clone'](!0x1));for(let _0x38bf43=0x1;_0x38bf43<_0x35d1cd['length'];_0x38bf43++)_0x35d1cd[_0x38bf43-0x1]['_appendChild'](_0x35d1cd[_0x38bf43]);return _0x35d1cd[_0x35d1cd['length']-0x1]['_appendChild'](_0x50ad0f),new _0x27a70e(_0x35d1cd[0x0]);}return _0x50ad0f;}['_copyMarkersToFragment'](_0x2b8398,_0x41ab79,_0x3354c4={'isTableSelection':!0x1}){const _0x2880d4=this['editor']['model'],_0x335edb=Array['from'](_0x41ab79['getRanges']()),_0x26b9d2=_0x41ab79['getFirstRange']()['start'];for(const _0x1450b of _0x2880d4['markers']){if(_0x1450b['name']['startsWith'](a)||!_0x1450b['affectsData'])continue;const _0x32bbd5=_0x1450b['getRange']();if(!_0x335edb['some'](_0x527231=>_0x527231['containsRange'](_0x32bbd5,!0x0)))continue;const _0x49375c=this['_regularCalculateMarkerPath'](_0x32bbd5['start'],_0x26b9d2,_0x3354c4['isTableSelection']),_0x27fa5f=this['_regularCalculateMarkerPath'](_0x32bbd5['end'],_0x26b9d2,_0x3354c4['isTableSelection']),_0x8d8417=_0x2880d4['createPositionFromPath'](_0x2b8398,_0x49375c),_0xd81d5a=_0x2880d4['createPositionFromPath'](_0x2b8398,_0x27fa5f);if(!_0x8d8417['isEqual'](_0xd81d5a)){const _0x463314=_0x2880d4['createRange'](_0x8d8417,_0xd81d5a);_0x2b8398['markers']['set'](_0x1450b['name'],_0x463314);}}}['_regularCalculateMarkerPath'](_0x240e67,_0xae4702,_0x51c6d0=!0x1){const _0x43ff6a=[..._0x240e67['path']['slice']()];for(let _0x1a114f=0x0;_0x1a114f<Math['max'](_0xae4702['path']['length'],_0x240e67['path']['length']);_0x1a114f++){const _0x422aca=_0xae4702['path'][_0x1a114f]||0x0,_0x45d6ed=(_0x240e67['path'][_0x1a114f]||0x0)-_0x422aca;if(_0x43ff6a[_0x1a114f]=_0x45d6ed,0x0!==_0x45d6ed&&!_0x51c6d0)break;}return _0x43ff6a;}async['_createInteraction'](_0x26cbf3,_0x4284a8,_0x1f94ba,_0x3b08b3){const _0x4337f1=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x3b08b3,'content':_0x26cbf3,'version':_0x4284a8,'aiBalloon':_0x1f94ba,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0xad2092=new h({'connector':this['_aiConnector'],'editor':_0x4337f1,'content':_0x26cbf3,'version':_0x4284a8,..._0x3b08b3});this['_interactions']['push'](_0xad2092);const _0x58cdcb=(_0x54fe89,_0x4373e9=!0x1,_0x2656a2='streaming')=>this['_promiseQueue']['enqueue'](async _0x36c268=>{try{const _0x59854f=f({'editor':_0x4337f1,'changeGroups':_0x54fe89['changeGroups'],'documentContextContent':_0x54fe89['documentContextContent'],'showDiff':_0x4373e9,'trimUnchanged':!0x1});_0x59854f['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x59854f[0x0],'renderingStrategy':_0x2656a2,'abortSignal':_0x36c268});}catch(_0x388470){if(this['_isAbortError'](_0x388470))return;throw _0x388470;}});this['_interaction']['on']('replyCreated',(_0x275433,_0x1acf4e)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x58cdcb(_0x1acf4e)['catch'](_0x51938e=>{this['_isAbortError'](_0x51938e)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x51938e),this['_setErrorState'](_0xad2092));});}),this['_interaction']['on']('replyContentUpdated',(_0xde478b,_0x321715)=>{_0x58cdcb(_0x321715)['catch'](_0x17a3ca=>{this['_isAbortError'](_0x17a3ca)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x17a3ca),this['_setErrorState'](_0xad2092));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x34ede5){this['_isAbortError'](_0x34ede5)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x34ede5),this['_setErrorState'](_0xad2092));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x45b86d,{showDiff:_0x5a4b62})=>{try{this['_balloonShowDiff']=_0x5a4b62;const _0x304563=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x304563&&await _0x58cdcb(_0x304563,_0x5a4b62,'static');}catch(_0x545588){this['_isAbortError'](_0x545588)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x545588),this['_setErrorState'](_0xad2092));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x17d309,{reply:_0x10db66})=>{const _0x4a3b2d={'positiveCount':_0x10db66['changeGroups']['filter'](_0x54b6e2=>'accepted'===_0x54b6e2['state'])['length'],'totalCount':_0x10db66['changeGroups']['length']},_0x2a9b84=this['_interaction']['actionCallId'],_0x2b7fe7=this['_interaction']['actionName'];_0x2b7fe7?this['_aiConnector']['upsertAIActionRating'](_0x2b7fe7,_0x2a9b84,_0x4a3b2d):this['_aiConnector']['upsertCustomAIActionRating'](_0x2a9b84,_0x4a3b2d);}),this['_setLoadingState']();try{const _0x3725a2=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x3725a2;}catch(_0x4de965){if(this['_isAbortError'](_0x4de965))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0xad2092);}}['_applyChanges'](_0x58c78a,_0x59833c,_0x1f4ff2){const _0x40c6d5=this['editor'];if(_0x1f4ff2&&!_0x40c6d5['plugins']['has']('TrackChanges'))throw new _0x1500e8('ai-no-track-changes',null);const _0x10d476=this['editor']['plugins']['get'](_0x4f58a6),_0x1fbebe=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x1fbebe||!_0x1fbebe['replies']['length'])return;const _0x116641=_0x1fbebe['replies'][_0x1fbebe['replies']['length']-0x1],_0x15baf4=_0x116641['changeGroups'];_0x116641['setChangeGroupState'](0x0,'accepted');let _0x2aac6f=y({'editor':_0x40c6d5,'reply':_0x116641,'interaction':_0x1fbebe,'groups':_0x15baf4,'transform':!0x1,'documentCompare':_0x10d476,'documentCompareOptions':{'anchor':_0x40c6d5['model']['createPositionAt'](_0x58c78a,0x0),'markDeletions':_0x1f4ff2}});_0x2aac6f=this['_filterOperationsOutsideRange'](_0x2aac6f,_0x59833c);for(const _0x40d102 of _0x2aac6f)this['_anchorOperation'](_0x59833c,_0x40d102,_0x40c6d5['model']['document']['getRoot']());const _0x534689=_0x1fbebe['getDocumentContext']()['version'],_0x38e86b=_0x40c6d5['model']['document']['history']['getOperations'](_0x534689),_0x5d1dbb={'document':_0x40c6d5['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x2fc34a=_0x104b8e(_0x2aac6f,_0x38e86b,_0x5d1dbb)['operationsA'];_0x40c6d5['model']['change'](_0x408fec=>{if(_0x408fec['setSelection'](_0x40c6d5['model']['document']['selection']['focus']),_0x1f4ff2)_0x40c6d5['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x2fc34a);else{for(const _0x50054e of _0x2fc34a)_0x50054e['baseVersion']=_0x40c6d5['model']['document']['version'],d(_0x40c6d5,_0x50054e),_0x408fec['batch']['addOperation'](_0x50054e),_0x40c6d5['model']['applyOperation'](_0x50054e);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x447630,_0x3a7108){return _0x447630['filter'](_0x5540d3=>{if('rename'==_0x5540d3['type']){const _0x36650d=_0x5540d3['position']['nodeAfter'];return!_0x3a7108['has'](_0x36650d);}if(_0x5540d3['type']['indexOf']('Attribute')>-0x1){const _0x420ac9=_0x5540d3['range']['start']['nodeAfter'];return!_0x3a7108['has'](_0x420ac9);}return!0x0;});}['_anchorOperation'](_0x4a459a,_0x1ccce7,_0x147ed3){const _0x49b21e=_0x1ccce7['clone']();for(const _0x4c4883 in _0x1ccce7){const _0x271cff=_0x1ccce7[_0x4c4883];_0x271cff instanceof _0x1f26a0?_0x1ccce7[_0x4c4883]=new _0x1f26a0(_0x2d1d43(_0x271cff['start']),_0x2d1d43(_0x271cff['end'])):_0x271cff instanceof _0x128f8a&&(_0x1ccce7[_0x4c4883]=_0x2d1d43(_0x271cff));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x49b21e['type'])){if(_0x49b21e['isDocumentOperation']=!0x1,_0x49b21e['baseVersion']=null,'remove'==_0x49b21e['type']){const _0x205a3e=_0x49b21e['sourcePosition'],_0x25d521=_0x49b21e['howMany'];new _0x34bf3b(_0x205a3e,_0x25d521)['_execute']();}else _0x49b21e['_execute']();}function _0x2d1d43(_0x2bf3e7){if('$graveyard'==_0x2bf3e7['root']['rootName'])return _0x2bf3e7;const _0x2404bb=[];let _0x290915=_0x2bf3e7['root'];for(let _0xd2b5f4=0x0;_0xd2b5f4<_0x2bf3e7['path']['length'];_0xd2b5f4++){const _0x17636d=_0x4a459a['get'](_0x290915)||0x0;_0x2404bb[_0xd2b5f4]=_0x2bf3e7['path'][_0xd2b5f4]+_0x17636d,_0x290915=_0x290915['getChildAtOffset'](_0x2bf3e7['path'][_0xd2b5f4]);}return new _0x128f8a(_0x147ed3,_0x2404bb,_0x2bf3e7['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x339eec,content:_0x584fb8,version:_0x387528,aiBalloon:_0x2ba1b7}=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'](_0x584fb8,_0x387528,_0x2ba1b7,_0x339eec)['catch'](_0x565a2f=>{this['_isAbortError'](_0x565a2f)||console['error']('Error\x20refreshing\x20interaction:',_0x565a2f);});}['_isAbortError'](_0x17af4b){return!!_0x17af4b['message']&&_0x17af4b['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 _0x4d8d59=this['_interactions']['length'];this['_currentInteractionIndex']<_0x4d8d59-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x36b417){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x36b417;const _0x159c95=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x159c95)return;if(_0x159c95['hasError'])return this['_setErrorState'](_0x159c95),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x159c95['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x5500fa=_0x159c95['replies'][_0x159c95['replies']['length']-0x1];if(_0x5500fa){const _0x3d8e58=this['editor'];try{const _0x5b53ec=f({'editor':_0x3d8e58,'changeGroups':_0x5500fa['changeGroups'],'documentContextContent':_0x5500fa['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0xa37528=>setTimeout(_0xa37528,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x5b53ec[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x2e44bc){this['_isAbortError'](_0x2e44bc)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x2e44bc);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x281c54){const _0x396f59=m(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x396f59),_0x281c54['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],this['_actionsBalloonView']['setErrorState'](),this['_actionsBalloonView']['toggleIsLoading'](!0x0);}['_clearErrorState'](){this['_actionsBalloonView']['hideError'](),this['_actionsBalloonView']['toggleIsLoading'](!0x1);}async['_clearLoadingState'](){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,this['_actionsBalloonView']['setIsLoading'](!0x1);}}class qa extends _0x5adfee{static get['requires'](){return[ki,ji,qi];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3a4160){super(_0x3a4160),_0x3a4160['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class gr extends _0x538d57{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x5ebedd,_0x383cfc){super(_0x5ebedd),this['id']=_0x383cfc,this['set']('status','pending'),this['set']('changeId',_0x383cfc),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',(_0x3ba8f0,_0x3516b8)=>{_0x3516b8&&_0x3516b8['target']&&'A'===_0x3516b8['target']['tagName']&&_0x3516b8['preventDefault'](),this['fire']('activateChange',{'id':_0x383cfc,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x383cfc,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x383cfc,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x1f0b89=new _0x538d57(this['locale']);return _0x1f0b89['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',_0x12bd1a=>!_0x12bd1a)]}}),_0x1f0b89;}['_createAcceptButtonView'](){const _0x5258f0=new _0x3fc85a(this['locale']);return _0x5258f0['set']({'label':m(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x5258f0['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xd7c97f=>{this['fire']('acceptChange',{'id':this['changeId']}),_0xd7c97f['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x3917d4=>'pending'!==_0x3917d4&&'accepted'!==_0x3917d4),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-accept-button',_0x566524=>'pending'===_0x566524),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x23168d=>'accepted'===_0x23168d)]}}),this['on']('change:status',(_0x542bbc,_0x149119,_0x45ced2)=>{_0x5258f0['isEnabled']='pending'===_0x45ced2,'accepted'===_0x45ced2&&(_0x5258f0['label']=m(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x5258f0['icon']=_0x1dd94c);}),_0x5258f0;}['_createDismissButtonView'](){const _0x5110a4=new _0x3fc85a(this['locale']);return _0x5110a4['set']({'label':m(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x5110a4['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x3efd7d=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x3efd7d['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary',this['bindTemplate']['if']('status','ck-hidden',_0x2c8434=>'pending'!==_0x2c8434&&'rejected'!==_0x2c8434),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x12192d=>'pending'===_0x12192d),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x26ff3a=>'rejected'===_0x26ff3a)]}}),this['on']('change:status',(_0xd8090,_0x4cd872,_0x1a5eb9)=>{_0x5110a4['isEnabled']='pending'===_0x1a5eb9,'rejected'===_0x1a5eb9&&(_0x5110a4['label']=m(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x5110a4['icon']=_0x3b3d8d);}),_0x5110a4;}['_createInfoButtonView'](){const _0x4a5454=new _0x3fc85a(this['locale']);return _0x4a5454['set']({'label':m(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'}),_0x4a5454['bind']('isOn')['to'](this,'isInfoToggleOn',_0x5f1e61=>_0x5f1e61),_0x4a5454['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x4a5454;}['_createOutdatedButtonView'](){const _0x1a79c5=new _0x3fc85a(this['locale']);return _0x1a79c5['set']({'label':m(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':_0x35296c,'withText':!0x0,'isEnabled':!0x1}),_0x1a79c5['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x2042fd=>'outdated'!==_0x2042fd)],'disabled':'disabled'}}),_0x1a79c5;}}class ie extends _0x51e059{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0xc66c9,_0x36369e){super(_0xc66c9),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']()),_0x36369e['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x47b196){this['resultItemView']['changeId']=_0x47b196['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x47b196['contentDiffed'];}['showBalloon'](_0x1e4c6c,_0x5d9ef2,_0x10d154,_0x47e4a5,_0x59b154,_0x409048){const _0x4353e8=_0x5d9ef2();if(!_0x4353e8)return;this['updateContent'](_0x1e4c6c),this['show']();const _0x43f54d=Array['from'](_0x4353e8['getClientRects']())['reverse'](),_0x418c85=this['_getPointedRectIndexFromEvent'](_0x10d154,_0x43f54d),_0x33e325=_0x43f54d[_0x418c85??0x0];'click'===_0x47e4a5?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x5d9ef2(),_0x418c85,_0x1e4c6c['id'],_0x59b154,_0x409048)||_0x33e325})):'hover'===_0x47e4a5&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x5d9ef2(),_0x418c85,_0x1e4c6c['id'])||_0x33e325}));}['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'](){_0x23d932({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x33bc4f=[this['element']];return this['_pinnedTargetElement']&&_0x33bc4f['push'](this['_pinnedTargetElement']),_0x33bc4f;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x5b1e70=new _0x538d57();return this['resultItemView']=new gr(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x5b1e70['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']]}]}),_0x5b1e70;}['_getBestRectPositionOnClick'](_0x38726d,_0x375e0a,_0x4028df,_0x4c519b,_0x5c76ee){if(!_0x38726d)return null;const _0x20e2b0=this['position']['replace']('arrow_',''),_0x110607=Array['from'](_0x38726d['getClientRects']());let _0x26c8ee,_0x37802c=_0x110607['reverse']();return void 0x0!==_0x375e0a&&this['_isPinnedRectVisible'](_0x37802c[_0x375e0a],_0x4c519b,_0x5c76ee)?(_0x26c8ee=_0x37802c[_0x375e0a],this['_pinnedRectIndex']=_0x375e0a):this['_isPinnedRectVisible'](_0x37802c[0x0],_0x4c519b,_0x5c76ee)&&void 0x0===_0x375e0a?_0x26c8ee=_0x37802c[0x0]:(_0x37802c='s'==_0x20e2b0[0x0]?[..._0x110607]['reverse']():_0x110607,_0x37802c['forEach'](_0x17ab04=>{this['_isPinnedRectVisible'](_0x17ab04,_0x4c519b,_0x5c76ee)&&(_0x26c8ee=_0x17ab04);})),this['_pinnedTargetChangeId']=_0x4028df,this['_pinnedTargetElement']=_0x38726d,_0x26c8ee||_0x38726d['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x133454,_0x53bf2a,_0x13e3fc){if(!_0x133454)return null;const _0x31509c=Array['from'](_0x133454['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x53bf2a&&this['_pinnedTargetChangeId']!==_0x13e3fc)return this['_pinnedRectIndex']=_0x53bf2a,this['_pinnedTargetElement']=_0x133454,this['_pinnedTargetChangeId']=_0x13e3fc,_0x31509c[_0x53bf2a];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x13e3fc){if(_0x133454!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x31509c[this['_pinnedRectIndex']];}return void 0x0!==_0x53bf2a&&this['_pinnedTargetChangeId']!==_0x13e3fc?(this['_pinnedRectIndex']=_0x53bf2a,this['_pinnedTargetElement']=_0x133454,this['_pinnedTargetChangeId']=_0x13e3fc,_0x31509c[_0x53bf2a]):_0x133454['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x16d48a,_0x1bb617){if(_0x16d48a)for(let _0x59a588=0x0;_0x59a588<_0x1bb617['length'];_0x59a588++){const _0x2b5108=_0x1bb617[_0x59a588];if(_0x16d48a['clientX']>=_0x2b5108['left']-0x3&&_0x16d48a['clientX']<=_0x2b5108['right']+0x3&&_0x16d48a['clientY']>=_0x2b5108['top']-0x3&&_0x16d48a['clientY']<=_0x2b5108['bottom']+0x3)return _0x59a588;}}['_isPinnedRectVisible'](_0x14db2b,_0x39c9b0,_0x4417a9){const _0x8fb9ce=new _0x34633d(_0x14db2b),_0xf7df40=_0x39c9b0||document['documentElement'],_0x2f0fc0=_0x8fb9ce['getIntersection'](_0x2a7169(_0x4417a9)),_0x56aa1e=new _0x34633d(_0xf7df40)['getIntersection'](_0x8fb9ce);return!!(_0x2f0fc0&&_0x56aa1e&&_0x8fb9ce['width']>0x0);}}const sh=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ve extends _0x37abb2{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[H];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x45a10d){super(_0x45a10d),this['_bodyCollection']=new _0x4b2ab0(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...sh)['to'](this),this['_balloonSuggestionView']=new ie(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x26480a=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x26480a);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x18b9d7){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x297014=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x18b9d7,_0x297014);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x50eba8){_0x50eba8&&('error-general'!==_0x50eba8['status']?'error-chunk'!==_0x50eba8['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x2b519c){this['_mainView']['addCheckRunResult'](_0x2b519c);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x27aca4){this['_mainView']['showGeneralReviewCoreErrorView'](_0x27aca4??m(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x3f9e83,_0x230bb3){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x3f9e83,_0x230bb3);}['setActiveStateInResults'](_0x1599b8){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0xcf527e=>{_0xcf527e['id']===_0x1599b8&&_0xcf527e['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x4de126=>_0x4de126['setItemAsInactive']());}['updateChangeState'](_0x4b2979,_0x238c1b){'accepted'===_0x238c1b||'rejected'===_0x238c1b||'outdated'===_0x238c1b?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x4b2979,_0x238c1b):this['_mainView']['reviewCheckResultsView']['showResult'](_0x4b2979,_0x238c1b);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x277827,_0xd909f,_0x2eb2e0,_0x47e5dc,_0x3ced17,_0x89b0f0){this['_balloonSuggestionView']['showBalloon'](_0x277827,_0xd909f,_0x2eb2e0,_0x47e5dc,_0x3ced17,_0x89b0f0);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x36079b){const _0x4af402=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x5a91f4=>_0x5a91f4['id']===_0x36079b);return _0x4af402?_0x4af402['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class hh extends _0x538d57{constructor(_0x275f0e){super(_0x275f0e),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x1f1876=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x1f1876['if']('isVisible','ck-hidden',_0x4d1de6=>!_0x4d1de6)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x1f1876['to']('errorMessage')}]}]});}}class _e extends _0x538d57{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x24df5c,_0x112709){super(_0x24df5c),this['reviewCoreHeader']=_0x112709['header'],this['generalErrorView']=new hh(_0x24df5c),this['reviewCheckListView']=_0x112709['list'],this['reviewCheckListView']['delegate'](...sh)['to'](this),this['reviewCheckResultsView']=_0x112709['results'],this['reviewCheckResultsView']['delegate'](...sh)['to'](this),this['reviewCompletedView']=_0x112709['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'](_0x52f2a2){this['reviewCheckResultsView']['addResult'](_0x52f2a2),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'](_0x34d44a){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x34d44a;}['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 _0x3fc85a{constructor(_0x4157aa,_0x346073){super(_0x346073),this['set']({'label':_0x4157aa,'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class Ie extends _0x5749b5{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x2aa6c2,_0x504454){super(_0x2aa6c2),this['_contents']=_0x504454,this['_resultViews']=new _0x4f2c93(),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(_0x2aa6c2),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 _0x782040=this['_createCombinedSkeletonLoader'](),_0x1132e5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x1132e5['if']('isLoading','ck-ai_review__check-run_loading',_0x1fb916=>_0x1fb916),_0x1132e5['if']('isResultReady','ck-ai_review__check-run_ready',_0x1731a0=>_0x1731a0),_0x1132e5['if']('isVisible','ck-hidden',_0xea1ab2=>!_0xea1ab2)]},'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',_0x27b79d=>_0x27b79d)]},'children':this['_resultViews']},_0x782040]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x74b542){const _0x240f7b=new gr(this['locale'],_0x74b542['id']);_0x240f7b['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x240f7b),_0x240f7b['resultResponseView']['element']['innerHTML']=_0x74b542['contentDiffed'];}['hideResult'](_0x4323a5,_0x20d7d8){if('pending'===_0x20d7d8)return;const _0x4d2abc=this['_resultViews']['find'](_0x3b18f=>_0x3b18f['id']===_0x4323a5);_0x4d2abc&&(_0x4d2abc['status']=_0x20d7d8,_0x4d2abc['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x41ca0d,_0x58b16c){if('pending'!==_0x58b16c)return;const _0x45f72b=this['_resultViews']['find'](_0x48d491=>_0x48d491['id']===_0x41ca0d);_0x45f72b&&(_0x45f72b['status']=_0x58b16c,_0x45f72b['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x5db304,_0x312ff0){this['headerTitle']=_0x5db304,this['headerSubtitle']=_0x312ff0||'';}['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 Oe(this['locale'],Be['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x43ac63=new _0x538d57(this['locale']),_0x16528b=[];for(let _0x3a84e5=0x0;_0x3a84e5<0x10;_0x3a84e5++){const _0x741eda=this['_createSkeletonLoader']();_0x741eda['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x16528b['push'](_0x741eda);}return _0x43ac63['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x3afaa0=>!_0x3afaa0)]},'children':_0x16528b}),_0x43ac63;}['_createErrorView'](){const _0x129126=new _0x538d57(this['locale']),_0x424a13=new _0x3fc85a(this['locale']),t=this['locale']['t'];return _0x129126['delegate']('retryReview')['to'](this),_0x424a13['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai_review__check-run-error-retry-button'}),_0x424a13['on']('execute',()=>{this['fire']('retryReview');}),_0x129126['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x49b438=>!_0x49b438),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x1dba94=>'chunk'===_0x1dba94)]},'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',_0x3ddf63=>'chunk'===_0x3ddf63)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x3197e4=>'general'!==_0x3197e4)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x459243=>'chunk'!==_0x459243)]},'children':[{'text':m(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x424a13]}),_0x129126;}['_createCancelButtonView'](){const _0x361dd8=new _0x3fc85a(this['locale']);return _0x361dd8['set']({'label':m(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x30c4f4}),_0x361dd8['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x16735f=>_0x16735f),this['bindTemplate']['if']('isCompleted','ck-hidden',_0xf8b68b=>_0xf8b68b)]}}),_0x361dd8['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x361dd8;}['_createToggleDiffButtonView'](){const _0x58ec0c=new _0x3fc85a(this['locale']);_0x58ec0c['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x58ec0c['bind']('isEnabled')['to'](this,'isError',_0x1dad08=>!_0x1dad08),_0x58ec0c['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x54be84=>!_0x54be84),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5e6e94=>_0x5e6e94)]}});const _0x2fe8c0=m(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x3a852d=m(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x58ec0c['bind']('isOn')['to'](this,'isToggleDiffOn',_0x4e4343=>_0x4e4343),_0x58ec0c['bind']('icon')['to'](this,'isToggleDiffOn',_0x4ed9a3=>_0x4ed9a3?_0x1ef78b:_0x4d2895),_0x58ec0c['bind']('label')['to'](this,'isToggleDiffOn',_0x330af3=>_0x330af3?_0x2fe8c0:_0x3a852d),_0x58ec0c['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x58ec0c;}['_createAcceptAllButtonView'](){const _0x2d8450=new _0x3fc85a(this['locale']);return _0x2d8450['set']({'label':m(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x2d8450['bind']('isEnabled')['to'](this,'isError',_0x8bf1c0=>!_0x8bf1c0),_0x2d8450['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x56725c=>!_0x56725c),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2d6784=>_0x2d6784)]}}),_0x2d8450['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x2d8450;}['_createExitReviewButtonView'](){const _0x96c46b=new _0x3fc85a(this['locale']);return _0x96c46b['set']({'label':m(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x96c46b['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary','ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x52a88f=>!_0x52a88f),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5e338d=>_0x5e338d)]}}),_0x96c46b['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x96c46b;}['_createResultHeaderView'](){const _0x5e93d1=new _0x538d57(this['locale']),_0x4cf600=this['_createTitleView']();return _0x5e93d1['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x539d63=>_0x539d63)]},'children':[_0x4cf600,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x5e93d1;}['_createTitleView'](){const _0x138af4=new _0x538d57(this['locale']),_0x3ca3bb=new De();return _0x3ca3bb['bind']('isVisible')['to'](this,'isResultReady',_0x20a3cb=>!_0x20a3cb),_0x138af4['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x3ca3bb,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x34d349=>_0x34d349)]},'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',_0x5cacce=>!_0x5cacce)]},'children':[{'text':m(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x138af4;}['_createFinishReviewButtonView'](){const _0x166945=new _r(m(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x166945['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0xe784ae=>!_0xe784ae)]}}),_0x166945['delegate']('finishReview')['to'](this),_0x166945;}}class Re extends _0x5749b5{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x593c58,_0x1766c2){super(_0x593c58),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x1766c2['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x1766c2['headerText']);const _0x25d732=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x25d732['if']('isVisible','ck-hidden',_0x3f9563=>!_0x3f9563)]},'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':_0x1766c2['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x50bb9e){const _0xc49142=new _r(_0x50bb9e,this['locale']);return _0xc49142['delegate']('finishReview')['to'](this),_0xc49142;}['_createResultHeaderView'](_0x15ed0b){const _0x45de27=new _0x538d57(this['locale']);return _0x45de27['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':_0x15ed0b}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x45de27;}}class Dr extends _0x538d57{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x5047c0,_0x3db68e){super(_0x5047c0),this['_defaultValue']=_0x3db68e['default']||(_0x3db68e['data']['length']>0x0?_0x3db68e['data'][0x0]['id']:''),this['_defaultLabel']=_0x3db68e['data']['find'](_0x1e3cde=>_0x1e3cde['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x238494(this['locale']);const _0x550ef1=this['_prepareListOptions'](_0x3db68e['data']);_0x57d60a(this['_dropdownView'],_0x550ef1,{'role':'menu','ariaLabel':_0x3db68e['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1e0c6d=>{_0x1e0c6d['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x16186b=>{this['formValue']=_0x16186b['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x16186b['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'](_0x2ac653=[]){const _0x2a9754=new _0x53af97();this['resetToDefault']();for(const _0x2cd7d6 of _0x2ac653){const _0x14b127=new _0x584377({'label':_0x2cd7d6['label'],'withText':!0x0,'role':'menuitemradio','id':_0x2cd7d6['id'],'model':_0x2cd7d6});_0x14b127['bind']('isOn')['to'](this,'formValue',_0x48e3d4=>_0x48e3d4===_0x14b127['id']);const _0x2e2bb2={'type':'button','model':_0x14b127};_0x2a9754['add'](_0x2e2bb2);}return _0x2a9754;}}class cc extends _0x5749b5{['_formItem']=null;constructor(_0x59893f,_0x221d85,_0xb9c5ce){super(_0x59893f),this['argsKey']=_0x221d85?.['argsKey'];if('dropdown'===_0x221d85['formType'])this['_formItem']=new Dr(this['locale'],_0x221d85);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x4634e6=new _0x553dac(this['locale'],{'children':[this['_formItem']],'class':[_0xb9c5ce?'ck-form__row_with-submit':'']});_0xb9c5ce&&_0x4634e6['children']['add'](_0xb9c5ce),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x4634e6]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class po extends _0x170ffb{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x45ec71){super(_0x45ec71),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x356454(),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 _0x538d57{['focusTracker']=new ts();['keystrokes']=new _0x356454();['focusCycler'];['_focusables']=new _0x4f2c93();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x2bd465,_0x4903b2,_0x55945d=!0x1){super(_0x2bd465),this['_check']=_0x4903b2,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x4903b2['defaultModel']?_0x4903b2['defaultModel']['id']:'',this['_defaultLabel']=_0x4903b2['defaultModel']?_0x4903b2['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x449567(this['locale'],()=>new po(_0x2bd465)),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 _0x53af97(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x55945d),_0x57d60a(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x553dac(this['locale'],{'children':[this['promptInputView']]}),new _0x553dac(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x5d3ad2,_0x479b51)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x479b51()):_0x479b51();}),this['focusCycler']=new _0x19c87e({'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'](_0x2898e6=>{this['_focusables']['add'](_0x2898e6),this['focusTracker']['add'](_0x2898e6['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 _0x2d2f0a of this['_getFormValidators']()){const _0x5d88ea=_0x2d2f0a();if(_0x5d88ea)return this['promptInputView']['errorText']=_0x5d88ea,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return m(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0xe14253=new _0x3fc85a(this['locale']),t=this['locale']['t'];return _0xe14253['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0xe14253['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0xe14253;}['_createCancelButtonView'](){const _0x3be857=new _0x3fc85a(this['locale']),t=this['locale']['t'];return _0x3be857['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary'}),_0x3be857['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x15d458=>{_0x15d458['stopPropagation']();})}}),_0x3be857['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x3be857;}['_setModelList'](_0x110164){this['_modelSelectionDropdownItems']['clear']();const _0x27ebdf=this['_check']['models'];if(_0x110164)this['set']('modelDisplayMode','hidden');else{const _0x5ce43b=0x1===_0x27ebdf['length'];this['set']('modelDisplayMode',_0x5ce43b?'name':'selector');}if(this['resetToDefault'](),_0x27ebdf?.['length']){0x1===_0x27ebdf['length']&&this['set']('activeModelName',_0x27ebdf[0x0]['name']||_0x27ebdf[0x0]['id']);for(const _0x1380ee of _0x27ebdf){const _0x1cada1=new _0x584377({'label':_0x1380ee['name'],'withText':!0x0,'role':'menuitemradio','id':_0x1380ee['id'],'model':_0x1380ee});_0x1cada1['bind']('isOn')['to'](this,'modelId',_0x523f2c=>_0x523f2c===_0x1380ee['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x1cada1,'labelView':new ko(this['locale'],_0x1380ee)});}}}['_createModelSelectionDropdown'](){const _0x239216=_0x238494(this['locale']);return _0x239216['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x239216['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),_0x239216['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x5c4dc5=>'selector'===_0x5c4dc5),this['listenTo'](_0x239216,'execute',_0x148c77=>{this['modelId']=_0x148c77['source']['model']['id'],_0x239216['buttonView']['label']=_0x148c77['source']['label'];}),_0x239216;}['_createModelNameView'](){const _0x2befb2=new _o(this['locale']);return _0x2befb2['bind']('text')['to'](this,'activeModelName',_0xe699e5=>_0xe699e5??''),_0x2befb2['bind']('isVisible')['to'](this,'modelDisplayMode',_0x45d4fb=>'name'===_0x45d4fb),_0x2befb2;}['_createActionsFooterView'](){const _0x511efc=new _0x538d57(this['locale']);return _0x511efc['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']]}]}),_0x511efc;}}class _o extends _0x538d57{constructor(_0x567f5b){super(_0x567f5b),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x52d66f=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x52d66f['if']('isVisible','ck-hidden',_0x13f700=>!_0x13f700)]},'children':[{'text':_0x52d66f['to']('text')}]});}}class ko extends _0x3ffbe5{constructor(_0x5446cb,_0x3bb36c){super();const _0x355e3e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x355e3e['to']('style'),'id':_0x355e3e['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x355e3e['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x3bb36c['description']||'']}]}]});}}class ic extends _0x5749b5{['_formItemsCollection']=new _0x4f2c93();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x25421f,_0x7c4361,_0x14b23c,_0x579178=!0x1){super(_0x25421f),this['_hideModels']=_0x579178,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x7c4361['isParameterized']);const _0x2b164f=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',_0x5530be=>_0x5530be),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x49db88=>_0x49db88)],'style':{'--ck-ai-review-check-list-item-index':_0x14b23c}},'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':_0x7c4361['title']}]},_0x2b164f]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x7c4361['description']?[{'text':_0x7c4361['description']}]:[]}]}]},..._0x7c4361['isParameterized']?[this['_createParameterizedView'](_0x7c4361)]:[],...'custom'===_0x7c4361['id']?[this['_createCustomView'](_0x7c4361,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x7c4361['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x7c4361['id'],'args':_0x7c4361['useArgs']?_0x7c4361['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x23d932({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x1352f6=>{_0x1352f6['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x24dda7=new _0x1a5580();return _0x24dda7['content']=_0x1ee0fb,_0x24dda7['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x24dda7;}['_createParameterizedView'](_0x4a7d77){const _0x5b351b=new _0x538d57(),_0x33a177=this['_createFormView'](_0x4a7d77);return _0x5b351b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x593245=>!_0x593245)]},'children':[_0x33a177]}),_0x5b351b;}['_createFormView'](_0x46ed65){const _0x1662d8=new _0x538d57(),_0x154c3d=Array['isArray'](_0x46ed65['options'])?_0x46ed65['options']:[],_0x28ffda=new _0x3fc85a(this['locale']),t=this['locale']['t'];_0x28ffda['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x28ffda['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x7972aa=>{_0x7972aa['stopPropagation']();})}}),_0x28ffda['on']('execute',()=>{const _0x53d36c=[],_0x132687={};this['_formItemsCollection']['forEach'](_0x22e7de=>{_0x53d36c['push'](_0x22e7de['value']),_0x46ed65['useArgs']&&_0x46ed65['options']&&(_0x132687[_0x22e7de['argsKey']]=_0x22e7de['value']);}),this['fire']('runReviewCheck',{'id':_0x46ed65['id'],'params':_0x53d36c['length']?_0x53d36c:void 0x0,'args':Object['keys'](_0x132687)['length']?_0x132687:void 0x0});});const _0x5c3549=_0x154c3d['length'];return _0x154c3d['forEach']((_0x5f4823,_0x1e1320)=>{const _0x28403b=_0x1e1320===_0x5c3549-0x1;this['_formItemsCollection']['add'](new cc(this['locale'],_0x5f4823,_0x28403b?_0x28ffda:null));}),_0x1662d8['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x1662d8;}['_createCustomView'](_0x573158,_0x40d65d=!0x1){return this['_customCheckView']=new rc(this['locale'],_0x573158,_0x40d65d),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',_0x330a61=>!_0x330a61)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0xdc68d5,_0x62d0e4,_0x47ec49)=>{_0x47ec49||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class Te extends _0x5749b5{['_checkViews'];constructor(_0xb0a8bb){super(_0xb0a8bb),this['_checkViews']=new _0x4f2c93(),this['_setupTemplate']();}['setChecks'](_0x30b78a,_0x581a59=!0x1){this['_checkViews']['clear']();for(const [_0x460e68,_0x164ea4]of _0x30b78a['entries']()){const _0xa8b801=new ic(this['locale'],_0x164ea4,_0x460e68,_0x581a59);_0xa8b801['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0xa8b801);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x54b869 of this['_checkViews'])_0x54b869 instanceof ic&&_0x54b869['resetToDefault']();}['_setupTemplate'](){const _0x2fe14e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x2fe14e['if']('isVisible','ck-hidden',_0x1032a3=>!_0x1032a3)]},'children':this['_checkViews']});}}class re extends ve{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x3afda5=this['context']['locale'],_0x3de463=new _0x2c8dbc(_0x3afda5,{'label':m(_0x3afda5,'AI_REVIEW_MODE'),'icon':_0x3867f9,'class':'ck-ai-header\x20ck-ai-header_review'});return new _e(this['context']['locale'],{'header':_0x3de463,'list':new Te(_0x3afda5),'results':new Ie(_0x3afda5,{'generalErrorText':m(_0x3afda5,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new Re(_0x3afda5,{'headerText':m(_0x3afda5,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':m(_0x3afda5,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':m(_0x3afda5,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x277ac2=this['context']['plugins']['get']('AITabs');_0x277ac2['view']['on']('activateTab',(_0x439611,_0x490a07)=>{'reviewMode'===_0x490a07?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x277ac2['view']['addTab']({'id':'reviewMode','buttonLabel':m(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x3867f9,'order':0x0,'content':this['_mainView']});}}const Lt='review-';class oe extends _0x37abb2{static get['requires'](){return[_0x4f58a6,o];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];constructor(_0x3974d6){super(_0x3974d6),this['_domEmitter']=new(Rt())(),this['_eventEmitter']=new(Ft())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x5d2453=D(this['context']);_0x5d2453['conversion']['for']('editingDowncast')['markerToElement']({'model':Lt+'insert','view':(_0x177c1e,{writer:_0x4cb6e8})=>{const _0x13c7ba=this['_markers']['get'](_0x177c1e['markerName']),_0x43584d={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x13c7ba?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x177c1e['markerName']};return _0x4cb6e8['createUIElement']('span',_0x43584d,function(_0x2de50c){const _0xf21fe5=this['toDomElement'](_0x2de50c);return _0xf21fe5['innerHTML']=_0x13c7ba?.['content']?.['asString']||'',_0xf21fe5;});}}),_0x5d2453['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Lt+'remove-only','view':_0x19dadc=>{const _0x104965=this['_markers']['get'](_0x19dadc['markerName']),_0x441ea6=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x104965?.['id']||'')&&_0x441ea6['push']('ck-ai_review__change_active'),{'classes':_0x441ea6,'attributes':{'data-marker-id':_0x19dadc['markerName']}};}}),_0x5d2453['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Lt+'remove-context','view':_0x158270=>{const _0x114d90=this['_markers']['get'](_0x158270['markerName']),_0x426da6=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x114d90?.['id']||'')&&_0x426da6['push']('ck-ai_review__change_active'),{'classes':_0x426da6,'attributes':{'data-marker-id':_0x158270['markerName']}};}}),_0x5d2453['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Lt+'remove-text','view':_0x23bb56=>{const _0x2d5ab3=this['_markers']['get'](_0x23bb56['markerName']),_0x40311e=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x2d5ab3?.['id']||'')&&_0x40311e['push']('ck-ai_review__change_active'),{'classes':_0x40311e,'attributes':{'data-marker-id':_0x23bb56['markerName']}};}}),_0x5d2453['conversion']['for']('dataDowncast')['markerToElement']({'model':Lt+'suggestion-context','view':(_0x280b4d,{writer:_0x3b69e0})=>_0x3b69e0['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x280b4d['isOpening']?'start':'end')})}),_0x5d2453['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x1707b9,'view':Bt});const _0xa58405=_0x5d2453['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0xa58405,'mouseup',(_0x17fa7b,_0x192d7b)=>{const _0x288176=_0x192d7b['target'],_0x1bee80=this['_findMarkerElement'](_0x288176);if(!_0x1bee80)return;const _0x447cc7=_0x1bee80['getAttribute']('data-marker-id'),_0x5ae183=_0x447cc7['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x447cc7,'changeId':_0x5ae183,'markerElement':()=>this['_findMarkerElementById'](_0x447cc7),'domEvent':_0x192d7b});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0xa58405,'mouseover',(_0x20a931,_0x1509fd)=>{const _0x289bf7=_0x1509fd['target'],_0x3a1b91=_0x1509fd['relatedTarget'];let _0x47e10c=this['_findMarkerElement'](_0x289bf7);if(!_0x47e10c&&_0x3a1b91&&(_0x47e10c=this['_findMarkerElement'](_0x3a1b91)),!_0x47e10c)return;const _0x371ef3=_0x47e10c['getAttribute']('data-marker-id'),_0xbfc7fc=_0x371ef3['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0xbfc7fc,'markerElement':()=>this['_findMarkerElementById'](_0x371ef3),'domEvent':_0x1509fd});}),this['_domEmitter']['listenTo'](document,'mouseover',Ht((_0x3a09a4,_0x5f1c76)=>{const _0x99ce68=_0x5f1c76['target'];if(this['_findMarkerElement'](_0x99ce68))return;_0x99ce68['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x5d2453['model']['document']['registerPostFixer'](_0x429e3b=>this['_validateMarkers'](_0x5d2453,_0x429e3b)),_0x5d2453['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x5d2453));}['getDocumentData'](){const _0x433dea=this['context']['plugins']['get']('AIEditing'),_0x3d94de=D(this['context']),_0x472738=_0x3d94de['model'],_0x2dc99a=new _0x27a70e();for(const _0x30e8bb of _0x472738['document']['getRoot']()['getChildren']()){const _0x346f60=_0x30e8bb['_clone'](!0x0);_0x2dc99a['_appendChild'](_0x346f60);}for(const _0x558be3 of _0x472738['markers'])_0x2dc99a['markers']['set'](_0x558be3['name'],this['_changeRangeOwnerDocument'](_0x558be3['getRange']()['clone'](),_0x2dc99a));const _0x4cc2db=new Dt({'ignoreElementEnd':!0x0,'startPosition':_0x472738['createPositionAt'](_0x2dc99a,0x0)}),_0x3efddc=new Set(),_0x4b1bd7=new Map();for(const {item:_0x657f80}of _0x4cc2db){if(!_0x657f80['is']('$textProxy'))continue;const _0x38000f=_0x657f80['parent'];if(_0x38000f&&_0x38000f['is']('element')){const _0x23e67f=this['_upsertDataId'](_0x38000f,()=>_0x433dea['_nextDataId'](_0x3efddc));_0x3efddc['add'](_0x23e67f);for(const _0x541607 of _0x38000f['getChildren']())_0x541607['is']('element')&&_0x3efddc['add'](this['_upsertDataId'](_0x541607,()=>_0x433dea['_nextDataId'](_0x3efddc)));let _0x2d1465=_0x38000f;for(;_0x2d1465['parent']&&!_0x2d1465['parent']['is']('documentFragment');)_0x2d1465=_0x2d1465['parent'],_0x2d1465['hasAttribute'](_0x1707b9)&&_0x2d1465['_removeAttribute'](_0x1707b9);_0x4b1bd7['set'](_0x23e67f,{'path':_0x38000f['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x2d1465['_clone'](!0x0),_0x23e67f,_0x3d94de['data'])}),_0x4cc2db['jumpTo'](_0x472738['createPositionAfter'](_0x38000f));}}return{'content':_0x3d94de['data']['processor']['toData'](_0x3d94de['data']['toView'](_0x2dc99a)),'version':_0x3d94de['model']['document']['version'],'elements':_0x4b1bd7};}['diffContent'](_0x28f3df,_0x3eb4e7,_0x45bb5d=!0x1){const _0x59fe05=[],_0x3a0b9e=D(this['context']),_0x349dea=_0x3a0b9e['data']['parse'](_0x3eb4e7,'$documentFragment'),_0x5c5fdc=_0x3a0b9e['data']['parse'](_0x28f3df,'$documentFragment'),_0x406010=_0x3a0b9e['model']['createPositionAt'](_0x5c5fdc,0x0);if(this['_haveSingleTopLevelElement'](_0x349dea)){if(!this['_hasSameTopLevelElement'](_0x5c5fdc,_0x349dea))return _0x59fe05;}else{const _0x31882b=_0x3a0b9e['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x5c5fdc,_0x31882b)||!this['_haveOnlyInlineContent'](_0x349dea,_0x31882b))return _0x59fe05;}const _0x3e5321=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x28f3df,_0x3eb4e7,{'anchor':_0x406010,'markDeletions':!0x0})['getOperations']()['filter'](_0x124c46=>'insert'===_0x124c46['type']||'marker'===_0x124c46['type']&&_0x124c46['name']['startsWith']('$markedRemove')),_0x3fd1f9=this['_groupAdjacentOperations'](_0x3e5321),_0x533a11=[];if(_0x45bb5d){if(_0x3fd1f9['length']){const _0x9f2145=_0x3fd1f9[0x0]['operations'][0x0],_0x396abe='insert'===_0x9f2145['type']?_0x9f2145['position']:_0x9f2145['newRange']['start'],_0x1dd3cf=this['_getPositionLimitingRange'](_0x396abe,_0x3a0b9e,'inside'),_0x43d702=_0x1dd3cf?_0x349dea['getChild'](0x0)['getChildren']():_0x349dea['getChildren'](),_0x296f5a=_0x1dd3cf||_0x3a0b9e['model']['createRangeIn'](_0x5c5fdc),_0x534804=[new Mt('$markedRemove:synthetic'+_0x3e4e8c(),null,_0x296f5a,_0x3a0b9e['model']['document']['model']['markers'],!0x0,_0x3a0b9e['model']['document']['version']+0x1),new $t(_0x296f5a['end'],_0x43d702,_0x3a0b9e['model']['document']['version']+0x2)];_0x533a11['push']({'operations':_0x534804,'operationsIsolated':_0x534804,'groupOffset':0x0});}}else _0x533a11['push'](..._0x3fd1f9);let _0x513be7=0x0;return _0x3a0b9e['model']['change'](_0x4e73f7=>{for(let _0xe8bd7f=0x0;_0xe8bd7f<_0x533a11['length'];_0xe8bd7f++){const _0x29c86e=_0x533a11[_0xe8bd7f],_0xf91dc=_0x4e73f7['createDocumentFragment']();for(const _0x511aff of _0x5c5fdc['getChildren']())_0x4e73f7['append'](_0x511aff['_clone'](!0x0),_0xf91dc);for(const _0x3e296e of _0x29c86e['operationsIsolated'])if('insert'===_0x3e296e['type']){const _0x234321=_0x3e296e;_0x234321['baseVersion']=null,_0x234321['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x234321,_0xf91dc),_0x4e73f7['batch']['addOperation'](_0x3e296e),_0x3a0b9e['model']['applyOperation'](_0x3e296e);const _0x1686d8='suggestion:insertion:id:authorId:'+_0x513be7++,_0x1bbb08=_0x3a0b9e['model']['createRange'](_0x234321['position'],_0x234321['position']['getShiftedBy'](_0x234321['howMany']));_0xf91dc['markers']['set'](_0x1686d8,_0x1bbb08);}else{if('marker'===_0x3e296e['type']&&_0x3e296e['name']['startsWith']('$markedRemove')){const _0x1c6750=_0x3e296e,_0x1f289d='suggestion:deletion:id:authorId:'+_0x513be7++;this['_changeOperationOwnerDocument'](_0x1c6750,_0xf91dc),_0xf91dc['markers']['set'](_0x1f289d,_0x1c6750['newRange']);}}if(_0x45bb5d)_0x59fe05['push']({..._0x29c86e,'context':this['_createGetContentFn'](_0x5c5fdc,_0x3a0b9e['data']),'content':this['_createGetContentFn'](_0x5c5fdc,_0x3a0b9e['data'])});else{const _0x1064bd=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x29c86e['operationsIsolated'][0x0]),_0xf91dc),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x29c86e['operationsIsolated'][_0x29c86e['operationsIsolated']['length']-0x1]),_0xf91dc));_0xf91dc['markers']['set'](Lt+'suggestion-context',new _0x1f26a0(_0x1064bd['start'],_0x1064bd['end'])),_0x59fe05['push']({..._0x29c86e,'context':this['_createGetContextFn'](_0xf91dc,_0x3a0b9e['data'],{'ellipsisBefore':_0x1064bd['hasContentBefore'],'ellipsisAfter':_0x1064bd['hasContentAfter']}),'content':this['_createGetContentFn'](_0xf91dc,_0x3a0b9e['data'])});}}}),_0x59fe05;}['markChangePositionInEditorContent'](_0x2e6bec,_0x33bae3){if(!_0x2e6bec['length'])return;const _0x125d1e=_0x2e6bec[0x0]['parent']['id'],_0x58ca33=_0x33bae3['elements']['get'](_0x125d1e);if(!_0x58ca33)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x125d1e);const _0x271b66=_0x58ca33['path'],_0x4b47a8=D(this['context']),_0x480eff=_0x4b47a8['model']['document']['history']['getOperations'](_0x33bae3['version']),_0x2bf80c=[];for(const _0x35ac39 of _0x2e6bec){const _0x592f3e=_0x35ac39['operationsIsolated']['map'](_0x1ac51e=>this['_translateOperationToEditorContent'](_0x1ac51e,_0x271b66,_0x4b47a8['model']['document']['getRoots']()[0x0]));if(!_0x592f3e||!_0x592f3e['length'])continue;const _0xe636e8=_0x592f3e['every'](_0x12684e=>'marker'===_0x12684e['type']&&_0x12684e['name']['startsWith']('$markedRemove')),_0x2a4301={'document':_0x4b47a8['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x41af29=_0x104b8e(_0x592f3e,_0x480eff,_0x2a4301)['operationsA'];for(const _0x276a79 of _0x41af29)if('insert'===_0x276a79['type']){const _0x3cde27=_0x276a79,_0x1637f3=_0x3cde27['nodes'];_0x4b47a8['model']['change'](_0x3fad53=>{const _0x41a664=_0x3fad53['createDocumentFragment']();for(const _0x1b0d40 of _0x1637f3)_0x3fad53['append'](_0x1b0d40['_clone'](!0x0),_0x41a664);_0x2bf80c['push']({'start':_0x3cde27['position'],'end':_0x3cde27['position'],'type':'insert','groupId':_0x35ac39['id'],'content':{'asString':this['_createGetContentFn'](_0x41a664,_0x4b47a8['data'])(),'asFragment':_0x41a664}});});}else{if('marker'===_0x276a79['type']&&_0x276a79['name']['startsWith']('$markedRemove')){const _0x32697f=_0x276a79;let _0x4b87c0='remove-text';if(_0xe636e8){const _0x2a65c8=this['_findAdjacentContextDistance'](_0x32697f['newRange']['start'],'backward',_0x4b47a8['model']['schema']),_0x125cdb=this['_findAdjacentContextDistance'](_0x32697f['newRange']['end'],'forward',_0x4b47a8['model']['schema']);if(_0x2a65c8||_0x125cdb){const _0x2e0a9c=_0x32697f['newRange']['start']['getShiftedBy'](-_0x2a65c8),_0x7c348f=_0x32697f['newRange']['end']['getShiftedBy'](_0x125cdb);_0x2bf80c['push']({'start':_0x2e0a9c,'end':_0x7c348f,'groupId':_0x35ac39['id'],'type':'remove-context'});}else _0x4b87c0='remove-only';}_0x2bf80c['push']({'start':_0x32697f['newRange']['start'],'end':_0x32697f['newRange']['end'],'groupId':_0x35ac39['id'],'type':_0x4b87c0});}}}this['_insertMarkers'](_0x2bf80c);}['clearAllMarkers'](){const _0x4b475e=D(this['context']);_0x4b475e['model']['change'](_0x4c906f=>{for(const _0x33e3e4 of this['_markers']['keys']())_0x4b475e['model']['markers']['get'](_0x33e3e4)&&_0x4c906f['removeMarker'](_0x33e3e4);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){D(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){D(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x4665e4){const _0x2e9fa3=D(this['context']),_0x58949d=_0x2e9fa3['model'],_0x37e88a=_0x4665e4['map'](_0x4d2921=>this['_getMarkersDataForGroup'](_0x4d2921))['flat']();_0x58949d['change'](_0x4433e5=>{for(const _0x370c91 of _0x37e88a){const _0x16832d=_0x2e9fa3['model']['markers']['get'](_0x370c91['id']);if(_0x16832d){if('insert'===_0x370c91['type']){if(!_0x370c91['content'])continue;_0x58949d['insertContent'](_0x370c91['content']['asFragment']||null,_0x16832d['getRange']()['start']);}else'remove-text'!==_0x370c91['type']&&'remove-only'!==_0x370c91['type']||_0x58949d['deleteContent'](_0x58949d['createSelection'](_0x16832d['getRange']()));_0x4433e5['removeMarker'](_0x370c91['id']),this['_markers']['delete'](_0x370c91['id']);}}});}['rejectChange'](_0x1a1aca){const _0x5d3f13=D(this['context']),_0x1c1010=this['_getMarkersDataForGroup'](_0x1a1aca);_0x5d3f13['model']['change'](_0x55d315=>{for(const _0x5a6e02 of _0x1c1010)_0x55d315['removeMarker'](_0x5a6e02['id']),this['_markers']['delete'](_0x5a6e02['id']);});}['getEditor'](){return D(this['context']);}['getMarkerElementForChange'](_0x121454){const _0x58fd97=Array['from'](this['_markers']['values']())['filter'](_0x5b9cc1=>_0x5b9cc1['groupId']===_0x121454);if(!_0x58fd97['length'])return null;const _0x5a02ae=0x1===_0x58fd97['length']?_0x58fd97[0x0]:this['_sortMarkers'](_0x58fd97)[0x0],_0x1ae595=D(this['context'])['model']['markers']['get'](_0x5a02ae['id']);if(!_0x1ae595)return null;return{'modelRange':_0x1ae595['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x5a02ae['id'])};}['getContentElementForChange'](_0xc0056b){const _0x351d69=Array['from'](this['_markers']['values']())['filter'](_0x106c23=>_0x106c23['groupId']===_0xc0056b);if(!_0x351d69['length'])return null;const _0x1e89bc=0x1===_0x351d69['length']?_0x351d69[0x0]:this['_sortMarkers'](_0x351d69)[0x0],_0x297d8e=D(this['context']),_0x57d59f=_0x297d8e['model']['markers']['get'](_0x1e89bc['id']);if(!_0x57d59f)return null;const _0x527715=_0x57d59f['getRange'](),_0x11ed22=_0x297d8e['editing']['view']['getDomRoot']();if(!_0x11ed22||!_0x527715)return null;let _0x4988bb=_0x527715['start']['parent'];for(;_0x4988bb['parent']&&'$root'!==_0x4988bb['parent']['name'];)_0x4988bb=_0x4988bb['parent'];if(!_0x4988bb||!_0x4988bb['name'])return null;const _0x5a5605=_0x11ed22['querySelector']('[data-marker-id=\x22'+_0x1e89bc['id']+'\x22]');if(!_0x5a5605)return null;let _0x4aca36=null;_0x297d8e['model']['change'](_0xb16ef3=>{_0x4aca36=_0xb16ef3['createDocumentFragment'](),_0xb16ef3['append'](_0x4988bb['_clone'](!0x0),_0x4aca36);});const _0x91cd6c=_0x297d8e['data']['toView'](_0x4aca36)['getChild'](0x0);return _0x5a5605['closest'](_0x91cd6c['name']);}['reactivateMarkers'](_0x35d5ac){const _0x19cb36=this['_getMarkersDataForGroup'](_0x35d5ac);if(!_0x19cb36['length'])return;const _0x3436ac=Array['from'](this['_activeMarkers'])['sort'](),_0x39c718=Array['from'](new Set(_0x19cb36['map'](_0x433b01=>_0x433b01['id'])))['sort']();_0x3436ac['join']('|')!==_0x39c718['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x35d5ac));}['setMarkersInElementAsActive'](_0x43d5e7){const _0x3c13b0=this['_getMarkersDataForGroup'](_0x43d5e7);if(!_0x3c13b0['length'])return;const _0x5cf5d6=D(this['context']),_0x544df8=new Set(_0x3c13b0['map'](_0x16ff71=>_0x16ff71['id'])),_0x4356cb=Array['from'](_0x544df8['values']())['map'](_0x46f4e5=>_0x5cf5d6['model']['markers']['get'](_0x46f4e5))['filter'](_0x161f37=>!!_0x161f37);_0x544df8['forEach'](_0x340223=>{this['_activeMarkers']['add'](_0x340223);}),_0x5cf5d6['model']['change'](()=>{_0x4356cb['forEach'](_0x1d9db0=>{_0x5cf5d6['editing']['reconvertMarker'](_0x1d9db0);});});}['setAllMarkersAsInactive'](){const _0x4a9674=Array['from'](this['_activeMarkers']);if(!_0x4a9674['length'])return;this['_activeMarkers']['clear']();const _0x5d9201=D(this['context']),_0x19f0a1=_0x4a9674['map'](_0x4eb25b=>_0x5d9201['model']['markers']['get'](_0x4eb25b))['filter'](_0x459d3d=>!!_0x459d3d);_0x5d9201['model']['change'](()=>{_0x19f0a1['forEach'](_0x33afcc=>{_0x5d9201['editing']['reconvertMarker'](_0x33afcc);});});}['_getPositionLimitingRange'](_0x2b0e7e,_0x3e7ea6,_0x8585b3='outside'){if(!_0x2b0e7e)return null;let _0x42ea2b=_0x2b0e7e['parent'];for(;_0x42ea2b&&_0x42ea2b['parent']&&'$root'!==_0x42ea2b['parent']['name']&&!_0x3e7ea6['model']['schema']['isLimit'](_0x42ea2b)&&!_0x3e7ea6['model']['schema']['isBlock'](_0x42ea2b);)_0x42ea2b=_0x42ea2b['parent'];if(!_0x42ea2b||!_0x42ea2b['name']||'$root'===_0x42ea2b['name'])return null;let _0x1c1a37=null;return _0x3e7ea6['model']['change'](_0x2b6112=>{_0x1c1a37='inside'===_0x8585b3?_0x2b6112['createRangeIn'](_0x42ea2b):_0x2b6112['createRangeOn'](_0x42ea2b);}),_0x1c1a37;}['_validateMarkers'](_0x197d9a,_0x341423){const _0x54c8e8=Array['from'](this['_markers']['keys']()),_0x38e930=new Map();for(const _0x4994e4 of _0x54c8e8){const _0x357f1e=_0x197d9a['model']['markers']['get'](_0x4994e4);if(!_0x357f1e)continue;const _0x406f59=_0x357f1e['getStart']()['path'][0x0];_0x38e930['has'](_0x406f59)||_0x38e930['set'](_0x406f59,[]),_0x38e930['get'](_0x406f59)['push'](_0x357f1e);}const _0x8b1c23=new Set();for(const _0x39e6f6 of _0x197d9a['model']['document']['differ']['getChanges']()){let _0x180d12=-0x1,_0x2d0896=null;if('insert'===_0x39e6f6['type'])_0x2d0896=new _0x1f26a0(_0x39e6f6['position'],_0x39e6f6['position']['getShiftedBy'](_0x39e6f6['length'])),_0x180d12=_0x39e6f6['position']['path'][0x0];else{if('remove'!==_0x39e6f6['type'])continue;_0x2d0896=new _0x1f26a0(_0x39e6f6['position']),_0x180d12=_0x39e6f6['position']['path'][0x0];}const _0x1996b2=_0x38e930['get'](_0x180d12)||[];if(_0x1996b2['length']){for(const _0x261c1a of _0x1996b2)if(_0x2d0896['root']['rootName']===_0x261c1a['getRange']()['root']['rootName']&&('insert'!==_0x39e6f6['type']||!_0x2d0896['containsRange'](_0x261c1a['getRange']()))&&(_0x2d0896['isIntersecting'](_0x261c1a['getRange']())||_0x2d0896['start']['isTouching'](_0x261c1a['getRange']()['end'])||_0x2d0896['end']['isTouching'](_0x261c1a['getRange']()['start']))){const _0x4c54fe=this['_parseMarkerName'](_0x261c1a['name']);Array['from'](this['_markers']['values']())['filter'](_0xf46787=>_0xf46787['groupId']===_0x4c54fe['groupId'])['forEach'](_0xc3c1c1=>_0x8b1c23['add'](_0xc3c1c1['id']));}}}if(_0x8b1c23['size']){for(const _0x30944c of _0x8b1c23)_0x341423['removeMarker'](_0x30944c);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x2b0334){for(const {name:_0x1f336a,data:_0x13ae42}of _0x2b0334['model']['document']['differ']['getChangedMarkers']()){if(!_0x1f336a['startsWith'](Lt))continue;const _0x5418bf=_0x13ae42['oldRange'],_0x3f65c6=_0x13ae42['newRange'],_0x48a73a=_0x5418bf&&'$graveyard'===_0x5418bf['root']['rootName'],_0x321791=_0x3f65c6&&'$graveyard'===_0x3f65c6['root']['rootName'];if(_0x48a73a&&_0x321791)continue;const _0x211d43=this['_parseMarkerName'](_0x1f336a);this['_markers']['get'](_0x1f336a)&&(_0x321791||!_0x3f65c6?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x1f336a,'changeId':_0x211d43['groupId']}):_0x48a73a&&_0x3f65c6&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x1f336a,'changeId':_0x211d43['groupId']}));}}['_parseMarkerName'](_0x3a48e3){const _0x1ab25b=_0x3a48e3['split'](':'),_0x22a500=(_0x1ab25b[0x1]||'')['split']('_');return{'prefix':_0x1ab25b[0x0],'groupId':_0x22a500[0x0],'suffix':_0x22a500[0x1]};}['_translateOperationToEditorContent'](_0x2cec74,_0x4a46ec,_0x4367ea){if('insert'===_0x2cec74['type']){const _0x46bc89=_0x2cec74;return new $t(this['_changePosition'](_0x4a46ec['concat'](_0x46bc89['position']['offset']),_0x4367ea),_0x46bc89['nodes'],_0x46bc89['baseVersion']);}if('marker'===_0x2cec74['type']&&_0x2cec74['name']['startsWith']('$markedRemove')){const _0x16fc29=_0x2cec74;return new Mt(_0x16fc29['name'],_0x16fc29['oldRange'],this['_changeRange'](_0x16fc29['newRange'],_0x4a46ec['concat'](_0x16fc29['newRange']['start']['offset']),_0x4a46ec['concat'](_0x16fc29['newRange']['end']['offset']),_0x4367ea),_0x16fc29['_markers'],_0x16fc29['affectsData'],_0x16fc29['baseVersion']);}return _0x2cec74;}['_groupAdjacentOperations'](_0x45e35f){if(!_0x45e35f['length'])return[];const _0x33010e=[];let _0x5d3434=0x0,_0x42c737=0x0,_0x41dde1=[];for(let _0x420ad7=0x0;_0x420ad7<=_0x45e35f['length'];_0x420ad7++){const _0x290ffb=_0x45e35f[_0x420ad7],_0x22ecc4=_0x45e35f[_0x420ad7-0x1];!_0x290ffb||_0x22ecc4&&!this['_getOperationEnd'](_0x22ecc4)['isTouching'](this['_getOperationStart'](_0x290ffb))?(_0x33010e['push']({'operations':_0x41dde1,'operationsIsolated':_0x41dde1['map'](_0x46408c=>this['_shiftOperation'](_0x46408c['clone'](),-_0x42c737)),'groupOffset':_0x5d3434}),_0x41dde1=_0x290ffb?[_0x290ffb]:[],_0x42c737+=_0x5d3434,_0x5d3434=0x0):_0x41dde1['push'](_0x290ffb),_0x290ffb&&'insert'===_0x290ffb['type']&&(_0x5d3434+=_0x290ffb['howMany']);}return _0x33010e;}['_findAdjacentContextDistance'](_0x1e1c08,_0x998843,_0x235b9d,_0x4e7fd5=0x1){const _0x1212fe=new Dt({'startPosition':_0x1e1c08,'direction':_0x998843});let _0x11db22=0x0;for(let _0x41b7c2=0x0;_0x41b7c2<_0x4e7fd5;_0x41b7c2++){let _0x19f53c=0x0,_0x3f9104=!0x1,_0x5ab65e='forward'===_0x998843?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x113cd4}of _0x1212fe)if(_0x113cd4['is']('$textProxy')){const _0x19edc6=_0x5ab65e['exec'](_0x113cd4['data']);if(_0x19edc6&&_0x19edc6['length']){if(_0x19f53c+='forward'===_0x998843?_0x19edc6['index']+_0x19edc6[0x0]['length']:_0x113cd4['data']['length']-_0x19edc6['index'],_0x19edc6[0x0]['length']!==_0x113cd4['data']['length'])break;_0x3f9104=!0x0,_0x5ab65e='forward'===_0x998843?/^\w+/:/\w+$/;}else{if(_0x3f9104)break;_0x19f53c+=_0x113cd4['offsetSize'];}}else{if(_0x113cd4['is']('element')){_0x235b9d['isInline'](_0x113cd4)&&!_0x3f9104&&(_0x19f53c+=0x1);break;}}_0x11db22+=_0x19f53c,_0x1212fe['jumpTo'](_0x1e1c08['getShiftedBy']('forward'===_0x998843?_0x11db22:-_0x11db22));}return _0x11db22;}['_getChangeContext'](_0x527c2d,_0x15dbff){const _0x3b6691=D(this['context'])['model']['schema'],_0x331f10=this['_findAdjacentContextDistance'](_0x527c2d,'backward',_0x3b6691,0x6),_0x257205=this['_findAdjacentContextDistance'](_0x15dbff,'forward',_0x3b6691,0x6),_0x33cf3e=_0x527c2d['getShiftedBy'](-_0x331f10),_0xf5499e=_0x15dbff['getShiftedBy'](_0x257205);return{'start':_0x33cf3e,'end':_0xf5499e,'hasContentBefore':!_0x33cf3e['isAtStart'],'hasContentAfter':!_0xf5499e['isAtEnd']};}['_insertMarkers'](_0x51ed5a){const _0x4efdb1=this['context']['plugins']['get']('AIEditing'),_0x2824f8=new Set();D(this['context'])['model']['change'](_0xbbb5f6=>{for(const _0x5e792b of _0x51ed5a){const _0x3cbb48=''+Lt+_0x5e792b['type']+':'+_0x5e792b['groupId']+'_'+_0x4efdb1['_nextDataId'](_0x2824f8);this['_markers']['set'](_0x3cbb48,{'id':_0x3cbb48,'groupId':_0x5e792b['groupId'],'type':_0x5e792b['type'],'content':_0x5e792b['content']}),_0xbbb5f6['addMarker'](_0x3cbb48,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xbbb5f6['createRange'](_0x5e792b['start'],_0x5e792b['end'])});}});}['_createGetContextFn'](_0x5c1bd4,_0x4dffe5,_0x232336){let _0x2285b6='';return()=>{if(!_0x2285b6){const _0x3bb9d7=_0x4dffe5['toView'](_0x5c1bd4,{'showSuggestionHighlights':!0x0});let _0x43688=_0x3bb9d7['getChild'](0x0);if(_0x43688['is']('containerElement')||(_0x43688=_0x3bb9d7),!_0x43688)return'';let _0x520607=!0x1;const _0x35dd6d=[];for(const _0x5168c1 of _0x43688['getChildren']())_0x5168c1['is']('element','span')&&_0x5168c1['hasClass']('ck-ai_review-marker_context-end')&&(_0x520607=!0x1),_0x520607&&_0x35dd6d['push'](_0x5168c1),_0x5168c1['is']('element','span')&&_0x5168c1['hasClass']('ck-ai_review-marker_context-start')&&(_0x520607=!0x0);_0x43688['_removeChildren'](0x0,_0x43688['childCount']),_0x232336?.['ellipsisBefore']&&_0x43688['_appendChild']('…'),_0x43688['_appendChild'](_0x35dd6d),_0x232336?.['ellipsisAfter']&&_0x43688['_appendChild']('…');const _0x348a50=_0x4dffe5['htmlProcessor']['domConverter']['viewToDom'](_0x3bb9d7),_0x46748f=_0x4dffe5['htmlProcessor']['htmlWriter']['getHtml'](_0x348a50);_0x2285b6=_0x46748f;}return _0x2285b6;};}['_createGetContentFn'](_0xdad0a5,_0x381dd6){let _0x467eec='';return()=>(_0x467eec||(_0x467eec=_0x381dd6['stringify'](_0xdad0a5,{'showSuggestionHighlights':!0x0})),_0x467eec);}['_createGetContentUsingDataIdFn'](_0x745aa7,_0x28eefa,_0x5c06f6){let _0x1ac9e0='';return()=>{if(!_0x1ac9e0){const _0x49c72c=_0x5c06f6['toView'](new _0x27a70e(_0x745aa7)),_0x532d49=_0x5c06f6['htmlProcessor']['domConverter']['viewToDom'](_0x49c72c)['querySelector']('[data-id=\x22'+_0x28eefa+'\x22]');_0x1ac9e0=_0x532d49?.['outerHTML']||'';}return _0x1ac9e0;};}['_findMarkerElement'](_0x1829a5,_0xf6f0e7=0x5){let _0x37313d=_0x1829a5,_0x190a7a=null;for(let _0x1ee6a7=0x0;_0x1ee6a7<_0xf6f0e7&&_0x37313d;_0x1ee6a7++){if(!_0x37313d['className']){_0x37313d=_0x37313d['parentElement'];continue;}if(!(''+_0x37313d['className'])['includes']('ck-ai_review-marker_')){_0x37313d=_0x37313d['parentElement'];continue;}if(!_0x37313d['getAttribute']('data-marker-id'))break;_0x190a7a=_0x37313d;break;}return _0x190a7a;}['_findMarkerElementById'](_0x4cf754){const _0x5f4273=D(this['context']),_0x2f7479=_0x5f4273['model']['markers']['get'](_0x4cf754);return _0x2f7479?Gt(_0x5f4273['editing'],_0x2f7479):null;}['_getMarkersDataForGroup'](_0x5e88f6){return Array['from'](this['_markers']['values']())['filter'](_0x4f26a7=>_0x4f26a7['groupId']===_0x5e88f6);}['_getOperationStart'](_0x2007e8){return'insert'===_0x2007e8['type']?_0x2007e8['position']:_0x2007e8['newRange']['start'];}['_getOperationEnd'](_0xfd2b25,_0x3bb7e2=!0x1){return'insert'===_0xfd2b25['type']?_0x3bb7e2?_0xfd2b25['position']:_0xfd2b25['position']['getShiftedBy'](_0xfd2b25['howMany']):_0xfd2b25['newRange']['end'];}['_shiftOperation'](_0x81ce73,_0x1960d9){return'insert'===_0x81ce73['type']?_0x81ce73['position']=_0x81ce73['position']['getShiftedBy'](_0x1960d9):'marker'===_0x81ce73['type']&&_0x81ce73['newRange']&&(_0x81ce73['newRange']=new _0x1f26a0(_0x81ce73['newRange']['start']['getShiftedBy'](_0x1960d9),_0x81ce73['newRange']['end']['getShiftedBy'](_0x1960d9))),_0x81ce73;}['_changeOperationOwnerDocument'](_0x800670,_0x3a3923){'insert'===_0x800670['type']?_0x800670['position']=this['_changePositionOwnerDocument'](_0x800670['position'],_0x3a3923):'marker'===_0x800670['type']&&_0x800670['newRange']&&(_0x800670['newRange']=this['_changeRangeOwnerDocument'](_0x800670['newRange'],_0x3a3923));}['_changePositionOwnerDocument'](_0x34f563,_0x2e9e1c){return new _0x128f8a(_0x2e9e1c,_0x34f563['path']);}['_changeRangeOwnerDocument'](_0x2782cc,_0x48851a){return new _0x1f26a0(this['_changePositionOwnerDocument'](_0x2782cc['start'],_0x48851a),this['_changePositionOwnerDocument'](_0x2782cc['end'],_0x48851a));}['_changePosition'](_0x196a99,_0x466a1b){return new _0x128f8a(_0x466a1b,[..._0x196a99]);}['_changeRange'](_0x3f3974,_0x284e6a,_0x6086a8,_0x55efb2){return new _0x1f26a0(this['_changePosition'](_0x284e6a,_0x55efb2),this['_changePosition'](_0x6086a8,_0x55efb2));}['_sortMarkers'](_0x2dbf52){const _0x221851=_0x15e584=>{switch(_0x15e584){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x2dbf52['sort']((_0x2fb576,_0x9efb59)=>_0x221851(_0x2fb576['type'])-_0x221851(_0x9efb59['type']));}['_hasSameTopLevelElement'](_0x1c661d,_0x5f0992){const _0x249f93=_0x1c661d['getChild'](0x0),_0x549880=_0x5f0992['getChild'](0x0);return!(!_0x249f93||!_0x549880)&&((!_0x249f93['is']('element')||!_0x549880['is']('element')||_0x249f93['name']===_0x549880['name'])&&!(_0x249f93['is']('element')&&!_0x549880['is']('element')||!_0x249f93['is']('element')&&_0x549880['is']('element')));}['_haveSingleTopLevelElement'](_0x3e2484){return 0x1===_0x3e2484['childCount'];}['_haveOnlyInlineContent'](_0x2b2e8e,_0x4376b1){for(const _0x23c81d of _0x2b2e8e['getChildren']())if(_0x23c81d['is']('element')&&!_0x4376b1['isInline'](_0x23c81d))return!0x1;return!0x0;}['_upsertDataId'](_0x491035,_0x3b9748){let _0x82099a=_0x491035['getAttribute'](_0x1707b9);return _0x82099a||(_0x82099a=_0x3b9748(),_0x491035['_setAttribute'](_0x1707b9,_0x82099a)),_0x82099a;}}class th extends Ft(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x45fff4,contentNew:_0x32e86c,contentInitial:_0x167077,documentVersion:_0x24515d}){super(),this['id']=_0x45fff4,this['contentNew']=_0x32e86c,this['contentInitial']=_0x167077,this['documentVersion']=_0x24515d;}}class eh extends Vt(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x5ae127,_0x5d69e2,_0x33ae25){super(),this['id']=_0x5ae127,this['parent']=_0x33ae25,this['_data']=_0x5d69e2,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 ih extends Vt(){['id']=_0x3e4e8c();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x21fe12,_0x2b2798,_0x33f728,_0x3161cc,_0x2a54b4){super(),this['_sourceCheck']=_0x2b2798,this['_documentData']=_0x21fe12,this['_aiConnector']=_0x33f728,this['_reviewParams']=_0x3161cc,this['_reviewArgs']=_0x2a54b4,this['on']('change:status',(_0x5e04f8,_0x15d4a6,_0x29737f)=>{'aborted'==_0x29737f&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x29737f,'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'](_0xe3a1c=>'pending'===_0xe3a1c['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x2fd1bf){this['_documentData']=_0x2fd1bf;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x4a3103=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x29f916 of _0x4a3103)'unmodified'!==_0x29f916['data']['operation']&&('error'!==_0x29f916['data']['operation']?'review-metadata'!==_0x29f916['event']?this['_addReviewCheckResult'](_0x29f916['data']['dataId'],_0x29f916['data']['textDelta']):this['callId']=_0x29f916['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(_0x2e2809){this['_currentError']=_0x2e2809,_0x2e2809 instanceof Error&&_0x2e2809['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'](_0x429a3d,_0x10c118){const _0x30d67d=this['_results']['get'](_0x429a3d);if(!_0x30d67d)return;if(0x0===_0x10c118['length'])return;const _0x5c1ac1=[];_0x10c118['forEach']((_0x951a78,_0x4649cd)=>{const _0x55de15=new eh(_0x30d67d['id']+'-'+_0x4649cd,_0x951a78,_0x30d67d);_0x55de15['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x55de15,'status':_0x55de15['status']});}),_0x55de15['on']('change:isActivated',()=>{_0x55de15['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x55de15}):this['fire']('reviewCheckResultDeactivated',{'change':_0x55de15});}),this['_changes']['push'](_0x55de15),_0x5c1ac1['push'](_0x55de15);}),this['fire']('reviewCheckResultReady',{'changes':_0x5c1ac1,'result':_0x30d67d,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x1a9d83){const _0x39c6c4=this['_changes']['find'](_0x400e1c=>_0x400e1c['id']===_0x1a9d83);return!(!_0x39c6c4||'pending'!==_0x39c6c4['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x3d7b6f=>!0x0===_0x3d7b6f['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x4bd2fc=>'pending'===_0x4bd2fc['status']);}['getChangeById'](_0x58ee4a){return this['_changes']['find'](_0xffc3a4=>_0xffc3a4['id']===_0x58ee4a);}['markAllChangesAsAccepted'](){for(const _0x2f0c38 of this['_changes'])'pending'===_0x2f0c38['status']&&(_0x2f0c38['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0xa7375b){const _0x510a26=this['_changes']['find'](_0x599975=>_0x599975['id']===_0xa7375b);_0x510a26&&'pending'===_0x510a26['status']&&(_0x510a26['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x17cb93){const _0x15e340=this['_changes']['find'](_0x3e04d2=>_0x3e04d2['id']===_0x17cb93);_0x15e340&&'pending'===_0x15e340['status']&&(_0x15e340['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x1edade){const _0xef22b1=this['_changes']['find'](_0x3a288b=>_0x3a288b['id']===_0x1edade);_0xef22b1&&'pending'===_0xef22b1['status']&&(_0xef22b1['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x11fe05){const _0x3bddb2=this['_changes']['find'](_0x3d9b4f=>_0x3d9b4f['id']===_0x11fe05);_0x3bddb2&&'outdated'===_0x3bddb2['status']&&(_0x3bddb2['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x3ea796){this['_changes']['filter'](_0x51cf11=>_0x51cf11['isActivated']&&_0x51cf11['id']!==_0x3ea796)['forEach'](_0x3867f5=>{_0x3867f5['isActivated']=!0x1;});const _0x34f130=this['_changes']['find'](_0x5a62b5=>_0x5a62b5['id']===_0x3ea796);_0x34f130&&'pending'===_0x34f130['status']&&(_0x34f130['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x3be05c=>_0x3be05c['isActivated'])['forEach'](_0x1a9342=>{_0x1a9342['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x23e123){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0xb2dd2e;if(_0x23e123){const _0x61c87a=this['_changes']['find'](_0x168c1b=>_0x168c1b['id']===_0x23e123);if(_0x61c87a&&_0x61c87a['isRated'])return;_0x61c87a&&(_0xb2dd2e=_0x61c87a['parent']['id'],_0x61c87a['isRated']=!0x0);}const _0x2fc301={'positiveCount':this['_changes']['filter'](_0xa75150=>'accepted'===_0xa75150['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x2fc301,this['callId'],_0xb2dd2e);}['_addReviewCheckResult'](_0x5bf391,_0x2fb133){const _0x1908d2=this['_documentData']['elements']['get'](_0x5bf391);if(!_0x1908d2)return;const _0x4ca5fc=_0x1908d2['getContent']();if(_0x4ca5fc===_0x2fb133)return;const _0xccb161=new th({'id':_0x5bf391,'contentInitial':_0x4ca5fc,'contentNew':_0x2fb133,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0xccb161['id'],_0xccb161),this['fire']('reviewCheckResultAdded',{'result':_0xccb161,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0xcf2179=>'pending'===_0xcf2179['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x436c31=>'pending'===_0x436c31['status'])['length']&&(this['status']='finished'));}}class Ri extends ih{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0xb81162=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x3f9bfc=0x0;_0x3f9bfc<this['_reviewParams']['length'];_0x3f9bfc++){if(!this['_reviewParams'][_0x3f9bfc]||!this['_sourceCheck']['options'][_0x3f9bfc])continue;const _0x129146=this['_sourceCheck']['options'][_0x3f9bfc],_0x677f70=_0x129146['data']?.['find'](_0x45d2e8=>_0x45d2e8['id']===this['_reviewParams'][_0x3f9bfc]);_0x677f70&&_0xb81162['push'](_0x677f70['label']);}return _0xb81162['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x712347,_0x3e6a1c,_0x37d801){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x3e6a1c,_0x712347,_0x37d801);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class ae extends _0x37abb2{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[s];}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(_0xeba0e7,_0x44501c)=>{const _0x1b46e5=this['_aiReviewCheckList']['getCheckById'](_0x44501c['id']);if(_0x1b46e5){this['_onReviewCheckRun'](_0x44501c),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x44501c,_0x1b46e5),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x2f69a0,_0x4b9e49)=>{switch(_0x4b9e49['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x4b9e49);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 _0x1500e8('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new _0x1500e8('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'!==_0x4b9e49['status']&&'error-chunk'!==_0x4b9e49['status']&&'error-general'!==_0x4b9e49['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x3be31d,_0x55faee)=>{if(!this['_currentReviewCheckRun'])throw new _0x1500e8('ai-review-mode-no-current-check-run',this);const _0x7cf818=this['_diffContent'](_0x55faee['result']['contentInitial'],_0x55faee['result']['contentNew']);_0x55faee['source']['addResultChanges'](_0x55faee['result']['id'],_0x7cf818);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x4cc9d6,_0x15f5cb)=>{for(const _0x176f8d of _0x15f5cb['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x176f8d);this['_markChangePositionInEditorContent'](_0x15f5cb['changes'],_0x15f5cb['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x4f13f5,_0x5b0a72)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x5b0a72['change']['id'],_0x5b0a72['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x4d49ff,_0x8c8335)=>{this['_onReviewCheckResultActivated'](_0x8c8335);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x4cdedf){_0x4cdedf instanceof Error&&_0x4cdedf['message']['includes']('ai-request-aborted')||(_0x4cdedf instanceof _0x1500e8?this['_logError'](_0x4cdedf):this['_logError'](new _0x1500e8('ai-review-mode-check-run-failed',this,void 0x0,_0x4cdedf)));}}else this['_logError'](new _0x1500e8('ai-review-mode-source-check-not-found',this,{'checkId':_0x44501c['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 _0xd7000e=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0xd7000e['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0xd7000e['map'](_0x236ae6=>_0x236ae6['id']));const _0x28ffe2=this['_currentReviewCheckRun'];_0x28ffe2['markAllChangesAsAccepted'](),_0x28ffe2['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x19451b,_0x5a91b5)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x5a91b5['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x5a91b5['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x5a91b5['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x5a91b5['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x5b4f2e,_0x5a962d)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x5a962d['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x5a962d['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x5a962d['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x5a962d['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',(_0x4ca3a8,_0x4db62f)=>{this['_onActivateChange'](_0x4db62f);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x30e73d,_0x39e4aa)=>{this['_onDeactivateChange'](_0x39e4aa);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x45da08,_0x32ae5b)=>{this['_onChangeMarkerClicked'](_0x45da08,_0x32ae5b);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x395986,_0x359604)=>{this['_onChangeMarkerHovered'](_0x395986,_0x359604);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x468382,_0x5921fd)=>{this['_onChangeMarkerRemoved'](_0x468382,_0x5921fd);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x408f28,_0x1a54cf)=>{this['_onChangeMarkerRestored'](_0x408f28,_0x1a54cf);});}['_createReviewCheckRun'](_0x72e234,_0x3c4f7c){return new Ri(this['_aiReviewCoreEditing']['getDocumentData'](),_0x3c4f7c,this['_aiConnector'],_0x72e234['params'],_0x72e234['args']);}['_onChangeMarkerRemoved'](_0x4208d1,_0x1c71b5){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x1c71b5['changeId']);}['_onChangeMarkerRestored'](_0x112f4b,_0x159930){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x159930['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x3613f5=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x3613f5&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x414353=this['_aiReviewCoreEditing']['getEditor']();_0x414353&&_0x414353['editing']['view']['change'](_0xf72d08=>{const _0x57466e=_0x414353['editing']['view']['document']['getRoot']();_0xf72d08['removeClass']('ck-ai_review-diff',_0x57466e),_0xf72d08['removeClass']('ck-ai_review-highlights',_0x57466e),_0xf72d08['removeClass']('ck-ai-translate-mode-content',_0x57466e);});}['_getTranslationWithDefault'](_0x183e80,_0x2d7d02){const _0x470e45=m(this['context']['locale'],_0x183e80);return _0x470e45===_0x183e80?_0x2d7d02:_0x470e45;}['_logError'](_0x64a0c3,_0x4de998=!0x1){_0x4dee23(_0x64a0c3['message']),_0x4de998||(_0x64a0c3['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x1889b0){if('content'===this['_changeActivationSource']){const _0x383061=this['_aiReviewCoreUi']['getChangeElement'](_0x1889b0);_0x383061&&_0x917d7b(_0x383061['closest']('.ck-ai_review__check-run-result')||_0x383061);}else{if('panel'===this['_changeActivationSource']){const _0x564997=this['_getChangeContentElement'](_0x1889b0);if(!_0x564997)return;_0x54e791({'target':_0x564997,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}const he=[{'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 Zs{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x3a7f92){this['id']=_0x3a7f92['id'],this['commandId']=_0x3a7f92['commandId'],this['title']=_0x3a7f92['title'],this['description']=_0x3a7f92['description'],this['isParameterized']=_0x3a7f92['isParameterized'],this['useArgs']=_0x3a7f92['useArgs'],this['options']=_0x3a7f92['options'],this['args']=_0x3a7f92['args'];}}class vo extends Vt(){['_checks']=[];['setupChecks'](_0x396436){this['_checks']=_0x396436['map'](_0x5454b6=>new Zs(_0x5454b6));}get['checks'](){return this['_checks'];}['getCheckById'](_0x3932aa){return this['checks']['find'](_0x28518c=>_0x28518c['id']===_0x3932aa);}['removeCheckById'](_0x190b16){this['_checks']=this['_checks']['filter'](_0x37650c=>_0x37650c['id']!==_0x190b16);}}class me extends Zs{['_models']=[];['_defaultModel']=null;constructor(_0x4e5722,_0x2daa7b,_0x4c8d5e){super(_0x4e5722),this['_models']=_0x2daa7b,this['_defaultModel']=_0x4c8d5e;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class de extends Zs{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x5b0e19,_0x1f4851,_0x3eaaef){super(_0x5b0e19),this['prompt']=_0x5b0e19['prompt'],this['model']=_0x5b0e19['model'],this['model']?this['_defaultModel']=_0x1f4851['find'](_0x2b1758=>_0x2b1758['id']===this['model'])||null:this['_defaultModel']=_0x3eaaef;}get['defaultModel'](){return this['_defaultModel'];}}class ce extends vo{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x52b819,_0x406fe8,_0x3add80){super(),this['_allModels']=_0x52b819,this['_recommendedModels']=_0x406fe8,this['_defaultModel']=_0x3add80;}['setupChecks'](_0x4233b6){this['_checks']=_0x4233b6['map'](_0x22cb7d=>!0x0===_0x22cb7d['isExtra']?new de(_0x22cb7d,this['_allModels'],this['_defaultModel']):'custom'===_0x22cb7d['id']?new me(_0x22cb7d,this['_recommendedModels'],this['_defaultModel']):new Zs(_0x22cb7d));}}class le extends ih{['_prompt'];['_model'];constructor(_0x1219da,_0x5ed890,_0x5e2f2f,_0x1f9966,_0xf0f645){super(_0x5e2f2f,_0x1f9966,_0xf0f645),this['_prompt']=_0x1219da,this['_model']=_0x5ed890;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x2cad4a,_0x36040a,_0x3c1627){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x36040a,_0x2cad4a,_0x3c1627);}}class ue extends le{get['subTitle'](){return'';}set['prompt'](_0x3f0654){this['_prompt']=_0x3f0654;}set['model'](_0x1400c3){this['_model']=_0x1400c3;}}class se extends ae{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x4500c3){super(_0x4500c3),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',he['map'](_0x1aa33f=>_0x1aa33f['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x19afe0,_0x2b2141)=>{this['_isDiffOn']=_0x2b2141['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x5cb924,_0x1fb2e5){return _0x5cb924['isCustom']?new le(_0x5cb924['args']['prompt'],_0x5cb924['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x1fb2e5,this['_aiConnector']):_0x1fb2e5['isExtra']?new ue(_0x1fb2e5['prompt'],_0x1fb2e5['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x1fb2e5,this['_aiConnector']):new Ri(this['_aiReviewCoreEditing']['getDocumentData'](),_0x1fb2e5,this['_aiConnector'],_0x5cb924['params'],_0x5cb924['args']);}['_onReviewCheckResultActivated'](_0x2178a4){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x2178a4['change']['id']),this['_scrollToChange'](_0x2178a4['change']['id']);const _0x2a4863=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x2178a4['change']['id']);if(!_0x2a4863)return;const _0xad4c4f=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x2178a4['change'],()=>_0x2a4863['getElement'](),void 0x0,'click',_0xad4c4f?.['editing']?.['view']?.['getDomRoot'](),_0xad4c4f?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x2178a4['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x36da1){this['_currentReviewCheckRun']&&'click'===_0x36da1['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x36da1['id']));}['_onDeactivateChange'](_0x1dbdee){this['_currentReviewCheckRun']&&'balloon'===_0x1dbdee['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x75c709,_0x168ce4){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x168ce4['changeId']);const _0x12d47e=this['_currentReviewCheckRun']['getChangeById'](_0x168ce4['changeId']);if(!_0x12d47e)return;const _0x1bff25=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x12d47e,_0x168ce4['markerElement'],_0x168ce4['domEvent'],'click',_0x1bff25?.['editing']?.['view']?.['getDomRoot'](),_0x1bff25?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0xddb0ae,_0x344c8f){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x36cafb=this['_currentReviewCheckRun']['getChangeById'](_0x344c8f['changeId']);if(!_0x36cafb)return;const _0x43c939=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x36cafb,_0x344c8f['markerElement'],_0x344c8f['domEvent'],'hover',_0x43c939?.['editing']?.['view']?.['getDomRoot'](),_0x43c939?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x1b7430){const _0x4b483a=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x1b7430);return _0x4b483a?_0x4b483a['getElement']():null;}['_markChangePositionInEditorContent'](_0x280d1b,_0x22be86){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x280d1b,_0x22be86);}['_diffContent'](_0x31ebf1,_0x3d9ed2){return this['_aiReviewCoreEditing']['diffContent'](_0x31ebf1,_0x3d9ed2);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x426970){const _0x4686c0=this['_aiReviewCoreEditing']['getEditor']();_0x426970?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x4686c0&&_0x4686c0['editing']['view']['change'](_0x54b8ef=>{const _0xac4c6=_0x4686c0['editing']['view']['document']['getRoot']();for(const _0x4c81cf of _0xac4c6['getClassNames']())_0x4c81cf['startsWith']('ck-ai_review-')&&_0x54b8ef['removeClass'](_0x4c81cf,_0xac4c6);_0x54b8ef['addClass'](_0x426970?'ck-ai_review-diff':'ck-ai_review-highlights',_0xac4c6);});}async['_getChecksList'](){const _0x52d96a=[...he,...this['_getExtraChecks']()],_0xccdbaf=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0xccdbaf,_0x52d96a);let _0x5e79ce=_0x52d96a;this['_hasDefaultAvailableCommands']||(_0x5e79ce=_0xccdbaf['map'](_0x139494=>_0x52d96a['find'](_0x5f13e9=>_0x5f13e9['id']===_0x139494))['filter'](_0x1cf44f=>!!_0x1cf44f)),_0x5e79ce=_0x5e79ce['map'](_0x1551df=>_0x1551df['isExtra']?_0x1551df:this['_translateReviewCheck'](_0x1551df));const _0x15e263=_0x5e79ce['some'](_0x2759bc=>_0x2759bc['isExtra']||'custom'===_0x2759bc['id']);let _0x37973b=[],_0x4f41cd=[],_0x22e14e=null;if(_0x15e263){const _0x5e702a=await this['_getModels']();_0x37973b=_0x5e702a['all'],_0x4f41cd=_0x5e702a['recommended'],_0x22e14e=_0x5e702a['default'];}const _0x58eaa3=new ce(_0x37973b,_0x4f41cd,_0x22e14e);return _0x58eaa3['setupChecks'](_0x5e79ce),_0x15e263&&this['_filterChecksWithMissingModel'](_0x58eaa3),_0x58eaa3;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x73f81f=>({'id':_0x73f81f['id'],'commandId':_0x73f81f['id'],'title':_0x73f81f['label'],'description':_0x73f81f['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x73f81f['prompt'],'model':_0x73f81f['model']}));}['_logErrorForNonExistentChecks'](_0xfffe99,_0x195499){const _0x5778be=_0xfffe99['filter'](_0x57d378=>!_0x195499['some'](_0x83d5c=>_0x83d5c['id']===_0x57d378));_0x5778be['length']&&this['_logError'](new _0x1500e8('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x5778be['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x59370c=new X({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x59370c['getAll'](),'recommended':await _0x59370c['getAvailableModels'](),'default':await _0x59370c['getDefault']()};}catch(_0x3fe374){return this['_logError'](new _0x1500e8('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x3fe374)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x14a686){const _0xa1a0ee='AI_REVIEW_CHECK_'+_0x14a686['id']['toUpperCase']()['replaceAll']('-','_'),_0x1ddff0={..._0x14a686,'title':this['_getTranslationWithDefault'](_0xa1a0ee+'_TITLE',_0x14a686['title']),'description':this['_getTranslationWithDefault'](_0xa1a0ee+'_DESCRIPTION',_0x14a686['description'])};return _0x14a686['options']&&(_0x1ddff0['options']=_0x14a686['options']['map'](_0x1d929e=>({..._0x1d929e,'label':this['_getTranslationWithDefault'](_0xa1a0ee+'_OPTIONS_LABEL',_0x1d929e['label']||''),'data':_0x1d929e['data']?_0x1d929e['data']['map'](_0x3853ac=>({..._0x3853ac,'label':this['_getTranslationWithDefault'](_0xa1a0ee+'_OPTIONS_DATA_'+_0x3853ac['id']['toUpperCase'](),_0x3853ac['label'])})):void 0x0}))),_0x1ddff0;}['_filterChecksWithMissingModel'](_0x52307f){const _0x28bae8=[];_0x52307f['checks']['forEach'](_0x3de80e=>{(_0x3de80e instanceof de&&!_0x3de80e['defaultModel']||_0x3de80e instanceof me&&!_0x3de80e['models']['length'])&&_0x28bae8['push'](_0x3de80e['id']);}),_0x28bae8['length']&&_0x28bae8['forEach'](_0x1b8927=>{_0x52307f['removeCheckById'](_0x1b8927),this['_logError'](new _0x1500e8('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x1b8927}),!0x0);});}}class Qa extends _0x37abb2{static get['requires'](){return[se,re,oe];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class jr extends Zs{get['apiId'](){return'translate';}}class ge extends vo{['setupChecks'](_0x213bce){this['_checks']=_0x213bce['map'](_0x1699f8=>new jr(_0x1699f8));}}class Ce extends Ri{['_title'];constructor(_0x124771,_0x53820b,_0x530e85,_0x449387,_0x18a5e3,_0x3c1531){super(_0x124771,_0x53820b,_0x530e85,_0x18a5e3,_0x3c1531),this['_title']=_0x449387;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class rr extends ae{static get['pluginName'](){return'AITranslateController';}constructor(_0x5efbcb){super(_0x5efbcb),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'](_0x3a89bf,_0x186119){return new Ce(this['_aiReviewCoreEditing']['getDocumentData'](),_0x186119,this['_aiConnector'],m(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x3a89bf['params'],_0x3a89bf['args']);}['_onReviewCheckResultActivated'](_0x3d15e5){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x3d15e5['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x3d15e5['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x4fadcc){this['_currentReviewCheckRun']&&('hover'===_0x4fadcc['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x4fadcc['id'])),'click'===_0x4fadcc['uiInteraction']&&this['_scrollToChange'](_0x4fadcc['id']));}['_onDeactivateChange'](_0x1b5711){this['_currentReviewCheckRun']&&'panel'===_0x1b5711['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x399196,_0x23eee5){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x23eee5['changeId']),this['_scrollToChange'](_0x23eee5['changeId']));}['_onChangeMarkerHovered'](_0x226a89,_0xc4249c){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0xc4249c['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0xc4249c['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x445f1a){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x445f1a);}['_markChangePositionInEditorContent'](_0x8f84d5,_0x556ab8){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x8f84d5,_0x556ab8);}['_diffContent'](_0x2078e0,_0x16dd11){return this['_aiReviewCoreEditing']['diffContent'](_0x2078e0,_0x16dd11,!0x0);}['_onReviewCheckRun'](){const _0x2f7c46=this['_aiReviewCoreEditing']['getEditor']();_0x2f7c46&&_0x2f7c46['editing']['view']['change'](_0x42ae52=>{const _0x509825=_0x2f7c46['editing']['view']['document']['getRoot']();for(const _0x5d9a0e of _0x509825['getClassNames']())(_0x5d9a0e['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x5d9a0e)&&_0x42ae52['removeClass'](_0x5d9a0e,_0x509825);_0x42ae52['addClass']('ck-ai-translate-mode-content',_0x509825);});}async['_getChecksList'](){const _0xe6d05e=[],_0x2a86a9=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x6aa41 of _0x2a86a9)_0xe6d05e['push']({'title':_0x6aa41['label'],'id':_0x6aa41['id'],'commandId':_0x6aa41['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x6aa41['id']}});const _0x299e8f=new ge();return _0x299e8f['setupChecks'](this['_translateChecks'](_0xe6d05e)),_0x299e8f;}['_translateChecks'](_0x48b083){return _0x48b083['map'](_0x2ab767=>{const _0x24c678='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x2ab767['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x2ab767,'title':this['_getTranslationWithDefault'](_0x24c678,_0x2ab767['title'])};});}}class Ae extends Ie{constructor(_0x32d17a,_0x47f928){super(_0x32d17a,_0x47f928),this['on']('set:isLoading',(_0x7c94d8,_0x49e9a8,_0x37e18f)=>{_0x37e18f&&(this['headerTitle']=m(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x26e96d,_0x563864,_0x5841cd)=>{_0x5841cd&&(this['headerTitle']=m(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0xaa2ca2=super['_createAcceptAllButtonView']();return _0xaa2ca2['set']('label',m(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0xaa2ca2;}['_createExitReviewButtonView'](){const _0x5bddb1=super['_createExitReviewButtonView']();return _0x5bddb1['set']('label',m(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x5bddb1;}}class Le extends Te{['_setupTemplate'](){const _0x5e3fb6=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x5e3fb6['if']('isVisible','ck-hidden',_0x58ea6d=>!_0x58ea6d)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':m(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':m(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x5e3fb6['if']('isVisible','ck-hidden',_0x44b5ab=>!_0x44b5ab)]},'children':this['_checkViews']}]});}}class tr extends ve{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x1cc111=this['context']['locale'],_0x47ce5f=new _0x2c8dbc(_0x1cc111,{'label':m(_0x1cc111,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x1dbdc4,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x43f6af=new _e(_0x1cc111,{'header':_0x47ce5f,'list':new Le(_0x1cc111),'results':new Ae(_0x1cc111,{'generalErrorText':m(_0x1cc111,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new Re(_0x1cc111,{'headerText':m(_0x1cc111,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':m(_0x1cc111,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':m(_0x1cc111,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x43f6af['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x43f6af;}['registerTab'](){const _0x174462=this['context']['plugins']['get']('AITabs');_0x174462['view']['on']('activateTab',(_0x2e9275,_0x592bdd)=>{'translate'===_0x592bdd?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x174462['view']['addTab']({'id':'translate','buttonLabel':m(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x1dbdc4,'order':0x0,'content':this['_mainView']});}}class Xa extends _0x37abb2{static get['requires'](){return[rr,tr,oe];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{qi as AIActions,hi as AIAdapter,qn as AIAssistant,ee as AIAssistantUI,u as AIBalloon,Fa as AIChat,x as AIChatController,I as AIChatHistory,rt as AIChatHistoryController,st as AIChatHistoryUI,Wa as AIChatShortcuts,P as AIChatUI,s as AIConnector,o as AIEditing,Ya as AIEditorIntegration,It as AIQuickActionType,qa as AIQuickActions,ki as AIQuickActionsUI,er as AIRequestError,Zs as AIReviewCheck,th as AIReviewCheckResult,ih as AIReviewCheckRun,Qa as AIReviewMode,ae as AIReviewModeController,oe as AIReviewModeEditing,re as AIReviewModeUI,H as AITabs,qe as AITextAdapter,pt as AIToggleButtonUI,Xa as AITranslate,rr as AITranslateController,tr as AITranslateUI,zn as AWSTextAdapter,Xn as OpenAITextAdapter,di as ShowAIAssistantCommand,io as ToggleAICommand,Cs as createResizeButton,Qn as getDefaultAICommands};
|