@ckeditor/ckeditor5-ai 48.8.1-alpha.4 → 49.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/dist/aiactions/aiactions.d.ts +109 -73
- package/dist/aiactions/model/aiactionsinteraction.d.ts +58 -50
- package/dist/aiactions/model/aiactionsreply.d.ts +18 -11
- package/dist/aiassistant/adapters/aiadapter.d.ts +48 -48
- package/dist/aiassistant/adapters/aitextadapter.d.ts +133 -133
- package/dist/aiassistant/adapters/awstextadapter.d.ts +42 -42
- package/dist/aiassistant/adapters/openaitextadapter.d.ts +184 -184
- package/dist/aiassistant/aiassistant.d.ts +425 -436
- package/dist/aiassistant/aiassistantediting.d.ts +51 -51
- package/dist/aiassistant/aiassistantui.d.ts +50 -53
- package/dist/aiassistant/legacyerrors.d.ts +0 -4
- package/dist/aiassistant/ui/aiassistantcontroller.d.ts +106 -105
- package/dist/aiassistant/ui/form/aiformcontentarea.d.ts +43 -43
- package/dist/aiassistant/ui/form/aiformerrorview.d.ts +19 -19
- package/dist/aiassistant/ui/form/aiformpromptview.d.ts +38 -38
- package/dist/aiassistant/ui/form/aiformtoolbarview.d.ts +50 -50
- package/dist/aiassistant/ui/form/aiformview.d.ts +121 -121
- package/dist/aiassistant/ui/form/aihistorylistitemview.d.ts +13 -13
- package/dist/aiassistant/ui/form/aihistorylistview.d.ts +27 -27
- package/dist/aiassistant/ui/form/prompthistory.d.ts +15 -15
- package/dist/aiassistant/ui/showaiassistantcommand.d.ts +35 -35
- package/dist/aiassistant/utils/common-translations.d.ts +6 -6
- package/dist/aiassistant/utils/normalizecommandsconfig.d.ts +9 -9
- package/dist/aiballoon/aiballoon.d.ts +85 -89
- package/dist/aiballoon/ui/aiballoondisclaimerview.d.ts +17 -0
- package/dist/aiballoon/ui/aiballoontoolbarview.d.ts +56 -0
- package/dist/aiballoon/ui/aiballoonview.d.ts +74 -27
- package/dist/aiballoon/utils/contentwidth.d.ts +1 -0
- package/dist/aichat/aichat.d.ts +88 -87
- package/dist/aichat/aichatballoon.d.ts +88 -79
- package/dist/aichat/aichatcontroller.d.ts +284 -258
- package/dist/aichat/aichatui.d.ts +352 -328
- package/dist/aichat/model/aichatcontext.d.ts +655 -654
- package/dist/aichat/model/aichatconversation.d.ts +270 -269
- package/dist/aichat/model/aichatinteraction.d.ts +45 -49
- package/dist/aichat/ui/aichatballoonview.d.ts +73 -101
- package/dist/aichat/ui/aichatcontrolsview.d.ts +121 -125
- package/dist/aichat/ui/aichatfeedview.d.ts +145 -128
- package/dist/aichat/ui/aichatview.d.ts +42 -40
- package/dist/aichat/ui/controls/aichatchipsoverflowmanager.d.ts +73 -63
- package/dist/aichat/ui/controls/aichatcontextitembuttonview.d.ts +41 -41
- package/dist/aichat/ui/controls/aichatcontextpanelurlinputview.d.ts +79 -79
- package/dist/aichat/ui/controls/aichatcontextpanelview.d.ts +110 -100
- package/dist/aichat/ui/controls/aichatdropzoneview.d.ts +30 -0
- package/dist/aichat/ui/controls/aichatpromptcapabilitiesview.d.ts +72 -81
- package/dist/aichat/ui/controls/aichatpromptinputview.d.ts +50 -44
- package/dist/aichat/ui/controls/aichatpromptsuggestionslistview.d.ts +13 -13
- package/dist/aichat/ui/controls/resources/aichatcontextresourceslistview.d.ts +44 -44
- package/dist/aichat/ui/controls/resources/aichatcontextresourcesview.d.ts +52 -52
- package/dist/aichat/ui/controls/resources/aichatresourcelistitemview.d.ts +57 -56
- package/dist/aichat/ui/controls/resources/aichatresourcesballoonview.d.ts +104 -100
- package/dist/aichat/ui/controls/resources/aichatresourcessearchinputview.d.ts +53 -53
- package/dist/aichat/ui/feed/aichatfeedcontextchipsview.d.ts +22 -22
- package/dist/aichat/ui/feed/aichatfeedcustomelementview.d.ts +30 -34
- package/dist/aichat/ui/feed/aichatfeederroritemview.d.ts +30 -33
- package/dist/aichat/ui/feed/aichatfeedinteractionheaderview.d.ts +24 -24
- package/dist/aichat/ui/feed/aichatfeeditemview.d.ts +39 -39
- package/dist/aichat/ui/feed/aichatfeedreplyitemview.d.ts +40 -40
- package/dist/aichat/ui/feed/aichatfeedsuggestionitemactionsview.d.ts +62 -63
- package/dist/aichat/ui/feed/aichatfeedsuggestionitemview.d.ts +87 -82
- package/dist/aichat/ui/feed/aichatfeedusermessageitem.d.ts +33 -33
- package/dist/aichat/utils/eventnames.d.ts +8 -4
- package/dist/aichat/utils/parsesingleurl.d.ts +1 -0
- package/dist/aichat/utils/promisequeue.d.ts +26 -25
- package/dist/aichat/utils/readdatatransferfiles.d.ts +14 -0
- package/dist/aichat/utils/resolvepaste.d.ts +71 -0
- package/dist/aichathistory/aichathistory.d.ts +26 -26
- package/dist/aichathistory/aichathistorycontroller.d.ts +36 -35
- package/dist/aichathistory/aichathistoryui.d.ts +80 -89
- package/dist/aichathistory/model/aichathistoryconversations.d.ts +95 -102
- package/dist/aichathistory/model/aichathistoryitem.d.ts +52 -53
- package/dist/aichathistory/ui/aichathistorylistitemview.d.ts +41 -40
- package/dist/aichathistory/ui/aichathistorylistview.d.ts +28 -28
- package/dist/aichathistory/ui/aichathistorysectionlistview.d.ts +16 -16
- package/dist/aichathistory/ui/aichathistoryview.d.ts +33 -33
- package/dist/aichatshortcuts/aichatshortcuts.d.ts +295 -295
- package/dist/aichatshortcuts/ui/aichatshortcutsview.d.ts +24 -18
- package/dist/aichatshortcuts/ui/aichatshortcutview.d.ts +18 -18
- package/dist/aiconfig.d.ts +362 -227
- package/dist/aicore/aiconnector.d.ts +428 -334
- package/dist/aicore/aicore.d.ts +53 -0
- package/dist/aicore/aiediting.d.ts +103 -88
- package/dist/aicore/aierrorreporter.d.ts +101 -0
- package/dist/aicore/aigateway.d.ts +135 -0
- package/dist/aicore/errors/aicoreerror.d.ts +67 -0
- package/dist/aicore/errors/geterrorcode.d.ts +17 -0
- package/dist/aicore/errors/isaborterror.d.ts +12 -0
- package/dist/aicore/errors/normalizeerror.d.ts +23 -0
- package/dist/aicore/model/aicapabilities.d.ts +69 -53
- package/dist/aicore/model/aicontext.d.ts +116 -77
- package/dist/aicore/model/aicontextlibrary.d.ts +71 -0
- package/dist/aicore/model/aicontextref.d.ts +37 -0
- package/dist/aicore/model/aidefaultcontext.d.ts +83 -0
- package/dist/aicore/model/aieditorroot.d.ts +26 -0
- package/dist/aicore/model/aiinteraction.d.ts +162 -162
- package/dist/aicore/model/aimodels.d.ts +80 -76
- package/dist/aicore/model/aireply.d.ts +129 -121
- package/dist/aicore/model/airunresult.d.ts +43 -0
- package/dist/aicore/model/airunsinglerootresult.d.ts +104 -0
- package/dist/aicore/pipeline/airesponseapplier.d.ts +284 -296
- package/dist/aicore/pipeline/airesponseparser.d.ts +24 -23
- package/dist/aicore/ui/aidisclaimerview.d.ts +12 -13
- package/dist/aicore/ui/aidotsloader.d.ts +18 -0
- package/dist/aicore/ui/aiheaderview.d.ts +27 -28
- package/dist/aicore/ui/aimodelselectorview.d.ts +151 -0
- package/dist/aicore/ui/aiseparatorview.d.ts +25 -0
- package/dist/aicore/ui/aiskeleton.d.ts +43 -32
- package/dist/aicore/ui/aispinner.d.ts +10 -11
- package/dist/aicore/ui/suggestioncontainer/aiminitoolbarview.d.ts +55 -56
- package/dist/aicore/ui/suggestioncontainer/aisuggestionbodyview.d.ts +95 -80
- package/dist/aicore/ui/suggestioncontainer/aisuggestioncontainerview.d.ts +45 -46
- package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentpartheaderview.d.ts +67 -37
- package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentpartstateview.d.ts +21 -31
- package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentparttoolbarview.d.ts +46 -21
- package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentpartview.d.ts +91 -58
- package/dist/aicore/ui/suggestioncontainer/aisuggestionheaderview.d.ts +26 -35
- package/dist/aicore/ui/suggestioncontainer/aisuggestionstreamablecontentview.d.ts +30 -27
- package/dist/aicore/ui/suggestioncontainer/aiwebsourcesview.d.ts +24 -24
- package/dist/aicore/utils/abortabletimeout.d.ts +11 -11
- package/dist/aicore/utils/aitabids.d.ts +11 -0
- package/dist/aicore/utils/builddocumentsuggestionsmap.d.ts +30 -0
- package/dist/aicore/utils/buttonclasses.d.ts +17 -8
- package/dist/aicore/utils/cleanupstreamingartifacts.d.ts +12 -0
- package/dist/aicore/utils/common-translations.d.ts +6 -6
- package/dist/aicore/utils/contentparttranslationkeys.d.ts +27 -0
- package/dist/aicore/utils/createresizebutton.d.ts +8 -9
- package/dist/aicore/utils/createstartconversationbutton.d.ts +7 -8
- package/dist/aicore/utils/documentposition.d.ts +37 -37
- package/dist/aicore/utils/documentrange.d.ts +41 -41
- package/dist/aicore/utils/eventnames.d.ts +5 -5
- package/dist/aicore/utils/geteditorconfig.d.ts +107 -0
- package/dist/aicore/utils/geteditorsfromcontext.d.ts +18 -0
- package/dist/aicore/utils/getmodeldisplaymode.d.ts +21 -0
- package/dist/aicore/utils/getoperationsfordocumentsuggestions.d.ts +20 -0
- package/dist/aicore/utils/getrootinfo.d.ts +45 -0
- package/dist/aicore/utils/getsuggestionpartsfromreply.d.ts +24 -18
- package/dist/aicore/utils/htmlparser.d.ts +23 -16
- package/dist/aicore/utils/htmlstreamer.d.ts +79 -79
- package/dist/aicore/utils/inlineroot.d.ts +1 -0
- package/dist/aicore/utils/istrackchangesenabled.d.ts +23 -0
- package/dist/aicore/utils/markoperationsasai.d.ts +21 -0
- package/dist/aicore/utils/replyactions.d.ts +13 -0
- package/dist/aicore/utils/scrollmanager.d.ts +24 -23
- package/dist/aicore/utils/showaitab.d.ts +1 -0
- package/dist/aidocumentprocessing/aidocumentprocessinggateway.d.ts +110 -0
- package/dist/aidocumentprocessing/model/aidocumentprocessingrunresult.d.ts +19 -0
- package/dist/aieditorintegration/aieditorintegration.d.ts +42 -32
- package/dist/aieditorintegration/aitogglebutton/aitogglebuttonui.d.ts +33 -34
- package/dist/aieditorintegration/aitogglebutton/toggleaicommand.d.ts +12 -12
- package/dist/aiquickactions/aiquickactions.d.ts +303 -252
- package/dist/aiquickactions/aiquickactionscommand.d.ts +10 -10
- package/dist/aiquickactions/aiquickactionsediting.d.ts +22 -22
- package/dist/aiquickactions/aiquickactionsui.d.ts +131 -124
- package/dist/aiquickactions/ui/aiquickactionsbuttoncreator.d.ts +57 -57
- package/dist/aiquickactions/ui/aiquickactionsdropdowncontentview.d.ts +45 -45
- package/dist/aiquickactions/ui/aiquickactionsdropdowncreator.d.ts +59 -59
- package/dist/aiquickactions/ui/aiquickactionsfilteredlistview.d.ts +0 -4
- package/dist/aiquickactions/ui/balloon/aiactionsballoonview.d.ts +73 -136
- package/dist/aiquickactions/ui/dropdownmenubuttonwithhighlightview.d.ts +24 -24
- package/dist/aireviewcore/aireviewcorecheckregistry.d.ts +37 -0
- package/dist/aireviewcore/aireviewcorecontroller.d.ts +48 -23
- package/dist/aireviewcore/aireviewcoreediting.d.ts +296 -224
- package/dist/aireviewcore/aireviewcoreui.d.ts +109 -85
- package/dist/aireviewcore/model/aichecksinglerootresult.d.ts +22 -0
- package/dist/aireviewcore/model/aireviewcheck.d.ts +49 -49
- package/dist/aireviewcore/model/aireviewchecklist.d.ts +29 -28
- package/dist/aireviewcore/model/aireviewcheckresult.d.ts +36 -35
- package/dist/aireviewcore/model/aireviewcheckresultchange.d.ts +62 -50
- package/dist/aireviewcore/model/aireviewcheckrun.d.ts +174 -147
- package/dist/aireviewcore/model/aireviewsystemcheckrun.d.ts +16 -16
- package/dist/aireviewcore/types.d.ts +30 -24
- package/dist/aireviewcore/ui/aireviewcoreabstractchecklistview.d.ts +50 -0
- package/dist/aireviewcore/ui/aireviewcorechecklistitemresultview.d.ts +53 -76
- package/dist/aireviewcore/ui/aireviewcorecompletereviewdropdown.d.ts +29 -0
- package/dist/aireviewcore/ui/aireviewcorecustomcheckview.d.ts +38 -56
- package/dist/aireviewcore/ui/aireviewcorefinishreviewbuttonview.d.ts +8 -9
- package/dist/aireviewcore/ui/aireviewcoregeneralerrorview.d.ts +20 -20
- package/dist/aireviewcore/ui/aireviewcorenavigationpanelview.d.ts +169 -0
- package/dist/aireviewcore/ui/aireviewcoreprogressbarview.d.ts +32 -0
- package/dist/aireviewcore/ui/aireviewcorepromptinputview.d.ts +25 -25
- package/dist/aireviewcore/ui/aireviewcorereviewchecklistview.d.ts +42 -23
- package/dist/aireviewcore/ui/aireviewcorereviewcommandlistitemview.d.ts +49 -39
- package/dist/aireviewcore/ui/aireviewcorereviewcompletedview.d.ts +13 -14
- package/dist/aireviewcore/ui/aireviewcoreuicheckresultsview.d.ts +114 -87
- package/dist/aireviewcore/ui/aireviewcoreview.d.ts +54 -50
- package/dist/aireviewcore/ui/changeevents.d.ts +49 -0
- package/dist/aireviewcore/ui/form/aireviewcoreformdropdown.d.ts +16 -16
- package/dist/aireviewcore/ui/form/aireviewcoreformmanager.d.ts +12 -12
- package/dist/aireviewcore/utils/openleaveconfirmationdialog.d.ts +21 -0
- package/dist/aireviewcore/utils/reviewcontentpart.d.ts +25 -0
- package/dist/aireviewmode/aireviewcheckdefinitions.d.ts +12 -12
- package/dist/aireviewmode/aireviewgateway.d.ts +172 -0
- package/dist/aireviewmode/aireviewmode.d.ts +260 -126
- package/dist/aireviewmode/aireviewmodecheckregistry.d.ts +46 -0
- package/dist/aireviewmode/aireviewmodecontroller.d.ts +24 -17
- package/dist/aireviewmode/aireviewmodeui.d.ts +17 -17
- package/dist/aireviewmode/model/aireviewcheckcustom.d.ts +16 -16
- package/dist/aireviewmode/model/aireviewcheckextra.d.ts +35 -30
- package/dist/aireviewmode/model/aireviewcustomcheckrun.d.ts +18 -17
- package/dist/aireviewmode/model/aireviewextracheckrun.d.ts +15 -15
- package/dist/aireviewmode/model/aireviewmodechecklist.d.ts +22 -18
- package/dist/aireviewmode/ui/aireviewmodecheckresultsview.d.ts +41 -0
- package/dist/aisdk/dataidassigner.d.ts +20 -0
- package/dist/aisdk/documentchanges.d.ts +165 -0
- package/dist/aisdk/documentchangesutils.d.ts +15 -0
- package/dist/aisdk/documentcompare.d.ts +171 -0
- package/dist/aisdk/documentcompareutils.d.ts +16 -0
- package/dist/aisdk/documentsnapshot.d.ts +48 -0
- package/dist/aisdk/extractselectionfromhtml.d.ts +27 -0
- package/dist/aisdk/validateoperations.d.ts +43 -0
- package/dist/aitabs/aitabs.d.ts +104 -84
- package/dist/aitabs/aitabsmainview.d.ts +70 -46
- package/dist/aitabs/tabs/aitabsview.d.ts +191 -188
- package/dist/aitranslate/aitranslate.d.ts +165 -129
- package/dist/aitranslate/aitranslatecheckregistry.d.ts +27 -0
- package/dist/aitranslate/aitranslatecontroller.d.ts +18 -15
- package/dist/aitranslate/aitranslategateway.d.ts +89 -0
- package/dist/aitranslate/aitranslateui.d.ts +17 -18
- package/dist/aitranslate/model/aitranslatecheck.d.ts +12 -12
- package/dist/aitranslate/model/aitranslatechecklist.d.ts +11 -11
- package/dist/aitranslate/model/aitranslatecheckrun.d.ts +24 -23
- package/dist/aitranslate/ui/aitranslatechecklistview.d.ts +28 -7
- package/dist/aitranslate/ui/aitranslatecheckresultsview.d.ts +11 -11
- package/dist/augmentation.d.ts +79 -63
- package/dist/errors.d.ts +0 -4
- package/dist/errorsmap.d.ts +5 -5
- package/dist/index-content.css +0 -96
- package/dist/index-editor.css +3932 -3291
- package/dist/index.css +3943 -3307
- package/dist/index.d.ts +83 -59
- package/dist/index.js +19 -6
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.js +1 -1
- package/dist/translations/be.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/package.json +32 -13
- package/dist/aichat/ui/controls/aichatcontrolsloaderview.d.ts +0 -12
- package/dist/aicore/ui/suggestioncontainer/aisuggestionloaderview.d.ts +0 -16
- package/dist/aicore/utils/geteditorfromcontext.d.ts +0 -19
- package/dist/aicore/utils/getoperationsfromreply.d.ts +0 -24
- package/dist/aiquickactions/ui/balloon/aiactionsballoondisclaimerview.d.ts +0 -17
- package/dist/aiquickactions/ui/balloon/aiactionsballoontoolbarview.d.ts +0 -37
- package/dist/aireviewcore/ui/aireviewcoreballoonsuggestionview.d.ts +0 -38
- package/dist/aitabs/tabs/tabbuttonview.d.ts +0 -47
- package/dist/aitabs/tabs/tabpanelview.d.ts +0 -44
package/dist/index.js
CHANGED
|
@@ -20,9 +20,22 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x53fc9f,Command as _0xae9ca1,ContextPlugin as _0x3cc0e4,Editor as _0x3cd9d5}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x5c3d91,IconCheck as _0x489882,IconError as _0x2b1be1,IconSubmit as _0xcffe77,IconAIHistory as _0x33c29f,IconMagicWand as _0x94995e,IconRobotPencil as _0x4a06bf,IconMaximize as _0x55d900,IconMinimize as _0x37bd1f,IconShowChangesOn as _0x5a2923,IconShowChangesOff as _0x1aad04,IconDocument as _0x3745a0,IconBoxWithCross as _0x5d4966,IconBoxWithCheck as _0x3a31e4,IconBoxWithMarker as _0x561f7b,IconInfo as _0x467df0,IconWeb as _0x43e506,IconCancel as _0x5777e9,IconSelection as _0x283729,IconFileUpload as _0xc6d689,IconLink as _0x4ad8e3,IconBulb as _0x23256e,IconAI as _0x5ddbf5,IconPreviousArrow as _0x3d9913,IconDocumentOutline as _0x3649ad,IconLoupe as _0x3fa2b6,IconPaperClip as _0x1bd4f2,IconBrowseFiles as _0x23ddc8,IconDropdownArrow as _0x3edc81,IconStop as _0xdb5f07,IconPlus as _0x40c6c9,IconAIChat as _0x24024f,IconPin as _0x321a25,IconThreeHorizontalDots as _0x3c4511,IconAIReview as _0xc8a0b9,IconAITranslate as _0x31db4a,IconAIAskAI as _0x485aef,IconThumbUp as _0x4dcf71,IconThumbDown as _0x102fde,IconChevronDown as _0x3a15b7,IconChevronUp as _0x2ca3b2,IconAIQuickActions as _0x50cf41,IconAIChatCommands as _0x4bc996,IconAIImproveWriting as _0x1f8e78,IconAIContinueWriting as _0x1c6602,IconAIGrammarCheck as _0x1be793,IconAIAdjustLength as _0x3c09f1,IconAIChangeTone as _0x2ad21d,IconAIOther as _0x19a5b3,IconRefresh as tt,IconNextArrow as et,IconOutdated as it,IconEye as st,IconEyeCrossedOut as nt,IconChevronRight as rt}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as ot,CKEditorError as at,ObservableMixin as ht,global as ct,isVisible as lt,Rect as ut,Collection as dt,FocusTracker as _t,KeystrokeHandler as It,first as At,logWarning as gt,logError as Ct,toArray as mt,version as pt,EmitterMixin as Et,scrollViewportToShowTarget as wt,insertToPriorityArray as Tt,scrollAncestorsToShowTarget as ft,ResizeObserver as St,_isMotionReduced as Rt,getConstrainedViewportRect as bt,DomEmitterMixin as Ot}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as kt,ButtonView as vt,View as Nt,SpinnerView as yt,IconView as xt,AutocompleteView as Lt,ListView as Dt,ListItemGroupView as Vt,ListItemView as Pt,ButtonLabelView as Ht,FocusCycler as Mt,createLabeledTextarea as Ut,Dialog as Bt,createDropdown as Gt,addMenuToDropdown as Ft,MenuBarMenuView as Kt,MenuBarMenuListItemButtonView as Wt,DialogViewPosition as Yt,MenuBarMenuListView as $t,MenuBarMenuListItemView as qt,BodyCollection as Qt,BalloonPanelView as Xt,clickOutsideHandler as zt,addListToDropdown as jt,UIModel as Jt,submitHandler as Zt,LabeledFieldView as te,createLabeledInputText as _0x22cbcd,FormHeaderView as _0x4c3dd1,HighlightedTextView as _0x378b1f,ViewCollection as _0x3127bc,FileDialogButtonView as _0x29e35a,InputTextView as _0x5ecc48,SearchTextView as _0x29d55b,ListItemButtonView as _0x5c328f,ButtonLabelWithHighlightView as _0x153bc3,DropdownMenuPanelPositioningFunctions as _0x17daa9,BalloonToolbar as _0x53d0e4,FormRowView as _0x6cbb85,TextareaView as _0x23272a}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x2226b6,ClipboardMarkersUtils as _0xa6f429}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x44e9df,ViewDataTransfer as _0x104872,ViewUpcastWriter as _0x4349bc,Matcher as _0x5e058b,_DetachOperation as _0x42f63b,_insertIntoModelNodeList as _0x967622,_removeFromModelNodeList as _0x5b03c0,ModelRange as _0x5d6ed6,transformOperationSets as _0x2d44f8,ViewDowncastWriter as _0x56ae7f,ModelDocumentFragment as _0xd8720b,ModelPosition as _0x554d31,ModelTreeWalker as _0x5ae065,MarkerOperation as _0x1cab42,InsertOperation as _0x32f2fc}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x491084,escape as _0x2d9792,cloneDeep as _0x4d8886,throttle as _0x134eed,debounce as _0xc92ffd,escapeRegExp as _0x5933ee}from'es-toolkit/compat';import{createParser as _0x24589f}from'eventsource-parser';import{CloudServices as _0x2fe476}from'@ckeditor/ckeditor5-cloud-services/dist/index.js';import{parseDocument as _0x57287f}from'htmlparser2';import{isTag as _0x5778d8,findOne as _0x10d1dd,getParent as _0x586047,findAll as _0x11b699,removeElement as _0x8926a6,prepend as _0x238c6d,prependChild as _0x3d3041,appendChild as _0x2b0d30,append as _0x1d7e6a,find as _0x18d527,isComment as _0x51bc24,replaceElement as _0x1a09b2,getChildren as _0x31b03f,textContent as _0x5408c8}from'domutils';import ti from'dom-serializer';import{Document as _0x617866,Element as _0x1f4caa,Text as _0x54c8f4,cloneNode as _0x252747,isDocument as _0x19438c,isText as _0x4de3bc,NodeWithChildren as _0x43458d}from'domhandler';import{MarkdownGfmMdToHtmlDefaultPlugins as _0x5ed1bb,MarkdownGfmMdToHtml as _0x589477}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import _0x3905b6 from'rehype-sanitize';import{fixElementSuggestionRange as _0x331213,DocumentCompare as _0x490f88,DATA_ID_MODEL_ATTRIBUTE as _0x34af8c,ConfirmMixin as _0x9830fd,getAllMarkersDomElementsSorted as _0x3ba44f,SuggestionsConversion as _0x3fefa0,DATA_ID_VIEW_ATTRIBUTE as _0x1053a9,getMarkerDomElement as _0x3d8b1f}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import _0x53d52c from'morphdom';import{diffArrays as _0x235976}from'diff';const wi='_ungrouppedCommands';function Ti(_0x7edb9,_0x165f85){const _0x42c677=(0x0,_0x165f85['t'])('Other');return _0x7edb9['length']?'groupId'in _0x7edb9[0x0]?_0x7edb9:[{'groupId':wi,'groupLabel':_0x42c677,'order':0x1/0x0,'commands':_0x7edb9}]:[{'groupId':wi,'groupLabel':_0x42c677,'order':0x1/0x0,'commands':[]}];}const fi=globalThis['DataTransfer'],Si='ai-ui';class AIAssistantEditing extends _0x53fc9f{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x5b8fa0}=this,_0x5d09be=['ck-fake-ai-selection'];_0x5b8fa0['config']['get']('ai.assistant.useTheme')&&_0x5d09be['push']('ck-ai-assistant-ui_theme'),_0x5b8fa0['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Si,'view':{'classes':_0x5d09be,'priority':0xc}}),_0x5b8fa0['conversion']['for']('editingDowncast')['markerToElement']({'model':Si,'view':(_0x1649c6,{writer:_0x437ffa})=>{if(!_0x1649c6['markerRange']['isCollapsed'])return null;const _0x3549d0=_0x437ffa['createUIElement']('span');return _0x437ffa['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x3549d0),_0x3549d0;}});}['afterInit'](){!async function(_0xd189db){const _0x1de8a6=_0xe1ecb8([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]),_0x154d92=0x3dffc4e1,_0x4dfc8e=0x3df84e61^_0x154d92,_0x175cf0=window[_0xe1ecb8([0x44,0x61,0x74,0x65])][_0xe1ecb8([0x6e,0x6f,0x77])](),_0x5cc8bd=_0xd189db[_0xe1ecb8([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x18e589=new window[(_0xe1ecb8([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x148532=>{_0x5cc8bd[_0xe1ecb8([0x6f,0x6e,0x63,0x65])](_0xe1ecb8([0x72,0x65,0x61,0x64,0x79]),_0x148532);}),_0x676e5a={[_0xe1ecb8([0x6b,0x74,0x79])]:_0xe1ecb8([0x45,0x43]),[_0xe1ecb8([0x75,0x73,0x65])]:_0xe1ecb8([0x73,0x69,0x67]),[_0xe1ecb8([0x63,0x72,0x76])]:_0xe1ecb8([0x50,0x2d,0x32,0x35,0x36]),[_0xe1ecb8([0x78])]:_0xe1ecb8([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]),[_0xe1ecb8([0x79])]:_0xe1ecb8([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]),[_0xe1ecb8([0x61,0x6c,0x67])]:_0xe1ecb8([0x45,0x53,0x32,0x35,0x36])},_0x8ab6ae=_0x5cc8bd[_0xe1ecb8([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0xe1ecb8([0x67,0x65,0x74])](_0xe1ecb8([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x5cb334(){let _0x47953a,_0x4a0613=null,_0xfdeae8=null;try{if(_0x8ab6ae==_0xe1ecb8([0x47,0x50,0x4c]))return _0xe1ecb8([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x47953a=_0x5269d1(),!_0x47953a)return _0xe1ecb8([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x47953a[_0xe1ecb8([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0xfdeae8=_0x572467(_0x47953a[_0xe1ecb8([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x47953a[_0xe1ecb8([0x6a,0x74,0x69])])),await _0x317e8a()?_0x2aae0d()?_0x168c8d()?_0xe1ecb8([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x41e4aa()?(_0x47953a[_0xe1ecb8([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0xe1ecb8([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x4a0613=_0xef8129(_0xe1ecb8([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x36b701()):_0xe1ecb8([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0xe1ecb8([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0xe1ecb8([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0xe1ecb8([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x168c8d(){const _0x53be8e=[_0xe1ecb8([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0xe1ecb8([0x74,0x72,0x69,0x61,0x6c])][_0xe1ecb8([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x47953a[_0xe1ecb8([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x175cf0/0x3e8:0xe10*_0x4dfc8e;return _0x47953a[_0xe1ecb8([0x65,0x78,0x70])]<_0x53be8e;}function _0x2aae0d(){const _0x14f512=_0x47953a[_0xe1ecb8([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x14f512&&(!!_0x14f512[_0xe1ecb8([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xe1ecb8([0x2a]))||!!_0x14f512[_0xe1ecb8([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xe1ecb8([0x41,0x49])));}function _0x41e4aa(){const _0x3d49da=_0x47953a[_0xe1ecb8([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x3d49da||0x0==_0x3d49da[_0xe1ecb8([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x1d31e1}=new URL(window[_0xe1ecb8([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x3d49da[_0xe1ecb8([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1d31e1))return!0x0;const _0x3aefd2=_0x1d31e1[_0xe1ecb8([0x73,0x70,0x6c,0x69,0x74])](_0xe1ecb8([0x2e]));return _0x3d49da[_0xe1ecb8([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x591f62=>_0x591f62[_0xe1ecb8([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xe1ecb8([0x2a])))[_0xe1ecb8([0x6d,0x61,0x70])](_0x32e1fb=>_0x32e1fb[_0xe1ecb8([0x73,0x70,0x6c,0x69,0x74])](_0xe1ecb8([0x2e])))[_0xe1ecb8([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x296982=>_0x296982[_0xe1ecb8([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x3aefd2[_0xe1ecb8([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0xe1ecb8([0x6d,0x61,0x70])](_0x5d4b09=>Array(_0x3aefd2[_0xe1ecb8([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x5d4b09[_0xe1ecb8([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0xe1ecb8([0x66,0x69,0x6c,0x6c])](_0x5d4b09[0x0]===_0xe1ecb8([0x2a])?_0xe1ecb8([0x2a]):'')[_0xe1ecb8([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x5d4b09))[_0xe1ecb8([0x73,0x6f,0x6d,0x65])](_0x48e36d=>_0x3aefd2[_0xe1ecb8([0x65,0x76,0x65,0x72,0x79])]((_0x35ea2a,_0x2c8374)=>_0x48e36d[_0x2c8374]===_0x35ea2a||_0x48e36d[_0x2c8374]===_0xe1ecb8([0x2a])));}function _0x36b701(){return _0x4a0613&&_0xfdeae8?new window[(_0xe1ecb8([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x89eada,_0x4949b7)=>{_0x4a0613[_0xe1ecb8([0x74,0x68,0x65,0x6e])](_0x89eada,_0x4949b7),_0xfdeae8[_0xe1ecb8([0x74,0x68,0x65,0x6e])](_0x59bc23=>{_0x59bc23!=_0xe1ecb8([0x56,0x61,0x6c,0x69,0x64])&&_0x89eada(_0x59bc23);},_0x4949b7);}):_0x4a0613||_0xfdeae8||_0xe1ecb8([0x56,0x61,0x6c,0x69,0x64]);}}function _0x572467(_0x7da9c0,_0x480a20){return new window[(_0xe1ecb8([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xdc6883=>{if(_0x3b7142())return _0xdc6883(_0xe1ecb8([0x56,0x61,0x6c,0x69,0x64]));_0x5942d1(),_0x5cc8bd[_0xe1ecb8([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0xe1ecb8([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x3d2309=!0x1;const _0x576107=ot();function _0x5de7a9(_0x545722){return!!_0x545722&&(typeof _0x545722===_0xe1ecb8([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x545722===_0xe1ecb8([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x545722[_0xe1ecb8([0x74,0x68,0x65,0x6e])]===_0xe1ecb8([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x545722[_0xe1ecb8([0x63,0x61,0x74,0x63,0x68])]===_0xe1ecb8([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x1b8a89(_0x41973e){_0xa161c(_0x41973e)[_0xe1ecb8([0x74,0x68,0x65,0x6e])](_0x576f2a=>{if(!_0x576f2a||_0x576f2a[_0xe1ecb8([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0xe1ecb8([0x6f,0x6b]))return _0xe1ecb8([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x4a0e3a(_0x570b90(_0x576107+_0x480a20))!=_0x576f2a[_0xe1ecb8([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0xe1ecb8([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0xe1ecb8([0x56,0x61,0x6c,0x69,0x64]);})[_0xe1ecb8([0x74,0x68,0x65,0x6e])](_0x16df95=>(_0x4278ed(),_0x16df95),()=>{const _0x4176ef=_0x4342a3();return null==_0x4176ef?(_0x4278ed(),_0xe1ecb8([0x56,0x61,0x6c,0x69,0x64])):_0xe1ecb8(_0x175cf0-_0x4176ef>(0x19f340e1^_0x154d92)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0xe1ecb8([0x74,0x68,0x65,0x6e])](_0xdc6883)[_0xe1ecb8([0x63,0x61,0x74,0x63,0x68])](()=>{_0xdc6883(_0xe1ecb8([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x1f3a6d=0x3dc92a61^_0x154d92;function _0x4278ed(){const _0x21b606=_0xe1ecb8([0x6c,0x6c,0x63,0x74,0x2d])+_0x4a0e3a(_0x570b90(_0x7da9c0)),_0x33137a=_0x342641(_0x4a0e3a(window[_0xe1ecb8([0x4d,0x61,0x74,0x68])][_0xe1ecb8([0x63,0x65,0x69,0x6c])](_0x175cf0/_0x1f3a6d)));window[_0xe1ecb8([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0xe1ecb8([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x21b606,_0x33137a);}function _0x4342a3(){const _0x4b4773=_0xe1ecb8([0x6c,0x6c,0x63,0x74,0x2d])+_0x4a0e3a(_0x570b90(_0x7da9c0)),_0x313ce0=window[_0xe1ecb8([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0xe1ecb8([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4b4773);return _0x313ce0?window[_0xe1ecb8([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x342641(_0x313ce0),0x10)*_0x1f3a6d:null;}function _0xa161c(_0x58a3f8){return new window[(_0xe1ecb8([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x452d94,_0x32aebf)=>{_0x58a3f8[_0xe1ecb8([0x74,0x68,0x65,0x6e])](_0x452d94,_0x32aebf),window[_0xe1ecb8([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x32aebf,0x3dfe1021^_0x154d92);});}}_0x5cc8bd[_0xe1ecb8([0x6f,0x6e])](_0xe1ecb8([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x44ab3c,_0x25780f)=>{if(_0x25780f[0x0]!=_0x7da9c0)return _0xdc6883(_0xe1ecb8([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x25780f[0x1]={..._0x25780f[0x1],[_0xe1ecb8([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x576107};},{[_0xe1ecb8([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0xe1ecb8([0x68,0x69,0x67,0x68])}),_0x5cc8bd[_0xe1ecb8([0x6f,0x6e])](_0xe1ecb8([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x351047=>{_0x5de7a9(_0x351047[_0xe1ecb8([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x3d2309=!0x0,_0x1b8a89(_0x351047[_0xe1ecb8([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0xe1ecb8([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0xe1ecb8([0x6c,0x6f,0x77])}),_0x18e589[_0xe1ecb8([0x74,0x68,0x65,0x6e])](()=>{_0x3d2309||_0xdc6883(_0xe1ecb8([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x3b7142(){return _0x5cc8bd[_0xe1ecb8([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0xe1ecb8([0x76,0x69,0x65,0x77])][_0xe1ecb8([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0xe1ecb8([0x61,0x75,0x74,0x6f]);}function _0x5942d1(){_0x5cc8bd[_0xe1ecb8([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0xe1ecb8([0x76,0x69,0x65,0x77])][_0xe1ecb8([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0xe1ecb8([0x61,0x75,0x74,0x6f]);}}function _0xef8129(_0x1481c4){const _0x5c368c=[new window[(_0xe1ecb8([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x57eecf=>setTimeout(_0x57eecf,0x3df6fa2d^_0x154d92)),_0x18e589[_0xe1ecb8([0x74,0x68,0x65,0x6e])](()=>new window[(_0xe1ecb8([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4421d8=>{let _0x2200f0=0x0;_0x5cc8bd[_0xe1ecb8([0x6d,0x6f,0x64,0x65,0x6c])][_0xe1ecb8([0x6f,0x6e])](_0xe1ecb8([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x3a2804,_0x4683d2)=>{_0x4683d2[0x0][_0xe1ecb8([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x2200f0++,_0x2200f0==(0x3dffc109^_0x154d92)&&(_0x4421d8(),_0x3a2804[_0xe1ecb8([0x6f,0x66,0x66])]());});}))];return window[_0xe1ecb8([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0xe1ecb8([0x72,0x61,0x63,0x65])](_0x5c368c)[_0xe1ecb8([0x74,0x68,0x65,0x6e])](()=>_0x1481c4);}async function _0xbaa125(){await _0x18e589,_0x5cc8bd[_0xe1ecb8([0x6d,0x6f,0x64,0x65,0x6c])][_0xe1ecb8([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x227c18,_0x5cc8bd[_0xe1ecb8([0x6d,0x6f,0x64,0x65,0x6c])][_0xe1ecb8([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x227c18,_0x5cc8bd[_0xe1ecb8([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0xe1ecb8([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x4d91f2(_0x3c1fcb){const _0x2e210a=_0x564ed2();_0x5cc8bd[_0x2e210a]=_0xe1ecb8([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x3c1fcb,_0x3c1fcb!=_0xe1ecb8([0x56,0x61,0x6c,0x69,0x64])&&_0xbaa125();}function _0x564ed2(){const _0x19ab81=window[_0xe1ecb8([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0xe1ecb8([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0xe1ecb8([0x6e,0x6f,0x77])]())[_0xe1ecb8([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0xe1ecb8([0x2e]),'');let _0x8c0c55=_0xe1ecb8([0x6e]);for(let _0x49f9a9=0x0;_0x49f9a9<_0x19ab81[_0xe1ecb8([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x49f9a9+=0x2){let _0x3c8857=window[_0xe1ecb8([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x19ab81[_0xe1ecb8([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x49f9a9,_0x49f9a9+0x2));_0x3c8857>=_0x1de8a6[_0xe1ecb8([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x3c8857-=_0x1de8a6[_0xe1ecb8([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x8c0c55+=_0x1de8a6[_0x3c8857];}return _0x8c0c55;}function _0x5269d1(){const _0x1a2219=_0x8ab6ae[_0xe1ecb8([0x73,0x70,0x6c,0x69,0x74])](_0xe1ecb8([0x2e]));if(0x3!=_0x1a2219[_0xe1ecb8([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0xe8fa47(_0x1a2219[0x1]);function _0xe8fa47(_0x520211){const _0x1ea7ef=_0x586a12(_0x520211);return _0x1ea7ef&&_0x29fdb2()?_0x1ea7ef:null;function _0x29fdb2(){const _0x39de65=_0x1ea7ef[_0xe1ecb8([0x6a,0x74,0x69])],_0x59aa13=window[_0xe1ecb8([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x39de65[_0xe1ecb8([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x39de65[_0xe1ecb8([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x499d29={..._0x1ea7ef,[_0xe1ecb8([0x6a,0x74,0x69])]:_0x39de65[_0xe1ecb8([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x39de65[_0xe1ecb8([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x499d29[_0xe1ecb8([0x76,0x63])],_0x570b90(_0x499d29)==_0x59aa13;}}}async function _0x317e8a(){let _0x42c4de=!0x0;try{const _0x182724=_0x8ab6ae[_0xe1ecb8([0x73,0x70,0x6c,0x69,0x74])](_0xe1ecb8([0x2e])),[_0x43bebb,_0x4ce08b,_0x2be051]=_0x182724;return _0x18bab1(_0x43bebb),await _0x59b154(_0x43bebb,_0x4ce08b,_0x2be051),_0x42c4de;}catch{return!0x1;}function _0x18bab1(_0x17e804){const _0x2641d3=_0x586a12(_0x17e804);_0x2641d3&&_0x2641d3[_0xe1ecb8([0x61,0x6c,0x67])]==_0xe1ecb8([0x45,0x53,0x32,0x35,0x36])||(_0x42c4de=!0x1);}async function _0x59b154(_0x5887f2,_0x3ec7a5,_0x2c8a72){const _0x32e359=window[_0xe1ecb8([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0xe1ecb8([0x66,0x72,0x6f,0x6d])](_0x2d0c1b(_0x2c8a72),_0x28a69e=>_0x28a69e[_0xe1ecb8([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x205fbc=new window[(_0xe1ecb8([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0xe1ecb8([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x5887f2+_0xe1ecb8([0x2e])+_0x3ec7a5),_0x2656d9=window[_0xe1ecb8([0x63,0x72,0x79,0x70,0x74,0x6f])][_0xe1ecb8([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x2656d9)return;const _0x31e9cf=await _0x2656d9[_0xe1ecb8([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0xe1ecb8([0x6a,0x77,0x6b]),_0x676e5a,{[_0xe1ecb8([0x6e,0x61,0x6d,0x65])]:_0xe1ecb8([0x45,0x43,0x44,0x53,0x41]),[_0xe1ecb8([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0xe1ecb8([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0xe1ecb8([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x2656d9[_0xe1ecb8([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0xe1ecb8([0x6e,0x61,0x6d,0x65])]:_0xe1ecb8([0x45,0x43,0x44,0x53,0x41]),[_0xe1ecb8([0x68,0x61,0x73,0x68])]:{[_0xe1ecb8([0x6e,0x61,0x6d,0x65])]:_0xe1ecb8([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x31e9cf,_0x32e359,_0x205fbc)||(_0x42c4de=!0x1);}}function _0x586a12(_0x1cc112){return _0x1cc112[_0xe1ecb8([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0xe1ecb8([0x65,0x79]))?JSON[_0xe1ecb8([0x70,0x61,0x72,0x73,0x65])](_0x2d0c1b(_0x1cc112)):null;}function _0x2d0c1b(_0x1a5b32){return window[_0xe1ecb8([0x61,0x74,0x6f,0x62])](_0x1a5b32[_0xe1ecb8([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0xe1ecb8([0x2b]))[_0xe1ecb8([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0xe1ecb8([0x2f])));}function _0x570b90(_0x3e461e){let _0x18a0b6=0x1505;function _0xa544b9(_0x570b65){for(let _0x1df587=0x0;_0x1df587<_0x570b65[_0xe1ecb8([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1df587++){const _0x430dae=_0x570b65[_0xe1ecb8([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x1df587);_0x18a0b6=(_0x18a0b6<<0x5)+_0x18a0b6+_0x430dae,_0x18a0b6&=_0x18a0b6;}}function _0x23b007(_0xad4903){Array[_0xe1ecb8([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0xad4903)?_0xad4903[_0xe1ecb8([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x23b007):_0xad4903&&typeof _0xad4903==_0xe1ecb8([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0xe1ecb8([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0xad4903)[_0xe1ecb8([0x73,0x6f,0x72,0x74])]()[_0xe1ecb8([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x132f76,_0x26fe72])=>{_0xa544b9(_0x132f76),_0x23b007(_0x26fe72);}):_0xa544b9(window[_0xe1ecb8([0x53,0x74,0x72,0x69,0x6e,0x67])](_0xad4903));}return _0x23b007(_0x3e461e),_0x18a0b6>>>0x0;}function _0x4a0e3a(_0x48ea45){return _0x48ea45[_0xe1ecb8([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0xe1ecb8([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0xe1ecb8([0x30]));}function _0x342641(_0x2dde57){return _0x2dde57[_0xe1ecb8([0x73,0x70,0x6c,0x69,0x74])]('')[_0xe1ecb8([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0xe1ecb8([0x6a,0x6f,0x69,0x6e])]('');}function _0x227c18(){}function _0xe1ecb8(_0x642cfb){return _0x642cfb['map'](_0x1708b4=>String['fromCharCode'](_0x1708b4))['join']('');}_0x4d91f2(await _0x5cb334());}(this);}['showFakeVisualSelection'](){const _0x234abb=this['editor']['model'];_0x234abb['change'](_0x5d7685=>{const _0x282798=_0x234abb['document']['selection']['getRanges']();let _0x412450=0x0;for(const _0x2a9644 of _0x282798){const _0x38b15c=Si+':'+_0x412450;if(_0x234abb['markers']['has'](_0x38b15c))_0x5d7685['updateMarker'](_0x38b15c,{'range':_0x2a9644});else{if(_0x2a9644['start']['isAtEnd']){const _0x25dc35=_0x2a9644['start']['getLastMatchingPosition'](({item:_0x185306})=>!_0x234abb['schema']['isContent'](_0x185306),{'boundaries':_0x2a9644});_0x5d7685['addMarker'](_0x38b15c,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5d7685['createRange'](_0x25dc35,_0x2a9644['end'])});}else _0x5d7685['addMarker'](_0x38b15c,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2a9644});}_0x412450++;}});}['hideFakeVisualSelection'](){const _0xdd5df3=this['editor']['model'],_0x489c68=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](Si));_0x489c68['length']&&_0xdd5df3['change'](_0x1c8f3f=>{_0x489c68['forEach'](_0xfb22e1=>{_0x1c8f3f['removeMarker'](_0xfb22e1);});});}['insertContent'](_0x267048,_0x51fcf8){const _0x112fa1=this['_getAISelection'](),_0x1e1038=_0x51fcf8||_0x112fa1['getFirstRange']();this['editor']['model']['canEditAt'](_0x1e1038)&&this['editor']['model']['change'](_0x37961d=>{this['hideFakeVisualSelection'](),_0x51fcf8||this['_resetContentOfSelectedTableCells'](_0x37961d,_0x112fa1),this['_pasteHTMLUsingClipboard']({'insertAt':_0x1e1038,'writer':_0x37961d,'html':_0x267048});});}['insertContentBelow'](_0x30310d){const {model:_0x37efe6}=this['editor'],_0x3a2e39=this['_getAISelection']();_0x37efe6['change'](()=>{const _0x580c1c=this['_prepareTableInsertBelowPosition'](_0x30310d,_0x3a2e39)||this['_getDefaultInsertBelowPosition'](_0x3a2e39);this['insertContent'](_0x30310d,_0x580c1c);});}['_getAISelection'](){const _0xe0dda1=this['editor']['model'],_0x358619=Array['from'](_0xe0dda1['markers']['getMarkersGroup'](Si))['map'](_0x2ff2cd=>_0x2ff2cd['getRange']());return _0xe0dda1['createSelection'](_0x358619);}['_pasteHTMLUsingClipboard']({writer:_0x1ddb98,html:_0x1e8695,insertAt:_0x18a78d}){const {view:_0x516a8d}=this['editor']['editing'],_0x19a004=this['editor']['plugins']['get'](_0x2226b6),_0x113164=new fi();_0x113164['setData']('text/html',_0x1e8695);const _0x190c0e=new ClipboardEvent('paste',{'clipboardData':_0x113164}),_0x330ffe=new _0x44e9df(_0x516a8d,_0x190c0e,{'dataTransfer':new _0x104872(_0x113164)});_0x1ddb98['setSelection'](_0x18a78d);const _0x12d36f=(_0x2e43a6,_0x29be4f)=>{_0x29be4f['resultRange']&&_0x1ddb98['setSelection'](_0x29be4f['resultRange']);};_0x19a004['once']('contentInsertion',_0x12d36f,{'priority':'lowest'}),_0x516a8d['document']['fire']('paste',_0x330ffe),_0x19a004['off']('contentInsertion',_0x12d36f);}['_getDefaultInsertBelowPosition'](_0x485a3c){const {model:_0x50cdbf}=this['editor'],_0x41bdee=Array['from'](_0x485a3c['getSelectedBlocks']());return _0x41bdee['length']?_0x50cdbf['createPositionAfter'](_0x41bdee['pop']()):_0x485a3c['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0xaed221,_0x336ced){const {model:_0x1b2f3d,plugins:_0x4affba}=this['editor'];if(_0x4affba['has']('TableUtils')){const _0x30ed7a=_0x4affba['get']('TableUtils')['getSelectedTableCells'](_0x336ced);if(_0x30ed7a['length']){const _0x113094=this['_getTableRowCountFromContent'](_0xaed221),_0x2e8d22=this['_createEmptyTableRows'](_0x30ed7a,_0x113094);return _0x1b2f3d['createPositionAt'](_0x2e8d22,0x0);}}return null;}['_getTableRowCountFromContent'](_0x3c07cb){const _0x20f59a=this['editor']['plugins']['get']('TableUtils'),_0x10758e=this['editor']['data']['parse'](_0x3c07cb),_0x457f02=Array['from'](_0x10758e['getChildren']())['filter'](_0x378edd=>_0x378edd['is']('element','table'));let _0x584743=0x0;return _0x457f02['forEach'](_0x1fcc99=>{_0x584743+=_0x20f59a['getRows'](_0x1fcc99);}),_0x584743;}['_createEmptyTableRows'](_0x265fff,_0x45aae3){const _0x3f9cbf=this['editor']['plugins']['get']('TableUtils'),_0x15ef00=_0x3f9cbf['getRowIndexes'](_0x265fff),_0x1392b5=_0x3f9cbf['getColumnIndexes'](_0x265fff),_0x3c95d1=_0x15ef00['last']+0x1,_0x1771e9=_0x1392b5['first'],_0x5875ae=_0x265fff[0x0]['findAncestor']('table');for(let _0x271495=0x0;_0x271495<_0x45aae3;_0x271495++)_0x3f9cbf['insertRows'](_0x5875ae,{'at':_0x3c95d1});return _0x5875ae['getChild'](_0x3c95d1)['getChild'](_0x1771e9);}['_resetContentOfSelectedTableCells'](_0xc6ae62,_0x1a7f21){const {plugins:_0x46001b}=this['editor'],{model:_0x12656b}=_0xc6ae62;if(!_0x46001b['has']('TableUtils'))return;_0x46001b['get']('TableUtils')['getSelectedTableCells'](_0x1a7f21)['length']&&_0x12656b['deleteContent'](_0x1a7f21);}}class AIAdapter extends _0x53fc9f{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new at('aiadapter-text-adapter-not-set',null);}}class AIRequestError extends Error{constructor(_0x5f07a3){super(_0x5f07a3),this['name']='AIRequestError';}}function Ri(_0x4c5b14,_0xff1eae,_0x273dcb){const t=_0x4c5b14['t'];switch(_0xff1eae){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',_0x273dcb);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x273dcb);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'},_0x273dcb);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_AWS_NOT_SUPPORTED':return t({'id':'AI_ERROR_AWS_NOT_SUPPORTED','string':'The\x20AWS\x20integration\x20is\x20no\x20longer\x20supported.\x20Please\x20contact\x20the\x20support.'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0xff1eae;}}class ShowAIAssistantCommand extends _0xae9ca1{['_commandDefinitions'];constructor(_0x1bb8c3,_0x3d7a18){super(_0x1bb8c3),this['_commandDefinitions']=_0x3d7a18,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x253f8c,_0x49ce22,_0x1cc308)=>{this['isEnabled']&&(this['enabledCommandsIds']=bi(this['_commandDefinitions'],_0x1cc308));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0xa176a4,_0x1d8860,_0x73a656)=>{this['enabledCommandsIds']=_0x73a656?bi(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x5f3abb=this['editor']['model'];this['_hasContext']=function(_0x592b44){const _0x44eacb=_0x592b44['document']['selection'];return _0x44eacb['isCollapsed']?0x0!==[..._0x44eacb['getSelectedBlocks']()]['length']&&![..._0x44eacb['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x592b44['hasContent'](_0x44eacb['getFirstRange']());}(_0x5f3abb);const _0x545096=_0x5f3abb['document']['selection'],_0x380110=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x2bb76c of _0x545096['getRanges']())for(const _0x57a2f4 of _0x2bb76c['getItems']())if(_0x57a2f4['is']('element')&&_0x380110['includes'](_0x57a2f4['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x3f08ef='',_0x4bcf47='',_0x4e0313='custom'){this['editor']['plugins']['get'](AIAssistantUI)['showUI'](_0x3f08ef,_0x4bcf47,_0x4e0313);}}function bi(_0x31892e,_0x3898fe){const _0x267630=new Set();for(const _0x336358 of _0x31892e['values']())(_0x3898fe||!0x1===_0x336358['requiresContent'])&&_0x267630['add'](_0x336358['id']);return Array['from'](_0x267630);}const Oi=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class AIAssistantController extends/* #__PURE__ -- @preserve */
|
|
24
|
-
ht(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x66367e,_0x31537c,_0x230a3c){super(),this['editor']=_0x66367e,this['textAdapter']=_0x31537c,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x230a3c,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x3f5dd2,_0x263a7f,_0x436717)=>{this['view']['value']=this['_sanitizeHTML'](_0x436717);}),this['listenTo'](this['view'],'submitPrompt',(_0x36840f,_0xdd4ea9)=>{const _0x1d66f0=this['currentContext']||this['initialContext'];this['_handleQuery'](_0xdd4ea9,_0x1d66f0,'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:_0x43f66d,query:_0x32d6d8,htmlContent:_0x5b5797,label:_0x216fb6,mainActionLabel:_0x5c9989}){this['view']['prompt']=_0x216fb6,this['view']['mainAction']=_0x5c9989,this['initialContext']=_0x5b5797,_0x32d6d8&&(this['view']['isRendered']?this['_handleQuery'](_0x32d6d8,_0x5b5797,_0x43f66d,_0x216fb6):this['view']['once']('render',()=>{this['_handleQuery'](_0x32d6d8,_0x5b5797,_0x43f66d,_0x216fb6);}));}['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'](_0x58a440,_0x43da05,_0x1818d5,_0x25919c){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x43da05,this['previousQuery']=_0x58a440,this['previousLabel']=_0x25919c||_0x58a440,this['previousActionId']=_0x1818d5,new Promise(_0x5b522f=>{this['textAdapter']['makeRequest']({'query':_0x58a440,'context':_0x43da05,'onData':_0x50e8e6=>{this['currentResponse']=_0x50e8e6,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x1818d5})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x1a84d6=>{_0x1a84d6 instanceof AIRequestError?this['view']['handleError'](_0x1a84d6['message']):this['view']['handleError'](),_0x5b522f();})['finally'](()=>{this['stopProcessing'](),_0x5b522f();});});}['_parseAndNormalizeContent'](_0x4df9fa,_0x17420d=!0x1){const _0x53a659=Oi['exec'](_0x4df9fa);_0x4df9fa=_0x53a659?_0x4df9fa['substring'](_0x53a659[0x1]['length']):_0x4df9fa['length']<0x64&&!_0x17420d?'':this['_stripMarkdownSyntax'](_0x4df9fa);const _0x1bc693=this['_domParser']['parseFromString'](_0x4df9fa,'text/html');if(_0x53a659){const _0x31646d=Array['from'](_0x1bc693['body']['childNodes']);_0x31646d['reverse']();for(const _0x184f59 of _0x31646d){if(_0x184f59['nodeType']==Node['ELEMENT_NODE'])break;_0x184f59['remove']();}}const _0x24c9b2=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x1bc693['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x24c9b2);const _0x14fd33=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x398273=this['editor']['data']['toModel'](_0x24c9b2);return _0x14fd33||_0x398273['markers']['clear'](),this['editor']['data']['stringify'](_0x398273);}['_normalizeResponseHeadings'](_0x582de6){const _0x5422d9=new _0x4349bc(this['editor']['editing']['view']['document']),_0x2a2176=new _0x5e058b({'name':/^h[1-5]$/}),_0x1e2a3a=[];let _0x2d4d67=!0x1;for(const _0x4d5030 of _0x582de6)_0x4d5030['is']('element')&&_0x2a2176['match'](_0x4d5030)&&(_0x1e2a3a['push'](_0x4d5030),'h1'==_0x4d5030['name']&&(_0x2d4d67=!0x0));if(_0x2d4d67){for(const _0xbba934 of _0x1e2a3a)_0x5422d9['rename']('h'+(parseInt(_0xbba934['name'][0x1])+0x1),_0xbba934);}}['_isH1TagSupportEnabled'](){const {data:_0x36b0c9,editing:_0x4d8021}=this['editor'],_0x37d691=_0x36b0c9['htmlProcessor']['toView']('<h1></h1>'),_0x20e713=_0x36b0c9['toView'](_0x36b0c9['toModel'](_0x37d691));return!!_0x4d8021['view']['domConverter']['viewToDom'](_0x20e713)['querySelector']('h1');}['_sanitizeHTML'](_0x1cde78){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x1cde78),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x29ee7e){const _0x267038=_0x29ee7e['trim']();return _0x267038['startsWith']('```html')?_0x267038['endsWith']('```')?_0x267038['substring'](0x7,_0x267038['length']-0x3):_0x267038['substring'](0x7):_0x29ee7e;}}const ki={'REPLACE':'replace','INSERT':'insert'};class AIFormToolbarView extends kt{constructor(_0x46c69a){super(_0x46c69a),this['set']('isVisible',!0x1),this['set']('mainAction',ki['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x1dafb3=>Ri(_0x46c69a,'AI_'+_0x1dafb3['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Ri(_0x46c69a,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Ri(_0x46c69a,'Try\x20again')),this['stopButton']=this['_createButton'](Ri(_0x46c69a,'Stop'));const _0x48adb8=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x48adb8['if']('isVisible','ck-hidden',_0x548fac=>!_0x548fac)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x3340c6,_0x5a24ed){const _0x547e95=new vt(this['locale']);return _0x547e95['set']({'label':_0x3340c6,'class':_0x5a24ed||'','isVisible':!0x0,'withText':!0x0}),_0x547e95;}}class AIFormContentArea extends Nt{['contentFieldView'];['copyButtonView'];constructor(_0x3cd026,_0x3e08ea=''){super(_0x3cd026),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x5abaad=this['bindTemplate'];this['contentFieldView']=new ContentFieldView(_0x3cd026,_0x3e08ea),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x5abaad['if']('isVisible','ck-hidden',_0x1ca6ab=>!_0x1ca6ab)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x5abaad['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 _0x295d7f=!0x1;this['on']('change:value',(_0x54e24a,_0x18e0e2,_0x199b7d)=>{const _0x324cca=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x199b7d),this['isProcessing']&&_0x324cca&&!_0x295d7f&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x21abc4,_0x3e8fe8,_0xc61151)=>{_0x295d7f=!0x1,_0xc61151?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x295d7f=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x295d7f=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x544699=this['locale'],_0x5dfbda=new vt(this['locale']),_0x31fe6c='ck-ai-form__copy-button';return _0x5dfbda['set']({'label':Ri(_0x544699,'Copy'),'icon':_0x5c3d91,'class':_0x31fe6c,'tooltip':!0x0}),_0x5dfbda['bind']('isVisible')['to'](this,'value',_0x2efa34=>!!_0x2efa34),_0x5dfbda['bind']('isEnabled')['to'](this,'isProcessing',_0x247a16=>!_0x247a16),_0x5dfbda['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x5dfbda['icon']=_0x489882,_0x5dfbda['class']=_0x31fe6c+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x5dfbda['icon']=_0x5c3d91,_0x5dfbda['class']=_0x31fe6c;},0x3e8);}),_0x5dfbda;}['_copyHTMLToClipboard'](_0x1659bc){const {window:_0x36c72b,document:_0x4cf7bb}=ct;if(_0x36c72b['ClipboardItem']){const {Blob:_0x136b64,ClipboardItem:_0x312468}=_0x36c72b,_0x1f7d73=[new _0x312468({'text/html':new _0x136b64([_0x1659bc['innerHTML']],{'type':'text/html'}),'text/plain':new _0x136b64([_0x1659bc['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x1f7d73);}else{const _0x42476a=_0x4cf7bb['createElement']('div');_0x42476a['style']['position']='absolute',_0x42476a['style']['left']='-9999px',_0x42476a['innerHTML']='<span>[</span>'+_0x1659bc['innerHTML']+'<span>]</span>',_0x4cf7bb['body']['appendChild'](_0x42476a);const _0x2e165d=_0x4cf7bb['createRange']();_0x2e165d['setStartAfter'](_0x42476a['firstElementChild']),_0x2e165d['setEndBefore'](_0x42476a['lastElementChild']);const _0x5ed063=_0x36c72b['getSelection']();_0x5ed063['removeAllRanges'](),_0x5ed063['addRange'](_0x2e165d),_0x4cf7bb['execCommand']('copy'),_0x42476a['remove']();}}}class ContentFieldView extends Nt{constructor(_0x54a501,_0x3bc7e4=''){super(_0x54a501),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x3bc7e4,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x13ce58){this['element']['innerHTML']=_0x13ce58;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0xe872a3=new Nt(),_0x56f432=this['locale'],_0x3197c4=new yt();return _0x3197c4['isVisible']=!0x0,_0xe872a3['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x3197c4,{'text':Ri(_0x56f432,'AI\x20is\x20writing...')}]}),_0xe872a3['render'](),_0xe872a3;}}class AIFormErrorView extends Nt{constructor(_0x1e4f4c,_0x25b8e2=''){super(_0x1e4f4c);const _0x2a0eec=new xt(),_0x295da0=this['bindTemplate'];this['set']('text',_0x25b8e2),_0x2a0eec['content']=_0x2b1be1,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x2a0eec,{'text':_0x295da0['to']('text')}]});}}class AIFormPromptView extends Lt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x216c18,_0x441ea3){super(_0x216c18,_0x441ea3),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',(_0x5dfbf8,_0xb65b72)=>{_0x5dfbf8['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0xb65b72());});}['_createSubmitButton'](){const _0x3c9220=new vt(this['locale']),_0x2c3bd0=this['locale'];return _0x3c9220['set']({'icon':_0xcffe77,'label':Ri(_0x2c3bd0,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x3c9220['on']('execute',()=>{this['submit']();}),_0x3c9220['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x174adb,_0x3aa677)=>!_0x174adb&&_0x3aa677),_0x3c9220;}['_createShowHistoryButton'](){const _0x39ae54=new vt(this['locale']),_0x584bc2=this['resultsView'],_0xb60b85=this['locale'];_0x39ae54['set']({'label':Ri(_0xb60b85,'History'),'withText':!0x1,'icon':_0x33c29f,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x39ae54['bind']('isOn')['to'](_0x584bc2,'isVisible'),_0x39ae54['bind']('isEnabled')['to'](this,'isEnabled'),_0x39ae54['on']('execute',()=>{_0x584bc2['isVisible']=!_0x584bc2['isVisible'],_0x584bc2['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x15fb97=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x25bd7e=new ut(this['queryView']['fieldView']['element']),_0x44eddd=_0x25bd7e['width'],_0x536b77='rtl'===_0xb60b85['uiLanguageDirection']?'left':'right';_0x25bd7e['excludeScrollbarsAndBorders'](),_0x39ae54['element']['style'][_0x536b77]=_0x44eddd-_0x25bd7e['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x15fb97),this['on']('render',_0x15fb97),_0x39ae54;}['submit'](){const _0x527af7=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x527af7);}['focus'](_0x514aae){-0x1===_0x514aae?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class AIHistoryListView extends Dt{['historyGroupView'];['clearHistoryButton'];constructor(_0x2975d9){super(_0x2975d9),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Vt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Ri(_0x2975d9,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x1869b9=0x0;for(const _0x551910 of this['items'])_0x1869b9+=_0x551910['items']['length'];return{'resultsCount':_0x1869b9,'totalItemsCount':_0x1869b9};}['_createClearHistoryButton'](){const _0x59892e=this['locale'],_0x4bf756=new vt(this['locale']);return _0x4bf756['set']({'label':'('+Ri(_0x59892e,'Clear')+')','withText':!0x0}),_0x4bf756['on']('execute',()=>this['fire']('clearHistory')),_0x4bf756;}}class AIHistoryListItemView extends Pt{constructor(_0x4ec4c2){super();const _0x3be3be=new Ht(),_0x2b816a=new vt(this['locale'],_0x3be3be);this['children']['add'](_0x2b816a),_0x2b816a['set']({'label':_0x4ec4c2['prompt'],'withText':!0x0}),_0x2b816a['on']('execute',()=>{this['fire']('execute',{'value':_0x491084(_0x4ec4c2['prompt'])});});}}const vi='CKEditor/AIFormView/PromptHistory';class PromptHistory extends dt{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x1ac208,_0x25b1c9)=>{const _0x2c122d=Ni(_0x25b1c9['prompt']);for(const _0x531dde of this)if(_0x531dde!=_0x25b1c9&&Ni(_0x531dde['prompt'])===_0x2c122d){this['remove'](_0x531dde);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x464f9e=sessionStorage['getItem'](vi)||'[]';this['addMany'](JSON['parse'](_0x464f9e));}['_saveToSessionStorage'](){sessionStorage['setItem'](vi,JSON['stringify'](this['map'](_0x2acd55=>_0x2acd55)));}}function Ni(_0x5d2536){return _0x5d2536['toLowerCase']()['trim']();}class AIFormView extends Nt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x3744c7,_0x24f32e,_0x2910e4=''){super(_0x3744c7),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',ki['REPLACE']),this['_promptHistory']=new PromptHistory(),this['errorView']=new AIFormErrorView(_0x3744c7),this['contentArea']=new AIFormContentArea(_0x3744c7,_0x2910e4),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new _t(),this['keystrokes']=new It(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x3da30c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x24f32e],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x3da30c['if']('isError','ck-hidden',_0x466af4=>!_0x466af4)]},'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'](_0x11a21f=0x1){-0x1===_0x11a21f?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 _0xe25dbc=this['locale'],_0x884298=new AIFormPromptView(_0xe25dbc,{'queryView':{'label':Ri(_0xe25dbc,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':Ut,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Ri(_0xe25dbc,'Empty\x20history'),'secondary':Ri(_0xe25dbc,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x884298['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x1ae876,_0x21e8b9)=>_0x1ae876&&!_0x21e8b9),this['listenTo'](_0x884298,'submit',(_0x2320c3,_0x1b9873)=>{this['prompt']=_0x1b9873;const _0x2aebee=_0x2d9792(_0x1b9873);this['fire']('submitPrompt',_0x2aebee),_0x1b9873['trim']()&&this['_promptHistory']['add']({'prompt':_0x2aebee},0x0);},{'priority':'high'}),_0x884298;}['_createHistoryView'](){const _0x22f3d1=new AIHistoryListView(this['locale']);return _0x22f3d1['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](AIHistoryListItemView),_0x22f3d1['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x22f3d1;}['_createToolbar'](){const _0x21708a=new AIFormToolbarView(this['locale']);return _0x21708a['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x33dc7b,_0x16b1c0,_0x48630d)=>_0x33dc7b&&!_0x16b1c0&&!!_0x48630d),_0x21708a['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x21708a['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x14a53a,_0x2d47f8,_0x2537d6)=>_0x14a53a&&!_0x2d47f8&&!!_0x2537d6),_0x21708a['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x21708a['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0xa968c3,_0x46ec7e)=>_0xa968c3&&!_0x46ec7e),_0x21708a['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x21708a['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x21708a['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x21708a;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x3fb85c=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Ri(_0x3fb85c,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x459133){const _0x4e1e17=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x459133||Ri(_0x4e1e17,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const yi=globalThis['DataTransfer'];class AIAssistantUI extends _0x53fc9f{['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[_0xa6f429,AIAssistantEditing,AIAdapter,Bt];}constructor(_0x112afb){super(_0x112afb),_0x112afb['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x112afb['config']['define']('ai.assistant.contentAreaCssClass',''),_0x112afb['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x112afb['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x54d4e5}=this;this['_aiAdapter']=_0x54d4e5['plugins']['get'](AIAdapter),this['_dialog']=_0x54d4e5['plugins']['get'](Bt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x861ee8=new ShowAIAssistantCommand(_0x54d4e5,Array['from'](this['_commandDefinitions']['values']()));_0x54d4e5['commands']['add']('showAIAssistant',_0x861ee8),_0x54d4e5['ui']['componentFactory']['add']('aiCommands',_0xc0347e=>{const _0x1eecff=Gt(_0xc0347e);return _0x1eecff['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x1eecff['buttonView']['set']({'label':Ri(_0xc0347e,'AI\x20Commands'),'icon':_0x94995e,'tooltip':!0x0}),_0x1eecff['on']('execute',_0x1fbc8b=>this['_onExecute'](_0x1fbc8b['source']['id'])),Ft(_0x1eecff,_0x54d4e5['ui']['view']['body'],function(_0x695192){const _0x1dc766=Ti(_0x695192['config']['get']('ai.assistant.commands'),_0x695192['locale']),_0x20318d=Li(_0x695192,_0x1dc766)['filter'](_0x45e784=>_0x45e784['commands']['length']);if(0x1===_0x20318d['length'])return Li(_0x695192,_0x20318d[0x0]['commands'])['map'](_0x12576a=>({'id':_0x12576a['id'],'label':_0x12576a['label']}));return _0x20318d['map'](_0x37037d=>{const {groupId:_0x596c9a,groupLabel:_0x180ba5,commands:_0x49974a}=_0x37037d,_0x322193=Li(_0x695192,_0x49974a)['map'](_0x47eb29=>({'id':_0x47eb29['id'],'label':_0x47eb29['label']}));return{'id':_0x596c9a,'menu':_0x180ba5||_0x596c9a,'children':_0x322193};});}(_0x54d4e5),{'ariaLabel':Ri(_0xc0347e,'AI\x20Commands')}),_0x1eecff['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x861ee8['on']('change:enabledCommandsIds',_0x54a24e),_0x1eecff['menuView']['once']('render',_0x54a24e),_0x1eecff;function _0x54a24e(){_0x1eecff['isEnabled']=_0x861ee8['enabledCommandsIds']['length']>0x0;for(const _0x2af6bd of _0x1eecff['menuView']['buttons'])_0x2af6bd['isEnabled']=_0x861ee8['enabledCommandsIds']['includes'](_0x2af6bd['id']);}}),_0x54d4e5['ui']['componentFactory']['add']('menuBar:aiCommands',_0x4ec704=>{const _0x3f31a7=new Kt(_0x4ec704);_0x3f31a7['buttonView']['set']({'label':Ri(_0x4ec704,'AI\x20Commands'),'icon':_0x94995e}),_0x3f31a7['bind']('isEnabled')['to'](_0x861ee8,'enabledCommandsIds',_0x15ca55=>_0x15ca55['length']>0x0);const _0x26328c=Ti(_0x54d4e5['config']['get']('ai.assistant.commands'),_0x4ec704);return this['_populateMenuBarMenu'](_0x861ee8,_0x3f31a7,_0x26328c,_0x3ab1b7=>this['_onExecute'](_0x3ab1b7)),_0x3f31a7;}),_0x54d4e5['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x444ed7=this['_createAIAssistantUIButton'](vt);return _0x444ed7['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x444ed7;}),_0x54d4e5['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x1174f8=this['_createAIAssistantUIButton'](Wt);return _0x1174f8['set']({'role':'menuitemcheckbox'}),_0x1174f8;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x2a7e6d=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x563cc6;for(const _0x55a7a2 in _0x2a7e6d){const _0x103ccd=_0x55a7a2,_0x2ec12f=_0x2a7e6d[_0x103ccd];if('aiLicenseKeyValid'==_0x2ec12f||'aiLicenseKeyInvalid'==_0x2ec12f||'aiLicenseKeyExpired'==_0x2ec12f||'aiLicenseKeyDomainLimit'==_0x2ec12f||'aiLicenseKeyNotAllowed'==_0x2ec12f||'aiLicenseKeyEvaluationLimit'==_0x2ec12f||'aiLicenseKeyUsageLimit'==_0x2ec12f){delete _0x2a7e6d[_0x103ccd],_0x563cc6=_0x2ec12f,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x563cc6&&_0x2a7e6d['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x563cc6&&_0x2a7e6d['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x563cc6&&_0x2a7e6d['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x563cc6&&_0x2a7e6d['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x563cc6&&_0x2a7e6d['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x563cc6&&_0x2a7e6d['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x1a66ff='',_0x3c9f8a='',_0x1aa374='custom'){const _0x10cd12=this['editor'],_0x4c78ac=_0x10cd12['editing']['view'],_0xe2094f=_0x10cd12['plugins']['get'](AIAssistantEditing),_0xbb4482=_0x10cd12['plugins']['get'](_0xa6f429);_0xe2094f['showFakeVisualSelection']();const _0x3e6a14=new yi(),_0x327614=new ClipboardEvent('copy',{'clipboardData':_0x3e6a14}),_0x923d28=new _0x104872(_0x3e6a14),_0x2642ef=new _0x44e9df(_0x4c78ac,_0x327614,{'dataTransfer':_0x923d28});_0xbb4482['_forceMarkersCopy']('comment',()=>{_0x4c78ac['document']['fire']('copy',_0x2642ef);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new AIAssistantController(_0x10cd12,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x3685cc=_0x923d28['getData']('text/html');const _0x51b4df=_0x10cd12['model']['document']['selection'],_0x5749e1=Array['from'](_0x51b4df['getRanges']());0x1===_0x5749e1['length']&&_0x5749e1[0x0]['isFlat']&&!_0x51b4df['getSelectedElement']()&&''!==_0x3685cc['replace'](/ /g,'')['trim']()&&(_0x3685cc='<p>'+_0x3685cc+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x1aa374,'query':_0x1a66ff,'htmlContent':_0x3685cc,'label':_0x3c9f8a,'mainActionLabel':ki[_0x10cd12['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x4a06bf,'title':Ri(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Yt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0xe2094f['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x2fbf7e=new Map(),_0x3ae582=Ti(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x18d29b of _0x3ae582)for(const _0x28a572 of _0x18d29b['commands'])_0x2fbf7e['set'](_0x28a572['id'],{..._0x28a572,'groupId':_0x18d29b['groupId'],'groupLabel':_0x18d29b['groupLabel']||_0x18d29b['groupId']});return _0x2fbf7e;}['_createAIAssistantUIButton'](_0x39de0d){const _0x382d87=this['editor'],_0x65ed00=_0x382d87['commands']['get']('showAIAssistant'),_0x54892e=new _0x39de0d(_0x382d87['locale']);return _0x54892e['set']({'label':Ri(_0x382d87['locale'],'AI\x20Assistant'),'icon':_0x4a06bf,'isToggleable':!0x0}),_0x54892e['bind']('isEnabled')['to'](_0x65ed00),_0x54892e['bind']('isOn')['to'](this['_dialog'],'id',_0x425e77=>'aiAssistant'===_0x425e77),this['listenTo'](_0x54892e,'execute',()=>{_0x54892e['isOn']?this['hideUI']():_0x65ed00['execute']();}),_0x54892e;}['_initView'](){const _0x5e3e00=this['editor']['plugins']['get'](AIAssistantEditing);this['_formView']=new AIFormView(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',()=>{_0x5e3e00['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x5e3e00['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x2a3e4b,ui:{ariaLiveAnnouncer:_0x20d142}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x3bfe25,_0x1dc5fd,_0x28886c)=>{const _0x44eb9b=this['_aiAssistantController']['currentContext'];_0x28886c?_0x20d142['announce'](Ri(_0x2a3e4b,'AI\x20is\x20writing')):_0x44eb9b&&_0x20d142['announce'](Ri(_0x2a3e4b,'Generated\x20content:\x20%0',_0x44eb9b),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x3e3068,_0x4cb5ed,_0x420f90)=>{if(_0x420f90){const _0x4c4e47=this['_formView']['errorView']['text'];_0x20d142['announce'](Ri(_0x2a3e4b,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x4c4e47));}});}['_onExecute'](_0x77db72){const _0x558b64=this['_commandDefinitions']['get'](_0x77db72),_0x251288=this['editor'],_0x4b4601=_0x251288['model']['document']['selection'],_0x5e6678=_0x251288['commands']['get']('showAIAssistant'),_0x358007=_0x251288['plugins']['get'](AIAssistantEditing),_0x1b749a=''+(_0x558b64['groupId']!==wi?_0x558b64['groupLabel']+':\x20':'')+_0x558b64['label'];if(!0x1!==_0x558b64['requiresContent']&&_0x4b4601['isCollapsed']){const _0x591519=At(_0x4b4601['getSelectedBlocks']())||_0x251288['model']['schema']['getLimitElement'](_0x4b4601);_0x251288['model']['change'](_0x5ce9c8=>{_0x5ce9c8['setSelection'](_0x591519,'in');});}_0x358007['showFakeVisualSelection'](),_0x5e6678['execute'](_0x558b64['prompt'],_0x1b749a,'command:'+_0x77db72);}['_populateMenuBarMenu'](_0x36ec4f,_0x43a6c5,_0x1bf195,_0x58520f){const _0x371574=this['editor'],_0x4bed00=_0x371574['locale'],_0x8f4ba6=new $t(_0x4bed00),_0x3bdf4a=Li(_0x371574,_0x1bf195)['filter'](_0x2b168d=>_0x2b168d['commands']['length']);0x1===_0x3bdf4a['length']?this['_getMenuBarGroupButtons']({'command':_0x36ec4f,'commands':_0x3bdf4a[0x0]['commands'],'parentMenuView':_0x43a6c5,'onExecute':_0x58520f})['forEach'](_0x4dcf7e=>_0x8f4ba6['items']['add'](_0x4dcf7e)):_0x3bdf4a['forEach'](({groupId:_0x1f7cbf,groupLabel:_0x3c7663,commands:_0x51f31e})=>{const _0x4b33c3=new qt(_0x4bed00,_0x43a6c5),_0x5337e1=new Kt(_0x4bed00),_0x4cf571=new $t(_0x4bed00),_0x585654=this['_getMenuBarGroupButtons']({'command':_0x36ec4f,'commands':_0x51f31e,'parentMenuView':_0x5337e1,'onExecute':_0x58520f});_0x5337e1['buttonView']['set']({'label':_0x3c7663||_0x1f7cbf}),_0x5337e1['delegate']('execute')['to'](_0x43a6c5),_0x4cf571['items']['addMany'](_0x585654),_0x5337e1['panelView']['children']['add'](_0x4cf571),_0x4b33c3['children']['add'](_0x5337e1),_0x8f4ba6['items']['add'](_0x4b33c3);}),_0x43a6c5['panelView']['children']['add'](_0x8f4ba6);}['_getMenuBarGroupButtons']({command:_0x1d91d1,commands:_0x262493,parentMenuView:_0x1b3fe0,onExecute:_0x2bd10b}){const _0x4da867=this['editor'],_0x594b47=_0x4da867['locale'];return Li(_0x4da867,_0x262493)['map'](_0x59f203=>{const _0x100ab5=new qt(_0x594b47,_0x1b3fe0),_0x124d9e=new Wt(_0x594b47);return _0x124d9e['set']({'label':_0x59f203['label']}),_0x124d9e['delegate']('execute')['to'](_0x1b3fe0),_0x124d9e['on']('execute',()=>_0x2bd10b(_0x59f203['id'])),_0x124d9e['bind']('isEnabled')['to'](_0x1d91d1,'enabledCommandsIds',_0x1778d1=>_0x1778d1['includes'](_0x59f203['id'])),_0x100ab5['children']['add'](_0x124d9e),_0x100ab5;});}}function xi(_0x4c9a83,_0x4d30e5){return void 0x0!==_0x4c9a83['order']&&void 0x0===_0x4d30e5['order']?0x1:void 0x0===_0x4c9a83['order']&&void 0x0!==_0x4d30e5['order']?-0x1:void 0x0!==_0x4c9a83['order']&&void 0x0!==_0x4d30e5['order']?_0x4c9a83['order']-_0x4d30e5['order']:0x0;}function Li(_0x1722b7,_0x285e14){_0x285e14['sort'](xi);const _0x3d0e0b={},_0x19d1ef=[];for(const _0x511c19 of _0x285e14)if(void 0x0!==_0x511c19['order']){if(_0x511c19['order']in _0x3d0e0b)throw new at('ai-commands-config-order-collision',_0x1722b7,{'conflictingDefinitions':[_0x511c19,_0x3d0e0b[_0x511c19['order']]]});_0x3d0e0b[_0x511c19['order']]=_0x511c19,_0x19d1ef['splice'](_0x511c19['order'],0x0,_0x511c19);}else _0x19d1ef['push'](_0x511c19);return _0x19d1ef;}class AIAssistant extends _0x53fc9f{static get['requires'](){return[AIAssistantUI,AIAssistantEditing];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2b5e42){super(_0x2b5e42);const _0x14aefc=_0x2b5e42['config'],_0x5ac9f5=_0x2b5e42['locale'];_0x14aefc['define']('ai.assistant.preserveComments',!0x0),_0x14aefc['define']('ai.assistant.commands',Di(_0x5ac9f5)),_0x14aefc['define']('ai.assistant.extraCommandGroups',[]),_0x14aefc['define']('ai.assistant.removeCommands',[]);let _0x336a55=Ti(_0x14aefc['get']('ai.assistant.commands'),_0x5ac9f5);const _0x158bf2=_0x14aefc['get']('ai.assistant.extraCommandGroups'),_0xbc779=_0x14aefc['get']('ai.assistant.removeCommands');_0x158bf2['forEach'](_0x1d9e54=>{const _0x56f838=_0x336a55['find'](_0x106eed=>_0x106eed['groupId']===_0x1d9e54['groupId']);_0x56f838?_0x56f838['commands']=_0x56f838['commands']['concat'](_0x1d9e54['commands']):_0x336a55['push'](_0x1d9e54);}),_0x336a55=_0x336a55['filter'](_0x56f28c=>!_0xbc779['includes'](_0x56f28c['groupId'])),_0x336a55['forEach'](_0x587b9c=>{_0x587b9c['commands']=_0x587b9c['commands']['filter'](_0x5311da=>!_0xbc779['includes'](_0x5311da['id']));}),_0x14aefc['set']('ai.assistant.commands',_0x336a55);}}function Di(_0xa6b52f){return[{'groupId':'editOrReview','groupLabel':Ri(_0xa6b52f,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Ri(_0xa6b52f,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Ri(_0xa6b52f,'Make\x20shorter'),'prompt':'Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.'},{'id':'makeLonger','label':Ri(_0xa6b52f,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Ri(_0xa6b52f,'Simplify\x20language'),'prompt':'Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.'}]},{'groupId':'generate','groupLabel':Ri(_0xa6b52f,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Ri(_0xa6b52f,'Summarize'),'prompt':'Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.'},{'id':'continue','label':Ri(_0xa6b52f,'Continue'),'prompt':'Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.'}]},{'groupId':'changeTone','groupLabel':Ri(_0xa6b52f,'Change\x20tone'),'commands':[{'id':'professional','label':Ri(_0xa6b52f,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Ri(_0xa6b52f,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Ri(_0xa6b52f,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Ri(_0xa6b52f,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Ri(_0xa6b52f,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Ri(_0xa6b52f,'Change\x20style'),'commands':[{'id':'business','label':Ri(_0xa6b52f,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Ri(_0xa6b52f,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Ri(_0xa6b52f,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Ri(_0xa6b52f,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Ri(_0xa6b52f,'Translate'),'commands':[{'id':'translateEnglish','label':Ri(_0xa6b52f,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Ri(_0xa6b52f,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Ri(_0xa6b52f,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Ri(_0xa6b52f,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Ri(_0xa6b52f,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Ri(_0xa6b52f,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Ri(_0xa6b52f,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Ri(_0xa6b52f,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class AITextAdapter extends _0x53fc9f{['abortController'];static get['requires'](){return[AIAdapter];}constructor(_0x2bfef7){super(_0x2bfef7),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](AIAdapter)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x210322){return this['sendRequest'](_0x210322)['catch'](_0x5da1d3=>{if(_0x5da1d3 instanceof AIRequestError)return Promise['reject'](_0x5da1d3);if('AbortError'==_0x5da1d3['name'])return Promise['resolve']();throw console['error'](_0x5da1d3),new at('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x2de68b,_0x410bd9){const _0x32ef37=this['editor']['locale'],_0x436311={'Content-Type':'application/json'};if('object'==typeof _0x2de68b)Object['assign'](_0x436311,_0x2de68b);else{if(_0x2de68b)try{const _0x1aad6e=await _0x2de68b(_0x410bd9);Object['assign'](_0x436311,_0x1aad6e);}catch{return Promise['reject'](new AIRequestError(Ri(_0x32ef37,'AI_ERROR_GET_HEADERS')));}}return _0x436311;}async['_prepareRequestParameters'](_0xc2d2aa,_0x112c91){const _0x1390d7=this['editor']['locale'];if('object'==typeof _0xc2d2aa)return _0xc2d2aa;try{return await _0xc2d2aa(_0x112c91);}catch{return Promise['reject'](new AIRequestError(Ri(_0x1390d7,'AI_ERROR_GET_PARAMETERS')));}}}class OpenAITextAdapter extends AITextAdapter{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x3034ad){super(_0x3034ad),_0x3034ad['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x3034ad['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x3034ad['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x3034ad['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x3034ad['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x3034ad['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x37ad67,context:_0x519aec,onData:_0x175088,actionId:_0x416b02}){const _0x4cd8aa=this['editor']['locale'],_0x55d8bf=await this['prepareMessages'](_0x37ad67,_0x519aec,_0x416b02),_0x4da8b4=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x416b02),_0x58a16c=await this['_prepareRequestParameters'](this['_requestParameters'],_0x416b02),_0x4c9005={'messages':_0x55d8bf,..._0x58a16c},_0x59a732={'method':'POST','headers':_0x4da8b4,'body':JSON['stringify'](_0x4c9005),'signal':this['abortController']['signal']},_0x11ffb5=await fetch(this['_apiUrl'],_0x59a732);if(_0x11ffb5['ok'])return _0x58a16c['stream']?await this['_readStreamableResponse'](_0x11ffb5,_0x175088):await this['_readStaticResponse'](_0x11ffb5,_0x175088),Promise['resolve']();{const _0x428a36=await _0x11ffb5['text']();return _0x428a36['includes']('context_length_exceeded')?Promise['reject'](new AIRequestError(Ri(_0x4cd8aa,'AI_ERROR_CONTEXT_LENGTH'))):_0x428a36['includes']('Moderation')?Promise['reject'](new AIRequestError(Ri(_0x4cd8aa,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x428a36));}}async['prepareMessages'](_0x3999e5,_0xff7b31,_0x3e23b7){let _0x21323e,_0xe08e39;return _0xff7b31?(_0x21323e='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.',_0xe08e39='Instruction:\x0a'+_0x3999e5+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0xff7b31):(_0x21323e='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.',_0xe08e39=_0x3999e5),[{'role':'system','content':_0x21323e},{'role':'user','content':_0xe08e39}];}async['_readStreamableResponse'](_0x54bb46,_0x29a672){const _0x502964=_0x54bb46['body']['getReader'](),_0x2fe905=new TextDecoder();let _0x2cfe9e='',_0x378186='',_0x322bbc='',_0x3e8610=!0x1;for(;!_0x3e8610;){const {done:_0x7edc90,value:_0x4b2622}=await _0x502964['read'](),_0x5045d9=_0x2cfe9e+_0x2fe905['decode'](_0x4b2622);let _0x2c8089='';_0x3e8610=_0x7edc90;try{_0x2c8089=this['_cleanUpData'](_0x5045d9),_0x2cfe9e='';}catch{_0x2cfe9e=_0x5045d9;continue;}_0x378186+=_0x2c8089,!_0x3e8610&&this['_isBufferIncomplete'](_0x378186)||_0x378186&&(_0x322bbc+=_0x378186,_0x378186='',_0x29a672(_0x322bbc));}return Promise['resolve']();}async['_readStaticResponse'](_0x26d721,_0x5ec0b3){return _0x5ec0b3((await _0x26d721['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x4cf6e4){const _0xfe0dee=_0x4cf6e4['split']('<')['length']!==_0x4cf6e4['split']('>')['length'],_0x3446a4=_0x4cf6e4['length']<0x1e;return _0xfe0dee&&_0x3446a4;}['_cleanUpData'](_0x2c3d86){return _0x2c3d86['split'](/\n(?![^{]*\})/g)['map'](_0x32d319=>_0x32d319['replace']('data:\x20',''))['filter'](_0x14bf25=>_0x14bf25&&_0x14bf25['length']>0x0&&'[DONE]'!==_0x14bf25)['map'](_0x32f53d=>{const {choices:_0x5a6e37}=JSON['parse'](_0x32f53d);if(_0x5a6e37[0x0]?.['delta']?.['content'])return _0x5a6e37[0x0]['delta']['content'];})['filter'](_0x475da5=>_0x475da5)['join']('');}}class AWSTextAdapter extends AITextAdapter{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),gt('ai-aws-adapter-not-supported');}async['sendRequest'](_0x2049a3){throw Ct('ai-aws-adapter-not-supported'),new AIRequestError(Ri(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class TabButtonView extends vt{constructor(_0x2400e5,_0x3a39e7={}){super(_0x2400e5),this['isToggleable']=!0x0,this['set']('side',_0x3a39e7['side']||'top');const _0x2af47e=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...mt(_0x3a39e7['class']||[]),_0x2af47e['to']('side',_0x39586f=>'ck-tab-button_'+_0x39586f),_0x2af47e['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class TabPanelView extends Nt{['children'];constructor(_0x3ab3de,_0xa05953={}){super(_0x3ab3de);const _0x440278=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-tab-panel',...mt(_0xa05953['class']||[]),_0x440278['to']('class'),_0x440278['if']('isVisible','ck-hidden',_0x43bb9d=>!_0x43bb9d)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class AITabsView extends Nt{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x56fb00,_0xa50bb={}){super(_0x56fb00),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0xa50bb['side']||'top'),this['set']('isMaximized',!0x1),this['set']('collapsible',_0xa50bb['collapsible']||!0x1),this['set']('_isMaximizedActive',!0x1),this['bind']('_isMaximizedActive')['to'](this,'isMaximized',this,'activeTab',(_0x2b51d9,_0x25df81)=>_0x2b51d9&&null!==_0x25df81);const _0x4bb458=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...mt(_0xa50bb['class']||[]),_0x4bb458['to']('side',_0x5887bc=>'ck-tabs_'+_0x5887bc),_0x4bb458['to']('class'),_0x4bb458['if']('_isMaximizedActive','ck-ai-tabs_maximized'),_0x4bb458['to']('activeTab',_0x2adbd0=>null===_0x2adbd0?'ck-ai-tabs_collapsed':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x4bb458['to']('side',_0x185ede=>'ck-tabs__buttons-container_'+_0x185ede)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x4bb458['to']('side',_0x58c592=>'ck-tabs__panels-container_'+_0x58c592)]},'children':this['panelViews']},...mt(_0xa50bb['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x33913d){const _0x44c8c9=this['_tabs']['get'](_0x33913d);return _0x44c8c9||null;}['addTab'](_0x1024b5){const _0x2d51c5=this['_setupButton']({'id':_0x1024b5['id'],'label':_0x1024b5['buttonLabel'],'icon':_0x1024b5['buttonIcon'],'order':_0x1024b5['order']}),_0x2175b6=new TabPanelView(this['locale']);return _0x2175b6['render'](),_0x1024b5['content']&&_0x2175b6['children']['add'](_0x1024b5['content']),this['panelViews']['add'](_0x2175b6),this['_tabs']['set'](_0x1024b5['id'],{'button':_0x2d51c5,'panel':_0x2175b6,'order':void 0x0!==_0x1024b5['order']?_0x1024b5['order']:null}),this['fire']('addTab:'+_0x1024b5['id'],{'id':_0x1024b5['id'],'button':_0x2d51c5,'panel':_0x2175b6}),null===this['activeTab']?this['activateTab'](_0x1024b5['id']):this['_hidePanel'](_0x1024b5['id']),{'button':_0x2d51c5,'panel':_0x2175b6};}['activateTab'](_0x296fee){if(null!==_0x296fee&&!this['getTab'](_0x296fee))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x296fee});if(this['activeTab']===_0x296fee)return;const _0x41429f=this['activeTab'];this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x296fee,_0x296fee&&this['_showPanel'](_0x296fee),this['fire']('activateTab:'+_0x296fee,{'newTab':_0x296fee,'oldTab':_0x41429f});}['toggleTabPanel'](_0x30813d){if(!this['getTab'](_0x30813d))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x30813d});this['activeTab']===_0x30813d?this['collapsible']&&(this['activeTab']=null):this['activateTab'](_0x30813d);}['showTab'](_0x1502ee){if(!this['getTab'](_0x1502ee))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x1502ee});this['_showPanel'](_0x1502ee),this['_showButton'](_0x1502ee),this['fire']('show:'+_0x1502ee,_0x1502ee);}['hideTab'](_0x1f1196){if(!this['getTab'](_0x1f1196))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x1f1196});const _0x1a7d1a=this['activeTab'];this['_hidePanel'](_0x1f1196),this['_hideButton'](_0x1f1196);const _0xaf4d96=this['getTabIds']();_0x1a7d1a===_0x1f1196&&_0xaf4d96['length']>0x1&&this['activateTab'](_0xaf4d96['find'](_0x16bb6e=>_0x16bb6e!==_0x1f1196)),this['fire']('hide:'+_0x1f1196,_0x1f1196);}['_getPanel'](_0x18b3ce){const _0xbf1469=this['_tabs']['get'](_0x18b3ce);return _0xbf1469?_0xbf1469['panel']:null;}['_showPanel'](_0x58efa3){null!==this['activeTab']&&this['activeTab']!==_0x58efa3||this['_getPanel'](_0x58efa3)['show']();}['_hidePanel'](_0x564b78){const _0x463f7c=this['_getPanel'](_0x564b78);_0x463f7c['isVisible']&&(this['activeTab']===_0x564b78&&(this['activeTab']=null),_0x463f7c['hide']());}['_getButton'](_0x3a0ac3){const _0x2ed2d6=this['_tabs']['get'](_0x3a0ac3);return _0x2ed2d6?_0x2ed2d6['button']:null;}['_showButton'](_0x202254){this['_getButton'](_0x202254)['show']();}['_hideButton'](_0xbefef7){this['_getButton'](_0xbefef7)['hide']();}['_setupButton'](_0x36f400){const _0x4e674b=new TabButtonView(this['locale'],{'side':this['side']}),_0x301691=this['buttonViews'];if(_0x4e674b['set']({'label':_0x36f400['label'],'icon':_0x36f400['icon'],'tooltip':!0x0,'withText':!0x0}),_0x4e674b['bind']('isOn')['to'](this,'activeTab',_0x166fb4=>_0x166fb4===_0x36f400['id']),_0x4e674b['bind']('side')['to'](this,'side'),_0x36f400['order']){const _0x698654=[...this['_tabs']]['reduce']((_0x40a92b,_0xf23266)=>{const _0x45d83=_0xf23266[0x0],{order:_0x1927a7}=_0xf23266[0x1];return!_0x1927a7||_0x1927a7>_0x36f400['order']?_0x40a92b:_0x1927a7>=_0x40a92b['order']?{'id':_0x45d83,'order':_0x1927a7}:_0x40a92b;},{'id':'','order':0x0}),_0x30bdff=_0x301691['getIndex'](this['_getButton'](_0x698654['id']));_0x301691['add'](_0x4e674b,_0x30bdff+0x1);}else _0x301691['add'](_0x4e674b);return _0x4e674b['on']('execute',()=>{this['toggleTabPanel'](_0x36f400['id']);}),_0x4e674b;}}const Vi=['overlay','sidebar','custom'],Pi=['left','right'];class AITabsMainView extends AITabsView{constructor(_0x4909ca,_0x46e94c={}){super(_0x4909ca,_0x46e94c),this['set']('type',_0x46e94c['type']||'sidebar'),this['set']('side',_0x46e94c['side']||'right'),this['set']('isVisible',_0x46e94c['visibleByDefault']??!0x0);const _0x5079e3=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x5079e3['if']('type','ck-ai-tabs__overlay',_0x578fd8=>'overlay'===_0x578fd8),_0x5079e3['if']('type','ck-ai-tabs__sidebar',_0x3e2e54=>'sidebar'===_0x3e2e54),_0x5079e3['if']('isVisible','ck-hidden',_0x448262=>!_0x448262)]}}),this['buttonViews']['on']('add',(_0xc0260e,_0x4b7434)=>{_0x4b7434['set']('withText',!0x1);});}}class AITabs extends _0x3cc0e4{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xf8d385){if(super(_0xf8d385),!this['context']['config']['get']('ai.container'))throw new at('ai-tabs-configuration-not-found');this['context']['config']['define']('ai.container.visibleByDefault',!0x0),this['context']['config']['define']('ai.container.collapsible',!0x1);const _0x208ea4=this['context']['config']['get']('ai.container');if(this['set']('side','right'),void 0x0!==_0x208ea4['showResizeButton']&&(this['showResizeButton']=_0x208ea4['showResizeButton']),'sidebar'!==_0x208ea4['type']&&'overlay'!==_0x208ea4['type']||_0x208ea4['side']&&(this['side']=_0x208ea4['side']),'sidebar'===_0x208ea4['type']){if(this['container']=_0x208ea4['element'],this['set']('type','sidebar'),!this['container'])throw new at('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x208ea4['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new AITabsMainView(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':_0x208ea4['visibleByDefault'],'collapsible':_0x208ea4['collapsible']}),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 _0x3cd9d5&&this['context']['ui']['focusTracker']['add'](this['view']['element']),this['listenTo'](this,'resizeTabs',()=>{this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);});}['switchType'](_0x4b68d3){if(_0x4b68d3&&this['type']!==_0x4b68d3){if(!Vi['includes'](_0x4b68d3))throw new at('ai-tabs-unsupported-ui-type');this['type']=_0x4b68d3;}}['switchSide'](_0xb668ae){if(_0xb668ae&&this['side']!==_0xb668ae){if(!Pi['includes'](_0xb668ae))throw new at('ai-tabs-unsupported-ui-side');this['side']=_0xb668ae;}}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class AIConnector extends _0x3cc0e4{['_apiUrl'];['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0x2fe476];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x542542){super(_0x542542),this['context']['config']['define']('ai.serviceUrl','https://ai.cke-cs.com/v1'),this['_apiUrl']=this['context']['config']['get']('ai.serviceUrl'),this['_token']=null,this['_decoder']=new TextDecoder(),this['_responseCache']=new Map();}['init'](){const _0x412f22=this['context']['plugins']['get'](_0x2fe476);if(!_0x412f22['token'])throw new at('ai-missing-token',this);this['_token']=_0x412f22['token'];}['startConversation'](_0x3f7ae3,_0x3d4a8a){const _0x59b636=this['_sendApiRequest']('/conversations','POST',{'id':_0x3f7ae3,'group':_0x3d4a8a});return{'getConversation':async()=>(await _0x59b636['request'])['json'](),'abortController':_0x59b636['abortController']};}['queryAssistant']({message:_0x30a371,conversationId:_0x2222f7,parts:_0xec6a7c,capabilities:_0xe84dc2,model:_0x276c50,attributes:_0x195122}){const _0x5ebc62={'prompt':_0x30a371,'content':_0xec6a7c,'model':_0x276c50,..._0xe84dc2&&{'capabilities':_0xe84dc2},..._0x195122&&{'attributes':_0x195122}},_0x313fbb=this['_sendApiRequest']('/conversations/'+_0x2222f7+'/messages','POST',_0x5ebc62);return{'getStream':async()=>{const _0x4e69e0=(await _0x313fbb['request'])['body'];return this['_getStreamReader'](_0x4e69e0);},'abortController':_0x313fbb['abortController']};}['executeCustomAction']({content:_0x49abb5,message:_0x2d39a5,model:_0x1c468a,outputFormat:_0xc553f4}){const _0x1c4577={'content':[{'type':'text','content':_0x49abb5}],'prompt':_0x2d39a5,'model':_0x1c468a,'outputFormat':_0xc553f4},_0x24129b=this['_sendApiRequest']('/actions/custom/calls','POST',_0x1c4577);return{'getStream':async()=>{const _0x1db089=(await _0x24129b['request'])['body'];return this['_getStreamReader'](_0x1db089);},'abortController':_0x24129b['abortController']};}['executeAction']({actionName:_0xd3e4df,content:_0x13ae3c,args:_0x5adcbf}){const _0x23d94e={'content':[{'type':'text','content':_0x13ae3c}],'args':_0x5adcbf},_0x3a6897=this['_sendApiRequest']('/actions/system/'+_0xd3e4df+'/calls','POST',_0x23d94e);return{'getStream':async()=>{const _0x44ffc6=(await _0x3a6897['request'])['body'];return this['_getStreamReader'](_0x44ffc6);},'abortController':_0x3a6897['abortController']};}['uploadFile'](_0x5a1350,_0x2943c4,_0x3ae6d9){const _0x142bec=new FormData();_0x142bec['append']('file',_0x2943c4,_0x2943c4['name']),_0x3ae6d9&&_0x142bec['append']('attributes',JSON['stringify'](_0x3ae6d9));const _0xd13cb1=this['_sendApiRequest']('/conversations/'+_0x5a1350+'/files','POST',_0x142bec);return{'getId':async()=>(await _0xd13cb1['request'])['json'](),'abortController':_0xd13cb1['abortController']};}['fetchDocument'](_0xca4cff,_0x135ec2){const _0x2ff04d=this['_sendApiRequest']('/conversations/'+_0xca4cff+'/documents/'+_0x135ec2,'GET');return{'getDocument':async()=>(await _0x2ff04d['request'])['json'](),'abortController':_0x2ff04d['abortController']};}['uploadDocument'](_0x51a27e,_0x4a5522,_0x35b47b){const _0x170824={'content':_0x4a5522};_0x35b47b&&(_0x170824['attributes']=_0x35b47b);const _0x59bd97=this['_sendApiRequest']('/conversations/'+_0x51a27e+'/documents','POST',_0x170824);return{'getId':async()=>(await _0x59bd97['request'])['json'](),'abortController':_0x59bd97['abortController']};}['uploadDocuments'](_0x10f8e5,_0x590d61){const _0x59a8c2={'documents':_0x590d61['map'](_0x2e362e=>({'content':_0x2e362e['content'],'attributes':{'version':_0x2e362e['version'],'sessionId':_0x2e362e['sessionId'],'channelId':_0x2e362e['channelId'],'rootName':_0x2e362e['rootName'],'selections':_0x2e362e['selections']},...void 0x0!==_0x2e362e['name']?{'name':_0x2e362e['name']}:{},...void 0x0!==_0x2e362e['description']?{'description':_0x2e362e['description']}:{}}))},_0x82d2b7=this['_sendApiRequest']('/conversations/'+_0x10f8e5+'/documents/batch','POST',_0x59a8c2);return{'getIds':async()=>(await _0x82d2b7['request'])['json'](),'abortController':_0x82d2b7['abortController']};}['fetchDocuments'](_0x302567,_0x547b03){const _0x5c6bcd=new URLSearchParams();_0x5c6bcd['append']('documentIds',_0x547b03['join'](','));const _0x910def=this['_sendApiRequest']('/conversations/'+_0x302567+'/documents/batch?'+_0x5c6bcd['toString'](),'GET');return{'getDocuments':async()=>(await _0x910def['request'])['json'](),'abortController':_0x910def['abortController']};}['fetchConversations'](_0x484a1b,_0x6bc680={}){const _0xfb2649=new URLSearchParams();_0xfb2649['append']('group',_0x484a1b),_0xfb2649['append']('excludeEmpty',!0x1!==_0x6bc680['excludeEmpty']?'true':'false'),_0xfb2649['append']('limit',_0x6bc680['limit']?_0x6bc680['limit']['toString']():'100'),_0xfb2649['append']('sortBy',_0x6bc680['sortBy']?_0x6bc680['sortBy']:'createdAt'),_0xfb2649['append']('order',_0x6bc680['order']?_0x6bc680['order']:'desc');const _0x3ad069=this['_sendApiRequest']('/conversations?'+_0xfb2649['toString'](),'GET');return{'getConversations':async()=>{const _0x58f995=await _0x3ad069['request'];return(await _0x58f995['json']())['items'];},'abortController':_0x3ad069['abortController']};}['deleteConversation'](_0x3f4ffd){const _0x565a13=this['_sendApiRequest']('/conversations/'+_0x3f4ffd,'DELETE');return{'execute':async()=>{await _0x565a13['request'];},'abortController':_0x565a13['abortController']};}['updateConversation'](_0x438c64,_0x563447){const _0x42564a=this['_sendApiRequest']('/conversations/'+_0x438c64,'PATCH',_0x563447);return{'getResult':async()=>(await _0x42564a['request'],_0x563447),'abortController':_0x42564a['abortController']};}['fetchConversation'](_0x58212f){const _0x4cd656=this['_sendApiRequest']('/conversations/'+_0x58212f,'GET');return{'getConversation':async()=>(await _0x4cd656['request'])['json'](),'abortController':_0x4cd656['abortController']};}['fetchConversationMessages'](_0x22ee80){const _0x245ead=this['_sendApiRequest']('/conversations/'+_0x22ee80+'/messages','GET');return{'getMessages':async()=>{const _0x1a9a19=await _0x245ead['request'];return(await _0x1a9a19['json']())['items'];},'abortController':_0x245ead['abortController']};}['uploadUrl'](_0x426888,_0x2cb0e5,_0x176c3c){const _0x598d4a=this['_sendApiRequest']('/conversations/'+_0x426888+'/web-resources','POST',{'url':_0x2cb0e5,'attributes':_0x176c3c});return{'getId':async()=>(await _0x598d4a['request'])['json'](),'abortController':_0x598d4a['abortController']};}['getModels'](_0x3727ed='en'){const _0x50b77c=new URLSearchParams();_0x50b77c['append']('language',_0x3727ed);const _0x385098='/models/1?'+_0x50b77c['toString'](),_0x253c16=this['_sendApiRequest'](_0x385098,'GET',void 0x0,!0x0);return{'list':async()=>await(await _0x253c16['request'])['json'](),'abortController':_0x253c16['abortController']};}['deleteFile'](_0x56e379,_0x48b024){const _0x51e848=this['_sendApiRequest']('/conversations/'+_0x56e379+'/files/'+_0x48b024,'DELETE');return{'execute':async()=>{await _0x51e848['request'];},'abortController':_0x51e848['abortController']};}['deleteDocument'](_0x637360,_0x2af9ab){const _0x328bf0=this['_sendApiRequest']('/conversations/'+_0x637360+'/documents/'+_0x2af9ab,'DELETE');return{'execute':async()=>{await _0x328bf0['request'];},'abortController':_0x328bf0['abortController']};}['deleteWebResource'](_0x44d03c,_0x5b8412){const _0x311905=this['_sendApiRequest']('/conversations/'+_0x44d03c+'/web-resources/'+_0x5b8412,'DELETE');return{'execute':async()=>{await _0x311905['request'];},'abortController':_0x311905['abortController']};}['callSystemReview']({reviewName:_0x11d016,content:_0x29c65d,args:_0x4513f1}){const _0xcf4a3a=this['_sendApiRequest']('/reviews/system/'+_0x11d016+'/calls','POST',{'content':[{'type':'text','content':_0x29c65d}],'args':_0x4513f1});return{'getStream':async()=>{const _0x2746f8=(await _0xcf4a3a['request'])['body'];return this['_getStreamReader'](_0x2746f8);},'abortController':_0xcf4a3a['abortController']};}['callCustomReview']({content:_0x596da9,prompt:_0x4a647e,model:_0x541453}){const _0x5f1987=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x596da9}],'prompt':_0x4a647e,'model':_0x541453});return{'getStream':async()=>{const _0x349900=(await _0x5f1987['request'])['body'];return this['_getStreamReader'](_0x349900);},'abortController':_0x5f1987['abortController']};}['upsertAIChatRating'](_0xfef292,_0x1fb452,_0x3bd9d7){const _0x5b49db=this['_sendApiRequest']('/conversations/'+_0xfef292+'/messages/'+_0x1fb452+'/ratings','PUT',{'positiveCount':_0x3bd9d7['positiveCount'],'totalCount':_0x3bd9d7['totalCount'],'modificationId':_0x3bd9d7['modificationId']});return{'execute':async()=>{await _0x5b49db['request'];},'abortController':_0x5b49db['abortController']};}['upsertAIActionRating'](_0x4b54d9,_0x48e2df,_0x3b234c){const _0x4c8c51=this['_sendApiRequest']('/actions/system/'+_0x4b54d9+'/calls/'+_0x48e2df+'/ratings','PUT',{'positiveCount':_0x3b234c['positiveCount'],'totalCount':_0x3b234c['totalCount']});return{'execute':async()=>{await _0x4c8c51['request'];},'abortController':_0x4c8c51['abortController']};}['upsertCustomAIActionRating'](_0x14fa21,_0x442c61){const _0x12b156=this['_sendApiRequest']('/actions/custom/calls/'+_0x14fa21+'/ratings','PUT',{'positiveCount':_0x442c61['positiveCount'],'totalCount':_0x442c61['totalCount']});return{'execute':async()=>{await _0x12b156['request'];},'abortController':_0x12b156['abortController']};}['upsertAIReviewRating'](_0x1692dc,_0x3647d2,_0x353763,_0xe0e97d){const _0x2316d4=this['_sendApiRequest']('/reviews/system/'+_0x1692dc+'/calls/'+_0x3647d2+'/ratings','PUT',{'positiveCount':_0x353763['positiveCount'],'totalCount':_0x353763['totalCount'],'dataId':_0xe0e97d});return{'execute':async()=>{await _0x2316d4['request'];},'abortController':_0x2316d4['abortController']};}['upsertCustomAIReviewRating'](_0x25c921,_0x144295,_0x5bd923){const _0x3249eb=this['_sendApiRequest']('/reviews/custom/calls/'+_0x25c921+'/ratings','PUT',{'positiveCount':_0x144295['positiveCount'],'totalCount':_0x144295['totalCount'],'dataId':_0x5bd923});return{'execute':async()=>{await _0x3249eb['request'];},'abortController':_0x3249eb['abortController']};}['_sendApiRequest'](_0x5106c7,_0x5a2d0a,_0x15600f,_0x5dfaed=!0x1){const _0x563608=new AbortController(),_0x30e77a=_0x5dfaed?_0x5a2d0a+':'+_0x5106c7:null;if(_0x30e77a){const _0x45c197=this['_responseCache']['get'](_0x30e77a);if(_0x45c197)return{'request':_0x45c197['then'](_0x6a0a0d=>_0x6a0a0d['clone']()),'abortController':_0x563608};}const _0x470ee1=_0x15600f instanceof FormData,_0x13cfb2={'Authorization':'Bearer\x20'+this['_token']?.['value'],'X-Editor-Version':pt};_0x15600f&&!_0x470ee1&&(_0x13cfb2['Content-Type']='application/json');const _0x55c79d={'method':_0x5a2d0a,'headers':_0x13cfb2,'signal':_0x563608['signal']};_0x15600f&&(_0x55c79d['body']=_0x470ee1?_0x15600f:JSON['stringify'](_0x15600f));const _0x43ea4b=fetch(''+this['_apiUrl']+_0x5106c7,_0x55c79d)['catch'](_0x1fb9d1=>{_0x30e77a&&this['_responseCache']['delete'](_0x30e77a),this['_handleError'](_0x1fb9d1);})['then'](_0x1a9595=>_0x1a9595['ok']?_0x1a9595:_0x1a9595['json']()['then'](_0x5b89b2=>{throw _0x30e77a&&this['_responseCache']['delete'](_0x30e77a),{'url':this['_apiUrl'],'path':_0x5106c7,'method':_0x5a2d0a,'body':_0x15600f,'status':(_0x1a9595||{})['status'],'statusText':(_0x1a9595||{})['statusText'],'code':_0x5b89b2['code'],'message':_0x5b89b2['message'],'traceId':_0x5b89b2['traceId']};}));return _0x30e77a&&this['_responseCache']['set'](_0x30e77a,_0x43ea4b['then'](_0x344e82=>_0x344e82['clone']())),{'request':_0x43ea4b,'abortController':_0x563608};}async*['_getStreamReader'](_0x59efda){const _0x5f3037=[],_0x437e41=_0x59efda['getReader'](),_0xe26e69=_0x24589f({'onError':_0x4037cf=>{this['_handleError'](_0x4037cf);},'onEvent':_0x2b300f=>{_0x2b300f['data']=JSON['parse'](_0x2b300f['data']),_0x5f3037['push'](_0x2b300f);}});try{let _0xb5f78f=!0x1;for(;!_0xb5f78f;){const {done:_0x1bf161,value:_0xf9a817}=await _0x437e41['read']();_0x1bf161&&(_0xb5f78f=!0x0),_0xe26e69['feed'](this['_decoder']['decode'](_0xf9a817,{'stream':!0x0})),yield*_0x5f3037,_0x5f3037['length']=0x0;}}catch(_0xc61611){this['_handleError'](_0xc61611);}finally{_0x437e41['releaseLock'](),_0xe26e69['reset']();}}['_handleError'](_0x1171de){if(_0x1171de instanceof at)throw _0x1171de;if(_0x1171de instanceof Error&&'AbortError'===_0x1171de['name'])throw new at('ai-request-aborted',this,{'originalError':_0x1171de});throw new at('ai-request-failed',this,{'originalError':_0x1171de});}}function Hi(_0x14428b,_0x2de69c,_0x3f8f1d){const t=_0x14428b['t'];switch(_0x2de69c){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'},_0x3f8f1d);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':'Response\x20stopped.'});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.'},_0x3f8f1d);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.'},_0x3f8f1d);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.'},_0x3f8f1d);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'},_0x3f8f1d);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x3f8f1d);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'},_0x3f8f1d);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.'},_0x3f8f1d);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.'},_0x3f8f1d);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.'},_0x3f8f1d);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.'},_0x3f8f1d);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'},_0x3f8f1d);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.'},_0x3f8f1d);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 _0x2de69c;}}const Mi='ck-ai-button-primary',Ui='ck-ai-button-secondary',Bi='ck-ai-button-tertiary';function Gi(_0x440e74,_0x3b0e9a){const _0xdc4df6=new vt(_0x440e74),_0x538b49=Hi(_0x440e74,'AI_TABS_LABEL_MINIMIZE'),_0x54dca1=Hi(_0x440e74,'AI_TABS_LABEL_MAXIMIZE');return _0xdc4df6['set']({'withText':!0x1,'icon':_0x55d900,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+Bi}),_0xdc4df6['bind']('label')['to'](_0x3b0e9a,'isMaximized',_0x4de773=>_0x4de773?_0x538b49:_0x54dca1),_0xdc4df6['bind']('icon')['to'](_0x3b0e9a,'isMaximized',_0x47f003=>_0x47f003?_0x37bd1f:_0x55d900),_0xdc4df6['bind']('isOn')['to'](_0x3b0e9a,'isMaximized'),_0xdc4df6['on']('execute',()=>{_0x3b0e9a['fire']('resizeTabs');}),_0xdc4df6;}function Fi(_0x4be5e7){return _0x57287f(_0x4be5e7);}function Ki(_0x12a39a){return ti(_0x12a39a);}function Wi(_0x867622,_0x34ad1a,_0x5e1eb5){const _0x1d50a6=null!==_0x34ad1a?_0x48b90b=>_0x48b90b['attribs'][_0x867622]===_0x34ad1a:_0x3f0b10=>Boolean(_0x3f0b10['attribs'][_0x867622]);return _0x10d1dd(_0x50b16a=>_0x5778d8(_0x50b16a)&&_0x1d50a6(_0x50b16a),_0x5e1eb5);}function Yi(_0x34c465,_0x4613c1,_0x248e2a){const _0x2405d3=null!==_0x4613c1?_0x2fd22c=>_0x2fd22c['attribs'][_0x34c465]===_0x4613c1:_0x1ad999=>Boolean(_0x1ad999['attribs'][_0x34c465]);return _0x11b699(_0x10ffcc=>_0x5778d8(_0x10ffcc)&&_0x2405d3(_0x10ffcc),_0x248e2a);}function $i(_0x5edd67,_0x4acc08){return _0x5edd67&&_0x5778d8(_0x5edd67)?_0x5edd67['attribs'][_0x4acc08]:null;}function qi(_0x2d7bc0,_0x13f21c,_0x2ee7bb){_0x5778d8(_0x2d7bc0)&&(null===_0x2ee7bb?delete _0x2d7bc0['attribs'][_0x13f21c]:_0x2d7bc0['attribs'][_0x13f21c]=_0x2ee7bb);}function Qi(_0x5f294d,_0x45d247,_0x5348df){const _0x29a3d9=_0x45d247['cloneNode'](!0x0);'beforebegin'===_0x5348df?_0x238c6d(_0x5f294d,_0x29a3d9):'afterbegin'===_0x5348df?_0x3d3041(_0x5f294d,_0x29a3d9):'beforeend'===_0x5348df?_0x2b0d30(_0x5f294d,_0x29a3d9):'afterend'===_0x5348df&&_0x1d7e6a(_0x5f294d,_0x29a3d9);}function Xi(_0x29330a){const _0xb1a020=[];let _0x50eede=_0x29330a;for(;_0x50eede;)_0x50eede=_0x586047(_0x50eede),_0x50eede&&_0xb1a020['push'](_0x50eede);return _0xb1a020;}function zi(_0x4a40d1){return _0x4a40d1['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function ji(_0xa54752){let _0x2f5858=0x0;for(;_0xa54752['parentNode'];)_0xa54752=_0xa54752['parentNode'],_0x2f5858++;return _0x2f5858;}function Ji(_0x42cf0d){const _0x263dad=[];let _0x1b1c86=_0x42cf0d['nextSibling'];for(;_0x1b1c86;)_0x263dad['push'](_0x1b1c86),_0x1b1c86=_0x1b1c86['nextSibling'];_0x263dad['forEach'](_0x143ac6=>{_0x8926a6(_0x143ac6);});}class AIResponseParser extends/* #__PURE__ -- @preserve */
|
|
25
|
-
ht(){['_m2html'];constructor(){super();const _0x130d30=Object['entries'](_0x5ed1bb),_0x16c539=_0x130d30['findIndex'](([_0x3f4272])=>'rehypeDomRaw'===_0x3f4272);if(-0x1===_0x16c539)throw new at('ai-response-parser-unable-to-set-up-parser');_0x130d30['splice'](_0x16c539+0x1,0x0,['rehypeSanitize',_0x3905b6]),this['_m2html']=new _0x589477({'plugins':Object['fromEntries'](_0x130d30)});}['convertMarkdownToHTML'](_0x405bec){const _0x43957a=this['_m2html']['parse'](_0x405bec);return this['parseAndNormalizeHTML'](_0x43957a);}['parseAndNormalizeHTML'](_0x73c559){return this['_parseHTML'](_0x73c559);}['_parseHTML'](_0x16cce7){const _0x1b364c=Fi('<dummy>'+_0x16cce7['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x1b364c['children']=_0x1b364c['children'][0x0]['children'],_0x1b364c;}}class AIResponseApplier extends/* #__PURE__ -- @preserve */
|
|
26
|
-
ht(){['_generateUid'];['_uidCounter']=0x0;['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x2069db){super(),this['_generateUid']=_0x2069db||(()=>'e'+String(this['_uidCounter']++));}['merge'](_0x1225b2,_0x36b16a,_0x491ad1){this['_uidCounter']=0x0;const _0x1b306d=_0x1225b2['cloneNode'](!0x0),_0x4d812e=_0x1b306d['childNodes'],_0x17797b=Array['from'](_0x4d812e)['filter'](_0x4f3ddb=>!(0x3===_0x4f3ddb['nodeType']&&''===Ki(_0x4f3ddb)['trim']())),_0x4018b2=_0x17797b['length'],_0x1fff0f=new Map();for(const _0x3d981d of _0x17797b)_0x3d981d&&_0x5778d8(_0x3d981d)&&void 0x0===_0x3d981d['attribs']['data-id']&&qi(_0x3d981d,'data-id','new-element');if(0x0===_0x36b16a['childNodes']['length']){const _0x24290d=[];return Yi('data-id','new-element',_0x1b306d)['forEach'](_0x537fd2=>{const _0x302c23=this['_generateUid']();qi(_0x537fd2,'data-id',_0x302c23),_0x24290d['push'](_0x302c23);}),this['_removeSpecialComments'](_0x1b306d),{'parsedContent':_0x1b306d,'newNodeIds':_0x24290d,'modifiedNodeIds':[],'removedNodeIds':[],'newAnchorIds':_0x1fff0f};}_0x491ad1&&_0x491ad1['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x1b306d),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Yi('data-id',null,_0x36b16a)['map'](_0x15d99b=>$i(_0x15d99b,'data-id'))['filter'](_0x56716e=>!!_0x56716e));let _0x285297=-0x1,_0x2e5be9=!0x1;for(let _0x25769f=0x0;_0x25769f<_0x4018b2;_0x25769f++){const _0x521fab=_0x17797b[_0x25769f],_0x1853eb=_0x17797b[_0x25769f+0x1];if(this['_isNewNode'](_0x521fab)){if(-0x1===_0x285297&&(_0x285297=_0x25769f),this['_markWrappedElements'](_0x521fab),!this['_isNewNode'](_0x1853eb)){const [_0x2f0b5d,_0x3e3162]=this['_findReferenceNode'](_0x521fab,_0x2e5be9,_0x36b16a);if(_0x2f0b5d){const _0x5484fd=Array['from'](_0x17797b)['slice'](_0x285297,_0x25769f+0x1),_0x4245cd=$i(_0x2f0b5d,'data-id');if(this['_insertNodes'](_0x2f0b5d,_0x5484fd,_0x3e3162),_0x4245cd)for(const _0x5b764c of _0x5484fd){const _0x338a03=$i(_0x5b764c,'data-id');_0x338a03&&_0x1fff0f['set'](_0x338a03,_0x4245cd);}_0x285297=-0x1;}}}else{if(this['_isExistingContentComment'](_0x521fab))_0x2e5be9=!0x0;else{if(this['_isExistingNode'](_0x521fab)){const _0x10bd42=$i(_0x521fab,'data-id');if(_0x10bd42&&this['_existingDataIds']['has'](_0x10bd42)){const _0x486393=Wi('data-id',_0x10bd42,_0x36b16a);this['_replaceNode'](_0x486393,_0x521fab);}}else{if(this['_isDelNode'](_0x521fab)){const _0x48d174=this['_getNodeDataId'](_0x521fab);!!Wi('data-id',_0x48d174,_0x1b306d)||this['_touchedNodesState']['removedIds']['push'](_0x48d174);}}}}}for(const _0x326a00 of this['_touchedNodesState']['removedIds']){const _0x1027cb=Wi('data-id',_0x326a00,_0x36b16a);_0x1027cb&&this['_removeNode'](_0x1027cb,_0x326a00,_0x491ad1);}if(Yi('data-id','new-element',_0x36b16a)['forEach'](_0x26fc74=>{const _0x483a2a=this['_getUid'](_0x26fc74);qi(_0x26fc74,'data-id',_0x483a2a),this['_touchedNodesState']['newIds']['push'](_0x483a2a);}),this['_removeSpecialComments'](_0x36b16a),_0x491ad1&&_0x491ad1['markUnstableElements']&&this['_markUnstableElements'](_0x36b16a,_0x491ad1['markUnstableElementsDepth']||0x0),this['_processWrappedElements'](_0x36b16a,_0x491ad1),_0x491ad1&&_0x491ad1['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){const _0x5e9e77=Yi('data-id',this['_touchedNodesState']['lastTouchedId'],_0x36b16a);let _0x44485e=_0x5e9e77[_0x5e9e77['length']-0x1];for(;_0x44485e;)Ji(_0x44485e),_0x44485e=_0x44485e['parentNode'];}return{'parsedContent':_0x36b16a,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds'],'newAnchorIds':_0x1fff0f};}['_insertNodes'](_0x5bbcd0,_0x7f25d3,_0x8d1ae1){for(const _0x142a17 of _0x7f25d3){const _0x17d6df=this['_getUid'](_0x142a17);qi(_0x142a17,'data-id',_0x17d6df),this['_touchedNodesState']['newIds']['push'](_0x17d6df),this['_touchedNodesState']['lastTouchedId']=_0x17d6df;}const _0xf864a0='afterbegin'===_0x8d1ae1||'afterend'===_0x8d1ae1?_0x7f25d3['reverse']():_0x7f25d3;for(const _0x2c3f97 of _0xf864a0)Qi(_0x5bbcd0,_0x2c3f97,_0x8d1ae1);}['_replaceNode'](_0x276699,_0x188482){if(!_0x276699)return;if(_0x3fc42e=_0x188482,zi(Ki(_0x276699))===zi(Ki(_0x3fc42e)))return;var _0x3fc42e;const _0x5a8a17=this['_getUid'](_0x276699);qi(_0x188482,'data-id',_0x5a8a17),this['_touchedNodesState']['modifiedIds']['push'](_0x5a8a17),this['_touchedNodesState']['lastTouchedId']=_0x5a8a17,_0x1a09b2(_0x276699,_0x188482['cloneNode'](!0x0));}['_removeNode'](_0x4147b6,_0x1b327a,_0x30eed9){if(_0x30eed9&&_0x30eed9['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x1b327a;const _0x287668=_0x30eed9['replaceRemovedWith']['cloneNode'](!0x0);qi(_0x287668,'data-id',_0x1b327a),qi(_0x287668,'data-removed','true'),_0x1a09b2(_0x4147b6,_0x287668);}else _0x8926a6(_0x4147b6);}['_findReferenceNode'](_0x2165de,_0x352c86,_0x5cbdd5){const _0x5f2cdd=this['_findPrevElementWithDataId'](_0x2165de,!0x1);if(_0x5f2cdd){const _0x1ca88a=this['_getNodeDataId'](_0x5f2cdd),_0x3edb96=Wi('data-id',_0x1ca88a,_0x5cbdd5);if(_0x3edb96)return[_0x3edb96,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x1ca88a);}const _0x648d3a=this['_findNextElementWithDataId'](_0x2165de,!0x1);if(_0x648d3a){const _0x27884d=this['_getNodeDataId'](_0x648d3a),_0x4c98a3=Wi('data-id',_0x27884d,_0x5cbdd5);if(_0x4c98a3)return[_0x4c98a3,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x27884d);}return _0x352c86?_0x2165de['nextSibling']?this['_findFallbackReferenceNode'](_0x2165de,_0x5cbdd5):[_0x5cbdd5['childNodes'][_0x5cbdd5['childNodes']['length']-0x1],'afterend']:[_0x5cbdd5['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x2efe52,_0x244179){const _0x1b592e=[],_0x1dd43b=this['_findPrevElementWithDataId'](_0x2efe52,!0x0);if(_0x1dd43b){const _0x27feb9=Wi('data-id',this['_getNodeDataId'](_0x1dd43b),_0x244179);_0x27feb9&&_0x1b592e['push']([_0x27feb9,'afterend']);}const _0x5a33af=this['_findNextElementWithDataId'](_0x2efe52,!0x0);if(_0x5a33af){const _0xa56eef=Wi('data-id',this['_getNodeDataId'](_0x5a33af),_0x244179);_0xa56eef&&_0x1b592e['push']([_0xa56eef,'beforebegin']);}if(_0x1b592e['length']>0x1)return ji(_0x1b592e[0x0][0x0])<=ji(_0x1b592e[0x1][0x0])?_0x1b592e[0x0]:_0x1b592e[0x1];return 0x1===_0x1b592e['length']?_0x1b592e[0x0]:[_0x244179['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x176c03,_0x2f1b0e){let _0xa81867=_0x176c03['nextSibling'],_0x33fd61=null,_0x58e792=!0x1;for(;_0xa81867;){if(_0x51bc24(_0xa81867)){if(this['_isDelNode'](_0xa81867)&&(_0x33fd61=_0xa81867),this['_isExistingContentComment'](_0xa81867)&&_0x2f1b0e&&!_0x58e792){_0x58e792=!0x0,_0xa81867=_0xa81867['nextSibling'];continue;}break;}const _0x4124c0=$i(_0xa81867,'data-id');if(_0x4124c0&&'new-element'!==_0x4124c0&&this['_existingDataIds']['has'](_0x4124c0)){_0x33fd61=_0xa81867;break;}_0xa81867=_0xa81867['nextSibling'];}return _0x33fd61;}['_findPrevElementWithDataId'](_0x3d1c33,_0x5398a7){let _0x39ff5b=_0x3d1c33['previousSibling'],_0x4ceab0=null,_0x3a8b62=!0x1;for(;_0x39ff5b;){if(_0x51bc24(_0x39ff5b)){if(this['_isDelNode'](_0x39ff5b)&&(_0x4ceab0=_0x39ff5b),this['_isExistingContentComment'](_0x39ff5b)&&_0x5398a7&&!_0x3a8b62){_0x3a8b62=!0x0,_0x39ff5b=_0x39ff5b['previousSibling'];continue;}break;}const _0x28a561=$i(_0x39ff5b,'data-id');if(_0x28a561&&'new-element'!==_0x28a561&&this['_existingDataIds']['has'](_0x28a561)){_0x4ceab0=_0x39ff5b;break;}_0x39ff5b=_0x39ff5b['previousSibling'];}return _0x4ceab0;}['_markWrappedElements'](_0x4a9f45){_0x5778d8(_0x4a9f45)&&Yi('data-id',null,_0x4a9f45)['forEach'](_0x566982=>{this['_isExistingNode'](_0x566982)&&(qi(_0x566982,'data-wrapped-id',$i(_0x566982,'data-id')),qi(_0x566982,'data-id',null));});}['_processWrappedElements'](_0x1f722a,_0x1dba13){Yi('data-wrapped-id',null,_0x1f722a)['forEach'](_0x47f992=>{const _0x904143=$i(_0x47f992,'data-wrapped-id');if($i(_0x47f992,'data-unstable')||this['_hasUnstableParent'](_0x47f992))return;const _0x493a8d=Wi('data-id',_0x904143,_0x1f722a);qi(_0x47f992,'data-id',_0x904143),qi(_0x47f992,'data-wrapped-id',null),_0x493a8d&&(this['_removeNode'](_0x493a8d,_0x904143,_0x1dba13),this['_touchedNodesState']['removedIds']['push'](_0x904143),this['_touchedNodesState']['lastTouchedId']=_0x904143);});}['_hasUnstableParent'](_0x9448c){let _0x4c2d8c=_0x9448c['parentNode'];for(;_0x4c2d8c;){if($i(_0x4c2d8c,'data-unstable'))return!0x0;_0x4c2d8c=_0x4c2d8c['parentNode'];}return!0x1;}['_getNodeDataId'](_0x5eec3f){if(!_0x5eec3f)return null;if(_0x5778d8(_0x5eec3f))return $i(_0x5eec3f,'data-id');if(_0x51bc24(_0x5eec3f)){const _0x15e792=Ki(_0x5eec3f)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x15e792&&_0x15e792[0x1])return _0x15e792[0x1];}return null;}['_getUid'](_0xda44a4){return this['_isExistingNode'](_0xda44a4)?$i(_0xda44a4,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x3f59fc){(function(_0x4e8d91){return _0x18d527(_0x5d1939=>_0x51bc24(_0x5d1939),_0x4e8d91,!0x0,0x1/0x0);}(_0x3f59fc)['filter'](_0x3889f1=>this['_isDelNode'](_0x3889f1)||this['_isExistingContentComment'](_0x3889f1))['forEach'](_0x36b87c=>{_0x8926a6(_0x36b87c);}));}['_markLastTagElementUnstable'](_0x52fa99){const _0x5311ea=_0x52fa99['childNodes'],_0x27ac33=_0x5311ea[_0x5311ea['length']-0x1];_0x27ac33&&_0x5778d8(_0x27ac33)&&qi(_0x27ac33,'data-unstable','true');}['_markUnstableElements'](_0x1ce914,_0x433175){const _0x719b3d=Wi('data-unstable','true',_0x1ce914);if(!_0x719b3d)return;const _0x5b8367=Xi(_0x719b3d)['slice'](0x0,-0x1),_0x49c0e1=_0x5b8367['length'];let _0x3d59d1=_0x719b3d;if(_0x49c0e1>_0x433175){let _0x3bd4c9=_0x49c0e1,_0x114f31=null;for(;_0x3bd4c9>_0x433175&&_0x3bd4c9>=0x0;)_0x3bd4c9--,_0x114f31=_0x5b8367[_0x3bd4c9];_0x114f31&&(_0x3d59d1=_0x114f31,qi(_0x719b3d,'data-unstable',null),qi(_0x114f31,'data-unstable','true'));}else{if(_0x49c0e1<_0x433175){let _0x306c55=_0x49c0e1,_0x112809=_0x719b3d;for(;_0x306c55<_0x433175;){const _0x589ad2=_0x112809['childNodes']['filter'](_0x5c866d=>_0x5778d8(_0x5c866d));if(0x0===_0x589ad2['length'])break;_0x306c55++,_0x112809=_0x589ad2[_0x589ad2['length']-0x1];}_0x112809&&(_0x3d59d1=_0x112809,qi(_0x719b3d,'data-unstable',null),qi(_0x112809,'data-unstable','true'));}}let _0x408dd9=_0x3d59d1;for(;_0x408dd9;){for(;_0x408dd9['nextSibling'];)_0x408dd9=_0x408dd9['nextSibling'],_0x5778d8(_0x408dd9)&&qi(_0x408dd9,'data-unstable','true');_0x408dd9=_0x408dd9['parentNode'];}}['_isNewNode'](_0xb9a66){return Boolean('new-element'===$i(_0xb9a66,'data-id'));}['_isExistingNode'](_0x2cad97){return Boolean(($i(_0x2cad97,'data-id')||'')['length']>0x0&&'new-element'!==$i(_0x2cad97,'data-id'));}['_isDelNode'](_0x5b014c){return!!_0x5b014c&&Boolean(_0x51bc24(_0x5b014c)&&Ki(_0x5b014c)['match'](/removed[\s*-]data-id="[^"]+"/));}['_isExistingContentComment'](_0x5726ab){return Boolean(_0x51bc24(_0x5726ab)&&Ki(_0x5726ab)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function Zi({editor:_0x6689cd,changeGroups:_0x36e6c7,documentContextContent:_0x24858a,showDiff:_0x280067,trimUnchanged:_0x285b3a=!0x0}){return _0x36e6c7['map'](_0x24e42c=>{const _0x1cfe80=new _0x617866([]),_0x3acbc8=new _0x617866([]),_0x2ae909=new Set();for(const _0x9d1caa of _0x24e42c['changes'])'new'==_0x9d1caa['type']&&Yi('data-id',null,_0x9d1caa['node'])['forEach'](_0x44fe3e=>{_0x2ae909['add']($i(_0x44fe3e,'data-id'));});for(const _0x1a34ca of _0x24e42c['changes'])if('removed'!=_0x1a34ca['type']?_0x3acbc8['children']['push'](_0x1a34ca['node']['cloneNode'](!0x0)):_0x280067||_0x2ae909['has'](_0x1a34ca['id'])||_0x3acbc8['children']['push'](_0x1a34ca['node']['cloneNode'](!0x0)),'new'!=_0x1a34ca['type']&&(_0x280067||'removed'!=_0x1a34ca['type'])){const _0x4c3ddd=_0x10d1dd(_0x308d1b=>$i(_0x308d1b,'data-id')==_0x1a34ca['id'],_0x24858a,!0x0);_0x4c3ddd&&_0x1cfe80['children']['push'](_0x4c3ddd['cloneNode'](!0x0));}const {content:_0x568334,hasChanges:_0x2f9d37}=function(_0x5e0bb,_0x536525,_0x1fc112,_0x540da4,_0x930dc6=!0x0){const _0x4ebd6b=_0x5e0bb['plugins']['get']('DocumentCompare'),_0x3f40f2=Ki(_0x536525),_0xa021b1=Ki(_0x1fc112),_0x1cf9f2=_0x5e0bb['data']['parse'](_0x3f40f2,'$root'),_0x20fcf3=_0x5e0bb['model']['createPositionAt'](_0x1cf9f2,0x0),_0x5977af=_0x4ebd6b['getDiff'](_0x3f40f2,_0xa021b1,{'anchor':_0x20fcf3,'markDeletions':_0x540da4,'targetEditor':_0x5e0bb}),_0x38383f=_0x5977af['getOperations']();if(0x0==_0x38383f['length'])return{'content':_0x536525['cloneNode'](!0x0),'hasChanges':!0x1};_0x540da4?function(_0xf72afe,_0x23e62f,_0x157b81){if(0x0==_0xf72afe['length'])return;const _0x501e32=_0x157b81['plugins']['get']('DocumentCompare'),_0x5b8936=_0x157b81['plugins']['get']('SuggestionsConversion');_0x157b81['model']['change'](_0x130c8c=>{const _0x1e020f=new Set();for(let _0x108191=0x0;_0x108191<_0xf72afe['length'];_0x108191++){const _0x3d585a=_0xf72afe[_0x108191];if(_0x3d585a['baseVersion']=null,_0x3d585a['isDocumentOperation']=!0x1,_0x501e32['isMarkedRemoveOperation'](_0x3d585a)){const _0x1bfd50=_0x331213(_0x3d585a['newRange'],_0x157b81['model']),_0x79a25b='suggestion:deletion:'+ot()+':$aiSuggestion';_0x23e62f['markers']['set'](_0x79a25b,_0x1bfd50);}else switch(_0x3d585a['type']){case'rename':{if(_0x3d585a['oldName']==_0x3d585a['newName'])break;_0x130c8c['batch']['addOperation'](_0x3d585a),_0x157b81['model']['applyOperation'](_0x3d585a);const _0x51501d='$elementName',_0x2b38a5=_0x3d585a['position'],_0x3bc496=_0x157b81['model']['createRange'](_0x2b38a5,_0x157b81['model']['createPositionAt'](_0x2b38a5['nodeAfter'],'end')),_0x3c24f2='suggestion:attribute:'+_0x51501d+':'+ot()+':$aiSuggestion';_0x23e62f['markers']['set'](_0x3c24f2,_0x3bc496);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x3d585a['oldValue']==_0x3d585a['newValue'])break;_0x130c8c['batch']['addOperation'](_0x3d585a),_0x157b81['model']['applyOperation'](_0x3d585a);const _0x4eb0c5=_0x3d585a['key'];if(!_0x5b8936['isRegisteredAttribute'](_0x4eb0c5))break;const _0x209f4e=_0x331213(_0x3d585a['range'],_0x157b81['model']),_0x171540='suggestion:attribute:'+_0x4eb0c5+':'+ot()+':$aiSuggestion';_0x23e62f['markers']['set'](_0x171540,_0x209f4e);break;}case'insert':{_0x130c8c['batch']['addOperation'](_0x3d585a),_0x157b81['model']['applyOperation'](_0x3d585a);if(_0xf72afe[_0x108191+0x1]&&'move'==_0xf72afe[_0x108191+0x1]['type']){ts(_0x23e62f,_0x3d585a);break;}const _0x547af5=_0x3d585a['position'],_0x10a892=_0x3d585a['howMany'],_0x2b0874=_0x331213(_0x157b81['model']['createRange'](_0x547af5,_0x547af5['getShiftedBy'](_0x10a892)),_0x157b81['model']),_0x563344='suggestion:insertion:'+ot()+':$aiSuggestion';_0x23e62f['markers']['set'](_0x563344,_0x2b0874);break;}case'split':{_0x130c8c['batch']['addOperation'](_0x3d585a),_0x157b81['model']['applyOperation'](_0x3d585a);const _0x32ba52=_0x3d585a['splitPosition'],_0x45619d=_0x3d585a['moveTargetPosition'],_0x1c1826=_0x157b81['model']['createRange'](_0x32ba52,_0x45619d),_0x10969a='suggestion:insertion:'+ot()+':$aiSuggestion';_0x23e62f['markers']['set'](_0x10969a,_0x1c1826);break;}case'move':{_0x130c8c['batch']['addOperation'](_0x3d585a),_0x157b81['model']['applyOperation'](_0x3d585a),_0xf72afe[_0x108191-0x1]&&'insert'==_0xf72afe[_0x108191-0x1]['type']&&ts(_0x23e62f,_0x3d585a);const _0x355c78=_0x3d585a['getMovedRangeStart'](),_0xfc1031=_0x3d585a['howMany'];for(let _0x3e4d8f=0x0;_0x3e4d8f<_0xfc1031;_0x3e4d8f++){const _0x25ff00=_0x355c78['getShiftedBy'](_0x3e4d8f)['nodeAfter'];_0x1e020f['add'](_0x25ff00);}break;}case'remove':{const _0xbb5b64=_0x3d585a['sourcePosition'],_0x3642a3=_0x3d585a['howMany'],_0x403a7f=new _0x42f63b(_0xbb5b64,_0x3642a3);_0x130c8c['batch']['addOperation'](_0x403a7f),_0x157b81['model']['applyOperation'](_0x403a7f);break;}}}for(const _0x397351 of _0x1e020f){const _0x2cdc8e=_0x157b81['model']['createRangeOn'](_0x397351),_0x48ed76='suggestion:formatBlock:$fakeWrap:'+ot()+':$aiSuggestion';_0x23e62f['markers']['set'](_0x48ed76,_0x331213(_0x2cdc8e,_0x157b81['model']));}});}(_0x38383f,_0x1cf9f2,_0x5e0bb):_0x5e0bb['model']['change'](_0x252f96=>{for(const _0xd0ee8e of _0x38383f)if('remove'==_0xd0ee8e['type']){const _0x4b5066=_0xd0ee8e['sourcePosition'],_0x4aa142=_0xd0ee8e['howMany'],_0x17436f=new _0x42f63b(_0x4b5066,_0x4aa142);_0x252f96['batch']['addOperation'](_0x17436f),_0x5e0bb['model']['applyOperation'](_0x17436f);}else{if('marker'==_0xd0ee8e['type']){const _0x8cac11=_0xd0ee8e['name'],_0x75f32c=_0xd0ee8e['newRange'];null!==_0x75f32c?_0x1cf9f2['markers']['set'](_0x8cac11,_0x75f32c):_0x1cf9f2['markers']['delete'](_0x8cac11);}else _0xd0ee8e['baseVersion']=null,_0xd0ee8e['isDocumentOperation']=!0x1,_0x252f96['batch']['addOperation'](_0xd0ee8e),_0x5e0bb['model']['applyOperation'](_0xd0ee8e);}});if(_0x930dc6){const _0x33d560=es(_0x5e0bb,_0x38383f,_0x1cf9f2);is(_0x5e0bb['model'],_0x33d560),function(_0xdd3c8e,_0x5c889f){const _0x551bc9=_0x5c889f['getFirstRange']()['start'];let _0x499549=_0x5c889f['getFirstRange']()['end'];const _0x2abf06=_0x551bc9['root'];(_0x499549['textNode']||_0x499549['nodeAfter']&&_0x499549['nodeAfter']['is']('$text'))&&(_0x967622(_0x499549,'...'),_0x499549=_0x499549['getShiftedBy'](0x3)),(_0x551bc9['textNode']||_0x551bc9['nodeBefore']&&_0x551bc9['nodeBefore']['is']('$text'))&&(_0x967622(_0x551bc9,'...'),function(_0x40109a,_0xedab99,_0x4a90ef){for(let [_0x2acb9a,_0x1c8286]of _0x40109a['markers']){const _0x125bd6=_0x1c8286['_getTransformedByInsertion'](_0xedab99,_0x4a90ef,!0x1);_0x1c8286=_0x125bd6[0x0],_0x40109a['markers']['set'](_0x2acb9a,_0x1c8286);}}(_0x2abf06,_0x551bc9,0x3),_0x551bc9['parent']==_0x499549['parent']&&(_0x499549=_0x499549['getShiftedBy'](0x3)));const _0x49ea64=_0xdd3c8e['createRange'](_0xdd3c8e['createPositionAt'](_0x2abf06,0x0),_0x551bc9),_0xcc7a71=_0xdd3c8e['createRange'](_0x499549,_0xdd3c8e['createPositionAt'](_0x2abf06,'end')),_0x54a45b=[..._0x49ea64['getMinimalFlatRanges'](),..._0xcc7a71['getMinimalFlatRanges']()];_0x54a45b['reverse']();for(const _0x456112 of _0x54a45b)_0x5b03c0(_0x456112),ns(_0x2abf06,_0x456112);}(_0x5e0bb['model'],_0x33d560);}const _0x2ffbea=_0x5e0bb['data']['stringify'](_0x1cf9f2,{'showSuggestionHighlights':!0x0});return{'content':Fi(_0x2ffbea),'hasChanges':!0x0};}(_0x6689cd,_0x1cfe80,_0x3acbc8,_0x280067,_0x285b3a);return{'type':_0x24e42c['changes'][0x0]['type'],'index':_0x24e42c['index'],'content':_0x568334,'hasChanges':_0x2f9d37};});}function ts(_0x35f63f,_0x475889){for(const [_0x51ecde,_0xe3dfa7]of _0x35f63f['markers']){const _0x4bf195=_0x5d6ed6['_createFromRanges'](_0xe3dfa7['getTransformedByOperation'](_0x475889));_0x35f63f['markers']['set'](_0x51ecde,_0x4bf195);}}function es(_0x29b85f,_0x3fa7be,_0x14c0da){const _0x57bb54=_0x29b85f['plugins']['get']('DocumentCompare');let _0x3bb38d=_0x29b85f['model']['createPositionAt'](_0x14c0da,Number['POSITIVE_INFINITY']),_0x4a1a82=_0x29b85f['model']['createPositionAt'](_0x14c0da,0x0);for(const _0x998fa7 of _0x3fa7be){let _0x7e68ef,_0x137039;if(_0x57bb54['isMarkedRemoveOperation'](_0x998fa7))_0x7e68ef=_0x998fa7['newRange']['start'],_0x137039=_0x998fa7['newRange']['end'];else switch(_0x3bb38d=_0x3bb38d['getTransformedByOperation'](_0x998fa7),_0x4a1a82=_0x4a1a82['getTransformedByOperation'](_0x998fa7),_0x998fa7['type']){case'rename':_0x7e68ef=_0x998fa7['position'],_0x137039=_0x7e68ef['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x7e68ef=_0x998fa7['range']['start'],_0x137039=_0x998fa7['range']['end'];break;case'insert':_0x7e68ef=_0x998fa7['position'],_0x137039=_0x7e68ef['getShiftedBy'](_0x998fa7['howMany']);break;case'split':_0x7e68ef=_0x998fa7['splitPosition'],_0x137039=_0x998fa7['moveTargetPosition'];break;case'merge':{const _0x3e993f=_0x998fa7['targetPosition']['path']['slice'](0x0,-0x1);_0x7e68ef=_0x29b85f['model']['createPositionFromPath'](_0x14c0da,_0x3e993f),_0x137039=_0x7e68ef['getShiftedBy'](0x1);break;}case'move':case'remove':{const _0xeac10e=_0x998fa7['howMany'],_0x312987=_0x998fa7['sourcePosition']['_getTransformedByInsertion'](_0x998fa7['targetPosition'],_0xeac10e),_0x27ad54=_0x998fa7['getMovedRangeStart']();'remove'==_0x998fa7['type']?(_0x7e68ef=_0x312987,_0x137039=_0x312987):(_0x7e68ef=_0x27ad54,_0x137039=_0x27ad54['getShiftedBy'](_0xeac10e));break;}}_0x7e68ef&&_0x7e68ef['isBefore'](_0x3bb38d)&&(_0x3bb38d=_0x7e68ef['clone'](),_0x3bb38d['stickiness']='toNone'),_0x137039&&_0x137039['isAfter'](_0x4a1a82)&&(_0x4a1a82=_0x137039['clone'](),_0x4a1a82['stickiness']='toNone');}return _0x29b85f['model']['createSelection'](_0x29b85f['model']['createRange'](_0x3bb38d,_0x4a1a82));}function is(_0x3323f5,_0x4a4606){ss(_0x3323f5,_0x4a4606,'forward');const _0x3dff1d=_0x4a4606['getFirstRange']();_0x4a4606['setTo']([]),_0x4a4606['setTo'](_0x3dff1d,{'backward':!0x0}),ss(_0x3323f5,_0x4a4606,'backward');}function ss(_0x5a130e,_0xf40c55,_0x5840aa){let _0x2e5c43=0x14;for(;_0x2e5c43;){_0x5a130e['modifySelection'](_0xf40c55,{'unit':'word','direction':_0x5840aa}),_0x2e5c43--;const _0x48059e=_0xf40c55['focus']['forward'==_0x5840aa?'nodeBefore':'nodeAfter'];if(_0x48059e&&_0x48059e['is']('element')&&_0x5a130e['schema']['isBlock'](_0x48059e)&&_0x5a130e['schema']['isObject'](_0x48059e))break;}}function ns(_0x2df77b,_0x3c9aac){for(const [_0x2e30fd,_0x4ad49c]of _0x2df77b['markers']){const _0x127de8=_0x4ad49c['_getTransformedByDeletion'](_0x3c9aac['start'],_0x3c9aac['end']['offset']-_0x3c9aac['start']['offset']);null!=_0x127de8?_0x2df77b['markers']['set'](_0x2e30fd,_0x127de8):_0x2df77b['markers']['delete'](_0x2e30fd);}}class AIReply extends ht(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x617866([]);['parsedMergedContent']=new _0x617866([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['isFromHistory']=!0x1;['documentContextContent'];['documentId'];['dataIdDocumentSources'];['newNodeAnchorIds']=new Map();['aiResponseParser'];['aiResponseApplier'];['locale'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x454e7f,content:_0x4d97f1='',isDone:_0x2f4979=!0x1,isComplete:_0x314651,interactionId:_0x37cdce,areActionsDisabled:_0x761cc,isFromHistory:_0x3b4d22=!0x1,documentContextContent:_0xa258f6,dataIdDocumentSources:_0xe6fa70,documentId:_0x514c72,locale:_0x2aaf77,id:_0x3be9fd}){super(),this['id']=_0x3be9fd||ot(),this['interactionId']=_0x37cdce,this['type']=_0x454e7f,this['areActionsDisabled']=!!_0x761cc,this['locale']=_0x2aaf77,this['dataIdDocumentSources']=_0xe6fa70,this['documentId']=_0x514c72,this['isFromHistory']=_0x3b4d22,this['aiResponseParser']=new AIResponseParser(),this['aiResponseApplier']=new AIResponseApplier(),this['documentContextContent']=Fi(_0xa258f6||''),this['set']('isDone',_0x2f4979),this['set']('isComplete',_0x314651??_0x2f4979),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x4d97f1);}['appendContent'](_0x3cff90){this['set']('content',this['content']+_0x3cff90);}['done'](_0x2f1879=!0x0){this['isComplete']=_0x2f1879,this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x287b10,_0x15764e){this['changeGroups'][_0x287b10]['state']=_0x15764e,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x287b10,'state':_0x15764e});}['getContentParts']({showDiff:_0x455bd1,groupIndex:_0x1678cf,editor:_0x2c9dce}){const _0x276b02=this['_getCachedContentParts'](_0x455bd1,_0x1678cf);if(_0x276b02)return _0x276b02;let _0x49b5ee=[];if(void 0x0===_0x1678cf)_0x49b5ee=this['changeGroups'];else{const _0xc55d79=this['changeGroups']['find'](({index:_0x4add64})=>_0x4add64===_0x1678cf);if(!_0xc55d79)throw new at('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x1678cf});_0x49b5ee=[_0xc55d79];}const _0x674509=Zi({'editor':_0x2c9dce,'showDiff':_0x455bd1,'changeGroups':_0x49b5ee,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x455bd1,_0x674509),_0x674509;}['_getCachedContentParts'](_0x3a4196,_0x2dffdf){const _0x202bc2=_0x3a4196?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x202bc2]['length'])return null;const _0x524746=this['cachedSuggestionContentParts'][_0x202bc2];if(void 0x0===_0x2dffdf)return _0x524746['length']>0x0&&_0x524746['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x3a4196,null),null):_0x4d8886(_0x524746);{const _0xfe2368=_0x524746['find'](({index:_0x244019})=>_0x244019===_0x2dffdf);if(_0xfe2368)return[_0x4d8886(_0xfe2368)];}return null;}['_setCachedContentParts'](_0x3549fd,_0x4d38a3){const _0x531815=_0x3549fd?'withDiff':'withoutDiff';_0x4d38a3?_0x4d38a3['forEach'](_0x13f003=>{const _0x50bcb1=this['cachedSuggestionContentParts'][_0x531815],_0x4e65e4=_0x50bcb1['find'](({index:_0x502604})=>_0x502604===_0x13f003['index']);if(_0x4e65e4){const _0x96fd2d=_0x50bcb1['indexOf'](_0x4e65e4);_0x50bcb1['splice'](_0x96fd2d,0x1,_0x13f003);}else _0x50bcb1['push'](_0x13f003);}):this['cachedSuggestionContentParts'][_0x531815]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x4f0a2c=this['changeGroups'];this['updateChangeGroups']();const _0x17b71d=this['_getDifferentChangeGroups'](_0x4f0a2c,this['changeGroups']);(_0x17b71d['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x17b71d),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x501357,_0x2ff7fc){const _0x4fddb8=[];for(const _0x226570 of _0x2ff7fc){const _0x1e614a=_0x501357[_0x226570['index']];_0x1e614a?_0x1e614a['changes']['length']!==_0x226570['changes']['length']?_0x4fddb8['push'](_0x226570):_0x1e614a['changes']['forEach']((_0x3de856,_0x5dc61f)=>{const _0x5b749d=_0x226570['changes'][_0x5dc61f];_0x3de856['id']!==_0x5b749d['id']&&_0x4fddb8['push'](_0x226570);}):_0x4fddb8['push'](_0x226570);}return _0x4fddb8;}['updateChangeGroups'](){const _0x335736=this['locale']?new _0x1f4caa('p',{},[new _0x1f4caa('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x54c8f4(Hi(this['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]):void 0x0,_0x5da2a5=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone']||!this['isComplete'],'replaceRemovedWith':_0x335736,'cutAfterLastChange':!this['isDone']||!this['isComplete']});if(!_0x5da2a5['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x5da2a5['parsedContent'],this['newNodeAnchorIds']=_0x5da2a5['newAnchorIds'];let _0x252c5a=[];if(_0x11b699(_0x4f4734=>{const _0x6dfadf=$i(_0x4f4734,'data-id');if(!_0x6dfadf||!_0x3dc60c(_0x6dfadf))return!0x1;const _0x42701a=[_0x4f4734,...Xi(_0x4f4734)]['at'](-0x2);if(_0x4f4734!=_0x42701a){const _0x79d5fa=$i(_0x42701a,'data-id');_0x3dc60c(_0x79d5fa)||(_0x252c5a['push']({'node':_0x42701a,'id':_0x79d5fa,'type':'modified'}),_0x5da2a5['modifiedNodeIds']['push'](_0x79d5fa));}else _0x5da2a5['modifiedNodeIds']['includes'](_0x6dfadf)?_0x252c5a['push']({'node':_0x4f4734,'type':'modified','id':_0x6dfadf}):_0x5da2a5['newNodeIds']['includes'](_0x6dfadf)?_0x252c5a['push']({'node':_0x4f4734,'type':'new','id':_0x6dfadf,'anchorId':$i(_0x4f4734['previousSibling'],'data-id')}):_0x252c5a['push']({'node':_0x4f4734,'type':'removed','id':_0x6dfadf});return!0x0;},this['parsedMergedContent']),_0x252c5a=_0x252c5a['filter'](({node:_0x2c7eaa})=>[...Xi(_0x2c7eaa),_0x2c7eaa]['every'](_0x5861ba=>!$i(_0x5861ba,'data-unstable'))),0x0==_0x252c5a['length'])return;const _0x575356=[[_0x252c5a[0x0]]];for(let _0x24a3a6=0x1;_0x24a3a6<_0x252c5a['length'];_0x24a3a6++){const _0x4ce36d=_0x575356[_0x575356['length']-0x1],_0x28bc53=_0x4ce36d[_0x4ce36d['length']-0x1];_0x252c5a[_0x24a3a6]['node']['previousSibling']==_0x28bc53['node']&&'modified'!=_0x252c5a[_0x24a3a6]['type']&&'modified'!=_0x28bc53['type']&&this['_isSameDocument'](_0x252c5a[_0x24a3a6]['node'],_0x28bc53['node'])?_0x4ce36d['push'](_0x252c5a[_0x24a3a6]):_0x575356['push']([_0x252c5a[_0x24a3a6]]);}for(const _0x42fa96 of _0x575356){const _0x178842=_0x42fa96[0x0],_0x1dce57=_0x42fa96[_0x42fa96['length']-0x1],_0x3d9001=_0x592d1f(_0x178842['node']['previousSibling']);_0x3d9001&&this['_isSameDocument'](_0x3d9001['node'],_0x178842['node'])&&_0x42fa96['unshift'](_0x3d9001);const _0x221994=_0x592d1f(_0x1dce57['node']['nextSibling']);_0x221994&&this['_isSameDocument'](_0x221994['node'],_0x1dce57['node'])&&_0x42fa96['push'](_0x221994);}function _0x3dc60c(_0x1e9c2c){return _0x5da2a5['modifiedNodeIds']['includes'](_0x1e9c2c)||_0x5da2a5['newNodeIds']['includes'](_0x1e9c2c)||_0x5da2a5['removedNodeIds']['includes'](_0x1e9c2c);}function _0x592d1f(_0x4ce588){if(_0x4ce588&&$i(_0x4ce588,'data-id')&&!$i(_0x4ce588,'data-unstable')){const _0x53299f=$i(_0x4ce588,'data-id');if(!_0x3dc60c(_0x53299f))return{'node':_0x4ce588,'type':'context','id':_0x53299f};}return null;}this['changeGroups']=_0x575356['map']((_0x594198,_0x500d5e)=>({'changes':_0x594198,'state':'pending','index':_0x500d5e}));}['_isSameDocument'](_0x472ac6,_0x16922c){if(!this['dataIdDocumentSources']?.['size'])return!0x0;const _0xf2e241=this['_resolveDocumentSource'](_0x472ac6),_0xcbc2fa=this['_resolveDocumentSource'](_0x16922c);return!_0xf2e241||!_0xcbc2fa||_0xf2e241['editor']===_0xcbc2fa['editor']&&_0xf2e241['rootName']===_0xcbc2fa['rootName'];}['_resolveDocumentSource'](_0x5b6ecd){if(!_0x5b6ecd||!this['dataIdDocumentSources'])return;const _0x13362c=$i(_0x5b6ecd,'data-id');if(_0x13362c){const _0x9dd383=this['dataIdDocumentSources']['get'](_0x13362c);if(_0x9dd383)return _0x9dd383;const _0x195475=this['newNodeAnchorIds']['get'](_0x13362c),_0x7f55f8=_0x195475?this['dataIdDocumentSources']['get'](_0x195475):void 0x0;if(_0x7f55f8)return _0x7f55f8;}for(let _0x2f5019=_0x5b6ecd['previousSibling'];_0x2f5019;_0x2f5019=_0x2f5019['previousSibling']){const _0x72eda0=$i(_0x2f5019,'data-id'),_0x1b2180=_0x72eda0?this['dataIdDocumentSources']['get'](_0x72eda0):void 0x0;if(_0x1b2180)return _0x1b2180;}for(let _0x4d9d89=_0x5b6ecd['nextSibling'];_0x4d9d89;_0x4d9d89=_0x4d9d89['nextSibling']){const _0x5cbede=$i(_0x4d9d89,'data-id'),_0x319e1f=_0x5cbede?this['dataIdDocumentSources']['get'](_0x5cbede):void 0x0;if(_0x319e1f)return _0x319e1f;}}}const rs=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class AIInteraction extends Et(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['locale'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x59283f,locale:_0x5d3535}){super(),this['id']=ot(),this['connector']=_0x59283f,this['isStopped']=!0x0,this['locale']=_0x5d3535;}async['start'](){const _0x2b51ee=[];let _0x56eae2,_0x5c9ff7,_0x5e1bc4,_0x4460ff=!0x1;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x500ffa=await this['currentRequest']['getStream']();for await(const _0xc3e20 of _0x500ffa){if(this['isStopped'])return;if('error'==_0xc3e20['event'])return void this['fire']('error',{'error':new at('ai-chat-interaction-error',this)});switch(_0xc3e20['event']){case'message-metadata':this['messageId']=_0xc3e20['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0xc3e20['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0xc3e20['data']['conversationTitle'],!0x0);break;case'source':_0x2b51ee['push'](_0xc3e20['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'](),_0x56eae2='modification-delta'==_0xc3e20['event']?'modification':'text',_0x5c9ff7='modification-delta'==_0xc3e20['event']?_0xc3e20['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x56eae2&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']?'modification-delta'==_0xc3e20['event']&&(this['currentReply']['documentId']=_0xc3e20['data']['documentId']):(this['currentReply']=this['createReply']({'type':_0x56eae2,'interactionId':this['id'],'id':_0x5c9ff7,...'modification-delta'==_0xc3e20['event']&&{'documentId':_0xc3e20['data']['documentId']}}),'modification'==_0x56eae2&&(this['currentReply']['sources']=_0x2b51ee['splice'](0x0))),this['currentReply']['appendContent'](_0xc3e20['data']['textDelta']);break;case'mcp-tool-result':_0x5e1bc4=JSON['parse'](_0xc3e20['data']['result']),this['_handleToolResultData']({'toolName':_0xc3e20['data']['toolName'],'data':_0x5e1bc4['data'],'attributes':_0x5e1bc4['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0xc3e20['data']['toolName'],'data':_0xc3e20['data']['data']});}}_0x4460ff=!0x0;}finally{this['isStopped']||(this['currentReply']&&_0x2b51ee['length']>0x0&&(this['currentReply']['sources']=_0x2b51ee['splice'](0x0)),this['_finalizeInteraction'](_0x4460ff),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x4ac904){return this['replies']['find'](_0x12fbab=>_0x12fbab['id']===_0x4ac904);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x33ab08=>_0x33ab08['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x5eb264){const _0x278b56=new AIReply({'locale':this['locale'],'documentContextContent':this['getDocumentContext']()?.['content'],'dataIdDocumentSources':this['getDocumentContext']()?.['dataIdDocumentSources'],..._0x5eb264});return this['replies']['push'](_0x278b56),_0x278b56['delegate'](...rs)['to'](this),this['fire']('replyCreated',_0x278b56),_0x278b56;}['setConversationTitle'](_0x4cf082,_0x3e17eb=!0x1){this['fire']('setConversationTitle',_0x4cf082,_0x3e17eb);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x2d95b1){this['fire']('toolDataReceived',{'type':'result','toolName':_0x2d95b1['toolName'],'data':structuredClone(_0x2d95b1['data']||{}),'attributes':structuredClone(_0x2d95b1['attributes']||{})},this);}['_handleToolNotificationData'](_0x13f733){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x13f733['toolName'],'data':structuredClone(_0x13f733['data'])},this);}['_finalizeInteraction'](_0x4ba274=!0x1){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](_0x4ba274),this['currentRequest']=this['currentReply']=void 0x0;}}const os=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']]),as=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class AIChatContext extends ht(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x3f1c40,config:_0x198c8f,ownerId:_0x17f3e7}){super(),this['_connector']=_0x3f1c40,this['_config']=_0x198c8f,this['_ownerId']=_0x17f3e7;}['init'](){this['_pendingContextItems']=new Map(),this['_conversationContextItems']=new Map(),this['_ongoingUploads']=new Map(),this['_ongoingUploadOperations']=new Map(),this['_documentSources']=new Map(),this['_dataIdToSource']=new Map(),this['_setAddContextOptionsDefaultState']();}['_getDocumentSource'](_0xf71ac8){if(_0xf71ac8)return this['_documentSources']['get'](_0xf71ac8);}['getSourceByDataId'](_0x10ede1){if(_0x10ede1)return this['_dataIdToSource']['get'](_0x10ede1);}['_getDocumentContextSlice'](_0x29d058){const _0x11390f=this['_getDocumentSource'](_0x29d058);if(_0x11390f)return{'editor':_0x11390f['editor'],'rootName':_0x11390f['rootName'],'html':_0x11390f['content'],'version':_0x11390f['version']};}['getDocumentContextSliceByDataId'](_0x21254e){const _0x40d8db=this['getSourceByDataId'](_0x21254e);return _0x40d8db?this['_getDocumentContextSlice'](_0x40d8db['documentId']):void 0x0;}['getPendingContextItems'](){return this['_pendingContextItems'];}async['populateFromMessage'](_0x1f1b16){const _0x5c2086=await this['_createContextItemFromContent'](_0x1f1b16);return this['_addToConversationContextItem'](_0x5c2086),'current-document'===_0x5c2086['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x5c2086;}async['populateDocumentsFromMessage'](_0x56ff9a,_0x45a6a5){const _0x811690=_0x56ff9a['filter'](_0x428784=>'document'===_0x428784['type']);if(0x0===_0x811690['length'])return{'hasUnmatched':!0x1};if(0x1===_0x811690['length'])return{'contextItem':await this['populateFromMessage'](_0x811690[0x0]),'hasUnmatched':!0x1};const _0x5cd0a5=_0x811690['map'](_0x9bb231=>_0x9bb231['id']),_0x58033a=await this['_connector']['fetchDocuments'](this['_ownerId'],_0x5cd0a5)['getDocuments'](),_0x660bdf=new Map(_0x58033a['map'](_0x1b21fc=>[_0x1b21fc['id'],_0x1b21fc]));this['_documentSources']['clear'](),this['_dataIdToSource']['clear']();const _0x1de5d4=[];let _0x5567d3=!0x1;for(const _0xf716c6 of _0x811690){const _0xc7a39b=_0x660bdf['get'](_0xf716c6['id']);if(!_0xc7a39b)continue;const _0x508b40=this['_matchDocumentToRoot'](_0xc7a39b,_0x45a6a5),_0x2bd1bb=_0x45a6a5[0x0]&&this['_getFirstRoot'](_0x45a6a5[0x0]);_0x508b40||(_0x5567d3=!0x0);const _0x216847=_0x508b40?.['editor']??_0x2bd1bb?.['editor'],_0xa6fcd5=_0x508b40?.['rootName']??_0x2bd1bb?.['rootName'];if(_0x216847&&_0xa6fcd5){const _0x3a64ac={'editor':_0x216847,'rootName':_0xa6fcd5,'content':_0xc7a39b['content'],'version':_0xc7a39b['attributes']?.['version']??0x0,'name':_0xc7a39b['name'],'description':_0xc7a39b['description']};this['_documentSources']['set'](_0xc7a39b['id'],_0x3a64ac);const _0x516f82=Fi(_0xc7a39b['content']);for(const _0x58b97c of _0x11b699(_0x17b149=>!!$i(_0x17b149,'data-id'),_0x516f82)){const _0x41b4aa=$i(_0x58b97c,'data-id');_0x41b4aa&&this['_dataIdToSource']['set'](_0x41b4aa,{..._0x3a64ac,'documentId':_0xc7a39b['id']});}}_0x1de5d4['push']({'id':_0xc7a39b['id'],'content':_0xc7a39b['content'],'version':_0xc7a39b['attributes']?.['version']??0x0,'sessionId':_0xc7a39b['attributes']?.['sessionId']??null,'selection':[]});}const _0x3a9c66={'id':'current-document','uiId':'current-document','label':'Current\x20document','type':'document','hidden':this['_conversationContextItems']['has']('current-document'),'documents':_0x1de5d4,'dataIdDocumentSources':new Map(this['_dataIdToSource'])};return this['_addToConversationContextItem'](_0x3a9c66),this['_toggleAddCurrentDocumentOptionVisibility'](),{'contextItem':_0x3a9c66,'hasUnmatched':_0x5567d3};}['_matchDocumentToRoot'](_0x4b1c49,_0x346780){const _0x2677c0=_0x4b1c49['attributes']?.['channelId'],_0x5d75a0=_0x4b1c49['attributes']?.['rootName'];if(_0x2677c0&&_0x5d75a0){for(const _0x28a149 of _0x346780)if(_0x28a149['config']['get']('collaboration.channelId')===_0x2677c0){for(const _0x1c0061 of _0x28a149['model']['document']['getRoots']())if('$graveyard'!==_0x1c0061['rootName']&&_0x1c0061['rootName']===_0x5d75a0)return{'editor':_0x28a149,'rootName':_0x1c0061['rootName']};}}}['_getFirstRoot'](_0x407479){for(const _0x5e1672 of _0x407479['model']['document']['getRoots']())if('$graveyard'!==_0x5e1672['rootName'])return{'editor':_0x407479,'rootName':_0x5e1672['rootName']};}async['_createContextItemFromContent'](_0x24f6df){if('document'===_0x24f6df['type']){const _0x33ebd5=await this['_connector']['fetchDocument'](this['_ownerId'],_0x24f6df['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x24f6df['type'],'content':_0x33ebd5['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x33ebd5['attributes']?.['version'],'sessionId':_0x33ebd5['attributes']?.['sessionId']};}if('mcp-tool-context'===_0x24f6df['type'])return{'id':_0x24f6df['id'],'uiId':_0x24f6df['id'],'label':_0x24f6df['data']?.['label']||_0x24f6df['id'],'type':'mcp-tool-context','mcpServerName':_0x24f6df['mcpServerName'],'toolName':_0x24f6df['toolName'],'data':_0x24f6df['data']||{}};return{'id':_0x24f6df['id'],'uiId':_0x24f6df['id'],'label':_0x24f6df['attributes']?.['label']||_0x24f6df['name']||_0x24f6df['url']||_0x24f6df['id'],'type':_0x24f6df['type'],..._0x24f6df?.['attributes']?.['resourceId']?{'resourceId':_0x24f6df['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x373515){const _0x3eefac=this['_pendingContextItems']['get'](_0x373515);_0x3eefac?.['isReadOnly']||this['_removeContextItem'](_0x373515);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x1efbfb of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x1efbfb['uiId']);const _0x32ad4e=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x32ad4e&&this['_addContextItem']({..._0x32ad4e,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x4acd03){for(const _0x12a31f of _0x4acd03['values']())this['_addToConversationContextItem'](_0x12a31f);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'](_0x224194){return Array['from'](_0x224194['values']())['flatMap'](_0x16439b=>this['_mapContextItemToRequestData'](_0x16439b));}async['addFilesToContext'](_0x39efb0,_0x2880bb,_0x2d4e53='file'){const _0x1a744d='files-'+ot();this['_startUploadOperation'](_0x1a744d);try{await Promise['all'](_0x39efb0['map'](async _0x163088=>{const _0x1e32ad='file-'+ot(),_0x12eebe=_0x2d9792(_0x163088['name']);try{this['_addContextItem']({'type':_0x2d4e53,'label':_0x2880bb?.['label']||_0x12eebe,'uiId':_0x1e32ad,'resourceId':_0x2880bb?.['resourceId']},!0x0);const _0xe2dac2=this['_connector']['uploadFile'](this['_ownerId'],_0x163088,_0x2880bb);this['_ongoingUploads']['set'](_0x1e32ad,_0xe2dac2['abortController']);const {id:_0x4af4a2}=await _0xe2dac2['getId']();this['_ongoingUploads']['delete'](_0x1e32ad),this['_finishContextItemLoading']({'type':_0x2d4e53,'id':_0x4af4a2,'label':_0x2880bb?.['label']||_0x12eebe,'uiId':_0x1e32ad,'resourceId':_0x2880bb?.['resourceId']},!0x1);}catch(_0x266d8b){this['_ongoingUploads']['delete'](_0x1e32ad);if(!(_0x266d8b instanceof at&&_0x266d8b['message']['startsWith']('ai-request-aborted'))){const _0x2c898f=os['get'](_0x266d8b['code'])||'ai-chat-file-upload-failed',_0x1b15f4=new at(_0x2c898f,null,{'fileName':_0x12eebe,..._0x266d8b});_0x1b15f4['stack']=_0x266d8b['stack'],this['fire']('error',{'error':_0x1b15f4});}this['_removeContextItem'](_0x1e32ad);}}));}finally{this['_finishUploadOperation'](_0x1a744d);}}['addCurrentDocumentToContext'](_0x40e483){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x3f93c1={'type':'document','uiId':'current-document','label':_0x40e483,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x3f93c1);}async['updateCurrentDocument'](_0x40ef45,_0x4bdaf3,_0x15236a,_0x5e03cd,_0x1308c1,_0x493cf3){const _0x5c78d2=this['_pendingContextItems']['get']('current-document');if(_0x5c78d2&&_0x40ef45){_0x5c78d2['selection']=_0x493cf3?_0x493cf3['map'](_0x3d3f1a=>({'start':_0x3d3f1a['start'],'end':_0x3d3f1a['end']})):[];try{if(_0x5c78d2['version']===_0x4bdaf3)return;const {id:_0x403e12}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x40ef45,{'version':_0x4bdaf3,'sessionId':_0x15236a,'channelId':_0x5e03cd,'rootName':_0x1308c1})['getId']();_0x5c78d2['id']=_0x403e12,_0x5c78d2['content']=_0x40ef45,_0x5c78d2['version']=_0x4bdaf3,_0x5c78d2['sessionId']=_0x15236a;}catch(_0x270893){const _0x1cdb9c=new at('ai-chat-document-upload-failed',null);_0x1cdb9c['stack']=_0x270893['stack'],this['fire']('error',{'error':_0x1cdb9c});}}}async['updateCurrentDocuments'](_0x3dffae){const _0x4a343f=this['_pendingContextItems']['get']('current-document');if(!_0x4a343f||!_0x3dffae['length']||_0x3dffae['every'](_0x57a25f=>!_0x57a25f['content']))return;_0x3dffae['length']>0x1&&_0x3dffae['some'](_0x269886=>!_0x269886['description'])&>('ai-chat-documents-missing-description');const _0x53d654=_0x5bf51f=>_0x5bf51f?_0x5bf51f['map'](_0x5c7e95=>({'start':_0x5c7e95['start'],'end':_0x5c7e95['end']})):[],_0x259db8=_0x4a343f['documents']??[];if(_0x259db8['length']===_0x3dffae['length']&&_0x3dffae['every']((_0x16d467,_0x16e3b3)=>_0x259db8[_0x16e3b3]?.['version']===_0x16d467['version']))_0x4a343f['documents']=_0x259db8['map']((_0x59de80,_0x2620a3)=>({..._0x59de80,'selection':_0x53d654(_0x3dffae[_0x2620a3]['selections'])}));else try{const _0x5504d7=await this['_connector']['uploadDocuments'](this['_ownerId'],_0x3dffae)['getIds']();_0x4a343f['documents']=_0x3dffae['map']((_0x160feb,_0x4a1a4b)=>({'id':_0x5504d7[_0x4a1a4b]?.['id'],'content':_0x160feb['content'],'version':_0x160feb['version'],'sessionId':_0x160feb['sessionId'],'selection':_0x53d654(_0x160feb['selections'])})),this['_documentSources']['clear'](),this['_dataIdToSource']['clear']();for(let _0x52ea53=0x0;_0x52ea53<_0x3dffae['length'];_0x52ea53++){const _0x561396=_0x5504d7[_0x52ea53]?.['id'],_0x56a661=_0x3dffae[_0x52ea53];if(!_0x561396)continue;const _0x3ae1c5={'editor':_0x56a661['editor'],'rootName':_0x56a661['rootName'],'content':_0x56a661['content'],'version':_0x56a661['version'],'name':_0x56a661['name'],'description':_0x56a661['description']};this['_documentSources']['set'](_0x561396,_0x3ae1c5);const _0x3bb3bf=Fi(_0x56a661['content']);for(const _0x2f9c4f of _0x11b699(_0x2c79f5=>!!$i(_0x2c79f5,'data-id'),_0x3bb3bf)){const _0x1d87f2=$i(_0x2f9c4f,'data-id');_0x1d87f2&&this['_dataIdToSource']['set'](_0x1d87f2,{..._0x3ae1c5,'documentId':_0x561396});}}_0x4a343f['dataIdDocumentSources']=new Map(this['_dataIdToSource']);}catch(_0x34cce1){const _0xe64318=new at('ai-chat-document-upload-failed',null);_0xe64318['stack']=_0x34cce1['stack'],this['fire']('error',{'error':_0xe64318});}}['addSelectionToContext'](_0x263645){this['_addContextItem']({'type':'selection','label':_0x263645,'uiId':'selection','content':_0x263645});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x2f8056,_0x3794f4){const _0x24d06b='url-'+ot();this['_startUploadOperation'](_0x24d06b);const _0x4f1456='url-'+ot();try{this['_addContextItem']({'type':'web-resource','label':_0x3794f4?.['label']||_0x2f8056,'uiId':_0x4f1456,'resourceId':_0x3794f4?.['resourceId']},!0x0);const _0x1f8b5f=this['_connector']['uploadUrl'](this['_ownerId'],_0x2f8056,_0x3794f4);this['_ongoingUploads']['set'](_0x4f1456,_0x1f8b5f['abortController']);const {id:_0x20886b}=await _0x1f8b5f['getId']();this['_ongoingUploads']['delete'](_0x4f1456),this['_finishContextItemLoading']({'type':'web-resource','id':_0x20886b,'label':_0x3794f4?.['label']||_0x2f8056,'uiId':_0x4f1456,'resourceId':_0x3794f4?.['resourceId']},!0x1);}catch(_0x56c273){this['_ongoingUploads']['delete'](_0x4f1456),(_0x56c273['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new at('ai-chat-url-upload-failed',this,{'url':_0x2f8056,'originalError':_0x56c273}),'url':_0x2f8056}),this['_removeContextItem'](_0x4f1456));}finally{this['_finishUploadOperation'](_0x24d06b);}}['addToolItemToContext'](_0x1c7554){_0x1c7554['id']=_0x1c7554['id']??ot()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x1c7554['uiId'],_0x1c7554),this['fire']('contextItemAdded',{'contextItem':_0x1c7554,'isLoading':!0x1});}async['loadSourceResources'](_0x16a2a7,_0x35f973,_0x4c7570){const _0xca1264=this['_addContextOptionsState']['sources']['find'](_0x28f9ad=>_0x28f9ad['id']===_0x16a2a7);if(!_0xca1264)return this['fire']('error',{'error':new at('ai-chat-source-not-found',this,{'sourceId':_0x16a2a7}),'sourceId':_0x16a2a7}),[];try{const _0x47bb58=(await _0xca1264['getResources'](_0x35f973))['map'](_0x30760f=>{const _0x3326c1=this['_isResourceInContext'](_0x30760f['id']);return{..._0x30760f,'isInContext':_0x3326c1};});return _0xca1264['resources']=_0x47bb58,this['fire']('sourceResourcesLoaded',{'sourceId':_0x16a2a7,'source':_0xca1264,'resources':_0x47bb58,'uid':_0x4c7570}),_0x47bb58;}catch(_0x24dde3){return this['fire']('error',{'error':new at('ai-chat-source-resources-load-failed',this,{'sourceId':_0x16a2a7,'originalError':_0x24dde3}),'sourceId':_0x16a2a7,'sourceLabel':_0xca1264['label']}),[];}}async['addResourceToContext'](_0xa13715,_0x29876f){if(this['_isResourceInContext'](_0x29876f['id']))return;let _0x57358a=_0x29876f['data'];if(!_0x57358a&&_0xa13715['getData'])try{_0x57358a=await _0xa13715['getData'](_0x29876f['id']);}catch(_0x414fe1){return void this['fire']('error',{'error':new at('ai-chat-resource-load-failed',this,{'resourceId':_0x29876f['id'],'sourceId':_0xa13715['id'],'originalError':_0x414fe1}),'resourceId':_0x29876f['id'],'sourceId':_0xa13715['id']});}if(_0x57358a)switch(_0x29876f['type']){case'web-resource':if('string'!=typeof _0x57358a)return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x29876f['id'],'sourceId':_0xa13715['id'],'expectedType':'string','actualType':typeof _0x57358a}),'resourceId':_0x29876f['id'],'sourceId':_0xa13715['id']});await this['addUrlToContext'](_0x57358a,{'label':_0x29876f['label'],'resourceId':_0x29876f['id']});break;case'file':if(!(_0x57358a instanceof File))return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x29876f['id'],'sourceId':_0xa13715['id'],'expectedType':'File','actualType':typeof _0x57358a}),'resourceId':_0x29876f['id'],'sourceId':_0xa13715['id']});await this['addFilesToContext']([_0x57358a],{'label':_0x29876f['label'],'resourceId':_0x29876f['id']});break;case'text':if('object'!=typeof _0x57358a||!('content'in _0x57358a)||!('type'in _0x57358a))return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x29876f['id'],'sourceId':_0xa13715['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x57358a}),'resourceId':_0x29876f['id'],'sourceId':_0xa13715['id']});_0x57358a=AIChatContext['_convertTextResourceToFile'](_0x57358a,_0x29876f['label']),await this['addFilesToContext']([_0x57358a],{'label':_0x29876f['label'],'resourceId':_0x29876f['id']},'text');break;case'mcp-tool-context':break;default:this['fire']('error',{'error':new at('ai-chat-context-unsupported-type',this,{'resourceId':_0x29876f['id'],'sourceId':_0xa13715['id'],'resourceType':_0x29876f['type']}),'resourceId':_0x29876f['id'],'sourceId':_0xa13715['id']});}else this['fire']('error',{'error':new at('ai-chat-resource-no-data',this,{'resourceId':_0x29876f['id'],'sourceId':_0xa13715['id']}),'resourceId':_0x29876f['id'],'sourceId':_0xa13715['id']});}static['_convertTextResourceToFile'](_0x2c37f9,_0x266d89){switch(_0x2c37f9['type']){case'markdown':return new File([_0x2c37f9['content']],_0x266d89,{'type':'text/markdown'});case'html':return new File([_0x2c37f9['content']],_0x266d89,{'type':'text/html'});default:return new File([_0x2c37f9['content']],_0x266d89,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x184677){switch(_0x184677['type']){case'file':case'text':return[{'type':'file','id':_0x184677['id']}];case'web-resource':return[{'type':'web-resource','id':_0x184677['id']}];case'document':return _0x184677['documents']?.['length']?_0x184677['documents']['map'](_0x337aae=>({'type':'document','id':_0x337aae['id'],..._0x337aae['selection']?.['length']&&{'selection':_0x337aae['selection']}})):[{'type':'document','id':_0x184677['id'],..._0x184677['selection']?.['length']&&{'selection':_0x184677['selection']}}];case'mcp-tool-context':{const _0x7c4d47=_0x184677;return[{'type':'mcp-tool-context','mcpServerName':_0x7c4d47['mcpServerName'],'toolName':_0x7c4d47['toolName'],'data':{..._0x7c4d47['data'],'label':_0x7c4d47['label']||_0x7c4d47['data']?.['label']||_0x7c4d47['id']},'id':_0x7c4d47['id']}];}default:return[];}}['_addContextItem'](_0x3e057a,_0x5920ec=!0x1){if(this['_pendingContextItems']['set'](_0x3e057a['uiId'],_0x3e057a),_0x3e057a['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x3e057a,'isLoading':_0x5920ec}),'current-document'===_0x3e057a['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x3e057a['resourceId']){const _0x37d56b=this['_findSourceIdsByResourceId'](_0x3e057a['resourceId']);_0x37d56b&&_0x37d56b['forEach'](_0x408000=>{this['_updateResourceInContextState'](_0x408000,_0x3e057a['resourceId'],!0x0);});}}['_removeContextItem'](_0x2b2009){const _0x56212e=this['_pendingContextItems']['get'](_0x2b2009),_0x3d0e23=this['_ongoingUploads']['get'](_0x2b2009);if(_0x3d0e23&&(_0x3d0e23['abort'](),this['_ongoingUploads']['delete'](_0x2b2009)),_0x56212e?.['resourceId']){const _0x389eb7=this['_findSourceIdsByResourceId'](_0x56212e['resourceId']);_0x389eb7&&_0x389eb7['forEach'](_0x214461=>{this['_updateResourceInContextState'](_0x214461,_0x56212e['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x2b2009),this['fire']('contextItemRemoved',{'uiId':_0x2b2009,'type':_0x56212e?.['type']}),'current-document'===_0x2b2009&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x369571,_0x2e10b6){if(this['_pendingContextItems']['has'](_0x369571['uiId'])&&(this['_pendingContextItems']['set'](_0x369571['uiId'],_0x369571),this['fire']('contextItemLoadingEnded',{'contextItem':_0x369571,'isLoading':_0x2e10b6}),_0x369571['resourceId'])){const _0x5e660e=this['_findSourceIdsByResourceId'](_0x369571['resourceId']);_0x5e660e&&_0x5e660e['forEach'](_0x245920=>{this['_updateResourceInContextState'](_0x245920,_0x369571['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x516e45){this['_conversationContextItems']['set'](_0x516e45['uiId'],_0x516e45);}['_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'](_0x581e20=>({..._0x581e20,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x28ad85=>({..._0x28ad85,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x9f3c58=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x9f3c58,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x6d59b7){for(const _0xb2fb60 of this['_pendingContextItems']['values']())if(_0xb2fb60['resourceId']===_0x6d59b7)return!0x0;for(const _0x18fb3a of this['_conversationContextItems']['values']())if(_0x18fb3a['resourceId']===_0x6d59b7)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x3d92d5){const _0x350398=[];for(const _0xc0f7d5 of this['_addContextOptionsState']['sources']){_0xc0f7d5['resources']['find'](_0x142080=>_0x142080['id']===_0x3d92d5)&&_0x350398['push'](_0xc0f7d5['id']);}return 0x0===_0x350398['length']?null:_0x350398;}['_updateResourceInContextState'](_0x4e12e2,_0x4d8cdf,_0x2e2b2c){const _0x50394e=this['_addContextOptionsState']['sources']['find'](_0x451c99=>_0x451c99['id']===_0x4e12e2);if(!_0x50394e)return;const _0x2533ed=_0x50394e['resources']['find'](_0x50c431=>_0x50c431['id']===_0x4d8cdf);_0x2533ed&&(_0x2533ed['isInContext']=_0x2e2b2c,this['fire']('resourceStateChanged',{'sourceId':_0x4e12e2,'resourceId':_0x4d8cdf,'isInContext':_0x2e2b2c}));}['_startUploadOperation'](_0x430fc9){this['_ongoingUploadOperations']['set'](_0x430fc9,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x3bcb5c){this['_ongoingUploadOperations']['delete'](_0x3bcb5c),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const hs=['capabilitiesUpdated'];class AICapabilities extends Et(){['_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'](_0x1a31c1){const _0x1cdc29={};return _0x1a31c1&&_0x1a31c1['isWebSearchEnabled']&&(_0x1cdc29['webSearch']={}),_0x1a31c1&&_0x1a31c1['isReasoningEnabled']&&(_0x1cdc29['reasoning']={}),_0x1cdc29;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x29b1d4){_0x29b1d4!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x29b1d4,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x381bea){_0x381bea!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x381bea,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class AIChatInteraction extends AIInteraction{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0x228305){super(_0x228305),this['conversationId']=_0x228305['conversationId'],this['contextItems']=_0x228305['contextItems'],this['capabilities']=_0x228305['capabilities'],this['userMessage']=_0x228305['userMessage'],this['model']=_0x228305['model'],this['attributes']=_0x228305['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':AIChatContext['mapContextItemsToRequestData'](this['contextItems']),'capabilities':AICapabilities['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}['createReply'](_0x1a15c5){const _0x316f7f=this['getDocumentContext']();if(_0x316f7f?.['documents']?.['length']){const _0xc9de71=_0x316f7f['documents']['map'](_0x5acbf2=>_0x5acbf2['content']??'')['join']('');if(_0xc9de71)return super['createReply']({'documentContextContent':_0xc9de71,..._0x1a15c5});}return super['createReply'](_0x1a15c5);}}class AIChatConversation extends Et(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x5b0d68){super(),this['options']=_0x5b0d68,this['connector']=_0x5b0d68['connector'],this['chatModels']=_0x5b0d68['chatModels'],this['id']=_0x5b0d68['conversationId'],this['isFromHistory']=_0x5b0d68['isFromHistory'];}async['init'](_0x494fa4){try{this['chatContext']=new AIChatContext({'connector':this['connector'],'config':_0x494fa4,'ownerId':this['id']}),this['chatContext']['delegate'](...as)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new AICapabilities(),this['chatCapabilities']['delegate'](...hs)['to'](this),this['chatCapabilities']['init']();const _0x109b78=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x109b78});const _0x295d6e=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x295d6e&&await this['setModel'](_0x295d6e);}catch(_0x4cc202){const _0x4653b8=new at('ai-chat-conversation-init-failed',null,{'message':_0x4cc202['message']||_0x4cc202});_0x4653b8['stack']=_0x4cc202['stack'],this['fire']('error',{'error':_0x4653b8});}}async['start'](){if(this['isStarted'])throw new at('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new at('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x58e56c}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x58e56c,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x4ae868){const _0x392357=new at('ai-chat-conversation-start-failed',null,{'message':_0x4ae868['message'],'conversationId':this['id']});throw _0x392357['stack']=_0x4ae868['stack'],this['fire']('error',{'error':_0x392357}),_0x392357;}}async['load'](_0x2c9833,_0x2bde13){try{const _0x3457d5=await this['connector']['fetchConversation'](_0x2c9833)['getConversation'](),_0x1c50ee=await this['connector']['fetchConversationMessages'](_0x2c9833)['getMessages'](),_0x4cae91=_0x1c50ee[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x3457d5['id'],'title'in _0x3457d5?this['fire']('setConversationTitle',_0x3457d5['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x21bc40=(await this['chatModels']['getAll']())['find'](_0x292f95=>_0x292f95['id']['toLowerCase']()===_0x4cae91['toLowerCase']());return this['selectedModel']=_0x21bc40,this['fire']('modelSelected',{'selectedModel':_0x21bc40,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x1c50ee,_0x2bde13,_0x4cae91),this['currentInteraction']=void 0x0,this;}catch(_0x50acbd){const _0x2a53b4=new at('ai-chat-conversation-init-from-id-failed',null,{'message':_0x50acbd['message'],'conversationId':_0x2c9833});throw _0x2a53b4['stack']=_0x50acbd['stack'],this['fire']('error',{'error':_0x2a53b4}),_0x2a53b4;}}async['_processMessagesToInteractions'](_0x50df61,_0x4528bf,_0x146ef9){let _0x196a41,_0x14f221=!0x1;for(const _0x4c958e of _0x50df61)if('user'===_0x4c958e['role']){const {contextItems:_0x5d5c29,hasUnmatched:_0x1f8b1e}=await this['_extractContextItems'](_0x4c958e);_0x14f221=_0x1f8b1e;const _0x21c45e={'isReasoningEnabled':Object['hasOwn'](_0x4c958e['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x4c958e['capabilities'],'webSearch')};_0x196a41=this['createInteraction']({'userMessage':_0x4c958e['prompt'],'contextItems':_0x5d5c29,'capabilities':_0x21c45e,'modelId':_0x146ef9,'attributes':_0x4c958e['attributes']}),this['currentInteraction']=_0x196a41,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x4c958e['role']&&_0x196a41){const _0x34e159=[];for(const _0x107a27 of _0x4c958e['content'])switch(_0x107a27['type']){case'text':case'modification':{const _0x38d732=_0x196a41['getDocumentContext'](),_0x599e40=(_0x38d732?.['documents']?.['length']?_0x38d732['documents']['some'](_0x1e55ab=>_0x1e55ab['sessionId']!==_0x4528bf):_0x38d732?.['sessionId']!==_0x4528bf)||_0x14f221;_0x196a41['currentReply']?.['type']!==_0x107a27['type']&&(_0x196a41['currentReply']=_0x196a41['createReply']({'type':_0x107a27['type'],'isDone':!0x0,'interactionId':_0x196a41['id'],'areActionsDisabled':_0x599e40,'isFromHistory':!0x0}),_0x34e159['length']>0x0&&(_0x196a41['currentReply']['sources']=_0x34e159['splice'](0x0))),_0x196a41['currentReply']['appendContent'](_0x107a27['content']);break;}case'url':_0x34e159['push'](_0x107a27);break;case'mcp-tool-result':{const {data:_0x3b0239,attributes:_0x56163b}=JSON['parse'](_0x107a27['content']);_0x196a41['_handleToolResultData']({'toolName':_0x107a27['toolName'],'data':_0x3b0239,'attributes':_0x56163b});break;}}}}}async['_extractContextItems'](_0x59034c){const _0x32885c=new Map();if(!_0x59034c['content'])return{'contextItems':_0x32885c,'hasUnmatched':!0x1};const _0x1893e7=this['_resolveEditors'](),{contextItem:_0x3c3a88,hasUnmatched:_0x29bc8e}=await this['chatContext']['populateDocumentsFromMessage'](_0x59034c['content'],_0x1893e7);_0x3c3a88&&_0x32885c['set'](_0x3c3a88['id'],_0x3c3a88);for(const _0x1063d2 of _0x59034c['content']){if('document'===_0x1063d2['type'])continue;const _0x427dcf=await this['chatContext']['populateFromMessage'](_0x1063d2);_0x427dcf&&_0x32885c['set'](_0x427dcf['id'],_0x427dcf);}return{'contextItems':_0x32885c,'hasUnmatched':_0x29bc8e};}['_resolveEditors'](){return this['options']['getEditors']?this['options']['getEditors']():this['options']['getEditor']?[this['options']['getEditor']()]:[];}async['handleUserInteraction']({userMessage:_0x3b346e,attributes:_0x59939b}){if(!this['isStarted'])throw new at('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new at('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0xaab588=this['chatContext']['getPendingContextItems'](),_0x196683=this['chatCapabilities']['getCapabilitiesConfig'](),_0x3c9aa8=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x3b346e,'contextItems':_0xaab588,'capabilities':_0x196683,'modelId':_0x3c9aa8,'attributes':_0x59939b}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x3a866d){if(_0x3a866d instanceof at)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x3a866d});else{const _0x1afe8a=os['get'](_0x3a866d['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new at(_0x1afe8a,null,{'error':_0x3a866d})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x55a2c6,contextItems:_0x1d4dbf,capabilities:_0x1a963c,modelId:_0x54f2f0,attributes:_0x32e392}){const _0x285e70=new AIChatInteraction({'userMessage':_0x55a2c6,'contextItems':_0x1d4dbf,'capabilities':_0x1a963c,'conversationId':this['id'],'connector':this['connector'],'locale':this['options']['locale'],'model':_0x54f2f0,'attributes':_0x32e392});return _0x285e70['delegate'](...rs)['to'](this),this['interactions']['push'](_0x285e70),this['fire']('interactionCreated',_0x285e70),_0x285e70;}['getInteraction'](_0x5af8a3){return this['interactions']['find'](_0x454a80=>_0x454a80['id']===_0x5af8a3);}['removeInteraction'](_0x239361){const _0xeb67e0=this['getInteraction'](_0x239361);_0xeb67e0&&(_0xeb67e0['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0xeb67e0),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0xb1ab91){this['chatContext']['addCurrentDocumentToContext'](_0xb1ab91);}async['updateCurrentDocumentInContext']({content:_0x30735d,version:_0x4432da,sessionId:_0x1916d0,channelId:_0xb95095,rootName:_0x54df81,selections:_0x178ee9}){await this['chatContext']['updateCurrentDocument'](_0x30735d,_0x4432da,_0x1916d0,_0xb95095,_0x54df81,_0x178ee9);}async['updateCurrentDocumentsInContext'](_0xc10aaf){await this['chatContext']['updateCurrentDocuments'](_0xc10aaf);}['getSourceByDataId'](_0x119566){return this['chatContext']['getSourceByDataId'](_0x119566);}['getDocumentContextSliceByDataId'](_0x1a7002){return this['chatContext']['getDocumentContextSliceByDataId'](_0x1a7002);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x2c90ea){this['chatContext']['addSelectionToContext'](_0x2c90ea);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x5c8233){this['chatContext']['addFilesToContext'](_0x5c8233);}['addUrlToContext'](_0x36ae07){this['chatContext']['addUrlToContext'](_0x36ae07);}['addToolItemToContext'](_0xad0ebc){this['chatContext']['addToolItemToContext'](_0xad0ebc);}['addResourceToContext'](_0x56ec79,_0x1f4e2b){this['chatContext']['addResourceToContext'](_0x56ec79,_0x1f4e2b);}['loadSourceResources'](_0x25daef,_0x3bd8c6,_0x514228){return this['chatContext']['loadSourceResources'](_0x25daef,_0x3bd8c6,_0x514228);}['removeFromContext'](_0x32113a){this['chatContext']['removeFromContext'](_0x32113a);}['setWebSearch'](_0x1cbf3f){this['chatCapabilities']['setWebSearch'](_0x1cbf3f);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x292ff3){this['chatCapabilities']['setReasoning'](_0x292ff3);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x4f1f7a){_0x4f1f7a?!0x1===await this['chatModels']['isAvailable'](_0x4f1f7a)&&(gt('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x4f1f7a}),_0x4f1f7a=(await this['chatModels']['getAvailableModels']())[0x0]):(gt('ai-chat-conversation-set-model-null',{'conversation':this}),_0x4f1f7a=(await this['chatModels']['getAvailableModels']())[0x0]),_0x4f1f7a['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x4f1f7a,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x4f1f7a}));}}class AIModels extends Et(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x11f6ef,config:_0x4747d2,locale:_0x42fd48}){super(),this['_connector']=_0x11f6ef,this['_config']=_0x4747d2,this['_locale']=_0x42fd48;}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 _0x48d63c=await this['getAll']();let _0x384a8e;return _0x384a8e=this['_availableModels']?this['_filterModels'](_0x48d63c,this['_availableModels']):_0x48d63c['filter'](_0x378599=>_0x378599['recommended']),_0x384a8e;}async['getModel'](_0x2cda80){const _0x40cb46=await this['getAll']();if(!_0x40cb46['length'])return null;if(_0x2cda80){const _0x48846e=this['_getModelById'](_0x40cb46,_0x2cda80);if(_0x48846e)return _0x48846e;gt('ai-chat-model-id-unrecognized',{'modelId':_0x2cda80,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x1c5eb6=await this['getAvailableModels']();if(!_0x1c5eb6['length'])return null;if(this['_defaultModelId']){const _0x230e74=this['_getModelById'](_0x1c5eb6,this['_defaultModelId']);if(_0x230e74)return _0x230e74;gt('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x1c5eb6[0x0]['id']});}return _0x1c5eb6[0x0];}async['isAvailable'](_0x4978c1){return(await this['getAvailableModels']())['some'](_0x50ce10=>_0x50ce10['name']===_0x4978c1['name']&&_0x50ce10['provider']===_0x4978c1['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0xfca49f=this['_locale']['uiLanguage']||'en',_0x3b9df6=this['_connector']['getModels'](_0xfca49f),_0x1a0157=await _0x3b9df6['list']();this['_modelList']=_0x1a0157['items']['map'](_0x51e165=>cs(_0x51e165)?{..._0x51e165,'name':Hi(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x51e165);}catch(_0x1122a0){throw Ct('ai-models-unable-to-retrieve',{'error':_0x1122a0}),_0x1122a0;}return[...this['_modelList']];}['_filterModels'](_0x1e4009,_0x29a9f0){let _0x3f13a6;if(_0x29a9f0){_0x3f13a6=[];const _0x29717c=new Set(),_0x126eed='string'==typeof _0x29a9f0?[_0x29a9f0['toLocaleLowerCase']()]:_0x29a9f0['map'](_0x451e61=>_0x451e61['toLocaleLowerCase']());for(const _0x5cf77b of _0x126eed)for(const _0x2786c7 of _0x1e4009)!_0x29717c['has'](_0x2786c7['id'])&&this['_isMatchingFilter'](_0x2786c7,_0x5cf77b)&&(_0x3f13a6['push'](_0x2786c7),_0x29717c['add'](_0x2786c7['id']));}else _0x3f13a6=_0x1e4009;return _0x3f13a6;}['_isMatchingFilter'](_0x504bb6,_0x4c2209){const _0x13560c=_0x504bb6['id']['toLocaleLowerCase'](),_0x1ef362=_0x504bb6['name']['toLocaleLowerCase'](),_0x5dedf5=_0x504bb6['provider']['toLocaleLowerCase']();return _0x13560c===_0x4c2209||_0x1ef362===_0x4c2209||cs(_0x504bb6)&&'auto'===_0x4c2209||_0x5dedf5===_0x4c2209||_0x13560c['startsWith'](_0x4c2209);}['_getModelById'](_0x4ce351,_0x58b82d){return _0x4ce351['find'](_0x5bcc28=>cs(_0x5bcc28)&&'auto'===_0x58b82d?_0x5bcc28:_0x5bcc28['id']===_0x58b82d)||null;}}function cs(_0x346b68){return _0x346b68['id']['startsWith']('agent');}function ls(_0x1f7545){return _0x1f7545?_0x1f7545 instanceof _0x3cd9d5?[_0x1f7545]:_0x1f7545['editors']&&0x0!==_0x1f7545['editors']['length']?Array['from'](_0x1f7545['editors']):[]:[];}function us(_0x2accee){const _0x9f4c27=ls(_0x2accee);if(!_0x9f4c27['length'])throw new at('ai-get-editor-from-context-no-editor');if(0x1===_0x9f4c27['length'])return _0x9f4c27[0x0];const _0x4e07b5=_0x9f4c27['find'](_0x5d3517=>_0x5d3517['ui']?.['focusTracker']?.['isFocused']);if(_0x4e07b5)return _0x4e07b5;const _0x2612c0=function(_0x110461){if(_0x110461 instanceof _0x3cd9d5)return;const _0x508b57=_0x110461;if(!_0x508b57['plugins']||!_0x508b57['plugins']['has']('AIEditing'))return;const _0x1f508c=_0x508b57['plugins']['get']('AIEditing');return _0x1f508c['getLastContentFocusedEditor']?.();}(_0x2accee);return _0x2612c0&&_0x9f4c27['includes'](_0x2612c0)?_0x2612c0:_0x9f4c27[0x0];}function ds(_0xd596b1){return us(_0xd596b1);}function _s({editor:_0x54aa75,interaction:_0x5f489a,reply:_0x484b3d,groups:_0x478845,transform:_0x55e5b0,documentCompare:_0x3babbb,documentCompareOptions:_0xe96699,documentContextSlice:_0x3d27a5}){const _0x5bb801=_0x5f489a['getDocumentContext']();if(!_0x5bb801)return[];const _0x2ca6f2=_0x484b3d['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x302c8d}of _0x478845){const _0x46bb70=_0x302c8d['filter'](_0xf9cecb=>'new'!=_0xf9cecb['type'])['map'](_0x5205b7=>Wi('data-id',_0x5205b7['id'],_0x2ca6f2)),_0x13b98b=_0x302c8d['filter'](_0x3f258f=>'removed'!=_0x3f258f['type'])['map'](_0xb86bd8=>_0xb86bd8['node']['cloneNode'](!0x0));let _0x3e9222=null;if(_0x46bb70['length']){_0x3e9222=_0x46bb70[0x0]['previousSibling'];for(let _0x12ed17=0x0;_0x12ed17<_0x46bb70['length'];_0x12ed17++)_0x8926a6(_0x46bb70[_0x12ed17]);}if(_0x13b98b['length']){_0x3e9222||(_0x302c8d[0x0]['anchorId']?_0x3e9222=Wi('data-id',_0x302c8d[0x0]['anchorId'],_0x2ca6f2):(_0x3e9222=_0x13b98b['shift'](),_0x3d3041(_0x2ca6f2,_0x3e9222)));for(let _0x3657c6=0x0;_0x3657c6<_0x13b98b['length'];_0x3657c6++)_0x1d7e6a(_0x3e9222,_0x13b98b[_0x3657c6]),_0x3e9222=_0x13b98b[_0x3657c6];}}let _0x5a31c2,_0x372eff,_0x503489,_0x12954d=_0xe96699;if(_0x3d27a5){_0x5a31c2=_0x3d27a5['html'],_0x503489=_0x3d27a5['version'],_0x12954d={..._0xe96699,'anchor':_0x3d27a5['rootName']};const _0x5d10db=new _0x617866([]),_0x3866a7=_0x2ca6f2['children'],_0x4ea605=_0x484b3d['dataIdDocumentSources'],_0x4c23f5=_0x484b3d['newNodeAnchorIds'],_0x11fdae=_0x3d27a5['editor'],_0x504b30=_0x3d27a5['rootName'],_0x5b3c83=new Array(_0x3866a7['length']),_0x204d95=_0x4830ec=>_0x4830ec?_0x4830ec['editor']===_0x11fdae&&_0x4830ec['rootName']===_0x504b30:void 0x0;for(let _0x4c5655=0x0;_0x4c5655<_0x3866a7['length'];_0x4c5655++){const _0x4003a3=$i(_0x3866a7[_0x4c5655],'data-id');if(!_0x4003a3)continue;const _0x1dc82f=_0x204d95(_0x4ea605?.['get'](_0x4003a3));if(void 0x0!==_0x1dc82f){_0x5b3c83[_0x4c5655]=_0x1dc82f;continue;}const _0x9175d2=_0x4c23f5['get'](_0x4003a3),_0x4b08b4=_0x9175d2?_0x204d95(_0x4ea605?.['get'](_0x9175d2)):void 0x0;void 0x0!==_0x4b08b4&&(_0x5b3c83[_0x4c5655]=_0x4b08b4);}for(let _0x996c4c=0x0;_0x996c4c<_0x3866a7['length'];_0x996c4c++)if(void 0x0===_0x5b3c83[_0x996c4c]){for(let _0x45cdab=_0x996c4c-0x1;_0x45cdab>=0x0;_0x45cdab--)if(void 0x0!==_0x5b3c83[_0x45cdab]){_0x5b3c83[_0x996c4c]=_0x5b3c83[_0x45cdab];break;}if(void 0x0===_0x5b3c83[_0x996c4c]){for(let _0x19cac2=_0x996c4c+0x1;_0x19cac2<_0x3866a7['length'];_0x19cac2++)if(void 0x0!==_0x5b3c83[_0x19cac2]){_0x5b3c83[_0x996c4c]=_0x5b3c83[_0x19cac2];break;}}}for(let _0x2a572c=0x0;_0x2a572c<_0x3866a7['length'];_0x2a572c++)_0x5b3c83[_0x2a572c]&&_0x5d10db['children']['push'](_0x252747(_0x3866a7[_0x2a572c],!0x0));_0x372eff=Ki(_0x5d10db);}else _0x5a31c2=_0x5bb801['content'],_0x503489=_0x5bb801['version'],_0x372eff=Ki(_0x2ca6f2);const _0x125405=_0x3babbb['getDiff'](_0x5a31c2,_0x372eff,{..._0x12954d,'targetEditor':_0x54aa75})['getOperations']();if(_0x55e5b0){const _0x43d8da=_0x54aa75['model']['document']['history']['getOperations'](_0x503489),_0x11ca0d={'document':_0x54aa75['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x2d44f8(_0x125405,_0x43d8da,_0x11ca0d)['operationsA'];}return _0x125405;}function Is(_0x5bb50d,_0x2a6c71){if('marker'!=_0x2a6c71['type'])return;const _0x4f9602=_0x5bb50d['model']['markers']['get'](_0x2a6c71['name']);_0x4f9602&&(_0x2a6c71['oldRange']=_0x4f9602['getRange']());}class AIChatController extends _0x3cc0e4{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_activeBalloon'];['_wiredBalloons']=new Set();['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[AIConnector,_0x490f88];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new Qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new AIModels({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x51a098=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x127485,_0x168aa7)=>{this['_handleUIUserMessage']({'message':_0x168aa7});}),this['listenTo'](_0x51a098['view'],'change:activeTab',(_0x4dd986,_0x47125e,_0x36578f)=>{'chat'!==_0x36578f&&this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['addCurrentDocumentToChatContext']();}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x5570a4,_0x3857ce)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x3857ce));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x497c3b,_0x2c271e)=>{this['activeConversation']?.['addUrlToContext'](_0x2c271e);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x2f9a8d,_0x5eafd8)=>{_0x5eafd8['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x49d2d4,_0x54e828)=>{this['activeConversation']?.['addResourceToContext'](_0x54e828['source'],_0x54e828['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x5d9cc5,_0x3f5983)=>{this['_removeFromContext'](_0x3f5983);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x8a8b05,_0x21f95d)=>{this['activeConversation']?.['loadSourceResources'](_0x21f95d['sourceId'],_0x21f95d['query'],_0x21f95d['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x1361d5,_0x45744d)=>{this['activeConversation']?.['setModel'](_0x45744d);}),this['listenTo'](this['_aiChatUi'],'like',(_0x502429,{replyId:_0x2e5395})=>{console['log']('Liked\x20response',_0x2e5395);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x411930,{replyId:_0x338f5b})=>{console['log']('Disliked\x20response',_0x338f5b);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x989c06,_0x4b2735)=>{this['_insertSuggestion'](_0x4b2735);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x1b86aa,{replyId:_0x3d4f1f,partIndex:_0xa81f73})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x3d4f1f,_0xa81f73);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0xdd3595,{replyId:_0x2b281d,partIndex:_0x12154f})=>{const _0xd67ea4=this['_getDocumentRangeForReplyChanges'](_0x2b281d,_0x12154f);_0xd67ea4&&'$graveyard'!=_0xd67ea4['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'ranges':[_0xd67ea4['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x12fc8f,_0x3844e4)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x3844e4);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x115aaa,{replyId:_0xdd8ce3,showDiff:_0x284658})=>{const {reply:_0xab6b7a}=this['getInteractionAndReplyById'](_0xdd8ce3),_0x4f5610=_0xab6b7a['getContentParts']({'showDiff':_0x284658,'editor':ds(this['context'])});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0xab6b7a['id'],'parts':_0x4f5610});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x47473b,{replyId:_0x4df826,partIndex:_0x2a6e4f})=>{this['_rejectSuggestion']({'replyId':_0x4df826,'partIndex':_0x2a6e4f}),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['set']('_aiChatBalloonShowDiff',!0x1),this['context']['plugins']['has']('AIChatBalloon')&&(this['_aiChatBalloon']=this['context']['plugins']['get']('AIChatBalloon')),this['on']('interactionCreated',(_0x26cdea,_0x1305ae)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x1305ae);}),this['on']('replyCreated',(_0x109452,_0x2aae72)=>{this['_addFeedItemReply'](_0x2aae72);});}async['afterInit'](){this['context']instanceof _0x3cd9d5?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x1d3b17,_0x43166d)=>{_0x43166d['on']('ready',()=>{this['_integrateEditor'](_0x43166d);});});const _0x2cea98=this['context']['config']['get']('ai.chat.initialConversation');let _0x2e8f69=_0x2cea98;if('lastCreated'!=_0x2cea98||(_0x2e8f69=await this['_getLastCreatedConversationId'](),_0x2e8f69))return'new'==_0x2e8f69?this['_startConversationSafely']():this['loadConversation'](_0x2e8f69);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0x1d12fc){this['_activeBalloon']?.['close'](),this['_activeBalloon']=void 0x0,this['_currentPreviewedChangeGroup']=null,(this['context']['plugins']['get'](AITabs)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x1d12fc)['getConversation'](),await this['_startConversationSafely']({'id':_0x1d12fc}),this['_updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x1d12fc,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x1d9502){this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x1d12fc}),this['_logError'](new at('ai-chat-conversation-not-found',this,{'error':_0x1d9502}));}finally{this['_aiChatUi']['startAutoScroll']({'smooth':!0x1}),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0x5a9162){let _0x30f7f1=null,_0x15fc62=null;this['on']('toolDataReceived',(_0x2140f7,_0x5a213c,_0x3d538e)=>{_0x3d538e['id']!==_0x30f7f1&&(_0x30f7f1=_0x3d538e['id'],_0x15fc62=this['_getAIChatFeedAPI'](_0x3d538e)),_0x5a9162(_0x5a213c,_0x15fc62);});}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](Hi(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x55f157=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x55f157),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](_0xbeeeec){await this['_startConversationSafely']({'modelId':_0xbeeeec?.['modelId']});}async['sendMessage'](_0x3c4534){await this['_handleUIUserMessage'](_0x3c4534);}['getGroupId'](){const _0x37948d=this['context']['config']['get']('collaboration.channelId');if(!_0x37948d)throw new at('ai-missing-channel-id',this);return _0x37948d;}['_handleRemovedConversation'](_0x5647f7){this['activeConversation']['id']===_0x5647f7&&this['_startConversationSafely']();}['_insertSuggestion'](_0x208dca){const _0x282b65=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x53f096,interaction:_0x7d8ae5}=this['getInteractionAndReplyById'](_0x208dca['replyId']),_0x3fbb5a=void 0x0!==_0x208dca['partIndex']?[_0x53f096['changeGroups'][_0x208dca['partIndex']]]:_0x53f096['changeGroups']['filter'](_0x38fde4=>'pending'==_0x38fde4['state']);for(const _0x4258fd of this['_groupChangesByTarget'](_0x53f096,_0x3fbb5a)){const {target:_0xe9f799,groups:_0x485c0e,groupsIndexes:_0x420847,slice:_0x18de35}=_0x4258fd;if(!_0xe9f799['editor']['plugins']['has']('TrackChanges'))throw new at('ai-no-track-changes',null);const _0x245c09=this['_getDocumentRangeForReplyChanges'](_0x208dca['replyId'],_0x420847[0x0]);if(!_0x245c09||'$graveyard'==_0x245c09['range']['root']['rootName']){_0x420847['forEach'](_0x32ae0a=>_0x53f096['setChangeGroupState'](_0x32ae0a,'outdated'));continue;}_0x420847['forEach'](_0x115a47=>_0x53f096['setChangeGroupState'](_0x115a47,'accepted'));const _0x17ad25=_s({'editor':_0xe9f799['editor'],'reply':_0x53f096,'interaction':_0x7d8ae5,'groups':_0x485c0e,'transform':!0x0,'documentCompare':_0x282b65,'documentCompareOptions':{'anchor':_0x18de35?.['rootName']??'main','markDeletions':!0x0},'documentContextSlice':_0x18de35});let _0x4e645b;this['_scrollToSuggestionRange'](_0x245c09['range'],!0x1,_0xe9f799['editor']),_0xe9f799['editor']['model']['change'](_0x34160d=>{_0x4e645b=_0x34160d['batch'],_0xe9f799['editor']['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x17ad25),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x4e645b,{'interactionId':_0x7d8ae5['id'],'replyId':_0x53f096['id'],'indexes':_0x420847['slice']()});}this['_updateRatings'](_0x53f096);}['_applySuggestion'](_0x5e06e7){const _0xf0f396=this['context']['plugins']['get'](_0x490f88),{reply:_0x2b93f9,interaction:_0x1aa8bc}=this['getInteractionAndReplyById'](_0x5e06e7['replyId']),_0x2bcbf5=void 0x0!==_0x5e06e7['partIndex']?[_0x2b93f9['changeGroups'][_0x5e06e7['partIndex']]]:_0x2b93f9['changeGroups']['filter'](_0x1ed729=>'pending'==_0x1ed729['state']);for(const _0x33a88f of this['_groupChangesByTarget'](_0x2b93f9,_0x2bcbf5)){const {target:_0x2da176,groups:_0x57cebc,groupsIndexes:_0x346f54,slice:_0x33631f}=_0x33a88f,_0x2c4a62=this['_getDocumentRangeForReplyChanges'](_0x5e06e7['replyId'],_0x346f54[0x0]);if(!_0x2c4a62||'$graveyard'==_0x2c4a62['range']['root']['rootName']){_0x346f54['forEach'](_0x36c623=>_0x2b93f9['setChangeGroupState'](_0x36c623,'outdated'));continue;}_0x346f54['forEach'](_0x1598a6=>_0x2b93f9['setChangeGroupState'](_0x1598a6,'accepted'));const _0x414bae=_s({'editor':_0x2da176['editor'],'reply':_0x2b93f9,'interaction':_0x1aa8bc,'groups':_0x57cebc,'transform':!0x0,'documentCompare':_0xf0f396,'documentCompareOptions':{'anchor':_0x33631f?.['rootName']??'main','markDeletions':!0x1},'documentContextSlice':_0x33631f});let _0x55fe78;this['_scrollToSuggestionRange'](_0x2c4a62['range'],!0x1,_0x2da176['editor']),_0x2da176['editor']['model']['change'](_0x2f9099=>{_0x55fe78=_0x2f9099['batch'];for(const _0x4acebc of _0x414bae)_0x4acebc['baseVersion']=_0x2da176['editor']['model']['document']['version'],Is(_0x2da176['editor'],_0x4acebc),_0x2f9099['batch']['addOperation'](_0x4acebc),_0x2da176['editor']['model']['applyOperation'](_0x4acebc);}),this['_batchToChanges']['set'](_0x55fe78,{'interactionId':_0x1aa8bc['id'],'replyId':_0x2b93f9['id'],'indexes':_0x346f54['slice']()});}this['_updateRatings'](_0x2b93f9);}['_rejectSuggestion'](_0x4bd717){const {reply:_0x3bd933}=this['getInteractionAndReplyById'](_0x4bd717['replyId']);_0x3bd933['setChangeGroupState'](_0x4bd717['partIndex'],'rejected');}['_openBalloonFor'](_0x473970,_0x381099){if(!this['_aiChatBalloon'])return;const {reply:_0x4e18ca}=this['getInteractionAndReplyById'](_0x473970),_0x304a34=_0x4e18ca['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'editor':ds(this['context'])});let _0x5774c8,_0x899b99;if(void 0x0!==_0x381099?(_0x899b99=_0x304a34['find'](_0x36405a=>_0x36405a['index']==_0x381099),_0x5774c8=_0x899b99?.['index']):(_0x899b99=_0x304a34[0x0],_0x5774c8=_0x899b99['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x473970&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x5774c8)return;const _0x4065ec=this['_getUserPresentableContentPartDocumentRange'](_0x473970,_0x4e18ca,_0x899b99),_0x2fa3ab=_0x4e18ca['changeGroups']['find'](_0x12301d=>_0x12301d['index']==_0x5774c8),_0x401c98=_0x2fa3ab?this['_resolveGroupTarget'](_0x4e18ca,_0x2fa3ab):null,_0x59d216=_0x401c98?.['editor']??ds(this['context']),_0x3f161a=_0x59d216['plugins']['has']('AIChatBalloon')?_0x59d216['plugins']['get']('AIChatBalloon'):this['_aiChatBalloon'];if(this['_activeBalloon']&&this['_activeBalloon']!==_0x3f161a&&this['_activeBalloon']['close'](),!_0x4065ec)return _0x3f161a['close'](),void(this['_activeBalloon']=void 0x0);this['_activeBalloon']=_0x3f161a,this['_currentPreviewedChangeGroup']={'replyId':_0x473970,'partIndex':_0x5774c8},this['_scrollToSuggestionRange'](_0x4065ec,!0x0,_0x59d216);const _0x51c0dd=this['_getPresentableSiblingContentPartIndex'](_0x473970,_0x5774c8,'next');_0x3f161a['updateContent']({'part':_0x899b99,'renderingStrategy':'static'}),_0x3f161a['open']({'index':_0x5774c8,'title':Hi(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x5774c8+0x1)['toString']()),'showRotator':null!==_0x51c0dd,'ranges':[_0x4065ec],'areActionsDisabled':_0x4e18ca['areActionsDisabled'],'targetEditor':_0x59d216}),_0x3f161a['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x473970,_0x5774c8),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x473970,'index':_0x5774c8,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x42013c,_0x5189b4,_0x4293f6){const {reply:_0x56ea9f}=this['getInteractionAndReplyById'](_0x42013c),_0x5d9da5=_0x56ea9f['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'editor':ds(this['context'])});if(0x1==_0x5d9da5['length'])return null;const _0xaa8365=_0x5d9da5['findIndex'](_0x37d849=>_0x37d849['index']==_0x5189b4),_0x335d32='next'==_0x4293f6?0x1:-0x1;let _0x5735cb=_0x5d9da5['at']((_0xaa8365+_0x335d32)%_0x5d9da5['length'])['index'],_0x459279=_0x5d9da5[_0x5735cb];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x42013c,_0x56ea9f,_0x459279);){if(_0x5735cb=_0x5d9da5['at']((_0x5735cb+_0x335d32)%_0x5d9da5['length'])['index'],_0x5735cb===_0xaa8365)return null;_0x459279=_0x5d9da5[_0x5735cb];}return _0x5735cb;}['_getUserPresentableContentPartDocumentRange'](_0x5ac4ea,_0x8550c7,_0x57a98f){const _0x57e7df=_0x8550c7['changeGroups'];if(!_0x57a98f['hasChanges'])return null;const _0x5f1b48=_0x57e7df['find'](_0x527885=>_0x527885['index']==_0x57a98f['index']);if('pending'!==_0x5f1b48?.['state'])return null;const _0x652255=this['_getDocumentRangeForReplyChanges'](_0x5ac4ea,_0x57a98f['index']);if(!_0x652255)return _0x8550c7['setChangeGroupState'](_0x57a98f['index'],'outdated'),null;const {range:_0x137759,currentIndex:_0x2458d2}=_0x652255;return'$graveyard'==_0x137759['root']['rootName']?(_0x8550c7['setChangeGroupState'](_0x2458d2,'outdated'),null):_0x652255['range'];}['_getDocumentRangeForReplyChanges'](_0x5b2c41,_0x298d8){const {reply:_0x1fe298}=this['getInteractionAndReplyById'](_0x5b2c41),_0xf3ae9=_0x1fe298['changeGroups']['filter'](_0x4626a3=>'pending'==_0x4626a3['state']),_0x4f1bba=_0xf3ae9['map'](_0x243542=>_0x1fe298['changeGroups']['indexOf'](_0x243542));void 0x0===_0x298d8&&(_0x298d8=_0x4f1bba[0x0]);const _0x2423cd=_0x4f1bba['indexOf'](_0x298d8);if(-0x1==_0x2423cd)return null;const _0x155d1d=_0xf3ae9[_0x2423cd],_0x39a944=this['_resolveGroupTarget'](_0x1fe298,_0x155d1d);if(!_0x39a944)return null;const {editor:_0x1e93b7,root:_0x48d855,parsedDocumentContent:_0x168a0a,serializedDocumentContent:_0x2227a2,version:_0x6aec24}=_0x39a944,_0x818cac=new _0x617866([]),_0x38eb43=new _0x617866([]);for(const _0xb2fed0 of _0x155d1d['changes']){const _0x285e5e=this['activeConversation']?.['getSourceByDataId'](_0xb2fed0['id']);if((!_0x285e5e||_0x285e5e['editor']===_0x39a944['editor']&&_0x285e5e['rootName']===_0x39a944['root']['rootName'])&&('removed'!=_0xb2fed0['type']&&_0x38eb43['children']['push'](_0xb2fed0['node']['cloneNode'](!0x0)),'new'!=_0xb2fed0['type'])){const _0x11f5a7=_0x10d1dd(_0x5fd704=>$i(_0x5fd704,'data-id')==_0xb2fed0['id'],_0x168a0a,!0x0);if(!_0x11f5a7)return null;_0x818cac['children']['push'](_0x11f5a7['cloneNode'](!0x0));}}if(0x0==_0x818cac['children']['length']){if(_0x155d1d['changes'][0x0]['anchorId']){const _0x339ec3=Wi('data-id',_0x155d1d['changes'][0x0]['anchorId'],_0x168a0a);_0x818cac['children']['unshift'](_0x339ec3['cloneNode'](!0x0)),_0x38eb43['children']['unshift'](_0x339ec3['cloneNode'](!0x0)),_0x339ec3['nextSibling']&&(_0x818cac['children']['push'](_0x339ec3['nextSibling']['cloneNode'](!0x0)),_0x38eb43['children']['push'](_0x339ec3['nextSibling']['cloneNode'](!0x0)));}else{const _0xf9a398=_0x168a0a['children'][0x0];if(!_0xf9a398)return null;_0x818cac['children']['push'](_0xf9a398['cloneNode'](!0x0)),_0x38eb43['children']['push'](_0xf9a398['cloneNode'](!0x0));}}const _0x5704ce=_0x1e93b7['data']['parse'](_0x2227a2),_0x396e39=Ki(_0x818cac),_0x32e090=_0x1e93b7['data']['parse'](_0x396e39),_0x5396a5=_0x1e93b7['data']['parse'](_0x396e39),_0x52a631=_0x1e93b7['model']['createPositionAt'](_0x32e090,0x0),_0x4d4ad8=Ki(_0x38eb43),_0x5acb92={'targetEditor':_0x1e93b7,'anchor':_0x52a631,'markDeletions':!0x1},_0x52fd8a=_0x1e93b7['plugins']['get'](_0x490f88)['getDiff'](_0x396e39,_0x4d4ad8,_0x5acb92)['getOperations']();if(!_0x52fd8a['length'])return null;_0x1e93b7['model']['change'](_0x47bf92=>{for(const _0x12650b of _0x52fd8a)if('remove'==_0x12650b['type']){const _0x317271=_0x12650b['sourcePosition'],_0x577006=_0x12650b['howMany'],_0x554716=new _0x42f63b(_0x317271,_0x577006);_0x47bf92['batch']['addOperation'](_0x554716),_0x1e93b7['model']['applyOperation'](_0x554716);}else'marker'!==_0x12650b['type']&&(_0x12650b['baseVersion']=null,_0x12650b['isDocumentOperation']=!0x1,_0x47bf92['batch']['addOperation'](_0x12650b),_0x1e93b7['model']['applyOperation'](_0x12650b));});const _0x549bed=es(_0x1e93b7,_0x52fd8a,_0x32e090);is(_0x1e93b7['model'],_0x549bed);const _0x5a9b89=_0x549bed['getFirstRange']()['start']['path']['slice'](),_0x632cfd=_0x549bed['getFirstRange']()['end']['path']['slice'](),_0x865899=[];let _0x41d37d=_0x32e090,_0x483695=_0x5396a5;for(let _0x18629e=0x0;_0x18629e<_0x632cfd['length'];_0x18629e++){const _0x5d0d36=_0x41d37d['maxOffset']-_0x632cfd[_0x18629e];_0x865899[_0x18629e]=_0x483695['maxOffset']-_0x5d0d36,_0x41d37d=_0x41d37d['getChildAtOffset'](_0x632cfd[_0x18629e]),_0x483695=_0x483695['getChildAtOffset'](_0x865899[_0x18629e]);}const _0x28c553=_0x1e93b7['model']['createRange'](_0x1e93b7['model']['createPositionFromPath'](_0x5396a5,_0x5a9b89),_0x1e93b7['model']['createPositionFromPath'](_0x5396a5,_0x865899)),_0x10fd07=_0x5396a5['getChild'](0x0)['getAttribute'](_0x34af8c),_0x334f85=Array['from'](_0x5704ce['getChildren']())['find'](_0x3de38a=>_0x3de38a['getAttribute'](_0x34af8c)==_0x10fd07)['getPath'](),_0x45cfdd=_0x28c553['start']['path']['slice'](),_0x2c2e65=_0x28c553['end']['path']['slice']();_0x45cfdd[0x0]=_0x334f85[0x0]+_0x45cfdd[0x0],_0x2c2e65[0x0]=_0x334f85[0x0]+_0x2c2e65[0x0];let _0x58b8b8=_0x1e93b7['model']['createRange'](_0x1e93b7['model']['createPositionFromPath'](_0x48d855,_0x45cfdd),_0x1e93b7['model']['createPositionFromPath'](_0x48d855,_0x2c2e65));const _0x534998=_0x1e93b7['model']['document']['history']['getOperations'](_0x6aec24);for(const _0x1ad3b8 of _0x534998)_0x58b8b8=_0x5d6ed6['_createFromRanges'](_0x58b8b8['getTransformedByOperation'](_0x1ad3b8));return{'range':_0x58b8b8,'currentIndex':_0x298d8};}['_integrateEditorBalloon'](_0x68f8b3){if(!_0x68f8b3['plugins']['has']('AIChatBalloon'))return;const _0x1320af=_0x68f8b3['plugins']['get']('AIChatBalloon');this['_wiredBalloons']['has'](_0x1320af)||(this['_wiredBalloons']['add'](_0x1320af),this['_aiChatBalloon']||(this['_aiChatBalloon']=_0x1320af),_0x1320af['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](_0x1320af,'toggleSuggestionDisplayMode',()=>{const {replyId:_0x53e92e,partIndex:_0x189300}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x3f8bd3}=this['getInteractionAndReplyById'](_0x53e92e),_0x950775=_0x3f8bd3['changeGroups']['find'](_0x5deb90=>_0x5deb90['index']===_0x189300),_0x1221a6=_0x950775?this['_resolveGroupTarget'](_0x3f8bd3,_0x950775):null,_0x5b42be=_0x3f8bd3['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x189300,'editor':_0x1221a6?.['editor']??ds(this['context'])});(this['_activeBalloon']??_0x1320af)['updateContent']({'part':_0x5b42be[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](_0x1320af,'applySuggestion',()=>{const {replyId:_0x386244,partIndex:_0x5d601b}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x386244,'partIndex':_0x5d601b}),(this['_activeBalloon']??_0x1320af)['setState']('accepted');}),this['listenTo'](_0x1320af,'insertSuggestion',()=>{const {replyId:_0x54af24,partIndex:_0x2f0ac8}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x54af24,'partIndex':_0x2f0ac8}),(this['_activeBalloon']??_0x1320af)['setState']('accepted');}),this['listenTo'](_0x1320af,'rejectSuggestion',()=>{const {replyId:_0x1387be,partIndex:_0x49c038}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x1387be,'partIndex':_0x49c038}),(this['_activeBalloon']??_0x1320af)['setState']('rejected');}),this['listenTo'](_0x1320af,'showNext',()=>{const {replyId:_0x442d83,partIndex:_0x5d39e5}=this['_currentPreviewedChangeGroup'],_0x3195a9=this['_getPresentableSiblingContentPartIndex'](_0x442d83,_0x5d39e5,'next');null!==_0x3195a9&&this['_openBalloonFor'](_0x442d83,_0x3195a9);}),this['listenTo'](_0x1320af,'showPrevious',()=>{const {replyId:_0x1d5ee5,partIndex:_0x480ebe}=this['_currentPreviewedChangeGroup'],_0x4b8f01=this['_getPresentableSiblingContentPartIndex'](_0x1d5ee5,_0x480ebe,'previous');null!==_0x4b8f01&&this['_openBalloonFor'](_0x1d5ee5,_0x4b8f01);}),this['listenTo'](_0x1320af,'dialogClosed',(_0x2852cb,{id:_0x4d4dcb})=>{if('aiChatBalloon'!==_0x4d4dcb)return;const {replyId:_0x402922,partIndex:_0x253a6b}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x402922,'index':_0x253a6b,'isActive':!0x1}),this['_activeBalloon']===_0x1320af&&(this['_activeBalloon']=void 0x0);}));}['_integrateEditor'](_0x50f3a8){if(this['_integrateEditorBalloon'](_0x50f3a8),_0x50f3a8['plugins']['has']('Undo')){const _0xb0ebf2=_0x50f3a8['commands']['get']('undo'),_0x350931=_0x50f3a8['commands']['get']('redo');this['listenTo'](_0xb0ebf2,'revert',(_0x11fa21,_0x21103e,_0x35beff)=>{const _0x5dd235=this['_batchToChanges']['get'](_0x21103e);if(!_0x5dd235)return;const _0x2de275=this['activeConversation']['getInteraction'](_0x5dd235['interactionId']),_0x354220=_0x2de275?.['getReply'](_0x5dd235['replyId']);this['_batchToChanges']['delete'](_0x21103e),_0x2de275&&_0x354220&&(_0x5dd235['indexes']['forEach'](_0x3c94a3=>_0x354220['setChangeGroupState'](_0x3c94a3,'pending')),this['_batchToChanges']['set'](_0x35beff,_0x5dd235));}),this['listenTo'](_0x350931,'revert',(_0x46393f,_0x58aee3,_0x30bf55)=>{const _0x49c3df=this['_batchToChanges']['get'](_0x58aee3);if(!_0x49c3df)return;const _0x46f006=this['activeConversation']['getInteraction'](_0x49c3df['interactionId']),_0x560b75=_0x46f006?.['getReply'](_0x49c3df['replyId']);this['_batchToChanges']['delete'](_0x58aee3),_0x46f006&&_0x560b75&&(_0x49c3df['indexes']['forEach'](_0x41d523=>_0x560b75['setChangeGroupState'](_0x41d523,'accepted')),this['_batchToChanges']['set'](_0x30bf55,_0x49c3df));});}const _0x21a591=_0x50f3a8['config']['get']('ai.chat.context');_0x21a591['alwaysAddSelection']&&_0x21a591['document']['enabled']&&this['listenTo'](_0x50f3a8['model']['document']['selection'],'change:range',(_0x407809,_0x1aed74)=>{if(!_0x1aed74['directChange'])return;'chat'===_0x50f3a8['plugins']['get']('AITabs')['view']['activeTab']&&(_0x50f3a8['model']['hasContent'](_0x50f3a8['model']['document']['selection'])?this['addSelectionToChatContext']():this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0x2c55fc=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x585c8f=await _0x2c55fc['getConversations']();return _0x585c8f['length']?_0x585c8f[0x0]['id']:'new';}catch(_0x500286){return this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':ot()}),this['_logError'](new at('ai-chat-conversation-init-failed',this,{'error':_0x500286})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0x2882fc={}){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x2882fc);}catch(_0x5ee5a6){this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x2882fc['id']||ot()}),console['error'](_0x5ee5a6),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation']({id:_0x1420ed,modelId:_0x589fbb}={}){this['_activeBalloon']?.['close'](),this['_activeBalloon']=void 0x0,this['_currentPreviewedChangeGroup']=null;let _0x4e0723=_0x589fbb;_0x4e0723||(_0x1420ed||!this['activeConversation']?_0x4e0723=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x4e0723=this['activeConversation']['selectedModel']['id'])),await this['_stopLastInteraction']();const _0x13b612=this['getGroupId'](),_0x52c879=_0x1420ed||ot();let _0x4884fb;this['activeConversation']=new AIChatConversation({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x4e0723,'conversationId':_0x52c879,'group':_0x13b612,'getEditor':()=>ds(this['context']),'getEditors':()=>ls(this['context']),'locale':this['context']['locale'],'isFromHistory':!!_0x1420ed}),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','interactionStarted','replyCreated')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x2c784b,_0x440068)=>{this['_aiChatUi']['createConversation'](_0x440068),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x1420ed||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x80320e,_0x34b39d)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x34b39d['isUploadInProgress']);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x293f97=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x293f97);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x4cd034=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x4cd034);}),this['activeConversation']['on']('webSearchFinished',(_0x316717,_0x520473)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x520473,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x225506,_0x56e473)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x56e473,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{this['_updateReplyContentThrottled']['flush'](),await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x1ba0e9,_0x45e94d)=>{this['_aiChatUi']['removeFeedInteraction'](_0x45e94d['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x21c1cc,_0x1e7f07,_0x1c8407)=>{this['_updateConversationTitle'](_0x1e7f07,_0x1c8407);}),this['activeConversation']['on']('replyContentUpdated',async(_0xb4b07,_0x3f14f9)=>{void 0x0!==_0x4884fb&&_0x4884fb!==_0x3f14f9['id']&&this['_updateReplyContentThrottled']['flush'](),_0x4884fb=_0x3f14f9['id'],_0x3f14f9['isFromHistory']?await this['_updateReplyContent']({'reply':_0x3f14f9}):await this['_updateReplyContentThrottled']({'reply':_0x3f14f9});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x35fb40,{reply:_0x41783a,index:_0xcd9351,state:_0xf0d5f7})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x41783a['id'],'index':_0xcd9351,'state':_0xf0d5f7}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x41783a['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0xcd9351&&(this['_activeBalloon']??this['_aiChatBalloon'])?.['setState'](_0xf0d5f7);}),this['activeConversation']['on']('contextItemAdded',(_0x544586,_0x2549e3)=>{if(this['_aiChatUi']['addContextItem'](_0x2549e3['contextItem'],_0x2549e3['isLoading']),'selection'===_0x2549e3['contextItem']['type']){const _0x53cecf=[...ds(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'ranges':_0x53cecf,'id':'context','priority':0x1});}}),this['activeConversation']['on']('contextItemRemoved',(_0x1daa49,_0x28f3af)=>{this['_aiChatUi']['removeContextItem'](_0x28f3af['uiId']),'current-document'==_0x28f3af['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x28f3af['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['activeConversation']['on']('contextItemLoadingEnded',(_0xf01b74,_0x4bd073)=>{this['_aiChatUi']['setContextItemLoading'](_0x4bd073['contextItem']['uiId'],_0x4bd073['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x480be0,_0x34821f)=>{this['_aiChatUi']['setConversationContext'](_0x34821f['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x1d07b2,_0x283030)=>{this['_aiChatUi']['setAddContextOptions'](_0x283030['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x1317e8,_0x104338)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x104338['sourceId'],_0x104338['source'],_0x104338['resources'],_0x104338['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0xed0ca0,_0xacc0ad)=>{this['_aiChatUi']['updateResourceState'](_0xacc0ad['sourceId'],_0xacc0ad['resourceId'],_0xacc0ad['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x198644,_0x1903a6)=>{this['_aiChatUi']['updateCapabilities'](_0x1903a6);}),this['activeConversation']['on']('modelSelected',async(_0x1ec157,_0x112019)=>{const _0x24e8a0=(await this['_aiChatModels']['getAll']())['find'](_0x40f06f=>_0x40f06f['id']===_0x112019['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x24e8a0,_0x112019['isDisabled']);}),this['activeConversation']['on']('error',(_0xeabf0e,{error:_0xb85066,interactionId:_0x3c52ac,fileName:_0x86c104,url:_0x459b76,sourceId:_0x128b07,sourceLabel:_0x1f519d})=>{const _0x2bd328=_0x3c52ac?_0x3c52ac+':'+ot():ot();_0xb85066['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':Hi(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x2bd328}):_0xb85066['message']['startsWith']('ai-chat-conversation-init-failed')||_0xb85066['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x2bd328}),this['_logError'](_0xb85066)):_0xb85066['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x86c104),'id':_0x2bd328}):_0xb85066['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x459b76),'id':_0x2bd328}):_0xb85066['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x2bd328}):_0xb85066['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x2bd328}):_0xb85066['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x128b07&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x128b07),this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x1f519d||'source'),'id':_0x2bd328}),this['_logError'](_0xb85066)):_0xb85066['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x2bd328}),this['_logError'](_0xb85066)):_0xb85066['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x2bd328}),this['_logError'](_0xb85066)):_0xb85066['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x2bd328}),this['_logError'](_0xb85066)):_0xb85066['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x2bd328}),this['_logError'](_0xb85066)):_0xb85066['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x2bd328}),this['_logError'](_0xb85066)):_0xb85066['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x2bd328}),this['_logError'](_0xb85066)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x2bd328}),this['_logError'](_0xb85066));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x1420ed||await this['activeConversation']['start']();}async['_handleUIUserMessage']({message:_0x4f7fe8,attributes:_0x1aa588}){if(!this['activeConversation'])throw new at('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x4a9949=await this['_aiEditing']['getDocumentData']();_0x4a9949['length']>0x1?await this['activeConversation']['updateCurrentDocumentsInContext'](_0x4a9949):await this['activeConversation']['updateCurrentDocumentInContext'](_0x4a9949[0x0]);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x4f7fe8,'attributes':_0x1aa588});}['_logError'](_0x20a19a){Ct(_0x20a19a['message']);}['_removeFromContext'](_0x216546){this['activeConversation']?.['removeFromContext'](_0x216546);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x2b3c87){const [_0x229d7e,_0x1f6e69]=_0x2b3c87['split'](':'),_0x1fb541=this['activeConversation']['getInteraction'](_0x229d7e),_0x5bf1c5=_0x1fb541['getReply'](_0x1f6e69);return{'interaction':_0x1fb541,'reply':_0x5bf1c5};}['_resolveGroupTarget'](_0x3b0d9b,_0x8dceb){const _0x326dfa=[..._0x8dceb['changes']['filter'](_0x50e635=>'context'!==_0x50e635['type']),..._0x8dceb['changes']['filter'](_0x2296f2=>'context'===_0x2296f2['type'])];for(const _0x33b343 of _0x326dfa){const _0x4b840a=_0x3b0d9b['newNodeAnchorIds']['get'](_0x33b343['id']),_0x3cf418=this['activeConversation']?.['getSourceByDataId'](_0x33b343['id'])||this['activeConversation']?.['getSourceByDataId'](_0x4b840a)||this['activeConversation']?.['getSourceByDataId'](_0x33b343['anchorId']??void 0x0);if(_0x3cf418){if('destroyed'===_0x3cf418['editor']['state'])return null;const _0x3f9147=_0x3cf418['editor']['model']['document']['getRoot'](_0x3cf418['rootName']);return _0x3f9147?{'editor':_0x3cf418['editor'],'root':_0x3f9147,'parsedDocumentContent':Fi(_0x3cf418['content']),'serializedDocumentContent':_0x3cf418['content'],'version':_0x3cf418['version']}:null;}}const _0x2637bf=ds(this['context']),_0x1ea5a3=this['activeConversation']['getInteraction'](_0x3b0d9b['interactionId']),_0xbcc549=_0x1ea5a3?.['getDocumentContext']();return{'editor':_0x2637bf,'root':_0x2637bf['model']['document']['getRoot'](),'parsedDocumentContent':_0x3b0d9b['documentContextContent'],'serializedDocumentContent':_0xbcc549?.['content'],'version':_0xbcc549?.['version']};}['_groupChangesByTarget'](_0x15289b,_0x1f0534){const _0x2ed009=new Map();for(const _0x3878d6 of _0x1f0534){const _0x4db09a=this['_resolveGroupTarget'](_0x15289b,_0x3878d6);if(!_0x4db09a)continue;const _0x16ff2b=(_0x4db09a['editor']['id']||'e')+'|'+_0x4db09a['root']['rootName'];let _0x53fdd0=_0x2ed009['get'](_0x16ff2b);if(!_0x53fdd0){let _0x54bff4;for(const _0x37855f of[..._0x3878d6['changes']['filter'](_0x273030=>'context'!==_0x273030['type']),..._0x3878d6['changes']['filter'](_0x58fdce=>'context'===_0x58fdce['type'])])if(_0x54bff4=this['activeConversation']?.['getDocumentContextSliceByDataId'](_0x37855f['id'])||this['activeConversation']?.['getDocumentContextSliceByDataId'](_0x15289b['newNodeAnchorIds']['get'](_0x37855f['id'])),_0x54bff4)break;_0x53fdd0={'target':{'editor':_0x4db09a['editor'],'root':_0x4db09a['root']},'slice':_0x54bff4,'groups':[],'groupsIndexes':[]},_0x2ed009['set'](_0x16ff2b,_0x53fdd0);}_0x53fdd0['groups']['push'](_0x3878d6),_0x53fdd0['groupsIndexes']['push'](_0x15289b['changeGroups']['indexOf'](_0x3878d6));}return Array['from'](_0x2ed009['values']());}['_scrollToSuggestionRange'](_0x366d2a,_0x195eb0=!0x1,_0x3d738d){const _0xc5267b={'target':_0x3d738d['editing']['view']['domConverter']['viewRangeToDom'](_0x3d738d['editing']['mapper']['toViewRange'](_0x366d2a)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x195eb0};_0x195eb0&&(_0xc5267b['alignToTop']=!0x0),wt(_0xc5267b);}['_updateConversationTitle'](_0x3e2228,_0x42c78f=!0x1){this['_aiChatUi']['setConversationTitle'](_0x3e2228||Hi(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x42c78f);}['_addFeedItemReply'](_0x30f540){'text'===_0x30f540['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x30f540):this['_aiChatUi']['addFeedItemAISuggestion'](_0x30f540);}async['_updateReplyContent']({reply:_0x40fa74,renderingStrategy:_0x7f900e}){const {id:_0x3a768c,interactionId:_0x7ae3d5,isDone:_0x433863,type:_0x30b368,parsedContent:_0x3c013b}=_0x40fa74,_0x4f962f=_0x7ae3d5+':'+_0x3a768c;if('modification'===_0x30b368){const _0x11a59b=_0x40fa74['getContentParts']({'showDiff':this['_aiChatUi']['showDiff'],'editor':ds(this['context'])});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x4f962f,'parts':_0x11a59b,'isDone':_0x433863,'skipLoadingEffects':_0x40fa74['isFromHistory']});}else'text'===_0x30b368&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x4f962f,'parsedContent':_0x3c013b,'renderingStrategy':_0x7f900e,'isDone':_0x433863});_0x433863&&_0x40fa74['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x4f962f,_0x40fa74['sources']);}['_updateReplyContentThrottled']=_0x134eed(this['_updateReplyContent']['bind'](this),0xc8);async['_stopLastInteraction'](){const _0x425582=this['activeConversation']?.['lastInteraction'];_0x425582&&(_0x425582['stop'](),this['_aiChatUi']['stopInteraction'](_0x425582)),this['_updateReplyContentThrottled']['cancel']();}async['_flushLastInteractionUI'](){const _0x679bf=this['activeConversation']?.['lastInteraction'];if(_0x679bf){for await(const _0x5da3e9 of _0x679bf['replies'])this['_aiChatUi']['hasFeedItem'](_0x5da3e9['id'])||this['_addFeedItemReply'](_0x5da3e9),await this['_updateReplyContent']({'reply':_0x5da3e9,'renderingStrategy':'static'});}}['_updateRatings'](_0x4470a3){const _0x27e115={'positiveCount':_0x4470a3['changeGroups']['filter'](_0x560e1f=>'accepted'===_0x560e1f['state'])['length'],'totalCount':_0x4470a3['changeGroups']['length'],'modificationId':_0x4470a3['id']},_0x316934=this['activeConversation']['getInteraction'](_0x4470a3['interactionId'])['messageId'];_0x316934&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x316934,_0x27e115);}['_getAIChatFeedAPI'](_0x140b89){const _0x39aa2e=this['_aiChatUi'],_0x26fc3b=()=>{_0x140b89['resetWebSearchState'](),_0x140b89['resetReasoningState'](),_0x39aa2e['clearLoadingMessage']();},_0x381123=()=>{_0x140b89['currentReply']&&(_0x140b89['currentReply']['done'](),_0x140b89['currentReply']=void 0x0);};return{'insertTextReply':(_0x2f3c25,_0x5aab12)=>{_0x381123(),_0x26fc3b();const _0x54d11f=_0x140b89['currentReply']=_0x140b89['createReply']({'type':'text','interactionId':_0x140b89['id'],'content':_0x2f3c25,'id':_0x5aab12||ot()});return _0x381123(),_0x54d11f;},'insertCustomElement':async(_0x83facd,_0x1e294b)=>(_0x381123(),_0x26fc3b(),_0x39aa2e['addFeedItemCustomElement'](_0x83facd,_0x1e294b||ot())),'setLoadingMessage':_0x4bc8a1=>{_0x39aa2e['setLoadingMessage'](_0x4bc8a1);},'clearLoadingMessage':()=>{_0x39aa2e['clearLoadingMessage']();}};}}const As='ai-selection',gs=['br'];class AIEditing extends _0x3cc0e4{constructor(_0x55129b){super(_0x55129b),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}['_outputDataProcessor'];['_fakeSelections']=[];['_sessionId'];['_lastContentFocusedEditor'];static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['getLastContentFocusedEditor'](){return this['_lastContentFocusedEditor'];}get['sessionId'](){if(!this['_sessionId']){const _0x48fcf1=ls(this['context']),_0x1f14b2=_0x48fcf1['find'](_0x19cd0e=>_0x19cd0e['plugins']['has']('RealTimeCollaborationClient'))||_0x48fcf1[0x0],_0x161954=_0x1f14b2['plugins']['has']('RealTimeCollaborationClient')&&_0x1f14b2['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x161954||ot();}return this['_sessionId'];}async['getDocumentData'](){const _0x1f3138=ls(this['context']);if(!_0x1f3138['length'])throw new at('ai-get-editor-from-context-no-editor');const _0x4e1abd=[],_0x490281=new Set();for(const _0x26de3a of _0x1f3138){const _0x493b20=_0x26de3a['config']['get']('roots')||{};for(const _0x14cb12 of _0x26de3a['model']['document']['getRoots']()){if('$graveyard'===_0x14cb12['rootName'])continue;const _0x5ac6ae=await this['_getDocumentDataForEditorRoot'](_0x26de3a,_0x14cb12,_0x490281),_0x3342be=_0x493b20[_0x14cb12['rootName']];let _0x5540c9;_0x3342be?.['label']?_0x5540c9=_0x3342be['label']:(gt('ai-document-root-missing-label',{'editor':_0x26de3a,'rootConfig':_0x3342be}),_0x5540c9=_0x14cb12['rootName']),_0x4e1abd['push']({'editor':_0x26de3a,'rootName':_0x14cb12['rootName'],'content':_0x5ac6ae['content'],'version':_0x5ac6ae['version'],'sessionId':this['sessionId'],'channelId':_0x26de3a['config']['get']('collaboration.channelId'),'selections':_0x5ac6ae['selections'],'name':_0x5540c9,'description':_0x3342be?.['description']});}}return _0x4e1abd;}async['_getDocumentDataForEditorRoot'](_0x16c1d9,_0x59b5d1,_0x397c24){const _0x9ddb20=_0x16c1d9['data']['toView'](_0x59b5d1,{'convertAiChatSelectionMarker':!0x0}),_0x2ab9e9=new _0x56ae7f(_0x16c1d9['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x9ddb20,_0x2ab9e9,_0x397c24);let _0x27f80b=await this['_getDocumentDataStringFromView'](_0x9ddb20,_0x16c1d9);const _0x5d065d=this['_getMarkersInDocumentOrder'](_0x16c1d9,_0x59b5d1),_0x463140=[];for(const _0x5a419c of _0x5d065d){const _0x18f7a8='<'+_0x5a419c['name']+':start></'+_0x5a419c['name']+':start>',_0xbb48d7=_0x27f80b['indexOf'](_0x18f7a8);_0x27f80b=_0x27f80b['substring'](0x0,_0xbb48d7)+_0x27f80b['substring'](_0xbb48d7+_0x18f7a8['length']);const _0x2f1f69='<'+_0x5a419c['name']+':end></'+_0x5a419c['name']+':end>',_0x5d7e48=_0x27f80b['indexOf'](_0x2f1f69);_0x27f80b=_0x27f80b['substring'](0x0,_0x5d7e48)+_0x27f80b['substring'](_0x5d7e48+_0x2f1f69['length']),_0x463140['push']({'markerName':_0x5a419c['name'],'start':_0xbb48d7,'end':_0x5d7e48,'htmlFragment':_0x27f80b['substring'](_0xbb48d7,_0x5d7e48)});}return{'content':_0x27f80b,'version':_0x16c1d9['model']['document']['version'],'selections':_0x463140};}async['afterInit'](){this['context']instanceof _0x3cd9d5?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x1fc97b,_0xbe91f4)=>{_0xbe91f4['on']('ready',()=>{this['_integrateEditor'](_0xbe91f4);});});}['_setOutputDataProcessor'](_0x5b735a){this['_outputDataProcessor']=_0x5b735a;}async['_getDocumentDataStringFromView'](_0x28c800,_0x1ecca9){let _0xb517ae;if(this['_outputDataProcessor']){const _0x25e467=_0x1ecca9['data']['processor']['domConverter']['viewToDom'](_0x28c800),_0x49caf2=await this['_outputDataProcessor'](_0x25e467);_0xb517ae=_0x1ecca9['data']['processor']['htmlWriter']['getHtml'](_0x49caf2);}else _0xb517ae=_0x1ecca9['data']['processor']['toData'](_0x28c800);return _0xb517ae;}['_integrateEditor'](_0x195283){if(!_0x195283['config']['get']('collaboration.channelId'))throw new at('ai-missing-channel-id',_0x195283);_0x195283['ui']['focusTracker']['on']('change:isFocused',(_0x47d6b7,_0x3fe36b,_0x539164)=>{_0x539164&&(this['_lastContentFocusedEditor']=_0x195283);}),_0x195283['on']('destroy',()=>{this['_lastContentFocusedEditor']===_0x195283&&(this['_lastContentFocusedEditor']=void 0x0);}),_0x195283['conversion']['for']('editingDowncast')['markerToHighlight']({'model':As,'view':({markerName:_0x4bdcd5})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x4bdcd5['split'](':')[0x1]],'priority':0xc})}),_0x195283['conversion']['for']('dataDowncast')['markerToElement']({'model':As+':context','view':(_0x5d2eda,{writer:_0x3d9b11,options:_0x172280})=>_0x172280['convertAiChatSelectionMarker']?_0x3d9b11['createUIElement'](_0x5d2eda['markerName']+':'+(_0x5d2eda['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x458c54){const _0x5c3610=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x458c54);const _0x44ac6f=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x5c3610,_0x44ac6f);}['hideFakeVisualSelection'](_0x174bf4){const _0x570dc3=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x174bf4);const _0x3a9d96=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x570dc3,_0x3a9d96);}async['modelToDataWithIds'](_0xddfe05){const _0x4f92df=ds(this['context']),_0x4203e5=_0x4f92df['data']['toView'](_0xddfe05),_0x5f5673=new _0x56ae7f(_0x4f92df['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x4203e5,_0x5f5673),this['_getDocumentDataStringFromView'](_0x4203e5,_0x4f92df);}['_setDataIdsOnChildren'](_0x312e7e,_0x244f24,_0x31aaa2=new Set()){let _0x2f8e45=!0x1;for(const _0x363e7e of _0x312e7e['getChildren']()){if(!_0x363e7e['is']('view:element')||gs['includes'](_0x363e7e['name']))continue;const _0x10136f=_0x363e7e['is']('view:containerElement'),_0x46fdb7=_0x363e7e['is']('view:emptyElement'),_0xb910d7=this['_setDataIdsOnChildren'](_0x363e7e,_0x244f24,_0x31aaa2);if(_0x363e7e['hasAttribute']('data-id')){_0x2f8e45=!0x0,_0x31aaa2['add'](_0x363e7e['getAttribute']('data-id'));continue;}(_0x10136f||_0x46fdb7||_0xb910d7)&&(_0x244f24['setAttribute']('data-id',this['_nextDataId'](_0x31aaa2),_0x363e7e),_0x2f8e45=!0x0);}return _0x2f8e45;}['_nextDataId'](_0x1564e0){let _0x333331;do{_0x333331='';for(let _0x3de002=0x0;_0x3de002<0x4;_0x3de002++)_0x333331+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x1564e0['has'](_0x333331));return _0x1564e0['add'](_0x333331),_0x333331;}['getSelectionText'](){const {model:_0x3f9f2f}=ds(this['context']),_0xdcd40c=_0x3f9f2f['document']['selection'],_0x4f2deb=[],_0x3235e1=Array['from'](_0xdcd40c['getRanges']());_0x3235e1['sort']((_0x1f203d,_0x37bc81)=>_0x1f203d['start']['isBefore'](_0x37bc81['start'])?-0x1:0x1);for(const _0x5a776f of _0x3235e1)for(const _0x2f7942 of _0x5a776f['getItems']())_0x2f7942['is']('$textProxy')?_0x4f2deb['push'](_0x2f7942['data']):_0x2f7942['is']('element')&&_0x4f2deb['length']>0x0&&'\x20'!==_0x4f2deb[_0x4f2deb['length']-0x1]&&_0x4f2deb['push']('\x20');return _0x4f2deb['length']?'\x22'+_0x4f2deb['join']('')['trim']()+'\x22':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0x47b0b2){for(let _0x3d898a=0x0;_0x3d898a<this['_fakeSelections']['length'];_0x3d898a++)if(this['_fakeSelections'][_0x3d898a]['id']==_0x47b0b2)return void this['_fakeSelections']['splice'](_0x3d898a,0x1);}['_addFakeSelection'](_0x2a98ce){this['_removeFakeSelectionById'](_0x2a98ce['id']),Tt(this['_fakeSelections'],_0x2a98ce);}['_refreshFakeSelection'](_0x1e78fb,_0x5e24ef){if(_0x1e78fb==_0x5e24ef)return;const _0x1af5f4=_0x1e78fb?this['_getEditorForFakeSelection'](_0x1e78fb):null,_0x62d0bb=_0x5e24ef?this['_getEditorForFakeSelection'](_0x5e24ef):null,_0x18184f=(_0x3f1af9,_0x4e7098)=>{const _0x4bd525=_0x4e7098['model']['markers']['getMarkersGroup'](As);for(const _0x4de8a0 of _0x4bd525)_0x3f1af9['removeMarker'](_0x4de8a0);},_0x85e996=(_0x412bf7,_0x20fc84,_0x1a0749)=>{const _0x6900a2=_0x20fc84['model'];for(let _0x5a04ea=0x0;_0x5a04ea<_0x1a0749['ranges']['length'];_0x5a04ea++){let _0x1891ab=_0x1a0749['ranges'][_0x5a04ea];const _0x42dd93=As+':'+_0x1a0749['id']+':'+_0x5a04ea;if(_0x1891ab['start']['isAtEnd']){const _0x3b41b=_0x1891ab['start']['getLastMatchingPosition'](({item:_0x1605db})=>!_0x6900a2['schema']['isContent'](_0x1605db),{'boundaries':_0x1891ab});_0x1891ab=_0x412bf7['createRange'](_0x3b41b,_0x1891ab['end']);}_0x412bf7['addMarker'](_0x42dd93,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1891ab});}};_0x1af5f4&&_0x62d0bb&&_0x1af5f4===_0x62d0bb&&_0x5e24ef?_0x1af5f4['model']['change'](_0x4622c6=>{_0x18184f(_0x4622c6,_0x1af5f4),_0x85e996(_0x4622c6,_0x62d0bb,_0x5e24ef);}):(_0x1af5f4&&_0x1af5f4['model']['change'](_0x46f47e=>_0x18184f(_0x46f47e,_0x1af5f4)),_0x62d0bb&&_0x5e24ef&&_0x62d0bb['model']['change'](_0x529f47=>_0x85e996(_0x529f47,_0x62d0bb,_0x5e24ef)));}['_getEditorForFakeSelection'](_0xb40bcf){if(!_0xb40bcf['ranges']['length'])return ds(this['context']);const _0x450829=_0xb40bcf['ranges'][0x0]['root']['document'];return ls(this['context'])['find'](_0x3b1505=>_0x3b1505['model']['document']===_0x450829)??ds(this['context']);}['_getMarkersInDocumentOrder'](_0x4a9a2c,_0x3332cf){const _0x3c501e=Array['from'](_0x4a9a2c['model']['markers']['getMarkersGroup'](As+':context'));return(_0x3332cf?_0x3c501e['filter'](_0xfc9404=>{const _0x1e6fb5=_0xfc9404['getRange']();return _0x1e6fb5&&_0x1e6fb5['root']['rootName']===_0x3332cf['rootName'];}):_0x3c501e)['sort']((_0x14c430,_0x272d99)=>_0x14c430['getStart']()['isBefore'](_0x272d99['getStart']())?-0x1:_0x14c430['getStart']()['isAfter'](_0x272d99['getStart']())?0x1:0x0);}}const Cs=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],ms=[...Cs,'startConversation','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];function ps(_0x353c8f){const _0x28047d=new AbortController();return{'promise':new Promise((_0x5ec9c0,_0x676586)=>{const _0x2b12c7=setTimeout(_0x5ec9c0,_0x353c8f);_0x28047d['signal']['addEventListener']('abort',()=>{clearTimeout(_0x2b12c7),_0x676586();});}),'abortController':_0x28047d};}class HTMLStreamer{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x1e1c30){this['options']={'delay':_0x1e1c30?.['delay']??0xa,'textNodeStyle':_0x1e1c30?.['textNodeStyle']??'animation:\x20ck-html-streamer-fade-in\x20.3s'};}async['stream']({document:_0x462e39,targetElement:_0x479b51,abortSignal:_0x23104c}){this['isStreaming']&&this['stop'](),_0x23104c?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x252747(_0x462e39,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x2be9ba=0x0;_0x2be9ba<this['currentIndex'];_0x2be9ba++)this['nodesList'][_0x2be9ba]['shouldBeStreamed']=!0x0;do{const _0x48167b=Date['now'](),_0x1beaf5=this['nodesList'][this['currentIndex']],_0x482348=_0x48167b-this['lastUpdateTime'];if(_0x1beaf5){_0x1beaf5['shouldBeStreamed']=!0x0;let _0x544654=_0x1beaf5['parent'];for(;_0x544654;)_0x544654['shouldBeStreamed']=!0x0,_0x544654=_0x544654['parent'];}if(_0x482348<this['options']['delay'])try{const {promise:_0x29e53e,abortController:_0x213010}=ps(this['options']['delay']-_0x482348);this['timeoutAbortController']=_0x213010,await _0x29e53e;}catch(_0x1213db){return;}_0x53d52c(_0x479b51,'<'+_0x479b51['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x479b51['tagName']+'>',{'childrenOnly':!0x0}),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:_0x2889a2}){Array['from'](_0x2889a2['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x45e455=>{_0x45e455['replaceWith'](_0x45e455['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x4ccc58){let _0x10259c='';if(function(_0x453c6d){return _0x19438c(_0x453c6d);}(_0x4ccc58)){for(const _0x10b0e0 of _0x4ccc58['children'])_0x10259c+=this['renderNode'](_0x10b0e0);}else{if(Ts(_0x4ccc58)){if(!_0x4ccc58['shouldBeStreamed'])return'';const _0x312f3a=_0x4ccc58,_0x43f157=Object['entries'](_0x312f3a['attribs'])['map'](([_0x2ccba1,_0x49d6ba])=>_0x2ccba1+'=\x22'+_0x49d6ba+'\x22')['join']('\x20');_0x10259c+='<'+_0x312f3a['tagName']+(_0x43f157?'\x20'+_0x43f157:'')+'>';for(const _0x2336e0 of _0x31b03f(_0x312f3a))_0x10259c+=this['renderNode'](_0x2336e0);_0x10259c+='</'+_0x312f3a['tagName']+'>';}else{if(!ws(_0x4ccc58))return'';if(!_0x4ccc58['shouldBeStreamed'])return'';!function(_0x285797){if(!_0x285797['parent']||!Ts(_0x285797['parent']))return!0x1;if(!Es['includes'](_0x285797['parent']['tagName']))return!0x1;return!_0x5408c8(_0x285797)['match'](/^\s*[<>]\s*$/);}(_0x4ccc58)?_0x10259c+=ti(_0x4ccc58):_0x10259c+=ti(new _0x1f4caa('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x4ccc58]));}}return _0x10259c;}['getParsedDocumentNodeList'](){const _0x87335=[];return function(_0x53e824,_0x5ae8c3){const _0x518f6e=_0x533e90=>{if(_0x5ae8c3(_0x533e90),_0x533e90 instanceof _0x43458d)for(let _0x3b52d0=0x0;_0x3b52d0<_0x533e90['children']['length'];_0x3b52d0++){const _0x58d84c=_0x533e90['children'][_0x3b52d0];_0x518f6e(_0x58d84c);}};for(let _0x333337=0x0;_0x333337<_0x53e824['children']['length'];_0x333337++)_0x518f6e(_0x53e824['children'][_0x333337]);}(this['document'],_0x428b1b=>{if(ws(_0x428b1b)){const _0x131cd2=this['splitTextNodeIntoWordNodes'](_0x428b1b);_0x131cd2['length']&&_0x87335['push'](..._0x131cd2);}_0x428b1b['isWordSplitSource']||_0x428b1b['isWordSplitResult']||_0x87335['push'](_0x428b1b);}),_0x87335;}['splitTextNodeIntoWordNodes'](_0x4c5279){if(_0x4c5279['isWordSplitSource']||_0x4c5279['isWordSplitResult'])return[];const _0x12aeb5=_0x5408c8(_0x4c5279)['match'](/(?:\s*\S+\s*)/g),_0xd49e53=[];if(_0x12aeb5&&_0x12aeb5['length']>0x1){for(const _0x3f64b9 of _0x12aeb5){const _0x4b630f=new _0x54c8f4(_0x3f64b9);_0x4b630f['isWordSplitResult']=!0x0,_0x238c6d(_0x4c5279,_0x4b630f),_0xd49e53['push'](_0x4b630f);}_0x4c5279['isWordSplitSource']=!0x0,_0x8926a6(_0x4c5279);}return _0xd49e53;}}const Es=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function ws(_0x247ef9){return _0x4de3bc(_0x247ef9);}function Ts(_0x510203){return _0x5778d8(_0x510203);}class AIChatFeedItemView extends Nt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x34075f){super();const _0x524947=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new HTMLStreamer(),this['options']=_0x34075f,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x524947['if']('isDone','ck-ai-chat__feed__item_done'),_0x524947['if']('isVisible','ck-hidden',_0x2692a8=>!_0x2692a8),'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'](_0x1c87b5=>{_0x1c87b5['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x21ecfc,_0x306bc0,_0x19a823){await this['htmlStreamer']['stream']({'document':_0x21ecfc,'targetElement':_0x306bc0,'abortSignal':_0x19a823});}}class AISuggestionHeaderView extends Nt{['showChangesToggleView'];constructor(_0x481e46,_0xdc8cd8){super(_0x481e46),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new ShowChangesToggleView(_0x481e46),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+Bi,'label':Hi(_0x481e46,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0xdc8cd8['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x2ffff6=>_0x2ffff6?_0x5a2923:_0x1aad04),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x422170=new xt();_0x422170['content']=_0x3745a0,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0xdc8cd8['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x422170,{'tag':'span','children':[Hi(_0x481e46,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class ShowChangesToggleView extends vt{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const fs={'accepted':_0x3a31e4,'rejected':_0x5d4966,'outdated':_0x5d4966};class AISuggestionContentPartStateView extends Nt{['stateIconView'];constructor(_0x14b498){super(_0x14b498);const _0x245e44=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new StateIconView(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x245e44['to']('state',_0x11dde8=>'ck-ai-suggestion__content-part-state_'+_0x11dde8),_0x245e44['if']('isVisible','ck-hidden',_0x1ebdf1=>!_0x1ebdf1)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x245e44['to']('state',_0x25d441=>{switch(_0x25d441){case'accepted':return Hi(_0x14b498,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return Hi(_0x14b498,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return Hi(_0x14b498,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x220fe5){this['state']=_0x220fe5;}}class StateIconView extends xt{constructor(){super(),this['set']('state','accepted'),this['content']=fs[this['state']],this['on']('change:state',()=>{this['content']=fs[this['state']];});}}class AISuggestionContentPartToolbarView extends kt{['_applyButton'];['_suggestButton'];constructor(_0x3ac9c6,_0x213c04,_0x5645ff){super(_0x3ac9c6);const _0x1889d3=Boolean(_0x5645ff);this['set']('isEnabled',!_0x1889d3),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x158240=[];if(_0x1889d3){const _0x356a22=new vt(_0x3ac9c6);_0x356a22['set']({'label':Hi(_0x3ac9c6,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x467df0}),_0x356a22['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}}),_0x158240['push'](_0x356a22);}else{_0x213c04['includes']('applySuggestion')&&(this['_applyButton']=new vt(_0x3ac9c6),this['_applyButton']['set']({'label':Hi(_0x3ac9c6,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x3a31e4}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x158240['push'](this['_applyButton'])),_0x213c04['includes']('insertSuggestion')&&(this['_suggestButton']=new vt(_0x3ac9c6),this['_suggestButton']['set']({'label':Hi(_0x3ac9c6,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x561f7b}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x158240['push'](this['_suggestButton']));const _0x28a344=new vt(_0x3ac9c6);_0x28a344['set']({'label':Hi(_0x3ac9c6,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x5d4966}),_0x28a344['bind']('isEnabled')['to'](this),_0x28a344['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x158240['push'](_0x28a344);}this['items']['addMany'](_0x158240);const _0x3310bf=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x3310bf['if']('isVisible','ck-hidden',_0x1cde75=>!_0x1cde75)]}});}['setButtonsVisibility']({showApplyButton:_0xfea36b,showSuggestButton:_0x1f012d}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0xfea36b),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x1f012d);}}class AISuggestionContentPartHeaderView extends Nt{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x5353ce,{part:_0x84891,uiIndex:_0x5e6bde,availableActions:_0x38e47a,areActionsDisabled:_0x1372c9}){super(_0x5353ce),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new AISuggestionContentPartToolbarView(_0x5353ce,_0x38e47a,_0x1372c9),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x84891['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x84891['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x84891['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new AISuggestionContentPartStateView(_0x5353ce),this['titleLabelView']=new AISuggestionBodyContentPartTitleLabelView(_0x5353ce,_0x5e6bde),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',(_0x514c7c,_0x51a644,_0x5962fc,_0x5ae3db)=>{'pending'===_0x5ae3db?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x5962fc?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x5962fc),this['children']['add'](this['stateView']));});}}class AISuggestionBodyContentPartTitleLabelView extends Nt{constructor(_0x53d9d9,_0x4df74e){super(_0x53d9d9),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[Hi(_0x53d9d9,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x4df74e['toString']())]});}}class AISuggestionStreamableContentView extends Nt{['htmlStreamer'];constructor(_0x5f2233){super(_0x5f2233),this['htmlStreamer']=new HTMLStreamer(),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async['update']({part:_0x5026a5,renderingStrategy:_0x53460d,abortSignal:_0x5a2372}){'streaming'===_0x53460d?await this['htmlStreamer']['stream']({'document':_0x5026a5['content'],'targetElement':this['element'],'abortSignal':_0x5a2372}):_0x53d52c(this['element'],'<'+this['element']['tagName']+'>'+Ki(_0x5026a5['content'])+'</'+this['element']['tagName']+'>',{'childrenOnly':!0x0});}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class AISuggestionBodyViewContentPartView extends Nt{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x5467f1,{part:_0x3efc2b,uiIndex:_0x204a43,areActionsDisabled:_0xe9b558,availableActions:_0x3645dd}){super(_0x5467f1);const _0x5cba0b=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x188c3b=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0xe9b558;};this['on']('change:state',_0x188c3b),this['on']('change:isDone',_0x188c3b),_0x188c3b(),this['_children']=this['createCollection'](),this['_headerView']=new AISuggestionContentPartHeaderView(_0x5467f1,{'part':_0x3efc2b,'uiIndex':_0x204a43,'availableActions':_0x3645dd,'areActionsDisabled':_0xe9b558}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...Cs)['to'](this),this['_streamableContentView']=new AISuggestionStreamableContentView(_0x5467f1),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x5cba0b['to']('state',_0x5d37ca=>'ck-ai-suggestion__body__content-part_'+_0x5d37ca),_0x5cba0b['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x5cba0b['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x5cba0b['if']('isVisible','ck-hidden',_0x4ea960=>!_0x4ea960)]},'children':this['_children'],'on':{'mouseenter':_0x5cba0b['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x3efc2b['index']});}),'mouseleave':_0x5cba0b['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x3efc2b['index']});}),'click':_0x5cba0b['to'](_0xb72089=>{const _0x3d7689=_0xb72089['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x3d7689)&&this['fire']('showChangeInText',{'index':_0x3efc2b['index']});})}});}async['updateContent']({part:_0x4161b1,showUnchangedParts:_0x77745a=!0x1,abortSignal:_0x8023c0}){this['partDefinition']=_0x4161b1,this['isVisible']=this['partDefinition']['hasChanges']||_0x77745a,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x4161b1,'renderingStrategy':'static','abortSignal':_0x8023c0});}['markAsDone'](){this['isDone']=!0x0;}}class AISkeletonView extends Nt{constructor(_0x2bfc64,_0x3f9f72){super(_0x2bfc64),this['set']('isVisible',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton',this['bindTemplate']['if']('isVisible','ck-hidden',_0x39fa11=>!_0x39fa11)]},'children':this['_createSkeletonItems'](_0x3f9f72)});}['_createSkeletonItems'](_0x3f9a2a){const _0x452b4b=['ck','ck-ai-skeleton__item'];return _0x3f9a2a['map'](_0xd67044=>{let _0x33b644='';switch(_0xd67044['attributes']['align']){case'right':_0x33b644='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x33b644='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x33b644='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0xd67044['tag'],'attributes':{'class':[..._0x452b4b,_0xd67044['attributes']['class']?_0xd67044['attributes']['class']:''],'style':'width:\x20'+_0xd67044['attributes']['width']+';\x20height:\x20'+_0xd67044['attributes']['height']+';'+_0x33b644}};});}}const Ss={'aiSuggestionBody':[{'tag':'div','attributes':{'width':'50%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'85%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'75%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}}],'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':Rs(0x5,'100%','44px','right'),'aiChatResources':Rs(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 Rs(_0x52ed24,_0x11212c,_0x2728cc,_0x151f8c){return new Array(_0x52ed24)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x11212c,'height':_0x2728cc,'align':_0x151f8c}}));}class PromiseQueue extends Et(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x3e3cb6){const _0x4d69dd=this['createTask'](_0x3e3cb6);return this['queue']['push'](_0x4d69dd),this['_processQueue'](),_0x4d69dd['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(_0x8c0d5c=>{this['once']('_queueEmpty',()=>{_0x8c0d5c();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x2df15b=this['queue']['shift']();try{await _0x2df15b['callback'](this['_abortController']['signal']),_0x2df15b['resolve']();}catch(_0x4c8823){_0x2df15b['reject'](_0x4c8823);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x539c2c){let _0x2c4d35,_0x327900;const _0x6d5e5b=new Promise((_0x7bbe7a,_0x1abda2)=>{_0x2c4d35=_0x7bbe7a,_0x327900=_0x1abda2;});return{'callback':_0x539c2c,'resolve':_0x2c4d35,'reject':_0x327900,'completePromise':_0x6d5e5b};}}class AIChatFeedErrorItemView extends AIChatFeedItemView{constructor(_0x24cddb){super(_0x24cddb),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x24cddb['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x3e15d3){this['element']['innerHTML']=_0x3e15d3;}}const bs=['applySuggestion','insertSuggestion'];class AIChatFeedSuggestionItemActionsView extends Nt{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x1bb3df,_0xc0d294=[...bs],_0x447eff){super(_0x1bb3df);const _0x11e8b2=this['bindTemplate'],_0x2135b2=Boolean(_0x447eff);if(this['set']('isEnabled',!_0x2135b2),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x2135b2){const _0xdb8e13=new vt(_0x1bb3df);_0xdb8e13['set']({'label':Hi(_0x1bb3df,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x467df0}),_0xdb8e13['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}});const _0x46ae5a=new Nt(_0x1bb3df);_0x46ae5a['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[Hi(_0x1bb3df,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0xdb8e13]}]}),this['children']['add'](_0x46ae5a);}else this['_applyChangesButton']=new vt(_0x1bb3df),this['_applyChangesButton']['set']({'label':Hi(_0x1bb3df,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0xc0d294['includes']('applySuggestion'),'class':Mi}),this['_insertSuggestionsButton']=new vt(_0x1bb3df),this['_insertSuggestionsButton']['set']({'label':Hi(_0x1bb3df,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0xc0d294['includes']('insertSuggestion'),'class':Ui}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x435f7b=>{_0x435f7b['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',_0x11e8b2['if']('isVisible','ck-hidden',_0x4b84c5=>!_0x4b84c5)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x56b646){this['isVisible']=_0x56b646;}['_switchButtonLabelsPlurality'](_0x26eda3){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x26eda3?(this['_applyChangesButton']['label']=Hi(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=Hi(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=Hi(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=Hi(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class AIWebSourcesView extends Nt{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x37d4c1,_0x5f79e0){super(_0x37d4c1),this['bodyCollection']=_0x5f79e0,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',_0x2aafb0=>!_0x2aafb0)]},'children':this['children']});const _0x92c653=new Nt(this['locale']),_0x258d33=new xt();_0x258d33['content']=_0x43e506,_0x92c653['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x258d33,{'tag':'span','children':[{'text':Hi(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x92c653),this['_setupBalloonPanel'](_0x37d4c1);}['addSource'](_0x23ceea){this['children']['add'](new AIWebSourceView(this['locale'],_0x23ceea,this['balloonPanelView']));}['_setupBalloonPanel'](_0x5ec840){this['balloonPanelView']=new Xt(_0x5ec840),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class AIWebSourceView extends vt{['balloonPanelView'];['source'];constructor(_0x2959e1,_0x7e54e0,_0x52d0d8){super(_0x2959e1),this['source']=_0x7e54e0,this['balloonPanelView']=_0x52d0d8,this['set']({'label':_0x7e54e0['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x322a2d=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x322a2d['to'](()=>{window['open'](_0x7e54e0['url'],'_blank');}),'mouseenter':_0x322a2d['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x322a2d['to'](()=>{this['_hideTooltip']();})}}),_0x7e54e0['favicon']){const _0x365b98=new Nt(_0x2959e1);_0x365b98['setTemplate']({'tag':'img','attributes':{'src':_0x7e54e0['favicon']||_0x43e506,'alt':_0x7e54e0['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x365b98);}else this['set']('icon',_0x43e506);}['_createTooltipContentView'](_0x2033fc,_0x26a250){const _0x1e5983=new Nt(_0x2033fc),_0x3077f4=[];let _0x193dff;_0x26a250?.['favicon']?(_0x193dff=new Nt(_0x2033fc),_0x193dff['setTemplate']({'tag':'img','attributes':{'src':_0x26a250['favicon'],'alt':_0x26a250['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x193dff=new xt(),_0x193dff['content']=_0x43e506,_0x193dff['extendTemplate']({'attributes':{'alt':_0x26a250['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x3077f4['push'](_0x193dff);const _0xa6cd51=new Nt(_0x2033fc);_0xa6cd51['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x26a250['url']},'children':[{'text':new URL(_0x26a250['url'])?.['hostname']}]}),_0x3077f4['push'](_0xa6cd51);const _0x546d42=new Nt(_0x2033fc);_0x546d42['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x3077f4});const _0x1352cc=new Nt(_0x2033fc);return _0x1352cc['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x26a250['title']['length']>0x190?_0x26a250['title']['substring'](0x0,0x190)+'...':_0x26a250['title']}]}),_0x1e5983['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x546d42,_0x1352cc]}),_0x1e5983;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[Xt['defaultPositions']['northArrowSouth'],Xt['defaultPositions']['northArrowSouthWest'],Xt['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 _0x58a053=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x58a053);}}class AISuggestionBodyView extends Nt{['_actionsView'];['_sourcesView'];['_children'];['_skeletonView'];['_showSkeletonDebounced']=_0xc92ffd(()=>{this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now']();},0x3e8);['_skeletonShownAt']=null;['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x5863b3,_0x5bf97e){super(_0x5863b3);const {areActionsDisabled:_0x54b5b1,showUnchangedParts:_0x5b8b49,availableActions:_0x1f26ae}=_0x5bf97e;this['_areActionsDisabled']=_0x54b5b1,this['_showUnchangedParts']=_0x5b8b49,this['_availableActions']=_0x1f26ae,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_skeletonView']=new AISkeletonView(_0x5863b3,Ss['aiSuggestionBody']),this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now'](),this['_children']['add'](this['_skeletonView']),this['_updateContentPartsPromiseQueue']=new PromiseQueue(),this['_emptyPartsWarningView']=new AIChatFeedErrorItemView({'id':'empty-parts-warning','initialContent':Hi(_0x5863b3,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new AIChatFeedSuggestionItemActionsView(_0x5863b3,_0x5bf97e['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new AIWebSourcesView(this['locale'],_0x5bf97e['bodyCollection']),_0x5bf97e['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...Cs)['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']]});}['destroy'](){this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),super['destroy']();}get['partsCount'](){return this['_contentPartViews']['length'];}get['_contentPartViews'](){return Array['from'](this['_children'])['filter'](_0x1b8ea2=>_0x1b8ea2 instanceof AISuggestionBodyViewContentPartView);}async['updateContentParts']({parts:_0xf0402f,abortSignal:_0x14b494,skipLoadingEffects:_0x4e2e36}){this['_cachedContentParts']['length']?_0xf0402f['forEach'](_0x44b74e=>{const _0x900cd=this['_cachedContentParts']['findIndex'](_0x4c7c47=>_0x4c7c47['index']==_0x44b74e['index']);-0x1===_0x900cd?this['_cachedContentParts']['push'](_0x44b74e):this['_cachedContentParts'][_0x900cd]=_0x44b74e;}):this['_cachedContentParts']=_0xf0402f;const _0x3baf09=this['_showUnchangedParts']?_0xf0402f:_0xf0402f['filter'](_0x23192d=>_0x23192d['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x3baf09['length']>0x1),_0x4e2e36&&(this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1);for(const _0x4a68bd of _0x3baf09)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x1f22e6=>{let _0x527b8f=this['getPartView'](_0x4a68bd['index']);if(!_0x527b8f){if(_0x527b8f=new AISuggestionBodyViewContentPartView(this['locale'],{'part':_0x4a68bd,'uiIndex':this['_contentPartViews']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x527b8f['delegate'](...Cs)['to'](this),!_0x4e2e36&&(this['_showSkeletonDebounced']['cancel'](),await this['_awaitMinimumSkeletonDisplayTime'](_0x1f22e6),_0x1f22e6['aborted']))return;this['_skeletonView']['isVisible']=!0x1,this['_children']['add'](_0x527b8f,this['_children']['length']-0x1),this['hasPendingParts']=!0x0,_0x4e2e36||this['_showSkeletonDebounced']();}await _0x527b8f['updateContent']({'part':_0x4a68bd,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x1f22e6}),_0x527b8f['markAsDone']();});return _0x14b494?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1;}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x2e200d,_0x44a674){const _0x19e426=this['getPartView'](_0x2e200d);_0x19e426&&(_0x19e426['state']=_0x44a674),this['hasPendingParts']='pending'==_0x44a674||this['_contentPartViews']['some'](_0x613864=>'pending'==_0x613864['state']);}['setPartActive'](_0x2b4adf,_0x1f0d9e){if(!0x1===_0x2b4adf){for(const _0x4b3cb0 of this['_contentPartViews'])_0x4b3cb0['isActive']=!0x1;}else{const _0x5c931d=this['getPartView'](_0x2b4adf);_0x5c931d&&(_0x5c931d['isActive']=_0x1f0d9e);}}['updateSources'](_0xdc888c){_0xdc888c['forEach'](_0x175d30=>this['_sourcesView']['addSource'](_0x175d30)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x3f1115){return this['_contentPartViews']['find'](_0x2e444e=>_0x2e444e['partDefinition']['index']==_0x3f1115)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x4a009b=!this['_cachedContentParts']['find'](({hasChanges:_0x2c48ce})=>_0x2c48ce),_0x21060c=!!this['_cachedContentParts']['find'](({hasChanges:_0x526e9d})=>!_0x526e9d);this['_emptyPartsWarningView']['isVisible']=0x0==this['_contentPartViews']['length']||_0x21060c,_0x4a009b?this['_emptyPartsWarningView']['setContent'](Hi(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](Hi(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_contentPartViews']['forEach'](_0x72d49=>_0x72d49['markAsDone']()),this['_skeletonView']['isVisible']=!0x1,this['_showSkeletonDebounced']['cancel'](),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}async['_awaitMinimumSkeletonDisplayTime'](_0x29f9e0){if(!this['_skeletonView']['isVisible']||null===this['_skeletonShownAt'])return;const _0x36779a=0x3e8-(Date['now']()-this['_skeletonShownAt']);if(this['_skeletonShownAt']=null,_0x36779a>0x0){const {promise:_0x420e0b,abortController:_0x2016a1}=ps(_0x36779a);_0x29f9e0?.['addEventListener']('abort',()=>_0x2016a1['abort']()),await _0x420e0b['catch'](()=>{});}}get['hasNonEmptyParts'](){return this['_contentPartViews']['filter'](_0x21822e=>_0x21822e['partDefinition']['hasChanges'])['length']>0x0;}}class AISuggestionContainerView extends Nt{['bodyView'];['children'];['headerView'];constructor(_0x18cfc0,_0x3cc187,_0x238185){super(_0x18cfc0);const {showDiff:_0x4a9409,areActionsDisabled:_0x473db4,showUnchangedParts:_0x38a519,availableActions:_0x4d7139}=_0x3cc187;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new AISuggestionHeaderView(_0x18cfc0,{'showDiff':_0x4a9409}),this['headerView']['on']('toggleShowChanges',(_0x6e3592,_0x2a0d4e)=>{this['areChangesVisible']=_0x2a0d4e['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x2a0d4e['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new AISuggestionBodyView(_0x18cfc0,{'areActionsDisabled':_0x473db4,'showUnchangedParts':!!_0x38a519,'availableActions':_0x4d7139,'bodyCollection':_0x238185}),this['bodyView']['delegate'](...Cs)['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'](_0x2109fc){await this['bodyView']['updateContentParts'](_0x2109fc);}['updateSources'](_0x17b7b0){this['bodyView']['updateSources'](_0x17b7b0);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class AIChatFeedSuggestionItemView extends AIChatFeedItemView{['containerView'];constructor(_0x5bb318,_0x43aba0,_0x274f66){super(_0x43aba0),this['set']('isTrackChangesOn',!0x1),this['containerView']=new AISuggestionContainerView(_0x5bb318,{'showDiff':_0x43aba0['showDiff'],'areActionsDisabled':_0x43aba0['areActionsDisabled'],'availableActions':_0x43aba0['availableActions']},_0x274f66),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x5e6f52,_0x22f832)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x22f832['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',(_0x41da90,{index:_0x13a450})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x13a450});}),this['containerView']['on']('applySuggestion',(_0x4ca53a,{index:_0xa8787a}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0xa8787a});}),this['containerView']['on']('insertSuggestion',(_0x499c30,{index:_0x262fa3}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x262fa3});}),this['containerView']['on']('rejectSuggestion',(_0x39ea2f,{index:_0x989b8c})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x989b8c});}),this['containerView']['on']('mouseOverSuggestion',(_0x28a84d,{index:_0x287579})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x287579});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x5b3125,{index:_0x1fc282})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x1fc282});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0xa4de2d){await this['containerView']['updateContent'](_0xa4de2d);}['updatePartState'](_0x131a6b,_0x101b8b){this['containerView']['bodyView']['updatePartState'](_0x131a6b,_0x101b8b);}['setPartActive'](_0x4ce109,_0x30d514){!0x1===_0x4ce109?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x4ce109,_0x30d514);}['updateSources'](_0x51b3cf){this['containerView']['updateSources'](_0x51b3cf);}['getPartView'](_0x10b771){return this['containerView']['bodyView']['getPartView'](_0x10b771);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class AIChatFeedReplyItemView extends AIChatFeedItemView{['replyContainer'];['_bodyCollection'];constructor(_0x5f3fae,_0x2a3140,_0x35814f){super(_0x2a3140),this['_bodyCollection']=_0x35814f,this['locale']=_0x5f3fae,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new Nt(),this['replyContainer']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-chat__feed__ai-reply-container']}}),this['children']['add'](this['replyContainer']);}async['render'](){super['render'](),this['options']['initialContent']&&(await this['updateContent']({'parsedContent':Fi(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x143a0b,renderingStrategy:_0x5eb6dc,abortSignal:_0x24ccbe}){'streaming'===_0x5eb6dc?await this['streamIntoElement'](_0x143a0b,this['replyContainer']['element'],_0x24ccbe):this['replyContainer']['element']['innerHTML']=ti(_0x143a0b);}['updateSources'](_0x5c3f94){const _0x14dc7f=new AIWebSourcesView(this['locale'],this['_bodyCollection']);_0x14dc7f['children']['addMany'](_0x5c3f94['map'](_0x57b6e1=>new AIWebSourceView(this['locale'],_0x57b6e1,_0x14dc7f['balloonPanelView']))),_0x14dc7f['isVisible']=!0x0,this['children']['add'](_0x14dc7f);}}class AISpinnerView extends yt{constructor(_0x3db68b=void 0x0){super();const _0x4ba7e2=_0x3db68b?'ck-ai-spinner_'+_0x3db68b:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x4ba7e2]}});}}const Os={'file':_0xc6d689,'document':_0x3745a0,'web-resource':_0x4ad8e3,'text':_0xc6d689,'selection':_0x283729,'mcp-tool-context':_0x3745a0},ks='ck-ai-chat-context-chip',vs='ck-ai-chat-context-chip_wide',Ns='ck-ai-chat-context-chip_document',ys='ck-ai-chat-context-chip__label',xs='ck-ai-chat-context-chip__type-icon',Ls='ck-ai-chat-context-controls__chip-tooltip',Ds='n';class AIChatContextItemButtonView extends vt{constructor(_0xafe34a,_0x508402,_0x36fc68,_0x12215b,_0x3a1b3b=!0x1){super(_0xafe34a),this['_isAnimationOnEnterEnabled']=_0x12215b,this['_initializeProperties'](_0x508402,_0x36fc68,_0x3a1b3b),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'](_0x3cda74,_0x516320,_0x41a04b){this['set']('label',_0x3cda74['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x3cda74['type']),this['set']('id',_0x3cda74['uiId']),this['set']('readonly',_0x516320),this['set']('isLoading',_0x41a04b);}['_setupTemplate'](){const _0xf4d51a=this['_createIconView'](),_0x2e664a=this['_createRemoveButton'](),_0x13b970=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x13b970),'children':this['_createTemplateChildren'](_0xf4d51a,_0x2e664a,_0x13b970)});}['_createTemplateAttributes'](_0x23b3f1){return{'class':[ks,_0x23b3f1['if']('itemType',Ns,_0x249e99=>'document'==_0x249e99),_0x23b3f1['if']('itemType',vs,_0x32b376=>'selection'==_0x32b376)],'data-cke-tooltip-text':_0x23b3f1['to']('label',Vs),'data-cke-tooltip-position':Ds,'data-cke-tooltip-class':Ls};}['_createTemplateChildren'](_0xbfb20c,_0x40862a,_0x507689){const _0x3e1e75=this['_createLabelElement'](_0x507689),_0x2cb73e=this['_createLoaderIcon']();return this['readonly']?[_0xbfb20c,_0x3e1e75]:[_0xbfb20c,_0x2cb73e,_0x3e1e75,_0x40862a];}['_createLabelElement'](_0x54fabc){return{'tag':'span','attributes':{'class':ys},'children':[{'text':_0x54fabc['to']('label')}]};}['_createRemoveButton'](){const _0x3542b2=new vt(this['locale']);return _0x3542b2['set']({'label':Hi(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x5777e9}),this['_setupRemoveButtonEvent'](_0x3542b2),_0x3542b2;}['_setupRemoveButtonEvent'](_0x34eea5){_0x34eea5['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x273094=this['bindTemplate'],_0xef78e4=new xt();return _0xef78e4['content']=Os[this['itemType']],_0xef78e4['extendTemplate']({'attributes':{'class':[xs,_0x273094['if']('isLoading','ck-hidden',_0x40160e=>_0x40160e)]}}),_0xef78e4;}['_handleAnimationEndOnce'](_0x6313af,_0x2d330e){if(!_0x6313af)return;const _0x4eb0ca=()=>{_0x2d330e(),_0x6313af['removeEventListener']('animationend',_0x4eb0ca),_0x6313af['removeEventListener']('webkitAnimationEnd',_0x4eb0ca);};_0x6313af['addEventListener']('animationend',_0x4eb0ca),_0x6313af['addEventListener']('webkitAnimationEnd',_0x4eb0ca);}['_createLoaderIcon'](){const _0x341e31=new AISpinnerView('small');return _0x341e31['bind']('isVisible')['to'](this,'isLoading',_0x199622=>_0x199622),_0x341e31;}}function Vs(_0x850f03){if(!_0x850f03)return _0x850f03;if(_0x850f03['length']<=0x78)return _0x850f03;const _0x54f54e=_0x850f03['slice'](0x0,0x78),_0x36cc6b=_0x54f54e['lastIndexOf']('\x20');return(_0x36cc6b>0x0?_0x54f54e['slice'](0x0,_0x36cc6b):_0x54f54e)+'…';}const Ps={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},Hs='300px';class AIChatChipsOverflowManager{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0xcb761f,_0xb73b1,_0x310c86,_0x404bc0,_0xd29c55){this['_locale']=_0xcb761f,this['_visibleChips']=_0xb73b1,this['_config']={...Ps,..._0x310c86,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x310c86['cssClasses']}},this['_overflowChips']=new dt(),this['_bodyCollection']=_0x404bc0,this['_parentView']=_0xd29c55||null;}['setContainerElement'](_0x532f7a){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x532f7a,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 _0xe35510=[...this['_visibleChips'],...this['_overflowChips']],_0x1bc67c=this['_createCalculationContainer'](),_0x4213b=this['_calculateOverflowInContainer'](_0x1bc67c,_0xe35510),_0x31fe92=_0x1bc67c['_ancestorsToRestore'];_0x31fe92&&this['_restoreAncestorVisibility'](_0x31fe92),_0x1bc67c['remove'](),this['_applyOverflowResults'](_0xe35510,_0x4213b);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),zt({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x3a6254=new vt(this['_locale']);_0x3a6254['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x5bbf9c=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x5bbf9c['push'](this['_config']['cssClasses']['controlsButton']),_0x3a6254['extendTemplate']({'attributes':{'class':_0x5bbf9c}}),_0x3a6254;}['_createShowMoreBalloonPanelView'](){const _0x10b9ba=new Xt(this['_locale']);return _0x10b9ba['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x10b9ba),_0x10b9ba;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x5352fb=>{_0x5352fb['disableAnimationOnEnter']();});const _0xe48992=new Nt(this['_locale']);_0xe48992['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0xe48992);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x1093f5=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x1093f5?'':'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'](_0x5d5f92){const _0xad8cfc=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x338f9c=this['_containerElement']?.['classList'];if(_0x338f9c){const _0x42675a=_0x338f9c[0x0]||'',_0xd3f665=_0x5d5f92['querySelector']('.'+_0x42675a),_0x355ab4=_0x5d5f92['querySelector'](_0xad8cfc);return _0xd3f665||_0x355ab4||_0x5d5f92;}return _0x5d5f92['querySelector'](_0xad8cfc)||_0x5d5f92;}['_calculateContainerWidth'](){const _0xfd2960=this['_parentView']?.['element']||this['_containerElement'];if(!_0xfd2960)return Hs;const _0x61d94a=window['getComputedStyle'](_0xfd2960)['width'];if('auto'===_0x61d94a||'0px'===_0x61d94a||!_0x61d94a){const _0x2a0ff9=_0xfd2960['parentElement'];if(_0x2a0ff9){const _0x540fa0=window['getComputedStyle'](_0x2a0ff9);return'auto'!==_0x540fa0['width']?_0x540fa0['width']:Hs;}return Hs;}return _0x61d94a;}['_applyCalculationStyles'](_0x518931,_0x2bdaa6){this['_config']['cssClasses']['calculationContainer']&&_0x518931['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x518931['style']['width']=_0x2bdaa6,_0x518931['style']['position']='absolute',_0x518931['style']['top']='-9999px',_0x518931['style']['left']='-9999px',_0x518931['style']['opacity']='0',_0x518931['style']['pointerEvents']='none',_0x518931['style']['zIndex']='-1',_0x518931['style']['visibility']='visible\x20!important',_0x518931['style']['display']='block\x20!important',_0x518931['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x113719){_0x113719['forEach'](({element:_0x30b54b,originalDisplay:_0x3ef524,originalVisibility:_0x23b8ce})=>{_0x30b54b['style']['display']=_0x3ef524,_0x30b54b['style']['visibility']=_0x23b8ce;});}['_makeAncestorsVisible'](_0x4c7113){const _0x463608=[];let _0x244317=_0x4c7113;for(;_0x244317&&_0x244317!==document['body'];){const _0x5e2c31=window['getComputedStyle'](_0x244317);'none'!==_0x5e2c31['display']&&'hidden'!==_0x5e2c31['visibility']||(_0x463608['push']({'element':_0x244317,'originalDisplay':_0x244317['style']['display'],'originalVisibility':_0x244317['style']['visibility']}),_0x244317['style']['display']='block',_0x244317['style']['visibility']='visible'),_0x244317=_0x244317['parentElement'];}return _0x463608;}['_createContainerElements'](){let _0x2cfc3a,_0xff4b4e;return this['_parentView']?.['element']?(_0x2cfc3a=this['_parentView']['element']['cloneNode'](!0x0),_0xff4b4e=this['_findTargetContainer'](_0x2cfc3a)):(_0x2cfc3a=document['createElement']('div'),_0xff4b4e=_0x2cfc3a),{'calculationContainer':_0x2cfc3a,'targetContainer':_0xff4b4e};}['_createCalculationContainer'](){const {calculationContainer:_0x335fa5,targetContainer:_0x5ad158}=this['_createContainerElements'](),_0x5bf57c=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x335fa5,_0x5bf57c);const _0x1579bd=this['_parentView']?.['element']||this['_containerElement'],_0x208ca7=_0x1579bd?.['parentElement'];_0x208ca7?_0x208ca7['appendChild'](_0x335fa5):document['body']['appendChild'](_0x335fa5),_0x335fa5['_targetContainer']=_0x5ad158;const _0xa95369=this['_makeAncestorsVisible'](_0x208ca7||null);return _0x335fa5['offsetWidth'],_0x335fa5['_ancestorsToRestore']=_0xa95369,_0x335fa5;}['_calculateOverflowInContainer'](_0x4c8fcd,_0x43e4f5){const _0x2d949c=_0x4c8fcd['_targetContainer']||_0x4c8fcd,_0x4a765d=[],{rowCount:_0x2047bb}=this['_renderChipsAndCountRows'](_0x2d949c,_0x43e4f5);if(_0x2047bb<=this['_config']['maxVisibleRows'])return _0x4a765d;const _0x18455e=_0x43e4f5['slice']();for(;_0x18455e['length']>0x0;){if(this['_testButtonFit'](_0x4c8fcd,_0x2d949c,_0x18455e)){const _0x1514ec=_0x43e4f5['filter'](_0x3c8310=>!_0x18455e['includes'](_0x3c8310));_0x4a765d['push'](..._0x1514ec);break;}if(!_0x18455e['pop']())break;}return _0x4a765d;}['_renderChipsAndCountRows'](_0x8d5d5f,_0xfe13f7){_0x8d5d5f['innerHTML']='',_0xfe13f7['forEach'](_0x2d2e71=>{if(_0x2d2e71['element']){const _0x4cef1b=_0x2d2e71['element']['cloneNode'](!0x0);_0x8d5d5f['appendChild'](_0x4cef1b);}}),_0x8d5d5f['offsetWidth'];const _0x304034=_0x8d5d5f['children'],_0x343db9=[];return Array['from'](_0x304034)['forEach'](_0x49c764=>{const _0x1ae197=_0x49c764['getBoundingClientRect']()['top'];_0x343db9['some'](_0x616148=>Math['abs'](_0x616148-_0x1ae197)<this['_config']['rowDetectionTolerance'])||_0x343db9['push'](_0x1ae197);}),{'rowCount':_0x343db9['length']};}['_createMockButton'](){const _0x261d29=document['createElement']('button');return _0x261d29['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x261d29['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x261d29['textContent']='+\x201',_0x261d29;}['_testButtonFit'](_0x47318b,_0x5a6720,_0x148224){this['_renderChipsAndCountRows'](_0x5a6720,_0x148224);const _0x4fdd4d=this['_createMockButton']();_0x47318b['appendChild'](_0x4fdd4d),_0x47318b['offsetWidth'];const _0x441150=[..._0x5a6720['children'],_0x4fdd4d],_0x12d433=[];_0x441150['forEach'](_0x26d717=>{const _0x535c00=_0x26d717['getBoundingClientRect']()['top'];_0x12d433['some'](_0x85d9c1=>Math['abs'](_0x85d9c1-_0x535c00)<this['_config']['rowDetectionTolerance'])||_0x12d433['push'](_0x535c00);});const _0x13cfb1=_0x12d433['length'];return _0x4fdd4d['remove'](),_0x13cfb1<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x2c04c9,_0xa43f5){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x2c04c9['forEach'](_0x5e9fba=>{_0xa43f5['includes'](_0x5e9fba)?this['_overflowChips']['add'](_0x5e9fba):this['_visibleChips']['add'](_0x5e9fba);});}['_updateOverflowUI'](_0x4bcfaa){if(_0x4bcfaa>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x4bcfaa>0x0&&this['_showMoreButtonView']){const _0x274e6f=''+this['_config']['showMoreLabelPrefix']+(_0x4bcfaa<0x63?_0x4bcfaa:'99');this['_showMoreButtonView']['label']=_0x274e6f;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x287d98,_0x436121){this['_distributeChips'](_0x287d98,_0x436121),this['_updateOverflowUI'](_0x436121['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x5809c4=>{_0x5809c4[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 _0x23acac=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x23acac['width']||0x0===_0x23acac['height'])return!0x1;const _0x14fce0=window['innerHeight']||document['documentElement']['clientHeight'],_0x1cf64a=window['innerWidth']||document['documentElement']['clientWidth'],_0x131992=0xc8;return _0x23acac['bottom']>=-0xc8&&_0x23acac['top']<=_0x14fce0+_0x131992&&_0x23acac['right']>=-0xc8&&_0x23acac['left']<=_0x1cf64a+_0x131992;}}const Ms='ck-ai-chat__feed__context-chips',Us='ck-ai-chat-context-chips-wrapper',Bs='ck-ai-chat-context-chips-wrapper-balloon',Gs='ck-ai-chat-controls-button',Fs='ck-ai-chat-controls_context_show-more-button',Ks='ck-ai-chat-context-controls__show-more-balloon-panel';class AIChatFeedContextChipsView extends Nt{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x37c087,_0xf194df,_0x17a246){super(_0x37c087),this['_bodyCollection']=_0x17a246,this['_createContextChips'](_0xf194df);const _0x17b48e={'cssClasses':{'showMoreButton':Fs+'\x20'+Bi,'showMoreBalloon':Ks,'overflowContainer':Bs,'controlsButton':Gs}};this['_overflowManager']=new AIChatChipsOverflowManager(_0x37c087,this['_contextChips'],_0x17b48e,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Ms,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Us},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x5c1f6d=this['element']['querySelector']('.'+Us);_0x5c1f6d&&(this['_overflowManager']['setContainerElement'](_0x5c1f6d),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x380631){for(const _0xc3636 of _0x380631){const _0x181f4e=new AIChatContextItemButtonView(this['locale'],_0xc3636,!0x0,!0x1);this['_contextChips']['add'](_0x181f4e);}}}class AIChatFeedUserMessageItemView extends AIChatFeedItemView{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x27d9d4,_0x190582,_0xc86dd5){super(_0x190582),this['_locale']=_0x27d9d4,this['_bodyCollection']=_0xc86dd5,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 AIChatFeedContextChipsView(this['_locale'],this['options']['contextItems']['filter'](_0x11ab18=>!_0x11ab18['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new Nt(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__message-content'}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=this['options']['initialContent'],this['markAsDone']();}}class AIChatFeedInteractionHeaderView extends AIChatFeedItemView{['capabilities'];constructor(_0x235060,_0x1d5cbc){super(_0x1d5cbc);const {isWebSearchEnabled:_0x1fb19e,isReasoningEnabled:_0x54260b}=_0x1d5cbc['capabilities'],_0x436a9d=[];let _0x5677aa='';_0x1fb19e&&_0x54260b?(_0x5677aa=Hi(_0x235060,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x436a9d['push'](Ws(_0x43e506)),_0x436a9d['push'](Ws(_0x23256e))):_0x1fb19e?(_0x5677aa=Hi(_0x235060,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x436a9d['push'](Ws(_0x43e506))):_0x54260b&&(_0x5677aa=Hi(_0x235060,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x436a9d['push'](Ws(_0x23256e))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x5677aa?'':'ck-hidden']}});const _0x21f780=new Nt();_0x21f780['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x436a9d,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x5677aa]}]}),this['children']['add'](_0x21f780),this['capabilities']=_0x1d5cbc['capabilities'];}}function Ws(_0x43c662){const _0x1020aa=new xt();return _0x1020aa['content']=_0x43c662,_0x1020aa;}const Ys=['wheel','touchstart','pointerdown','keydown'],$s=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class ScrollManager{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];['scrollBehavior'];constructor(_0x41e2c5){this['element']=_0x41e2c5,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1,this['scrollBehavior']='smooth';for(const _0x1e275c of Ys){const _0x515a2e='keydown'!==_0x1e275c;this['element']['addEventListener'](_0x1e275c,this['_onUserEvent']['bind'](this),{'passive':_0x515a2e,'signal':this['abortController']['signal']});}}['start']({smooth:_0x547ff3=!0x0}={}){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,this['scrollBehavior']=_0x547ff3?'smooth':'auto',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'](_0x38003b){if(this['isRunning']){if('keydown'===_0x38003b['type']){const _0x40b901=_0x38003b['key'];if(!$s['includes'](_0x40b901))return;}_0x38003b instanceof WheelEvent?_0x38003b['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0xb00e4f,scrollHeight:_0xd23031,clientHeight:_0x97c524}=this['element'];return _0xd23031-_0xb00e4f-_0x97c524<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':this['scrollBehavior']}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class AIChatFeedCustomElementView extends AIChatFeedItemView{constructor(_0x5d99f8){super(_0x5d99f8),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 AIChatFeedView extends Nt{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x254e92,_0x2ebe36){super(_0x254e92),this['_bodyCollection']=_0x2ebe36,this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...ms)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new ScrollManager(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x3bbea7,_0x178f10){let _0x4733f6;return'ai-reply'===_0x3bbea7?_0x4733f6=new AIChatFeedReplyItemView(this['locale'],_0x178f10,this['_bodyCollection']):'ai-suggestion-reply'===_0x3bbea7?(_0x4733f6=new AIChatFeedSuggestionItemView(this['locale'],_0x178f10,this['_bodyCollection']),_0x4733f6['bind']('isTrackChangesOn')['to'](this)):_0x4733f6='user-message'===_0x3bbea7?new AIChatFeedUserMessageItemView(this['locale'],_0x178f10,this['_bodyCollection']):'interaction-header'===_0x3bbea7?new AIChatFeedInteractionHeaderView(this['locale'],_0x178f10):'custom-element'===_0x3bbea7?new AIChatFeedCustomElementView(_0x178f10):new AIChatFeedErrorItemView(_0x178f10),this['children']['add'](_0x4733f6),_0x4733f6;}async['updateReplyItem']({id:_0x259d75,parsedContent:_0x4306ea,renderingStrategy:_0x4c4eef,abortSignal:_0x4878ef}){const _0x5d1254=this['getItemById'](_0x259d75);if(!(_0x5d1254 instanceof AIChatFeedReplyItemView))throw new at('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x5d1254,'id':_0x259d75,'parsedContent':_0x4306ea});await _0x5d1254['updateContent']({'parsedContent':_0x4306ea,'renderingStrategy':_0x4c4eef,'abortSignal':_0x4878ef});}async['updateWebSources'](_0x5b1cdb,_0x3c9709){const _0x2afc9e=this['getItemById'](_0x5b1cdb);if(_0x2afc9e instanceof AIChatFeedSuggestionItemView)_0x2afc9e['updateSources'](_0x3c9709);else{if(!(_0x2afc9e instanceof AIChatFeedReplyItemView))throw new at('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x2afc9e,'id':_0x5b1cdb,'sources':_0x3c9709});_0x2afc9e['updateSources'](_0x3c9709);}}async['updateSuggestionItem']({id:_0xec92d2,parts:_0x49c313,abortSignal:_0x5c8abc,skipLoadingEffects:_0x489fde}){const _0x23e007=this['getItemById'](_0xec92d2);if(!(_0x23e007 instanceof AIChatFeedSuggestionItemView))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x23e007,'id':_0xec92d2,'parts':_0x49c313});await _0x23e007['updateContent']({'parts':_0x49c313,'abortSignal':_0x5c8abc,'skipLoadingEffects':_0x489fde});}['updateSuggestionPartState']({id:_0x39787f,index:_0x5e66d7,state:_0x471a13}){const _0x16dfdd=this['getItemById'](_0x39787f);if(!(_0x16dfdd instanceof AIChatFeedSuggestionItemView))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x39787f});_0x16dfdd['updatePartState'](_0x5e66d7,_0x471a13);}['setSuggestionPartActive']({id:_0x15d636,index:_0x5be76b,isActive:_0x426927}){const _0x10c115=this['getItemById'](_0x15d636);if(!(_0x10c115 instanceof AIChatFeedSuggestionItemView))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x15d636});this['children']['filter'](_0x271d4f=>_0x271d4f instanceof AIChatFeedSuggestionItemView)['forEach'](_0x271f4c=>{_0x271f4c['setPartActive'](!0x1);}),_0x10c115['setPartActive'](_0x5be76b,_0x426927);}['markItemAsDone'](_0x2b65cc){this['getItemById'](_0x2b65cc)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x242802=>_0x242802['options']['id']);}['removeItem'](_0x42c7e8){this['children']['remove'](this['getItemById'](_0x42c7e8));}['hasItem'](_0xc8d222){return!!this['children']['find'](_0x4be252=>_0x4be252['options']['id']['includes'](_0xc8d222));}['scrollToSuggestion'](_0x4e4ebe,_0x17a462){const _0xaaba11=this['getItemById'](_0x4e4ebe);if(!(_0xaaba11 instanceof AIChatFeedSuggestionItemView))return void gt('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x4e4ebe,'partIndex':_0x17a462});const _0x1c80d7=_0xaaba11['getPartView'](_0x17a462);_0x1c80d7?ft(_0x1c80d7['element'],0x14,this['element']['parentElement'],!0x0,!0x0):gt('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x4e4ebe,'partIndex':_0x17a462});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x3418e8=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x3418e8,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x166e0a=new AISkeletonView(this['locale'],Ss['aiFeed']);return _0x166e0a['bind']('isVisible')['to'](this,'isLoadingSkeletonVisible'),_0x166e0a;}['_createFeedItems'](){const _0x52ad20=new Nt(this['locale']);return _0x52ad20['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x52ad20;}['_createFeedLoader'](){const _0x5dacc5=new Nt(this['locale']);return _0x5dacc5['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('loadingMessage','ck-hidden',_0x259316=>!_0x259316)]},'children':this['_createLoaderChildren']()}),_0x5dacc5;}['_createLoaderChildren'](){const _0x438ada=new AISpinnerView();return _0x438ada['isVisible']=!0x0,[_0x438ada,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x218ca1){const _0x55a6de=this['children']['find'](_0x596046=>_0x596046['options']['id']['includes'](_0x218ca1));if(!_0x55a6de)throw new at('ai-chat-feed-view-item-not-found',this,{'id':_0x218ca1});return _0x55a6de;}['setLoadingMessage'](_0x1812df){this['set']('loadingMessage',_0x1812df);}['toggleLoadingSkeleton'](_0x3a634c){this['set']('isLoadingSkeletonVisible',_0x3a634c);}['startAutoScroll'](_0x4847e={}){this['scrollManager']['start'](_0x4847e);}['stopAutoScroll'](){this['scrollManager']['stop']();}}class AIChatPromptSuggestionsListView extends Dt{['filter'](){let _0x5dcdb4=0x0;for(const _0x370ba4 of this['items'])_0x5dcdb4+=_0x370ba4['items']['length'];return{'resultsCount':_0x5dcdb4,'totalItemsCount':_0x5dcdb4};}}const qs='ck-ai-chat__prompt-input_highlighted';class AIChatPromptInputView extends Lt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x281b81,_0x3bacde){super(_0x281b81,{'queryView':{'label':'','creator':Ut,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new AIChatPromptSuggestionsListView(_0x281b81),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x3bacde,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=AIChatPromptInputView['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=AIChatPromptInputView['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',(_0x31fdb9,_0x1b6f07)=>!_0x31fdb9&&!_0x1b6f07),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x1368af,_0x372cee)=>{this['isUploadInProgress']||this['isEmpty']||_0x1368af['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x372cee());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0xbb94f8=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0xbb94f8)return this['queryView']['errorText']=Hi(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x90939b=_0x2d9792(_0xbb94f8);this['fire']('sendUserMessage',_0x90939b),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x18c085){this['queryView']['fieldView']['set']('placeholder',_0x18c085);}['focus'](_0x6a1909=!0x1){super['focus'](),_0x6a1909&&(this['element']['classList']['contains'](qs)||(this['element']['classList']['add'](qs),setTimeout(()=>{this['element']['classList']['remove'](qs);},0x320)));}['_createSubmitButton'](){const _0x18f507=new vt(this['locale']);return _0x18f507['set']({'icon':_0xcffe77,'label':Hi(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+Mi,'isEnabled':!0x1}),_0x18f507['on']('execute',()=>{this['submit']();}),_0x18f507;}['setIsUploadInProgress'](_0x2f7aad){this['isUploadInProgress']=_0x2f7aad;}['_setUpAddContextButtonPositioning'](){const _0x2ff29d=this['locale'],_0x5632e1=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x319922=new ut(this['queryView']['fieldView']['element']),_0x4e1746=new ut(this['_addContextButtonView']['element']),_0x293e96=_0x319922['width'],_0xdb4941='rtl'===_0x2ff29d['uiLanguageDirection']?'right':'left';_0x319922['excludeScrollbarsAndBorders']();const _0x48ad0c=_0x293e96-_0x319922['width']+0x1;this['_addContextButtonView']['element']['style'][_0xdb4941]='calc('+(_0x293e96-_0x4e1746['width']-_0x48ad0c)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x5632e1),this['on']('render',()=>{_0x5632e1(),this['_queryViewResizeObserver']=new St(this['queryView']['fieldView']['element'],()=>{_0x5632e1();});});}}const Qs='ck-ai-chat__prompt-capabilities',Xs='ck-ai-chat-controls-button',zs='ck-ai-chat-controls-button--commands',js='ck-ai-chat-controls__model-selection',Js='ck-ai-chat-controls__model-selection__item-name',Zs='ck-ai-chat-controls__model-selection__item-description',tn='ck-ai-chat-controls__model-selection__item-capabilities',en='n';class AIChatPromptCapabilitiesView extends Nt{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x4f2398){super(_0x4f2398),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',_0x50cdd8=>'selector'===_0x50cdd8),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x25df66=>_0x25df66?this['_modelSelectionDropdown']['buttonView']['label']:Hi(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x8446ca=>_0x8446ca),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x98e32e=>_0x98e32e),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x48a645=>Hi(this['locale'],_0x48a645?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x2db2dd=>_0x2db2dd),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x1b6070=>Hi(this['locale'],_0x1b6070?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[Qs]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new dt(),jt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0xe1c8b5,_0x458cea){if(_0x458cea)this['set']('modelDisplayMode','hidden');else{const _0x196ccb=0x1===_0xe1c8b5['length'];this['set']('modelDisplayMode',_0x196ccb?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0xe1c8b5?.['length'])for(const _0x28b86b of _0xe1c8b5){const _0x3ed462=new Jt({'label':_0x28b86b['name'],'withText':!0x0,'role':'menuitemradio','id':_0x28b86b['id'],'model':_0x28b86b});_0x3ed462['bind']('isOn')['to'](this,'activeModelId',_0x1c85de=>_0x1c85de===_0x28b86b['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x3ed462,'labelView':new sn(this['locale'],_0x28b86b)});}}['setWebSearch'](_0x12af44){this['set']('webSearchActive',_0x12af44);}['setReasoning'](_0x1d0ea1){this['set']('reasoningActive',_0x1d0ea1);}['setModel'](_0x2d7f3d){if(!_0x2d7f3d)return;this['activeModelId']=_0x2d7f3d['id'],this['activeModelName']=_0x2d7f3d['name']||_0x2d7f3d['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x2d7f3d['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x2d7f3d['name']);const _0x34117c=_0x2d7f3d['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x34117c),this['_webSearchButton']['set']('isVisible',_0x34117c);const _0x5f1857=_0x2d7f3d['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x5f1857),this['_reasoningButton']['set']('isVisible',_0x5f1857);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x3ef8ce){this['set']('modelSelectorEnabled',!0x1),_0x3ef8ce&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x211581=new vt();return _0x211581['set']({'label':Hi(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x43e506,'class':Xs+'\x20'+Bi,'isToggleable':!0x0,'tooltipPosition':en}),_0x211581['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x211581;}['_createReasoningButton'](){const _0x6c9f8e=new vt();return _0x6c9f8e['set']({'label':Hi(this['locale'],'AI_CHAT_REASONING'),'icon':_0x23256e,'class':Xs+'\x20'+Bi,'isToggleable':!0x0,'tooltipPosition':en}),_0x6c9f8e['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x6c9f8e;}['_createCommandsButton'](){const _0x1b4c6c=new vt();return _0x1b4c6c['set']({'label':Hi(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x5ddbf5,'withText':!0x0,'class':Xs+'\x20'+Bi,'isToggleable':!0x0,'tooltip':Hi(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':en}),_0x1b4c6c['extendTemplate']({'attributes':{'class':[zs]}}),_0x1b4c6c['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x1b4c6c;}['_createModelSelectionDropdown'](){const _0x2d81a1=Gt(this['locale']);return _0x2d81a1['set']({'panelPosition':'ne','class':[js]}),_0x2d81a1['buttonView']['set']({'label':Hi(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':en,'class':Bi}),this['listenTo'](_0x2d81a1,'execute',_0x383cfb=>{this['fire']('selectModel',_0x383cfb['source']['model']);}),_0x2d81a1;}['_createModelNameView'](){const _0x3e7c63=new nn(this['locale']);return _0x3e7c63['bind']('text')['to'](this,'activeModelName',_0x3db2c5=>_0x3db2c5??''),_0x3e7c63['bind']('isVisible')['to'](this,'modelDisplayMode',_0x55fafb=>'name'===_0x55fafb),_0x3e7c63;}}let sn=class ModelButtonLabelView extends Ht{constructor(_0x43d10a,_0x2e14a4){super();const _0x2aa3fd=this['bindTemplate'],_0x269a4a=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x2aa3fd['to']('style'),'id':_0x2aa3fd['to']('id')},'children':[{'tag':'div','attributes':{'class':[Js]},'children':[{'text':_0x2aa3fd['to']('text')}]},{'tag':'div','attributes':{'class':[Zs]},'children':[{'tag':'span','children':[{'text':_0x2e14a4['description']}]}]},{'tag':'div','attributes':{'class':[tn]},'children':_0x269a4a}]}),_0x269a4a['addMany'](this['_getCapabilityParts'](_0x43d10a,_0x43e506,'AI_CHAT_SEARCH_WEB',_0x2e14a4['capabilities']['webSearch']?.['enabled']??!0x1)),_0x269a4a['addMany'](this['_getCapabilityParts'](_0x43d10a,_0x23256e,'AI_CHAT_REASONING',_0x2e14a4['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x392b5e,_0x57adb2,_0x1f4f38,_0x1c1039){const _0x3ee70d=new xt();_0x3ee70d['content']=_0x57adb2;const _0x46c264=new Nt(_0x392b5e);_0x46c264['setTemplate']({'tag':'span','children':[{'text':Hi(_0x392b5e,_0x1f4f38)+':\x20'}]});const _0x63dc80=new Nt(_0x392b5e);return _0x63dc80['setTemplate']({'tag':'span','children':[{'text':Hi(_0x392b5e,_0x1c1039?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x3ee70d,_0x46c264,_0x63dc80];}},nn=class ModelNameView extends Nt{constructor(_0x3ad3aa){super(_0x3ad3aa),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x543be1=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x543be1['if']('isVisible','ck-hidden',_0x43b507=>!_0x43b507)]},'children':[{'text':_0x543be1['to']('text')}]});}};const rn='ck-ai-chat-context-controls__url-form',on='ck-ai-chat-context-controls__url-input-section';class AIChatContextPanelUrlInputView extends Nt{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x111499){super(_0x111499),this['focusTracker']=new _t(),this['keystrokes']=new It(),this['backButton']=this['_createBackButton'](),this['urlInputField']=this['_createUrlInputField'](),this['confirmButton']=this['_createConfirmButton'](),this['_focusables']=this['createCollection']([this['backButton'],this['urlInputField'],this['confirmButton']]),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['set']('withBackButton',!0x0),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x239620=>{this['focusTracker']['add'](_0x239620['element']),this['keystrokes']['listenTo'](_0x239620['element']);}),Zt({'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'](_0x1357b6){this['urlInputField']['errorText']=_0x1357b6,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0xf6b95a=new vt(this['locale']);return _0xf6b95a['set']({'icon':_0x3d9913,'tooltip':Hi(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x5521a9,_0x453368,_0x55131a)=>{_0xf6b95a['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x55131a?'':'\x20ck-hidden')]});}),_0xf6b95a;}['_createUrlInputField'](){const _0x21a2ae=new te(this['locale'],_0x22cbcd);return _0x21a2ae['set']({'label':Hi(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x21a2ae['fieldView']['set']({'placeholder':Hi(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x21a2ae;}['_createConfirmButton'](){const _0x51e096=new vt(this['locale']);return _0x51e096['set']({'icon':_0x489882,'tooltip':Hi(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x51e096;}['_setupTemplate'](){const _0x29c2bb=new _0x4c3dd1(this['locale'],{'label':Hi(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x29c2bb['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':rn,'tabindex':'-1'},'children':[_0x29c2bb,{'tag':'div','attributes':{'class':on},'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',_0x127290=>{_0x127290['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x207c7e,_0x14463a)=>{this['clear'](),this['fire']('cancel'),_0x14463a();});}['_handleSubmit'](){const _0x1b6bd3=this['getValue']()['trim']();_0x1b6bd3?this['_isValidUrl'](_0x1b6bd3)?(this['clearError'](),this['fire']('submitUrl',_0x1b6bd3)):this['setError'](Hi(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](Hi(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x678c01=this['getValue']()['trim'](),_0x1e3448=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x678c01['length']>0x0&&!_0x1e3448;}['_isValidUrl'](_0xb4fc02){try{return!!new URL(_0xb4fc02);}catch{return!0x1;}}}const an='ck-ai-chat-resources__item',hn='ck-ai-chat-resources__item--in-context',cn='ck-ai-chat-resources__item-title',ln='ck-ai-chat-resources__item__icon';class AIChatResourceListItemView extends Pt{['resource'];['_titleView'];['_iconView'];constructor(_0x122880,_0x329e93){super(_0x122880),this['resource']=_0x329e93,this['set']('isInContext',!!_0x329e93['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0xe9cc89){if(_0xe9cc89['isInContext'])return _0x489882;switch(_0xe9cc89['type']){case'document':return _0x3745a0;case'web-resource':return _0x4ad8e3;case'file':case'text':return _0xc6d689;default:return _0x3649ad;}}['highlightText'](_0x2d52f0){if(!_0x2d52f0||''===_0x2d52f0['trim']())return void this['_titleView']['highlightText'](null);const _0x2ef92a=new RegExp(_0x5933ee(_0x2d52f0),'gi');this['_titleView']['highlightText'](_0x2ef92a);}['updateResourceState'](_0x29eb49){this['resource']['isInContext']=_0x29eb49,this['isInContext']=_0x29eb49,this['_updateIcon']();}['_createTitleView'](){const _0x16b680=new _0x378b1f();return _0x16b680['text']=this['resource']['label'],_0x16b680['extendTemplate']({'tag':'span','attributes':{'class':[cn]}}),_0x16b680;}['_createIconView'](){const _0x89415f=new xt();return _0x89415f['content']=this['getResourceIcon'](this['resource']),_0x89415f;}['_setupTemplate'](){const _0x1a9f1a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[an,_0x1a9f1a['if']('isVisible','ck-hidden',_0x97893=>!_0x97893),_0x1a9f1a['if']('isInContext',hn)]},'children':[{'tag':'div','attributes':{'class':[ln]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x1a9f1a['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const un='ck-ai-chat-resources__list';class AIChatContextResourcesListView extends Dt{['_source'];constructor(_0x295804,_0xd14025){super(_0x295804),this['_source']=_0xd14025,this['extendTemplate']({'attributes':{'class':[un]}});}['setResources'](_0x239e16,_0x51dfa1){this['items']['clear']();let _0x4f0fae=_0x239e16;if(this['_source']['useDefaultFiltering']&&_0x51dfa1&&''!==_0x51dfa1['trim']()){const _0x5a33d5=new RegExp(_0x51dfa1['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x4f0fae=_0x239e16['filter'](_0x2dea4d=>_0x5a33d5['test'](_0x2dea4d['label']));}for(const _0x5b505b of _0x4f0fae){const _0x231305=new AIChatResourceListItemView(this['locale'],_0x5b505b);_0x231305['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x5b505b);}),this['items']['add'](_0x231305);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x51dfa1);}['highlightText'](_0x2bd714){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x2323dd=>{_0x2323dd['highlightText'](_0x2bd714);});}['updateResourceState'](_0x388f29,_0x1b0f67){for(const _0x108950 of this['items']){const _0x3ad439=_0x108950;_0x3ad439['resource']['id']===_0x388f29&&_0x3ad439['updateResourceState'](_0x1b0f67);}}['_handleResourceSelection'](_0x356e76,_0x167120){this['fire']('addResourceToContext',{'source':_0x356e76,'resource':_0x167120});}}class AIChatContextResourcesSearchInputView extends te{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0xfddc74){const t=_0xfddc74['t'],_0x44661e={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x22cbcd,'label':Hi(_0xfddc74,'AI_CHAT_SEARCH_RESOURCES')};super(_0xfddc74,_0x44661e['creator']),this['label']=_0x44661e['label'],this['_viewConfig']=_0x44661e,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0xfddc74,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x3314fd){this['fire']('search',_0x3314fd);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new xt(),this['iconView']['content']=_0x3fa2b6,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x574bd0,t){this['resetButtonView']=new vt(_0x574bd0),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x5777e9,'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',_0x4c42d5=>!_0x4c42d5),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 AIChatContextResourcesView extends Nt{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x51e7c3,_0x144725){super(_0x51e7c3),this['_source']=_0x144725['source'],this['_searchInputVisibleFrom']=_0x144725['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 _0x3127bc([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new AIChatContextResourcesSearchInputView(this['locale']);}['_createSearchSection'](){const _0x15ff8d=new Nt(this['locale']);return _0x15ff8d['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x255a63,_0x3f89cd)=>{this['loadResources'](_0x3f89cd),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x3f89cd);}),_0x15ff8d;}['_createResourcesListView'](){const _0x45fea2=new AIChatContextResourcesListView(this['locale'],this['_source']);return _0x45fea2['delegate']('addResourceToContext')['to'](this),_0x45fea2['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x45fea2;}['_createSkeletonView'](){const _0x3231da=new AISkeletonView(this['locale'],Ss['aiChatResources']);return _0x3231da['bind']('isVisible')['to'](this,'isLoading'),_0x3231da;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x4e640a){const _0x292ff0=ot();this['_latestLoadResourcesUid']=_0x292ff0,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x4e640a,'uid':_0x292ff0}),this['isLoading']=!0x0;}['setResources'](_0x18df52,_0x384384){if(_0x384384&&_0x384384!==this['_latestLoadResourcesUid'])return;const _0x9030c9=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x18df52,_0x9030c9),_0x18df52['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x52083a,_0x2532d0){this['_resourcesListView']['updateResourceState'](_0x52083a,_0x2532d0);}}const dn='ck-ai-chat-context-controls__source-balloon-panel',_n='ck-button-icon\x20ck-button-back',In='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class AIChatResourcesBalloonView{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x5b8578,_0x395fe0,_0x5c8146){this['_locale']=_0x5b8578,this['_bodyCollection']=_0x395fe0,this['_config']=_0x5c8146;}['showSourceResourcesBalloon']({source:_0x198135,withBackButton:_0x492d03}){let _0x169d2d=this['_sourceResourceBalloons']['get'](_0x198135['id']);_0x169d2d||(_0x169d2d=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x198135['id'],_0x169d2d),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x169d2d)),this['_addSourceResourceContent']({'balloonPanel':_0x169d2d,'source':_0x198135,'withBackButton':_0x492d03}),_0x169d2d['show']();const _0x22bf32=this['_config']['getTargetElement']();_0x22bf32&&_0x169d2d['pin']({'target':_0x22bf32,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x26bc11,_0xbb8f1f,_0x312950){const _0x124fa9=this['_sourceResourceBalloons']['get'](_0x26bc11);if(!_0x124fa9)return;const _0x255722=this['_getResourcesViewFromBalloon'](_0x124fa9);_0x255722&&(_0x255722['setResources'](_0xbb8f1f,_0x312950),_0x255722['once']('change:isLoading',()=>{_0x124fa9['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x32cd2b){const _0x439ebf=this['_sourceResourceBalloons']['get'](_0x32cd2b);_0x439ebf&&requestAnimationFrame(()=>{_0x439ebf['hide'](),this['_sourceResourceBalloons']['delete'](_0x32cd2b),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x5a1e9f of this['_sourceResourceBalloons']['values']())if(_0x5a1e9f['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x60ad73,_0x5d08f1,_0xe07731){const _0x431d80=this['_sourceResourceBalloons']['get'](_0x60ad73);if(!_0x431d80||!_0x431d80['isVisible'])return;const _0x46f577=this['_config']['getTargetElement']();if(!_0x46f577)return;_0x431d80['pin']({'target':_0x46f577,'limiter':this['_config']['getLimiterElement']()});const _0x52ddd1=this['_getResourcesViewFromBalloon'](_0x431d80);_0x52ddd1&&_0x52ddd1['updateResourceState'](_0x5d08f1,_0xe07731);}['destroy'](){for(const _0x362f12 of this['_sourceResourceBalloons']['values']())_0x362f12['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0xcc0ed4=new Xt(this['_locale']);return _0xcc0ed4['extendTemplate']({'attributes':{'class':dn}}),this['_bodyCollection']['add'](_0xcc0ed4),_0xcc0ed4;}['_addSourceResourceContent']({balloonPanel:_0x31f7ba,source:_0x3b3c68,withBackButton:_0x538b53}){_0x31f7ba['content']['clear']();const _0x2dab73=this['_createBalloonHeader']({'balloonPanel':_0x31f7ba,'source':_0x3b3c68,'withBackButton':_0x538b53});_0x31f7ba['content']['add'](_0x2dab73);const _0x2c21a3=this['_createBalloonResourcesView'](_0x3b3c68);_0x31f7ba['content']['add'](_0x2c21a3);}['_createBalloonHeader']({balloonPanel:_0xf61cae,source:_0x5c2613,withBackButton:_0x518f12}){const _0x53dfb4=new _0x4c3dd1(this['_locale'],{'label':_0x5c2613['label'],'class':In});return _0x518f12&&_0x53dfb4['children']['add'](this['_createBackButton'](_0xf61cae),0x0),_0x53dfb4;}['_createBackButton'](_0x243f26){const _0x760ce5=new vt(this['_locale']);return _0x760ce5['set']({'icon':_0x3d9913,'tooltip':Hi(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':_n}),_0x760ce5['on']('execute',()=>{_0x243f26['hide'](),this['_config']['onBackToContext']();}),_0x760ce5;}['_createBalloonResourcesView'](_0x4c6330){const _0x5434be=new AIChatContextResourcesView(this['_locale'],{'source':_0x4c6330,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x5434be['on']('loadSourceResources',(_0x4ffdef,_0x5e2dfa)=>{this['_config']['onLoadSourceResources'](_0x5e2dfa);}),_0x5434be['on']('addResourceToContext',(_0x59039d,_0x49037c)=>{this['_config']['onResourceSelected'](_0x49037c['source'],_0x49037c['resource']),this['closeSourceResourceBalloon'](_0x4c6330['id']);}),_0x5434be;}['_getResourcesViewFromBalloon'](_0x501cc1){const _0x2b2e8b=_0x501cc1['content']['get'](0x1);return _0x2b2e8b instanceof AIChatContextResourcesView?_0x2b2e8b:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x2c06b7){zt({'emitter':_0x2c06b7,'contextElements':[_0x2c06b7['element']],'callback':()=>{_0x2c06b7['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x2c06b7['isVisible']});}}const An=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],gn='ck-ai-chat-context-controls',Cn='ck-ai-chat-context-controls__pending-contexts',mn='ck-ai-chat-context-controls__add-context-balloon-panel',pn='ck-ai-chat-context-controls__add-context-button',En='ck-ai-chat-context-controls__url-balloon-panel',wn='ck-ai-chat-context-controls__balloon-button',Tn='ck-ai-chat-context-controls__balloon-button-source',fn='ck-ai-chat-controls-button',Sn='ck-ai-chat-context-chips-wrapper-balloon',Rn='ck-ai-chat-controls_context_show-more-button',bn='ck-ai-chat-context-controls__show-more-balloon-panel',On='ck-ai-chat',kn=[Xt['defaultPositions']['northArrowSouthWest'],Xt['defaultPositions']['northArrowSouth'],Xt['defaultPositions']['northArrowSouthEast'],Xt['defaultPositions']['southArrowNorthWest'],Xt['defaultPositions']['southArrowNorth'],Xt['defaultPositions']['southArrowNorthEast']];class AIChatContextPanelView extends Nt{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x25b436,_0x4154c3){super(_0x25b436),this['bodyCollection']=_0x4154c3['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x25b436),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x25b436),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x25b436),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x25b436,_0x4154c3);const _0x759399={'cssClasses':{'showMoreButton':Rn+'\x20'+Bi,'showMoreBalloon':bn,'overflowContainer':Sn,'controlsButton':fn}};this['_overflowManager']=new AIChatChipsOverflowManager(_0x25b436,this['_currentContextsChips'],_0x759399,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'](_0x5827a2,_0x5eff4c){const _0x15e4d0=this['_createContextButton'](_0x5827a2,'current',!0x0,_0x5eff4c);this['_addContextToCollection'](_0x15e4d0,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x137f2d){this['_removeContextFromCollection'](_0x137f2d,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x137f2d,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0xfb4c4d,_0x538f9b){let _0x127d99=this['_currentContextsChips']['find'](_0x5a266d=>_0x5a266d['id']===_0xfb4c4d);_0x127d99||(_0x127d99=this['_overflowManager']['overflowChips']['find'](_0x29d96c=>_0x29d96c['id']===_0xfb4c4d)),_0x127d99&&(_0x127d99['isLoading']=_0x538f9b);}['setConversationContext'](_0x400339){this['_conversationContextsChips']['clear']();for(const _0x506530 of _0x400339){const _0x233ffd=this['_createContextButton'](_0x506530,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x233ffd,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x246c2d,_0x1fb7c6,_0x5f21a2){this['_resourcesBalloonView']['updateResourceState'](_0x246c2d,_0x1fb7c6,_0x5f21a2);}['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:_0x4d2e23,withBackButton:_0x1f692d}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x4d2e23,'withBackButton':_0x1f692d}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x1e3671,_0x5cea06,_0x14adf8,_0x2fa4ee){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x1e3671,_0x14adf8,_0x2fa4ee);}['closeSourceResourceBalloon'](_0x507440){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x507440),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x478b9b){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x478b9b),this['_setAddContextButtonEnabled'](_0x478b9b);}['_setAddContextButtonEnabled'](_0x5b8e02){const _0x211764=!_0x5b8e02['document']['isHidden']&&_0x5b8e02['document']['enabled'],_0x1d76ed=_0x5b8e02['urls']['enabled'],_0x2169c6=_0x5b8e02['files']['enabled'],_0x57a708=_0x5b8e02['sources']['length']>0x0,_0x20b844=_0x5b8e02['customItems']&&_0x5b8e02['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x211764||_0x1d76ed||_0x2169c6||_0x57a708||_0x20b844;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[gn,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Cn},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x140cce){const _0x2b9156=new vt(_0x140cce);return _0x2b9156['set']({'label':Hi(_0x140cce,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':fn+'\x20'+pn+'\x20'+Bi,'icon':_0x1bd4f2,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x2b9156;}['_createAddContextBalloonPanelView'](_0x2d87f5){return this['_createBaseBalloonPanel'](_0x2d87f5,mn);}['_createUrlBalloonPanelView'](_0x586a8c){const _0xee1b52=this['_createBaseBalloonPanel'](_0x586a8c,En);return this['_addUrlContent'](_0xee1b52,_0x586a8c),_0xee1b52;}['_createResourcesBalloonView'](_0x454e0b,_0x3a46e6){const _0x5ce63c={'searchInputVisibleFrom':_0x3a46e6['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':kn});},'onResourceSelected':(_0x5a4261,_0x182054)=>{this['fire']('addResourceToContext',{'source':_0x5a4261,'resource':_0x182054});},'onLoadSourceResources':_0x49a836=>{this['fire']('loadSourceResources',_0x49a836);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new AIChatResourcesBalloonView(_0x454e0b,_0x3a46e6['bodyCollection'],_0x5ce63c);}['_getLimiterElement'](){return this['element']?.['closest']('.'+On)||document['body'];}['_createBaseBalloonPanel'](_0x38684a,_0x2b3e13){const _0x4adfc2=new Xt(_0x38684a);return _0x4adfc2['extendTemplate']({'attributes':{'class':_0x2b3e13}}),this['bodyCollection']['add'](_0x4adfc2),_0x4adfc2;}['_setBalloonPanelContent'](_0x47950e,_0x1fe58b,_0x5632e7){if(_0x47950e['content']['clear'](),!_0x5632e7['document']['isHidden']&&_0x5632e7['document']['enabled']){const _0x53c86b=this['_createBalloonButton'](_0x1fe58b,{'label':Hi(_0x1fe58b,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x3745a0});_0x53c86b['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x47950e['content']['add'](_0x53c86b);}if(_0x5632e7['urls']['enabled']){const _0x55ed97=this['_createBalloonButton'](_0x1fe58b,{'label':Hi(_0x1fe58b,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x4ad8e3});_0x55ed97['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':kn}),this['_urlInputView']['focus']();}),_0x47950e['content']['add'](_0x55ed97);}if(_0x5632e7['files']['enabled']){const _0xddcfd4=new _0x29e35a(_0x1fe58b);_0xddcfd4['set']({'label':Hi(_0x1fe58b,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x23ddc8,'withText':!0x0,'tooltip':!0x0,'class':wn,'allowMultipleFiles':!0x0}),_0xddcfd4['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0xddcfd4['on']('done',(_0x2c8612,_0x220adf)=>{this['fire']('addFileToContext',_0x220adf);}),_0xddcfd4['tooltip']=!0x0,_0x47950e['content']['add'](_0xddcfd4);}for(const _0x526a0a of _0x5632e7['sources']){const _0x7d7b0a=this['_createBalloonButton'](_0x1fe58b,{'label':_0x526a0a['label'],'icon':_0x526a0a['icon']||_0x3649ad,'type':'source'});_0x47950e['content']['add'](_0x7d7b0a),_0x7d7b0a['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x526a0a,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x486bb2 of _0x5632e7['customItems']||[]){const _0x4f9b25=this['_createBalloonButton'](_0x1fe58b,{'label':_0x486bb2['label'],'icon':_0x486bb2['icon']||_0x3649ad,'type':'customItem'});_0x47950e['content']['add'](_0x4f9b25),_0x4f9b25['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x486bb2);});}this['_hasExactlyOneSource']=0x1===_0x47950e['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x4132fe,_0x1949c3){this['_urlInputView']=new AIChatContextPanelUrlInputView(_0x1949c3),this['_urlInputView']['on']('submitUrl',(_0xeaba09,_0x474d56)=>{this['_handleUrlSubmit'](_0x474d56);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':kn}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':kn});}),_0x4132fe['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x426d94,_0x461216){const _0x1a312d='source'===_0x461216['type']?new SourcesBalloonButtonView(_0x426d94):new vt(_0x426d94);return _0x1a312d['set']({'label':_0x461216['label'],'icon':_0x461216['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':wn}),_0x1a312d;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){zt({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x1a8433){const _0x2330e1=this['_addContextBalloonConfig'];_0x2330e1['buttonView']['isOn']=_0x1a8433,_0x1a8433?_0x2330e1['balloonView']['show']():_0x2330e1['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x7646dd,buttonView:_0x49af4c,hideMethod:_0x439b41}=this['_addContextBalloonConfig'];zt({'emitter':_0x7646dd,'contextElements':[_0x7646dd['element'],_0x49af4c['element']],'callback':()=>{_0x439b41();},'activator':()=>_0x49af4c['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x4585ec,_0x49a2fc,_0x3a26f9=!0x1,_0x15aff8=!0x1){const _0x3180c6='conversation'===_0x49a2fc||!0x0===_0x4585ec['isReadOnly'],_0x5d7495=new AIChatContextItemButtonView(this['locale'],_0x4585ec,_0x3180c6,_0x3a26f9,_0x15aff8);return _0x3180c6||_0x5d7495['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x5d7495['id']);}),_0x5d7495;}['_addContextToCollection'](_0x46fb71,_0x320505){_0x320505['add'](_0x46fb71,0x0);}['_removeContextFromCollection'](_0x37db7b,_0x37259b){const _0x896c53=_0x37259b['find'](_0x52748a=>_0x52748a['id']===_0x37db7b);_0x896c53&&_0x37259b['remove'](_0x896c53);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':kn}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x509446){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x509446);}}class SourcesBalloonButtonView extends vt{['arrowView'];constructor(_0x245200){super(_0x245200),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Tn]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x369e23=new xt();return _0x369e23['content']=_0x3edc81,_0x369e23['extendTemplate']({'attributes':{'class':Tn+'__arrow'}}),_0x369e23;}}class AIChatControlsLoaderView extends Nt{['_cancelButtonView'];['_loaderView'];constructor(_0x179b1d){super(_0x179b1d),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 _0x41779f=new vt(this['locale']);return _0x41779f['set']({'label':Hi(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':Ui+'\x20ck-ai-button-stop-generating','icon':_0xdb5f07}),_0x41779f['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x41779f;}['_createLoaderView'](){const _0x4e7c52=new Nt(this['locale']);return _0x4e7c52['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':Hi(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x4e7c52;}}class AIChatControlsView extends Nt{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x5684be,_0x507cff){super(_0x5684be),this['_contextPanelView']=this['_createContextPanelView'](_0x5684be,{'bodyCollection':_0x507cff['bodyCollection'],'searchInputVisibleFrom':_0x507cff['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x5684be),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x5684be),this['_loaderView']=this['_createLoaderView'](_0x5684be),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x5684be),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'](...An)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x1ca4c2=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x1ca4c2['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x1ca4c2['if']('isLoading','ck-hidden',_0x224e33=>_0x224e33||!this['isModelAvailable']),_0x1ca4c2['if']('isModelAvailable','ck-hidden',_0x1d0b40=>!_0x1d0b40||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x1ca4c2['if']('isLoading','ck-hidden',_0xb2e55c=>!_0xb2e55c)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x1ca4c2['if']('isModelAvailable','ck-hidden',_0x62bf98=>_0x62bf98)]},'children':[this['_modelUnavailableMessageView']]}]}),zt({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x522788,_0x6f5334){return new AIChatContextPanelView(_0x522788,_0x6f5334);}['_createPromptInputView'](_0x1b2398){return new AIChatPromptInputView(_0x1b2398,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x23501a){return new AIChatPromptCapabilitiesView(_0x23501a);}['_createLoaderView'](_0x1283be){return new AIChatControlsLoaderView(_0x1283be);}['_createModelUnavailableMessageView'](_0x4a854d){const _0x2dc084=new AIChatModelUnavailableMessageView(_0x4a854d);return _0x2dc084['delegate']('startConversation')['to'](this),_0x2dc084;}['_handlePromptInputFocus'](_0x35c0a2,_0x4b9253,_0x3eda7d){_0x3eda7d?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x1d2690,_0x41da4d){this['_contextPanelView']['addContextItem'](_0x1d2690,_0x41da4d);}['removeContextItem'](_0x3e910f){this['_contextPanelView']['removeContextItem'](_0x3e910f);}['setContextItemLoading'](_0x55a999,_0x11b7f9){this['_contextPanelView']['setContextItemLoading'](_0x55a999,_0x11b7f9);}['setIsUploadInProgress'](_0x358467){this['_promptInputView']['setIsUploadInProgress'](_0x358467);}['setConversationContext'](_0xf4d99f){this['_contextPanelView']['setConversationContext'](_0xf4d99f);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x24474a,_0x476f7a,_0x3cf87a){this['_contextPanelView']['updateResourceState'](_0x24474a,_0x476f7a,_0x3cf87a);}['setWebSearch'](_0x5ba702){this['_promptCapabilitiesView']['setWebSearch'](_0x5ba702);}['setReasoning'](_0x11c851){this['_promptCapabilitiesView']['setReasoning'](_0x11c851);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x3a216a){this['_contextPanelView']['setAddContextOptions'](_0x3a216a);}['setInputPlaceholder'](_0x5e9fd7){this['_promptInputView']['setPlaceholderText'](_0x5e9fd7);}['setModelList'](_0x17178d,_0x19021d){this['_promptCapabilitiesView']['setModelList'](_0x17178d,_0x19021d);}['setModel'](_0x304ee7){_0x304ee7?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x304ee7)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x2ff1e4){this['_promptCapabilitiesView']['disableModelSelector'](_0x2ff1e4);}['populateSourceResourceBalloon'](_0x1edd25,_0x491ebf,_0x27533d,_0x1d5fc1){this['_contextPanelView']['populateSourceResourceBalloon'](_0x1edd25,_0x491ebf,_0x27533d,_0x1d5fc1);}['closeSourceResourceBalloon'](_0x3cf068){this['_contextPanelView']['closeSourceResourceBalloon'](_0x3cf068);}['focusPromptInput'](_0xf438ea=!0x1){this['_promptInputView']['focus'](_0xf438ea);}['setPromptInputValue'](_0x199125){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x199125;}}class AIChatModelUnavailableMessageView extends Nt{constructor(_0x4a03c8){super(_0x4a03c8);const _0x2d5ee5=new vt(_0x4a03c8);_0x2d5ee5['set']({'label':Hi(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x2d5ee5['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':Hi(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x2d5ee5]}]});}}class AIHeaderView extends _0x4c3dd1{['resizeButton'];constructor(_0x1da2f3,_0x5c27c6){super(_0x1da2f3,{'label':_0x5c27c6['label'],'class':'ck-ai-header\x20'+_0x5c27c6['class'],'icon':_0x5c27c6['icon']}),this['set']('isMaximized',!0x1),_0x5c27c6['content']&&this['children']['add'](_0x5c27c6['content']),_0x5c27c6['showResizeButton']&&(this['resizeButton']=Gi(_0x1da2f3,this),this['children']['add'](this['resizeButton']));}}class AIDisclaimerView extends Nt{constructor(_0x410403){super(_0x410403),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':Hi(_0x410403,'AI_DISCLAIMER_TEXT')}]}]});}}function vn(_0x228b0b,_0x5da903){const _0x435c7c=new vt(_0x228b0b);return _0x435c7c['set']({'label':Hi(_0x228b0b,'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x40c6c9,'class':'ck-ai-chat__start-conversation\x20'+Ui}),_0x435c7c['on']('execute',()=>{_0x5da903['fire']('startConversation');}),_0x435c7c;}class AIChatView extends Nt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x131892,_0x4659a3){super(_0x131892),this['_bodyCollection']=new Qt(_0x131892),this['_bodyCollection']['attachToDom']();const _0xbe0632=vn(_0x131892,this);this['chatHeader']=new AIHeaderView(_0x131892,{'label':Hi(_0x131892,'AI_CHAT_HEADING'),'icon':_0x24024f,'class':'ck-ai-header_chat','content':_0xbe0632,'showResizeButton':_0x4659a3['showResizeButton']}),this['chatHeader']['delegate']('resizeTabs')['to'](this),this['chatFeed']=new AIChatFeedView(_0x131892,this['_bodyCollection']),this['chatFeed']['delegate'](...ms)['to'](this),this['chatControls']=new AIChatControlsView(_0x131892,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x4659a3['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...ms)['to'](this),this['chatDisclaimer']=new AIDisclaimerView(_0x131892),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x131892['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x19ecd9,_0x38b5f9,_0x4f355a,_0x716e04){this['chatControls']['populateSourceResourceBalloon'](_0x19ecd9,_0x38b5f9,_0x4f355a,_0x716e04);}['closeSourceResourceBalloon'](_0x2efe56){this['chatControls']['closeSourceResourceBalloon'](_0x2efe56);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class AIChatUI extends _0x3cc0e4{static get['requires'](){return[AITabs];}['_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(_0x4f385e){super(_0x4f385e);const _0x2a9808=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new PromiseQueue(),this['_view']=new AIChatView(this['context']['locale'],{'showResizeButton':_0x2a9808['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate']('resizeTabs')['to'](_0x2a9808),this['_view']['delegate'](...ms)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x4d734b,{showDiff:_0x23f73d})=>{this['showDiff']=_0x23f73d;}),_0x2a9808['view']['addTab']({'id':'chat','buttonLabel':Hi(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x24024f,'order':0x0,'content':this['_view']}),this['_view']['chatHeader']['bind']('isMaximized')['to'](_0x2a9808['view'],'isMaximized',_0x5d5fc6=>_0x5d5fc6),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x5d5e33=>_0x5d5e33),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x349f74){const _0x325bd1=this['context']['config']['get']('ai.chat.welcomeMessage')??Hi(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x349f74['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x325bd1}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0x4a6340,staticMessage:_0x12a8a3}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x4a6340,'initialContent':'<p>'+_0x12a8a3+'</p>'});});}async['addFeedItemUserMessage'](_0x5d5738){const _0x5d30d5=_0x5d5738['attributes']?.['displayedPrompt']||_0x5d5738['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x5d5738['contextItems']['values']()),'initialContent':'<p>'+_0x5d30d5+'</p>','id':_0x5d5738['id']});});}async['addFeedItemError']({errorMessage:_0x2e2c8f,id:_0x144d7d}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x2e2c8f+'</p>','id':_0x144d7d});});}async['addFeedItemAIReply'](_0x38dc2a){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x38dc2a['interactionId']+':'+_0x38dc2a['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x3b6f1c){const _0x381322=ds(this['context']);let _0x47e5f9=_0x381322['config']['get']('ai.availableReplyActions')||[...bs];if(_0x381322['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x211b3d=_0x381322['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x211b3d,'value');}}else _0x47e5f9=_0x47e5f9['filter'](_0x314a8e=>'insertSuggestion'!=_0x314a8e);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x3b6f1c['interactionId']+':'+_0x3b6f1c['id'],'areActionsDisabled':_0x3b6f1c['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x47e5f9}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0x522e15,_0x27bbab){return this['_promiseQueue']['enqueue'](async()=>{const _0x546594=this['_view']['chatFeed']['children']['last'];if(_0x546594 instanceof AIChatFeedInteractionHeaderView)return this['_view']['chatFeed']['children']['remove'](_0x546594),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x522e15['id'],'capabilities':{'isWebSearchEnabled':_0x546594['capabilities']['isWebSearchEnabled']||_0x27bbab['isWebSearchEnabled'],'isReasoningEnabled':_0x546594['capabilities']['isReasoningEnabled']||_0x27bbab['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x522e15['id'],'capabilities':_0x27bbab});});}async['addFeedItemCustomElement'](_0x6f85e8,_0x125f12){let _0x32d3b6;return await this['_promiseQueue']['enqueue'](async()=>{_0x32d3b6=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x6f85e8,'id':_0x125f12});}),_0x32d3b6;}['removeFeedItem'](_0x521925){this['_view']['chatFeed']['removeItem'](_0x521925);}['hasFeedItem'](_0x134475){return this['_view']['chatFeed']['hasItem'](_0x134475);}['updateFeedInteractionHeader'](_0x2c501a){const _0x2e7847=this['_view']['chatFeed']['children']['find'](_0x1c273d=>_0x1c273d['options']['id']==_0x2c501a['id']&&_0x1c273d instanceof AIChatFeedInteractionHeaderView);_0x2e7847&&_0x2e7847['set']('isVisible',_0x2c501a['isVisible']);}async['updateFeedItemAIReplyContent'](_0x162e53){const _0x30c933=_0x162e53['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x1d896d=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x162e53,'abortSignal':_0x1d896d,'renderingStrategy':_0x30c933}),_0x162e53['isDone']&&this['markFeedItemAsDone'](_0x162e53['id']);});}['updateFeedItemAIReplySources'](_0x594ce2,_0x4539c1){this['_view']['chatFeed']['updateWebSources'](_0x594ce2,_0x4539c1);}async['updateFeedItemAIReplySuggestionContent'](_0x47b7d3){return this['_promiseQueue']['enqueue'](async _0x3aadcf=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x47b7d3,'abortSignal':_0x3aadcf}),_0x47b7d3['isDone']&&this['markFeedItemAsDone'](_0x47b7d3['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x10af50){this['_view']['chatFeed']['updateSuggestionPartState'](_0x10af50);}['setFeedItemAIReplySuggestionPartActive'](_0x581abf){this['_view']['chatFeed']['setSuggestionPartActive'](_0x581abf);}['markFeedItemAsDone'](_0xd4d169){this['_view']['chatFeed']['markItemAsDone'](_0xd4d169);}['removeFeedInteraction'](_0x49da1c){this['_view']['chatFeed']['getItemIds']()['filter'](_0x1a3414=>_0x1a3414['startsWith'](_0x49da1c))['forEach'](_0x1f9f5b=>this['_view']['chatFeed']['removeItem'](_0x1f9f5b));}['startInteraction'](){const _0x33429d=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x33429d),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x5b3ce9){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x438f76=>_0x438f76['startsWith'](_0x5b3ce9['id']))['forEach'](_0x2962a5=>this['markFeedItemAsDone'](_0x2962a5)),this['isBusy']=!0x1,this['clearLoadingMessage'](),this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['clearLoadingMessage'](),this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x56700f,_0x3c58da){this['_view']['chatControls']['addContextItem'](_0x56700f,_0x3c58da);}['removeContextItem'](_0x6a0757){this['_view']['chatControls']['removeContextItem'](_0x6a0757);}['setContextItemLoading'](_0x5d0a5d,_0xa4cb7){this['_view']['chatControls']['setContextItemLoading'](_0x5d0a5d,_0xa4cb7);}['setIsUploadInProgress'](_0x233e1a){this['_view']['chatControls']['setIsUploadInProgress'](_0x233e1a);}['setConversationContext'](_0x30aec8){this['_view']['chatControls']['setConversationContext'](_0x30aec8);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x2a175d,_0x12b7ea,_0x2bcc6b){this['_view']['chatControls']['updateResourceState'](_0x2a175d,_0x12b7ea,_0x2bcc6b);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x3d7cd9){this['_view']['chatControls']['setAddContextOptions'](_0x3d7cd9);}['updateCapabilities'](_0x5b14bf){this['_view']['chatControls']['setWebSearch'](_0x5b14bf['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x5b14bf['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x5b14bf));}['setSelectedModel'](_0x2e7819,_0x26ed0b){this['_view']['chatControls']['setModel'](_0x2e7819),_0x26ed0b&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x5822a5){this['feedItemRenderingStrategy']=_0x5822a5;}['toggleLoadingSkeleton'](_0x8dba2c){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x8dba2c);}['resetConversationTitle'](){this['setConversationTitle'](Hi(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x4292a7,_0x44aad1=!0x1){if(_0x44aad1&&!Rt()&&_0x4292a7['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x4292a7);this['_view']['chatHeader']['label']=_0x4292a7;}['setLoadingMessage'](_0x3310e9){this['_view']['chatFeed']['setLoadingMessage'](_0x3310e9);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x18b6ba){let _0x260a6e=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x18b6ba[_0x260a6e],_0x260a6e++,_0x260a6e===_0x18b6ba['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['prepareLoadingMessage'](_0x203bc5){return _0x203bc5['isWebSearchEnabled']&&_0x203bc5['isReasoningEnabled']?Hi(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x203bc5['isWebSearchEnabled']?Hi(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x203bc5['isReasoningEnabled']?Hi(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):Hi(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x437f2a){return _0x437f2a?_0x437f2a['isWebSearchEnabled']&&_0x437f2a['isReasoningEnabled']?Hi(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x437f2a['isWebSearchEnabled']?Hi(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x437f2a['isReasoningEnabled']?Hi(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):Hi(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):Hi(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x5ce677,_0x29e1e2,_0x4c2256,_0x29d82c){this['_view']['populateSourceResourceBalloon'](_0x5ce677,_0x29e1e2,_0x4c2256,_0x29d82c);}['closeSourceResourceBalloon'](_0x3b54f0){this['_view']['closeSourceResourceBalloon'](_0x3b54f0);}['setPromptInputValue'](_0x2b2369){this['_view']['chatControls']['setPromptInputValue'](_0x2b2369);}['focusPromptInput'](_0x3f76e2=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x3f76e2);}['scrollFeedToSuggestion'](_0x29be9e,_0x4ca2a2){this['_view']['chatFeed']['scrollToSuggestion'](_0x29be9e,_0x4ca2a2);}['startAutoScroll'](_0x34945b={}){this['_view']['chatFeed']['startAutoScroll'](_0x34945b);}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class AIChatHistorySectionListView extends Dt{['sections'];constructor(_0x2806a8,_0x6e57e3){super(_0x2806a8),this['sections']=_0x6e57e3,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x5c9b0f){let _0x49b878=0x0,_0x31649f=0x0;for(const _0x14b917 of this['sections']){const {resultsCount:_0x4dc689,totalItemsCount:_0x20d056}=_0x14b917['filter'](_0x5c9b0f);_0x49b878+=_0x4dc689,_0x31649f+=_0x20d056;}return{'resultsCount':_0x49b878,'totalItemsCount':_0x31649f};}}class AIChatHistoryListView extends Pt{['title'];['itemsViews'];['_itemsListView'];constructor(_0x1150c1,{title:_0x21ed95,items:_0x56ca1d}){super(_0x1150c1);const _0x184799=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x21ed95,this['itemsViews']=_0x56ca1d;const _0x10ffce=new Nt(_0x1150c1);_0x10ffce['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Dt(_0x1150c1),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x184799['if']('isVisible','ck-hidden',_0x1f5bac=>!_0x1f5bac)]},'children':[_0x10ffce,this['_itemsListView']]});}['filter'](_0x4e286a){const _0x5d9f7c=this['itemsViews']['length'];let _0x54ce27=0x0;for(const _0xb32f33 of this['itemsViews']){if(_0x4e286a){const _0xf0ffb4=_0xb32f33['isMatching'](_0x4e286a);_0xb32f33['isVisible']=!!_0xf0ffb4,_0xb32f33['highlightText'](_0x4e286a);}else _0xb32f33['isVisible']=!0x0,_0xb32f33['highlightText'](null);_0xb32f33['isVisible']&&_0x54ce27++;}return this['isVisible']=_0x54ce27>0x0,{'resultsCount':_0x54ce27,'totalItemsCount':_0x5d9f7c};}['getItem'](_0x3fed09){return this['itemsViews']['find'](_0x443100=>_0x443100['id']===_0x3fed09);}['removeItem'](_0x25bbdc){const _0x2eeb76=this['itemsViews']['indexOf'](_0x25bbdc);-0x1!==_0x2eeb76&&(this['itemsViews']['splice'](_0x2eeb76,0x1),this['_itemsListView']['items']['remove'](_0x25bbdc));}}class AIChatHistoryListItemView extends/* #__PURE__ -- @preserve */
|
|
27
|
-
_0x9830fd(Pt){['id'];static ['LOADING_LABELS']={'remove':'AI_CHAT_HISTORY_LOADING_REMOVING','rename':'AI_CHAT_HISTORY_LOADING_RENAMING','pin':'AI_CHAT_HISTORY_LOADING_PINNING','unpin':'AI_CHAT_HISTORY_LOADING_UNPINNING'};['actions'];['mainContent'];['_titleView'];constructor(_0x4991d5,_0x5e9ee4){super(_0x4991d5);const _0x285163=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x5e9ee4['pinned']),this['set']('loadingState',null),this['set']('title',_0x5e9ee4['title']),this['id']=_0x5e9ee4['id'];const {createdAt:_0x1a14a9,active:_0x33d618=!0x1}=_0x5e9ee4;this['_titleView']=new _0x378b1f(),this['_titleView']['bind']('text')['to'](this,'title',t=>_0x2d9792(t||'')),this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x115ee2=this['_createCheckView'](),_0x7486b2=this['_createPinButtonView'](_0x4991d5),_0x14eeed=this['_createMenuDropdownView'](),_0x48eb05=this['_createEditInputView'](_0x4991d5),_0x464b9c=this['_createAcceptEditButtonView'](_0x4991d5,_0x48eb05),_0x592058=this['_createCancelEditButtonView'](_0x4991d5);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x7486b2),this['actions']['add'](_0x14eeed),this['on']('change:isEdit',(_0x122e33,_0x1962a1,_0x46158c)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x46158c?(this['actions']['add'](_0x464b9c),this['actions']['add'](_0x592058),this['mainContent']['add'](_0x48eb05),_0x48eb05['element']['value']=this['title']||'',_0x48eb05['element']['focus']()):(this['actions']['add'](_0x7486b2),this['actions']['add'](_0x14eeed),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x33d618?'ck-ai-chat-history__item--active':'',_0x285163['if']('isVisible','ck-hidden',_0xfde7=>!_0xfde7),_0x285163['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',_0x285163['if']('loadingState','ck-hidden',_0x2dcf40=>!!_0x2dcf40)]},'children':_0x33d618?[_0x115ee2]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x285163['if']('loadingState','ck-hidden',_0x31401c=>!_0x31401c)]},'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-container',_0x285163['if']('loadingState','ck-hidden',_0x308646=>!!_0x308646)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x285163['if']('loadingState','ck-hidden',_0x520809=>!_0x520809)]},'children':[{'text':_0x285163['to']('loadingState',_0x54ea79=>_0x54ea79?Hi(this['locale'],AIChatHistoryListItemView['LOADING_LABELS'][_0x54ea79]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x1a14a9]}]},{'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'](_0x516aaa){this['set']('title',_0x516aaa);}['updateLoadingState'](_0x2ff468,_0x3f13e7){this['set']('loadingState',_0x3f13e7?_0x2ff468:null);}['_createCheckView'](){const _0x362e77=new xt();return _0x362e77['set']({'content':_0x489882}),_0x362e77;}['_createPinButtonView'](_0x183e30){const _0x213fd9=new vt(_0x183e30);return _0x213fd9['set']({'label':Hi(_0x183e30,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x321a25,'withText':!0x1,'tooltip':!0x0}),_0x213fd9['bind']('isOn')['to'](this,'pinned'),_0x213fd9['on']('execute',()=>{const _0xfc89a6=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0xfc89a6});}),_0x213fd9;}['_createMenuDropdownView'](){const _0x381fb5=Gt(this['locale']),_0x97879a=_0x381fb5['panelView']['children'];_0x381fb5['buttonView']['set']({'label':Hi(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x3c4511}),_0x381fb5['panelPosition']='sw';const _0x59e4fa=new vt(this['locale']);_0x59e4fa['label']=Hi(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x59e4fa['withText']=!0x0,_0x59e4fa['on']('execute',()=>{this['isEdit']=!0x0;});const _0x519e57=new vt(this['locale']);_0x519e57['label']=Hi(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x519e57['withText']=!0x0,_0x519e57['on']('execute',()=>{this['showConfirm'](Hi(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x200f5e=new Dt(this['locale']),_0x350dff=new Pt(this['locale']);_0x350dff['children']['add'](_0x59e4fa);const _0x47c343=new Pt(this['locale']);return _0x47c343['children']['add'](_0x519e57),_0x200f5e['items']['addMany']([_0x350dff,_0x47c343]),_0x97879a['add'](_0x200f5e),_0x381fb5;}['_createEditInputView'](_0x13c991){const _0x2af655=new _0x5ecc48(_0x13c991),_0x8b7901=_0x2af655['bindTemplate'];return _0x2af655['extendTemplate']({'on':{'keydown':_0x8b7901['to'](_0x229734=>{'Enter'==_0x229734['key']&&this['_commitEditInputValue'](_0x2af655);})}}),_0x2af655;}['_createAcceptEditButtonView'](_0x54d6f5,_0x3a06ee){const _0x22cc20=new vt(_0x54d6f5);return _0x22cc20['set']({'icon':_0x489882,'withText':!0x1,'tooltip':Hi(_0x54d6f5,'AI_CHAT_HISTORY_ACCEPT')}),_0x22cc20['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x22cc20['on']('execute',()=>{this['_commitEditInputValue'](_0x3a06ee);}),_0x22cc20;}['_commitEditInputValue'](_0x4420bd){const _0x33741d=_0x4420bd['element']['value']||'';this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x33741d});}['_createCancelEditButtonView'](_0x539384){const _0x22d482=new vt(_0x539384);return _0x22d482['set']({'icon':_0x5777e9,'withText':!0x1,'tooltip':Hi(_0x539384,'AI_CHAT_HISTORY_CANCEL')}),_0x22d482['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x22d482['on']('execute',()=>{this['isEdit']=!0x1,this['fire']('edit:cancel');}),_0x22d482;}['_createSpinnerView'](){const _0x3c84e3=new AISpinnerView('tiny');return _0x3c84e3['isVisible']=!0x0,_0x3c84e3;}['isMatching'](_0xb3953c){return'string'==typeof this['title']&&this['title']['match'](_0xb3953c)?{'title':!0x0}:null;}['highlightText'](_0x277ce1){this['_titleView']['highlightText'](_0x277ce1);}}class AIChatHistoryView extends Nt{['headerView'];['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];constructor(_0x2cf24b,_0x3211a9){super(_0x2cf24b),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x412cd=vn(_0x2cf24b,this);this['headerView']=new AIHeaderView(_0x2cf24b,{'label':Hi(_0x2cf24b,'AI_CHAT_HISTORY_HEADING'),'icon':_0x33c29f,'class':'ck-ai-header_history','content':_0x412cd,'showResizeButton':_0x3211a9}),this['headerView']['delegate']('resizeTabs')['to'](this),this['sectionsView']=new AIChatHistorySectionListView(_0x2cf24b,[]),this['sectionsView']['delegate'](...Nn)['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',_0x584e49=>!_0x584e49)]}}),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':[this['headerView'],{'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 _0x1593b9=new _0x29d55b(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':Hi(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x137866=>Hi(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x137866),'secondary':Hi(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x398e50=this['_createErrorView']();return _0x398e50['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x2e929b=>!_0x2e929b)]}}),_0x1593b9['on']('render',()=>{_0x1593b9['children']['add'](_0x398e50,0x1);}),_0x1593b9['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0xcdf1cd=>!_0xcdf1cd)]}}),_0x1593b9;}['_createSkeletonView'](){const _0x4075ce=new AISkeletonView(this['locale'],Ss['aiHistory']);return _0x4075ce['bind']('isVisible')['to'](this,'isLoading'),_0x4075ce;}['_createErrorView'](){const _0x4c5bce=new Nt(this['locale']),_0x162080=new vt(this['locale']);_0x162080['set']({'withText':!0x1,'icon':_0x5777e9,'class':'ck-ai-notification_error__dismiss-button'}),_0x162080['bind']('isVisible')['to'](this,'hasItems',_0x43e966=>!!_0x43e966),_0x162080['on']('execute',()=>{this['errorMessage']='';});const _0x13b7b8=this['bindTemplate'];return _0x4c5bce['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x13b7b8['to']('errorMessage')}]},_0x162080]}),_0x4c5bce;}['_createEmptyStateView'](){const _0x54d724=new Nt(this['locale']);return _0x54d724['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x48547f=>!_0x48547f)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[Hi(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]}]}),_0x54d724;}['_createListItemViews'](_0x4f75d2,_0xea4027){const _0x213a5a=[];for(const _0x1d5b14 of _0x4f75d2){const _0x5ab0f8=new AIChatHistoryListItemView(_0xea4027,_0x1d5b14);_0x5ab0f8['delegate'](...Nn)['to'](this),_0x213a5a['push'](_0x5ab0f8);}return _0x213a5a;}['updateHistoryItemsWithCategories'](_0x555194){const _0x5d4e73=this['locale']||'en',_0x2d2b34=[];for(const _0x294894 of _0x555194){const _0x5871e0=this['_createListItemViews'](_0x294894['items'],_0x5d4e73);_0x2d2b34['push'](new AIChatHistoryListView(_0x5d4e73,{'title':_0x294894['title'],'items':_0x5871e0}));}this['sectionsView']['sections']=_0x2d2b34,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x2d2b34),this['hasItems']=_0x555194['some'](_0xf01ba8=>_0xf01ba8['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x5b5399){for(const _0x208e48 of this['sectionsView']['sections']){const _0x491147=_0x208e48['getItem'](_0x5b5399);if(_0x491147){if(_0x208e48['removeItem'](_0x491147),0x0===_0x208e48['itemsViews']['length']){const _0x5ed90e=this['sectionsView']['sections']['indexOf'](_0x208e48);-0x1!==_0x5ed90e&&(this['sectionsView']['sections']['splice'](_0x5ed90e,0x1),this['sectionsView']['items']['remove'](_0x208e48));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x430cb5,_0xf785ab){for(const _0x3f18ff of this['sectionsView']['sections']){const _0xf8960e=_0x3f18ff['getItem'](_0x430cb5);if(_0xf8960e){_0xf8960e['updateTitle'](_0xf785ab);break;}}}['updateItemLoadingState'](_0x6a6327,_0x49b4bb,_0x3a0b80){for(const _0x3aab2c of this['sectionsView']['sections']){const _0x27763e=_0x3aab2c['getItem'](_0x6a6327);if(_0x27763e){_0x27763e['updateLoadingState'](_0x49b4bb,_0x3a0b80);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x33c935=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x33c935);}}}const Nn=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','startConversation'];class AIChatHistoryUI extends _0x3cc0e4{static get['requires'](){return[AITabs];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5bd93c){super(_0x5bd93c);const _0x414b97=this['context']['plugins']['get']('AITabs');this['_historyView']=new AIChatHistoryView(this['context']['locale'],_0x414b97['showResizeButton']),this['_historyView']['delegate']('resizeTabs')['to'](_0x414b97),this['_historyView']['delegate'](...Nn)['to'](this),this['_historyView']['headerView']['bind']('isMaximized')['to'](_0x414b97['view'],'isMaximized',_0x5a539f=>_0x5a539f),_0x414b97['view']['addTab']({'id':'history','buttonLabel':Hi(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x33c29f,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x7ede1c){this['_historyView']['removeHistoryItem'](_0x7ede1c);}['updateItems'](_0x2da1fd){this['_historyView']['updateHistoryItemsWithCategories'](_0x2da1fd);}['updateItemTitle'](_0x3567e9,_0x37de61){this['_historyView']['updateItemTitle'](_0x3567e9,_0x37de61);}['updateItemLoadingState'](_0xd6bf9,_0xf165ea,_0x24cff5){this['_historyView']['updateItemLoadingState'](_0xd6bf9,_0xf165ea,_0x24cff5);}['setLoadingSkeleton'](_0x5a357f){this['_historyView']['isLoading']=_0x5a357f;}['showError'](_0x5018a6){this['_historyView']['errorMessage']=_0x5018a6;}['hideError'](){this['_historyView']['errorMessage']='';}}class AIChatHistoryItem extends ht(){['id'];['createdAt'];constructor({id:_0x3e2ad4,title:_0x2dc02e,createdAt:_0x5c170a,updatedAt:_0x115d4a,pinned:_0x309305}){super(),this['id']=_0x3e2ad4,this['createdAt']=new Date(_0x5c170a),this['set']('title',_0x2dc02e),this['set']('updatedAt',_0x115d4a?new Date(_0x115d4a):null),this['set']('pinned',_0x309305||!0x1);}['updateTitle'](_0x33a588){this['set']('title',_0x33a588),this['updatedAt']=new Date();}['updatePinned'](_0x5c495f){this['set']('pinned',_0x5c495f),this['updatedAt']=new Date();}}class AIChatHistoryConversations extends Et(){['items']=[];['connector'];['group'];constructor({connector:_0x1df393,group:_0x14e7be}){super(),this['connector']=_0x1df393,this['group']=_0x14e7be;}async['init'](){try{const _0x20ed50=this['connector']['fetchConversations'](this['group']),_0x52d9b2=await _0x20ed50['getConversations']();this['loadItems'](_0x52d9b2);}catch(_0x11a1f9){this['fire']('error',{'error':_0x11a1f9,'operation':'init'});}}['addItem'](_0x5eddff){this['items']['push'](_0x5eddff);}async['removeItem'](_0x5c7b7f){const _0x3f398a=this['items']['findIndex'](_0x23aee9=>_0x23aee9['id']===_0x5c7b7f);if(-0x1===_0x3f398a)return!0x1;try{return await this['connector']['deleteConversation'](_0x5c7b7f)['execute'](),this['items']['splice'](_0x3f398a,0x1),this['fire']('itemRemoved',{'itemId':_0x5c7b7f}),!0x0;}catch(_0x3236ff){return this['fire']('error',{'error':_0x3236ff,'operation':'removeItem','itemId':_0x5c7b7f}),!0x1;}}['getItem'](_0x291a4a){return this['items']['find'](_0x499388=>_0x499388['id']===_0x291a4a);}async['updateItemTitle'](_0x56143b,_0x119aa4){const _0x2a0a1b=this['getItem'](_0x56143b);if(!_0x2a0a1b)return!0x1;try{return await this['connector']['updateConversation'](_0x56143b,{'title':_0x119aa4})['getResult'](),_0x2a0a1b['updateTitle'](_0x119aa4),this['fire']('itemUpdated',{'itemId':_0x56143b,'updates':{'title':_0x119aa4}}),!0x0;}catch(_0x3fed60){return this['fire']('error',{'error':_0x3fed60,'operation':'updateItemTitle','itemId':_0x56143b}),!0x1;}}async['updateItemPinned'](_0x99d8e5,_0x1f68fd){const _0x4f9bdd=this['getItem'](_0x99d8e5);if(!_0x4f9bdd)return!0x1;try{return await this['connector']['updateConversation'](_0x99d8e5,{'pinned':_0x1f68fd})['getResult'](),_0x4f9bdd['updatePinned'](_0x1f68fd),this['fire']('itemUpdated',{'itemId':_0x99d8e5,'updates':{'pinned':_0x1f68fd}}),!0x0;}catch(_0x487975){return this['fire']('error',{'error':_0x487975,'operation':'updateItemPinned','itemId':_0x99d8e5}),!0x1;}}['loadItems'](_0x16acf9){try{this['items']=[],_0x16acf9['map'](_0x26ccba=>{this['addItem'](new AIChatHistoryItem(_0x26ccba));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0xf6be52){this['fire']('error',{'error':_0xf6be52,'operation':'loadItems'});}}['getItems'](_0x1808f4={}){const _0x1cbff6=void 0x0!==_0x1808f4['pinned']&&_0x1808f4['pinned'],_0x38a428=_0x1808f4['from']?new Date(_0x1808f4['from']['getFullYear'](),_0x1808f4['from']['getMonth'](),_0x1808f4['from']['getDate']()):null,_0x43ffd3=_0x1808f4['to']?new Date(_0x1808f4['to']['getFullYear'](),_0x1808f4['to']['getMonth'](),_0x1808f4['to']['getDate']()):null;return this['items']['filter'](_0x223f29=>{if(_0x223f29['pinned']!==_0x1cbff6)return!0x1;if(_0x43ffd3){const _0x51e6ac=new Date(_0x223f29['createdAt']['getFullYear'](),_0x223f29['createdAt']['getMonth'](),_0x223f29['createdAt']['getDate']());return _0x38a428?_0x38a428['getTime']()===_0x43ffd3['getTime']()?_0x51e6ac['getTime']()===_0x38a428['getTime']():_0x51e6ac<_0x43ffd3&&_0x51e6ac>=_0x38a428:_0x51e6ac<_0x43ffd3;}return!0x0;});}}class AIChatHistoryController extends _0x3cc0e4{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[AIConnector,AIChatController,AIChatHistoryUI,AITabs];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](AIConnector),this['_aiChatHistoryUi']=this['context']['plugins']['get'](AIChatHistoryUI),this['_aiChatController']=this['context']['plugins']['get'](AIChatController);const _0x4d2806=this['context']['plugins']['get'](AITabs);try{const _0x15f7ab=this['_aiChatController']['getGroupId']();this['history']=new AIChatHistoryConversations({'connector':this['_aiConnector'],'group':_0x15f7ab}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x2e1ae9,_0x27ac1e)=>{this['_setItemLoading'](_0x27ac1e['id'],'remove'),this['_handleRemove'](_0x27ac1e['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x221f87,_0x438134)=>{this['_setItemLoading'](_0x438134['id'],'rename'),this['_handleEditTitle'](_0x438134['id'],_0x438134['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x47b97f,_0x1600ae)=>{void 0x0!==_0x1600ae['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x1600ae['itemId'],_0x1600ae['updates']['title']),void 0x0!==_0x1600ae['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x1600ae['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x42d4db,_0x258d3e)=>{this['_aiChatController']['_handleRemovedConversation'](_0x258d3e['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x258d3e['itemId']),this['_clearItemLoading'](_0x258d3e['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x3b0308,_0x3955d5)=>{this['_handleHistoryErrorUI'](_0x3955d5['error'],_0x3955d5['operation'],_0x3955d5['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x5bb21c,_0x24eaaa)=>{this['_handleSelectConversation'](_0x24eaaa['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x1c8fbb,_0x386479)=>{const _0x32706d=_0x386479['pinned']?'pin':'unpin';this['_setItemLoading'](_0x386479['id'],_0x32706d),this['_handleTogglePin'](_0x386479['id'],_0x386479['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'startConversation',()=>{this['_aiChatController']['startConversation'](),_0x4d2806['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x4d2806['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();});}catch(_0x4336d9){this['_handleHistoryErrorUI'](_0x4336d9,'init');}}async['_handleEditTitle'](_0x1aea51,_0x2dd1df){await this['history']['updateItemTitle'](_0x1aea51,_0x2dd1df);}async['_handleTogglePin'](_0x412019,_0x34bda1){await this['history']['updateItemPinned'](_0x412019,_0x34bda1);}async['_handleRemove'](_0x3bd9fa){await this['history']['removeItem'](_0x3bd9fa);}async['_handleSelectConversation'](_0x2d9517){await this['_aiChatController']['loadConversation'](_0x2d9517);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x131ef8=this['_aiChatController']['activeConversation']?.['id'],_0x42678e=this['_getCategorizedItems']()['map'](_0x57cdf8=>({'title':_0x57cdf8['title'],'items':_0x57cdf8['items']['map'](_0x1f16a7=>({'id':_0x1f16a7['id'],'title':_0x1f16a7['title']||Hi(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x1f16a7['createdAt'])['toLocaleDateString'](),'active':_0x1f16a7['id']===_0x131ef8,'pinned':_0x1f16a7['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x42678e);}['_setItemLoading'](_0x4add8c,_0x5d25c2){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x4add8c,_0x5d25c2,!0x0);}['_clearItemLoading'](_0x7facce){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x7facce,null,!0x1);}['_handleHistoryErrorUI'](_0x38c9b8,_0x197406,_0x533c0d){const _0x588451=this['_generateErrorMessage'](_0x197406,_0x533c0d);this['_aiChatHistoryUi']['showError'](_0x588451),_0x533c0d&&this['_clearItemLoading'](_0x533c0d),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x2e93e8,_0x500fd4){const _0x5c002a=_0x500fd4?this['history']['getItem'](_0x500fd4):null,_0x407039=_0x5c002a?.['title']||Hi(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x2e93e8){case'updateItemTitle':return Hi(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x407039);case'updateItemPinned':{const _0x557ad0=Hi(this['context']['locale'],_0x5c002a?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return Hi(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x557ad0,_0x407039]);}case'removeItem':return Hi(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x407039);case'init':case'loadItems':return Hi(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return Hi(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x4a3c0f=new Date(),_0x237a3f=new Date(_0x4a3c0f['getFullYear'](),_0x4a3c0f['getMonth'](),_0x4a3c0f['getDate']()),_0x4e092f=new Date(_0x237a3f);_0x4e092f['setDate'](_0x4e092f['getDate']()-0x1);const _0x4ef42=new Date(_0x237a3f);_0x4ef42['setDate'](_0x4ef42['getDate']()-0xe);const _0x4992b2=this['history']['getItems']({'pinned':!0x0}),_0x1d2700=this['history']['getItems']({'from':_0x237a3f,'to':_0x237a3f}),_0x5a7b22=this['history']['getItems']({'from':_0x4e092f,'to':_0x4e092f}),_0x2d7b08=this['history']['getItems']({'from':_0x4ef42,'to':_0x4e092f}),_0x33688a=this['history']['getItems']({'to':_0x4ef42}),_0x475ca6=[];return _0x4992b2['length']>0x0&&_0x475ca6['push']({'title':Hi(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x4992b2}),_0x1d2700['length']>0x0&&_0x475ca6['push']({'title':Hi(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x1d2700}),_0x5a7b22['length']>0x0&&_0x475ca6['push']({'title':Hi(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x5a7b22}),_0x2d7b08['length']>0x0&&_0x475ca6['push']({'title':Hi(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x2d7b08}),_0x33688a['length']>0x0&&_0x475ca6['push']({'title':Hi(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x33688a}),_0x475ca6;}}class AIChatHistory extends _0x3cc0e4{static get['requires'](){return[AIChatHistoryController,AIChatHistoryUI];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class AIChat extends _0x3cc0e4{static get['requires'](){return[AIChatController,AIEditing,AIChatUI,AIChatHistory];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x482399){super(_0x482399),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[],'alwaysAddSelection':!0x1}),this['context']['config']['define']('ai.chat.initialConversation','new');}}class AIChatShortcutView extends vt{['id'];constructor(_0x27f0f7,_0x3af242){super(_0x27f0f7);const {id:_0x524906,type:_0x42292f,icon:_0xae49c5}=_0x3af242;this['id']=_0x524906,this['set']({'label':_0x3af242['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x3af242['id']}}),_0xae49c5?this['icon']=_0xae49c5:'chat'===_0x42292f?this['icon']=_0x24024f:'review'===_0x42292f?this['icon']=_0xc8a0b9:'translate'===_0x42292f&&(this['icon']=_0x31db4a);}}class AIChatShortcutsView extends Nt{['listView'];constructor(_0x392d11,_0x1862d9){super(_0x392d11);const _0x139563=_0x1862d9['map'](_0x54a3c0=>{const _0x3936fe=new Pt(this['locale']),_0xd6fea=new AIChatShortcutView(this['locale'],_0x54a3c0);return _0x3936fe['children']['add'](_0xd6fea),_0xd6fea['delegate']('execute')['to'](this),_0x3936fe;});this['listView']=new Dt(this['locale']),this['listView']['items']['addMany'](_0x139563),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const yn='chat-shortcuts';class AIChatShortcuts extends _0x3cc0e4{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[AIChatUI];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](AIChatUI),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x370275=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x370275['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x370275,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x4b41e7=['chat','review','translate'];this['_shortcuts']['forEach'](_0x5455e7=>{let _0x357686=!0x0;if(_0x5455e7['id']&&_0x5455e7['label']&&_0x4b41e7['includes'](_0x5455e7['type'])?'chat'===_0x5455e7['type']&&(_0x357686='string'==typeof _0x5455e7['prompt']):_0x357686=!0x1,!_0x357686)throw new at('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x5455e7});});}['_injectShortcuts'](){const _0x20ad89=this['context']['plugins']['get'](AIChatUI);this['_shortcutsView']=new AIChatShortcutsView(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x20ad89['addFeedItemCustomElement'](this['_shortcutsView']['element'],yn),this['_shortcutsView']['on']('execute',_0x3d02da=>{const _0xfb4d63=_0x3d02da['source']['id'];this['_executeShortcut'](_0xfb4d63);});}['_removeShortcuts'](){const _0x9bf284=this['context']['plugins']['get'](AIChatUI);_0x9bf284['hasFeedItem'](yn)&&_0x9bf284['removeFeedItem'](yn),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x17afc9){const _0x3a9587=this['_shortcuts']['find'](_0x22f496=>_0x22f496['id']===_0x17afc9),_0x3e5c34=_0x3a9587['type'];'chat'===_0x3e5c34?this['_runChatShortcut'](_0x3a9587):'review'===_0x3e5c34?_0x3a9587['commandId']?this['_runReviewShortcut'](_0x3a9587):this['_switchTab']('reviewMode'):'translate'===_0x3e5c34&&(_0x3a9587['language']?this['_runTranslateShortcut'](_0x3a9587):this['_switchTab']('translate'));}['_switchTab'](_0x50feed){if(!this['context']['plugins']['has']('AITabs'))throw new at('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x50feed});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x50feed);}async['_runChatShortcut']({prompt:_0x1cfc49,draftMode:_0xe1a8b7,useWebSearch:_0x298cec=!0x1,useReasoning:_0x427eb0=!0x1,model:_0x5eb3f7}){const _0x328933=this['context']['plugins']['get']('AIChatController'),_0x53e1f2=_0x328933['activeConversation'];let _0x14f782;_0x14f782=_0x5eb3f7?await _0x53e1f2['chatModels']['getModel'](_0x5eb3f7):await _0x53e1f2['chatModels']['getDefault'](),_0x14f782&&await _0x53e1f2['setModel'](_0x14f782),_0x53e1f2['setWebSearch'](_0x298cec),_0x53e1f2['setReasoning'](_0x427eb0),_0x328933['addCurrentDocumentToChatContext'](),_0xe1a8b7?(this['_aiChatUI']['setPromptInputValue'](_0x1cfc49),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x328933['sendMessage']({'message':_0x1cfc49});}['_runReviewShortcut']({commandId:_0xc65800,model:_0x1b82b6,prompt:_0x5926d1,params:_0x5e9bb3}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new at('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x400b0b={'id':_0xc65800,'isCustom':'custom'===_0xc65800};_0x1b82b6&&_0x5926d1&&(_0x400b0b['args']={'model':_0x1b82b6,'prompt':_0x5926d1}),_0x5e9bb3&&(_0x400b0b['params']=_0x5e9bb3),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x400b0b);}['_runTranslateShortcut']({language:_0x1441b8}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new at('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x1441b8,'args':{'language':_0x1441b8}});}}class ToggleAICommand extends _0xae9ca1{constructor(_0x11f120){super(_0x11f120);const _0x1c3c3c=_0x11f120['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x1c3c3c,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x53f04b=this['editor']['plugins']['get']('AITabs')['view'];_0x53f04b['isVisible']=!_0x53f04b['isVisible'];}}class AIToggleButtonUI extends _0x53fc9f{static get['requires'](){return[AITabs];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x229800=this['editor'];_0x229800['commands']['add']('toggleAi',new ToggleAICommand(_0x229800)),_0x229800['ui']['componentFactory']['add']('toggleAi',()=>{const _0x574d60=this['_createAIUIButton'](vt);return _0x574d60['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x574d60;}),_0x229800['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0xba8f97=this['_createAIUIButton'](Wt);return _0xba8f97['set']({'role':'menuitemcheckbox'}),_0xba8f97;});}['_createAIUIButton'](_0x1f4efd){const _0x119a1f=this['editor'],_0x4f4eb5=_0x119a1f['commands']['get']('toggleAi'),_0x5f5c4f=new _0x1f4efd(_0x119a1f['locale']);return _0x5f5c4f['set']({'label':Hi(_0x119a1f['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x485aef,'isToggleable':!0x0}),_0x5f5c4f['bind']('isEnabled')['to'](_0x4f4eb5),_0x5f5c4f['bind']('isOn')['to'](_0x4f4eb5,'value',_0x139bf0=>!!_0x139bf0),this['listenTo'](_0x5f5c4f,'execute',()=>{_0x4f4eb5['execute']();}),_0x5f5c4f;}}const xn=['applySuggestion','insertSuggestion','showNext','showPrevious'];class AIBalloonView extends Nt{['_errorView'];constructor(_0x57c7d4){super(_0x57c7d4),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x2c86fd){this['showError'](_0x2c86fd);}['showError'](_0xbd3510){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0xbd3510,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x363eef=new Nt(this['locale']),_0x2b83bb=new Nt(this['locale']);return _0x2b83bb['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x363eef['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x48303a=>!_0x48303a)]},'children':[_0x2b83bb]}),_0x363eef;}}const Ln=0xa;class AIBalloon extends _0x3cc0e4{static get['requires'](){return[AIEditing];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_getTargetEditor'](){return this['_currentConfig']?.['targetEditor']??ds(this['context']);}['_isUpdatingMarkers']=!0x1;['open'](_0x266c9e){const {id:_0x47fa5d}=this['_currentConfig']??{};this['_currentConfig']=_0x266c9e;const {id:_0x16b957}=this['_currentConfig'];this['isOpen']&&_0x47fa5d===_0x16b957?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x208e47=this['_getTargetEditor']()['plugins']['get']('Dialog');_0x208e47['isOpen']&&this['_currentConfig']&&_0x208e47['id']===this['_currentConfig']['id']&&_0x208e47['hide']();}['_updateDialog'](){const _0x200073=this['_getTargetEditor']()['plugins']['get']('Dialog'),{icon:_0x2ce46c,title:_0x7729e7}=this['_currentConfig'];_0x200073['view']?.['headerView']&&(_0x200073['view']['headerView']['label']=_0x7729e7,_0x200073['view']['headerView']['iconView']&&_0x2ce46c&&(_0x200073['view']['headerView']['iconView']['content']=_0x2ce46c)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x200073['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](AIEditing)['showFakeVisualSelection']({'ranges':this['_currentConfig']['ranges'],'id':'balloon','priority':0x64}),window['getSelection']()?.['removeAllRanges']();}['_hideFakeVisualSelection'](){this['context']['plugins']['get'](AIEditing)['hideFakeVisualSelection']('balloon');}['_showDialog'](){const _0x90c3b9=this['_getTargetEditor']()['plugins']['get']('Dialog'),{id:_0x2d01bb,title:_0x172d32,icon:_0x22b609,class:_0x66fb8,mainView:_0x5721ee}=this['_currentConfig'];_0x5721ee['delegate'](...xn)['to'](this),_0x90c3b9['show']({'title':_0x172d32,'icon':_0x22b609,'hasCloseButton':!0x0,'id':_0x2d01bb,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x66fb8||''),'content':_0x5721ee,'onShow':_0xe36c1e=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener'](),_0xe36c1e['view']?.['updatePosition']();const _0x708a77=this['_getSelectionElements']();_0x708a77&&_0x708a77[0x0]&&wt({'target':_0x708a77[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0xe36c1e['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x2d01bb});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x2d01bb}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x283038,_0x520ebc){if(!_0x520ebc){const _0x15b2be=this['_getTargetRootDomRect']();if(!_0x15b2be)return null;_0x520ebc=_0x15b2be;}const _0xea6395=this['_getSelectionElements']();if(!_0xea6395||0x0===_0xea6395['length'])return{'left':Math['round'](_0x520ebc['left']+_0x520ebc['width']/0x2-_0x283038['width']/0x2),'top':Math['round'](_0x520ebc['top']+_0x520ebc['height']/0x2-_0x283038['height']/0x2)};const _0x23000a=Math['round'](_0x520ebc['left']+_0x520ebc['width']/0x2-_0x283038['width']/0x2),_0x18ebca=_0xea6395['map'](_0x405a5a=>new ut(_0x405a5a)),_0xb6b3cd=_0x283038['height'];return{'left':_0x23000a,'top':this['_calculateOptimalTopPosition'](_0x18ebca,_0xb6b3cd,_0x520ebc)};}['_calculateOptimalTopPosition'](_0x4d07b8,_0x2844cb,_0x505c8f){const _0x2da6f9=new ut(ct['window']),_0x4a6eac=_0x4d07b8['map'](_0x716f92=>_0x716f92['getVisible']())['filter'](_0x3f4c66=>_0x3f4c66),_0x430fc4=ut['getBoundingRect'](_0x4a6eac);if(!_0x430fc4)return Math['round'](_0x505c8f['top']+_0x505c8f['height']/0x2);const _0x588d6e=_0x2da6f9['getIntersection'](_0x430fc4);if(!_0x588d6e)return Math['round'](_0x505c8f['top']+_0x505c8f['height']/0x2);const _0x10359c=_0x505c8f['getVisible'](),_0x277564=_0x10359c&&_0x430fc4['height']>_0x10359c['height'],_0xb492da=_0x588d6e['top'],_0x5ac79b=_0x588d6e['bottom'];if(_0x277564){const _0x1ee42f=(_0x10359c||_0x2da6f9)['height']/0x2-_0x2844cb/0x2,_0x424636=_0xb492da-Ln-_0x505c8f['top'],_0x3539f1=_0x505c8f['bottom']-_0x5ac79b-Ln;return _0x424636>=_0x2844cb?Math['max'](Ln,_0xb492da-_0x2844cb-Ln):_0x3539f1>=_0x2844cb?_0x5ac79b+Ln:Math['max'](Ln,_0x1ee42f);}const _0x18aff5=_0xb492da-_0x2844cb,_0x28ce39=_0x505c8f['bottom']-_0x5ac79b-Ln,_0x2f09d5=_0xb492da-Ln-_0x505c8f['top'];let _0x5b201e;if(_0x28ce39>=_0x2844cb)_0x5b201e=_0x5ac79b+Ln;else{if(_0x2f09d5>=_0x2844cb)_0x5b201e=_0x18aff5-Ln;else _0x5b201e=_0xb492da+_0x430fc4['height']/0x2-_0x2844cb/0x2;}return _0x5b201e;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x80bc48=this['_getTargetEditor']();this['listenTo'](_0x80bc48['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x41248a,data:{newRange:_0x4ef70d}}of _0x80bc48['model']['document']['differ']['getChangedMarkers']())if(_0x41248a['startsWith'](As+':')&&(_0x4ef70d&&(_0x4ef70d['start']['isEqual'](_0x4ef70d['end'])||'$graveyard'==_0x4ef70d['root']['rootName'])||null==_0x4ef70d)){const _0x2edc81=Hi(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x2edc81),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x5589bc=this['_getTargetEditor']();this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x5589bc['model']['document']);}['_getSelectionElements'](){const _0x592b31=this['_getTargetEditor']();return _0x3ba44f(_0x592b31['editing'],[..._0x592b31['model']['markers']['getMarkersGroup']('ai-selection'),..._0x592b31['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}['_getTargetRootDomRect'](){const _0x41e21b=this['_currentConfig']?.['ranges']?.[0x0]?.['root'];if(!_0x41e21b)return null;const _0x3a4a67=this['_getTargetEditor'](),_0x47bea2=_0x3a4a67['editing']['view']['document']['getRoot'](_0x41e21b['rootName']);if(!_0x47bea2)return null;const _0x1f665c=_0x3a4a67['editing']['view']['domConverter']['mapViewToDom'](_0x47bea2);return _0x1f665c&&_0x1f665c instanceof HTMLElement?new ut(_0x1f665c):null;}}class AIMiniToolbarView extends kt{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x3ca703,_0x3ae928={}){super(_0x3ca703),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x3ae928};const _0x17d1f5=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x17d1f5?'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'](_0x36dad2){this['showChangesButton']['isEnabled']=_0x36dad2;}['_setupRatingButtons'](){this['likeButton']=new vt(this['locale']),this['likeButton']['set']({'icon':_0x4dcf71,'label':Hi(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'class':Bi,'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new vt(this['locale']),this['dislikeButton']['set']({'icon':_0x102fde,'label':Hi(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'class':Bi,'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new vt(this['locale']),this['copyButton']['set']({'icon':_0x5c3d91,'label':Hi(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button\x20'+Bi,'tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x5a50d9=new xt();_0x5a50d9['set']({'content':_0x489882}),_0x5a50d9['extendTemplate']({'attributes':{'class':['ck-ai-mini-toolbar-copy-button__check-mark']}}),this['copyButton']['on']('execute',()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20ck-ai-mini-toolbar-copy-button_copied\x20'+Bi,setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20'+Bi;},0x7d0);}),this['copyButton']['children']['add'](_0x5a50d9);}['_setupShowChangesButton'](){this['showChangesButton']=new vt(this['locale']),this['showChangesButton']['set']({'icon':_0x1aad04,'label':Hi(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':Bi}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x42cc56=>_0x42cc56?_0x5a2923:_0x1aad04),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class AIChatBalloonView extends AIBalloonView{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x2da476,_0x2c64ac){super(_0x2da476);const _0x57ca5e=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _t(),this['_keystrokes']=new It(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x2c64ac,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new AISuggestionStreamableContentView(_0x2da476),this['_partToolbarView']=new AISuggestionContentPartToolbarView(_0x2da476,_0x2c64ac['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x2c64ac),this['_stateView']=new AISuggestionContentPartStateView(_0x2da476),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new AIMiniToolbarView(_0x2da476,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new AIChatBalloonToolbarContainerView(_0x2da476,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x45159e,_0x392f49,_0x2b8104,_0x4a1eb3)=>{let _0x40d21a,_0x44823d;'pending'===_0x4a1eb3?(_0x40d21a=this['_partToolbarView'],_0x44823d=this['_stateView']):(_0x40d21a=this['_stateView'],_0x44823d=this['_partToolbarView']),this['_stateView']['setState'](_0x2b8104),_0x40d21a['isVisible']=!0x1,_0x44823d['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x57ca5e['to']('_state',_0x28b55a=>'ck-ai-chat-balloon-main_state_'+_0x28b55a)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x2c64ac);});}['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'](_0x5ce603){_0x5ce603?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x5ce603);}['setState'](_0x21a2b4){this['_state']=_0x21a2b4;}['showError'](_0x24d4c0){super['showError'](_0x24d4c0),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x5c7361){super['showBlockingError'](_0x5c7361),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0xa9ae15){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0xa9ae15;}['togglePartToolbarEnabled'](_0x423a58){this['_partToolbarView']['isEnabled']=_0x423a58;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x49bafd,showSuggestButton:_0x152905}){_0x49bafd=_0x49bafd&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x152905=_0x152905&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x49bafd,'showSuggestButton':_0x152905});}['_createNextButtonView'](){const _0x26cc0d=new vt(this['locale']);return _0x26cc0d['set']({'icon':_0x3a15b7,'label':Hi(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x26cc0d['on']('execute',()=>{this['fire']('showNext');}),_0x26cc0d;}['_createPreviousButtonView'](){const _0x265540=new vt(this['locale']);return _0x265540['set']({'icon':_0x2ca3b2,'label':Hi(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x265540['on']('execute',()=>{this['fire']('showPrevious');}),_0x265540;}}class AIChatBalloonToolbarContainerView extends Nt{constructor(_0x45b560,_0x1873e0){super(_0x45b560),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x1873e0});}}class AIChatBalloon extends _0x53fc9f{static get['requires'](){return[Bt,AIBalloon];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x52b11c){super(_0x52b11c),this['set']('showDiff',!0x1);}['open'](_0xed818d){const _0x1cf40e=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x1cf40e['plugins']['get']('AIBalloon')['open']({..._0xed818d,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0xed818d['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0xed818d['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x132e02){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x132e02);}['setState'](_0x3aea23){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x3aea23);}['_createChatBalloonView'](){const _0x298de2=this['editor'],_0x39a04d=_0x298de2['plugins']['get']('AIBalloon'),_0x1a4348=_0x298de2['commands']['get']('trackChanges');let _0xb96a3f=_0x298de2['config']['get']('ai.availableReplyActions')||[...bs];_0x298de2['plugins']['has']('TrackChanges')||(_0xb96a3f=_0xb96a3f['filter'](_0x1bd655=>'insertSuggestion'!=_0x1bd655));const _0x59eff1=new AIChatBalloonView(_0x298de2['locale'],{'availableActions':_0xb96a3f,'showApplyButton':!0x0,'showSuggestButton':!!_0x1a4348});return _0x59eff1['bind']('showDiff')['to'](this),_0x59eff1['delegate'](...Cs)['to'](this),_0x59eff1['delegate']('showPrevious','showNext')['to'](this),_0x39a04d['delegate']('dialogClosed')['to'](this),_0x59eff1['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x59eff1['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x59eff1['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x1a4348&&_0x59eff1['bind']('isTrackChangesOn')['to'](_0x1a4348,'value'),_0x59eff1['render'](),_0x59eff1;}['_toggleRotatorButtonsInDialogHeader'](_0x3406cc){const _0x5918fd=this['editor'],_0x4aa601=_0x5918fd['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x3406cc),_0x4aa601['has'](this['_chatBalloonView']['previousButtonView'])||(_0x4aa601['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x5918fd['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x4aa601['remove'](this['_chatBalloonView']['previousButtonView']),_0x4aa601['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class AIEditorIntegration extends _0x53fc9f{static get['requires'](){return[AIToggleButtonUI,AIChatBalloon,_0x3fefa0];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Dn(_0x3c46f8){const {editor:_0x15789e,action:_0x56513f,withText:_0x37af8e=!0x1,withIcon:_0x718abe=!0x0,isInDropdown:_0x1dadf9=!0x0,shouldPreventFocus:_0x1fe717=!0x1}=_0x3c46f8;return()=>{const _0x4b8a5a=_0x15789e['locale'],_0x565897=new vt(_0x4b8a5a),_0x554222=_0x565897['bindTemplate'];_0x1dadf9&&_0x565897['extendTemplate']({'on':{'mouseenter':_0x554222['to'](()=>{_0x1fe717&&_0x1fe717()||_0x565897['focus']();})}});const _0x54430c=_0x56513f['icon']??_0x56513f['parent']?.['icon'];return _0x565897['set']({'label':_0x56513f['label'],'withText':_0x37af8e,'role':'menuitem','icon':_0x718abe?_0x54430c??_0x50cf41:void 0x0,'tooltip':!_0x37af8e,'class':'ck-ai-quick-actions-button','isEnabled':_0x56513f['isEnabled']}),_0x565897['on']('execute',()=>{_0x15789e['editing']['view']['focus'](),_0x15789e['commands']['execute']('aiQuickAction',_0x56513f);}),_0x565897;};}class DropdownMenuButtonWithHighlightView extends _0x5c328f{['arrowView'];constructor(_0x57fce3,_0x4d37b4){super(_0x57fce3,_0x4d37b4);const _0x3683f2=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',_0x1adc3d=>String(_0x1adc3d)),'data-cke-tooltip-disabled':_0x3683f2['to']('isOn')},'on':{'mouseenter':_0x3683f2['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x37299d=new xt();return _0x37299d['content']=_0x3edc81,_0x37299d['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x37299d;}}class AIQuickActionsFilteredListView extends Dt{['_allListItems'];['_allSearchableItems'];constructor(_0x254a1f,_0x40acd9,_0x4af47b){super(_0x254a1f),this['_allListItems']=_0x40acd9,this['_allSearchableItems']=_0x4af47b;}['filter'](_0x49e53c){if(!_0x49e53c)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x4781e8=_0x49e53c['source']['toLowerCase']()['trim'](),_0x29cf4d=this['_allSearchableItems']['filter'](_0x519322=>(_0x519322['groupLabel']?_0x519322['label']+'\x20('+_0x519322['groupLabel']+')':_0x519322['label'])['toLowerCase']()['includes'](_0x4781e8));return this['items']['clear'](),this['items']['addMany'](_0x29cf4d['sort']((_0xe6d9c2,_0x181f6f)=>{const _0x563a2e=_0xe6d9c2['groupLabel'],_0x2e08d9=_0x181f6f['groupLabel'];return _0x563a2e||_0x2e08d9?_0x563a2e?0x1:-0x1:0x0;})['map'](_0x121e7f=>_0x121e7f['item'])),this['_highlightQuery'](_0x4781e8,_0x29cf4d),{'resultsCount':_0x29cf4d['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x49f63b,_0x265cb0){if(!_0x49f63b)return;const _0x1de33b=new RegExp(_0x5933ee(_0x49f63b),'gi');_0x265cb0['forEach'](_0x5463aa=>{_0x5463aa['highlightViews']&&_0x5463aa['highlightViews']['forEach'](_0x1a1f37=>{'function'==typeof _0x1a1f37['highlightText']&&_0x1a1f37['highlightText'](_0x1de33b);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x22c396=>{_0x22c396['highlightViews']&&_0x22c396['highlightViews']['forEach'](_0x23980a=>{'function'==typeof _0x23980a['highlightText']&&_0x23980a['highlightText'](null);});});}}const Vn='menu',Pn='menuitem';class AIQuickActionsDropdownContentView extends Nt{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x1076dd,_0x1503e3,_0x1bba9b,_0x18da15,_0x382006=!0x1){const _0x31107e=_0x1076dd['locale'];super(_0x31107e),this['_bodyCollection']=_0x18da15,this['_hasSearch']=_0x382006;const _0x4d3d71=this['_createListItems'](_0x1076dd,_0x1503e3,_0x1bba9b);this['optionsListView']=new AIQuickActionsFilteredListView(_0x31107e,_0x4d3d71,this['_allSearchableItems']),this['optionsListView']['role']=Vn,this['optionsListView']['items']['addMany'](_0x4d3d71),this['focusTracker']=new _t(),this['keystrokes']=new It(),_0x382006&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x4d3d71,this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x382006&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x1ccc9c=_0x382006&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x3127bc(_0x1ccc9c),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x31107e['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x29d55b(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':Hi(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':Hi(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x5be5d3=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x5be5d3);}['_createListItems'](_0xdc3da2,_0x376950,_0x5384b2){const _0x578bcc=new _0x3127bc();return _0x376950['forEach'](_0x31ec9f=>{if('actions'in _0x31ec9f){const {listItem:_0x5580a9}=this['_createActionGroupButton'](_0xdc3da2,_0x31ec9f,_0x5384b2);_0x578bcc['add'](_0x5580a9),_0x31ec9f['actions']['forEach'](_0x4cd195=>{this['_createActionButton'](_0xdc3da2,_0x4cd195,_0x31ec9f['label'],_0x31ec9f['icon']);const {listItem:_0x2ede0f,highlightViews:_0x1bf4b9}=this['_createSearchResultActionButton'](_0xdc3da2,_0x4cd195,_0x31ec9f['label'],_0x31ec9f['icon']);this['_allSearchableItems']['push']({'item':_0x2ede0f,'label':_0x4cd195['label'],'groupLabel':_0x31ec9f['label'],'highlightViews':_0x1bf4b9});});}else{const {listItem:_0x35837e}=this['_createActionButton'](_0xdc3da2,_0x31ec9f);_0x578bcc['add'](_0x35837e);const _0x62b70d=_0x35837e['children']['first'];if(_0x62b70d){const {listItem:_0x57bedd,highlightViews:_0x3e4fc0}=this['_createSearchResultActionButton'](_0xdc3da2,_0x31ec9f);this['_allSearchableItems']['push']({'item':_0x57bedd,'label':_0x62b70d['label']||'','highlightViews':_0x3e4fc0});}}}),_0x578bcc;}['_createActionButton'](_0x33caa3,_0x151dfc,_0x995110,_0x21aead){const _0x3b8161=new Pt(this['locale']);if(_0x995110&&_0x21aead){const _0x461b2e=new vt(this['locale']),_0x302fae=_0x461b2e['bindTemplate'],_0x377e85=new _0x378b1f();_0x377e85['text']=_0x151dfc['label'];const _0x42ae6b=new _0x378b1f();_0x42ae6b['text']=_0x995110;const _0x510e3f=new xt();_0x510e3f['content']=_0x21aead,_0x510e3f['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x59a9ff=new Nt(this['locale']);_0x59a9ff['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x3b6bea=new Nt(this['locale']);return _0x3b6bea['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x461b2e['set']({'label':_0x151dfc['label']+'\x20('+_0x995110+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x461b2e['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':[_0x377e85,_0x59a9ff,_0x510e3f,_0x42ae6b,_0x3b6bea],'on':{'mouseenter':_0x302fae['to'](()=>{this['_isSearchFocused']()||_0x461b2e['focus']();}),'click':_0x302fae['to'](()=>{_0x461b2e['fire']('execute');})}}),_0x461b2e['on']('execute',()=>{_0x33caa3['editing']['view']['focus'](),_0x33caa3['commands']['execute']('aiQuickAction',_0x151dfc);}),_0x3b8161['children']['add'](_0x461b2e),{'listItem':_0x3b8161,'highlightViews':[_0x377e85,_0x42ae6b]};}{const _0xe7fc6=new _0x153bc3(),_0x235e71=new vt(this['locale'],_0xe7fc6),_0x26ce6c=_0x235e71['bindTemplate'],_0x2fd4c4=_0x151dfc['icon']??_0x151dfc['parent']?.['icon'],_0x38600f=void 0x0!==_0x151dfc['icon'];return _0x235e71['set']({'label':_0x151dfc['label'],'withText':!0x0,'role':'menuitem','icon':_0x38600f?_0x2fd4c4??_0x50cf41:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x235e71['extendTemplate']({'on':{'mouseenter':_0x26ce6c['to'](()=>{this['_isSearchFocused']()||_0x235e71['focus']();})}}),_0x235e71['on']('execute',()=>{_0x33caa3['editing']['view']['focus'](),_0x33caa3['commands']['execute']('aiQuickAction',_0x151dfc);}),_0x3b8161['children']['add'](_0x235e71),{'listItem':_0x3b8161,'highlightViews':[_0xe7fc6]};}}['_createSearchResultActionButton'](_0x1d256b,_0x7bd995,_0x1cad6c,_0x5cf94e){return _0x1cad6c&&_0x5cf94e?this['_createSearchResultGroupedActionButton'](_0x1d256b,_0x7bd995,_0x1cad6c,_0x5cf94e):this['_createSearchResultIndividualActionButton'](_0x1d256b,_0x7bd995);}['_createSearchResultGroupedActionButton'](_0x1d1fd9,_0x57d975,_0x1af0b7,_0x3b8363){const _0x4f9200=new Pt(this['locale']),_0x1b9e83=new vt(this['locale']),_0x1b6c9b=_0x1b9e83['bindTemplate'],{view:_0x3556ce,highlightView:_0x354171}=this['_createSearchResultGroupRow'](_0x1af0b7,_0x3b8363),{view:_0x1712bc,highlightView:_0x581b4f}=this['_createSearchResultActionRow'](_0x57d975['label']),_0x1af02d=this['_createSearchResultContentView'](_0x3556ce,_0x1712bc);return _0x1b9e83['set']({'label':_0x57d975['label'],'withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button\x20ck-ai-quick-actions-search-result-button_with-group','tooltip':!0x1}),_0x1b9e83['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':[_0x1af02d],'on':{'mouseenter':_0x1b6c9b['to'](()=>{this['_isSearchFocused']()||_0x1b9e83['focus']();}),'click':_0x1b6c9b['to'](()=>{this['_handleSearchResultButtonClick'](_0x1b9e83);})}}),this['_setupActionButtonExecution'](_0x1b9e83,_0x1d1fd9,_0x57d975),_0x4f9200['children']['add'](_0x1b9e83),{'listItem':_0x4f9200,'highlightViews':[_0x354171,_0x581b4f]};}['_createSearchResultIndividualActionButton'](_0x35d300,_0x15781f){const _0x5779ab=new Pt(this['locale']),_0x539db4=new _0x153bc3(),_0x5cf601=new vt(this['locale'],_0x539db4),_0x4b5826=_0x5cf601['bindTemplate'];return _0x5cf601['set']({'label':_0x15781f['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x5cf601['extendTemplate']({'on':{'mouseenter':_0x4b5826['to'](()=>{this['_isSearchFocused']()||_0x5cf601['focus']();})}}),this['_setupActionButtonExecution'](_0x5cf601,_0x35d300,_0x15781f),_0x5779ab['children']['add'](_0x5cf601),{'listItem':_0x5779ab,'highlightViews':[_0x539db4]};}['_createSearchResultGroupRow'](_0x4f6bb8,_0x4b2981){const _0x47376e=new Nt(this['locale']),_0x1e7b1a=new xt();_0x1e7b1a['content']=_0x4b2981,_0x1e7b1a['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x149973=new _0x378b1f();return _0x149973['text']=_0x4f6bb8,_0x47376e['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x1e7b1a,_0x149973]}),{'view':_0x47376e,'highlightView':_0x149973};}['_createSearchResultActionRow'](_0x40dc91){const _0x594d97=new Nt(this['locale']),_0x5a02d5=new _0x378b1f();return _0x5a02d5['text']=_0x40dc91,_0x594d97['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x5a02d5]}),{'view':_0x594d97,'highlightView':_0x5a02d5};}['_createSearchResultContentView'](_0x3e0b80,_0x4323ad){const _0x472d1d=new Nt(this['locale']);return _0x472d1d['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x3e0b80,_0x4323ad]}),_0x472d1d;}['_setupActionButtonExecution'](_0x46bf4a,_0x596441,_0x429428){_0x46bf4a['on']('execute',()=>{_0x596441['editing']['view']['focus'](),_0x596441['commands']['execute']('aiQuickAction',_0x429428);});}['_createActionGroupButton'](_0x4a1dc4,_0x2e4c9f,_0x1bb0d7){const _0x5b3455=new Pt(this['locale']),_0x1ee6e0=new _0x153bc3(),_0x1749da=new DropdownMenuButtonWithHighlightView(this['locale'],_0x1ee6e0),_0x3195a6=_0x1749da['bindTemplate'],_0x35c36d=this['_getPanelKeystroke'](_0x1bb0d7),_0x3dbab6=this['_createGroupActionsList'](_0x4a1dc4,_0x2e4c9f['actions'],_0x1bb0d7);_0x1749da['set']({'label':_0x2e4c9f['label'],'withText':!0x0,'role':Pn,'icon':_0x2e4c9f['icon']??_0x50cf41,'isEnabled':_0x2e4c9f['actions']['some'](_0x1ed0d0=>_0x1ed0d0['isEnabled'])}),_0x1749da['extendTemplate']({'on':{'mouseenter':_0x3195a6['to'](()=>{this['_isSearchFocused']()||_0x1749da['focus']();})}});const _0x661e0a=new Xt(this['locale']);return _0x661e0a['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x3195a6['to'](_0xc11dcf=>{this['_handlePanelKeydown'](_0xc11dcf,_0x35c36d,_0x1749da,_0x661e0a);})}}),_0x1749da['bind']('isOn')['to'](_0x661e0a,'isVisible'),this['_bodyCollection']['add'](_0x661e0a),_0x661e0a['content']['add'](_0x3dbab6),this['_setupGroupMenuBehavior'](_0x1749da,_0x661e0a),_0x5b3455['children']['add'](_0x1749da),{'listItem':_0x5b3455,'highlightView':_0x1ee6e0};}['_createGroupActionsList'](_0x3ee9dc,_0x52fc45,_0x2ba45b){const _0x1e2eaf=new Dt(this['locale']);return _0x1e2eaf['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x52fc45['forEach'](_0x150819=>{const _0x1ea6b6=new Pt(this['locale']),_0x33103e=Dn({'editor':_0x3ee9dc,'action':_0x150819,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x1ea6b6['children']['add'](_0x33103e),_0x2ba45b['focusTracker']['add'](_0x33103e),_0x1e2eaf['items']['add'](_0x1ea6b6);}),_0x1e2eaf;}['_setupGroupMenuBehavior'](_0x15223b,_0x5e5b5f){const _0x135f6f=_0x15223b['bindTemplate'],_0x54a0cb=this['_getButtonKeystroke'](_0x15223b);_0x15223b['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x135f6f['to'](()=>{this['_showNestedPanel'](_0x5e5b5f,_0x15223b);}),'mouseleave':_0x135f6f['to'](_0x37282b=>{const _0x470b60=_0x37282b['relatedTarget'];this['_isMovingToNestedMenu'](_0x470b60,_0x5e5b5f)||this['_hideNestedPanel'](_0x5e5b5f);}),'keydown':_0x135f6f['to'](_0x2b344e=>{_0x2b344e['key']==_0x54a0cb&&(this['_showNestedPanel'](_0x5e5b5f,_0x15223b),_0x5e5b5f['content']['get'](0x0)['focus']());})}}),_0x5e5b5f['on']('render',()=>{_0x5e5b5f['element']?.['addEventListener']('mouseleave',_0x19f5be=>{const _0x3dcf3c=_0x19f5be['relatedTarget'];_0x15223b['element']?.['contains'](_0x3dcf3c)||this['_isMovingToNestedMenu'](_0x3dcf3c,_0x5e5b5f)||this['_hideNestedPanel'](_0x5e5b5f);});});}['_showNestedPanel'](_0x47f152,_0xa9a341){this['_openNestedPanels']['forEach'](_0x4d9150=>{_0x4d9150!==_0x47f152&&_0x4d9150['isVisible']&&_0x4d9150['hide']();}),_0x47f152['show'](),_0x47f152['pin']({'positions':[_0x17daa9['eastSouth']],'target':_0xa9a341['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x47f152);}['_hideNestedPanel'](_0x5d09c9){_0x5d09c9['hide'](),this['_openNestedPanels']['delete'](_0x5d09c9);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x2775ce=>_0x2775ce['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x5c5828,_0x47cf93){if(!_0x5c5828)return!0x1;if(_0x47cf93['element']?.['contains'](_0x5c5828))return!0x0;const _0x3c203c=_0x5c5828;return _0x3c203c['closest']&&(null!==_0x3c203c['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x3c203c['closest']('.ck-ai-quick-actions-group-list')||null!==_0x3c203c['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'](_0x1ffa08){return'rtl'===_0x1ffa08['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x16535c){return'rtl'===_0x16535c['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x483a8e,_0x4e7ac3,_0x169e9a,_0x118879){_0x483a8e['key']==_0x4e7ac3&&(_0x169e9a['focus'](),this['_hideNestedPanel'](_0x118879));}['_handleSearchResultButtonClick'](_0x55adca){_0x55adca['fire']('execute');}}function Hn(_0x465946){const {editor:_0x23594e,content:_0x1f4d58,buttonDefinition:_0x123852,bodyCollection:_0x149e06,hasSearch:_0x3c77c6=!0x1}=_0x465946;return()=>{const _0x3dce6b=_0x23594e['locale'],_0x12d86b=_0x23594e['commands']['get']('aiQuickAction'),_0x514b20=Gt(_0x3dce6b);_0x514b20['bind']('isEnabled')['to'](_0x12d86b),_0x514b20['buttonView']['set']({'icon':_0x123852['icon']??_0x50cf41,'label':_0x123852['label'],'tooltip':!0x0}),_0x514b20['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x1b7120=new AIQuickActionsDropdownContentView(_0x23594e,_0x1f4d58,_0x514b20,_0x149e06,_0x3c77c6);return _0x514b20['panelView']['children']['add'](_0x1b7120),_0x3c77c6&&_0x514b20['on']('change:isOpen',(_0x2b83c3,_0x355f8b,_0x4aaa49)=>{if(_0x4aaa49){if(_0x23594e['plugins']['has']('AIEditing')){const _0x109e38=_0x23594e['plugins']['get'](AIEditing),_0x40d25d=_0x23594e['model']['document']['selection'],_0x9c7f48=Array['from'](_0x40d25d['getRanges']());_0x9c7f48['length']>0x0&&_0x109e38['showFakeVisualSelection']({'ranges':_0x9c7f48,'id':'quick-action','priority':0x14});}}else _0x23594e['plugins']['has']('AIEditing')&&_0x23594e['plugins']['get'](AIEditing)['hideFakeVisualSelection']('quick-action'),_0x1b7120['resetSearch']();}),_0x514b20;};}const Mn='<task>Explain\x20the\x20selected\x20part\x20of\x20the\x20document\x20in\x20plain,\x20simple\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).-\x20Avoid\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><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20explanation,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant,\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',Un='<task>Summarize\x20the\x20selected\x20part\x20of\x20the\x20document\x20in\x202–4\x20clear\x20sentences,\x20capturing\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><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20summary,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',Bn='<task>Extract\x20and\x20present\x20the\x20key\x20points\x20from\x20the\x20selected\x20part\x20of\x20the\x20document\x20as\x20a\x20concise\x20bulleted\x20list.</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><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20key\x20points\x20list,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',Gn=/* #__PURE__ -- @preserve */
|
|
28
|
-
((()=>({'chat':'AIChat','action':'AIActions'}))());class AIQuickActionsUI extends _0x53fc9f{static get['requires'](){return[_0x53d0e4,AIConnector];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x3242c3=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x3242c3),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x534573){return function(_0x4dcfbf){const _0x3ecc72=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x4dcfbf['uiLanguage']),_0x5bccb3=_0x3ecc72||'English',_0x11db27=[{'id':'ask-ai','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_ASK_AI'),'type':'chat','icon':_0x4bc996},{'id':'chat-commands','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x4bc996,'actions':[{'id':'explain','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Mn['replace']('%0',_0x5bccb3),'type':'chat'},{'id':'summarize','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Un['replace']('%0',_0x5bccb3),'type':'chat'},{'id':'highlight-key-points','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Bn['replace']('%0',_0x5bccb3),'type':'chat'}]},{'id':'improve-writing','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'action','icon':_0x1f8e78},{'id':'continue','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'action','icon':_0x1c6602},{'id':'fix-grammar','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'action','icon':_0x1be793},{'id':'adjust-length','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x3c09f1,'actions':[{'id':'make-shorter','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'action'},{'id':'make-longer','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'action'}]},{'id':'change-tone','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x2ad21d,'actions':[{'id':'make-tone-casual','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'action'},{'id':'make-tone-direct','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'action'},{'id':'make-tone-friendly','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'action'},{'id':'make-tone-confident','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'action'},{'id':'make-tone-professional','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'action'}]},{'id':'translate','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x31db4a,'actions':[{'id':'translate-to-english','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'action','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'action','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'action','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'action','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'action','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'action','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'action','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'action','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'action','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'action','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_OTHER'),'icon':_0x19a5b3,'actions':[]}];return _0x11db27;}(_0x534573);}async['_getDefaultAndCustomActions'](){const _0x75b230=AIQuickActionsUI['getDefaultQuickActions'](this['editor']['locale']),_0x5c7b80=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x183fb5,_0xec70b2=[];try{const _0x2e5545=new AIModels({'connector':this['editor']['plugins']['get']('AIConnector'),'config':this['editor']['config']['get']('ai.models'),'locale':this['editor']['locale']});_0xec70b2=await _0x2e5545['getAll'](),_0x183fb5=(await _0x2e5545['getDefault']())?.['id'];}catch(_0x366dbe){const _0x486942=new at('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x366dbe});Ct(_0x486942['message']);}finally{const _0x1a85e7=_0x5c7b80['map'](_0x544811=>({..._0x544811,'type':'chat'===_0x544811['type']?'chat':'action','model':'chat'!==_0x544811['type']?_0x544811['model']||_0x183fb5:_0x544811['model'],'icon':void 0x0}));_0x75b230['find'](_0x10e856=>'other'===_0x10e856['id'])['actions']['push'](..._0x1a85e7),_0x75b230['forEach'](_0xbcf6db=>{if('actions'in _0xbcf6db)_0xbcf6db['actions']['forEach'](_0x25c8e2=>{if(_0x25c8e2['isEnabled']=!!_0xec70b2['find'](_0x792d18=>_0x792d18['id']===_0x25c8e2['model'])||void 0x0===_0x25c8e2['model'],!_0x25c8e2['isEnabled']){const _0x21a3f4=new at('ai-quick-actions-unavailable-model',this,{'actionId':_0x25c8e2['id'],'modelId':_0x25c8e2['model']});Ct(_0x21a3f4['message']);}});else{if(_0xbcf6db['isEnabled']=!!_0xec70b2['find'](_0x4d795c=>_0x4d795c['id']===_0xbcf6db['model'])||void 0x0===_0xbcf6db['model'],!_0xbcf6db['isEnabled']){const _0x9a5be1=new at('ai-quick-actions-unavailable-model',this,{'actionId':_0xbcf6db['id'],'modelId':_0xbcf6db['model']});Ct(_0x9a5be1['message']);}}});}return _0x75b230;}['_initializeQuickActionsComponentsAndCommands'](){const _0x99f1c8=new Qt(this['editor']['locale']);_0x99f1c8['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x99f1c8),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x99f1c8);}['_initializeQuickActionsDropdown'](_0x57c1bf){const _0x3ae2a6=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Hn({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x50cf41,'label':Hi(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x57c1bf,'hasSearch':_0x3ae2a6}));}['_prepareQuickActionsDefinition'](_0xff84c3){this['_quickActionsDefinition']=_0xff84c3['map'](_0x39a7c9=>{if('actions'in _0x39a7c9){const _0x51a770=_0x39a7c9;return{..._0x51a770,'actions':_0x51a770['actions']['map'](_0x34a93f=>{const {actions:_0x8ffc79,..._0x2a7ae1}=_0x51a770;return{..._0x34a93f,'parent':_0x2a7ae1};})['filter'](_0x15fa6=>this['_shouldIncludeAction'](_0x15fa6))};}return _0x39a7c9;})['filter'](_0x3435b7=>'actions'in _0x3435b7?_0x3435b7['actions']['length']>0x0:this['_shouldIncludeAction'](_0x3435b7));}['_shouldIncludeAction'](_0x57ff9b){const _0x36ca95=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Gn[_0x57ff9b['type']])&&!_0x36ca95['includes'](_0x57ff9b['id'])&&!('chat'===_0x57ff9b['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x5e9364){this['_quickActionsDefinition']['forEach'](_0x1a1512=>{if('actions'in _0x1a1512){const _0xe75851=Hn({'editor':this['editor'],'content':_0x1a1512['actions'],'buttonDefinition':_0x1a1512,'bodyCollection':_0x5e9364});this['editor']['ui']['componentFactory']['add'](_0x1a1512['id'],_0xe75851),_0x1a1512['actions']['forEach'](_0x4d328e=>{const _0x4315fa=Dn({'editor':this['editor'],'action':_0x4d328e});this['editor']['ui']['componentFactory']['add'](_0x4d328e['id'],_0x4315fa);});}else{const _0x5595ff=Dn({'editor':this['editor'],'action':_0x1a1512,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x1a1512['id'],_0x5595ff);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x338fef=>{const _0x4bafa4=this['editor']['commands']['get']('aiQuickAction'),_0x4198d1=new Kt(_0x338fef),_0x5f1022=Hi(_0x338fef,'AI_QUICK_ACTIONS_HEADING');_0x4198d1['buttonView']['set']({'label':_0x5f1022,'icon':_0x50cf41});const _0x52e8f3=new $t(_0x338fef);return _0x52e8f3['set']({'ariaLabel':_0x5f1022,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x2ecd14=>{if('actions'in _0x2ecd14){const _0x5259aa=_0x2ecd14,_0x488252=new qt(_0x338fef,_0x4198d1),_0x3a44f3=new Kt(_0x338fef),_0x54c004=new $t(_0x338fef);_0x3a44f3['buttonView']['set']({'label':_0x5259aa['label'],'icon':_0x5259aa['icon']}),_0x5259aa['actions']['forEach'](_0x1641f4=>{const _0x564de8=new qt(_0x338fef,_0x3a44f3),_0x1119e3=new Wt(_0x338fef);_0x1119e3['set']({'label':_0x1641f4['label'],'icon':_0x1641f4['icon'],'role':'menuitem','isEnabled':_0x1641f4['isEnabled']}),_0x1119e3['on']('execute',()=>{this['_executeQuickAction'](_0x1641f4);}),_0x1119e3['delegate']('execute')['to'](_0x3a44f3),_0x564de8['children']['add'](_0x1119e3),_0x54c004['items']['add'](_0x564de8);}),_0x3a44f3['panelView']['children']['add'](_0x54c004),_0x488252['children']['add'](_0x3a44f3),_0x52e8f3['items']['add'](_0x488252);}else{const _0x41b524=_0x2ecd14,_0x23e09a=new qt(_0x338fef,_0x4198d1),_0x42fd13=new Wt(_0x338fef);_0x42fd13['set']({'label':_0x41b524['label'],'icon':_0x41b524['icon'],'role':'menuitem','isEnabled':_0x41b524['isEnabled']}),_0x42fd13['on']('execute',()=>{this['_executeQuickAction'](_0x41b524);}),_0x42fd13['delegate']('execute')['to'](_0x4198d1),_0x23e09a['children']['add'](_0x42fd13),_0x52e8f3['items']['add'](_0x23e09a);}}),(Object['values'](Gn)['some'](_0x30e757=>this['editor']['plugins']['has'](_0x30e757))?_0x4198d1['bind']('isEnabled')['to'](_0x4bafa4):_0x4198d1['set']({'isEnabled':!0x1}),_0x4198d1['panelView']['children']['add'](_0x52e8f3),_0x4198d1);});}['_executeQuickAction'](_0x4a4d8d){const _0xc07db2=this['editor'];_0xc07db2['editing']['view']['focus'](),_0xc07db2['commands']['execute']('aiQuickAction',_0x4a4d8d);const _0x5b71ea=_0xc07db2['ui']['view']['menuBarView'];_0x5b71ea&&_0x5b71ea['close']&&_0x5b71ea['close']();}}class AIQuickActionsCommand extends _0xae9ca1{['execute'](_0x325d11){switch(this['_expandSelectionIfCollapsed'](),_0x325d11['type']){case'chat':if(!this['editor']['plugins']['has']('AIChat')){const _0x24ba17=Hi(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new at('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x24ba17});}this['_handleAIChatAction'](_0x325d11);break;case'action':if(!this['editor']['plugins']['has']('AIActions')){const _0x13e691=Hi(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new at('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x13e691});}this['_handleAIActionsAction'](_0x325d11);}}async['_handleAIChatAction'](_0x1707d6){const _0x419bb3=this['editor']['plugins']['get']('AIChatController'),_0x392b22=this['editor']['plugins']['get']('AITabs')['view'];if(_0x392b22['isVisible']||(_0x392b22['isVisible']=!0x0),'chat'!==_0x392b22['activeTab']&&_0x392b22['activateTab']('chat'),'ask-ai'===_0x1707d6['id'])_0x419bb3['removeSelectionFromChatContext'](),_0x419bb3['addSelectionToChatContext'](),_0x419bb3['focusPromptInput']();else await _0x419bb3['startConversation']({'modelId':_0x1707d6['model']}),_0x419bb3['removeSelectionFromChatContext'](),_0x419bb3['addSelectionToChatContext'](),_0x419bb3['focusPromptInput'](),await _0x419bb3['sendMessage']({'message':_0x1707d6['prompt']||_0x1707d6['displayedPrompt']||_0x1707d6['label'],'attributes':{'quickActionData':{'id':_0x1707d6['id']},'displayedPrompt':_0x1707d6['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x139bc6=this['editor'],_0x4274d4=_0x139bc6['model']['document']['selection'];if(!_0x4274d4['isCollapsed'])return;const _0x109000=At(_0x4274d4['getSelectedBlocks']())||_0x139bc6['model']['schema']['getLimitElement'](_0x4274d4);_0x139bc6['model']['change'](_0x113028=>{_0x113028['setSelection'](_0x109000,'in');});}['_handleAIActionsActionLabel'](_0x3db04d){return _0x3db04d['parent']?.['label']&&'other'!==_0x3db04d['parent']?.['id']?_0x3db04d['parent']['label']+':\x20'+_0x3db04d['label']:_0x3db04d['label'];}async['_handleAIActionsAction'](_0x425b13){const _0x320e4d=this['editor']['plugins']['get']('AIActions'),_0x3ed4c7=_0x425b13['prompt']?{'userMessage':_0x425b13['prompt'],'model':_0x425b13['model']}:{'actionName':_0x425b13['actionName']||_0x425b13['id'],'args':_0x425b13['args']},_0x6e881a=this['_handleAIActionsActionLabel'](_0x425b13);await _0x320e4d['executeAction'](_0x3ed4c7,_0x6e881a,_0x425b13['icon']);}}class AIQuickActionsEditing extends _0x53fc9f{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x1bea88=this['editor'],_0x464285=new AIQuickActionsCommand(this['editor']);if(_0x1bea88['commands']['add']('aiQuickAction',_0x464285),_0x1bea88['plugins']['has']('AIChat')){const _0x277152=this['editor']['plugins']['get']('AIChatController');_0x1bea88['model']['document']['selection']['on']('change:range',(_0xdd11a7,_0x13c887)=>{_0x13c887['directChange']&&_0x277152['removeSelectionFromChatContext']();});}}}class AIActionsReply extends AIReply{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x4bf4f7=this['documentContextContent']['children']['map'](_0x456826=>({'node':_0x456826,'id':$i(_0x456826,'data-id')})),_0x186fe9=this['parsedMergedContent']['children']['map'](_0x2222a6=>({'node':_0x2222a6,'id':$i(_0x2222a6,'data-id')||ot()})),_0x405a1a=_0x235976(_0x4bf4f7,_0x186fe9,{'comparator':(_0x52406f,_0x40f01c)=>_0x52406f['id']==_0x40f01c['id'],'oneChangePerToken':!0x0});if(!this['isDone']||!this['isComplete']){for(;_0x405a1a['length']&&_0x405a1a[_0x405a1a['length']-0x1]['removed'];)_0x405a1a['pop']();}const _0x47e6fa=_0x405a1a['map'](_0x2c92a0=>{const _0x2ce5fc=_0x2c92a0['added']?'new':_0x2c92a0['removed']?'removed':'modified';return{'node':_0x2c92a0['value'][0x0]['node'],'type':_0x2ce5fc,'id':_0x2c92a0['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x47e6fa,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x159c02,_0x33cfa9){return _0x33cfa9;}}class AIActionsInteraction extends AIInteraction{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;['stoppedExplicitly']=!0x1;constructor(_0xd3a84f){super(_0xd3a84f),this['content']=_0xd3a84f['content'],this['version']=_0xd3a84f['version'],this['actionName']=_0xd3a84f['actionName'],this['args']=_0xd3a84f['args'],this['userMessage']=_0xd3a84f['userMessage'],this['model']=_0xd3a84f['model'],this['on']('interactionStopped',()=>{this['stoppedExplicitly']=!0x0;});}async['sendRequest'](){return this['actionName']?this['connector']['executeAction']({'content':this['content'],'actionName':this['actionName'],'args':this['args']}):this['connector']['executeCustomAction']({'content':this['content'],'message':this['userMessage'],'model':this['model'],'outputFormat':'html'});}['getDocumentContext'](){return{'type':'text','content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x3c5374){const _0x2d83e3=new AIActionsReply({'locale':this['locale'],'documentContextContent':this['content'],..._0x3c5374});return this['replies']['push'](_0x2d83e3),_0x2d83e3['delegate'](...rs)['to'](this),this['fire']('replyCreated',_0x2d83e3),_0x2d83e3;}}class AIActionsBalloonToolbarView extends kt{constructor(_0x4633cc,_0x1b07a9=!0x0,_0x2ce379=!0x0){super(_0x4633cc),this['set']('isEnabled',!0x1),_0x1b07a9&&(this['applyButton']=this['_createButton'](Hi(_0x4633cc,'AI_BALLOON_APPLY_BUTTON'),Mi),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x2ce379&&(this['suggestButton']=this['_createButton'](Hi(_0x4633cc,'AI_BALLOON_SUGGEST_BUTTON'),_0x1b07a9?Ui:Mi),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x1b07a9,'showSuggestButton':_0x2ce379}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x24ad58,showSuggestButton:_0x15e219}){this['applyButton']&&(this['applyButton']['isVisible']=_0x24ad58),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x15e219);}['_createButton'](_0x23e9ae,_0x49becd){const _0x409c77=new vt(this['locale']);return _0x409c77['set']({'label':_0x23e9ae,'class':_0x49becd,'isVisible':!0x0,'withText':!0x0}),_0x409c77;}}class AIActionsBalloonDisclaimerView extends Nt{constructor(_0x474184){super(_0x474184),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':Hi(_0x474184,'AI_DISCLAIMER_TEXT')}]}]});}}class AISuggestionLoaderView extends Nt{constructor(_0xdb30c8){super(_0xdb30c8),this['set']('isVisible',!0x0);const _0x4bc6b7=new AISpinnerView('small');_0x4bc6b7['isVisible']=!0x0;const _0x424dd7=new Nt(this['locale']);_0x424dd7['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[Hi(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x23ecbb=>!_0x23ecbb)]},'children':[_0x4bc6b7,_0x424dd7]});}}class AIActionsBalloonView extends AIBalloonView{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x394ae5,_0x5be482){super(_0x394ae5),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x5be482,this['_focusTracker']=new _t(),this['_keystrokes']=new It(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x3127bc(),this['_addContentWrapper'](_0x5be482),this['_addDisclaimerView'](),this['_addToolbar'](_0x5be482),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'](_0x5be482);});}['render'](){super['render']();for(const _0x3736e8 of this['_focusables'])this['_focusTracker']['add'](_0x3736e8['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x1080f1){-0x1===_0x1080f1?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x2281c8){this['_isLoading']=_0x2281c8;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x46e036){super['showError'](_0x46e036),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x5727e8){super['showBlockingError'](_0x5727e8),this['setErrorState']();}['addMiniToolbarItem'](_0x5e356e){this['_miniToolbarView']['items']['has'](_0x5e356e)||this['_miniToolbarView']['items']['add'](_0x5e356e);}['removeMiniToolbarItem'](_0x365046){this['_miniToolbarView']['items']['has'](_0x365046)&&this['_miniToolbarView']['items']['remove'](_0x365046);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x393c47,showSuggestButton:_0x193328}){_0x393c47=_0x393c47&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x193328=_0x193328&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x393c47,'showSuggestButton':_0x193328});}async['updateContent'](_0x2c79ae){await this['_streamableContentView']['update'](_0x2c79ae);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x32f473){this['_contentWrapper']=new Nt(this['locale']),this['_contentWrapper']['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content-wrapper']},'children':[this['_createLoaderView'](),this['_createStreamableContentView']()]},this['_createMiniToolbar'](_0x32f473['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new AIActionsBalloonDisclaimerView(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x3eb7ce,showSuggestButton:_0x259ba9}){this['_toolbarView']=new AIActionsBalloonToolbarView(this['locale'],_0x3eb7ce,_0x259ba9),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',(_0x5c59bd,_0x255bc5,_0x25e113)=>!(_0x5c59bd||_0x255bc5||_0x25e113)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x3eb7ce,'showSuggestButton':_0x259ba9}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x57ac77){return this['_miniToolbarView']=new AIMiniToolbarView(this['locale'],_0x57ac77),this['_miniToolbarView']['delegate'](...Cs)['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',(_0x488bec,_0x18185b)=>!(_0x488bec||_0x18185b)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new AISuggestionLoaderView(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new AISuggestionStreamableContentView(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x421de3=new vt(this['locale']),_0x232212=new vt(this['locale']),_0x20ad5=new AIActionsBalloonNavigationCounterView(this['locale']),_0x46f7e9=new vt(this['locale']);_0x421de3['set']({'icon':tt,'label':Hi(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+Bi}),_0x232212['set']({'icon':_0x3d9913,'tooltip':Hi(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+Bi}),_0x46f7e9['set']({'icon':et,'tooltip':Hi(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+Bi}),_0x421de3['bind']('isEnabled')['to'](this,'isBusy',_0x48fd79=>!_0x48fd79),_0x421de3['on']('execute',()=>{this['fire']('tryAgain');}),_0x232212['bind']('isEnabled')['to'](this,'isBusy',_0x2baed6=>!_0x2baed6),_0x232212['on']('execute',()=>{this['fire']('showPrevious');}),_0x46f7e9['bind']('isEnabled')['to'](this,'isBusy',_0x14bf3d=>!_0x14bf3d),_0x46f7e9['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x232212,this['_navigationCounter']=_0x20ad5,this['_navigationNextButton']=_0x46f7e9,this['_navigationTryAgainButton']=_0x421de3;}['updateMiniToolbarButtons'](_0x5b6de8,_0x4dbc1c){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x2b46c1=_0x5b6de8>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x2b46c1){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x5753b7=_0x5b6de8-_0x4dbc1c;this['_navigationCounter']['setInteractionCount'](_0x5753b7+'/'+_0x5b6de8),this['_navigationPreviousButton']['isEnabled']=_0x4dbc1c<_0x5b6de8-0x1,this['_navigationNextButton']['isEnabled']=_0x4dbc1c>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'](_0x5c903b){this['_isLoading']=_0x5c903b;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x3b4d69=this['_getScrollableElement']();_0x3b4d69&&!this['_scrollManager']&&(this['_scrollManager']=new ScrollManager(_0x3b4d69));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class AIActionsBalloonNavigationCounterView extends Nt{constructor(_0x4535d5){super(_0x4535d5);const _0x19d00a=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x19d00a['to']('interactionCount')}]});}['setInteractionCount'](_0x50d4af){this['set']('interactionCount',_0x50d4af);}}class AIActions extends _0x53fc9f{static get['requires'](){return[AIConnector,Bt,AIEditing,AIBalloon,_0x490f88];}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(_0x1457c5){super(_0x1457c5),this['_bodyCollection']=new Qt(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new PromiseQueue();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x3941be,_0x171822,_0x30b787){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x26ae82,anchorData:_0x4082d9,root:_0x472aed}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x3941be,_0x26ae82,_0x4082d9,_0x472aed,_0x171822,_0x30b787);}}const {modelFragment:_0x2be86b,anchorData:_0x1d3a0f,root:_0x4b35db}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x3941be,_0x2be86b,_0x1d3a0f,_0x4b35db,_0x171822,_0x30b787);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x285912=this['editor']['plugins']['has']('TrackChanges');let _0x1718f7=this['editor']['config']['get']('ai.availableReplyActions')||[...bs];_0x285912||(_0x1718f7=_0x1718f7['filter'](_0x158c24=>'insertSuggestion'!=_0x158c24));const _0x3edef6=this['editor']['commands']['get']('trackChanges'),_0x1d6a77=new AIActionsBalloonView(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x285912,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x1718f7});return _0x1d6a77['bind']('isBusy')['to'](this),_0x3edef6&&_0x1d6a77['bind']('isTrackChangesOn')['to'](_0x3edef6,'value'),_0x1d6a77['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x1d6a77['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x1d6a77['on']('showNext',()=>{this['_navigateToNext']();}),_0x1d6a77;}['_getExecuteDataRegular'](){const _0x22cc3f=this['editor']['model']['document']['selection'],_0x4fb043=_0x22cc3f['getFirstRange']()['start']['root'];if(_0x22cc3f['isCollapsed']){const _0xd1090f=At(_0x22cc3f['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x22cc3f);this['editor']['model']['change'](_0x5cd2cd=>{_0x5cd2cd['setSelection'](_0xd1090f,'in');});}const _0x2b8ebc=_0x22cc3f['getFirstRange'](),_0x431bff=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x22cc3f),_0x2b8ebc['start'],_0x2b8ebc['end']);this['_copyMarkersToFragment'](_0x431bff,_0x22cc3f,{'isTableSelection':!0x1});const _0x404281=_0x22cc3f['getFirstRange']()['start'],_0x22049b=new Map();let _0x34e93a=_0x431bff;for(let _0x4ffa4b=0x0;_0x4ffa4b<_0x404281['path']['length'];_0x4ffa4b++)_0x22049b['set'](_0x34e93a,_0x404281['path'][_0x4ffa4b]),_0x34e93a=_0x34e93a['getChild'](0x0);return{'modelFragment':_0x431bff,'anchorData':_0x22049b,'root':_0x4fb043};}['_getExecuteDataInTable'](){const _0x260463=this['editor']['model']['document']['selection'],_0x4b6122=this['editor']['plugins']['get']('TableSelection'),_0x2be3ae=_0x260463['getFirstRange']()['start']['root'],_0x141cbd=_0x4b6122['getSelectionAsFragment'](),_0x2d3f27=_0x260463['getFirstRange']()['start']['parent']['parent'],_0x24f42=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x2d3f27),this['editor']['model']['createPositionAfter'](_0x2d3f27)),_0x16f194=this['_wrapWithCommonAncestors'](_0x141cbd,_0x24f42['start'],_0x24f42['end']);this['_copyMarkersToFragment'](_0x16f194,_0x260463,{'isTableSelection':!0x0});const _0x249509=_0x260463['getFirstRange']()['start'],_0x37d9f9=new Map();let _0x4b4583=_0x16f194;for(let _0x429efd=0x0;_0x429efd<_0x249509['path']['length'];_0x429efd++)if(_0x37d9f9['set'](_0x4b4583,_0x249509['path'][_0x429efd]),_0x429efd<_0x249509['path']['length']-0x1)_0x4b4583=_0x4b4583['getChild'](0x0);else{let _0x343c69=_0x4b4583['nextSibling'];for(;_0x343c69;)_0x37d9f9['set'](_0x343c69,_0x249509['path'][_0x429efd]),_0x343c69=_0x343c69['nextSibling'];}return{'modelFragment':_0x16f194,'anchorData':_0x37d9f9,'root':_0x2be3ae};}async['_executeAction'](_0xe2fffb,_0x240ac5,_0x29abab,_0x5d5596,_0x41c8f0,_0x103591){const _0x17b88f=this['editor']['plugins']['get'](AIEditing),_0x4270e7=this['editor']['plugins']['get'](AIBalloon),_0x47eaf2=this['editor']['model']['document']['selection'],_0xae7f39=await _0x17b88f['modelToDataWithIds'](_0x240ac5),_0x1394f0=this['editor']['model']['document']['version'],_0x4b6110=[..._0x47eaf2['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x4270e7['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x41c8f0,'icon':_0x103591||_0x50cf41,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x4b6110,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x4270e7),this['_interactionParams']={'action':_0xe2fffb,'content':_0xae7f39,'version':_0x1394f0,'aiBalloon':_0x4270e7,'modelFragment':_0x240ac5,'anchorData':_0x29abab,'root':_0x5d5596},this['_setupApplyListeners'](),this['listenTo'](_0x4270e7,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x4270e7,'dialogClosed',(_0x50cd03,{id:_0x191cd5})=>{if('aiActionsBalloon'===_0x191cd5){for(const _0x26d502 of this['_interactions']){if(0x0===_0x26d502['replies']['length']||_0x26d502['stoppedExplicitly'])continue;const _0xb2992e=_0x26d502['replies'][_0x26d502['replies']['length']-0x1],_0x3dadf7=_0xb2992e['changeGroups'][0x0];_0x3dadf7&&'pending'===_0x3dadf7['state']&&_0xb2992e['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x4270e7);}}),this['_createInteraction'](_0xae7f39,_0x1394f0,_0x4270e7,_0xe2fffb);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x58b63a,anchorData:_0x2dc970,root:_0x1590f0}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x58b63a,_0x2dc970,_0x1590f0,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x58b63a,_0x2dc970,_0x1590f0,!0x0);});}['_wrapWithCommonAncestors'](_0x1d4a01,_0x38f8ea,_0x88aec){const _0x2227d1=this['editor']['model']['createRange'](_0x38f8ea,_0x88aec)['getCommonAncestor'](),_0x174da1=_0x2227d1['is']('documentFragment')?[]:_0x2227d1['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x174da1['length']){const _0x40a387=_0x174da1['map'](_0x2f01ee=>_0x2f01ee['_clone'](!0x1));for(let _0x28fce9=0x1;_0x28fce9<_0x40a387['length'];_0x28fce9++)_0x40a387[_0x28fce9-0x1]['_appendChild'](_0x40a387[_0x28fce9]);return _0x40a387[_0x40a387['length']-0x1]['_appendChild'](_0x1d4a01),new _0xd8720b(_0x40a387[0x0]);}return _0x1d4a01;}['_copyMarkersToFragment'](_0x59ca0e,_0x439989,_0x3d7e26={'isTableSelection':!0x1}){const _0x4524e7=this['editor']['model'],_0x11ebf6=Array['from'](_0x439989['getRanges']()),_0x1b4ced=_0x439989['getFirstRange']()['start'];for(const _0xee3441 of _0x4524e7['markers']){if(_0xee3441['name']['startsWith'](As)||!_0xee3441['affectsData'])continue;const _0x1a355a=_0xee3441['getRange']();if(!_0x11ebf6['some'](_0xe7d64e=>_0xe7d64e['containsRange'](_0x1a355a,!0x0)))continue;const _0x5e7483=this['_regularCalculateMarkerPath'](_0x1a355a['start'],_0x1b4ced,_0x3d7e26['isTableSelection']),_0xda2d58=this['_regularCalculateMarkerPath'](_0x1a355a['end'],_0x1b4ced,_0x3d7e26['isTableSelection']),_0x342cb4=_0x4524e7['createPositionFromPath'](_0x59ca0e,_0x5e7483),_0x4122d0=_0x4524e7['createPositionFromPath'](_0x59ca0e,_0xda2d58);if(!_0x342cb4['isEqual'](_0x4122d0)){const _0x333ee7=_0x4524e7['createRange'](_0x342cb4,_0x4122d0);_0x59ca0e['markers']['set'](_0xee3441['name'],_0x333ee7);}}}['_regularCalculateMarkerPath'](_0x5befa9,_0xfd8398,_0x58cda9=!0x1){const _0x2b7f3d=[..._0x5befa9['path']['slice']()];for(let _0x7e0bbd=0x0;_0x7e0bbd<Math['max'](_0xfd8398['path']['length'],_0x5befa9['path']['length']);_0x7e0bbd++){const _0x4c9f41=_0xfd8398['path'][_0x7e0bbd]||0x0,_0x4904a9=(_0x5befa9['path'][_0x7e0bbd]||0x0)-_0x4c9f41;if(_0x2b7f3d[_0x7e0bbd]=_0x4904a9,0x0!==_0x4904a9&&!_0x58cda9)break;}return _0x2b7f3d;}async['_createInteraction'](_0x4c8643,_0x283a60,_0x40f4d1,_0xef5d02){const _0x2bfd07=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0xef5d02,'content':_0x4c8643,'version':_0x283a60,'aiBalloon':_0x40f4d1,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map(),'root':this['editor']['model']['document']['selection']['getFirstRange']()['start']['root']});const _0x288ab3=new AIActionsInteraction({'connector':this['_aiConnector'],'locale':_0x2bfd07['locale'],'content':_0x4c8643,'version':_0x283a60,..._0xef5d02});this['_interactions']['push'](_0x288ab3);const _0x2cd550=(_0x13b8d2,_0x3449f5=!0x1,_0x2401dd='streaming')=>this['_promiseQueue']['enqueue'](async _0x3f352e=>{try{const _0x368c08=Zi({'editor':_0x2bfd07,'changeGroups':_0x13b8d2['changeGroups'],'documentContextContent':_0x13b8d2['documentContextContent'],'showDiff':_0x3449f5,'trimUnchanged':!0x1});_0x368c08['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x368c08[0x0],'renderingStrategy':_0x2401dd,'abortSignal':_0x3f352e});}catch(_0x2d957b){if(this['_isAbortError'](_0x2d957b))return;throw _0x2d957b;}});_0x288ab3['on']('replyCreated',(_0x276738,_0x3b1c13)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x2cd550(_0x3b1c13)['catch'](_0x2f0250=>{this['_isAbortError'](_0x2f0250)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x2f0250),this['_setErrorState'](_0x288ab3));});}),_0x288ab3['on']('replyContentUpdated',(_0x1fcb66,_0x36d9b2)=>{_0x2cd550(_0x36d9b2)['catch'](_0x149da9=>{this['_isAbortError'](_0x149da9)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x149da9),this['_setErrorState'](_0x288ab3));});}),_0x288ab3['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x45f40a){this['_isAbortError'](_0x45f40a)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x45f40a),this['_setErrorState'](_0x288ab3));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x1b1970,{showDiff:_0xdfef22})=>{try{this['_balloonShowDiff']=_0xdfef22;const _0xf300e8=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0xf300e8&&await _0x2cd550(_0xf300e8,_0xdfef22,'static');}catch(_0x6970bb){this['_isAbortError'](_0x6970bb)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x6970bb),this['_setErrorState'](_0x288ab3));}}),_0x288ab3['on']('replyChangeGroupStateUpdated',()=>{const _0x2541a8={'positiveCount':_0x288ab3['replies']['reduce']((_0x4ada1e,_0xd64df3)=>_0x4ada1e+_0xd64df3['changeGroups']['filter'](_0x419049=>'accepted'===_0x419049['state'])['length'],0x0),'totalCount':_0x288ab3['replies']['reduce']((_0x3376c5,_0x1b0ab9)=>_0x3376c5+_0x1b0ab9['changeGroups']['length'],0x0)},_0x52ecd8=_0x288ab3['actionCallId'],_0x5f23ae=_0x288ab3['actionName'];_0x5f23ae?this['_aiConnector']['upsertAIActionRating'](_0x5f23ae,_0x52ecd8,_0x2541a8):this['_aiConnector']['upsertCustomAIActionRating'](_0x52ecd8,_0x2541a8);}),this['_setLoadingState']();try{const _0x2c2503=await _0x288ab3['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x2c2503;}catch(_0xacc69c){if(this['_isAbortError'](_0xacc69c))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x288ab3);}}['_applyChanges'](_0x53f885,_0x26dcfd,_0x406c37,_0x557d0d){const _0x445106=this['editor'];if(_0x557d0d&&!_0x445106['plugins']['has']('TrackChanges'))throw new at('ai-no-track-changes',null);const _0x199bdc=this['editor']['plugins']['get'](_0x490f88),_0x192913=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x192913||!_0x192913['replies']['length'])return;const _0xf342c8=_0x192913['replies'][_0x192913['replies']['length']-0x1],_0x395221=_0xf342c8['changeGroups'];_0xf342c8['setChangeGroupState'](0x0,'accepted');let _0x2dac03=_s({'editor':_0x445106,'reply':_0xf342c8,'interaction':_0x192913,'groups':_0x395221,'transform':!0x1,'documentCompare':_0x199bdc,'documentCompareOptions':{'anchor':_0x445106['model']['createPositionAt'](_0x53f885,0x0),'markDeletions':_0x557d0d}});_0x2dac03=this['_filterOperationsOutsideRange'](_0x2dac03,_0x26dcfd);for(const _0xf547f4 of _0x2dac03)this['_anchorOperation'](_0x26dcfd,_0xf547f4,_0x406c37);const _0x221fb0=_0x192913['getDocumentContext']()['version'],_0x438995=_0x445106['model']['document']['history']['getOperations'](_0x221fb0),_0x487017={'document':_0x445106['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x3effdc=_0x2d44f8(_0x2dac03,_0x438995,_0x487017)['operationsA'];_0x445106['model']['change'](_0x3d3899=>{if(_0x3d3899['setSelection'](_0x445106['model']['document']['selection']['focus']),_0x557d0d)_0x445106['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x3effdc);else{for(const _0x9f72d6 of _0x3effdc)_0x9f72d6['baseVersion']=_0x445106['model']['document']['version'],Is(_0x445106,_0x9f72d6),_0x3d3899['batch']['addOperation'](_0x9f72d6),_0x445106['model']['applyOperation'](_0x9f72d6);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x445dd3,_0x340248){return _0x445dd3['filter'](_0xe7635f=>{if('rename'==_0xe7635f['type']){const _0xc0d017=_0xe7635f['position']['nodeAfter'];return!_0x340248['has'](_0xc0d017);}if(_0xe7635f['type']['indexOf']('Attribute')>-0x1){const _0x2e4cc6=_0xe7635f['range']['start']['nodeAfter'];return!_0x340248['has'](_0x2e4cc6);}return!0x0;});}['_anchorOperation'](_0x532782,_0x358182,_0x44dc6c){const _0x1079a9=_0x358182['clone']();for(const _0x380389 in _0x358182){const _0x2ac24c=_0x358182[_0x380389];_0x2ac24c instanceof _0x5d6ed6?_0x358182[_0x380389]=new _0x5d6ed6(_0x1107af(_0x2ac24c['start']),_0x1107af(_0x2ac24c['end'])):_0x2ac24c instanceof _0x554d31&&(_0x358182[_0x380389]=_0x1107af(_0x2ac24c));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x1079a9['type'])){if(_0x1079a9['isDocumentOperation']=!0x1,_0x1079a9['baseVersion']=null,'remove'==_0x1079a9['type']){const _0x4dac68=_0x1079a9['sourcePosition'],_0x3b273d=_0x1079a9['howMany'];new _0x42f63b(_0x4dac68,_0x3b273d)['_execute']();}else _0x1079a9['_execute']();}function _0x1107af(_0x5e0ff2){if('$graveyard'==_0x5e0ff2['root']['rootName'])return _0x5e0ff2;const _0x47bb7f=[];let _0x12a896=_0x5e0ff2['root'];for(let _0x4d3484=0x0;_0x4d3484<_0x5e0ff2['path']['length'];_0x4d3484++){const _0x1691d9=_0x532782['get'](_0x12a896)||0x0;_0x47bb7f[_0x4d3484]=_0x5e0ff2['path'][_0x4d3484]+_0x1691d9,_0x12a896=_0x12a896['getChildAtOffset'](_0x5e0ff2['path'][_0x4d3484]);}return new _0x554d31(_0x44dc6c,_0x47bb7f,_0x5e0ff2['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0xa3895a,content:_0x5d98ea,version:_0x18eb79,aiBalloon:_0x201171}=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'](_0x5d98ea,_0x18eb79,_0x201171,_0xa3895a)['catch'](_0x2a0c44=>{this['_isAbortError'](_0x2a0c44)||console['error']('Error\x20refreshing\x20interaction:',_0x2a0c44);});}['_isAbortError'](_0x4a6acc){return!!_0x4a6acc['message']&&_0x4a6acc['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 _0x4ba288=this['_interactions']['length'];this['_currentInteractionIndex']<_0x4ba288-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x49518e){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x49518e;const _0x2b3759=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x2b3759)return;if(_0x2b3759['hasError'])return this['_setErrorState'](_0x2b3759),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x2b3759['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x908678=_0x2b3759['replies'][_0x2b3759['replies']['length']-0x1];if(_0x908678){const _0x42e4ee=this['editor'];try{const _0x59d711=Zi({'editor':_0x42e4ee,'changeGroups':_0x908678['changeGroups'],'documentContextContent':_0x908678['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x303319=>setTimeout(_0x303319,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x59d711[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x8966bb){this['_isAbortError'](_0x8966bb)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x8966bb);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x3468db){const _0x446691=Hi(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x446691),_0x3468db['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],this['_actionsBalloonView']['setErrorState'](),this['_actionsBalloonView']['toggleIsLoading'](!0x0);}['_clearErrorState'](){this['_actionsBalloonView']['hideError'](),this['_actionsBalloonView']['toggleIsLoading'](!0x1);}async['_clearLoadingState'](){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,this['_actionsBalloonView']['setIsLoading'](!0x1);}}class AIQuickActions extends _0x53fc9f{static get['requires'](){return[AIQuickActionsUI,AIQuickActionsEditing,AIActions];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x52d141){super(_0x52d141),_0x52d141['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class AIReviewCoreReviewCheckListItemResultsView extends Nt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x86dcac,_0xdffe25){super(_0x86dcac),this['id']=_0xdffe25,this['set']('status','pending'),this['set']('changeId',_0xdffe25),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',(_0x2aed59,_0x419668)=>{_0x419668&&_0x419668['target']&&'A'===_0x419668['target']['tagName']&&_0x419668['preventDefault'](),this['fire']('activateChange',{'id':_0xdffe25,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0xdffe25,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0xdffe25,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x3c2e6a=new Nt(this['locale']);return _0x3c2e6a['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',_0x27db1e=>!_0x27db1e)]}}),_0x3c2e6a;}['_createAcceptButtonView'](){const _0x3be01a=new vt(this['locale']);return _0x3be01a['set']({'label':Hi(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x3be01a['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x149047=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x149047['stopPropagation']();})},'attributes':{'class':[this['bindTemplate']['if']('status','ck-hidden',_0x3b4be7=>'pending'!==_0x3b4be7&&'accepted'!==_0x3b4be7),this['bindTemplate']['if']('status',Ui,_0xcdd623=>'pending'===_0xcdd623),this['bindTemplate']['if']('status',Bi,_0x42d7d3=>'pending'!==_0x42d7d3),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x550fd3=>'accepted'===_0x550fd3)]}}),this['on']('change:status',(_0x5892e5,_0x15067b,_0x4b95f4)=>{_0x3be01a['isEnabled']='pending'===_0x4b95f4,'accepted'===_0x4b95f4&&(_0x3be01a['label']=Hi(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x3be01a['icon']=_0x489882);}),_0x3be01a;}['_createDismissButtonView'](){const _0x121936=new vt(this['locale']);return _0x121936['set']({'label':Hi(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x121936['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xb3b13=>{this['fire']('dismissChange',{'id':this['changeId']}),_0xb3b13['stopPropagation']();})},'attributes':{'class':[Bi,this['bindTemplate']['if']('status','ck-hidden',_0x2bce66=>'pending'!==_0x2bce66&&'rejected'!==_0x2bce66),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x1923b6=>'pending'===_0x1923b6),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x4f43be=>'rejected'===_0x4f43be)]}}),this['on']('change:status',(_0x4a4ef6,_0x49db05,_0x2940e2)=>{_0x121936['isEnabled']='pending'===_0x2940e2,'rejected'===_0x2940e2&&(_0x121936['label']=Hi(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x121936['icon']=_0x5777e9);}),_0x121936;}['_createInfoButtonView'](){const _0x15625d=new vt(this['locale']);return _0x15625d['set']({'label':Hi(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x467df0,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':Bi+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x15625d['bind']('isOn')['to'](this,'isInfoToggleOn',_0x4f2b1a=>_0x4f2b1a),_0x15625d['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x15625d;}['_createOutdatedButtonView'](){const _0x29d590=new vt(this['locale']);return _0x29d590['set']({'label':Hi(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':it,'withText':!0x0,'isEnabled':!0x1}),_0x29d590['extendTemplate']({'attributes':{'class':[Bi,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x406bbe=>'outdated'!==_0x406bbe)],'disabled':'disabled'}}),_0x29d590;}}class AIReviewCoreBalloonSuggestionItemView extends Xt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x3398d7,_0x434f0c){super(_0x3398d7),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']()),_0x434f0c['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x1fccff){this['resultItemView']['changeId']=_0x1fccff['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x1fccff['contentDiffed'];}['showBalloon'](_0x2425c7,_0x40d0bc,_0xbd1430,_0x5729cc,_0x42642d,_0x35b411){const _0x3288d2=_0x40d0bc();if(!_0x3288d2)return;this['updateContent'](_0x2425c7),this['show']();const _0x3940c3=Array['from'](_0x3288d2['getClientRects']())['reverse'](),_0x45b19c=this['_getPointedRectIndexFromEvent'](_0xbd1430,_0x3940c3),_0xb1a969=_0x3940c3[_0x45b19c??0x0];'click'===_0x5729cc?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x40d0bc(),_0x45b19c,_0x2425c7['id'],_0x42642d,_0x35b411)||_0xb1a969})):'hover'===_0x5729cc&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x40d0bc(),_0x45b19c,_0x2425c7['id'])||_0xb1a969}));}['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'](){zt({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x85ac6d=[this['element']];return this['_pinnedTargetElement']&&_0x85ac6d['push'](this['_pinnedTargetElement']),_0x85ac6d;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x44b073=new Nt();return this['resultItemView']=new AIReviewCoreReviewCheckListItemResultsView(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x44b073['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']]}]}),_0x44b073;}['_getBestRectPositionOnClick'](_0x37b102,_0x24894f,_0x957aab,_0x1619cf,_0x2db323){if(!_0x37b102)return null;const _0x5887db=this['position']['replace']('arrow_',''),_0x4eb100=Array['from'](_0x37b102['getClientRects']());let _0x557d98,_0x96dd59=_0x4eb100['reverse']();return void 0x0!==_0x24894f&&this['_isPinnedRectVisible'](_0x96dd59[_0x24894f],_0x1619cf,_0x2db323)?(_0x557d98=_0x96dd59[_0x24894f],this['_pinnedRectIndex']=_0x24894f):this['_isPinnedRectVisible'](_0x96dd59[0x0],_0x1619cf,_0x2db323)&&void 0x0===_0x24894f?_0x557d98=_0x96dd59[0x0]:(_0x96dd59='s'==_0x5887db[0x0]?[..._0x4eb100]['reverse']():_0x4eb100,_0x96dd59['forEach'](_0x7c91c2=>{this['_isPinnedRectVisible'](_0x7c91c2,_0x1619cf,_0x2db323)&&(_0x557d98=_0x7c91c2);})),this['_pinnedTargetChangeId']=_0x957aab,this['_pinnedTargetElement']=_0x37b102,_0x557d98||_0x37b102['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x4c2600,_0x287639,_0x5c8c5e){if(!_0x4c2600)return null;const _0x508d5d=Array['from'](_0x4c2600['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x287639&&this['_pinnedTargetChangeId']!==_0x5c8c5e)return this['_pinnedRectIndex']=_0x287639,this['_pinnedTargetElement']=_0x4c2600,this['_pinnedTargetChangeId']=_0x5c8c5e,_0x508d5d[_0x287639];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x5c8c5e){if(_0x4c2600!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x508d5d[this['_pinnedRectIndex']];}return void 0x0!==_0x287639&&this['_pinnedTargetChangeId']!==_0x5c8c5e?(this['_pinnedRectIndex']=_0x287639,this['_pinnedTargetElement']=_0x4c2600,this['_pinnedTargetChangeId']=_0x5c8c5e,_0x508d5d[_0x287639]):_0x4c2600['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x502b3b,_0x3b2b25){if(_0x502b3b)for(let _0x1d6695=0x0;_0x1d6695<_0x3b2b25['length'];_0x1d6695++){const _0x423944=_0x3b2b25[_0x1d6695];if(_0x502b3b['clientX']>=_0x423944['left']-0x3&&_0x502b3b['clientX']<=_0x423944['right']+0x3&&_0x502b3b['clientY']>=_0x423944['top']-0x3&&_0x502b3b['clientY']<=_0x423944['bottom']+0x3)return _0x1d6695;}}['_isPinnedRectVisible'](_0xf40ac2,_0x2a86da,_0x17559a){const _0x5a386c=new ut(_0xf40ac2),_0x2b6034=_0x2a86da||document['documentElement'],_0x24d5cf=_0x5a386c['getIntersection'](bt(_0x17559a)),_0x1ac5b1=new ut(_0x2b6034)['getIntersection'](_0x5a386c);return!!(_0x24d5cf&&_0x1ac5b1&&_0x5a386c['width']>0x0);}}const Fn=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class AIReviewCoreUI extends _0x3cc0e4{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[AITabs];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x52115c){super(_0x52115c),this['_bodyCollection']=new Qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...Fn)['to'](this),this['_balloonSuggestionView']=new AIReviewCoreBalloonSuggestionItemView(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x3f625e=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x3f625e);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x32add0){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x5d858a=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x32add0,_0x5d858a);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x1a97b4){_0x1a97b4&&('error-general'!==_0x1a97b4['status']?'error-chunk'!==_0x1a97b4['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x50462b){this['_mainView']['addCheckRunResult'](_0x50462b);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x467b62){this['_mainView']['showGeneralReviewCoreErrorView'](_0x467b62??Hi(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x19902d,_0x58dbc1){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x19902d,_0x58dbc1);}['setActiveStateInResults'](_0x2cc071){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x1a0327=>{_0x1a0327['id']===_0x2cc071&&_0x1a0327['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x15ef89=>_0x15ef89['setItemAsInactive']());}['updateChangeState'](_0x5a1acd,_0x480b57){'accepted'===_0x480b57||'rejected'===_0x480b57||'outdated'===_0x480b57?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x5a1acd,_0x480b57):this['_mainView']['reviewCheckResultsView']['showResult'](_0x5a1acd,_0x480b57);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x531686,_0x23be43,_0x490116,_0x1aa805,_0x14096b,_0x3262c5){this['_balloonSuggestionView']['showBalloon'](_0x531686,_0x23be43,_0x490116,_0x1aa805,_0x14096b,_0x3262c5);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x221a23){const _0x2add1d=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x16f6f1=>_0x16f6f1['id']===_0x221a23);return _0x2add1d?_0x2add1d['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class AIReviewCoreGeneralErrorView extends Nt{constructor(_0x40ac09){super(_0x40ac09),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x2b91d2=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x2b91d2['if']('isVisible','ck-hidden',_0x3adcfa=>!_0x3adcfa)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x2b91d2['to']('errorMessage')}]}]});}}class AIReviewCoreView extends Nt{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0xce1dcc,_0x296b4c){super(_0xce1dcc),this['reviewCoreHeader']=_0x296b4c['header'],this['generalErrorView']=new AIReviewCoreGeneralErrorView(_0xce1dcc),this['reviewCheckListView']=_0x296b4c['list'],this['reviewCheckListView']['delegate'](...Fn)['to'](this),this['reviewCheckResultsView']=_0x296b4c['results'],this['reviewCheckResultsView']['delegate'](...Fn)['to'](this),this['reviewCompletedView']=_0x296b4c['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'](_0x40265a){this['reviewCheckResultsView']['addResult'](_0x40265a),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'](_0x446225){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x446225;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class AIReviewCoreFinishReviewButtonView extends vt{constructor(_0x57b5b6,_0x25ba1a){super(_0x25ba1a),this['set']({'label':_0x57b5b6,'withText':!0x0,'class':Mi}),this['on']('execute',()=>{this['fire']('finishReview');});}}class AIReviewCoreUICheckResultsView extends Pt{['_resultViews'];['_resultsHeader'];['_resultsBody'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x1a3962,_0x17733b){super(_0x1a3962),this['_contents']=_0x17733b,this['_resultViews']=new _0x3127bc(),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['_resultsBody']=this['_createResultsBodyView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new AIDisclaimerView(_0x1a3962),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 _0x30c0c6=this['_createCombinedSkeletonLoader'](),_0x38c202=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x38c202['if']('isLoading','ck-ai_review__check-run_loading',_0x1448c7=>_0x1448c7),_0x38c202['if']('isResultReady','ck-ai_review__check-run_ready',_0x261bf0=>_0x261bf0),_0x38c202['if']('isVisible','ck-hidden',_0x4addd4=>!_0x4addd4)]},'children':[this['_resultsHeader'],this['_errorMessageView'],this['_resultsBody'],_0x30c0c6,this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear'](),this['_resultsBody']['element']&&(this['_resultsBody']['element']['scrollTop']=0x0);}['getResults'](){return this['_resultViews'];}['addResult'](_0x3f661e){const _0x5970e9=new AIReviewCoreReviewCheckListItemResultsView(this['locale'],_0x3f661e['id']);_0x5970e9['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x5970e9),_0x5970e9['resultResponseView']['element']['innerHTML']=_0x3f661e['contentDiffed'];}['hideResult'](_0x388d30,_0x2399cb){if('pending'===_0x2399cb)return;const _0x38eea6=this['_resultViews']['find'](_0x205095=>_0x205095['id']===_0x388d30);_0x38eea6&&(_0x38eea6['status']=_0x2399cb,_0x38eea6['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0xdb0081,_0x53e71b){if('pending'!==_0x53e71b)return;const _0x51eb42=this['_resultViews']['find'](_0x575f26=>_0x575f26['id']===_0xdb0081);_0x51eb42&&(_0x51eb42['status']=_0x53e71b,_0x51eb42['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x444457,_0x56b0a1){this['headerTitle']=_0x444457,this['headerSubtitle']=_0x56b0a1||'';}['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 AISkeletonView(this['locale'],Ss['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x2f69f0=new Nt(this['locale']),_0x2ac27f=[];for(let _0x59343f=0x0;_0x59343f<0x10;_0x59343f++){const _0x463abd=this['_createSkeletonLoader']();_0x463abd['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x2ac27f['push'](_0x463abd);}return _0x2f69f0['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x703c2f=>!_0x703c2f)]},'children':_0x2ac27f}),_0x2f69f0;}['_createResultsBodyView'](){const _0x9263cb=new Nt(this['locale']);return _0x9263cb['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x5a4069=>_0x5a4069)]},'children':this['_resultViews']}),_0x9263cb;}['_createErrorView'](){const _0x48a697=new Nt(this['locale']),_0x55ce30=new vt(this['locale']),t=this['locale']['t'];return _0x48a697['delegate']('retryReview')['to'](this),_0x55ce30['set']({'label':t('Try\x20again'),'withText':!0x0,'class':Ui+'\x20ck-ai_review__check-run-error-retry-button'}),_0x55ce30['on']('execute',()=>{this['fire']('retryReview');}),_0x48a697['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x297629=>!_0x297629),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x4924bf=>'chunk'===_0x4924bf)]},'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',_0x370648=>'chunk'===_0x370648)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x12a1ec=>'general'!==_0x12a1ec)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0xc7cac0=>'chunk'!==_0xc7cac0)]},'children':[{'text':Hi(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x55ce30]}),_0x48a697;}['_createCancelButtonView'](){const _0x391bea=new vt(this['locale']);return _0x391bea['set']({'label':Hi(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[Ui+'\x20ck-ai-button-stop-generating'],'icon':_0xdb5f07}),_0x391bea['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2c5b69=>_0x2c5b69),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x427e21=>_0x427e21)]}}),_0x391bea['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x391bea;}['_createToggleDiffButtonView'](){const _0xcec806=new vt(this['locale']);_0xcec806['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0xcec806['bind']('isEnabled')['to'](this,'isError',_0x1d20b6=>!_0x1d20b6),_0xcec806['extendTemplate']({'attributes':{'class':[Ui,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x897891=>!_0x897891),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x46d42a=>_0x46d42a)]}});const _0x4b08ce=Hi(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x15080b=Hi(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0xcec806['bind']('isOn')['to'](this,'isToggleDiffOn',_0x5db7c5=>_0x5db7c5),_0xcec806['bind']('icon')['to'](this,'isToggleDiffOn',_0x5be895=>_0x5be895?st:nt),_0xcec806['bind']('label')['to'](this,'isToggleDiffOn',_0xd05b49=>_0xd05b49?_0x4b08ce:_0x15080b),_0xcec806['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0xcec806;}['_createAcceptAllButtonView'](){const _0x3fdd5b=new vt(this['locale']);return _0x3fdd5b['set']({'label':Hi(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x3fdd5b['bind']('isEnabled')['to'](this,'isError',_0x56efc9=>!_0x56efc9),_0x3fdd5b['extendTemplate']({'attributes':{'class':[Mi,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x559bec=>!_0x559bec),this['bindTemplate']['if']('isCompleted','ck-hidden',_0xe4d4e2=>_0xe4d4e2)]}}),_0x3fdd5b['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x3fdd5b;}['_createExitReviewButtonView'](){const _0xa6afd4=new vt(this['locale']);return _0xa6afd4['set']({'label':Hi(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0xa6afd4['extendTemplate']({'attributes':{'class':[Bi,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2f4d44=>!_0x2f4d44),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5e4778=>_0x5e4778)]}}),_0xa6afd4['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0xa6afd4;}['_createResultHeaderView'](){const _0x2724f3=new Nt(this['locale']),_0x956113=this['_createTitleView']();return _0x2724f3['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x554bbe=>_0x554bbe)]},'children':[_0x956113,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x2724f3;}['_createTitleView'](){const _0x16cef7=new Nt(this['locale']),_0x4e46ea=new AISpinnerView();return _0x4e46ea['bind']('isVisible')['to'](this,'isResultReady',_0x5ef7bc=>!_0x5ef7bc),_0x16cef7['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x4e46ea,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4da6ac=>_0x4da6ac)]},'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',_0x98f4d1=>!_0x98f4d1)]},'children':[{'text':Hi(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x16cef7;}['_createFinishReviewButtonView'](){const _0x322a38=new AIReviewCoreFinishReviewButtonView(Hi(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x322a38['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x256e2c=>!_0x256e2c)]}}),_0x322a38['delegate']('finishReview')['to'](this),_0x322a38;}}class AIReviewCoreReviewCompletedView extends Pt{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x3f2636,_0x3b4fc0){super(_0x3f2636),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x3b4fc0['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x3b4fc0['headerText']);const _0x219ba7=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x219ba7['if']('isVisible','ck-hidden',_0x186b4f=>!_0x186b4f)]},'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':_0x3b4fc0['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x5a24f5){const _0x54f7e3=new AIReviewCoreFinishReviewButtonView(_0x5a24f5,this['locale']);return _0x54f7e3['delegate']('finishReview')['to'](this),_0x54f7e3;}['_createResultHeaderView'](_0x47f9de){const _0x562d2f=new Nt(this['locale']);return _0x562d2f['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':_0x47f9de}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x562d2f;}}class AIReviewCoreFormDropdownView extends Nt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x26b920,_0x5a1a0e){super(_0x26b920),this['_defaultValue']=_0x5a1a0e['default']||(_0x5a1a0e['data']['length']>0x0?_0x5a1a0e['data'][0x0]['id']:''),this['_defaultLabel']=_0x5a1a0e['data']['find'](_0x46ba10=>_0x46ba10['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=Gt(this['locale']);const _0x7554a9=this['_prepareListOptions'](_0x5a1a0e['data']);jt(this['_dropdownView'],_0x7554a9,{'role':'menu','ariaLabel':_0x5a1a0e['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x25d0d4=>{_0x25d0d4['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x542668=>{this['formValue']=_0x542668['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x542668['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'](_0x15f067=[]){const _0x253939=new dt();this['resetToDefault']();for(const _0xa46e67 of _0x15f067){const _0x596b8e=new Jt({'label':_0xa46e67['label'],'withText':!0x0,'role':'menuitemradio','id':_0xa46e67['id'],'model':_0xa46e67});_0x596b8e['bind']('isOn')['to'](this,'formValue',_0x2beae3=>_0x2beae3===_0x596b8e['id']);const _0x1c1081={'type':'button','model':_0x596b8e};_0x253939['add'](_0x1c1081);}return _0x253939;}}class AIReviewCoreFormManagerView extends Pt{['_formItem']=null;constructor(_0x3e04e6,_0x527843,_0x213d3d){super(_0x3e04e6),this['argsKey']=_0x527843?.['argsKey'];if('dropdown'===_0x527843['formType'])this['_formItem']=new AIReviewCoreFormDropdownView(this['locale'],_0x527843);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x444dd5=new _0x6cbb85(this['locale'],{'children':[this['_formItem']],'class':[_0x213d3d?'ck-form__row_with-submit':'']});_0x213d3d&&_0x444dd5['children']['add'](_0x213d3d),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x444dd5]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class AIReviewCorePromptInputView extends _0x23272a{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x15f60e){super(_0x15f60e),this['set']('isEmpty',!0x0),this['keystrokes']=new It(),this['minRows']=AIReviewCorePromptInputView['MIN_ROWS'],this['maxRows']=AIReviewCorePromptInputView['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 AIReviewCoreCustomCheckView extends Nt{['focusTracker']=new _t();['keystrokes']=new It();['focusCycler'];['_focusables']=new _0x3127bc();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x2d7e0b,_0x3f9e5c,_0x12dcd1=!0x1){super(_0x2d7e0b),this['_check']=_0x3f9e5c,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x3f9e5c['defaultModel']?_0x3f9e5c['defaultModel']['id']:'',this['_defaultLabel']=_0x3f9e5c['defaultModel']?_0x3f9e5c['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new te(this['locale'],()=>new AIReviewCorePromptInputView(_0x2d7e0b)),this['promptInputView']['fieldView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['fieldView']['on']('input',()=>{this['prompt']=this['promptInputView']['fieldView']['element']['value'];}),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelSelectionDropdownItems']=new dt(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x12dcd1),jt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x6cbb85(this['locale'],{'children':[this['promptInputView']]}),new _0x6cbb85(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0xc7a82e,_0xdf9261)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0xdf9261()):_0xdf9261();}),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}));}['render'](){super['render'](),([this['promptInputView'],this['_modelSelectionDropdown'],this['cancelButtonView'],this['submitButtonView']]['forEach'](_0x110b47=>{this['_focusables']['add'](_0x110b47),this['focusTracker']['add'](_0x110b47['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 _0x26cc81 of this['_getFormValidators']()){const _0x1935e3=_0x26cc81();if(_0x1935e3)return this['promptInputView']['errorText']=_0x1935e3,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return Hi(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x195a9e=new vt(this['locale']),t=this['locale']['t'];return _0x195a9e['set']({'label':t('Submit'),'withText':!0x0,'class':Mi}),_0x195a9e['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x195a9e;}['_createCancelButtonView'](){const _0x11846b=new vt(this['locale']),t=this['locale']['t'];return _0x11846b['set']({'label':t('Cancel'),'withText':!0x0,'class':Bi}),_0x11846b['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x17fa3e=>{_0x17fa3e['stopPropagation']();})}}),_0x11846b['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x11846b;}['_setModelList'](_0x11494c){this['_modelSelectionDropdownItems']['clear']();const _0x3a56a3=this['_check']['models'];if(_0x11494c)this['set']('modelDisplayMode','hidden');else{const _0x3503bf=0x1===_0x3a56a3['length'];this['set']('modelDisplayMode',_0x3503bf?'name':'selector');}if(this['resetToDefault'](),_0x3a56a3?.['length']){0x1===_0x3a56a3['length']&&this['set']('activeModelName',_0x3a56a3[0x0]['name']||_0x3a56a3[0x0]['id']);for(const _0x3ceb61 of _0x3a56a3){const _0x37eef0=new Jt({'label':_0x3ceb61['name'],'withText':!0x0,'role':'menuitemradio','id':_0x3ceb61['id'],'model':_0x3ceb61});_0x37eef0['bind']('isOn')['to'](this,'modelId',_0x37983f=>_0x37983f===_0x3ceb61['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x37eef0,'labelView':new ModelButtonLabelView(this['locale'],_0x3ceb61)});}}}['_createModelSelectionDropdown'](){const _0xec1ecb=Gt(this['locale']);return _0xec1ecb['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0xec1ecb['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':Bi}),_0xec1ecb['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x54d2a6=>'selector'===_0x54d2a6),this['listenTo'](_0xec1ecb,'execute',_0x800bfd=>{this['modelId']=_0x800bfd['source']['model']['id'],_0xec1ecb['buttonView']['label']=_0x800bfd['source']['label'];}),_0xec1ecb;}['_createModelNameView'](){const _0x4a5f32=new ModelNameView(this['locale']);return _0x4a5f32['bind']('text')['to'](this,'activeModelName',_0x26d374=>_0x26d374??''),_0x4a5f32['bind']('isVisible')['to'](this,'modelDisplayMode',_0x3311c4=>'name'===_0x3311c4),_0x4a5f32;}['_createActionsFooterView'](){const _0x1c7ec2=new Nt(this['locale']);return _0x1c7ec2['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']]}]}),_0x1c7ec2;}}class ModelNameView extends Nt{constructor(_0x63e8d9){super(_0x63e8d9),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x58e54b=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x58e54b['if']('isVisible','ck-hidden',_0x52d821=>!_0x52d821)]},'children':[{'text':_0x58e54b['to']('text')}]});}}class ModelButtonLabelView extends Ht{constructor(_0x4a2788,_0x2aad77){super();const _0x708b8a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x708b8a['to']('style'),'id':_0x708b8a['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x708b8a['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x2aad77['description']||'']}]}]});}}class AIReviewCoreReviewCommandListItemView extends Pt{['_formItemsCollection']=new _0x3127bc();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x476663,_0x1902c9,_0x58c444,_0x487361=!0x1){super(_0x476663),this['_hideModels']=_0x487361,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x1902c9['isParameterized']);const _0x6510e9=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',_0x4e7e02=>_0x4e7e02),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x5c41a6=>_0x5c41a6)],'style':{'--ck-ai-review-check-list-item-index':_0x58c444}},'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':_0x1902c9['title']}]},_0x6510e9]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x1902c9['description']?[{'text':_0x1902c9['description']}]:[]}]}]},..._0x1902c9['isParameterized']?[this['_createParameterizedView'](_0x1902c9)]:[],...'custom'===_0x1902c9['id']?[this['_createCustomView'](_0x1902c9,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x1902c9['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x1902c9['id'],'args':_0x1902c9['useArgs']?_0x1902c9['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&zt({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x15ae3a=>{_0x15ae3a['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x17d630=new xt();return _0x17d630['content']=rt,_0x17d630['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x17d630;}['_createParameterizedView'](_0x2ca8b7){const _0x7c010b=new Nt(),_0x519fb4=this['_createFormView'](_0x2ca8b7);return _0x7c010b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x11e1b6=>!_0x11e1b6)]},'children':[_0x519fb4]}),_0x7c010b;}['_createFormView'](_0xb4e54a){const _0x12bfb7=new Nt(),_0x5701bd=Array['isArray'](_0xb4e54a['options'])?_0xb4e54a['options']:[],_0x3c52e7=new vt(this['locale']),t=this['locale']['t'];_0x3c52e7['set']({'label':t('Submit'),'withText':!0x0,'class':Mi}),_0x3c52e7['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x34b15d=>{_0x34b15d['stopPropagation']();})}}),_0x3c52e7['on']('execute',()=>{const _0x21c035=[],_0x14a63c={};this['_formItemsCollection']['forEach'](_0xf253f4=>{_0x21c035['push'](_0xf253f4['value']),_0xb4e54a['useArgs']&&_0xb4e54a['options']&&(_0x14a63c[_0xf253f4['argsKey']]=_0xf253f4['value']);}),this['fire']('runReviewCheck',{'id':_0xb4e54a['id'],'params':_0x21c035['length']?_0x21c035:void 0x0,'args':Object['keys'](_0x14a63c)['length']?_0x14a63c:void 0x0});});const _0x25ffce=_0x5701bd['length'];return _0x5701bd['forEach']((_0x54bade,_0x2a430e)=>{const _0x5c2e03=_0x2a430e===_0x25ffce-0x1;this['_formItemsCollection']['add'](new AIReviewCoreFormManagerView(this['locale'],_0x54bade,_0x5c2e03?_0x3c52e7:null));}),_0x12bfb7['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x12bfb7;}['_createCustomView'](_0x213618,_0x11890f=!0x1){return this['_customCheckView']=new AIReviewCoreCustomCheckView(this['locale'],_0x213618,_0x11890f),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',_0x48109c=>!_0x48109c)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x49fc6a,_0x313781,_0x34a87d)=>{_0x34a87d||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class AIReviewCoreReviewCheckListView extends Pt{['_checkViews'];constructor(_0x35d28f){super(_0x35d28f),this['_checkViews']=new _0x3127bc(),this['_setupTemplate']();}['setChecks'](_0x23a96d,_0x2b77b2=!0x1){this['_checkViews']['clear']();for(const [_0x1ab49f,_0x49c312]of _0x23a96d['entries']()){const _0x4981a9=new AIReviewCoreReviewCommandListItemView(this['locale'],_0x49c312,_0x1ab49f,_0x2b77b2);_0x4981a9['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x4981a9);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x10299e of this['_checkViews'])_0x10299e instanceof AIReviewCoreReviewCommandListItemView&&_0x10299e['resetToDefault']();}['_setupTemplate'](){const _0x3cfadd=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x3cfadd['if']('isVisible','ck-hidden',_0x3d90b1=>!_0x3d90b1)]},'children':this['_checkViews']});}}class AIReviewModeUI extends AIReviewCoreUI{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x4f5b00=this['context']['plugins']['get']('AITabs'),_0x5ca732=this['context']['locale'],_0x364f82=new AIHeaderView(_0x5ca732,{'label':Hi(_0x5ca732,'AI_REVIEW_MODE'),'icon':_0xc8a0b9,'class':'ck-ai-header_review','showResizeButton':_0x4f5b00['showResizeButton']});return _0x364f82['delegate']('resizeTabs')['to'](_0x4f5b00),_0x364f82['bind']('isMaximized')['to'](_0x4f5b00['view'],'isMaximized',_0x4ce02b=>_0x4ce02b),new AIReviewCoreView(this['context']['locale'],{'header':_0x364f82,'list':new AIReviewCoreReviewCheckListView(_0x5ca732),'results':new AIReviewCoreUICheckResultsView(_0x5ca732,{'generalErrorText':Hi(_0x5ca732,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new AIReviewCoreReviewCompletedView(_0x5ca732,{'headerText':Hi(_0x5ca732,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':Hi(_0x5ca732,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':Hi(_0x5ca732,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x53ecb1=this['context']['plugins']['get']('AITabs');_0x53ecb1['view']['on']('activateTab',(_0x47326b,{newTab:_0xa0c324,oldTab:_0x147c3f})=>{'reviewMode'===_0xa0c324?this['fire']('getReviewCheckList'):'reviewMode'===_0x147c3f&&this['fire']('leaveReview');}),_0x53ecb1['view']['addTab']({'id':'reviewMode','buttonLabel':Hi(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0xc8a0b9,'order':0x0,'content':this['_mainView']});}}const Kn='review-',Wn=['softBreak'];class AIReviewCoreEditing extends _0x3cc0e4{static get['requires'](){return[_0x490f88,AIEditing];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];['_reviewEditingAttachedEditors']=new WeakSet();['_boundEditables']=new WeakMap();constructor(_0x211989){super(_0x211989),this['_domEmitter']=new(Ot())(),this['_eventEmitter']=new(Et())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x24a3b1=_0x2dd930=>this['_scheduleAttachReviewEditingToEditor'](_0x2dd930);if(this['_registerGlobalBalloonBlurHandler'](),this['context']instanceof _0x3cd9d5)return void _0x24a3b1(this['context']);const _0x16e005=this['context'];for(const _0x1cf74d of _0x16e005['editors'])_0x24a3b1(_0x1cf74d);this['listenTo'](_0x16e005['editors'],'add',(_0x1eeb71,_0x49ef83)=>{_0x24a3b1(_0x49ef83);}),this['listenTo'](_0x16e005['editors'],'remove',(_0x3ee03e,_0x15ca85)=>{for(const [_0x209aa2,_0x1234fb]of this['_markers'])_0x1234fb['editor']===_0x15ca85&&(this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x209aa2,'changeId':_0x1234fb['groupId']}),this['_markers']['delete'](_0x209aa2));});}['_scheduleAttachReviewEditingToEditor'](_0x3a7408){const _0x3926cb=()=>{'destroyed'!==_0x3a7408['state']&&_0x3a7408['conversion']&&this['_attachReviewEditingToEditor'](_0x3a7408);};if('ready'===_0x3a7408['state'])return void _0x3926cb();const _0x33a009=()=>{this['stopListening'](_0x3a7408,'ready',_0x33a009),_0x3926cb();};this['listenTo'](_0x3a7408,'ready',_0x33a009);}['_attachReviewEditingToEditor'](_0x1c2003){this['_reviewEditingAttachedEditors']['has'](_0x1c2003)||(_0x1c2003['conversion']['for']('editingDowncast')['markerToElement']({'model':Kn+'insert','view':(_0x257c7a,{writer:_0x2f5845})=>{const _0xa3474d=this['_markers']['get'](_0x257c7a['markerName']),_0x164e6e={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0xa3474d?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x257c7a['markerName']};return _0x2f5845['createUIElement']('span',_0x164e6e,function(_0x57a7d4){const _0x2a7059=this['toDomElement'](_0x57a7d4);return _0x2a7059['innerHTML']=_0xa3474d?.['content']?.['asString']||'',_0x2a7059;});}}),_0x1c2003['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Kn+'remove-only','view':_0x5362bc=>{const _0x4ec4f9=this['_markers']['get'](_0x5362bc['markerName']),_0x2592d6=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x4ec4f9?.['id']||'')&&_0x2592d6['push']('ck-ai_review__change_active'),{'classes':_0x2592d6,'attributes':{'data-marker-id':_0x5362bc['markerName']}};}}),_0x1c2003['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Kn+'remove-context','view':_0x102708=>{const _0x12182b=this['_markers']['get'](_0x102708['markerName']),_0x482c61=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x12182b?.['id']||'')&&_0x482c61['push']('ck-ai_review__change_active'),{'classes':_0x482c61,'attributes':{'data-marker-id':_0x102708['markerName']}};}}),_0x1c2003['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Kn+'remove-text','view':_0x405e59=>{const _0x907108=this['_markers']['get'](_0x405e59['markerName']),_0x141eea=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x907108?.['id']||'')&&_0x141eea['push']('ck-ai_review__change_active'),{'classes':_0x141eea,'attributes':{'data-marker-id':_0x405e59['markerName']}};}}),_0x1c2003['conversion']['for']('dataDowncast')['markerToElement']({'model':Kn+'suggestion-context','view':(_0x3ce234,{writer:_0x376ac8})=>_0x376ac8['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x3ce234['isOpening']?'start':'end')})}),_0x1c2003['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x34af8c,'view':_0x1053a9}),this['_updateMouseMarkerInteractionListeners'](_0x1c2003),this['listenTo'](_0x1c2003,'addRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x1c2003),{'priority':'lowest'}),this['listenTo'](_0x1c2003,'detachRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x1c2003),{'priority':'lowest'}),_0x1c2003['model']['document']['registerPostFixer'](_0x4c0ebc=>this['_validateMarkers'](_0x1c2003,_0x4c0ebc)),_0x1c2003['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x1c2003)),this['_reviewEditingAttachedEditors']['add'](_0x1c2003));}['_updateMouseMarkerInteractionListeners'](_0x32980e){let _0x430bae=this['_boundEditables']['get'](_0x32980e);_0x430bae||(_0x430bae=new Map(),this['_boundEditables']['set'](_0x32980e,_0x430bae));const _0x483f97=new Set(_0x32980e['ui']['getEditableElementsNames']());for(const _0x27b32c of _0x483f97){if(_0x430bae['has'](_0x27b32c))continue;const _0x415ce4=_0x32980e['ui']['getEditableElement'](_0x27b32c);_0x430bae['set'](_0x27b32c,_0x415ce4),this['_attachMouseMarkerInteractionListeners'](_0x415ce4);}for(const [_0x18892c,_0x18eac4]of _0x430bae)_0x483f97['has'](_0x18892c)||(_0x430bae['delete'](_0x18892c),this['_domEmitter']['stopListening'](_0x18eac4));}['_attachMouseMarkerInteractionListeners'](_0x51909e){this['_domEmitter']['listenTo'](_0x51909e,'mouseup',(_0x59b281,_0x2acabe)=>{const _0x5a2f39=_0x2acabe['target'],_0x5f3b81=this['_findMarkerElement'](_0x5a2f39);if(!_0x5f3b81)return;const _0x194bc0=_0x5f3b81['getAttribute']('data-marker-id'),_0x230349=_0x194bc0['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x194bc0,'changeId':_0x230349,'markerElement':()=>this['_findMarkerElementById'](_0x194bc0),'domEvent':_0x2acabe});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x51909e,'mouseover',(_0x47f041,_0x191001)=>{const _0x3413a7=_0x191001['target'],_0x14af61=_0x191001['relatedTarget'];let _0xde3afe=this['_findMarkerElement'](_0x3413a7);if(!_0xde3afe&&_0x14af61&&(_0xde3afe=this['_findMarkerElement'](_0x14af61)),!_0xde3afe)return;const _0x1e66a9=_0xde3afe['getAttribute']('data-marker-id'),_0x2b8a4c=_0x1e66a9['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x2b8a4c,'markerElement':()=>this['_findMarkerElementById'](_0x1e66a9),'domEvent':_0x191001});});}['_registerGlobalBalloonBlurHandler'](){this['_domEmitter']['listenTo'](document,'mouseover',_0xc92ffd((_0x12cb02,_0x15cef4)=>{const _0x3e4e75=_0x15cef4['target'];if(this['_findMarkerElement'](_0x3e4e75))return;_0x3e4e75['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8));}['getDocumentData'](){const _0x1c7290=this['context']['plugins']['get']('AIEditing'),_0x49e6a0=ls(this['context']);if(!_0x49e6a0['length'])throw new at('ai-get-editor-from-context-no-editor',this);const _0x2eee94=new Set(),_0x1771ac=[],_0xc41f78=new Map();for(const _0x242b57 of _0x49e6a0)for(const _0x1c4be1 of _0x242b57['model']['document']['getRoots']()){if('$graveyard'===_0x1c4be1['rootName'])continue;const _0x4c9d78=this['_buildDocumentDataSliceForRoot'](_0x242b57,_0x1c4be1,_0x1c7290,_0x2eee94);_0x1771ac['push'](_0x4c9d78['content']);for(const [_0x377379,_0x505ccb]of _0x4c9d78['elements'])_0xc41f78['set'](_0x377379,_0x505ccb);}return{'elements':_0xc41f78,'content':_0x1771ac['join']('')};}['_buildDocumentDataSliceForRoot'](_0x33347a,_0x37f1fc,_0xd28de2,_0x5c84d5){const _0x27eab4=_0x33347a['model'],_0x8230bf=new _0xd8720b();for(const _0x3e8a6a of _0x37f1fc['getChildren']())_0x8230bf['_appendChild'](_0x3e8a6a['_clone'](!0x0));for(const _0x58e6ff of _0x27eab4['markers']){const _0x272e82=_0x58e6ff['getRange']();_0x272e82&&_0x272e82['root']['rootName']===_0x37f1fc['rootName']&&_0x8230bf['markers']['set'](_0x58e6ff['name'],this['_changeRangeOwnerDocument'](_0x272e82['clone'](),_0x8230bf));}const _0xd3741d=new Map(),_0x1cd989=_0x27eab4['document']['version'],_0x4a9db5=new _0x5ae065({'ignoreElementEnd':!0x0,'startPosition':_0x27eab4['createPositionAt'](_0x8230bf,0x0)});for(const {item:_0x1578de}of _0x4a9db5){if(!_0x1578de['is']('$textProxy'))continue;const _0x1ba977=_0x1578de['parent'];if(!_0x1ba977||!_0x1ba977['is']('element'))continue;const _0x12ccb4=this['_upsertDataId'](_0x1ba977,()=>_0xd28de2['_nextDataId'](_0x5c84d5));_0x5c84d5['add'](_0x12ccb4);for(const _0x28d502 of _0x1ba977['getChildren']())_0x28d502['is']('element')&&(_0x28d502['name']&&Wn['includes'](_0x28d502['name'])||_0x5c84d5['add'](this['_upsertDataId'](_0x28d502,()=>_0xd28de2['_nextDataId'](_0x5c84d5))));let _0xca0f59=_0x1ba977;for(;_0xca0f59['parent']&&!_0xca0f59['parent']['is']('documentFragment');)_0xca0f59=_0xca0f59['parent'],_0xca0f59['hasAttribute'](_0x34af8c)&&_0xca0f59['_removeAttribute'](_0x34af8c);_0xd3741d['set'](_0x12ccb4,{'editor':_0x33347a,'rootName':_0x37f1fc['rootName'],'path':_0x1ba977['getPath'](),'documentVersion':_0x1cd989,'getContent':this['_createGetContentUsingDataIdFn'](_0xca0f59['_clone'](!0x0),_0x12ccb4,_0x33347a['data'])}),_0x4a9db5['jumpTo'](_0x27eab4['createPositionAfter'](_0x1ba977));}return{'content':_0x33347a['data']['processor']['toData'](_0x33347a['data']['toView'](_0x8230bf)),'elements':_0xd3741d};}['diffContent'](_0x28e906,_0x21fe3e,_0x5c5003,_0x5dab05=!0x1){const _0x4f6f64=[],_0x4b8959=_0x28e906['data']['parse'](_0x5c5003,'$documentFragment'),_0x38aa10=_0x28e906['data']['parse'](_0x21fe3e,'$documentFragment'),_0x51abf6=_0x28e906['model']['createPositionAt'](_0x38aa10,0x0);if(this['_haveSingleTopLevelElement'](_0x4b8959)){if(!this['_hasSameTopLevelElement'](_0x38aa10,_0x4b8959))return _0x4f6f64;}else{const _0x2e771e=_0x28e906['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x38aa10,_0x2e771e)||!this['_haveOnlyInlineContent'](_0x4b8959,_0x2e771e))return _0x4f6f64;}const _0x241216=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x21fe3e,_0x5c5003,{'targetEditor':_0x28e906,'anchor':_0x51abf6,'markDeletions':!0x0})['getOperations']()['filter'](_0x5e0c30=>'insert'===_0x5e0c30['type']||'marker'===_0x5e0c30['type']&&_0x5e0c30['name']['startsWith']('$markedRemove')),_0x3e813f=this['_groupAdjacentOperations'](_0x241216),_0x2697ff=[];if(_0x5dab05){if(_0x3e813f['length']){const _0x27cda7=_0x3e813f[0x0]['operations'][0x0],_0xd5788b='insert'===_0x27cda7['type']?_0x27cda7['position']:_0x27cda7['newRange']['start'],_0x3de767=this['_getPositionLimitingRange'](_0xd5788b,_0x28e906,'inside'),_0x37d92c=_0x3de767?_0x4b8959['getChild'](0x0)['getChildren']():_0x4b8959['getChildren'](),_0x4b3c65=_0x3de767||_0x28e906['model']['createRangeIn'](_0x38aa10),_0x2df28f=[new _0x1cab42('$markedRemove:synthetic'+ot(),null,_0x4b3c65,_0x28e906['model']['document']['model']['markers'],!0x0,_0x28e906['model']['document']['version']+0x1),new _0x32f2fc(_0x4b3c65['end'],_0x37d92c,_0x28e906['model']['document']['version']+0x2)];_0x2697ff['push']({'operations':_0x2df28f,'operationsIsolated':_0x2df28f,'groupOffset':0x0});}}else _0x2697ff['push'](..._0x3e813f);let _0x4bbccf=0x0;return _0x28e906['model']['change'](_0x4dde13=>{for(let _0x1183df=0x0;_0x1183df<_0x2697ff['length'];_0x1183df++){const _0x19f03d=_0x2697ff[_0x1183df],_0x56f728=_0x4dde13['createDocumentFragment']();for(const _0x3b1c2b of _0x38aa10['getChildren']())_0x4dde13['append'](_0x3b1c2b['_clone'](!0x0),_0x56f728);for(const _0x48a638 of _0x19f03d['operationsIsolated'])if('insert'===_0x48a638['type']){const _0x4bbdb0=_0x48a638;_0x4bbdb0['baseVersion']=null,_0x4bbdb0['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x4bbdb0,_0x56f728),_0x4dde13['batch']['addOperation'](_0x48a638),_0x28e906['model']['applyOperation'](_0x48a638);const _0x4ebd7a='suggestion:insertion:id:authorId:'+_0x4bbccf++,_0x1e166a=_0x28e906['model']['createRange'](_0x4bbdb0['position'],_0x4bbdb0['position']['getShiftedBy'](_0x4bbdb0['howMany']));_0x56f728['markers']['set'](_0x4ebd7a,_0x1e166a);}else{if('marker'===_0x48a638['type']&&_0x48a638['name']['startsWith']('$markedRemove')){const _0x3241b3=_0x48a638,_0x628fbf='suggestion:deletion:id:authorId:'+_0x4bbccf++;this['_changeOperationOwnerDocument'](_0x3241b3,_0x56f728),_0x56f728['markers']['set'](_0x628fbf,_0x3241b3['newRange']);}}if(_0x5dab05)_0x4f6f64['push']({..._0x19f03d,'context':this['_createGetContentFn'](_0x38aa10,_0x28e906['data']),'content':this['_createGetContentFn'](_0x38aa10,_0x28e906['data'])});else{const _0x4ce986=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x19f03d['operationsIsolated'][0x0]),_0x56f728),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x19f03d['operationsIsolated'][_0x19f03d['operationsIsolated']['length']-0x1]),_0x56f728),_0x28e906);_0x56f728['markers']['set'](Kn+'suggestion-context',new _0x5d6ed6(_0x4ce986['start'],_0x4ce986['end'])),_0x4f6f64['push']({..._0x19f03d,'context':this['_createGetContextFn'](_0x56f728,_0x28e906['data'],{'ellipsisBefore':_0x4ce986['hasContentBefore'],'ellipsisAfter':_0x4ce986['hasContentAfter']}),'content':this['_createGetContentFn'](_0x56f728,_0x28e906['data'])});}}}),_0x4f6f64;}['markChangePositionInEditorContent'](_0x3571a6,_0x15a6a4){if(!_0x3571a6['length'])return;const _0x176f3d=_0x3571a6[0x0]['parent']['id'],_0x3e3636=_0x15a6a4['elements']['get'](_0x176f3d);if(!_0x3e3636)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x176f3d);const _0x122c83=_0x3e3636['path'],_0x454409=_0x3e3636['editor'],_0x43ab6d=_0x454409['model']['document']['getRoot'](_0x3e3636['rootName']);if(!_0x43ab6d)return void console['warn']('No\x20model\x20root\x20found\x20for\x20name:\x20'+_0x3e3636['rootName']);const _0x22629a=_0x454409['model']['document']['history']['getOperations'](_0x3e3636['documentVersion']),_0x13d515=[];for(const _0x552c88 of _0x3571a6){const _0x350a03=_0x552c88['operationsIsolated']['map'](_0x1f114b=>this['_translateOperationToEditorContent'](_0x1f114b,_0x122c83,_0x43ab6d));if(!_0x350a03||!_0x350a03['length'])continue;const _0x3aafeb=_0x350a03['every'](_0xc08371=>'marker'===_0xc08371['type']&&_0xc08371['name']['startsWith']('$markedRemove')),_0x1f4a9d={'document':_0x454409['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x13d142=_0x2d44f8(_0x350a03,_0x22629a,_0x1f4a9d)['operationsA'];for(const _0x56d85a of _0x13d142)if('insert'===_0x56d85a['type']){const _0x503fe7=_0x56d85a,_0x2f7d6a=_0x503fe7['nodes'];_0x454409['model']['change'](_0x2124bc=>{const _0x2e6b1b=_0x2124bc['createDocumentFragment']();for(const _0x1e86ca of _0x2f7d6a)_0x2124bc['append'](_0x1e86ca['_clone'](!0x0),_0x2e6b1b);_0x13d515['push']({'start':_0x503fe7['position'],'end':_0x503fe7['position'],'type':'insert','groupId':_0x552c88['id'],'content':{'asString':this['_createGetContentFn'](_0x2e6b1b,_0x454409['data'])(),'asFragment':_0x2e6b1b}});});}else{if('marker'===_0x56d85a['type']&&_0x56d85a['name']['startsWith']('$markedRemove')){const _0x3f6a1f=_0x56d85a;let _0x54d4bc='remove-text';if(_0x3aafeb){const _0x5c35d0=this['_findAdjacentContextDistance'](_0x3f6a1f['newRange']['start'],'backward',_0x454409['model']['schema']),_0x5037e1=this['_findAdjacentContextDistance'](_0x3f6a1f['newRange']['end'],'forward',_0x454409['model']['schema']);if(_0x5c35d0||_0x5037e1){const _0x5b1214=_0x3f6a1f['newRange']['start']['getShiftedBy'](-_0x5c35d0),_0x30fb97=_0x3f6a1f['newRange']['end']['getShiftedBy'](_0x5037e1);_0x13d515['push']({'start':_0x5b1214,'end':_0x30fb97,'groupId':_0x552c88['id'],'type':'remove-context'});}else _0x54d4bc='remove-only';}_0x13d515['push']({'start':_0x3f6a1f['newRange']['start'],'end':_0x3f6a1f['newRange']['end'],'groupId':_0x552c88['id'],'type':_0x54d4bc});}}}this['_insertMarkers'](_0x13d515,_0x454409);}['clearAllMarkers'](){const _0x96dc57=new Map();for(const _0x222877 of this['_markers']['keys']()){const _0x479df9=this['_markers']['get'](_0x222877);_0x479df9?.['editor']&&(_0x96dc57['has'](_0x479df9['editor'])||_0x96dc57['set'](_0x479df9['editor'],[]),_0x96dc57['get'](_0x479df9['editor'])['push'](_0x222877));}for(const [_0x2b99f2,_0x262ac5]of _0x96dc57)_0x2b99f2['model']['change'](_0x2dcfb6=>{for(const _0x26eaaf of _0x262ac5)_0x2b99f2['model']['markers']['get'](_0x26eaaf)&&_0x2dcfb6['removeMarker'](_0x26eaaf);});this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){for(const _0x5aa289 of ls(this['context']))_0x5aa289['enableReadOnlyMode']('ai-review');}['switchToEdit'](){for(const _0xe99b44 of ls(this['context']))_0xe99b44['disableReadOnlyMode']('ai-review');}['applyChange'](_0x45ace0){const _0x359a1e=_0x45ace0['map'](_0x2f12de=>this['_getMarkersDataForGroup'](_0x2f12de))['flat'](),_0x23cc87=new Map();for(const _0x200f1d of _0x359a1e)_0x23cc87['has'](_0x200f1d['editor'])||_0x23cc87['set'](_0x200f1d['editor'],[]),_0x23cc87['get'](_0x200f1d['editor'])['push'](_0x200f1d);for(const [_0x29434a,_0x3d7c26]of _0x23cc87){const _0x1546ff=_0x29434a['model'];_0x1546ff['change'](_0x24a3dc=>{for(const _0x585c54 of _0x3d7c26){const _0xd68137=_0x29434a['model']['markers']['get'](_0x585c54['id']);if(_0xd68137){if('insert'===_0x585c54['type']){if(!_0x585c54['content'])continue;_0x1546ff['insertContent'](_0x585c54['content']['asFragment']||null,_0xd68137['getRange']()['start']);}else'remove-text'!==_0x585c54['type']&&'remove-only'!==_0x585c54['type']||_0x1546ff['deleteContent'](_0x1546ff['createSelection'](_0xd68137['getRange']()));_0x24a3dc['removeMarker'](_0x585c54['id']),this['_markers']['delete'](_0x585c54['id']);}}});}}['rejectChange'](_0x451dcd){const _0x6250f2=this['_getMarkersDataForGroup'](_0x451dcd),_0x19de02=new Map();for(const _0x22bd74 of _0x6250f2)_0x19de02['has'](_0x22bd74['editor'])||_0x19de02['set'](_0x22bd74['editor'],[]),_0x19de02['get'](_0x22bd74['editor'])['push'](_0x22bd74);for(const [_0x1b1b7a,_0x2f80fc]of _0x19de02)_0x1b1b7a['model']['change'](_0x4c6f60=>{for(const _0x37b201 of _0x2f80fc)_0x4c6f60['removeMarker'](_0x37b201['id']),this['_markers']['delete'](_0x37b201['id']);});}['getEditor'](){return ds(this['context']);}['getEditors'](){return ls(this['context']);}['getEditorForChange'](_0xf77b94){const _0x48c50f=this['_getMarkersDataForGroup'](_0xf77b94);return _0x48c50f[0x0]?.['editor'];}['getMarkerElementForChange'](_0x32e109){const _0x2a7134=Array['from'](this['_markers']['values']())['filter'](_0xe77ffe=>_0xe77ffe['groupId']===_0x32e109);if(!_0x2a7134['length'])return null;const _0x232c59=0x1===_0x2a7134['length']?_0x2a7134[0x0]:this['_sortMarkers'](_0x2a7134)[0x0],_0x4489db=_0x232c59['editor']['model']['markers']['get'](_0x232c59['id']);if(!_0x4489db)return null;return{'modelRange':_0x4489db['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x232c59['id'])};}['getContentElementForChange'](_0x3cfd41){const _0x2fa25a=Array['from'](this['_markers']['values']())['filter'](_0x40b4b3=>_0x40b4b3['groupId']===_0x3cfd41);if(!_0x2fa25a['length'])return null;const _0x217f27=0x1===_0x2fa25a['length']?_0x2fa25a[0x0]:this['_sortMarkers'](_0x2fa25a)[0x0],_0x1de3af=_0x217f27['editor'],_0x1253b1=_0x1de3af['model']['markers']['get'](_0x217f27['id']);if(!_0x1253b1)return null;const _0x419b55=_0x1253b1['getRange'](),_0x314802=_0x1de3af['editing']['view']['getDomRoot'](_0x419b55['root']['rootName'])||_0x1de3af['editing']['view']['getDomRoot']();if(!_0x314802||!_0x419b55)return null;let _0x455575=_0x419b55['start']['parent'];for(;_0x455575['parent']&&'$root'!==_0x455575['parent']['name'];)_0x455575=_0x455575['parent'];if(!_0x455575||!_0x455575['name'])return null;const _0x31a2e4=_0x314802['querySelector']('[data-marker-id=\x22'+_0x217f27['id']+'\x22]');if(!_0x31a2e4)return null;let _0x2e4ad3=null;_0x1de3af['model']['change'](_0x29d1b0=>{_0x2e4ad3=_0x29d1b0['createDocumentFragment'](),_0x29d1b0['append'](_0x455575['_clone'](!0x0),_0x2e4ad3);});const _0x22f00f=_0x1de3af['data']['toView'](_0x2e4ad3)['getChild'](0x0);return _0x31a2e4['closest'](_0x22f00f['name']);}['reactivateMarkers'](_0x19a68b){const _0x51fc12=this['_getMarkersDataForGroup'](_0x19a68b);if(!_0x51fc12['length'])return;const _0x24c591=Array['from'](this['_activeMarkers'])['sort'](),_0x367cbe=Array['from'](new Set(_0x51fc12['map'](_0x45f637=>_0x45f637['id'])))['sort']();_0x24c591['join']('|')!==_0x367cbe['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x19a68b));}['setMarkersInElementAsActive'](_0xb30821){const _0x4edf03=this['_getMarkersDataForGroup'](_0xb30821);if(!_0x4edf03['length'])return;const _0x3a06a2=_0x4edf03[0x0]['editor'],_0x1aa917=new Set(_0x4edf03['map'](_0x22f0cd=>_0x22f0cd['id'])),_0x4e920b=Array['from'](_0x1aa917['values']())['map'](_0x12bc11=>_0x3a06a2['model']['markers']['get'](_0x12bc11))['filter'](_0x416859=>!!_0x416859);_0x1aa917['forEach'](_0x5f20d1=>{this['_activeMarkers']['add'](_0x5f20d1);}),_0x3a06a2['model']['change'](()=>{_0x4e920b['forEach'](_0x260a92=>{_0x3a06a2['editing']['reconvertMarker'](_0x260a92);});});}['setAllMarkersAsInactive'](){const _0x363af1=Array['from'](this['_activeMarkers']);if(!_0x363af1['length'])return;this['_activeMarkers']['clear']();const _0x4ff6a6=new Map();for(const _0x3005b0 of _0x363af1){const _0x24954a=this['_markers']['get'](_0x3005b0);if(!_0x24954a)continue;const _0x40ba97=_0x24954a['editor'],_0xe869d0=_0x40ba97['model']['markers']['get'](_0x3005b0);_0xe869d0&&(_0x4ff6a6['has'](_0x40ba97)||_0x4ff6a6['set'](_0x40ba97,[]),_0x4ff6a6['get'](_0x40ba97)['push'](_0xe869d0));}for(const [_0x2c1ce9,_0xc7d492]of _0x4ff6a6)_0x2c1ce9['model']['change'](()=>{_0xc7d492['forEach'](_0x1f0135=>{_0x2c1ce9['editing']['reconvertMarker'](_0x1f0135);});});}['_getPositionLimitingRange'](_0x27c7a5,_0x116ff3,_0x1e59f8='outside'){if(!_0x27c7a5)return null;let _0x20c341=_0x27c7a5['parent'];for(;_0x20c341&&_0x20c341['parent']&&'$root'!==_0x20c341['parent']['name']&&!_0x116ff3['model']['schema']['isLimit'](_0x20c341)&&!_0x116ff3['model']['schema']['isBlock'](_0x20c341);)_0x20c341=_0x20c341['parent'];if(!_0x20c341||!_0x20c341['name']||'$root'===_0x20c341['name'])return null;let _0x1a81af=null;return _0x116ff3['model']['change'](_0x377d5d=>{_0x1a81af='inside'===_0x1e59f8?_0x377d5d['createRangeIn'](_0x20c341):_0x377d5d['createRangeOn'](_0x20c341);}),_0x1a81af;}['_validateMarkers'](_0x238801,_0xef1420){const _0xc456d0=Array['from'](this['_markers']['keys']()),_0x57d394=new Map();for(const _0x143d87 of _0xc456d0){const _0x224cfb=_0x238801['model']['markers']['get'](_0x143d87);if(!_0x224cfb)continue;const _0x2c37da=_0x224cfb['getStart']()['root']['rootName']+':'+_0x224cfb['getStart']()['path'][0x0];_0x57d394['has'](_0x2c37da)||_0x57d394['set'](_0x2c37da,[]),_0x57d394['get'](_0x2c37da)['push'](_0x224cfb);}const _0x56d22b=new Set();for(const _0x4f3cf5 of _0x238801['model']['document']['differ']['getChanges']()){let _0x1ed72d='',_0x3065d8=null;if('insert'===_0x4f3cf5['type'])_0x3065d8=new _0x5d6ed6(_0x4f3cf5['position'],_0x4f3cf5['position']['getShiftedBy'](_0x4f3cf5['length'])),_0x1ed72d=_0x4f3cf5['position']['root']['rootName']+':'+_0x4f3cf5['position']['path'][0x0];else{if('remove'!==_0x4f3cf5['type'])continue;_0x3065d8=new _0x5d6ed6(_0x4f3cf5['position']),_0x1ed72d=_0x4f3cf5['position']['root']['rootName']+':'+_0x4f3cf5['position']['path'][0x0];}const _0x253a95=_0x57d394['get'](_0x1ed72d)||[];if(_0x253a95['length']){for(const _0x112d04 of _0x253a95)if(_0x3065d8['root']['rootName']===_0x112d04['getRange']()['root']['rootName']&&('insert'!==_0x4f3cf5['type']||!_0x3065d8['containsRange'](_0x112d04['getRange']()))&&(_0x3065d8['isIntersecting'](_0x112d04['getRange']())||_0x3065d8['start']['isTouching'](_0x112d04['getRange']()['end'])||_0x3065d8['end']['isTouching'](_0x112d04['getRange']()['start']))){const _0xae37e4=this['_parseMarkerName'](_0x112d04['name']);Array['from'](this['_markers']['values']())['filter'](_0x552ca0=>_0x552ca0['groupId']===_0xae37e4['groupId'])['forEach'](_0x4db039=>_0x56d22b['add'](_0x4db039['id']));}}}if(_0x56d22b['size']){for(const _0x2ebd09 of _0x56d22b)_0xef1420['removeMarker'](_0x2ebd09);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x45b654){for(const {name:_0x4eeb7a,data:_0x35cc0b}of _0x45b654['model']['document']['differ']['getChangedMarkers']()){if(!_0x4eeb7a['startsWith'](Kn))continue;const _0x3e57c5=_0x35cc0b['oldRange'],_0x3ac7fd=_0x35cc0b['newRange'],_0x3aa1b5=_0x3e57c5&&'$graveyard'===_0x3e57c5['root']['rootName'],_0x5219f3=_0x3ac7fd&&'$graveyard'===_0x3ac7fd['root']['rootName'];if(_0x3aa1b5&&_0x5219f3)continue;const _0x27ab7d=this['_parseMarkerName'](_0x4eeb7a);this['_markers']['get'](_0x4eeb7a)&&(_0x5219f3||!_0x3ac7fd?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x4eeb7a,'changeId':_0x27ab7d['groupId']}):_0x3aa1b5&&_0x3ac7fd&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x4eeb7a,'changeId':_0x27ab7d['groupId']}));}}['_parseMarkerName'](_0x3d5cb5){const _0x497bc3=_0x3d5cb5['split'](':'),_0x187286=(_0x497bc3[0x1]||'')['split']('_');return{'prefix':_0x497bc3[0x0],'groupId':_0x187286[0x0],'suffix':_0x187286[0x1]};}['_translateOperationToEditorContent'](_0xaf7d2,_0x3a9532,_0x4b2f85){if('insert'===_0xaf7d2['type']){const _0x3fc42b=_0xaf7d2;return new _0x32f2fc(this['_changePosition'](_0x3a9532['concat'](_0x3fc42b['position']['offset']),_0x4b2f85),_0x3fc42b['nodes'],_0x3fc42b['baseVersion']);}if('marker'===_0xaf7d2['type']&&_0xaf7d2['name']['startsWith']('$markedRemove')){const _0x3d9676=_0xaf7d2;return new _0x1cab42(_0x3d9676['name'],_0x3d9676['oldRange'],this['_changeRange'](_0x3d9676['newRange'],_0x3a9532['concat'](_0x3d9676['newRange']['start']['offset']),_0x3a9532['concat'](_0x3d9676['newRange']['end']['offset']),_0x4b2f85),_0x3d9676['_markers'],_0x3d9676['affectsData'],_0x3d9676['baseVersion']);}return _0xaf7d2;}['_groupAdjacentOperations'](_0x3e7012){if(!_0x3e7012['length'])return[];const _0x174bf5=[];let _0x124f23=0x0,_0x24da0c=0x0,_0x71d804=[];for(let _0x11667b=0x0;_0x11667b<=_0x3e7012['length'];_0x11667b++){const _0x3b6524=_0x3e7012[_0x11667b],_0x199df1=_0x3e7012[_0x11667b-0x1];!_0x3b6524||_0x199df1&&!this['_getOperationEnd'](_0x199df1)['isTouching'](this['_getOperationStart'](_0x3b6524))?(_0x174bf5['push']({'operations':_0x71d804,'operationsIsolated':_0x71d804['map'](_0x4464aa=>this['_shiftOperation'](_0x4464aa['clone'](),-_0x24da0c)),'groupOffset':_0x124f23}),_0x71d804=_0x3b6524?[_0x3b6524]:[],_0x24da0c+=_0x124f23,_0x124f23=0x0):_0x71d804['push'](_0x3b6524),_0x3b6524&&'insert'===_0x3b6524['type']&&(_0x124f23+=_0x3b6524['howMany']);}return _0x174bf5;}['_findAdjacentContextDistance'](_0x2175fe,_0x437c25,_0x155f00,_0x24c9ab=0x1){const _0x27c850=new _0x5ae065({'startPosition':_0x2175fe,'direction':_0x437c25});let _0x540449=0x0;for(let _0x106aeb=0x0;_0x106aeb<_0x24c9ab;_0x106aeb++){let _0x1cd800=0x0,_0x523680=!0x1,_0x1563e6='forward'===_0x437c25?/^\W*\w+/:/\w+\W*$/;for(const {item:_0xf1cc5a}of _0x27c850)if(_0xf1cc5a['is']('$textProxy')){const _0x3bab55=_0x1563e6['exec'](_0xf1cc5a['data']);if(_0x3bab55&&_0x3bab55['length']){if(_0x1cd800+='forward'===_0x437c25?_0x3bab55['index']+_0x3bab55[0x0]['length']:_0xf1cc5a['data']['length']-_0x3bab55['index'],_0x3bab55[0x0]['length']!==_0xf1cc5a['data']['length'])break;_0x523680=!0x0,_0x1563e6='forward'===_0x437c25?/^\w+/:/\w+$/;}else{if(_0x523680)break;_0x1cd800+=_0xf1cc5a['offsetSize'];}}else{if(_0xf1cc5a['is']('element')){_0x155f00['isInline'](_0xf1cc5a)&&!_0x523680&&(_0x1cd800+=0x1);break;}}_0x540449+=_0x1cd800,_0x27c850['jumpTo'](_0x2175fe['getShiftedBy']('forward'===_0x437c25?_0x540449:-_0x540449));}return _0x540449;}['_getChangeContext'](_0x51b821,_0x2ac5ea,_0x2f3c72){const _0x325931=_0x2f3c72['model']['schema'],_0x25ee48=this['_findAdjacentContextDistance'](_0x51b821,'backward',_0x325931,0x6),_0x3c1beb=this['_findAdjacentContextDistance'](_0x2ac5ea,'forward',_0x325931,0x6),_0x2f8bb4=_0x51b821['getShiftedBy'](-_0x25ee48),_0x287817=_0x2ac5ea['getShiftedBy'](_0x3c1beb);return{'start':_0x2f8bb4,'end':_0x287817,'hasContentBefore':!_0x2f8bb4['isAtStart'],'hasContentAfter':!_0x287817['isAtEnd']};}['_insertMarkers'](_0x48e623,_0x119d1b){const _0x27f609=this['context']['plugins']['get']('AIEditing'),_0x1f2df6=new Set();_0x119d1b['model']['change'](_0x1acb05=>{for(const _0x52c743 of _0x48e623){const _0x2f9f64=''+Kn+_0x52c743['type']+':'+_0x52c743['groupId']+'_'+_0x27f609['_nextDataId'](_0x1f2df6);this['_markers']['set'](_0x2f9f64,{'id':_0x2f9f64,'groupId':_0x52c743['groupId'],'type':_0x52c743['type'],'content':_0x52c743['content'],'editor':_0x119d1b}),_0x1acb05['addMarker'](_0x2f9f64,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1acb05['createRange'](_0x52c743['start'],_0x52c743['end'])});}});}['_createGetContextFn'](_0x4cb6d2,_0x1854fa,_0x19ab59){let _0x441edc='';return()=>{if(!_0x441edc){const _0x439170=_0x1854fa['toView'](_0x4cb6d2,{'showSuggestionHighlights':!0x0});let _0x41a0a4=_0x439170['getChild'](0x0);if(_0x41a0a4['is']('containerElement')||(_0x41a0a4=_0x439170),!_0x41a0a4)return'';let _0x3ffe4d=!0x1;const _0x11a9f4=[];for(const _0x16c5d8 of _0x41a0a4['getChildren']())_0x16c5d8['is']('element','span')&&_0x16c5d8['hasClass']('ck-ai_review-marker_context-end')&&(_0x3ffe4d=!0x1),_0x3ffe4d&&_0x11a9f4['push'](_0x16c5d8),_0x16c5d8['is']('element','span')&&_0x16c5d8['hasClass']('ck-ai_review-marker_context-start')&&(_0x3ffe4d=!0x0);_0x41a0a4['_removeChildren'](0x0,_0x41a0a4['childCount']),_0x19ab59?.['ellipsisBefore']&&_0x41a0a4['_appendChild']('…'),_0x41a0a4['_appendChild'](_0x11a9f4),_0x19ab59?.['ellipsisAfter']&&_0x41a0a4['_appendChild']('…');const _0x1e2e49=_0x1854fa['htmlProcessor']['domConverter']['viewToDom'](_0x439170),_0x563a95=_0x1854fa['htmlProcessor']['htmlWriter']['getHtml'](_0x1e2e49);_0x441edc=_0x563a95;}return _0x441edc;};}['_createGetContentFn'](_0x4803c6,_0x25b684){let _0x55f2c0='';return()=>(_0x55f2c0||(_0x55f2c0=_0x25b684['stringify'](_0x4803c6,{'showSuggestionHighlights':!0x0})),_0x55f2c0);}['_createGetContentUsingDataIdFn'](_0x136f4d,_0xcc48b2,_0x37a814){let _0x59add1='';return()=>{if(!_0x59add1){const _0x2ddd83=_0x37a814['toView'](new _0xd8720b(_0x136f4d)),_0x245f6b=_0x37a814['htmlProcessor']['domConverter']['viewToDom'](_0x2ddd83)['querySelector']('[data-id=\x22'+_0xcc48b2+'\x22]');_0x59add1=_0x245f6b?.['outerHTML']||'';}return _0x59add1;};}['_findMarkerElement'](_0xf3c569,_0x46768f=0x5){let _0x127359=_0xf3c569,_0x2ccc71=null;for(let _0x4e52f6=0x0;_0x4e52f6<_0x46768f&&_0x127359;_0x4e52f6++){if(!_0x127359['className']){_0x127359=_0x127359['parentElement'];continue;}if(!(''+_0x127359['className'])['includes']('ck-ai_review-marker_')){_0x127359=_0x127359['parentElement'];continue;}if(!_0x127359['getAttribute']('data-marker-id'))break;_0x2ccc71=_0x127359;break;}return _0x2ccc71;}['_findMarkerElementById'](_0x5a1e69){const _0x14b16b=this['_markers']['get'](_0x5a1e69),_0xe9ad67=_0x14b16b?.['editor']??ds(this['context']),_0x5c450f=_0xe9ad67['model']['markers']['get'](_0x5a1e69);return _0x5c450f?_0x3d8b1f(_0xe9ad67['editing'],_0x5c450f):null;}['_getMarkersDataForGroup'](_0x1ad616){return Array['from'](this['_markers']['values']())['filter'](_0x5a90dc=>_0x5a90dc['groupId']===_0x1ad616);}['_getOperationStart'](_0xd62dbf){return'insert'===_0xd62dbf['type']?_0xd62dbf['position']:_0xd62dbf['newRange']['start'];}['_getOperationEnd'](_0x234cad,_0x326e9e=!0x1){return'insert'===_0x234cad['type']?_0x326e9e?_0x234cad['position']:_0x234cad['position']['getShiftedBy'](_0x234cad['howMany']):_0x234cad['newRange']['end'];}['_shiftOperation'](_0x3e8abf,_0x3a2a5a){return'insert'===_0x3e8abf['type']?_0x3e8abf['position']=_0x3e8abf['position']['getShiftedBy'](_0x3a2a5a):'marker'===_0x3e8abf['type']&&_0x3e8abf['newRange']&&(_0x3e8abf['newRange']=new _0x5d6ed6(_0x3e8abf['newRange']['start']['getShiftedBy'](_0x3a2a5a),_0x3e8abf['newRange']['end']['getShiftedBy'](_0x3a2a5a))),_0x3e8abf;}['_changeOperationOwnerDocument'](_0x2b7cd4,_0xec9cdf){'insert'===_0x2b7cd4['type']?_0x2b7cd4['position']=this['_changePositionOwnerDocument'](_0x2b7cd4['position'],_0xec9cdf):'marker'===_0x2b7cd4['type']&&_0x2b7cd4['newRange']&&(_0x2b7cd4['newRange']=this['_changeRangeOwnerDocument'](_0x2b7cd4['newRange'],_0xec9cdf));}['_changePositionOwnerDocument'](_0x2aabea,_0x1b7d23){return new _0x554d31(_0x1b7d23,_0x2aabea['path']);}['_changeRangeOwnerDocument'](_0x380522,_0x41952b){return new _0x5d6ed6(this['_changePositionOwnerDocument'](_0x380522['start'],_0x41952b),this['_changePositionOwnerDocument'](_0x380522['end'],_0x41952b));}['_changePosition'](_0x25a548,_0x12cf5a){return new _0x554d31(_0x12cf5a,[..._0x25a548]);}['_changeRange'](_0x149956,_0x3cf5e7,_0x3d3b36,_0x570e82){return new _0x5d6ed6(this['_changePosition'](_0x3cf5e7,_0x570e82),this['_changePosition'](_0x3d3b36,_0x570e82));}['_sortMarkers'](_0x163217){const _0x577923=_0x3262d6=>{switch(_0x3262d6){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x163217['sort']((_0x4988a6,_0x4c6e90)=>_0x577923(_0x4988a6['type'])-_0x577923(_0x4c6e90['type']));}['_hasSameTopLevelElement'](_0x56c2b2,_0x40751f){const _0x268154=_0x56c2b2['getChild'](0x0),_0x4258bf=_0x40751f['getChild'](0x0);return!(!_0x268154||!_0x4258bf)&&((!_0x268154['is']('element')||!_0x4258bf['is']('element')||_0x268154['name']===_0x4258bf['name'])&&!(_0x268154['is']('element')&&!_0x4258bf['is']('element')||!_0x268154['is']('element')&&_0x4258bf['is']('element')));}['_haveSingleTopLevelElement'](_0x4a29f0){return 0x1===_0x4a29f0['childCount'];}['_haveOnlyInlineContent'](_0x3f2089,_0x3f3829){for(const _0x476e52 of _0x3f2089['getChildren']())if(_0x476e52['is']('element')&&!_0x3f3829['isInline'](_0x476e52))return!0x1;return!0x0;}['_upsertDataId'](_0x49aa90,_0x2f08db){let _0x31d642=_0x49aa90['getAttribute'](_0x34af8c);return _0x31d642||(_0x31d642=_0x2f08db(),_0x49aa90['_setAttribute'](_0x34af8c,_0x31d642)),_0x31d642;}}class AIReviewCheckResult extends Et(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x37718c,contentNew:_0x1a8905,contentInitial:_0x16f11f,documentVersion:_0x27b14b}){super(),this['id']=_0x37718c,this['contentNew']=_0x1a8905,this['contentInitial']=_0x16f11f,this['documentVersion']=_0x27b14b;}}class AIReviewCheckResultChange extends ht(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x44da7d,_0x3d852c,_0x3d7f3a){super(),this['id']=_0x44da7d,this['parent']=_0x3d7f3a,this['_data']=_0x3d852c,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 AIReviewCheckRun extends ht(){['id']=ot();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x46044d,_0x2a03a6,_0x58b10a,_0x461994,_0x310334){super(),this['_sourceCheck']=_0x2a03a6,this['_documentData']=_0x46044d,this['_aiConnector']=_0x58b10a,this['_reviewParams']=_0x461994,this['_reviewArgs']=_0x310334,this['on']('change:status',(_0x1e83c3,_0x5ea5c5,_0x2a6ab0)=>{'aborted'==_0x2a6ab0&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x2a6ab0,'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'](_0x27ca3a=>'pending'===_0x27ca3a['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x46b4cb){this['_documentData']=_0x46b4cb;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x168d31=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x425c40 of _0x168d31)'unmodified'!==_0x425c40['data']['operation']&&('error'!==_0x425c40['data']['operation']?'review-metadata'!==_0x425c40['event']?this['_addReviewCheckResult'](_0x425c40['data']['dataId'],_0x425c40['data']['textDelta']):this['callId']=_0x425c40['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(_0x2a5800){this['_currentError']=_0x2a5800,_0x2a5800 instanceof Error&&_0x2a5800['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'](_0x2061bf,_0x428a05){const _0x102fa6=this['_results']['get'](_0x2061bf);if(!_0x102fa6)return;if(0x0===_0x428a05['length'])return;const _0x37369d=[];_0x428a05['forEach']((_0x5537ba,_0x3c1f70)=>{const _0x189e2a=new AIReviewCheckResultChange(_0x102fa6['id']+'-'+_0x3c1f70,_0x5537ba,_0x102fa6);_0x189e2a['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x189e2a,'status':_0x189e2a['status']});}),_0x189e2a['on']('change:isActivated',()=>{_0x189e2a['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x189e2a}):this['fire']('reviewCheckResultDeactivated',{'change':_0x189e2a});}),this['_changes']['push'](_0x189e2a),_0x37369d['push'](_0x189e2a);}),this['fire']('reviewCheckResultReady',{'changes':_0x37369d,'result':_0x102fa6,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x430842){const _0x3fbfcf=this['_changes']['find'](_0x4709dd=>_0x4709dd['id']===_0x430842);return!(!_0x3fbfcf||'pending'!==_0x3fbfcf['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x1fa7c3=>!0x0===_0x1fa7c3['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0xcf9a63=>'pending'===_0xcf9a63['status']);}['getChangeById'](_0x220204){return this['_changes']['find'](_0x3b22e3=>_0x3b22e3['id']===_0x220204);}['markAllChangesAsAccepted'](){for(const _0x1f8fd8 of this['_changes'])'pending'===_0x1f8fd8['status']&&(_0x1f8fd8['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x458648){const _0x49a66e=this['_changes']['find'](_0x547cbc=>_0x547cbc['id']===_0x458648);_0x49a66e&&'pending'===_0x49a66e['status']&&(_0x49a66e['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0xb4697f){const _0x3cc7c8=this['_changes']['find'](_0x4c1b0c=>_0x4c1b0c['id']===_0xb4697f);_0x3cc7c8&&'pending'===_0x3cc7c8['status']&&(_0x3cc7c8['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x5ad0fe){const _0x4ab34c=this['_changes']['find'](_0x1c1aad=>_0x1c1aad['id']===_0x5ad0fe);_0x4ab34c&&'pending'===_0x4ab34c['status']&&(_0x4ab34c['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x2e6ee7){const _0x3ad427=this['_changes']['find'](_0x450c28=>_0x450c28['id']===_0x2e6ee7);_0x3ad427&&'outdated'===_0x3ad427['status']&&(_0x3ad427['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x37f67f){this['_changes']['filter'](_0x251274=>_0x251274['isActivated']&&_0x251274['id']!==_0x37f67f)['forEach'](_0x4c3e65=>{_0x4c3e65['isActivated']=!0x1;});const _0x518572=this['_changes']['find'](_0x3db1a4=>_0x3db1a4['id']===_0x37f67f);_0x518572&&'pending'===_0x518572['status']&&(_0x518572['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x17e52a=>_0x17e52a['isActivated'])['forEach'](_0x21e59c=>{_0x21e59c['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x311025){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x30047d;if(_0x311025){const _0x4a83a9=this['_changes']['find'](_0x50e59a=>_0x50e59a['id']===_0x311025);if(_0x4a83a9&&_0x4a83a9['isRated'])return;_0x4a83a9&&(_0x30047d=_0x4a83a9['parent']['id'],_0x4a83a9['isRated']=!0x0);}const _0x575816={'positiveCount':this['_changes']['filter'](_0x48c44b=>'accepted'===_0x48c44b['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x575816,this['callId'],_0x30047d);}['_addReviewCheckResult'](_0x2ab4ca,_0x5a85db){const _0x2055d2=this['_documentData']['elements']['get'](_0x2ab4ca);if(!_0x2055d2)return;const _0x4777dd=_0x2055d2['getContent']();if(_0x4777dd===_0x5a85db)return;const _0x548a14=new AIReviewCheckResult({'id':_0x2ab4ca,'contentInitial':_0x4777dd,'contentNew':_0x5a85db,'documentVersion':_0x2055d2['documentVersion']});this['_results']['set'](_0x548a14['id'],_0x548a14),this['fire']('reviewCheckResultAdded',{'result':_0x548a14,'source':this,'editor':_0x2055d2['editor']});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x234451=>'pending'===_0x234451['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x3ea9a9=>'pending'===_0x3ea9a9['status'])['length']&&(this['status']='finished'));}}class AIReviewSystemCheckRun extends AIReviewCheckRun{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x3c1542=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x1aa990=0x0;_0x1aa990<this['_reviewParams']['length'];_0x1aa990++){if(!this['_reviewParams'][_0x1aa990]||!this['_sourceCheck']['options'][_0x1aa990])continue;const _0xbcb101=this['_sourceCheck']['options'][_0x1aa990],_0x8c077a=_0xbcb101['data']?.['find'](_0x1fbb96=>_0x1fbb96['id']===this['_reviewParams'][_0x1aa990]);_0x8c077a&&_0x3c1542['push'](_0x8c077a['label']);}return _0x3c1542['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x371900,_0x1281e2,_0x9d9e06){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x1281e2,_0x371900,_0x9d9e06);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class AIReviewCoreController extends _0x3cc0e4{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[AIConnector];}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(_0x5cbdf1,_0x2ad819)=>{const _0xf5cdfb=this['_aiReviewCheckList']['getCheckById'](_0x2ad819['id']);if(_0xf5cdfb){this['_onReviewCheckRun'](_0x2ad819),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x2ad819,_0xf5cdfb),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x2b5812,_0x5ce926)=>{switch(_0x5ce926['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x5ce926);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 at('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new at('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'!==_0x5ce926['status']&&'error-chunk'!==_0x5ce926['status']&&'error-general'!==_0x5ce926['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x36221e,_0x487d53)=>{if(!this['_currentReviewCheckRun'])throw new at('ai-review-mode-no-current-check-run',this);const _0x2ff33b=this['_diffContent'](_0x487d53['editor'],_0x487d53['result']['contentInitial'],_0x487d53['result']['contentNew']);_0x487d53['source']['addResultChanges'](_0x487d53['result']['id'],_0x2ff33b);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x2f699c,_0xa49b3d)=>{for(const _0x5760e7 of _0xa49b3d['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x5760e7);this['_markChangePositionInEditorContent'](_0xa49b3d['changes'],_0xa49b3d['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x1900de,_0x8eafb4)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x8eafb4['change']['id'],_0x8eafb4['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x351790,_0xd412d4)=>{this['_onReviewCheckResultActivated'](_0xd412d4);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x4c30a9){_0x4c30a9 instanceof Error&&_0x4c30a9['message']['includes']('ai-request-aborted')||(_0x4c30a9 instanceof at?this['_logError'](_0x4c30a9):this['_logError'](new at('ai-review-mode-check-run-failed',this,void 0x0,_0x4c30a9)));}}else this['_logError'](new at('ai-review-mode-source-check-not-found',this,{'checkId':_0x2ad819['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 _0x7c4f2d=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x7c4f2d['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x7c4f2d['map'](_0x2faadb=>_0x2faadb['id']));const _0x5601f7=this['_currentReviewCheckRun'];_0x5601f7['markAllChangesAsAccepted'](),_0x5601f7['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x57ff64,_0x1dcc0a)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x1dcc0a['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x1dcc0a['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x1dcc0a['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x1dcc0a['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x3ddc82,_0x21e029)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x21e029['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x21e029['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x21e029['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x21e029['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',(_0x416db1,_0x35c64d)=>{this['_onActivateChange'](_0x35c64d);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x4456a8,_0x3a6380)=>{this['_onDeactivateChange'](_0x3a6380);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x56365d,_0x3918c2)=>{this['_onChangeMarkerClicked'](_0x56365d,_0x3918c2);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x1b2239,_0x47e356)=>{this['_onChangeMarkerHovered'](_0x1b2239,_0x47e356);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0xf66c73,_0x2221bd)=>{this['_onChangeMarkerRemoved'](_0xf66c73,_0x2221bd);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x36d9bd,_0x38d1aa)=>{this['_onChangeMarkerRestored'](_0x36d9bd,_0x38d1aa);});}['_createReviewCheckRun'](_0x5ddc9c,_0x455dbe){return new AIReviewSystemCheckRun(this['_aiReviewCoreEditing']['getDocumentData'](),_0x455dbe,this['_aiConnector'],_0x5ddc9c['params'],_0x5ddc9c['args']);}['_onChangeMarkerRemoved'](_0x423fb6,_0x19ddcd){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x19ddcd['changeId']);}['_onChangeMarkerRestored'](_0x1e5c58,_0x30a647){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x30a647['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x1e5c98=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x1e5c98&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;for(const _0x32cca8 of this['_aiReviewCoreEditing']['getEditors']())_0x32cca8['editing']['view']['change'](_0x4cf34f=>{for(const _0x44a341 of _0x32cca8['editing']['view']['document']['getRoots']())_0x4cf34f['removeClass']('ck-ai_review-diff',_0x44a341),_0x4cf34f['removeClass']('ck-ai_review-highlights',_0x44a341),_0x4cf34f['removeClass']('ck-ai-translate-mode-content',_0x44a341);});}['_getTranslationWithDefault'](_0x44fa24,_0x10f226){const _0x445f9c=Hi(this['context']['locale'],_0x44fa24);return _0x445f9c===_0x44fa24?_0x10f226:_0x445f9c;}['_logError'](_0x2f0073,_0x45f087=!0x1){Ct(_0x2f0073['message']),_0x45f087||(_0x2f0073['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x12b2bb){if('content'===this['_changeActivationSource']){const _0x44b7d1=this['_aiReviewCoreUi']['getChangeElement'](_0x12b2bb);_0x44b7d1&&ft(_0x44b7d1['closest']('.ck-ai_review__check-run-result')||_0x44b7d1);}else{if('panel'===this['_changeActivationSource']){const _0x5c9e81=this['_getChangeContentElement'](_0x12b2bb);if(!_0x5c9e81)return;wt({'target':_0x5c9e81,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}const Yn=[{'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 AIReviewCheck{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x1481ee){this['id']=_0x1481ee['id'],this['commandId']=_0x1481ee['commandId'],this['title']=_0x1481ee['title'],this['description']=_0x1481ee['description'],this['isParameterized']=_0x1481ee['isParameterized'],this['useArgs']=_0x1481ee['useArgs'],this['options']=_0x1481ee['options'],this['args']=_0x1481ee['args'];}}class AIReviewCheckList extends ht(){['_checks']=[];['setupChecks'](_0x262646){this['_checks']=_0x262646['map'](_0x1ad043=>new AIReviewCheck(_0x1ad043));}get['checks'](){return this['_checks'];}['getCheckById'](_0x406a8f){return this['checks']['find'](_0x10d130=>_0x10d130['id']===_0x406a8f);}['removeCheckById'](_0x2757f9){this['_checks']=this['_checks']['filter'](_0x35c47c=>_0x35c47c['id']!==_0x2757f9);}}class AIReviewCheckCustom extends AIReviewCheck{['_models']=[];['_defaultModel']=null;constructor(_0x201949,_0x5ca7a0,_0x3caf33){super(_0x201949),this['_models']=_0x5ca7a0,this['_defaultModel']=_0x3caf33;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class AIReviewCheckExtra extends AIReviewCheck{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x240ab7,_0x831723,_0x52c4e9){super(_0x240ab7),this['prompt']=_0x240ab7['prompt'],this['model']=_0x240ab7['model'],this['model']?this['_defaultModel']=_0x831723['find'](_0x3eb5a9=>_0x3eb5a9['id']===this['model'])||null:this['_defaultModel']=_0x52c4e9;}get['defaultModel'](){return this['_defaultModel'];}}class AIReviewModeCheckList extends AIReviewCheckList{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x345de3,_0x5cebd4,_0x28e1c8){super(),this['_allModels']=_0x345de3,this['_recommendedModels']=_0x5cebd4,this['_defaultModel']=_0x28e1c8;}['setupChecks'](_0x16f49f){this['_checks']=_0x16f49f['map'](_0x40473d=>!0x0===_0x40473d['isExtra']?new AIReviewCheckExtra(_0x40473d,this['_allModels'],this['_defaultModel']):'custom'===_0x40473d['id']?new AIReviewCheckCustom(_0x40473d,this['_recommendedModels'],this['_defaultModel']):new AIReviewCheck(_0x40473d));}}class AIReviewCustomCheckRun extends AIReviewCheckRun{['_prompt'];['_model'];constructor(_0x40afca,_0x2f61c6,_0x54b1f4,_0x44e4ab,_0x43392c){super(_0x54b1f4,_0x44e4ab,_0x43392c),this['_prompt']=_0x40afca,this['_model']=_0x2f61c6;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0xac723f,_0x4bb652,_0x523d8f){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x4bb652,_0xac723f,_0x523d8f);}}class AIReviewExtraCheckRun extends AIReviewCustomCheckRun{get['subTitle'](){return'';}set['prompt'](_0x81e2a2){this['_prompt']=_0x81e2a2;}set['model'](_0x53ad37){this['_model']=_0x53ad37;}}class AIReviewModeController extends AIReviewCoreController{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x102172){super(_0x102172),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',Yn['map'](_0x2b6d57=>_0x2b6d57['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x3a036f,_0x121ceb)=>{this['_isDiffOn']=_0x121ceb['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x86e0be,_0x226265){return _0x86e0be['isCustom']?new AIReviewCustomCheckRun(_0x86e0be['args']['prompt'],_0x86e0be['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x226265,this['_aiConnector']):_0x226265['isExtra']?new AIReviewExtraCheckRun(_0x226265['prompt'],_0x226265['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x226265,this['_aiConnector']):new AIReviewSystemCheckRun(this['_aiReviewCoreEditing']['getDocumentData'](),_0x226265,this['_aiConnector'],_0x86e0be['params'],_0x86e0be['args']);}['_onReviewCheckResultActivated'](_0x5c96ee){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x5c96ee['change']['id']),this['_scrollToChange'](_0x5c96ee['change']['id']);const _0x161a1f=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x5c96ee['change']['id']);if(!_0x161a1f)return;const _0x588533=this['_aiReviewCoreEditing']['getEditorForChange'](_0x5c96ee['change']['id'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x5c96ee['change'],()=>_0x161a1f['getElement'](),void 0x0,'click',this['_getBalloonDomRoot'](_0x588533,_0x161a1f['modelRange']['root']['rootName']),_0x588533?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x5c96ee['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x261408){this['_currentReviewCheckRun']&&'click'===_0x261408['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x261408['id']));}['_onDeactivateChange'](_0x120aa9){this['_currentReviewCheckRun']&&'balloon'===_0x120aa9['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x27be06,_0x426c76){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x426c76['changeId']);const _0x113007=this['_currentReviewCheckRun']['getChangeById'](_0x426c76['changeId']);if(!_0x113007)return;const _0x429767=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x426c76['changeId']),_0x147b1e=this['_aiReviewCoreEditing']['getEditorForChange'](_0x426c76['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x113007,_0x426c76['markerElement'],_0x426c76['domEvent'],'click',this['_getBalloonDomRoot'](_0x147b1e,_0x429767?.['modelRange']['root']['rootName']),_0x147b1e?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x487fe3,_0x1cf487){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x236fa8=this['_currentReviewCheckRun']['getChangeById'](_0x1cf487['changeId']);if(!_0x236fa8)return;const _0x5483e9=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x1cf487['changeId']),_0x23a2ba=this['_aiReviewCoreEditing']['getEditorForChange'](_0x1cf487['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x236fa8,_0x1cf487['markerElement'],_0x1cf487['domEvent'],'hover',this['_getBalloonDomRoot'](_0x23a2ba,_0x5483e9?.['modelRange']['root']['rootName']),_0x23a2ba?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x3f5478){const _0x52f728=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x3f5478);return _0x52f728?_0x52f728['getElement']():null;}['_markChangePositionInEditorContent'](_0x139f30,_0x4b326b){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x139f30,_0x4b326b);}['_diffContent'](_0x349662,_0x4bf2ec,_0x20ed93){return this['_aiReviewCoreEditing']['diffContent'](_0x349662,_0x4bf2ec,_0x20ed93,!0x1);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x25f122){_0x25f122?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon']();for(const _0x401780 of this['_aiReviewCoreEditing']['getEditors']())_0x401780['editing']['view']['change'](_0x1a67d6=>{for(const _0x2ce202 of _0x401780['editing']['view']['document']['getRoots']()){for(const _0x5515c6 of _0x2ce202['getClassNames']())_0x5515c6['startsWith']('ck-ai_review-')&&_0x1a67d6['removeClass'](_0x5515c6,_0x2ce202);_0x1a67d6['addClass'](_0x25f122?'ck-ai_review-diff':'ck-ai_review-highlights',_0x2ce202);}});}['_getBalloonDomRoot'](_0x49a61b,_0x1c386b){const _0x8c36e0=_0x49a61b['editing']['view'];if(_0x1c386b){const _0xb1babb=_0x8c36e0['getDomRoot'](_0x1c386b);if(_0xb1babb)return _0xb1babb;}return _0x8c36e0['getDomRoot']()??void 0x0;}async['_getChecksList'](){const _0x154f6e=[...Yn,...this['_getExtraChecks']()],_0x1ffa8b=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x1ffa8b,_0x154f6e);let _0x575b89=_0x154f6e;this['_hasDefaultAvailableCommands']||(_0x575b89=_0x1ffa8b['map'](_0x3321f4=>_0x154f6e['find'](_0x484aa1=>_0x484aa1['id']===_0x3321f4))['filter'](_0x3a7263=>!!_0x3a7263)),_0x575b89=_0x575b89['map'](_0x10c96f=>_0x10c96f['isExtra']?_0x10c96f:this['_translateReviewCheck'](_0x10c96f));const _0x424d14=_0x575b89['some'](_0x2fb80a=>_0x2fb80a['isExtra']||'custom'===_0x2fb80a['id']);let _0xd64c29=[],_0x1e76c0=[],_0x5ca5be=null;if(_0x424d14){const _0x2922c7=await this['_getModels']();_0xd64c29=_0x2922c7['all'],_0x1e76c0=_0x2922c7['recommended'],_0x5ca5be=_0x2922c7['default'];}const _0x2969a2=new AIReviewModeCheckList(_0xd64c29,_0x1e76c0,_0x5ca5be);return _0x2969a2['setupChecks'](_0x575b89),_0x424d14&&this['_filterChecksWithMissingModel'](_0x2969a2),_0x2969a2;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x49a193=>({'id':_0x49a193['id'],'commandId':_0x49a193['id'],'title':_0x49a193['label'],'description':_0x49a193['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x49a193['prompt'],'model':_0x49a193['model']}));}['_logErrorForNonExistentChecks'](_0x29cd8d,_0x30b6e4){const _0x10d52b=_0x29cd8d['filter'](_0x4852b2=>!_0x30b6e4['some'](_0x1c9843=>_0x1c9843['id']===_0x4852b2));_0x10d52b['length']&&this['_logError'](new at('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x10d52b['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x1d5532=new AIModels({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x1d5532['getAll'](),'recommended':await _0x1d5532['getAvailableModels'](),'default':await _0x1d5532['getDefault']()};}catch(_0x2462b8){return this['_logError'](new at('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x2462b8)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x2ee95f){const _0x5f3b30='AI_REVIEW_CHECK_'+_0x2ee95f['id']['toUpperCase']()['replaceAll']('-','_'),_0x253026={..._0x2ee95f,'title':this['_getTranslationWithDefault'](_0x5f3b30+'_TITLE',_0x2ee95f['title']),'description':this['_getTranslationWithDefault'](_0x5f3b30+'_DESCRIPTION',_0x2ee95f['description'])};return _0x2ee95f['options']&&(_0x253026['options']=_0x2ee95f['options']['map'](_0x421989=>({..._0x421989,'label':this['_getTranslationWithDefault'](_0x5f3b30+'_OPTIONS_LABEL',_0x421989['label']||''),'data':_0x421989['data']?_0x421989['data']['map'](_0x54733f=>({..._0x54733f,'label':this['_getTranslationWithDefault'](_0x5f3b30+'_OPTIONS_DATA_'+_0x54733f['id']['toUpperCase'](),_0x54733f['label'])})):void 0x0}))),_0x253026;}['_filterChecksWithMissingModel'](_0x176c8d){const _0x35478b=[];_0x176c8d['checks']['forEach'](_0x11261b=>{(_0x11261b instanceof AIReviewCheckExtra&&!_0x11261b['defaultModel']||_0x11261b instanceof AIReviewCheckCustom&&!_0x11261b['models']['length'])&&_0x35478b['push'](_0x11261b['id']);}),_0x35478b['length']&&_0x35478b['forEach'](_0x514af1=>{_0x176c8d['removeCheckById'](_0x514af1),this['_logError'](new at('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x514af1}),!0x0);});}}class AIReviewMode extends _0x3cc0e4{static get['requires'](){return[AIReviewModeController,AIReviewModeUI,AIReviewCoreEditing];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class AITranslateCheck extends AIReviewCheck{get['apiId'](){return'translate';}}class AITranslateCheckList extends AIReviewCheckList{['setupChecks'](_0x4276a0){this['_checks']=_0x4276a0['map'](_0x131d5a=>new AITranslateCheck(_0x131d5a));}}class AITranslateCheckRun extends AIReviewSystemCheckRun{['_title'];constructor(_0x5a4d30,_0x2c145d,_0x588c6b,_0x2fa32b,_0x160127,_0x44b394){super(_0x5a4d30,_0x2c145d,_0x588c6b,_0x160127,_0x44b394),this['_title']=_0x2fa32b;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class AITranslateController extends AIReviewCoreController{static get['pluginName'](){return'AITranslateController';}constructor(_0x451f6d){super(_0x451f6d),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'](_0x3c8190,_0x5b2585){return new AITranslateCheckRun(this['_aiReviewCoreEditing']['getDocumentData'](),_0x5b2585,this['_aiConnector'],Hi(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x3c8190['params'],_0x3c8190['args']);}['_onReviewCheckResultActivated'](_0x4d6df5){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x4d6df5['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x4d6df5['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x32ab3d){this['_currentReviewCheckRun']&&('hover'===_0x32ab3d['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x32ab3d['id'])),'click'===_0x32ab3d['uiInteraction']&&this['_scrollToChange'](_0x32ab3d['id']));}['_onDeactivateChange'](_0x1bd20b){this['_currentReviewCheckRun']&&'panel'===_0x1bd20b['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x45c592,_0x36dfd0){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x36dfd0['changeId']),this['_scrollToChange'](_0x36dfd0['changeId']));}['_onChangeMarkerHovered'](_0x7553ab,_0x5027bf){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x5027bf['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x5027bf['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x41bab2){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x41bab2);}['_markChangePositionInEditorContent'](_0x227d85,_0x4f3c31){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x227d85,_0x4f3c31);}['_diffContent'](_0x230783,_0x3873d9,_0x50cf42){return this['_aiReviewCoreEditing']['diffContent'](_0x230783,_0x3873d9,_0x50cf42,!0x0);}['_onReviewCheckRun'](){for(const _0x5515b2 of this['_aiReviewCoreEditing']['getEditors']())_0x5515b2['editing']['view']['change'](_0xf01557=>{for(const _0x3117e3 of _0x5515b2['editing']['view']['document']['getRoots']())_0xf01557['addClass']('ck-ai-translate-mode-content',_0x3117e3);});}async['_getChecksList'](){const _0x2e80c0=[],_0x5550ed=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x1d3f11 of _0x5550ed)_0x2e80c0['push']({'title':_0x1d3f11['label'],'id':_0x1d3f11['id'],'commandId':_0x1d3f11['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x1d3f11['id']}});const _0x17fda7=new AITranslateCheckList();return _0x17fda7['setupChecks'](this['_translateChecks'](_0x2e80c0)),_0x17fda7;}['_translateChecks'](_0x43eada){return _0x43eada['map'](_0x515f36=>{const _0x197e60='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x515f36['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x515f36,'title':this['_getTranslationWithDefault'](_0x197e60,_0x515f36['title'])};});}}class AITranslateCheckResultsView extends AIReviewCoreUICheckResultsView{constructor(_0x1d9af5,_0x2846be){super(_0x1d9af5,_0x2846be),this['on']('set:isLoading',(_0x5386b2,_0x2d4681,_0x4417dc)=>{_0x4417dc&&(this['headerTitle']=Hi(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x25d912,_0x4103cd,_0x905ae4)=>{_0x905ae4&&(this['headerTitle']=Hi(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x31278d=super['_createAcceptAllButtonView']();return _0x31278d['set']('label',Hi(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x31278d;}['_createExitReviewButtonView'](){const _0x58813d=super['_createExitReviewButtonView']();return _0x58813d['set']('label',Hi(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x58813d;}}class AITranslateCheckListView extends AIReviewCoreReviewCheckListView{['_setupTemplate'](){const _0x116a8b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x116a8b['if']('isVisible','ck-hidden',_0x3132b1=>!_0x3132b1)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':Hi(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':Hi(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x116a8b['if']('isVisible','ck-hidden',_0x420c65=>!_0x420c65)]},'children':this['_checkViews']}]});}}class AITranslateUI extends AIReviewCoreUI{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x4587ee=this['context']['plugins']['get']('AITabs'),_0x481c83=this['context']['locale'],_0x586239=new AIHeaderView(_0x481c83,{'label':Hi(_0x481c83,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x31db4a,'class':'ck-ai-header_review-translate','showResizeButton':_0x4587ee['showResizeButton']});_0x586239['delegate']('resizeTabs')['to'](_0x4587ee),_0x586239['bind']('isMaximized')['to'](_0x4587ee['view'],'isMaximized',_0x47f932=>_0x47f932);const _0x43ee6c=new AIReviewCoreView(_0x481c83,{'header':_0x586239,'list':new AITranslateCheckListView(_0x481c83),'results':new AITranslateCheckResultsView(_0x481c83,{'generalErrorText':Hi(_0x481c83,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new AIReviewCoreReviewCompletedView(_0x481c83,{'headerText':Hi(_0x481c83,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':Hi(_0x481c83,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':Hi(_0x481c83,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x43ee6c['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x43ee6c;}['registerTab'](){const _0x3316d7=this['context']['plugins']['get']('AITabs');_0x3316d7['view']['on']('activateTab',(_0x4f8552,{newTab:_0x18db04,oldTab:_0x43368a})=>{'translate'===_0x18db04?this['fire']('getReviewCheckList'):'translate'===_0x43368a&&this['fire']('leaveReview');}),_0x3316d7['view']['addTab']({'id':'translate','buttonLabel':Hi(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x31db4a,'order':0x0,'content':this['_mainView']});}}class AITranslate extends _0x3cc0e4{static get['requires'](){return[AITranslateController,AITranslateUI,AIReviewCoreEditing];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{AIActions,AIAdapter,AIAssistant,AIAssistantUI,AIBalloon,AIChat,AIChatController,AIChatFeedCustomElementView,AIChatHistory,AIChatHistoryController,AIChatHistoryUI,AIChatInteraction,AIChatShortcuts,AIChatUI,AIConnector,AIEditing,AIEditorIntegration,AIInteraction,AIQuickActions,AIQuickActionsUI,AIReply,AIRequestError,AIReviewCheck,AIReviewCheckResult,AIReviewCheckResultChange,AIReviewCheckRun,AIReviewMode,AIReviewCoreController as AIReviewModeController,AIReviewCoreEditing as AIReviewModeEditing,AIReviewModeUI,AITabs,AITabsMainView,AITabsView,AITextAdapter,AIToggleButtonUI,AITranslate,AITranslateController,AITranslateUI,AWSTextAdapter,OpenAITextAdapter,ShowAIAssistantCommand,ToggleAICommand,Gi as createResizeButton,Di as getDefaultAICommands};
|
|
23
|
+
import{Command as _0x1aa85e,ContextPlugin as _0x4f3978,Editor as _0xfb41df,Plugin as _0x52da8c,rootAcceptsBlocks as _0xfb89b7}from'@ckeditor/ckeditor5-core';import{IconAIAdjustLength as _0xc0a4f4,IconAIAskAI as _0x3a4672,IconAIChangeTone as _0x2e6b7e,IconAIChat as _0x31d0de,IconAIChatCommands as _0x3392ac,IconAIContinueWriting as _0x3664c0,IconAIGrammarCheck as _0x264045,IconAIHistory as _0x2239e4,IconAIImproveWriting as _0x3d577c,IconAIOther as _0x382db1,IconAIQuickActions as _0x211114,IconAIReview as _0x15e980,IconAITranslate as _0x2f431a,IconBoxWithCheck as _0x39d2e5,IconBoxWithCross as _0x2d4095,IconBoxWithMarker as _0x4b6aa4,IconBrowseFiles as _0x287262,IconBulb as _0x18ee94,IconCancel as _0x467543,IconCheck as _0x3e619a,IconChevronDown as _0x3b2b34,IconChevronLeft as _0x2bd669,IconChevronRight as _0x1a780a,IconChevronUp as _0x40bbde,IconCopy as _0x28b239,IconDocument as _0x2f2aeb,IconDocumentOutline as _0x286228,IconDropdownArrow as _0x5133fa,IconError as _0x2b5c3a,IconEye as _0xc0c807,IconEyeCrossedOut as _0x4bd9a2,IconFileUpload as _0x3ee9d9,IconImage as _0x5b4f6a,IconInfo as _0x52f52d,IconLink as _0x4d1c13,IconLock as _0x243ec8,IconLoupe as _0x214d18,IconMagicWand as _0x266664,IconMaximize as _0x3c5ba5,IconMinimize as _0x52c31f,IconOutdated as _0x44817c,IconPaperClip as _0x4074f7,IconPencil as _0x1f254b,IconPin as _0x143f91,IconPlus as _0x5bade3,IconPreviousArrow as _0x5c3f8c,IconRefresh as _0x21cbbb,IconRemove as _0x59f57d,IconRevisionHistory as tt,IconRobotPencil as et,IconSelection as it,IconShowChangesOff as st,IconShowChangesOn as nt,IconStop as rt,IconStopCircle as ot,IconSubmit as at,IconThreeHorizontalDots as ht,IconThumbDown as ct,IconThumbUp as lt,IconWeb as ut}from'@ckeditor/ckeditor5-icons';import{CKEditorError as dt,Collection as _t,DomEmitterMixin as gt,EmitterMixin as It,EventInfo as At,FocusTracker as Et,KeystrokeHandler as pt,ObservableMixin as mt,Rect as Tt,ResizeObserver as wt,ShadowRootRegistry as Ct,_isMotionReduced as ft,containsNode as Rt,decodeLicenseKey as bt,findClosestScrollableAncestor as St,first as Ot,getActiveElement as vt,getConstrainedViewportRect as yt,getElementFromPoint as Nt,getLayoutParentElement as kt,getOverlayMountRoot as xt,getParentElement as Lt,getParentNode as Dt,getSelection as Pt,getShadowRoots as Mt,global as Vt,insertToPriorityArray as Ht,isFeatureBlockedByLicenseKey as Ut,isVisible as Bt,listenToShadowRoots as Gt,logError as Wt,logWarning as Ft,priorities as Kt,scrollAncestorsToShowTarget as $t,scrollViewportToShowTarget as Yt,toArray as qt,trustedHtml as Qt,uid as Xt,version as zt}from'@ckeditor/ckeditor5-utils';import{AutocompleteView as jt,BalloonPanelView as Jt,BalloonToolbar as Zt,ButtonLabelView as te,ButtonLabelWithHighlightView as _0x3b187d,ButtonView as _0x1b12df,Dialog as _0x2c281f,DialogViewPosition as _0x472d1d,DropdownMenuPanelPositioningFunctions as _0x56862a,FileDialogListItemButtonView as _0x144683,FocusCycler as _0x2dd4b2,FormHeaderView as _0x2bed87,FormRowView as _0x50a5bf,HighlightedTextView as _0x473cf4,IconView as _0x3188b1,InputTextView as _0x2adc12,LabeledFieldView as _0x39833d,ListItemButtonView as _0x474fcf,ListItemGroupView as _0xa68267,ListItemView as _0x5be144,ListView as _0x35138b,MenuBarMenuListItemButtonView as _0x12150b,MenuBarMenuListItemView as _0x1a22a2,MenuBarMenuListView as _0x525003,MenuBarMenuView as _0x30233e,OverlayHost as _0x405998,SearchTextView as _0x248c98,SpinnerView as _0x20aef5,TabButtonView as _0x2dc6fb,TabPanelView as _0x3faa7f,Template as _0x373278,TextareaView as _0x56db51,ToolbarView as _0x526787,UIModel as _0x5f2643,View as _0x43ad99,ViewCollection as _0x4a09f9,addListToDropdown as _0xb17444,addMenuToDropdown as _0x2b4251,clickOutsideHandler as _0x8f06c5,createDropdown as _0x348de2,createLabeledInputText as _0x220632,createLabeledTextarea as _0x2f0e4a,submitHandler as _0x319cf6}from'@ckeditor/ckeditor5-ui';import{ClipboardMarkersUtils as _0x582f4d,ClipboardPipeline as _0x1c4f71}from'@ckeditor/ckeditor5-clipboard';import{AttributeOperation as _0x36881c,InsertOperation as _0x596b48,MarkerOperation as _0x4226e6,Matcher as _0x3c5786,MergeOperation as _0x36755a,ModelDocumentFragment as _0x3a5946,ModelPosition as _0x22fec2,ModelRange as _0x3e534d,ModelText as _0x113230,ModelTreeWalker as _0x2e5c20,MoveOperation as _0x4ad218,RenameOperation as _0x555a59,RootAttributeOperation as ti,RootOperation as _0x15cf85,SplitOperation as _0x4f5d25,ViewDataTransfer as _0x9e0a2b,ViewDocumentDomEventData as _0x2d8b34,ViewDowncastWriter as _0x5c06e8,ViewUpcastWriter as _0x42ff60,_DetachOperation as _0x3961c2,_insertIntoModelNodeList as _0x367b34,_removeFromModelNodeList as _0x48de72,transformOperationSets as _0x3d40c6}from'@ckeditor/ckeditor5-engine';import{cloneDeep as _0x5bff5d,debounce as _0x2dbd18,escape as _0x137309,escapeRegExp as _0x55bbed,isElement as _0x11c91a,omit as _0x317d81,throttle as _0x1de37f,unescape as _0x2e31f7}from'es-toolkit/compat';import{createParser as _0x249b22}from'eventsource-parser';import{CloudServices as _0x5aa0ea}from'@ckeditor/ckeditor5-cloud-services';import{parseDocument as _0x53a3d9}from'htmlparser2';import{append as _0x40d2b1,appendChild as _0x581dad,find as _0x50382a,findAll as _0x3ddd9a,findOne as _0x4cc400,getChildren as _0x156cfd,getParent as _0x203a08,isComment as _0x3e33bf,isTag as _0x350de8,prepend as _0x21a8b9,prependChild as _0x341e9c,removeElement as _0x20a4a8,replaceElement as _0x1a0dae,textContent as _0xf328de}from'domutils';import _0x3b6490 from'dom-serializer';import{Document as _0x52d767,Element as _0x47f524,NodeWithChildren as _0x4c4a4a,Text as _0x2980ba,cloneNode as _0x26ae61,isDocument as _0x23dcb3,isText as _0x36bb90}from'domhandler';import{diffArrays as _0x218245}from'diff';import{ConfirmMixin as _0x18407b,PillView as _0x6dc41b,SuggestionsConversion as _0x1d949b,fixElementSuggestionRange as _0x307024,getAllMarkersDomElementsSorted as _0x2d82a6,getMarkerDomElement as _0x4fcc06,hashObject as _0x395975,isInvalidAttributeOperation as _0x2b9cbb,isPointerStillOver as _0x2c12b5,reRootOperation as ts,splitSuggestionMarkerName as _0x7b3abe}from'@ckeditor/ckeditor5-collaboration-core';import{MarkdownGfmMdToHtml as _0xaf752,MarkdownGfmMdToHtmlDefaultPlugins as _0x583496}from'@ckeditor/ckeditor5-markdown-gfm';import _0x5bf231 from'rehype-sanitize';import _0x507afe from'morphdom';const os='_ungrouppedCommands';function as(_0x13dafa,_0x1e16da){const _0x1b4457=(0x0,_0x1e16da['t'])('Other');return _0x13dafa['length']?'groupId'in _0x13dafa[0x0]?_0x13dafa:[{'groupId':os,'groupLabel':_0x1b4457,'order':0x1/0x0,'commands':_0x13dafa}]:[{'groupId':os,'groupLabel':_0x1b4457,'order':0x1/0x0,'commands':[]}];}const hs=globalThis['DataTransfer'],cs='ai-ui';var ls=class extends _0x52da8c{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const {editor:_0x1ee95a}=this;_0x1ee95a['conversion']['for']('editingDowncast')['markerToHighlight']({'model':cs,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x1ee95a['conversion']['for']('editingDowncast')['markerToElement']({'model':cs,'view':(_0x48c3c9,{writer:_0x17bde9})=>{if(!_0x48c3c9['markerRange']['isCollapsed'])return null;const _0x18ecc5=_0x17bde9['createUIElement']('span');return _0x17bde9['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x18ecc5),_0x18ecc5;}});}afterInit(){this['_blockIfRemovedByLicenseKey'](),async function(_0x4a59ff){const _0x29e890='nA7yurgOHbZvDplRkJscdICm86oPWx92f1qF0LaSX3NGwTMK4jVtYUBQi5zheE',_0xe0627a=0x79728,_0x4a82bc={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0xd1e141(_0x15472d){const _0x176eb0=new window['Promise'](_0x14f6a9=>{_0x15472d['once']('ready',_0x14f6a9);}),_0x5ef362=window['Date']['now'](),_0x817a8=_0x15472d['config']['get']('licenseKey');async function _0x43491a(){let _0x5622eb,_0x22afbe=null,_0x2c95bb=null;try{return'GPL'==_0x817a8?'NotAllowed':(_0x5622eb=_0x53b03a(),_0x5622eb?(_0x5622eb['usageEndpoint']&&(_0x2c95bb=_0x8fbcf1(_0x5622eb['usageEndpoint'],_0x5622eb['jti'])),await _0x1e6645()?_0x41fd90()?_0x206885()?'Expired':_0x3d9058()?('evaluation'==_0x5622eb['licenseType']&&(_0x22afbe=_0xcaf2be('EvaluationLimit')),await _0x2dba46()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x206885(){const _0x51af5b=['evaluation','trial']['includes'](_0x5622eb['licenseType'])?_0x5ef362/0x3e8:0xe10*_0xe0627a;return _0x5622eb['exp']<_0x51af5b;}function _0x41fd90(){const _0x160eca=_0x5622eb['features'];return!!_0x160eca&&(!!_0x160eca['includes']('*')||!!_0x160eca['includes']('AI'));}function _0x3d9058(){const _0x332a55=_0x5622eb['licensedHosts'];if(!_0x332a55||0x0==_0x332a55['length'])return!0x0;const {hostname:_0x383d01}=new URL(window['location']['href']);if(_0x332a55['includes'](_0x383d01))return!0x0;const _0x1f05cb=_0x383d01['split']('.');return _0x332a55['filter'](_0x5cc41f=>_0x5cc41f['includes']('*'))['map'](_0x1e76b5=>_0x1e76b5['split']('.'))['filter'](_0x13ea3e=>_0x13ea3e['length']<=_0x1f05cb['length'])['map'](_0x3a09ae=>Array(_0x1f05cb['length']-_0x3a09ae['length'])['fill']('*'===_0x3a09ae[0x0]?'*':'')['concat'](_0x3a09ae))['some'](_0x3e05d3=>_0x1f05cb['every']((_0x4345b3,_0x1568ac)=>_0x3e05d3[_0x1568ac]===_0x4345b3||'*'===_0x3e05d3[_0x1568ac]));}function _0x2dba46(){return _0x22afbe&&_0x2c95bb?new window['Promise']((_0x3f395f,_0x260d6d)=>{_0x22afbe['then'](_0x3f395f,_0x260d6d),_0x2c95bb['then'](_0x2a3549=>{'Valid'!=_0x2a3549&&_0x3f395f(_0x2a3549);},_0x260d6d);}):_0x22afbe||_0x2c95bb||'Valid';}}function _0x8fbcf1(_0x58059a,_0x11a30f){return new window['Promise'](_0x259edf=>{if(_0x6d4289())return _0x259edf('Valid');_0x1476d4(),_0x15472d['decorate']('_sendUsageRequest');let _0x4374fd=!0x1;const _0x4dfde7=Xt();function _0x21d708(_0x15f2ae){return!!_0x15f2ae&&('object'==typeof _0x15f2ae||'function'==typeof _0x15f2ae)&&'function'==typeof _0x15f2ae['then']&&'function'==typeof _0x15f2ae['catch'];}function _0x3a0cc4(_0x33b001){_0x2af2ad(_0x33b001)['then'](_0x1c12e9=>_0x1c12e9&&'ok'==_0x1c12e9['status']?_0xeabfca(_0x57a2e3(_0x4dfde7+_0x11a30f))!=_0x1c12e9['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x55dbd2=>(_0x5d277e(),_0x55dbd2),()=>{const _0x469442=_0x339d8c();return null==_0x469442?(_0x5d277e(),'Valid'):_0x5ef362-_0x469442>0x240c8400?'UsageLimit':'Valid';})['then'](_0x259edf)['catch'](()=>{_0x259edf('UsageLimit');});const _0x3abec5=0x36ee80;function _0x5d277e(){const _0x4e563e='llct-'+_0xeabfca(_0x57a2e3(_0x58059a)),_0x38cdd6=_0x500fd2(_0xeabfca(window['Math']['ceil'](_0x5ef362/_0x3abec5)));window['localStorage']['setItem'](_0x4e563e,_0x38cdd6);}function _0x339d8c(){const _0x599c1e='llct-'+_0xeabfca(_0x57a2e3(_0x58059a)),_0x39b217=window['localStorage']['getItem'](_0x599c1e);return _0x39b217?window['parseInt'](_0x500fd2(_0x39b217),0x10)*_0x3abec5:null;}function _0x2af2ad(_0xa4c10){return new window['Promise']((_0x3de04c,_0x1da5e8)=>{_0xa4c10['then'](_0x3de04c,_0x1da5e8),window['setTimeout'](_0x1da5e8,0x1d4c0);});}}_0x15472d['on']('_sendUsageRequest',(_0x339c99,_0x55441f)=>{if(_0x55441f[0x0]!=_0x58059a)return _0x259edf('UsageLimit');_0x55441f[0x1]={..._0x55441f[0x1],'requestId':_0x4dfde7};},{'priority':'high'}),_0x15472d['on']('_sendUsageRequest',_0x1f1279=>{_0x21d708(_0x1f1279['return'])&&(_0x4374fd=!0x0,_0x3a0cc4(_0x1f1279['return']));},{'priority':'low'}),_0x176eb0['then'](()=>{_0x4374fd||_0x259edf('UsageLimit');});});function _0x6d4289(){return'auto'==_0x15472d['editing']['view']['_overlayModeHint'];}function _0x1476d4(){_0x15472d['editing']['view']['_overlayModeHint']='auto';}}function _0xcaf2be(_0x50b30e){const _0x4bfe0c=[new window['Promise'](_0xf67540=>setTimeout(_0xf67540,0x93ecc)),_0x176eb0['then'](()=>new window['Promise'](_0x553356=>{let _0x475805=0x0;_0x15472d['model']['on']('applyOperation',(_0x5274b4,_0x40b23e)=>{_0x40b23e[0x0]['isDocumentOperation']&&_0x475805++,0x5e8==_0x475805&&(_0x553356(),_0x5274b4['off']());});}))];return window['Promise']['race'](_0x4bfe0c)['then'](()=>_0x50b30e);}async function _0x1c4c00(){await _0x176eb0,_0x15472d['model']['change']=_0x32bc44,_0x15472d['model']['enqueueChange']=_0x32bc44,_0x15472d['enableReadOnlyMode']('model');}function _0x42ab54(_0x55e640){const _0x39154e=_0x1a755a();_0x15472d[_0x39154e]='aiLicenseKey'+_0x55e640,'Valid'!=_0x55e640&&_0x1c4c00();}function _0x1a755a(){const _0x16a873=window['String'](window['performance']['now']())['replace']('.','');let _0x499b19='n';for(let _0x15dfd9=0x0;_0x15dfd9<_0x16a873['length'];_0x15dfd9+=0x2){let _0x33f35e=window['parseInt'](_0x16a873['substring'](_0x15dfd9,_0x15dfd9+0x2));_0x33f35e>=0x3e&&(_0x33f35e-=0x3e),_0x499b19+=_0x29e890[_0x33f35e];}return _0x499b19;}function _0x53b03a(){const _0x1761da=_0x817a8['split']('.');if(0x3!=_0x1761da['length'])return null;return _0x60cea9(_0x1761da[0x1]);function _0x60cea9(_0x1b0a8e){const _0xd0d680=_0x12d5e6(_0x1b0a8e);return _0xd0d680&&_0x44555f()?_0xd0d680:null;function _0x44555f(){const _0x78739b=_0xd0d680['jti'],_0x52303f=window['parseInt'](_0x78739b['substring'](_0x78739b['length']-0x8),0x10),_0x2b481a={..._0xd0d680,'jti':_0x78739b['substring'](0x0,_0x78739b['length']-0x8)};return delete _0x2b481a['vc'],_0x57a2e3(_0x2b481a)==_0x52303f;}}}async function _0x1e6645(){let _0x13c558=!0x0;try{const [_0x56da5f,_0x371cb9,_0x2e2945]=_0x817a8['split']('.');return _0x4346d3(_0x56da5f),await _0x23544c(_0x56da5f,_0x371cb9,_0x2e2945),_0x13c558;}catch{return!0x1;}function _0x4346d3(_0x8f98b1){const _0x33e52a=_0x12d5e6(_0x8f98b1);_0x33e52a&&'ES256'==_0x33e52a['alg']||(_0x13c558=!0x1);}async function _0x23544c(_0x1c4bc5,_0xd59ac2,_0x3eace6){const _0x189b2f=window['Uint8Array']['from'](_0x192943(_0x3eace6),_0xf85f26=>_0xf85f26['charCodeAt'](0x0)),_0x585f38=new window['TextEncoder']()['encode'](_0x1c4bc5+'.'+_0xd59ac2),_0x3164a8=window['crypto']['subtle'];if(!_0x3164a8)return;const _0x19b6fb=await _0x3164a8['importKey']('jwk',_0x4a82bc,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x3164a8['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x19b6fb,_0x189b2f,_0x585f38)||(_0x13c558=!0x1);}}function _0x12d5e6(_0x2b7aaf){return _0x2b7aaf['startsWith']('ey')?JSON['parse'](_0x192943(_0x2b7aaf)):null;}function _0x192943(_0x156c7b){return window['atob'](_0x156c7b['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x57a2e3(_0xf5118f){let _0x561ce7=0x1505;function _0x40aaac(_0x47f636){for(let _0x4ac204=0x0;_0x4ac204<_0x47f636['length'];_0x4ac204++){const _0x3fdde5=_0x47f636['charCodeAt'](_0x4ac204);_0x561ce7=(_0x561ce7<<0x5)+_0x561ce7+_0x3fdde5,_0x561ce7&=_0x561ce7;}}function _0x4ef0be(_0x21b914){Array['isArray'](_0x21b914)?_0x21b914['forEach'](_0x4ef0be):_0x21b914&&'object'==typeof _0x21b914?Object['entries'](_0x21b914)['sort']()['forEach'](([_0x1d09f0,_0x2ad606])=>{_0x40aaac(_0x1d09f0),_0x4ef0be(_0x2ad606);}):_0x40aaac(window['String'](_0x21b914));}return _0x4ef0be(_0xf5118f),_0x561ce7>>>0x0;}function _0xeabfca(_0x286f59){return _0x286f59['toString'](0x10)['padStart'](0x8,'0');}function _0x500fd2(_0x39ce84){return _0x39ce84['split']('')['reverse']()['join']('');}function _0x32bc44(){}_0x42ab54(await _0x43491a());}_0xd1e141(_0x4a59ff['editor']);}(this);}['_blockIfRemovedByLicenseKey'](){const _0x3d9ba3=this['editor'],_0x1d5259=bt(_0x3d9ba3['config']['get']('licenseKey'));_0x1d5259&&Ut(_0x1d5259,'AI')&&(_0x3d9ba3['enableReadOnlyMode'](Symbol('invalidLicense')),_0x3d9ba3['_showLicenseError']('featureNotAllowed','AIAssistant'));}showFakeVisualSelection(){const _0x686a1f=this['editor']['model'];_0x686a1f['change'](_0x2fed23=>{const _0x6f3d80=_0x686a1f['document']['selection']['getRanges']();let _0x42d7da=0x0;for(const _0x1cb736 of _0x6f3d80){const _0x48ea7c=cs+':'+_0x42d7da;if(_0x686a1f['markers']['has'](_0x48ea7c))_0x2fed23['updateMarker'](_0x48ea7c,{'range':_0x1cb736});else{if(_0x1cb736['start']['isAtEnd']){const _0xb91687=_0x1cb736['start']['getLastMatchingPosition'](({item:_0x4eb6d2})=>!_0x686a1f['schema']['isContent'](_0x4eb6d2),{'boundaries':_0x1cb736});_0x2fed23['addMarker'](_0x48ea7c,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2fed23['createRange'](_0xb91687,_0x1cb736['end'])});}else _0x2fed23['addMarker'](_0x48ea7c,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1cb736});}_0x42d7da++;}});}hideFakeVisualSelection(){const _0xffc238=this['editor']['model'],_0x4bcd7f=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](cs));_0x4bcd7f['length']&&_0xffc238['change'](_0x524dc1=>{_0x4bcd7f['forEach'](_0xaeb1fa=>{_0x524dc1['removeMarker'](_0xaeb1fa);});});}insertContent(_0x2db7ca,_0x1660b6){const _0x57a46c=this['_getAISelection'](),_0x5e1904=_0x1660b6||_0x57a46c['getFirstRange']();this['editor']['model']['canEditAt'](_0x5e1904)&&this['editor']['model']['change'](_0x25e943=>{this['hideFakeVisualSelection'](),_0x1660b6||this['_resetContentOfSelectedTableCells'](_0x25e943,_0x57a46c),this['_pasteHTMLUsingClipboard']({'insertAt':_0x5e1904,'writer':_0x25e943,'html':_0x2db7ca});});}insertContentBelow(_0x50844f){const {model:_0xbabaf6}=this['editor'],_0x55876a=this['_getAISelection']();_0xbabaf6['change'](()=>{const _0xa766c5=this['_prepareTableInsertBelowPosition'](_0x50844f,_0x55876a)||this['_getDefaultInsertBelowPosition'](_0x55876a);this['insertContent'](_0x50844f,_0xa766c5);});}_getAISelection(){const _0x58bfee=this['editor']['model'],_0x337b63=Array['from'](_0x58bfee['markers']['getMarkersGroup'](cs))['map'](_0x2511ed=>_0x2511ed['getRange']());return _0x58bfee['createSelection'](_0x337b63);}_pasteHTMLUsingClipboard({writer:_0x39018b,html:_0x2780ab,insertAt:_0xf556ca}){const {view:_0x45e591}=this['editor']['editing'],_0x3f749b=this['editor']['plugins']['get'](_0x1c4f71),_0xda3a93=new hs();_0xda3a93['setData']('text/html',_0x2780ab);const _0x167f21=new ClipboardEvent('paste',{'clipboardData':_0xda3a93}),_0x243bb5=new _0x2d8b34(_0x45e591,_0x167f21,{'dataTransfer':new _0x9e0a2b(_0xda3a93)});_0x39018b['setSelection'](_0xf556ca);const _0x230188=(_0x13668a,_0x438667)=>{_0x438667['resultRange']&&_0x39018b['setSelection'](_0x438667['resultRange']);};_0x3f749b['once']('contentInsertion',_0x230188,{'priority':'lowest'}),_0x45e591['document']['fire']('paste',_0x243bb5),_0x3f749b['off']('contentInsertion',_0x230188);}_getDefaultInsertBelowPosition(_0x4a79e2){const {model:_0x3a61e8}=this['editor'],_0x4a2505=Array['from'](_0x4a79e2['getSelectedBlocks']());return _0x4a2505['length']?_0x3a61e8['createPositionAfter'](_0x4a2505['pop']()):_0x4a79e2['getLastPosition']();}_prepareTableInsertBelowPosition(_0x48d110,_0x558185){const {model:_0x4a6f31,plugins:_0x531a26}=this['editor'];if(_0x531a26['has']('TableUtils')){const _0x240510=_0x531a26['get']('TableUtils')['getSelectedTableCells'](_0x558185);if(_0x240510['length']){const _0x4d898d=this['_getTableRowCountFromContent'](_0x48d110),_0x2383a1=this['_createEmptyTableRows'](_0x240510,_0x4d898d);return _0x4a6f31['createPositionAt'](_0x2383a1,0x0);}}return null;}_getTableRowCountFromContent(_0x3b3e1c){const _0x193ded=this['editor']['plugins']['get']('TableUtils'),_0x1531ee=this['editor']['data']['parse'](_0x3b3e1c,'$documentFragment'),_0x1389f8=Array['from'](_0x1531ee['getChildren']())['filter'](_0x6ec245=>_0x6ec245['is']('element','table'));let _0x1e5b45=0x0;return _0x1389f8['forEach'](_0x23ada9=>{_0x1e5b45+=_0x193ded['getRows'](_0x23ada9);}),_0x1e5b45;}_createEmptyTableRows(_0x319251,_0x1f8f68){const _0x5ae9b4=this['editor']['plugins']['get']('TableUtils'),_0x45922a=_0x5ae9b4['getRowIndexes'](_0x319251),_0xffb2ee=_0x5ae9b4['getColumnIndexes'](_0x319251),_0x2b0d16=_0x45922a['last']+0x1,_0x2477d2=_0xffb2ee['first'],_0x578d9b=_0x319251[0x0]['findAncestor']('table');for(let _0x3c192a=0x0;_0x3c192a<_0x1f8f68;_0x3c192a++)_0x5ae9b4['insertRows'](_0x578d9b,{'at':_0x2b0d16});return _0x578d9b['getChild'](_0x2b0d16)['getChild'](_0x2477d2);}_resetContentOfSelectedTableCells(_0x3e08a6,_0x596a57){const {plugins:_0x4f29f4}=this['editor'],{model:_0x14fc56}=_0x3e08a6;_0x4f29f4['has']('TableUtils')&&_0x4f29f4['get']('TableUtils')['getSelectedTableCells'](_0x596a57)['length']&&_0x14fc56['deleteContent'](_0x596a57);}},us=class extends _0x52da8c{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}afterInit(){if(!this['textAdapter'])throw new dt('aiadapter-text-adapter-not-set',null);}},ds=class extends Error{constructor(_0x299b32){super(_0x299b32),this['name']='AIRequestError';}};function _s(_0x39a2ac,_0xa28c7f,_0x37c00c){const t=_0x39a2ac['t'];switch(_0xa28c7f){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',_0x37c00c);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x37c00c);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'},_0x37c00c);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_AWS_NOT_SUPPORTED':return t({'id':'AI_ERROR_AWS_NOT_SUPPORTED','string':'The\x20AWS\x20integration\x20is\x20no\x20longer\x20supported.\x20Please\x20contact\x20the\x20support.'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0xa28c7f;}}var gs=class extends _0x1aa85e{_commandDefinitions;constructor(_0x25f211,_0x44abc0){super(_0x25f211),this['_commandDefinitions']=_0x44abc0,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x2ee072,_0x159d2d,_0x4293bf)=>{this['isEnabled']&&(this['enabledCommandsIds']=Is(this['_commandDefinitions'],_0x4293bf));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x51d13e,_0x442125,_0x3dcc9f)=>{this['enabledCommandsIds']=_0x3dcc9f?Is(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x17ea4a=this['editor']['model'];this['_hasContext']=function(_0x5d473d){const _0x16b0f4=_0x5d473d['document']['selection'];return _0x16b0f4['isCollapsed']?0x0!==[..._0x16b0f4['getSelectedBlocks']()]['length']&&![..._0x16b0f4['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x5d473d['hasContent'](_0x16b0f4['getFirstRange']());}(_0x17ea4a);const _0x1b9f70=_0x17ea4a['document']['selection'],_0x2b2808=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x59ebe3 of _0x1b9f70['getRanges']())for(const _0x2cea22 of _0x59ebe3['getItems']())if(_0x2cea22['is']('element')&&_0x2b2808['includes'](_0x2cea22['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}execute(_0x2d31c5='',_0x1a1cc9='',_0x239c32='custom'){this['editor']['plugins']['get'](xs)['showUI'](_0x2d31c5,_0x1a1cc9,_0x239c32);}};function Is(_0x25bd04,_0x5cc712){const _0x1a6473=new Set();for(const _0x27fd81 of _0x25bd04['values']())(_0x5cc712||!0x1===_0x27fd81['requiresContent'])&&_0x1a6473['add'](_0x27fd81['id']);return Array['from'](_0x1a6473);}const As=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is'),Es=/* #__PURE__ -- @preserve */
|
|
24
|
+
mt();var ps=class extends Es{editor;textAdapter;['view'];_sanitizationContainer;['_domParser'];['_xmlSerializer'];constructor(_0x145cab,_0x320665,_0x551b02){super(),this['editor']=_0x145cab,this['textAdapter']=_0x320665,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x551b02,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x3ee583,_0x43f97c,_0x2e1749)=>{this['view']['value']=this['_sanitizeHTML'](_0x2e1749);}),this['listenTo'](this['view'],'submitPrompt',(_0x5e64e,_0x1e0c4c)=>{const _0x30ad9b=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x1e0c4c,_0x30ad9b,'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:_0xcfd892,query:_0x38239d,htmlContent:_0x75e0cb,label:_0x208452,mainActionLabel:_0x257bc5}){this['view']['prompt']=_0x208452,this['view']['mainAction']=_0x257bc5,this['initialContext']=_0x75e0cb,_0x38239d&&(this['view']['isRendered']?this['_handleQuery'](_0x38239d,_0x75e0cb,_0xcfd892,_0x208452):this['view']['once']('render',()=>{this['_handleQuery'](_0x38239d,_0x75e0cb,_0xcfd892,_0x208452);}));}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'](_0x2140be,_0xbbe075,_0x4a5153,_0xc66904){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0xbbe075,this['previousQuery']=_0x2140be,this['previousLabel']=_0xc66904||_0x2140be,this['previousActionId']=_0x4a5153,new Promise(_0x2d9232=>{this['textAdapter']['makeRequest']({'query':_0x2140be,'context':_0xbbe075,'onData':_0x2c9293=>{this['currentResponse']=_0x2c9293,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x4a5153})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x4eaa07=>{_0x4eaa07 instanceof ds?this['view']['handleError'](_0x4eaa07['message']):this['view']['handleError'](),_0x2d9232();})['finally'](()=>{this['stopProcessing'](),_0x2d9232();});});}_parseAndNormalizeContent(_0x436d03,_0x491497=!0x1){const _0x1a760d=As['exec'](_0x436d03);_0x436d03=_0x1a760d?_0x436d03['substring'](_0x1a760d[0x1]['length']):_0x436d03['length']<0x64&&!_0x491497?'':this['_stripMarkdownSyntax'](_0x436d03);const _0x2521a1=this['_domParser']['parseFromString'](Qt(_0x436d03),'text/html');if(_0x1a760d){const _0x46ee7d=Array['from'](_0x2521a1['body']['childNodes']);_0x46ee7d['reverse']();for(const _0x5d380c of _0x46ee7d){if(_0x5d380c['nodeType']==Node['ELEMENT_NODE'])break;_0x5d380c['remove']();}}const _0x5d7071=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x2521a1['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x5d7071);const _0x48b874=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x44a305=this['editor']['data']['toModel'](_0x5d7071);return _0x48b874||_0x44a305['markers']['clear'](),this['editor']['data']['stringify'](_0x44a305);}['_normalizeResponseHeadings'](_0x564889){const _0x41b83f=new _0x42ff60(this['editor']['editing']['view']['document']),_0x27df0d=new _0x3c5786({'name':/^h[1-5]$/}),_0x1ccbe8=[];let _0x5ef0d5=!0x1;for(const _0x2c6e03 of _0x564889)_0x2c6e03['is']('element')&&_0x27df0d['match'](_0x2c6e03)&&(_0x1ccbe8['push'](_0x2c6e03),'h1'==_0x2c6e03['name']&&(_0x5ef0d5=!0x0));if(_0x5ef0d5){for(const _0x54cbaf of _0x1ccbe8)_0x41b83f['rename']('h'+(parseInt(_0x54cbaf['name'][0x1])+0x1),_0x54cbaf);}}_isH1TagSupportEnabled(){const {data:_0x9fedbf,editing:_0x28f23d}=this['editor'],_0x245416=_0x9fedbf['htmlProcessor']['toView']('<h1></h1>'),_0x246401=_0x9fedbf['toView'](_0x9fedbf['toModel'](_0x245416));return!!_0x28f23d['view']['domConverter']['viewToDom'](_0x246401)['querySelector']('h1');}_sanitizeHTML(_0x31bd61){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x31bd61),this['_sanitizationContainer']['innerHTML'];}_stripMarkdownSyntax(_0x41b7af){const _0x4e17eb=_0x41b7af['trim']();return _0x4e17eb['startsWith']('```html')?_0x4e17eb['endsWith']('```')?_0x4e17eb['substring'](0x7,_0x4e17eb['length']-0x3):_0x4e17eb['substring'](0x7):_0x41b7af;}};const ms={'REPLACE':'replace','INSERT':'insert'};var Ts=class extends _0x526787{constructor(_0x58ca2a){super(_0x58ca2a),this['set']('isVisible',!0x1),this['set']('mainAction',ms['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x3a2cc3=>_s(_0x58ca2a,'AI_'+_0x3a2cc3['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](_s(_0x58ca2a,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](_s(_0x58ca2a,'Try\x20again')),this['stopButton']=this['_createButton'](_s(_0x58ca2a,'Stop'));const _0x7f27f=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x7f27f['if']('isVisible','ck-hidden',_0x3aa4a8=>!_0x3aa4a8)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}_createButton(_0x239b19,_0x2c69dc){const _0x5dbf52=new _0x1b12df(this['locale']);return _0x5dbf52['set']({'label':_0x239b19,'class':_0x2c69dc||'','isVisible':!0x0,'withText':!0x0}),_0x5dbf52;}},ws=class extends _0x43ad99{contentFieldView;copyButtonView;constructor(_0x390661,_0x2f9328=''){super(_0x390661),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x3ed766=this['bindTemplate'];this['contentFieldView']=new Cs(_0x390661,_0x2f9328),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x3ed766['if']('isVisible','ck-hidden',_0xeaebf8=>!_0xeaebf8)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x3ed766['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 _0x2d5d2e=!0x1;this['on']('change:value',(_0x699002,_0x1890a4,_0x4b9047)=>{const _0xe635f9=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x4b9047),this['isProcessing']&&_0xe635f9&&!_0x2d5d2e&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x4573bb,_0x28eda5,_0x58fcb2)=>{_0x2d5d2e=!0x1,_0x58fcb2?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x2d5d2e=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x2d5d2e=!0x0;});}['focus'](){this['element']['focus']();}_createCopyButton(){const _0x3edb09=this['locale'],_0x4beeab=new _0x1b12df(this['locale']),_0x357f88='ck-ai-form__copy-button';return _0x4beeab['set']({'label':_s(_0x3edb09,'Copy'),'icon':_0x28b239,'class':_0x357f88,'tooltip':!0x0}),_0x4beeab['bind']('isVisible')['to'](this,'value',_0x2b1704=>!!_0x2b1704),_0x4beeab['bind']('isEnabled')['to'](this,'isProcessing',_0x398341=>!_0x398341),_0x4beeab['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x4beeab['icon']=_0x3e619a,_0x4beeab['class']=_0x357f88+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x4beeab['icon']=_0x28b239,_0x4beeab['class']=_0x357f88;},0x3e8);}),_0x4beeab;}['_copyHTMLToClipboard'](_0x174644){const {window:_0x4c9ce7,document:_0xf632c6}=Vt;if(_0x4c9ce7['ClipboardItem']){const {Blob:_0x4bbeaa,ClipboardItem:_0x53113e}=_0x4c9ce7,_0x258843=[new _0x53113e({'text/html':new _0x4bbeaa([_0x174644['innerHTML']],{'type':'text/html'}),'text/plain':new _0x4bbeaa([_0x174644['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x258843);}else{const _0x1a548a=_0xf632c6['createElement']('div');_0x1a548a['style']['position']='absolute',_0x1a548a['style']['left']='-9999px',_0x1a548a['innerHTML']=Qt('<span>[</span>'+_0x174644['innerHTML']+'<span>]</span>'),_0xf632c6['body']['appendChild'](_0x1a548a);const _0x1c164a=_0xf632c6['createRange']();_0x1c164a['setStartAfter'](_0x1a548a['firstElementChild']),_0x1c164a['setEndBefore'](_0x1a548a['lastElementChild']);const _0x32c287=_0x4c9ce7['getSelection']();_0x32c287['removeAllRanges'](),_0x32c287['addRange'](_0x1c164a),_0xf632c6['execCommand']('copy'),_0x1a548a['remove']();}}},Cs=class extends _0x43ad99{constructor(_0x35de2a,_0x582fdc=''){super(_0x35de2a),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x582fdc,'ck-reset_all-excluded','ck-ai-form__content-field']}});}setContent(_0x1664b5){this['element']['innerHTML']=Qt(_0x1664b5||'');}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}_createLoader(){const _0x14ae8c=new _0x43ad99(),_0x2e1ade=this['locale'],_0x4b3936=new _0x20aef5();return _0x4b3936['isVisible']=!0x0,_0x14ae8c['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x4b3936,{'text':_s(_0x2e1ade,'AI\x20is\x20writing...')}]}),_0x14ae8c['render'](),_0x14ae8c;}},fs=class extends _0x43ad99{constructor(_0x4ebc94,_0x1f86f0=''){super(_0x4ebc94);const _0x398b83=new _0x3188b1(),_0x3db735=this['bindTemplate'];this['set']('text',_0x1f86f0),_0x398b83['content']=_0x2b5c3a,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x398b83,{'text':_0x3db735['to']('text')}]});}},Rs=class extends jt{submitButtonView;showHistoryButtonView;constructor(_0x182117,_0x36f6c2){super(_0x182117,_0x36f6c2),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',(_0x36e9d8,_0x562a9b)=>{_0x36e9d8['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x562a9b());});}_createSubmitButton(){const _0x142b36=new _0x1b12df(this['locale']),_0x3d49db=this['locale'];return _0x142b36['set']({'icon':at,'label':_s(_0x3d49db,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x142b36['on']('execute',()=>{this['submit']();}),_0x142b36['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x10a893,_0x41f379)=>!_0x10a893&&_0x41f379),_0x142b36;}_createShowHistoryButton(){const _0x10be02=new _0x1b12df(this['locale']),_0x3b2062=this['resultsView'],_0x4cd184=this['locale'];_0x10be02['set']({'label':_s(_0x4cd184,'History'),'withText':!0x1,'icon':_0x2239e4,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x10be02['bind']('isOn')['to'](_0x3b2062,'isVisible'),_0x10be02['bind']('isEnabled')['to'](this,'isEnabled'),_0x10be02['on']('execute',()=>{_0x3b2062['isVisible']=!_0x3b2062['isVisible'],_0x3b2062['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x4a2071=()=>{Vt['window']['requestAnimationFrame'](()=>{if(Bt(this['element'])){const _0x3767bd=new Tt(this['queryView']['fieldView']['element']),_0xa354a=_0x3767bd['width'],_0xd01a10='rtl'===_0x4cd184['uiLanguageDirection']?'left':'right';_0x3767bd['excludeScrollbarsAndBorders'](),_0x10be02['element']['style'][_0xd01a10]=_0xa354a-_0x3767bd['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x4a2071),this['on']('render',_0x4a2071),_0x10be02;}submit(){const _0x4b1bd4=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x4b1bd4);}['focus'](_0x4da608){-0x1===_0x4da608?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}},bs=class extends _0x35138b{historyGroupView;clearHistoryButton;constructor(_0x34e123){super(_0x34e123),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0xa68267(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=_s(_0x34e123,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}filter(){let _0x168c25=0x0;for(const _0x50c5be of this['items'])_0x168c25+=_0x50c5be['items']['length'];return{'resultsCount':_0x168c25,'totalItemsCount':_0x168c25};}_createClearHistoryButton(){const _0x10b18a=this['locale'],_0x3a1e36=new _0x1b12df(this['locale']);return _0x3a1e36['set']({'label':'('+_s(_0x10b18a,'Clear')+')','withText':!0x0}),_0x3a1e36['on']('execute',()=>this['fire']('clearHistory')),_0x3a1e36;}},Ss=class extends _0x5be144{constructor(_0x257b41){super();const _0x344348=new te(),_0x490622=new _0x1b12df(this['locale'],_0x344348);this['children']['add'](_0x490622),_0x490622['set']({'label':_0x257b41['prompt'],'withText':!0x0}),_0x490622['on']('execute',()=>{this['fire']('execute',{'value':_0x2e31f7(_0x257b41['prompt'])});});}};const Os='CKEditor/AIFormView/PromptHistory';var vs=class extends _t{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x9c963f,_0x26fb21)=>{const _0x425e7e=ys(_0x26fb21['prompt']);for(const _0x5dd336 of this)if(_0x5dd336!=_0x26fb21&&ys(_0x5dd336['prompt'])===_0x425e7e){this['remove'](_0x5dd336);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}_loadFromSessionStorage(){const _0x4cabef=sessionStorage['getItem'](Os)||'[]';this['addMany'](JSON['parse'](_0x4cabef));}_saveToSessionStorage(){sessionStorage['setItem'](Os,JSON['stringify'](this['map'](_0x12b9f2=>_0x12b9f2)));}};function ys(_0x43c32f){return _0x43c32f['toLowerCase']()['trim']();}var Ns=class extends _0x43ad99{['focusTracker'];keystrokes;contentArea;toolbar;promptView;['errorView'];['_focusables'];['focusCycler'];_promptHistory;constructor(_0x95135d,_0x51579b,_0x11a3ad=''){super(_0x95135d),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',ms['REPLACE']),this['_promptHistory']=new vs(),this['errorView']=new fs(_0x95135d),this['contentArea']=new ws(_0x95135d,_0x11a3ad),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 Et(),this['keystrokes']=new pt(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x2dd4b2({'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 _0x351f64=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x51579b],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x351f64['if']('isError','ck-hidden',_0x174e98=>!_0x174e98)]},'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'](_0x589a1c=0x1){-0x1===_0x589a1c?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 _0x16ff24=this['locale'],_0x2a4142=new Rs(_0x16ff24,{'queryView':{'label':_s(_0x16ff24,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x2f0e4a,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':_s(_0x16ff24,'Empty\x20history'),'secondary':_s(_0x16ff24,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x2a4142['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x40efc1,_0x39997c)=>_0x40efc1&&!_0x39997c),this['listenTo'](_0x2a4142,'submit',(_0xbeef8b,_0x2d4d1d)=>{this['prompt']=_0x2d4d1d;const _0x5cf377=_0x137309(_0x2d4d1d);this['fire']('submitPrompt',_0x5cf377),_0x2d4d1d['trim']()&&this['_promptHistory']['add']({'prompt':_0x5cf377},0x0);},{'priority':'high'}),_0x2a4142;}_createHistoryView(){const _0x3d36bd=new bs(this['locale']);return _0x3d36bd['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Ss),_0x3d36bd['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x3d36bd;}_createToolbar(){const _0x105456=new Ts(this['locale']);return _0x105456['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x55b293,_0x5deff5,_0x29a4b9)=>_0x55b293&&!_0x5deff5&&!!_0x29a4b9),_0x105456['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x105456['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x2e1971,_0x2fbf02,_0x5c3e1a)=>_0x2e1971&&!_0x2fbf02&&!!_0x5c3e1a),_0x105456['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x105456['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x159635,_0x115fde)=>_0x159635&&!_0x115fde),_0x105456['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x105456['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x105456['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x105456;}startProcessing(){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x123484=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=_s(_0x123484,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x23c5c9){const _0x50c816=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x23c5c9||_s(_0x50c816,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}};const ks=globalThis['DataTransfer'];var xs=class extends _0x52da8c{['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[_0x582f4d,ls,us,_0x2c281f];}constructor(_0xaf4e97){super(_0xaf4e97),_0xaf4e97['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0xaf4e97['config']['define']('ai.assistant.contentAreaCssClass',''),this['_uiCssClasses']='ck-ai-assistant-ui\x20ck-ai-assistant-ui_theme';}init(){const {editor:_0x3fe488}=this;this['_aiAdapter']=_0x3fe488['plugins']['get'](us),this['_dialog']=_0x3fe488['plugins']['get'](_0x2c281f),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x397ac2=new gs(_0x3fe488,Array['from'](this['_commandDefinitions']['values']()));_0x3fe488['commands']['add']('showAIAssistant',_0x397ac2),_0x3fe488['ui']['componentFactory']['add']('aiCommands',_0xae3b1c=>{const _0x4d9d19=_0x348de2(_0xae3b1c);return _0x4d9d19['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x4d9d19['buttonView']['set']({'label':_s(_0xae3b1c,'AI\x20Commands'),'icon':_0x266664,'tooltip':!0x0}),_0x4d9d19['on']('execute',_0xa0ec35=>this['_onExecute'](_0xa0ec35['source']['id'])),_0x2b4251(_0x4d9d19,_0x3fe488['ui']['view']['body'],function(_0x5c7362){const _0x1d6b3c=Ds(_0x5c7362,as(_0x5c7362['config']['get']('ai.assistant.commands'),_0x5c7362['locale']))['filter'](_0x532c71=>_0x532c71['commands']['length']);return 0x1===_0x1d6b3c['length']?Ds(_0x5c7362,_0x1d6b3c[0x0]['commands'])['map'](_0x20e262=>({'id':_0x20e262['id'],'label':_0x20e262['label']})):_0x1d6b3c['map'](_0x2ad1e5=>{const {groupId:_0x24c82b,groupLabel:_0x5ca3cd,commands:_0x19bdf2}=_0x2ad1e5,_0x26eaca=Ds(_0x5c7362,_0x19bdf2)['map'](_0x4d5b19=>({'id':_0x4d5b19['id'],'label':_0x4d5b19['label']}));return{'id':_0x24c82b,'menu':_0x5ca3cd||_0x24c82b,'children':_0x26eaca};});}(_0x3fe488),{'ariaLabel':_s(_0xae3b1c,'AI\x20Commands')}),_0x4d9d19['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x397ac2['on']('change:enabledCommandsIds',_0x418eca),_0x4d9d19['menuView']['once']('render',_0x418eca),_0x4d9d19;function _0x418eca(){_0x4d9d19['isEnabled']=_0x397ac2['enabledCommandsIds']['length']>0x0;for(const _0x2ab9b8 of _0x4d9d19['menuView']['buttons'])_0x2ab9b8['isEnabled']=_0x397ac2['enabledCommandsIds']['includes'](_0x2ab9b8['id']);}}),_0x3fe488['ui']['componentFactory']['add']('menuBar:aiCommands',_0x2ae45f=>{const _0x4278b6=new _0x30233e(_0x2ae45f);_0x4278b6['buttonView']['set']({'label':_s(_0x2ae45f,'AI\x20Commands'),'icon':_0x266664}),_0x4278b6['bind']('isEnabled')['to'](_0x397ac2,'enabledCommandsIds',_0x5363b2=>_0x5363b2['length']>0x0);const _0x5555d8=as(_0x3fe488['config']['get']('ai.assistant.commands'),_0x2ae45f);return this['_populateMenuBarMenu'](_0x397ac2,_0x4278b6,_0x5555d8,_0x39490b=>this['_onExecute'](_0x39490b)),_0x4278b6;}),_0x3fe488['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x1e8c44=this['_createAIAssistantUIButton'](_0x1b12df);return _0x1e8c44['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x1e8c44;}),_0x3fe488['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x4e3ad6=this['_createAIAssistantUIButton'](_0x12150b);return _0x4e3ad6['set']({'role':'menuitemcheckbox'}),_0x4e3ad6;}),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x26aa60=[this['editor']];for(const _0x2fee2c of _0x26aa60){let _0x4d2ae4;for(const _0x4e5a24 in _0x2fee2c){const _0x34af46=_0x4e5a24,_0x56042e=_0x2fee2c[_0x34af46];if('aiLicenseKeyValid'==_0x56042e||'aiLicenseKeyInvalid'==_0x56042e||'aiLicenseKeyExpired'==_0x56042e||'aiLicenseKeyDomainLimit'==_0x56042e||'aiLicenseKeyNotAllowed'==_0x56042e||'aiLicenseKeyEvaluationLimit'==_0x56042e||'aiLicenseKeyUsageLimit'==_0x56042e){delete _0x2fee2c[_0x34af46],_0x4d2ae4=_0x56042e,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x4d2ae4&&_0x2fee2c['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x4d2ae4&&_0x2fee2c['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x4d2ae4&&_0x2fee2c['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x4d2ae4&&_0x2fee2c['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x4d2ae4&&_0x2fee2c['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x4d2ae4&&_0x2fee2c['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x36a19d='',_0x1405db='',_0x362e9e='custom'){const _0x9449e0=this['editor'],_0x588809=_0x9449e0['editing']['view'],_0xdcfd19=_0x9449e0['plugins']['get'](ls),_0x538d2f=_0x9449e0['plugins']['get'](_0x582f4d);_0xdcfd19['showFakeVisualSelection']();const _0x336247=new ks(),_0x2c407b=new ClipboardEvent('copy',{'clipboardData':_0x336247}),_0x182a6c=new _0x9e0a2b(_0x336247),_0x15faa9=new _0x2d8b34(_0x588809,_0x2c407b,{'dataTransfer':_0x182a6c});_0x538d2f['_forceMarkersCopy']('comment',()=>{_0x588809['document']['fire']('copy',_0x15faa9);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new ps(_0x9449e0,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x352b07=_0x182a6c['getData']('text/html');const _0x5dc43a=_0x9449e0['model']['document']['selection'],_0x23cc78=Array['from'](_0x5dc43a['getRanges']());0x1===_0x23cc78['length']&&_0x23cc78[0x0]['isFlat']&&!_0x5dc43a['getSelectedElement']()&&''!==_0x352b07['replace'](/ /g,'')['trim']()&&(_0x352b07='<p>'+_0x352b07+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x362e9e,'query':_0x36a19d,'htmlContent':_0x352b07,'label':_0x1405db,'mainActionLabel':ms[_0x9449e0['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','title':_s(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x472d1d['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0xdcfd19['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}_getResolvedCommandsDefinitions(){const _0xd381ce=new Map(),_0x58212e=as(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x1e32d1 of _0x58212e)for(const _0xce2b12 of _0x1e32d1['commands'])_0xd381ce['set'](_0xce2b12['id'],{..._0xce2b12,'groupId':_0x1e32d1['groupId'],'groupLabel':_0x1e32d1['groupLabel']||_0x1e32d1['groupId']});return _0xd381ce;}_createAIAssistantUIButton(_0x33d0b8){const _0x244676=this['editor'],_0x529ba5=_0x244676['commands']['get']('showAIAssistant'),_0x33f459=new _0x33d0b8(_0x244676['locale']);return _0x33f459['set']({'label':_s(_0x244676['locale'],'AI\x20Assistant'),'icon':et,'isToggleable':!0x0}),_0x33f459['bind']('isEnabled')['to'](_0x529ba5),_0x33f459['bind']('isOn')['to'](this['_dialog'],'id',_0x428de9=>'aiAssistant'===_0x428de9),this['listenTo'](_0x33f459,'execute',()=>{_0x33f459['isOn']?this['hideUI']():_0x529ba5['execute']();}),_0x33f459;}_initView(){const _0x3b67e6=this['editor']['plugins']['get'](ls);this['_formView']=new Ns(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',()=>{_0x3b67e6['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x3b67e6['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}_initAriaAiStatusChangeAnnouncements(){const {locale:_0x3fe8bf,ui:{ariaLiveAnnouncer:_0x558971}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x59969,_0x50ee2f,_0x4a91cf)=>{const _0x543541=this['_aiAssistantController']['currentContext'];_0x4a91cf?_0x558971['announce'](_s(_0x3fe8bf,'AI\x20is\x20writing')):_0x543541&&_0x558971['announce'](_s(_0x3fe8bf,'Generated\x20content:\x20%0',_0x543541),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x31feca,_0x5a7f00,_0x46ad5c)=>{if(_0x46ad5c){const _0x31c4b1=this['_formView']['errorView']['text'];_0x558971['announce'](_s(_0x3fe8bf,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x31c4b1));}});}_onExecute(_0x2f0527){const _0x5ad93e=this['_commandDefinitions']['get'](_0x2f0527),_0x29f3dd=this['editor'],_0x397a33=_0x29f3dd['model']['document']['selection'],_0x45b26d=_0x29f3dd['commands']['get']('showAIAssistant'),_0x19bfbc=_0x29f3dd['plugins']['get'](ls),_0x2ed4eb=''+('_ungrouppedCommands'!==_0x5ad93e['groupId']?_0x5ad93e['groupLabel']+':\x20':'')+_0x5ad93e['label'];if(!0x1!==_0x5ad93e['requiresContent']&&_0x397a33['isCollapsed']){const _0x5c866b=Ot(_0x397a33['getSelectedBlocks']())||_0x29f3dd['model']['schema']['getLimitElement'](_0x397a33);_0x29f3dd['model']['change'](_0x42da62=>{_0x42da62['setSelection'](_0x5c866b,'in');});}_0x19bfbc['showFakeVisualSelection'](),_0x45b26d['execute'](_0x5ad93e['prompt'],_0x2ed4eb,'command:'+_0x2f0527);}_populateMenuBarMenu(_0x3370da,_0x164b26,_0xb0e73c,_0x7134ff){const _0x307c76=this['editor'],_0x4b1aba=_0x307c76['locale'],_0x30634d=new _0x525003(_0x4b1aba),_0x3b7dbd=Ds(_0x307c76,_0xb0e73c)['filter'](_0x233078=>_0x233078['commands']['length']);0x1===_0x3b7dbd['length']?this['_getMenuBarGroupButtons']({'command':_0x3370da,'commands':_0x3b7dbd[0x0]['commands'],'parentMenuView':_0x164b26,'onExecute':_0x7134ff})['forEach'](_0x2a312e=>_0x30634d['items']['add'](_0x2a312e)):_0x3b7dbd['forEach'](({groupId:_0x10c617,groupLabel:_0x209179,commands:_0x4c4b84})=>{const _0x3f86ce=new _0x1a22a2(_0x4b1aba,_0x164b26),_0x2ad856=new _0x30233e(_0x4b1aba),_0x49082b=new _0x525003(_0x4b1aba),_0x27bf28=this['_getMenuBarGroupButtons']({'command':_0x3370da,'commands':_0x4c4b84,'parentMenuView':_0x2ad856,'onExecute':_0x7134ff});_0x2ad856['buttonView']['set']({'label':_0x209179||_0x10c617}),_0x2ad856['delegate']('execute')['to'](_0x164b26),_0x49082b['items']['addMany'](_0x27bf28),_0x2ad856['panelView']['children']['add'](_0x49082b),_0x3f86ce['children']['add'](_0x2ad856),_0x30634d['items']['add'](_0x3f86ce);}),_0x164b26['panelView']['children']['add'](_0x30634d);}_getMenuBarGroupButtons({command:_0x328bcc,commands:_0x3bf798,parentMenuView:_0x324469,onExecute:_0xc3a994}){const _0x462afb=this['editor'],_0x436681=_0x462afb['locale'];return Ds(_0x462afb,_0x3bf798)['map'](_0x57249e=>{const _0x38563c=new _0x1a22a2(_0x436681,_0x324469),_0x944b18=new _0x12150b(_0x436681);return _0x944b18['set']({'label':_0x57249e['label']}),_0x944b18['delegate']('execute')['to'](_0x324469),_0x944b18['on']('execute',()=>_0xc3a994(_0x57249e['id'])),_0x944b18['bind']('isEnabled')['to'](_0x328bcc,'enabledCommandsIds',_0x5a238c=>_0x5a238c['includes'](_0x57249e['id'])),_0x38563c['children']['add'](_0x944b18),_0x38563c;});}};function Ls(_0x1e3045,_0x10db9c){return void 0x0!==_0x1e3045['order']&&void 0x0===_0x10db9c['order']?0x1:void 0x0===_0x1e3045['order']&&void 0x0!==_0x10db9c['order']?-0x1:void 0x0!==_0x1e3045['order']&&void 0x0!==_0x10db9c['order']?_0x1e3045['order']-_0x10db9c['order']:0x0;}function Ds(_0x2e5a85,_0x33285f){_0x33285f['sort'](Ls);const _0x5a05c4={},_0x11efb9=[];for(const _0x55a6d6 of _0x33285f)if(void 0x0!==_0x55a6d6['order']){if(_0x55a6d6['order']in _0x5a05c4)throw new dt('ai-commands-config-order-collision',_0x2e5a85,{'conflictingDefinitions':[_0x55a6d6,_0x5a05c4[_0x55a6d6['order']]]});_0x5a05c4[_0x55a6d6['order']]=_0x55a6d6,_0x11efb9['splice'](_0x55a6d6['order'],0x0,_0x55a6d6);}else _0x11efb9['push'](_0x55a6d6);return _0x11efb9;}var Ps=class extends _0x52da8c{static get requires(){return[xs,ls];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4a8543){super(_0x4a8543);const _0x1bbea2=_0x4a8543['config'],_0x2d4ed8=_0x4a8543['locale'];_0x1bbea2['define']('ai.assistant.preserveComments',!0x0),_0x1bbea2['define']('ai.assistant.commands',Ms(_0x2d4ed8)),_0x1bbea2['define']('ai.assistant.extraCommandGroups',[]),_0x1bbea2['define']('ai.assistant.removeCommands',[]);let _0x1a5d5d=as(_0x1bbea2['get']('ai.assistant.commands'),_0x2d4ed8);const _0x14055e=_0x1bbea2['get']('ai.assistant.extraCommandGroups'),_0x5df014=_0x1bbea2['get']('ai.assistant.removeCommands');_0x14055e['forEach'](_0x56768c=>{const _0x327a16=_0x1a5d5d['find'](_0x57368a=>_0x57368a['groupId']===_0x56768c['groupId']);_0x327a16?_0x327a16['commands']=_0x327a16['commands']['concat'](_0x56768c['commands']):_0x1a5d5d['push'](_0x56768c);}),_0x1a5d5d=_0x1a5d5d['filter'](_0x1afe10=>!_0x5df014['includes'](_0x1afe10['groupId'])),_0x1a5d5d['forEach'](_0x57bb4c=>{_0x57bb4c['commands']=_0x57bb4c['commands']['filter'](_0x410ee8=>!_0x5df014['includes'](_0x410ee8['id']));}),_0x1bbea2['set']('ai.assistant.commands',_0x1a5d5d);}};function Ms(_0x364c80){return[{'groupId':'editOrReview','groupLabel':_s(_0x364c80,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':_s(_0x364c80,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':_s(_0x364c80,'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':_s(_0x364c80,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':_s(_0x364c80,'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':_s(_0x364c80,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':_s(_0x364c80,'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':_s(_0x364c80,'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':_s(_0x364c80,'Change\x20tone'),'commands':[{'id':'professional','label':_s(_0x364c80,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':_s(_0x364c80,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':_s(_0x364c80,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':_s(_0x364c80,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':_s(_0x364c80,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':_s(_0x364c80,'Change\x20style'),'commands':[{'id':'business','label':_s(_0x364c80,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':_s(_0x364c80,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':_s(_0x364c80,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':_s(_0x364c80,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':_s(_0x364c80,'Translate'),'commands':[{'id':'translateEnglish','label':_s(_0x364c80,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':_s(_0x364c80,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':_s(_0x364c80,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':_s(_0x364c80,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':_s(_0x364c80,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':_s(_0x364c80,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':_s(_0x364c80,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':_s(_0x364c80,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}var Vs=class extends _0x52da8c{abortController;static get requires(){return[us];}constructor(_0x1602b0){super(_0x1602b0),this['abortController']=new AbortController();}init(){this['editor']['plugins']['get'](us)['textAdapter']=this;}abort(){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async makeRequest(_0x10c3f5){return this['sendRequest'](_0x10c3f5)['catch'](_0x44f53c=>{if(_0x44f53c instanceof ds)return Promise['reject'](_0x44f53c);if('AbortError'==_0x44f53c['name'])return Promise['resolve']();throw console['error'](_0x44f53c),new dt('aitextadapter-send-request-failed',null);});}async _prepareRequestHeaders(_0x1038e7,_0x500469){const _0x406ccb=this['editor']['locale'],_0x4474f4={'Content-Type':'application/json'};if('object'==typeof _0x1038e7)Object['assign'](_0x4474f4,_0x1038e7);else{if(_0x1038e7)try{const _0x450b75=await _0x1038e7(_0x500469);Object['assign'](_0x4474f4,_0x450b75);}catch{return Promise['reject'](new ds(_s(_0x406ccb,'AI_ERROR_GET_HEADERS')));}}return _0x4474f4;}async _prepareRequestParameters(_0x126b04,_0x4df852){const _0x2ae23c=this['editor']['locale'];if('object'==typeof _0x126b04)return _0x126b04;try{return await _0x126b04(_0x4df852);}catch{return Promise['reject'](new ds(_s(_0x2ae23c,'AI_ERROR_GET_PARAMETERS')));}}},Hs=class extends Vs{['_apiUrl'];_requestHeaders;_requestParameters;static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0xee787f){super(_0xee787f),_0xee787f['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0xee787f['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0xee787f['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0xee787f['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0xee787f['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0xee787f['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async sendRequest({query:_0x15fca5,context:_0x46921e,onData:_0x58ce27,actionId:_0x4a41f7}){const _0x3852aa=this['editor']['locale'],_0x16a745=await this['prepareMessages'](_0x15fca5,_0x46921e,_0x4a41f7),_0x5a3f46=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4a41f7),_0x20453b=await this['_prepareRequestParameters'](this['_requestParameters'],_0x4a41f7),_0x211cd7={'messages':_0x16a745,..._0x20453b},_0x3032c2={'method':'POST','headers':_0x5a3f46,'body':JSON['stringify'](_0x211cd7),'signal':this['abortController']['signal']},_0x1c8062=await fetch(this['_apiUrl'],_0x3032c2);if(_0x1c8062['ok'])return _0x20453b['stream']?await this['_readStreamableResponse'](_0x1c8062,_0x58ce27):await this['_readStaticResponse'](_0x1c8062,_0x58ce27),Promise['resolve']();{const _0x314c36=await _0x1c8062['text']();return _0x314c36['includes']('context_length_exceeded')?Promise['reject'](new ds(_s(_0x3852aa,'AI_ERROR_CONTEXT_LENGTH'))):_0x314c36['includes']('Moderation')?Promise['reject'](new ds(_s(_0x3852aa,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x314c36));}}async['prepareMessages'](_0x57e77a,_0x5d4e39,_0x4c3f70){let _0x4bc7bb,_0xacbf55;return _0x5d4e39?(_0x4bc7bb='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.',_0xacbf55='Instruction:\x0a'+_0x57e77a+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x5d4e39):(_0x4bc7bb='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.',_0xacbf55=_0x57e77a),[{'role':'system','content':_0x4bc7bb},{'role':'user','content':_0xacbf55}];}async _readStreamableResponse(_0x2600e3,_0x16eb5e){const _0x54e131=_0x2600e3['body']['getReader'](),_0x20d594=new TextDecoder();let _0x435b6a='',_0x3756d9='',_0x3d208a='',_0x13bae6=!0x1;for(;!_0x13bae6;){const {done:_0x3653d7,value:_0x44b08d}=await _0x54e131['read'](),_0x36789f=_0x435b6a+_0x20d594['decode'](_0x44b08d);let _0x76433f;_0x13bae6=_0x3653d7;try{_0x76433f=this['_cleanUpData'](_0x36789f),_0x435b6a='';}catch{_0x435b6a=_0x36789f;continue;}_0x3756d9+=_0x76433f,!_0x13bae6&&this['_isBufferIncomplete'](_0x3756d9)||_0x3756d9&&(_0x3d208a+=_0x3756d9,_0x3756d9='',_0x16eb5e(_0x3d208a));}return Promise['resolve']();}async _readStaticResponse(_0x547056,_0x329775){return _0x329775((await _0x547056['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}_isBufferIncomplete(_0x2e662d){const _0x3014bf=_0x2e662d['split']('<')['length']!==_0x2e662d['split']('>')['length'],_0xada266=_0x2e662d['length']<0x1e;return _0x3014bf&&_0xada266;}_cleanUpData(_0x63bf58){return _0x63bf58['split'](/\n(?![^{]*\})/g)['map'](_0x3fa818=>_0x3fa818['replace']('data:\x20',''))['filter'](_0x78d1da=>_0x78d1da&&_0x78d1da['length']>0x0&&'[DONE]'!==_0x78d1da)['map'](_0x420771=>{const {choices:_0x3216eb}=JSON['parse'](_0x420771);if(_0x3216eb[0x0]?.['delta']?.['content'])return _0x3216eb[0x0]['delta']['content'];})['filter'](_0x428f19=>_0x428f19)['join']('');}},Us=class extends Vs{static get['pluginName'](){return'AWSTextAdapter';}init(){super['init'](),Ft('ai-aws-adapter-not-supported');}async sendRequest(_0x630051){throw Wt('ai-aws-adapter-not-supported'),new ds(_s(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}},Bs=class extends _0x43ad99{buttonViews=this['createCollection']();['panelViews']=this['createCollection']();_tabs=new Map();constructor(_0x2302e7,_0x54752c={}){super(_0x2302e7),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x54752c['side']||'top'),this['set']('isMaximized',!0x1),this['set']('collapsible',_0x54752c['collapsible']||!0x1),this['set']('isCollapsed',!0x1),this['set']('_isMaximizedActive',!0x1),this['bind']('_isMaximizedActive')['to'](this,'isMaximized',this,'isCollapsed',(_0xfddf51,_0x45e4c7)=>_0xfddf51&&!_0x45e4c7);const _0x1d2dfc=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...qt(_0x54752c['class']||[]),_0x1d2dfc['to']('side',_0x2406b8=>'ck-tabs_'+_0x2406b8),_0x1d2dfc['to']('class'),_0x1d2dfc['if']('_isMaximizedActive','ck-ai-tabs_maximized'),_0x1d2dfc['if']('isCollapsed','ck-ai-tabs_collapsed')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x1d2dfc['to']('side',_0x5a2fd1=>'ck-tabs__buttons-container_'+_0x5a2fd1)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x1d2dfc['to']('side',_0x51c274=>'ck-tabs__panels-container_'+_0x51c274)]},'children':this['panelViews']},...qt(_0x54752c['children']||[])]});}getTabIds(){return[...this['_tabs']['keys']()];}getTab(_0x1c4d69){const _0x5ad9a0=this['_tabs']['get'](_0x1c4d69);return _0x5ad9a0||null;}['addTab'](_0x5ba71a){const _0x9f0fe8=this['_setupButton']({'id':_0x5ba71a['id'],'label':_0x5ba71a['buttonLabel'],'icon':_0x5ba71a['buttonIcon'],'order':_0x5ba71a['order']}),_0x72320c=new _0x3faa7f(this['locale']);return _0x72320c['render'](),_0x5ba71a['content']&&_0x72320c['children']['add'](_0x5ba71a['content']),this['panelViews']['add'](_0x72320c),this['_tabs']['set'](_0x5ba71a['id'],{'button':_0x9f0fe8,'panel':_0x72320c,'order':void 0x0!==_0x5ba71a['order']?_0x5ba71a['order']:null}),this['fire']('addTab:'+_0x5ba71a['id'],{'id':_0x5ba71a['id'],'button':_0x9f0fe8,'panel':_0x72320c}),null===this['activeTab']?this['_activateTab'](_0x5ba71a['id']):this['_hidePanel'](_0x5ba71a['id']),{'button':_0x9f0fe8,'panel':_0x72320c};}activateTab(_0x509224){this['_activateTab'](_0x509224);}_activateTab(_0x21957b){if(null!==_0x21957b&&!this['getTab'](_0x21957b))throw new dt('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x21957b});if(this['isCollapsed']=!0x1,this['activeTab']===_0x21957b)return;const _0x2d7d0f=this['activeTab'];this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x21957b,_0x21957b&&this['_showPanel'](_0x21957b),this['fire']('activateTab:'+_0x21957b,{'newTab':_0x21957b,'oldTab':_0x2d7d0f});}toggleTabPanel(_0x563996){this['activeTab']===_0x563996?this['collapsible']&&(this['isCollapsed']=!this['isCollapsed']):this['activateTab'](_0x563996);}['showTab'](_0xadbf35){if(!this['getTab'](_0xadbf35))throw new dt('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0xadbf35});this['_showPanel'](_0xadbf35),this['_showButton'](_0xadbf35),this['fire']('show:'+_0xadbf35,_0xadbf35);}['hideTab'](_0x2df0e7){if(!this['getTab'](_0x2df0e7))throw new dt('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x2df0e7});const _0x3861cb=this['activeTab'];this['_hidePanel'](_0x2df0e7),this['_hideButton'](_0x2df0e7);const _0x34197e=this['getTabIds']();_0x3861cb===_0x2df0e7&&_0x34197e['length']>0x1&&this['_activateTab'](_0x34197e['find'](_0x4f82d5=>_0x4f82d5!==_0x2df0e7)),this['fire']('hide:'+_0x2df0e7,_0x2df0e7);}_getPanel(_0xcf0885){const _0x399dff=this['_tabs']['get'](_0xcf0885);return _0x399dff?_0x399dff['panel']:null;}['_showPanel'](_0x270ff){null!==this['activeTab']&&this['activeTab']!==_0x270ff||this['_getPanel'](_0x270ff)['show']();}['_hidePanel'](_0x1f8661){const _0x5b3a5a=this['_getPanel'](_0x1f8661);_0x5b3a5a['isVisible']&&(this['activeTab']===_0x1f8661&&(this['activeTab']=null),_0x5b3a5a['hide']());}_getButton(_0x4c51d9){const _0x17db26=this['_tabs']['get'](_0x4c51d9);return _0x17db26?_0x17db26['button']:null;}_showButton(_0x2726c0){this['_getButton'](_0x2726c0)['show']();}_hideButton(_0x4e00fb){this['_getButton'](_0x4e00fb)['hide']();}_setupButton(_0x49c0e8){const _0x4d2e88=new _0x2dc6fb(this['locale'],{'side':this['side']}),_0x2b7d9f=this['buttonViews'];if(_0x4d2e88['set']({'label':_0x49c0e8['label'],'icon':_0x49c0e8['icon'],'tooltip':!0x0,'withText':!0x0}),_0x4d2e88['bind']('isOn')['to'](this,'activeTab',this,'isCollapsed',(_0x3bc556,_0x387ca9)=>_0x3bc556===_0x49c0e8['id']&&!_0x387ca9),_0x4d2e88['bind']('side')['to'](this,'side'),_0x49c0e8['order']){const _0x584bbf=[...this['_tabs']]['reduce']((_0x4e3e76,_0x30a0fa)=>{const _0x2ddec6=_0x30a0fa[0x0],{order:_0x3cd490}=_0x30a0fa[0x1];return!_0x3cd490||_0x3cd490>_0x49c0e8['order']?_0x4e3e76:_0x3cd490>=_0x4e3e76['order']?{'id':_0x2ddec6,'order':_0x3cd490}:_0x4e3e76;},{'id':'','order':0x0}),_0x2141f7=_0x2b7d9f['getIndex'](this['_getButton'](_0x584bbf['id']));_0x2b7d9f['add'](_0x4d2e88,_0x2141f7+0x1);}else _0x2b7d9f['add'](_0x4d2e88);return _0x4d2e88['on']('execute',()=>{this['toggleTabPanel'](_0x49c0e8['id']);}),_0x4d2e88;}};const Gs=['overlay','sidebar','custom'],Ws=['left','right'];var Fs=class extends Bs{constructor(_0x501c72,_0x2446f6={}){super(_0x501c72,_0x2446f6),this['set']('type',_0x2446f6['type']||'sidebar'),this['set']('side',_0x2446f6['side']||'right'),this['set']('isVisible',_0x2446f6['visibleByDefault']??!0x0);const _0xa772f0=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0xa772f0['if']('type','ck-ai-tabs__overlay',_0xd2c232=>'overlay'===_0xd2c232),_0xa772f0['if']('type','ck-ai-tabs__sidebar',_0x214ab8=>'sidebar'===_0x214ab8),_0xa772f0['if']('isVisible','ck-hidden',_0x5d51a5=>!_0x5d51a5)]}}),this['buttonViews']['on']('add',(_0x37b23f,_0x120b20)=>{_0x120b20['set']('withText',!0x1);});}activateTab(_0x311c){const {eventInfo:_0x337632}=this['_fireBeforeActivateTab'](_0x311c);return!_0x337632['stop']['called']&&(this['_finalizeActivateTab'](_0x311c),!0x0);}async activateTabAwaitingConfirmation(_0x25a33c){const {eventInfo:_0x5e8a70,activationConfirmed:_0x4ddd94}=this['_fireBeforeActivateTab'](_0x25a33c,!0x0);return!(_0x5e8a70['stop']['called']&&!await _0x4ddd94)&&(this['_finalizeActivateTab'](_0x25a33c),!0x0);}forceActivateTab(_0xc7aad8){this['_finalizeActivateTab'](_0xc7aad8);}_finalizeActivateTab(_0x5f38fa){super['activateTab'](_0x5f38fa);}_fireBeforeActivateTab(_0x2cd41a,_0x32c22b=!0x1){if(null!==_0x2cd41a&&!this['getTab'](_0x2cd41a))throw new dt('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x2cd41a});const _0x5dda44=this['activeTab'],_0x8fcc1c=new At(this,'beforeActivateTab');let _0x563784=()=>{};const _0x5abc6d=new Promise(_0x5130a8=>{_0x563784=_0x5130a8;}),_0x48785a={'newTab':_0x2cd41a,'oldTab':_0x5dda44};return _0x32c22b&&(_0x48785a['resolveActivation']=_0x563784),this['fire'](_0x8fcc1c,_0x48785a),{'eventInfo':_0x8fcc1c,'activationConfirmed':_0x5abc6d};}},Ks=class extends _0x4f3978{['view'];get bodyCollection(){return this['_overlayHost']['bodyCollection'];}_sidebarElement=null;_overlayHost;showResizeButton=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x12e133){if(super(_0x12e133),!this['context']['config']['get']('ai.container'))throw new dt('ai-tabs-configuration-not-found');this['context']['config']['define']('ai.container.visibleByDefault',!0x0),this['context']['config']['define']('ai.container.collapsible',!0x1);const _0x199df8=this['context']['config']['get']('ai.container');if(this['set']('side','right'),this['set']('container',null),void 0x0!==_0x199df8['showResizeButton']&&(this['showResizeButton']=_0x199df8['showResizeButton']),'sidebar'!==_0x199df8['type']&&'overlay'!==_0x199df8['type']||_0x199df8['side']&&(this['side']=_0x199df8['side']),'sidebar'===_0x199df8['type']){if(this['set']('type','sidebar'),this['_sidebarElement']=_0x199df8['element'],!_0x199df8['element'])throw new dt('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x199df8['type']?this['set']('type','overlay'):this['set']('type','custom');this['view']=new Fs(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':_0x199df8['visibleByDefault'],'collapsible':_0x199df8['collapsible']}),this['view']['render'](),this['view']['bind']('side')['to'](this,'side'),this['view']['bind']('type')['to'](this,'type'),this['_overlayHost']=new _0x405998(this['context']['locale'],{'resolveMountTarget':()=>this['_resolveOverlayMountTarget'](),'resolveInlineContainer':()=>this['container']}),this['bodyCollection']['bodyCollectionContainer']['classList']['add']('ck-ai-body'),this['_refreshContainer'](),this['_mountView'](),this['on']('change:container',()=>this['_mountView']()),this['on']('change:type',()=>this['_refreshContainer']()),this['on']('change:side',()=>this['_overlayHost']['sync']()),this['context']['editors']?this['listenTo'](this['context']['editors'],'add',(_0x43dd52,_0x4f4b9a)=>this['_refreshContainerWhenReady'](_0x4f4b9a)):this['context']instanceof _0xfb41df&&this['_refreshContainerWhenReady'](this['context']),this['context']instanceof _0xfb41df&&this['context']['ui']['focusTracker']['add'](this['view']['element']),this['listenTo'](this,'resizeTabs',()=>{this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);});}_refreshContainer(){if('sidebar'===this['type'])this['_sidebarElement']&&(this['container']=this['_sidebarElement']);else{if('overlay'===this['type']){const _0x39ee0c=this['_configuredOverlayContainer'];if(_0x39ee0c)return void(this['container']=_0x39ee0c);for(const _0x361b7d of this['_editors'])if('ready'===_0x361b7d['state']){for(const _0x3f18aa of _0x361b7d['editing']['view']['domRoots']['values']())if(_0x3f18aa['isConnected'])return void(this['container']=xt(_0x3f18aa));}this['container']=document['body'];}}}_refreshContainerWhenReady(_0x535f44){this['listenTo'](_0x535f44,'ready',()=>{'overlay'!==this['type']||this['container']&&this['container']!==document['body']||this['_refreshContainer'](),this['_overlayHost']['sync']();});}_mountView(){const _0x2cb5d0=this['view']['element'];'custom'!==this['type']&&this['container']&&Dt(_0x2cb5d0)!==this['container']&&this['container']['appendChild'](_0x2cb5d0),this['_overlayHost']['sync']();}_resolveOverlayMountTarget(){return this['_configuredOverlayContainer']?this['_configuredOverlayContainer']:this['container']?xt(this['container']):document['body'];}get _configuredOverlayContainer(){return this['_getConfiguredContainer']('ai.overlayContainer')||this['_getConfiguredContainer']('ui.overlayContainer');}_getConfiguredContainer(_0x463bc6){const _0xaa9e76=this['context']['config']['get'](_0x463bc6);if(_0xaa9e76)return _0xaa9e76;for(const _0x4c8111 of this['_editors']){const _0x35189f=_0x4c8111['config']['get'](_0x463bc6);if(_0x35189f)return _0x35189f;}return null;}get _editors(){return this['context']['editors']||(this['context']instanceof _0xfb41df?[this['context']]:[]);}switchType(_0x5c34f8){if(_0x5c34f8&&this['type']!==_0x5c34f8){if(!Gs['includes'](_0x5c34f8))throw new dt('ai-tabs-unsupported-ui-type');this['type']=_0x5c34f8;}}switchSide(_0xc6b277){if(_0xc6b277&&this['side']!==_0xc6b277){if(!Ws['includes'](_0xc6b277))throw new dt('ai-tabs-unsupported-ui-side');this['side']=_0xc6b277;}}destroy(){super['destroy'](),this['_overlayHost']['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}},$s=class extends _0x4f3978{['_apiUrl'];get['_apiUrlV11'](){return this['_apiUrl']['replace'](/\/v1$/,'/v1.1');}_token;['_decoder'];static get requires(){return[_0x5aa0ea];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x40ceae){if(super(_0x40ceae),this['context']['config']['define']('ai.serviceUrl','https://ai.cke-cs.com/v1'),this['_apiUrl']=this['context']['config']['get']('ai.serviceUrl')['replace'](/\/+$/,''),!this['_apiUrl']['endsWith']('/v1'))throw new dt('ai-service-url-invalid-version',this,{'serviceUrl':this['_apiUrl']});this['_token']=null,this['_decoder']=new TextDecoder();}init(){const _0x7e1216=this['context']['plugins']['get'](_0x5aa0ea);if(!_0x7e1216['token'])throw new dt('ai-missing-token',this);this['_token']=_0x7e1216['token'];}_getExtraHttpHeaders(){const _0x59710b=this['context']['config']['get']('ai.extraHttpHeaders'),_0x899bb7='function'==typeof _0x59710b?_0x59710b():_0x59710b;if(Array['isArray'](_0x899bb7)&&_0x899bb7['length'])return Object['fromEntries'](_0x899bb7['map'](({domain:_0x547e05,headers:_0x3ae7c2})=>[_0x547e05,_0x3ae7c2]));}startConversation(_0x533e94,_0x2a5d0f){const _0x4c589d=this['_sendApiRequest']('/conversations','POST',{'id':_0x533e94,'group':_0x2a5d0f});return{'getConversation':async()=>(await _0x4c589d['request'])['json'](),'abortController':_0x4c589d['abortController']};}queryAssistant({message:_0x1f7581,conversationId:_0x343ca3,parts:_0x3e9ad0,capabilities:_0x128b89,model:_0xbaf341,attributes:_0xd13399}){const _0x3ef603=this['_getExtraHttpHeaders'](),_0x274935={..._0x1f7581&&{'prompt':_0x1f7581},'content':_0x3e9ad0,'model':_0xbaf341,..._0x128b89&&{'capabilities':_0x128b89},..._0xd13399&&{'attributes':_0xd13399},..._0x3ef603&&{'extraHttpHeaders':_0x3ef603}},_0x57e841=this['_sendApiRequest']('/conversations/'+_0x343ca3+'/messages','POST',_0x274935,{'apiUrl':this['_apiUrlV11']});return{'getStream':async()=>{const _0x116b91=(await _0x57e841['request'])['body'];return this['_getStreamReader'](_0x116b91);},'abortController':_0x57e841['abortController']};}executeCustomAction({content:_0x79ae7a,message:_0x290bd2,model:_0x502387,outputFormat:_0x375f6d,contexts:_0x2c3ad2}){const _0x248c1d={'content':[{'type':'text','content':_0x79ae7a}],..._0x290bd2&&{'prompt':_0x290bd2},'model':_0x502387,'outputFormat':_0x375f6d,...Ys(_0x2c3ad2)},_0x488e29=this['_sendApiRequest']('/actions/custom/calls','POST',_0x248c1d);return{'getStream':async()=>{const _0x485749=(await _0x488e29['request'])['body'];return this['_getStreamReader'](_0x485749);},'abortController':_0x488e29['abortController']};}executeAction({actionName:_0x183594,content:_0x36ebc4,args:_0x59db1f,contexts:_0x1653bc}){const _0x69946d={'content':[{'type':'text','content':_0x36ebc4}],'args':_0x59db1f,...Ys(_0x1653bc)},_0x37a71f=this['_sendApiRequest']('/actions/system/'+_0x183594+'/calls','POST',_0x69946d);return{'getStream':async()=>{const _0x36383b=(await _0x37a71f['request'])['body'];return this['_getStreamReader'](_0x36383b);},'abortController':_0x37a71f['abortController']};}['uploadFile'](_0x14c1aa,_0x280501,_0x20640d){const _0x413f1f=new FormData();_0x413f1f['append']('file',_0x280501,_0x280501['name']),_0x20640d&&_0x413f1f['append']('attributes',JSON['stringify'](_0x20640d));const _0x469ea2=this['_sendApiRequest']('/conversations/'+_0x14c1aa+'/files','POST',_0x413f1f);return{'getId':async()=>(await _0x469ea2['request'])['json'](),'abortController':_0x469ea2['abortController']};}uploadDocuments(_0x415553,_0x20ae5d){const _0x5126f1={'documents':_0x20ae5d['map'](_0x334c6d=>({'content':_0x334c6d['content'],'attributes':{'version':_0x334c6d['version'],'sessionId':_0x334c6d['sessionId'],'channelId':_0x334c6d['channelId'],'rootName':_0x334c6d['rootName'],'selections':_0x334c6d['selections']},...void 0x0!==_0x334c6d['name']?{'name':_0x334c6d['name']}:{},...void 0x0!==_0x334c6d['description']?{'description':_0x334c6d['description']}:{}}))},_0x31b498=this['_sendApiRequest']('/conversations/'+_0x415553+'/documents/batch','POST',_0x5126f1);return{'getIds':async()=>(await _0x31b498['request'])['json'](),'abortController':_0x31b498['abortController']};}fetchDocuments(_0x3b4c17,_0x286580){const _0x1a21e5=new URLSearchParams();_0x1a21e5['append']('documentIds',_0x286580['join'](','));const _0x5650ce=this['_sendApiRequest']('/conversations/'+_0x3b4c17+'/documents/batch?'+_0x1a21e5['toString'](),'GET');return{'getDocuments':async()=>(await _0x5650ce['request'])['json'](),'abortController':_0x5650ce['abortController']};}fetchConversations(_0x2e8bbf,_0x54fe27={}){const _0x40ad15=new URLSearchParams();_0x40ad15['append']('group',_0x2e8bbf),_0x40ad15['append']('excludeEmpty',!0x1!==_0x54fe27['excludeEmpty']?'true':'false'),_0x40ad15['append']('limit',_0x54fe27['limit']?_0x54fe27['limit']['toString']():0x64['toString']()),_0x40ad15['append']('sortBy',_0x54fe27['sortBy']?_0x54fe27['sortBy']:'createdAt'),_0x40ad15['append']('order',_0x54fe27['order']?_0x54fe27['order']:'desc');const _0x1c0a2d=this['_sendApiRequest']('/conversations?'+_0x40ad15['toString'](),'GET');return{'getConversations':async()=>(await(await _0x1c0a2d['request'])['json']())['items'],'abortController':_0x1c0a2d['abortController']};}deleteConversation(_0x18b426){const _0x47c906=this['_sendApiRequest']('/conversations/'+_0x18b426,'DELETE');return{'execute':async()=>{await _0x47c906['request'];},'abortController':_0x47c906['abortController']};}updateConversation(_0x38ff92,_0xfa2e93){const _0x2e43cb=this['_sendApiRequest']('/conversations/'+_0x38ff92,'PATCH',_0xfa2e93);return{'getResult':async()=>(await _0x2e43cb['request'],_0xfa2e93),'abortController':_0x2e43cb['abortController']};}fetchConversation(_0x955cb0){const _0x5eb05d=this['_sendApiRequest']('/conversations/'+_0x955cb0,'GET');return{'getConversation':async()=>(await _0x5eb05d['request'])['json'](),'abortController':_0x5eb05d['abortController']};}fetchConversationMessages(_0x135e45){const _0x4a2a20=this['_sendApiRequest']('/conversations/'+_0x135e45+'/messages','GET',void 0x0,{'apiUrl':this['_apiUrlV11']});return{'getMessages':async()=>(await(await _0x4a2a20['request'])['json']())['items'],'abortController':_0x4a2a20['abortController']};}['uploadUrl'](_0x2d8d36,_0x311ab5,_0x1a31f2){const _0x3dbb41=this['_sendApiRequest']('/conversations/'+_0x2d8d36+'/web-resources','POST',{'url':_0x311ab5,'attributes':_0x1a31f2});return{'getId':async()=>(await _0x3dbb41['request'])['json'](),'abortController':_0x3dbb41['abortController']};}getModels(_0x42702e='en'){const _0xb9243=new URLSearchParams();_0xb9243['append']('language',_0x42702e);const _0x807acd='/models/1?'+_0xb9243['toString'](),_0x5a421b=this['_sendApiRequest'](_0x807acd,'GET');return{'list':async()=>await(await _0x5a421b['request'])['json'](),'abortController':_0x5a421b['abortController']};}listContexts(_0x1de16e={}){const _0x17c639=new URLSearchParams();_0x17c639['append']('limit',_0x1de16e['limit']?_0x1de16e['limit']['toString']():0x64['toString']()),_0x1de16e['cursor']&&_0x17c639['append']('cursor',_0x1de16e['cursor']),_0x1de16e['order']&&_0x17c639['append']('order',_0x1de16e['order']);const _0x42db4b=this['_sendApiRequest']('/contexts?'+_0x17c639['toString'](),'GET');return{'getContexts':async()=>(await(await _0x42db4b['request'])['json']())['items'],'abortController':_0x42db4b['abortController']};}deleteFile(_0x3f931f,_0x261a3b){const _0x51204e=this['_sendApiRequest']('/conversations/'+_0x3f931f+'/files/'+_0x261a3b,'DELETE');return{'execute':async()=>{await _0x51204e['request'];},'abortController':_0x51204e['abortController']};}deleteDocument(_0x5d943d,_0x1fd516){const _0x22a58e=this['_sendApiRequest']('/conversations/'+_0x5d943d+'/documents/'+_0x1fd516,'DELETE');return{'execute':async()=>{await _0x22a58e['request'];},'abortController':_0x22a58e['abortController']};}deleteWebResource(_0x50f0cb,_0x30fee7){const _0x35e9ad=this['_sendApiRequest']('/conversations/'+_0x50f0cb+'/web-resources/'+_0x30fee7,'DELETE');return{'execute':async()=>{await _0x35e9ad['request'];},'abortController':_0x35e9ad['abortController']};}cancelStream(_0x476b19,_0x5499f3){const _0x46f86a=this['_sendApiRequest']('/conversations/'+_0x476b19+'/messages/'+_0x5499f3+'/stream','DELETE',void 0x0,{'apiUrl':this['_apiUrlV11']});return{'execute':async()=>{await _0x46f86a['request'];},'abortController':_0x46f86a['abortController']};}resumeStream(_0x260519,_0x156e01,_0x53721f='0-0'){const _0x2db18d=new URLSearchParams({'lastEventId':_0x53721f}),_0x734444=this['_sendApiRequest']('/conversations/'+_0x260519+'/messages/'+_0x156e01+'/stream?'+_0x2db18d['toString'](),'GET',void 0x0,{'apiUrl':this['_apiUrlV11']});return{'getStream':async()=>{const _0x2d8980=await _0x734444['request'];return this['_getStreamReader'](_0x2d8980['body']);},'abortController':_0x734444['abortController']};}callSystemReview({reviewName:_0x336ad3,content:_0xbe5ee0,args:_0x5e3d9e,contexts:_0x5ed6dc}){const _0x16d381=this['_sendApiRequest']('/reviews/system/'+_0x336ad3+'/calls','POST',{'content':[{'type':'text','content':_0xbe5ee0}],'args':_0x5e3d9e,...Ys(_0x5ed6dc)});return{'getStream':async()=>{const _0x2b0c07=(await _0x16d381['request'])['body'];return this['_getStreamReader'](_0x2b0c07);},'abortController':_0x16d381['abortController']};}processDocument({content:_0x5c2c94,prompt:_0x51094d,model:_0x110370,capabilities:_0x7228a5,contexts:_0x454fbf}){const _0x3fbb7c=this['_getExtraHttpHeaders'](),_0x267c8e=this['_sendApiRequest']('/documents/process','POST',{'content':_0x5c2c94,'prompt':_0x51094d,'model':_0x110370,..._0x7228a5&&{'capabilities':_0x7228a5},...Ys(_0x454fbf),..._0x3fbb7c&&{'extraHttpHeaders':_0x3fbb7c}});return{'getResult':async()=>(await _0x267c8e['request'])['json'](),'abortController':_0x267c8e['abortController']};}callCustomReview({content:_0x3ee53c,prompt:_0xf09ef4,model:_0x4f8e20,contexts:_0x3d20c6}){const _0x37e455=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x3ee53c}],..._0xf09ef4&&{'prompt':_0xf09ef4},'model':_0x4f8e20,...Ys(_0x3d20c6)});return{'getStream':async()=>{const _0x125c90=(await _0x37e455['request'])['body'];return this['_getStreamReader'](_0x125c90);},'abortController':_0x37e455['abortController']};}upsertAIChatRating(_0x357ba0,_0x48587c,_0x51fe48){const _0x3630a3=this['_sendApiRequest']('/conversations/'+_0x357ba0+'/messages/'+_0x48587c+'/ratings','PUT',{'positiveCount':_0x51fe48['positiveCount'],'totalCount':_0x51fe48['totalCount'],'modificationId':_0x51fe48['modificationId']});return{'execute':async()=>{await _0x3630a3['request'];},'abortController':_0x3630a3['abortController']};}upsertAIActionRating(_0x12f68a,_0x4e4fdb,_0x558439){const _0x37c733=this['_sendApiRequest']('/actions/system/'+_0x12f68a+'/calls/'+_0x4e4fdb+'/ratings','PUT',{'positiveCount':_0x558439['positiveCount'],'totalCount':_0x558439['totalCount']});return{'execute':async()=>{await _0x37c733['request'];},'abortController':_0x37c733['abortController']};}upsertCustomAIActionRating(_0x240925,_0x54e473){const _0x4b25cd=this['_sendApiRequest']('/actions/custom/calls/'+_0x240925+'/ratings','PUT',{'positiveCount':_0x54e473['positiveCount'],'totalCount':_0x54e473['totalCount']});return{'execute':async()=>{await _0x4b25cd['request'];},'abortController':_0x4b25cd['abortController']};}upsertAIReviewRating(_0x39e479,_0x3de124,_0x1a9510,_0x543633){const _0x3f81e3=this['_sendApiRequest']('/reviews/system/'+_0x39e479+'/calls/'+_0x3de124+'/ratings','PUT',{'positiveCount':_0x1a9510['positiveCount'],'totalCount':_0x1a9510['totalCount'],'dataId':_0x543633});return{'execute':async()=>{await _0x3f81e3['request'];},'abortController':_0x3f81e3['abortController']};}upsertCustomAIReviewRating(_0x5ed57a,_0x51cf43,_0x3dd456){const _0x2c3975=this['_sendApiRequest']('/reviews/custom/calls/'+_0x5ed57a+'/ratings','PUT',{'positiveCount':_0x51cf43['positiveCount'],'totalCount':_0x51cf43['totalCount'],'dataId':_0x3dd456});return{'execute':async()=>{await _0x2c3975['request'];},'abortController':_0x2c3975['abortController']};}_sendApiRequest(_0x4418bc,_0x103e3a,_0x3fa5bc,_0x336283={}){const {apiUrl:_0x1711cc=this['_apiUrl']}=_0x336283,_0x56d35c=new AbortController(),_0x2c916c=_0x3fa5bc instanceof FormData,_0x32289d={'Authorization':'Bearer\x20'+this['_token']?.['value'],'X-Editor-Version':zt};_0x3fa5bc&&!_0x2c916c&&(_0x32289d['Content-Type']='application/json');const _0x516df8={'method':_0x103e3a,'headers':_0x32289d,'signal':_0x56d35c['signal']};return _0x3fa5bc&&(_0x516df8['body']=_0x2c916c?_0x3fa5bc:JSON['stringify'](_0x3fa5bc)),{'request':fetch(''+_0x1711cc+_0x4418bc,_0x516df8)['catch'](_0x56c08b=>{this['_handleError'](_0x56c08b);})['then'](_0x3796a5=>_0x3796a5['ok']?_0x3796a5:_0x3796a5['json']()['then'](_0x467881=>{throw{'url':_0x1711cc,'path':_0x4418bc,'method':_0x103e3a,'body':_0x3fa5bc,'status':(_0x3796a5||{})['status'],'statusText':(_0x3796a5||{})['statusText'],'code':_0x467881['code'],'message':_0x467881['message'],'traceId':_0x467881['traceId'],'data':_0x467881['data']};})),'abortController':_0x56d35c};}async *_getStreamReader(_0x3e2d4c){const _0x39549b=[],_0xef3532=_0x3e2d4c['getReader'](),_0x2a6e09=_0x249b22({'onError':_0x5832e5=>{this['_handleError'](_0x5832e5);},'onEvent':_0x5359d7=>{_0x5359d7['data']=JSON['parse'](_0x5359d7['data']),_0x39549b['push'](_0x5359d7);}});try{let _0x1dfd8c=!0x1;for(;!_0x1dfd8c;){const {done:_0x28b25b,value:_0x3059b3}=await _0xef3532['read']();_0x28b25b&&(_0x1dfd8c=!0x0),_0x2a6e09['feed'](this['_decoder']['decode'](_0x3059b3,{'stream':!0x0})),yield*_0x39549b,_0x39549b['length']=0x0;}}catch(_0x280c42){this['_handleError'](_0x280c42);}finally{_0xef3532['releaseLock'](),_0x2a6e09['reset']();}}['_handleError'](_0x577ab9){if(_0x577ab9 instanceof dt)throw _0x577ab9;if(_0x577ab9 instanceof Error&&'AbortError'===_0x577ab9['name'])throw new dt('ai-request-aborted',this,{'originalError':_0x577ab9});throw new dt('ai-request-failed',this,{'originalError':_0x577ab9});}};function Ys(_0x3f1964){return _0x3f1964?.['length']?{'contexts':_0x3f1964}:{};}function qs(_0x1d9c5f,_0x25debc,_0x3a36e2){const t=_0x1d9c5f['t'];switch(_0x25debc){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'},_0x3a36e2);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_SUGGESTION_CONTENT_PART_STATE_OUTDATED_TOOLTIP':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_TOOLTIP','string':'Created\x20for\x20a\x20previous\x20version\x20of\x20the\x20document\x20and\x20can\x20no\x20longer\x20be\x20applied.'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_CONTENT_REMOVED_TOOLTIP':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_CONTENT_REMOVED_TOOLTIP','string':'Created\x20for\x20content\x20that\x20no\x20longer\x20exists.'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_EDITOR_REMOVED_TOOLTIP':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_EDITOR_REMOVED_TOOLTIP','string':'Created\x20for\x20content\x20that\x20no\x20longer\x20exists.'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_SESSION_CHANGED_TOOLTIP':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_SESSION_CHANGED_TOOLTIP','string':'Created\x20for\x20a\x20previous\x20version\x20of\x20the\x20document\x20and\x20can\x20no\x20longer\x20be\x20applied.'});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':'Response\x20stopped.'});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.'},_0x3a36e2);case'AI_CHAT_CONTEXT_FOLDER_NOT_SUPPORTED':return t({'id':'AI_CHAT_CONTEXT_FOLDER_NOT_SUPPORTED','string':'Folders\x20cannot\x20be\x20added\x20to\x20the\x20chat.\x20Try\x20adding\x20individual\x20files\x20instead.'});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.'},_0x3a36e2);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_PASTED_TEXT_NAME':return t({'id':'AI_CHAT_CONTEXT_PASTED_TEXT_NAME','string':'Pasted\x20Text'});case'AI_CHAT_DROP_ZONE_HINT':return t({'id':'AI_CHAT_DROP_ZONE_HINT','string':'Drop\x20files\x20here\x20to\x20add\x20to\x20the\x20chat'});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_LIBRARY_LABEL':return t({'id':'AI_CHAT_CONTEXT_LIBRARY_LABEL','string':'Context\x20library'});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_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.'},_0x3a36e2);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_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'},_0x3a36e2);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x3a36e2);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'},_0x3a36e2);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_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.'},_0x3a36e2);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.'},_0x3a36e2);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.'},_0x3a36e2);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.'},_0x3a36e2);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_CHAT_BALLOON_HEADER_TITLE':return t({'id':'AI_CHAT_BALLOON_HEADER_TITLE','string':'Change\x20%0\x20of\x20%1'},_0x3a36e2);case'AI_BALLOON_REJECT_BUTTON':return t({'id':'AI_BALLOON_REJECT_BUTTON','string':'Reject'});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.'},_0x3a36e2);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_REJECT_ALL':return t({'id':'AI_REVIEW_MODE_REJECT_ALL','string':'Reject\x20all'});case'AI_REVIEW_MODE_ACCEPT_REMAINING':return t({'id':'AI_REVIEW_MODE_ACCEPT_REMAINING','string':'Accept\x20remaining'});case'AI_REVIEW_MODE_REJECT_REMAINING':return t({'id':'AI_REVIEW_MODE_REJECT_REMAINING','string':'Reject\x20remaining'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_LEAVE_CONFIRMATION_TITLE':return t({'id':'AI_REVIEW_MODE_LEAVE_CONFIRMATION_TITLE','string':'Exit\x20Review\x20Mode'});case'AI_REVIEW_MODE_LEAVE_CONFIRMATION_CONTENT':return t({'id':'AI_REVIEW_MODE_LEAVE_CONFIRMATION_CONTENT','string':'You\x20can\x27t\x20continue\x20this\x20review\x20after\x20exiting.'});case'AI_REVIEW_MODE_LEAVE_CONFIRMATION_STAY_BUTTON':return t({'id':'AI_REVIEW_MODE_LEAVE_CONFIRMATION_STAY_BUTTON','string':'Stay\x20in\x20Review\x20Mode'});case'AI_REVIEW_MODE_LEAVE_CONFIRMATION_EXIT_BUTTON':return t({'id':'AI_REVIEW_MODE_LEAVE_CONFIRMATION_EXIT_BUTTON','string':'Exit\x20Review\x20Mode'});case'AI_REVIEW_MODE_PROGRESS':return t({'id':'AI_REVIEW_MODE_PROGRESS','string':'%0\x20of\x20%1\x20reviewed'},_0x3a36e2);case'AI_REVIEW_MODE_CONTENT_PART_TITLE':return t({'id':'AI_REVIEW_MODE_CONTENT_PART_TITLE','string':'Review\x20%0'},_0x3a36e2);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_SUGGEST_CHANGE':return t({'id':'AI_REVIEW_MODE_SUGGEST_CHANGE','string':'Suggest'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_NAVIGATION_READ_ONLY_NOTICE':return t({'id':'AI_REVIEW_MODE_NAVIGATION_READ_ONLY_NOTICE','string':'Review\x20Mode\x20-\x20editor\x20is\x20read-only'});case'AI_REVIEW_MODE_NAVIGATION_COUNTER':return t({'id':'AI_REVIEW_MODE_NAVIGATION_COUNTER','string':'Review\x20%0\x20of\x20%1'},_0x3a36e2);case'AI_REVIEW_MODE_NAVIGATION_PREVIOUS_CHANGE':return t({'id':'AI_REVIEW_MODE_NAVIGATION_PREVIOUS_CHANGE','string':'Previous\x20change'});case'AI_REVIEW_MODE_NAVIGATION_NEXT_CHANGE':return t({'id':'AI_REVIEW_MODE_NAVIGATION_NEXT_CHANGE','string':'Next\x20change'});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_MODE_RUN_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_RUN_REVIEW_BUTTON_LABEL','string':'Review'});case'AI_REVIEW_MODE_CUSTOM_PROMPT_PLACEHOLDER':return t({'id':'AI_REVIEW_MODE_CUSTOM_PROMPT_PLACEHOLDER','string':'Describe\x20how\x20you\x20want\x20to\x20review\x20the\x20content'});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':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.'});case'AI_REVIEW_CHECK_CORRECTNESS_TITLE':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_TITLE','string':'Check\x20correctness'});case'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION','string':'Verify\x20grammar,\x20spelling,\x20and\x20style'});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':'Remove\x20redundant\x20phrases,\x20simplify\x20wording,\x20and\x20suggest\x20active\x20voice.'});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':'Simplify\x20complex\x20sentences\x20and\x20highlight\x20formatting\x20that\x20makes\x20text\x20harder\x20to\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':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs'});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':'Make\x20your\x20writing\x20more\x20consistent\x20and\x20adapt\x20its\x20tone\x20to\x20match\x20the\x20intended\x20audience.'});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_REVIEW_MODE_REVIEW_CATEGORY_TITLE_NON_PARAMETERIZED':return t({'id':'AI_REVIEW_MODE_REVIEW_CATEGORY_TITLE_NON_PARAMETERIZED','string':'Select\x20and\x20run\x20review'});case'AI_REVIEW_MODE_REVIEW_CATEGORY_TITLE_PARAMETERIZED':return t({'id':'AI_REVIEW_MODE_REVIEW_CATEGORY_TITLE_PARAMETERIZED','string':'Customize\x20and\x20run\x20review'});case'AI_REVIEW_MODE_COMPLETE_REVIEW':return t({'id':'AI_REVIEW_MODE_COMPLETE_REVIEW','string':'Complete'});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_TRANSLATE_LEAVE_CONFIRMATION_TITLE':return t({'id':'AI_TRANSLATE_LEAVE_CONFIRMATION_TITLE','string':'Exit\x20Translation\x20Mode'});case'AI_TRANSLATE_LEAVE_CONFIRMATION_CONTENT':return t({'id':'AI_TRANSLATE_LEAVE_CONFIRMATION_CONTENT','string':'You\x20can\x27t\x20continue\x20this\x20translation\x20after\x20exiting.'});case'AI_TRANSLATE_LEAVE_CONFIRMATION_STAY_BUTTON':return t({'id':'AI_TRANSLATE_LEAVE_CONFIRMATION_STAY_BUTTON','string':'Stay\x20in\x20Translation\x20Mode'});case'AI_TRANSLATE_LEAVE_CONFIRMATION_EXIT_BUTTON':return t({'id':'AI_TRANSLATE_LEAVE_CONFIRMATION_EXIT_BUTTON','string':'Exit\x20Translation\x20Mode'});default:return _0x25debc;}}const Qs=/* #__PURE__ -- @preserve */
|
|
25
|
+
It();var Xs=class extends Qs{_connector;['_config'];['_locale'];_modelList=[];_modelsRequest=null;constructor({connector:_0x2ef025,config:_0x2fbb4c,locale:_0x15a3dd}){super(),this['_connector']=_0x2ef025,this['_config']=_0x2fbb4c,this['_locale']=_0x15a3dd;}get['_availableModels'](){const _0x3a1186=qt(this['_config']?.['displayedModels']??[])['filter'](_0x19d8a0=>_0x19d8a0['trim']());return _0x3a1186['length']?_0x3a1186:void 0x0;}get _defaultModelId(){return this['_config']?.['defaultModelId'];}async getAllModels(){return this['_modelsRequest']||(this['_modelsRequest']=this['_retrieveModels']()['catch'](_0x498dd3=>{throw this['_modelsRequest']=null,_0x498dd3;})),this['_modelsRequest'];}async getAvailableModels(){const _0xc4126a=await this['getAllModels']();let _0x421814;return _0x421814=this['_availableModels']?this['_filterModels'](_0xc4126a,this['_availableModels']):_0xc4126a['filter'](_0xedb9a2=>_0xedb9a2['recommended']),_0x421814;}async['resolveModel'](_0x56894f){const _0x26228b=await this['getAllModels']();if(!_0x26228b['length'])return null;if(_0x56894f){const _0x5a6c07=this['_getModelById'](_0x26228b,_0x56894f);if(_0x5a6c07)return _0x5a6c07;Ft('ai-chat-model-id-unrecognized',{'modelId':_0x56894f,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async getDefault(){const _0x26bf45=await this['getAvailableModels']();if(!_0x26bf45['length'])return null;if(this['_defaultModelId']){const _0x1f0940=this['_getModelById'](_0x26bf45,this['_defaultModelId']);if(_0x1f0940)return _0x1f0940;Ft('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x26bf45[0x0]['id']});}return _0x26bf45[0x0];}async['isAvailable'](_0x51febc){return(await this['getAvailableModels']())['some'](_0x349a41=>_0x349a41['name']===_0x51febc['name']&&_0x349a41['provider']===_0x51febc['provider']);}async getModel(_0x4b62fd){const _0x83490a=await this['getAllModels']();return this['_getModelById'](_0x83490a,_0x4b62fd)||null;}async _retrieveModels(){if(!this['_modelList']['length']){const _0x427ae6=this['_locale']['uiLanguage']||'en',_0x40750e=await this['_connector']['getModels'](_0x427ae6)['list']();this['_modelList']=_0x40750e['items']['map'](_0x2a3287=>zs(_0x2a3287)?{..._0x2a3287,'name':qs(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x2a3287);}return[...this['_modelList']];}_filterModels(_0x6f413d,_0x5b7888){let _0xb516d0;if(_0x5b7888){_0xb516d0=[];const _0x4fa15f=new Set(),_0x72a2b2='string'==typeof _0x5b7888?[_0x5b7888['toLocaleLowerCase']()]:_0x5b7888['map'](_0x439376=>_0x439376['toLocaleLowerCase']());for(const _0x49e792 of _0x72a2b2)for(const _0x3ac7fc of _0x6f413d)!_0x4fa15f['has'](_0x3ac7fc['id'])&&this['_isMatchingFilter'](_0x3ac7fc,_0x49e792)&&(_0xb516d0['push'](_0x3ac7fc),_0x4fa15f['add'](_0x3ac7fc['id']));}else _0xb516d0=_0x6f413d;return _0xb516d0;}_isMatchingFilter(_0x34b76e,_0x53f655){const _0x4a2826=_0x34b76e['id']['toLocaleLowerCase'](),_0x3af030=_0x34b76e['name']['toLocaleLowerCase'](),_0x1e2f6d=_0x34b76e['provider']['toLocaleLowerCase']();return _0x4a2826===_0x53f655||_0x3af030===_0x53f655||zs(_0x34b76e)&&'auto'===_0x53f655||_0x1e2f6d===_0x53f655||_0x4a2826['startsWith'](_0x53f655);}_getModelById(_0x44f957,_0x53c6a0){return _0x44f957['find'](_0x5466e3=>zs(_0x5466e3)&&'auto'===_0x53c6a0?_0x5466e3:_0x5466e3['id']===_0x53c6a0)||null;}};function zs(_0x5e3693){return _0x5e3693['id']['startsWith']('agent');}var js=class{_connector;_defaultContext;_contextsRequest=null;constructor({connector:_0x80daf7,defaultContext:_0xd95a22}){this['_connector']=_0x80daf7,this['_defaultContext']=_0xd95a22;}async getAllContexts(){return this['_contextsRequest']||(this['_contextsRequest']=this['_connector']['listContexts']()['getContexts']()['catch'](_0x778ba=>{throw this['_contextsRequest']=null,_0x778ba;})),[...await this['_contextsRequest']];}async getAvailableContexts(){const _0x3ceb1e=await this['getAllContexts'](),_0x217bad=new Set((this['_defaultContext']??[])['map'](_0x2ca082=>_0x2ca082['id']));return _0x3ceb1e['filter'](_0xfe1a87=>!_0x217bad['has'](_0xfe1a87['id']));}resolveContext({feature:_0x52b138,ids:_0x92ee9a=[],extraContexts:_0x535ca7=[],idScopedOnly:_0x400133=!0x1,context:_0x5d5d19}){const _0x2e5fa2=this['_resolveDefaultContext'](_0x52b138,_0x92ee9a,_0x400133);return _0x5d5d19['addDefaultContext']([..._0x2e5fa2,..._0x535ca7]),_0x5d5d19;}_resolveDefaultContext(_0x41d36e,_0x5d3461,_0x30065f=!0x1){if(!this['_defaultContext'])return[];const _0x11e055=[];for(const _0x52a36d of this['_defaultContext'])this['_entryAppliesToFeature'](_0x52a36d['features'],_0x41d36e,_0x5d3461)&&(_0x30065f&&this['_entryAppliesToFeature'](_0x52a36d['features'],_0x41d36e,[])||_0x11e055['push'](this['_toContextRef'](_0x52a36d)));return _0x11e055;}_toContextRef(_0x56bcb5){return'promptId'in _0x56bcb5?{'id':_0x56bcb5['id'],'promptId':_0x56bcb5['promptId']}:'fileId'in _0x56bcb5?{'id':_0x56bcb5['id'],'fileId':_0x56bcb5['fileId']}:{'id':_0x56bcb5['id']};}_entryAppliesToFeature(_0x2b2e4b,_0x4a897e,_0x121152){if(!_0x2b2e4b)return!0x0;const _0x55d184=_0x2b2e4b[_0x4a897e];return!!_0x55d184&&(!0x0===_0x55d184||_0x121152['some'](_0x1146e3=>_0x55d184['test'](_0x1146e3)));}},Js=class extends _0x4f3978{['models'];contextLibrary;static get['pluginName'](){return'AICore';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[$s];}init(){const _0xbe11aa=this['context']['plugins']['get']($s);this['models']=new Xs({'connector':_0xbe11aa,'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']}),this['contextLibrary']=new js({'connector':_0xbe11aa,'defaultContext':this['context']['config']['get']('ai.defaultContext')});}};function Zs(_0x3aeb0c){return _0x3aeb0c?_0x3aeb0c instanceof _0xfb41df?[_0x3aeb0c]:_0x3aeb0c['editors']&&0x0!==_0x3aeb0c['editors']['length']?Array['from'](_0x3aeb0c['editors']):[]:[];}function tn(_0x2fdcd6){const _0x189b14=Zs(_0x2fdcd6);if(!_0x189b14['length'])throw new dt('ai-get-editor-from-context-no-editor');if(0x1===_0x189b14['length'])return _0x189b14[0x0];const _0x39db7f=_0x189b14['find'](_0x11e551=>_0x11e551['ui']?.['focusTracker']?.['isFocused']);if(_0x39db7f)return _0x39db7f;const _0x4bedaa=function(_0x915ec6){if(_0x915ec6 instanceof _0xfb41df)return;const _0x11e46d=_0x915ec6;if(!_0x11e46d['plugins']||!_0x11e46d['plugins']['has']('AIEditing'))return;return _0x11e46d['plugins']['get']('AIEditing')['getLastContentFocusedEditor']?.();}(_0x2fdcd6);return _0x4bedaa&&_0x189b14['includes'](_0x4bedaa)?_0x4bedaa:_0x189b14[0x0];}function en(_0xce9d1e,_0x602660){return _0x53a3d9(_0xce9d1e,_0x602660);}function sn(_0x21fb29,_0x542bdc){return _0x3b6490(_0x21fb29,_0x542bdc);}function nn(_0x3c7c57,_0x3ae8d5,_0x124fdf){const _0x261ad7=null!==_0x3ae8d5?_0x31013b=>_0x31013b['attribs'][_0x3c7c57]===_0x3ae8d5:_0x10f805=>Boolean(_0x10f805['attribs'][_0x3c7c57]);return _0x4cc400(_0x1f3965=>_0x350de8(_0x1f3965)&&_0x261ad7(_0x1f3965),_0x124fdf);}function rn(_0x3d7bf1,_0x5a05a4,_0x2fa7be){const _0x44445f=null!==_0x5a05a4?_0x4b084a=>_0x4b084a['attribs'][_0x3d7bf1]===_0x5a05a4:_0x39d84b=>Boolean(_0x39d84b['attribs'][_0x3d7bf1]);return _0x3ddd9a(_0xdd3e52=>_0x350de8(_0xdd3e52)&&_0x44445f(_0xdd3e52),_0x2fa7be);}function on(_0x473374){return _0x3ddd9a(_0x5a1e4b=>_0x350de8(_0x5a1e4b)&&function(_0x1ceb16){const _0x10ac8e=_0x1ceb16['toLowerCase']();return'script'===_0x10ac8e||'style'===_0x10ac8e||_0x10ac8e['includes']('-');}(_0x5a1e4b['name']),_0x473374);}const an=['comment-start','comment-end','suggestion-start','suggestion-end'];function hn(_0x529b22){return _0x350de8(_0x529b22)&&an['includes'](_0x529b22['name']['toLowerCase']());}function cn(_0x3d80fc){return _0x50382a(_0x5507b6=>_0x3e33bf(_0x5507b6),_0x3d80fc,!0x0,0x1/0x0);}function ln(_0x238715,_0x1b8820){return _0x238715&&_0x350de8(_0x238715)?_0x238715['attribs'][_0x1b8820]:null;}function un(_0xef023c,_0x464dae,_0x4bfdb5){_0x350de8(_0xef023c)&&(null===_0x4bfdb5?delete _0xef023c['attribs'][_0x464dae]:_0xef023c['attribs'][_0x464dae]=_0x4bfdb5);}function dn(_0x4e4c0b,_0x385c28,_0x59e761){const _0x516af2=_0x385c28['cloneNode'](!0x0);'beforebegin'===_0x59e761?_0x21a8b9(_0x4e4c0b,_0x516af2):'afterbegin'===_0x59e761?_0x341e9c(_0x4e4c0b,_0x516af2):'beforeend'===_0x59e761?_0x581dad(_0x4e4c0b,_0x516af2):'afterend'===_0x59e761&&_0x40d2b1(_0x4e4c0b,_0x516af2);}function _n(_0x35db30){const _0x46d287=[];let _0x3df4e9=_0x35db30;for(;_0x3df4e9;)_0x3df4e9=_0x203a08(_0x3df4e9),_0x3df4e9&&_0x46d287['push'](_0x3df4e9);return _0x46d287;}function gn(_0x341775){return _0x341775['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function In(_0x1fa997){let _0x3c2db2=0x0;for(;_0x1fa997['parentNode'];)_0x1fa997=_0x1fa997['parentNode'],_0x3c2db2++;return _0x3c2db2;}function An(_0x336a06){const _0x1c6300=[];let _0x2c5cd1=_0x336a06['nextSibling'];for(;_0x2c5cd1;)_0x1c6300['push'](_0x2c5cd1),_0x2c5cd1=_0x2c5cd1['nextSibling'];_0x1c6300['forEach'](_0x337ff2=>{_0x20a4a8(_0x337ff2);});}function En(_0x210ca8,_0x33b0c4){return!!_0x210ca8['model']['document']['getRoot'](_0x33b0c4)&&!_0xfb89b7(_0x210ca8,_0x33b0c4);}function pn(_0x4919dc,_0xed02c6){return'<p\x20data-id=\x22'+_0xed02c6+'\x22>'+_0x4919dc+'</p>';}function mn(_0x1aa379){return'p'===_0x1aa379['name']['toLowerCase']()&&Boolean(_0x1aa379['attribs']['data-id']);}function Tn(_0x3beb94){const _0x33d85d=en(_0x3beb94)['children']['filter'](_0x350de8);return 0x1===_0x33d85d['length']&&mn(_0x33d85d[0x0])?_0x33d85d[0x0]['children']['map'](_0x1c1b7f=>sn(_0x1c1b7f))['join'](''):_0x3beb94;}function wn(_0x476265,_0x2505db){const _0x1a9728=function(_0x5271fa){const _0x308c1f=_0x5271fa['children']['filter'](_0x350de8);return 0x1===_0x308c1f['length']&&mn(_0x308c1f[0x0])?_0x308c1f[0x0]['children']:_0x5271fa['children'];}(_0x2505db),{blockElements:_0x1fb688}=_0x476265['editing']['view']['domConverter'],_0x315acc=_0x4334b8=>_0x4334b8['some'](_0x1f90c3=>_0x350de8(_0x1f90c3)&&('p'!==_0x1f90c3['name']['toLowerCase']()&&_0x1fb688['includes'](_0x1f90c3['name']['toLowerCase']())||_0x315acc(_0x1f90c3['children'])));if(_0x315acc(_0x1a9728))return!0x1;const _0x4a92a7=_0x1a9728['map'](_0x2d48db=>sn(_0x2d48db))['join'](''),_0x1d6046=_0x476265['data']['parse'](_0x4a92a7,'$root'),{schema:_0x1056e9}=_0x476265['model'];let _0x254033=0x0;for(const {item:_0x2d3384}of _0x476265['model']['createRangeIn'](_0x1d6046))if(_0x2d3384['is']('element')&&_0x1056e9['isBlock'](_0x2d3384)&&(++_0x254033>0x1||'paragraph'!==_0x2d3384['name']))return!0x1;return!0x0;}function Cn(_0xd58852,_0x22efb8){const _0x41c661=_0x22efb8['filter'](_0x5b0fdd=>'new'!=_0x5b0fdd['type'])['map'](_0x25f30a=>nn('data-id',_0x25f30a['id'],_0xd58852))['filter'](_0x15c33=>null!==_0x15c33),_0x11cf6c=_0x22efb8['filter'](_0x563ad8=>'removed'!=_0x563ad8['type'])['map'](_0x3a225b=>_0x3a225b['node']['cloneNode'](!0x0));let _0x77d6d5=null;if(_0x41c661['length']){_0x77d6d5=_0x41c661[0x0]['previousSibling'];for(let _0x238740=0x0;_0x238740<_0x41c661['length'];_0x238740++)_0x20a4a8(_0x41c661[_0x238740]);}if(_0x11cf6c['length']){_0x77d6d5||(_0x22efb8[0x0]['anchorId']?_0x77d6d5=nn('data-id',_0x22efb8[0x0]['anchorId'],_0xd58852):(_0x77d6d5=_0x11cf6c['shift'](),_0x341e9c(_0xd58852,_0x77d6d5)));for(let _0x33166f=0x0;_0x33166f<_0x11cf6c['length'];_0x33166f++)_0x40d2b1(_0x77d6d5,_0x11cf6c[_0x33166f]),_0x77d6d5=_0x11cf6c[_0x33166f];}}function fn(_0x41f4f3,_0x3b8f05){const _0x4d0898=new Set();for(const _0x12281d of _0x41f4f3){if(!_0x12281d['editor']||'destroyed'===_0x12281d['editor']['state']||!En(_0x12281d['editor'],_0x12281d['rootName']))continue;const _0x5e9627=_0x3b8f05['get'](_0x12281d['documentId']);let _0x3cc8f0;_0x5e9627?(_0x3cc8f0=_0x5e9627['cloneNode'](!0x0),Cn(_0x3cc8f0,_0x12281d['changes'])):_0x3cc8f0=new _0x52d767(_0x12281d['changes']['filter'](_0x2ded47=>'removed'!=_0x2ded47['type'])['map'](_0x4305d7=>_0x4305d7['node']['cloneNode'](!0x0))),wn(_0x12281d['editor'],_0x3cc8f0)||_0x4d0898['add'](_0x12281d['index']);}return _0x4d0898;}function Rn(_0x2ff0e0,_0x421f5d,_0x401550,_0x231b65){return En(_0x2ff0e0,_0x421f5d)?wn(_0x2ff0e0,en(_0x231b65))?{'before':Tn(_0x401550),'after':Tn(_0x231b65)}:null:{'before':_0x401550,'after':_0x231b65};}function bn(_0x1b3b3e,_0x124e4c){return{'isInline':En(_0x1b3b3e,_0x124e4c),'hostElement':Sn(_0x1b3b3e,_0x124e4c)};}function Sn(_0x194cc8,_0x17c636){const _0x173d06=On(_0x194cc8['config']['get']('roots')?.[_0x17c636]?.['element']);if(_0x173d06)return _0x173d06;const _0x120c67=_0x194cc8['model']['document']['getRoot'](_0x17c636)?.['getAttribute']('$rootEditableOptions');return On(_0x120c67?.['element'])||'div';}function On(_0x5223fb){if(_0x5223fb)return'string'==typeof _0x5223fb?_0x5223fb['toLowerCase']():_0x11c91a(_0x5223fb)?_0x5223fb['tagName']['toLowerCase']():_0x5223fb['name']?.['toLowerCase']();}function vn(_0xed0f5d,_0x148333){return _0x317d81(_0xed0f5d,_0x148333);}function yn(_0x1e6d3f,_0x432981){return _0x1e6d3f['map'](_0x2f2c56=>null!==_0x2f2c56&&'object'==typeof _0x2f2c56?vn(_0x2f2c56,_0x432981):_0x2f2c56);}function Nn(_0x266ae1){return _0x266ae1 instanceof RegExp?String(_0x266ae1):Array['isArray'](_0x266ae1)?_0x266ae1['map'](_0x4ffdbf=>Nn(_0x4ffdbf)):null!==_0x266ae1&&'object'==typeof _0x266ae1?Object['fromEntries'](Object['entries'](_0x266ae1)['map'](([_0x4f3115,_0x209317])=>[_0x4f3115,Nn(_0x209317)])):_0x266ae1;}const kn=[['BlockQuoteEditing','blockQuote'],['BoldEditing','bold'],['BookmarkEditing','bookmark'],['CodeEditing','code'],['HorizontalLineEditing','horizontalLine'],['HtmlEmbedEditing','htmlEmbed'],['ItalicEditing','italic'],['MathType','math'],['PageBreakEditing','pageBreak'],['Paragraph','paragraph'],['StandardEditingModeEditing','restrictedEditing'],['StrikethroughEditing','strikethrough'],['SubscriptEditing','subscript'],['SuperscriptEditing','superscript'],['TableOfContentsEditing','tableOfContents'],['Title','title'],['TodoListEditing','todoList'],['UnderlineEditing','underline']];function xn(_0x1d3214,_0x22650d='main'){const _0x938147={'editorVersion':zt,'rootType':bn(_0x1d3214,_0x22650d)};if(_0x1d3214['plugins']['has']('AlignmentEditing')&&(_0x938147['alignment']=_0x1d3214['config']['get']('alignment')),_0x1d3214['plugins']['has']('CodeBlockEditing')&&(_0x938147['codeBlock']=_0x1d3214['config']['get']('codeBlock')),_0x1d3214['plugins']['has']('FontBackgroundColorEditing')&&(_0x938147['fontBackgroundColor']=vn(_0x1d3214['config']['get']('fontBackgroundColor'),['documentColors','columns','colorPicker'])),_0x1d3214['plugins']['has']('FontColorEditing')&&(_0x938147['fontColor']=vn(_0x1d3214['config']['get']('fontColor'),['documentColors','columns','colorPicker'])),_0x1d3214['plugins']['has']('FontFamilyEditing')&&(_0x938147['fontFamily']=_0x1d3214['config']['get']('fontFamily'),_0x938147['fontFamily']&&_0x938147['fontFamily']['options']&&(_0x938147['fontFamily']['options']=yn(_0x938147['fontFamily']['options'],['model','upcastAlso']))),_0x1d3214['plugins']['has']('FontSizeEditing')&&(_0x938147['fontSize']=_0x1d3214['config']['get']('fontSize'),_0x938147['fontSize']&&_0x938147['fontSize']['options']&&(_0x938147['fontSize']['options']=yn(_0x938147['fontSize']['options'],['upcastAlso']))),_0x1d3214['plugins']['has']('FootnotesEditing')){const _0x427fd6=_0x1d3214['config']['get']('footnotes')??{};_0x427fd6['footnotesProperties']&&'object'==typeof _0x427fd6['footnotesProperties']&&(_0x427fd6['footnotesProperties']=vn(_0x427fd6['footnotesProperties'],['toolbar','listStyles'])),_0x938147['footnotes']=_0x427fd6;}if(_0x1d3214['plugins']['has']('GeneralHtmlSupport')){const _0x222d2a=_0x1d3214['config']['get']('htmlSupport');_0x222d2a&&(_0x938147['htmlSupport']=Nn(vn(_0x222d2a,['preserveEmptyBlocksInEditingView','htmlIframeSandbox','fullPage'])));}if(_0x1d3214['plugins']['has']('HeadingEditing')&&(_0x938147['heading']=_0x1d3214['config']['get']('heading'),_0x938147['heading']&&_0x938147['heading']['options']&&(_0x938147['heading']['options']=yn(_0x938147['heading']['options'],['model','icon','class','converterPriority','upcastAlso']))),_0x1d3214['plugins']['has']('HighlightEditing')&&(_0x938147['highlight']=_0x1d3214['config']['get']('highlight'),_0x938147['highlight']&&_0x938147['highlight']['options']&&(_0x938147['highlight']['options']=yn(_0x938147['highlight']['options'],['model','color']))),_0x1d3214['plugins']['has']('ImageBlockEditing')||_0x1d3214['plugins']['has']('ImageInlineEditing')){const _0x1be490=vn(_0x1d3214['config']['get']('image'),['toolbar','upload','insert','resizeOptions']);_0x1d3214['plugins']['has']('ImageResizeEditing')||delete _0x1be490['resizeUnit'],_0x1d3214['plugins']['has']('ImageStyleEditing')?_0x1be490['styles']?.['options']&&(_0x1be490['styles']['options']=yn(_0x1be490['styles']['options'],['icon'])):delete _0x1be490['styles'],_0x938147['image']=_0x1be490;}if(_0x1d3214['plugins']['has']('IndentBlock')&&(_0x938147['indentBlock']=_0x1d3214['config']['get']('indentBlock')),_0x1d3214['plugins']['has']('LineHeightEditing')&&(_0x938147['lineHeight']=_0x1d3214['config']['get']('lineHeight'),_0x938147['lineHeight']&&(delete _0x938147['lineHeight']['supportAllValues'],_0x938147['lineHeight']['options']&&(_0x938147['lineHeight']['options']=yn(_0x938147['lineHeight']['options'],['model'])))),_0x1d3214['plugins']['has']('LinkEditing')&&(_0x938147['link']=vn(_0x1d3214['config']['get']('link'),['toolbar'])),_0x1d3214['plugins']['has']('ListEditing')){const _0x27434d=_0x1d3214['config']['get']('list')??{};delete _0x27434d['enableListItemMarkerFormatting'],_0x1d3214['plugins']['has']('ListPropertiesEditing')?_0x27434d['properties']&&_0x27434d['properties']['styles']&&'object'==typeof _0x27434d['properties']['styles']&&(_0x27434d['properties']['styles']=vn(_0x27434d['properties']['styles'],['listStyleTypes'])):delete _0x27434d['properties'],_0x938147['list']=_0x27434d;}if(_0x1d3214['plugins']['has']('MediaEmbedEditing')&&(_0x938147['mediaEmbed']=_0x1d3214['config']['get']('mediaEmbed'),_0x938147['mediaEmbed']&&(delete _0x938147['mediaEmbed']['toolbar'],_0x1d3214['plugins']['has']('MediaEmbedResizeEditing')?_0x938147['mediaEmbed']['resizeOptions']&&(_0x938147['mediaEmbed']['resizeOptions']=_0x938147['mediaEmbed']['resizeOptions']['map'](_0x4fd86=>vn(_0x4fd86,['icon','label']))):delete _0x938147['mediaEmbed']['resizeOptions'],_0x1d3214['plugins']['has']('MediaEmbedStyleEditing')?_0x938147['mediaEmbed']['styles']&&_0x938147['mediaEmbed']['styles']['options']&&(_0x938147['mediaEmbed']['styles']['options']=yn(_0x938147['mediaEmbed']['styles']['options'],['icon','title'])):delete _0x938147['mediaEmbed']['styles'])),_0x1d3214['plugins']['has']('MultiLevelListEditing')&&(_0x938147['listMultiLevel']=_0x1d3214['config']['get']('listMultiLevel')??{}),_0x1d3214['plugins']['has']('MentionEditing')){const _0x4d5033=vn(_0x1d3214['config']['get']('mention'),['commitKeys','dropdownLimit']);_0x4d5033['feeds']&&(_0x4d5033['feeds']=_0x4d5033['feeds']['map'](_0x3a178e=>vn(_0x3a178e,['minimumCharacters','itemRenderer','dropdownLimit']))),_0x938147['mention']=_0x4d5033;}if(_0x1d3214['plugins']['has']('MergeFieldsEditing')){const _0x263e82=vn(_0x1d3214['config']['get']('mergeFields'),['previewModes','initialPreviewMode','previewHtmlValues','sanitizeHtml']);Array['isArray'](_0x263e82['definitions'])&&(_0x263e82['definitions']=_0x263e82['definitions']['map'](_0x26123c=>'groupId'in _0x26123c?(Array['isArray'](_0x26123c['definitions'])&&(_0x26123c['definitions']=_0x26123c['definitions']['map'](_0x3d66e8=>vn(_0x3d66e8,['defaultValue']))),_0x26123c):vn(_0x26123c,['defaultValue']))),_0x938147['mergeFields']=_0x263e82;}if(_0x1d3214['plugins']['has']('ShiftEnter')&&(_0x938147['shiftEnter']={}),_0x1d3214['plugins']['has']('StyleEditing')&&(_0x938147['style']=_0x1d3214['config']['get']('style')),_0x1d3214['plugins']['has']('TableEditing')){const _0x1d5d23=vn(_0x1d3214['config']['get']('table'),['contentToolbar','tableToolbar','showHiddenBorders']);_0x1d3214['plugins']['has']('TablePropertiesEditing')?_0x1d5d23['tableProperties']&&'object'==typeof _0x1d5d23['tableProperties']&&(_0x1d5d23['tableProperties']=vn(_0x1d5d23['tableProperties'],['colorPicker','borderColors','backgroundColors'])):delete _0x1d5d23['tableProperties'],_0x1d3214['plugins']['has']('TableCellPropertiesEditing')?_0x1d5d23['tableCellProperties']&&'object'==typeof _0x1d5d23['tableCellProperties']&&(_0x1d5d23['tableCellProperties']=vn(_0x1d5d23['tableCellProperties'],['colorPicker','borderColors','backgroundColors'])):delete _0x1d5d23['tableCellProperties'],_0x1d3214['plugins']['has']('TableLayoutEditing')?_0x1d5d23['tableLayout']||(_0x1d5d23['tableLayout']={}):delete _0x1d5d23['tableLayout'],_0x1d3214['plugins']['has']('TableCaptionEditing')?_0x1d5d23['tableCaption']||(_0x1d5d23['tableCaption']={}):delete _0x1d5d23['tableCaption'],_0x938147['table']=_0x1d5d23;}_0x1d3214['plugins']['has']('TextPartLanguageEditing')&&(_0x938147['textPartLanguage']=_0x1d3214['config']['get']('language.textPartLanguage'));for(const [_0x15ec42,_0x3cefa0]of kn)_0x1d3214['plugins']['has'](_0x15ec42)&&(_0x938147[_0x3cefa0]={});return _0x938147;}const Ln='ai-selection',Dn=['br'];var Pn=class extends _0x4f3978{constructor(_0x563b3f){super(_0x563b3f),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}_outputDataProcessor;_fakeSelections=[];_sessionIdByEditor=new WeakMap();_lastContentFocusedEditor;static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}getLastContentFocusedEditor(){return this['_lastContentFocusedEditor'];}getSessionId(_0x295401){let _0x11f91a=this['_sessionIdByEditor']['get'](_0x295401);return _0x11f91a||(_0x11f91a=_0x295401['plugins']['has']('RealTimeCollaborationClient')&&_0x295401['plugins']['get']('RealTimeCollaborationClient')['sessionId']||Xt(),this['_sessionIdByEditor']['set'](_0x295401,_0x11f91a)),_0x11f91a;}async getDocumentData(_0x301799){const _0x48abcd=Zs(this['context']),_0x1d7c1b=[],_0x2810b2=new Set();for(const _0x26c5c3 of _0x48abcd){if(_0x301799&&!_0x301799['has'](_0x26c5c3['config']['get']('collaboration.channelId')))continue;const _0x516e71=_0x26c5c3['config']['get']('roots')||{},_0x47aaef=this['_getEditorSelectionSignature'](_0x26c5c3),_0x532340=_0x26c5c3['config']['get']('collaboration.channelId'),_0x3e6f4e=this['getSessionId'](_0x26c5c3);for(const _0x1b901b of _0x26c5c3['model']['document']['getRoots']()){if('$graveyard'===_0x1b901b['rootName'])continue;const _0x226645=await this['_getDocumentDataForEditorRoot'](_0x26c5c3,_0x1b901b,_0x2810b2),_0x21c03b=_0x516e71[_0x1b901b['rootName']],_0x5f3428=_0x1b901b['getAttribute']('$description')??_0x21c03b?.['description'];let _0x45fef4=_0x1b901b['getAttribute']('$title')??_0x21c03b?.['title'];_0x45fef4||(_0x45fef4=_0x1b901b['getAttribute']('$rootEditableOptions')?.['label']??_0x21c03b?.['label']),_0x45fef4||(Ft('ai-document-root-missing-title',{'editor':_0x26c5c3,'rootName':_0x1b901b['rootName']}),_0x45fef4=_0x1b901b['rootName']),_0x1d7c1b['push']({'editor':_0x26c5c3,'rootName':_0x1b901b['rootName'],'content':_0x226645['content'],'version':_0x226645['version'],'sessionId':_0x3e6f4e,'channelId':_0x532340,'selections':_0x226645['selections'],'selectionSignature':_0x47aaef,'editorConfig':xn(_0x26c5c3,_0x1b901b['rootName']),'name':_0x45fef4,'description':_0x5f3428});}}return _0x1d7c1b;}getEditorsVersions(){const _0x4f1cd4=Zs(this['context']),_0x57d045=new Map();for(const _0x399081 of _0x4f1cd4){const _0x4d4f8c=_0x399081['config']['get']('collaboration.channelId');_0x57d045['set'](_0x4d4f8c,_0x399081['model']['document']['version']);}return _0x57d045;}getEditorsSelections(){const _0x396b51=Zs(this['context']),_0x446f69=new Map();for(const _0x5694dc of _0x396b51){const _0xedf052=_0x5694dc['config']['get']('collaboration.channelId'),_0x2e32cf=this['_getEditorSelectionSignature'](_0x5694dc);_0x446f69['set'](_0xedf052,_0x2e32cf);}return _0x446f69;}_getEditorSelectionSignature(_0x57f77a){return this['_getMarkersInDocumentOrder'](_0x57f77a)['map'](_0x44e7e1=>{const _0x55b7ae=_0x44e7e1['getRange']();return _0x55b7ae['root']['rootName']+':'+_0x55b7ae['start']['path']['join']('.')+'-'+_0x55b7ae['end']['path']['join']('.');})['join']('|');}async _getDocumentDataForEditorRoot(_0x1c84cf,_0x155923,_0x649d3a){const _0x49b1f2=_0x1c84cf['data']['toView'](_0x155923,{'convertAiChatSelectionMarker':!0x0}),_0x332319=new _0x5c06e8(_0x1c84cf['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x49b1f2,_0x332319,_0x649d3a);let _0x4b830d=await this['_getDocumentDataStringFromView'](_0x49b1f2,_0x1c84cf);En(_0x1c84cf,_0x155923['rootName'])&&(_0x4b830d=pn(_0x4b830d,this['_nextDataId'](_0x649d3a)));const _0x397b73=this['_getMarkersInDocumentOrder'](_0x1c84cf,_0x155923),_0x332edc=[];for(const _0x4c1649 of _0x397b73){const _0x2443a0='<'+_0x4c1649['name']+':start></'+_0x4c1649['name']+':start>',_0x3c3a58=_0x4b830d['indexOf'](_0x2443a0);_0x4b830d=_0x4b830d['substring'](0x0,_0x3c3a58)+_0x4b830d['substring'](_0x3c3a58+_0x2443a0['length']);const _0x562711='<'+_0x4c1649['name']+':end></'+_0x4c1649['name']+':end>',_0x28dd05=_0x4b830d['indexOf'](_0x562711);_0x4b830d=_0x4b830d['substring'](0x0,_0x28dd05)+_0x4b830d['substring'](_0x28dd05+_0x562711['length']),_0x332edc['push']({'markerName':_0x4c1649['name'],'start':_0x3c3a58,'end':_0x28dd05,'htmlFragment':_0x4b830d['substring'](_0x3c3a58,_0x28dd05)});}return{'content':_0x4b830d,'version':_0x1c84cf['model']['document']['version'],'selections':_0x332edc};}afterInit(){this['context']instanceof _0xfb41df?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x4773ad,_0x1cee48)=>{_0x1cee48['on']('ready',()=>{this['_integrateEditor'](_0x1cee48);});});}_setOutputDataProcessor(_0x45766c){this['_outputDataProcessor']=_0x45766c;}async _getDocumentDataStringFromView(_0x20c8e6,_0x3ed5a5){let _0xb33567;if(this['_outputDataProcessor']){const _0x37093a=_0x3ed5a5['data']['processor']['domConverter']['viewToDom'](_0x20c8e6),_0x26e34f=await this['_outputDataProcessor'](_0x37093a);_0xb33567=_0x3ed5a5['data']['processor']['htmlWriter']['getHtml'](_0x26e34f);}else _0xb33567=_0x3ed5a5['data']['processor']['toData'](_0x20c8e6);return _0xb33567;}_integrateEditor(_0x45fe9a){if(!_0x45fe9a['config']['get']('collaboration.channelId'))throw new dt('ai-missing-channel-id',_0x45fe9a);_0x45fe9a['ui']['focusTracker']['on']('change:isFocused',(_0x263d65,_0x4f3002,_0x48298a)=>{_0x48298a&&(this['_lastContentFocusedEditor']=_0x45fe9a);}),_0x45fe9a['on']('destroy',()=>{this['_lastContentFocusedEditor']===_0x45fe9a&&(this['_lastContentFocusedEditor']=void 0x0);}),_0x45fe9a['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ln,'view':({markerName:_0x169907})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x169907['split'](':')[0x1]],'priority':0xc})}),_0x45fe9a['conversion']['for']('dataDowncast')['markerToElement']({'model':Ln+':context','view':(_0x5e523d,{writer:_0x118ea3,options:_0x41b3d0})=>_0x41b3d0['convertAiChatSelectionMarker']?_0x118ea3['createUIElement'](_0x5e523d['markerName']+':'+(_0x5e523d['isOpening']?'start':'end')):null});}showFakeVisualSelection(_0x48668b){const _0x4e7840=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x48668b);const _0x34da3e=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x4e7840,_0x34da3e);}hideFakeVisualSelection(_0x5b8063){const _0x1a9cc1=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x5b8063);const _0x49fe50=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x1a9cc1,_0x49fe50);}async modelToDataWithIds(_0x4c4478,_0x3e18f8,_0x212395){const _0xb8a4e6=_0x3e18f8['data']['toView'](_0x4c4478),_0x142565=new _0x5c06e8(_0x3e18f8['editing']['view']['document']),_0x479d4a=new Set();this['_setDataIdsOnChildren'](_0xb8a4e6,_0x142565,_0x479d4a);const _0x464706=await this['_getDocumentDataStringFromView'](_0xb8a4e6,_0x3e18f8);return _0x212395&&En(_0x3e18f8,_0x212395)?pn(_0x464706,this['_nextDataId'](_0x479d4a)):_0x464706;}_setDataIdsOnChildren(_0x2fa3eb,_0x4b40c8,_0x3aac04=new Set()){let _0x663a0f=!0x1;for(const _0x5f0947 of _0x2fa3eb['getChildren']()){if(!_0x5f0947['is']('view:element')||Dn['includes'](_0x5f0947['name']))continue;const _0xe11841=_0x5f0947['is']('view:containerElement'),_0x9e9086=_0x5f0947['is']('view:emptyElement'),_0x442b32=_0x5f0947['is']('view:rawElement'),_0x1d09d5=this['_setDataIdsOnChildren'](_0x5f0947,_0x4b40c8,_0x3aac04);_0x5f0947['hasAttribute']('data-id')?(_0x663a0f=!0x0,_0x3aac04['add'](_0x5f0947['getAttribute']('data-id'))):(_0xe11841||_0x9e9086||_0x442b32||_0x1d09d5)&&(_0x4b40c8['setAttribute']('data-id',this['_nextDataId'](_0x3aac04),_0x5f0947),_0x663a0f=!0x0);}return _0x663a0f;}_nextDataId(_0x57196a){let _0x355860;do{_0x355860='';for(let _0x2c2645=0x0;_0x2c2645<0x4;_0x2c2645++)_0x355860+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x57196a['has'](_0x355860));return _0x57196a['add'](_0x355860),_0x355860;}getSelectionText(_0x176816){const _0x5177d3=(_0x176816?_0x176816['model']:tn(this['context'])['model'])['document']['selection'],_0x3a5d77=[],_0x551a4d=Array['from'](_0x5177d3['getRanges']());_0x551a4d['sort']((_0x46d695,_0x40808b)=>_0x46d695['start']['isBefore'](_0x40808b['start'])?-0x1:0x1);for(const _0x24850e of _0x551a4d)for(const _0x18b76f of _0x24850e['getItems']())_0x18b76f['is']('$textProxy')?_0x3a5d77['push'](_0x18b76f['data']):_0x18b76f['is']('element')&&_0x3a5d77['length']>0x0&&'\x20'!==_0x3a5d77[_0x3a5d77['length']-0x1]&&_0x3a5d77['push']('\x20');return _0x3a5d77['length']?'\x22'+_0x3a5d77['join']('')['trim']()+'\x22':qs(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}_removeFakeSelectionById(_0x16d556){for(let _0x207642=0x0;_0x207642<this['_fakeSelections']['length'];_0x207642++)if(this['_fakeSelections'][_0x207642]['id']==_0x16d556)return void this['_fakeSelections']['splice'](_0x207642,0x1);}_addFakeSelection(_0x483955){this['_removeFakeSelectionById'](_0x483955['id']),Ht(this['_fakeSelections'],_0x483955);}_refreshFakeSelection(_0xf75b3b,_0x50b423){if(_0xf75b3b==_0x50b423)return;const _0x302b06=_0xf75b3b?_0xf75b3b['editor']:null,_0x3c98e1=_0x50b423?_0x50b423['editor']:null,_0x370234=(_0x5d3970,_0x237faf)=>{const _0x43c230=_0x237faf['model']['markers']['getMarkersGroup'](Ln);for(const _0x140b85 of _0x43c230)_0x5d3970['removeMarker'](_0x140b85);},_0x1543e1=(_0x2df862,_0x4567d7,_0xd44de5)=>{const _0x393f4e=_0x4567d7['model'];for(let _0x4208df=0x0;_0x4208df<_0xd44de5['ranges']['length'];_0x4208df++){let _0x24c0cd=_0xd44de5['ranges'][_0x4208df];const _0x13ea40=Ln+':'+_0xd44de5['id']+':'+_0x4208df;if(_0x24c0cd['start']['isAtEnd']){const _0x1f6e78=_0x24c0cd['start']['getLastMatchingPosition'](({item:_0x5d15dc})=>!_0x393f4e['schema']['isContent'](_0x5d15dc),{'boundaries':_0x24c0cd});_0x24c0cd=_0x2df862['createRange'](_0x1f6e78,_0x24c0cd['end']);}_0x2df862['addMarker'](_0x13ea40,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x24c0cd});}};_0x302b06&&_0x3c98e1&&_0x302b06===_0x3c98e1&&_0x50b423?_0x302b06['model']['change'](_0x1586f2=>{_0x370234(_0x1586f2,_0x302b06),_0x1543e1(_0x1586f2,_0x3c98e1,_0x50b423);}):(_0x302b06&&_0x302b06['model']['change'](_0x4605c2=>_0x370234(_0x4605c2,_0x302b06)),_0x3c98e1&&_0x50b423&&_0x3c98e1['model']['change'](_0x4bcaa5=>_0x1543e1(_0x4bcaa5,_0x3c98e1,_0x50b423)));}_getMarkersInDocumentOrder(_0x48d642,_0x46f42e){const _0x50e3b1=Array['from'](_0x48d642['model']['markers']['getMarkersGroup'](Ln+':context'));return(_0x46f42e?_0x50e3b1['filter'](_0x51fb49=>{const _0x4ca17c=_0x51fb49['getRange']();return _0x4ca17c&&_0x4ca17c['root']['rootName']===_0x46f42e['rootName'];}):_0x50e3b1)['sort']((_0x32e057,_0x18f860)=>_0x32e057['getStart']()['isBefore'](_0x18f860['getStart']())?-0x1:_0x32e057['getStart']()['isAfter'](_0x18f860['getStart']())?0x1:0x0);}},Mn=class extends _0x4f3978{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'DocumentChangesUtils';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['licenseKey']=this['context']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x205f99=this['context'],_0xa0c940=_0x205f99['editors']||[_0x205f99],_0x28a4cc=!_0x205f99['editors'];for(const _0x294e6d of _0xa0c940){let _0x2db741;for(const _0xfa79fd in _0x294e6d){const _0xc6671c=_0xfa79fd,_0x497c62=_0x294e6d[_0xc6671c];if('documentChangesLicenseKeyValid'==_0x497c62||'documentChangesLicenseKeyInvalid'==_0x497c62||'documentChangesLicenseKeyExpired'==_0x497c62||'documentChangesLicenseKeyDomainLimit'==_0x497c62||'documentChangesLicenseKeyNotAllowed'==_0x497c62||'documentChangesLicenseKeyEvaluationLimit'==_0x497c62||'documentChangesLicenseKeyUsageLimit'==_0x497c62){delete _0x294e6d[_0xc6671c],_0x2db741=_0x497c62,_0x28a4cc&&(clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0);break;}}'documentChangesLicenseKeyInvalid'==_0x2db741&&_0x294e6d['_showLicenseError']('invalid'),'documentChangesLicenseKeyExpired'==_0x2db741&&_0x294e6d['_showLicenseError']('expired'),'documentChangesLicenseKeyDomainLimit'==_0x2db741&&_0x294e6d['_showLicenseError']('domainLimit'),'documentChangesLicenseKeyNotAllowed'==_0x2db741&&_0x294e6d['_showLicenseError']('featureNotAllowed','DocumentChanges'),'documentChangesLicenseKeyEvaluationLimit'==_0x2db741&&_0x294e6d['_showLicenseError']('evaluationLimit'),'documentChangesLicenseKeyUsageLimit'==_0x2db741&&_0x294e6d['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}};const Vn='$elementId',Hn='data-id';var Un=class extends _0x4f3978{static get['pluginName'](){return'DocumentChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Mn];}async init(){!async function(_0x24e18a){const _0x1f6a68='EMDS3dsLoJY0nbe9cmlCrXyaZ8zpPqN6jxThf7gwBi2KFOVUWRAG14HQIkut5v',_0x50a031=0x79728,_0x4581ec={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x4ea416(_0x2e3e34){const _0x15357a=window['Promise']['resolve'](_0x2e3e34),_0x520b76=window['Date']['now'](),_0x22bd1f=_0x2e3e34['config']['get']('licenseKey');async function _0x20d51d(){let _0x11183b,_0xe79755=null,_0x20abcc=null;try{return'GPL'==_0x22bd1f?'NotAllowed':(_0x11183b=_0x4f187e(),_0x11183b?(_0x11183b['usageEndpoint']&&(_0x20abcc=_0x4118a3(_0x11183b['usageEndpoint'],_0x11183b['jti'])),await _0x33b196()?_0x312be2()?_0x2fbf5a()?'Expired':_0x47a86f()?('evaluation'==_0x11183b['licenseType']&&(_0xe79755=_0x4f4ed6('EvaluationLimit')),await _0x111438()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x2fbf5a(){const _0x443112=['evaluation','trial']['includes'](_0x11183b['licenseType'])?_0x520b76/0x3e8:0xe10*_0x50a031;return _0x11183b['exp']<_0x443112;}function _0x312be2(){const _0x42c987=_0x11183b['features'];return!!_0x42c987&&(!!_0x42c987['includes']('*')||(!!_0x42c987['includes']('DIFF')||(!!_0x42c987['includes']('ET')||!!_0x42c987['includes']('CKAI'))));}function _0x47a86f(){const _0x1aacb9=_0x11183b['licensedHosts'];if(!_0x1aacb9||0x0==_0x1aacb9['length'])return!0x0;const {hostname:_0x4445ce}=new URL(window['location']['href']);if(_0x1aacb9['includes'](_0x4445ce))return!0x0;const _0x3b2b2b=_0x4445ce['split']('.');return _0x1aacb9['filter'](_0x5aa6d0=>_0x5aa6d0['includes']('*'))['map'](_0x3e27fe=>_0x3e27fe['split']('.'))['filter'](_0x2c3748=>_0x2c3748['length']<=_0x3b2b2b['length'])['map'](_0x27c886=>Array(_0x3b2b2b['length']-_0x27c886['length'])['fill']('*'===_0x27c886[0x0]?'*':'')['concat'](_0x27c886))['some'](_0x457356=>_0x3b2b2b['every']((_0x5e1aac,_0x493cd4)=>_0x457356[_0x493cd4]===_0x5e1aac||'*'===_0x457356[_0x493cd4]));}function _0x111438(){return _0xe79755&&_0x20abcc?new window['Promise']((_0x26880d,_0x1d02d0)=>{_0xe79755['then'](_0x26880d,_0x1d02d0),_0x20abcc['then'](_0x33a38b=>{'Valid'!=_0x33a38b&&_0x26880d(_0x33a38b);},_0x1d02d0);}):_0xe79755||_0x20abcc||'Valid';}}function _0x4118a3(_0x4e0bf8,_0x33613a){return new window['Promise'](_0x112874=>{if(_0x269e1f())return _0x112874('Valid');_0x4f168f(),_0x2e3e34['decorate']('_sendUsageRequest');let _0x2febae=!0x1;const _0x4a7c1f=Xt();function _0x43c3ed(_0x1eff85){return!!_0x1eff85&&('object'==typeof _0x1eff85||'function'==typeof _0x1eff85)&&'function'==typeof _0x1eff85['then']&&'function'==typeof _0x1eff85['catch'];}function _0x20a251(_0x3860b7){_0x1c2bda(_0x3860b7)['then'](_0x4e2fd1=>_0x4e2fd1&&'ok'==_0x4e2fd1['status']?_0x26b03d(_0x5b1be2(_0x4a7c1f+_0x33613a))!=_0x4e2fd1['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x1e44a7=>(_0xc9848a(),_0x1e44a7),()=>{const _0x45d58f=_0x469a5b();return null==_0x45d58f?(_0xc9848a(),'Valid'):_0x520b76-_0x45d58f>0x240c8400?'UsageLimit':'Valid';})['then'](_0x112874)['catch'](()=>{_0x112874('UsageLimit');});const _0x338606=0x36ee80;function _0xc9848a(){const _0x380a77='llct-'+_0x26b03d(_0x5b1be2(_0x4e0bf8)),_0x37035b=_0x2135b1(_0x26b03d(window['Math']['ceil'](_0x520b76/_0x338606)));window['localStorage']['setItem'](_0x380a77,_0x37035b);}function _0x469a5b(){const _0x26403d='llct-'+_0x26b03d(_0x5b1be2(_0x4e0bf8)),_0x70757a=window['localStorage']['getItem'](_0x26403d);return _0x70757a?window['parseInt'](_0x2135b1(_0x70757a),0x10)*_0x338606:null;}function _0x1c2bda(_0x2c3066){return new window['Promise']((_0x5ef3d6,_0x335276)=>{_0x2c3066['then'](_0x5ef3d6,_0x335276),window['setTimeout'](_0x335276,0x1d4c0);});}}_0x2e3e34['on']('_sendUsageRequest',(_0x3b4606,_0x3587d1)=>{if(_0x3587d1[0x0]!=_0x4e0bf8)return _0x112874('UsageLimit');_0x3587d1[0x1]={..._0x3587d1[0x1],'requestId':_0x4a7c1f};},{'priority':'high'}),_0x2e3e34['on']('_sendUsageRequest',_0x25af5a=>{_0x43c3ed(_0x25af5a['return'])&&(_0x2febae=!0x0,_0x20a251(_0x25af5a['return']));},{'priority':'low'}),_0x15357a['then'](()=>{_0x2febae||_0x112874('UsageLimit');});});function _0x269e1f(){return'auto'==_0x2e3e34['editing']['view']['_overlayModeHint'];}function _0x4f168f(){_0x2e3e34['editing']['view']['_overlayModeHint']='auto';}}function _0x4f4ed6(_0x2941d8){const _0xb65364=[new window['Promise'](_0xad5185=>setTimeout(_0xad5185,0x93ecc)),_0x15357a['then'](()=>new window['Promise'](_0xcaa48b=>{let _0x5842d4=0x0;_0x2e3e34['model']['on']('applyOperation',(_0x5c4d50,_0x4476f9)=>{_0x4476f9[0x0]['isDocumentOperation']&&_0x5842d4++,0x5e8==_0x5842d4&&(_0xcaa48b(),_0x5c4d50['off']());});}))];return window['Promise']['race'](_0xb65364)['then'](()=>_0x2941d8);}async function _0x2e47b7(){await _0x15357a,_0x24e18a['getDiff']=_0x4595ca,_0x24e18a['_createDiff']=_0x4595ca,_0x2e3e34['model']['change']=_0x4595ca,_0x2e3e34['model']['enqueueChange']=_0x4595ca,_0x2e3e34['enableReadOnlyMode']('model');}function _0x3d953c(_0x399e30){const _0x57282f=_0x54c45e();_0x2e3e34[_0x57282f]='documentChangesLicenseKey'+_0x399e30,'Valid'!=_0x399e30&&_0x2e47b7();}function _0x54c45e(){const _0x5a0dac=window['String'](window['performance']['now']())['replace']('.','');let _0x4fc477='E';for(let _0x159906=0x0;_0x159906<_0x5a0dac['length'];_0x159906+=0x2){let _0x491bf6=window['parseInt'](_0x5a0dac['substring'](_0x159906,_0x159906+0x2));_0x491bf6>=0x3e&&(_0x491bf6-=0x3e),_0x4fc477+=_0x1f6a68[_0x491bf6];}return _0x4fc477;}function _0x4f187e(){const _0x54e086=_0x22bd1f['split']('.');if(0x3!=_0x54e086['length'])return null;return _0x14f055(_0x54e086[0x1]);function _0x14f055(_0x7c9dc4){const _0x4a91fd=_0x186ba1(_0x7c9dc4);return _0x4a91fd&&_0x425610()?_0x4a91fd:null;function _0x425610(){const _0x941ce3=_0x4a91fd['jti'],_0x395ed0=window['parseInt'](_0x941ce3['substring'](_0x941ce3['length']-0x8),0x10),_0xc24416={..._0x4a91fd,'jti':_0x941ce3['substring'](0x0,_0x941ce3['length']-0x8)};return delete _0xc24416['vc'],_0x5b1be2(_0xc24416)==_0x395ed0;}}}async function _0x33b196(){let _0x1833d2=!0x0;try{const [_0x41170b,_0x9159c8,_0x4d112f]=_0x22bd1f['split']('.');return _0x3e6835(_0x41170b),await _0x163469(_0x41170b,_0x9159c8,_0x4d112f),_0x1833d2;}catch{return!0x1;}function _0x3e6835(_0x57b7b1){const _0x2eff38=_0x186ba1(_0x57b7b1);_0x2eff38&&'ES256'==_0x2eff38['alg']||(_0x1833d2=!0x1);}async function _0x163469(_0xb5d23b,_0x3d4409,_0x1300da){const _0x1f86b6=window['Uint8Array']['from'](_0xe5942a(_0x1300da),_0x181ff9=>_0x181ff9['charCodeAt'](0x0)),_0xf3d7a4=new window['TextEncoder']()['encode'](_0xb5d23b+'.'+_0x3d4409),_0x175f7c=window['crypto']['subtle'];if(!_0x175f7c)return;const _0x324b31=await _0x175f7c['importKey']('jwk',_0x4581ec,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x175f7c['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x324b31,_0x1f86b6,_0xf3d7a4)||(_0x1833d2=!0x1);}}function _0x186ba1(_0x5bf8e7){return _0x5bf8e7['startsWith']('ey')?JSON['parse'](_0xe5942a(_0x5bf8e7)):null;}function _0xe5942a(_0x14bb4e){return window['atob'](_0x14bb4e['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x5b1be2(_0x234673){let _0x4642f4=0x1505;function _0x3279de(_0x399803){for(let _0x414f00=0x0;_0x414f00<_0x399803['length'];_0x414f00++){const _0x1ea7a9=_0x399803['charCodeAt'](_0x414f00);_0x4642f4=(_0x4642f4<<0x5)+_0x4642f4+_0x1ea7a9,_0x4642f4&=_0x4642f4;}}function _0x2fd06f(_0x1fc242){Array['isArray'](_0x1fc242)?_0x1fc242['forEach'](_0x2fd06f):_0x1fc242&&'object'==typeof _0x1fc242?Object['entries'](_0x1fc242)['sort']()['forEach'](([_0x5991f2,_0x44d3d1])=>{_0x3279de(_0x5991f2),_0x2fd06f(_0x44d3d1);}):_0x3279de(window['String'](_0x1fc242));}return _0x2fd06f(_0x234673),_0x4642f4>>>0x0;}function _0x26b03d(_0x444a42){return _0x444a42['toString'](0x10)['padStart'](0x8,'0');}function _0x2135b1(_0x6594f2){return _0x6594f2['split']('')['reverse']()['join']('');}function _0x4595ca(){}_0x3d953c(await _0x20d51d());}const _0x1de39b=_0x24e18a['context'],_0x489fb9=_0x1de39b['editors'];_0x489fb9?(_0x489fb9['forEach'](_0x5e1901),_0x24e18a['listenTo'](_0x489fb9,'add',(_0x13dab0,_0x427a2e)=>_0x5e1901(_0x427a2e),{'priority':'highest'})):_0x5e1901(_0x1de39b);function _0x5e1901(_0x1546b2){_0x1546b2['once']('ready',()=>_0x4ea416(_0x1546b2),{'priority':'highest'});}}(this),this['context']instanceof _0xfb41df?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x323fd5,_0x5b3659)=>{_0x5b3659['on']('ready',()=>{this['_integrateEditor'](_0x5b3659);});});}get editor(){if(this['context']instanceof _0xfb41df)return this['context'];{const _0x4bc035=this['context']['editors']['first'];if(!_0x4bc035)throw new dt('documentchanges-no-editor',this);return _0x4bc035;}}getDiff(_0x27af26,_0x3e4538,_0x509762={'anchor':'main','markDeletions':!0x1}){return this['_createDiff'](_0x27af26,_0x3e4538,_0x509762)['getOperations']();}_getDiffWithOperationsData(_0x16a12a,_0x223ccd,_0x132612={'anchor':'main','markDeletions':!0x1}){const _0x2cfe1b=this['_createDiff'](_0x16a12a,_0x223ccd,_0x132612);return{'operationsData':_0x2cfe1b['getOperationsData'](),'operations':_0x2cfe1b['getOperations']()};}_createDiff(_0x143e5f,_0x2521d2,_0x180004){const _0xe7de6=_0x180004['targetEditor']||this['editor'],_0x9c719b=_0x180004['anchor']??'main';let _0x4944a6,_0x708d41;if('string'==typeof _0x9c719b){const _0x1bff2e=_0xe7de6['model']['document']['getRoot'](_0x9c719b);if(!_0x1bff2e)throw new dt('documentchanges-compare-no-root',this,{'anchor':_0x9c719b});_0x4944a6=_0x1bff2e,_0x708d41=_0xe7de6['model']['createPositionAt'](_0x1bff2e,0x0);}else _0x4944a6=_0x9c719b['clone'](),_0x708d41=_0x9c719b['clone']();const _0x17a27c=_0xe7de6['data']['parse'](_0x143e5f,_0x4944a6),_0x28560e=_0xe7de6['data']['parse'](_0x2521d2,_0x4944a6);return new Bn({'editor':_0xe7de6,'before':_0x17a27c,'after':_0x28560e,'options':{'anchor':_0x708d41,'markDeletions':_0x180004['markDeletions']}});}isMarkedRemoveOperation(_0x3af806){return'marker'==_0x3af806['type']&&_0x3af806['name']['startsWith']('$markedRemove');}applyOperations(_0x274bb9,_0x1c455e){const _0x31370f=_0x274bb9['model'];for(const _0x4d34fa of _0x1c455e)_0x2b9cbb(_0x4d34fa)||(_0x4d34fa instanceof _0x4ad218?_0x274bb9['_addOperationForAffectedMarkers']('move',_0x3e534d['_createFromPositionAndShift'](_0x4d34fa['sourcePosition'],_0x4d34fa['howMany'])):_0x4d34fa instanceof _0x36755a?_0x274bb9['_addOperationForAffectedMarkers']('merge',_0x4d34fa['deletionPosition']):_0x4d34fa instanceof _0x4226e6&&this['_fixMarkerOperationOldRange'](_0x31370f,_0x4d34fa),_0x4d34fa['baseVersion']=_0x31370f['document']['version'],_0x274bb9['batch']['addOperation'](_0x4d34fa),_0x31370f['applyOperation'](_0x4d34fa));}_fixMarkerOperationOldRange(_0x2bfcdf,_0x85057e){const _0x29046e=_0x2bfcdf['markers']['get'](_0x85057e['name']);_0x29046e&&(_0x85057e['oldRange']=_0x29046e['getRange']());}_integrateEditor(_0x1ff587){_0x1ff587['conversion']['for']('upcast')['add'](_0x3c842e=>{_0x3c842e['on']('element',(_0x118b22,_0x341fe2,_0x5e2666)=>{if(_0x341fe2['modelRange']&&_0x5e2666['consumable']['consume'](_0x341fe2['viewItem'],{'attributes':'data-id'}))for(const _0x1e83cb of _0x341fe2['modelRange']['getItems']({'shallow':!0x0})){if(_0x1e83cb['is']('$textProxy'))continue;const _0x180ebc=_0x341fe2['viewItem']['getAttribute'](Hn);_0x180ebc&&_0x5e2666['writer']['setAttribute'](Vn,_0x180ebc,_0x1e83cb);}},{'priority':Kt['low']+0x1});}),_0x1ff587['model']['schema']['addAttributeCheck'](()=>!0x0,Vn);}},Bn=class{_editor;_diffItems=[];_markDeletions;['_anchor'];_operationsData=[];_path=[0x0];_parents=[];_splitPostponedData=new Map();constructor({editor:_0x1557cd,before:_0x1eea0e,after:_0x31e2d2,options:_0x1a5f55}){this['_editor']=_0x1557cd,this['_markDeletions']=!!_0x1a5f55['markDeletions'],this['_anchor']=_0x1a5f55['anchor'];const _0x17c1aa=this['_tokenizeModel'](_0x1eea0e),_0x38fbfc=this['_tokenizeModel'](_0x31e2d2);this['_diffItems']=this['_diffModelTokens'](_0x17c1aa,_0x38fbfc),this['_calculateOperationsData'](),this['_markDeletions']||this['_calculateMarkersOperationsData'](_0x1eea0e['markers'],_0x31e2d2['markers']);}getOperationsData(){return this['_operationsData'];}getOperations(){const _0x581ec0=this['_editor']['model']['document'],_0x4f5676=[];let _0x37938a=_0x581ec0['version'];for(const _0x237dfb of this['getOperationsData']())switch(_0x237dfb['type']){case'attribute':{const _0x457e05=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0x237dfb['path']),_0x274c8b=_0x457e05['getShiftedBy'](_0x237dfb['howMany']),_0x2e5eac=new _0x3e534d(_0x457e05,_0x274c8b),_0x209766=JSON['parse'](_0x237dfb['oldValue']),_0x5358ed=JSON['parse'](_0x237dfb['newValue']);_0x4f5676['push'](new _0x36881c(_0x2e5eac,_0x237dfb['key'],_0x209766,_0x5358ed,_0x37938a++));break;}case'insert':{const _0x843477=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0x237dfb['path']),_0x371c52=this['_makeModelFromTokens'](_0x237dfb['tokens']);_0x4f5676['push'](new _0x596b48(_0x843477,_0x371c52,_0x37938a++));break;}case'remove':{const _0x3207ff=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0x237dfb['path']),_0x1497ee=new _0x22fec2(_0x581ec0['graveyard'],[0x0]);_0x4f5676['push'](new _0x4ad218(_0x3207ff,_0x237dfb['howMany'],_0x1497ee,_0x37938a++));break;}case'rename':{const _0x19a59d=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0x237dfb['path']);_0x4f5676['push'](new _0x555a59(_0x19a59d,_0x237dfb['oldName'],_0x237dfb['newName'],_0x37938a++));break;}case'split':{const _0x2efb42=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0x237dfb['path']),_0x143f8f=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0x237dfb['path']['slice'](0x0,-0x1));_0x143f8f['offset']++,_0x4f5676['push'](new _0x4f5d25(_0x2efb42,Number['NEGATIVE_INFINITY'],_0x143f8f,null,_0x37938a++));break;}case'merge':{const _0x23bef2=_0x237dfb['path']['slice'](),_0x3bf2f9=_0x23bef2['slice'](0x0,-0x1);_0x3bf2f9[_0x3bf2f9['length']-0x1]++,_0x3bf2f9['push'](0x0);const _0x19f43e=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0x3bf2f9),_0x38772f=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0x23bef2),_0x5a50e8=new _0x22fec2(_0x581ec0['graveyard'],[0x0]);_0x4f5676['push'](new _0x36755a(_0x19f43e,Number['NEGATIVE_INFINITY'],_0x38772f,_0x5a50e8,_0x37938a++));break;}case'marker':case'markedRemove':{let _0x2759f2=null;if(_0x237dfb['range']){const _0x1eefd1=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0x237dfb['range']['start']),_0x3520ee=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0x237dfb['range']['end']);_0x2759f2=new _0x3e534d(_0x1eefd1,_0x3520ee);}const _0x21a772='marker'==_0x237dfb['type']?_0x237dfb['name']:'$markedRemove:'+Xt();_0x4f5676['push'](new _0x4226e6(_0x21a772,null,_0x2759f2,_0x581ec0['model']['markers'],!0x0,_0x37938a++));break;}case'unwrap':{const _0xe2b6e9=_0x237dfb['path']['slice']();_0xe2b6e9['push'](0x0);const _0xfe5763=_0x237dfb['path']['slice'](),_0x396356=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0xe2b6e9),_0x5bcb79=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0xfe5763),_0x940ed2=new _0x22fec2(_0x581ec0['graveyard'],[0x0]);_0x4f5676['push'](new _0x4ad218(_0x396356,_0x237dfb['howMany'],_0x5bcb79,_0x37938a++)),_0x4f5676['push'](new _0x4ad218(_0x5bcb79['getShiftedBy'](_0x237dfb['howMany']),0x1,_0x940ed2,_0x37938a++));break;}case'wrap':{const _0x28d99b=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0x237dfb['range']['start']),_0x53ee7f=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0x237dfb['range']['end']),_0x3a4bf0=_0x237dfb['token']['element']['_clone'](!0x1);_0x3a4bf0['_removeAttribute'](Vn);const _0x91cbea=_0x237dfb['range']['end']['slice']();_0x91cbea['push'](0x0);const _0x18cd85=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0x91cbea);_0x4f5676['push'](new _0x596b48(_0x53ee7f,_0x3a4bf0,_0x37938a++)),_0x4f5676['push'](new _0x4ad218(_0x28d99b,_0x53ee7f['offset']-_0x28d99b['offset'],_0x18cd85,_0x37938a++));break;}}return _0x4f5676;}_tokenizeModel(_0x464b02){const _0x45bfd4=[],_0x2451a3=_0x3e534d['_createIn'](_0x464b02),_0x187b6=new _0x2e5c20({'boundaries':_0x2451a3});let _0x2bfcec='',_0x3f723e=null;const _0x3fb459=[''],_0x6d8255=new Map();for(const _0xe09d28 of _0x187b6)if('elementStart'==_0xe09d28['type']||'elementEnd'==_0xe09d28['type']){let _0x5e7e66=_0x3fb459[0x0];''!==_0x2bfcec&&(_0x45bfd4['push'](...this['_makeTokensFromTextByWords'](_0x2bfcec,_0x3f723e,_0x5e7e66)),_0x2bfcec='');const _0x17ac3d=_0xe09d28['item'];let _0x3c73cc;_0x17ac3d['getAttribute']('$elementId')?_0x3c73cc=_0x17ac3d['getAttribute'](Vn):'elementStart'==_0xe09d28['type']?(_0x3c73cc=Wn(_0x17ac3d),_0x6d8255['set'](_0x17ac3d,_0x3c73cc)):_0x3c73cc=_0x6d8255['get'](_0x17ac3d);const _0x1dbec3=this['_getElementCategory'](_0x17ac3d);'solid'==_0x1dbec3&&('elementStart'==_0xe09d28['type']?(_0x5e7e66=_0x3c73cc,_0x3fb459['unshift'](_0x5e7e66)):_0x3fb459['shift']());const _0x25eba4={'type':'element','element':_0x17ac3d,'elementId':_0x3c73cc,'category':_0x1dbec3,'isStart':'elementStart'==_0xe09d28['type'],'limitId':_0x5e7e66};_0x45bfd4['push'](_0x25eba4);}else''==_0x2bfcec&&(_0x3f723e=_0xe09d28['previousPosition']['clone']()),_0x2bfcec+=_0xe09d28['item']['data'];return''!==_0x2bfcec&&_0x45bfd4['push'](...this['_makeTokensFromTextByWords'](_0x2bfcec,_0x3f723e,_0x3fb459[0x0])),_0x45bfd4;}_makeTokensFromTextByWords(_0x3ba664,_0x5681a4,_0x3bb0e2){const _0x57207f=_0x3ba664['matchAll'](/(\s)/g),_0x1efc9d=Array['from'](_0x57207f)['map'](_0x43c8e2=>_0x43c8e2['index']);_0x1efc9d['push'](_0x3ba664['length']),0x0==_0x1efc9d[0x0]&&_0x1efc9d['shift']();const _0x487d02=[],_0x50c67d=_0x5681a4['parent'];let _0x3c1f88=0x0,_0x572855=_0x5681a4['offset'];for(let _0x289a75=0x0;_0x289a75<_0x1efc9d['length'];_0x289a75++)_0x487d02['push']({'type':'text','data':_0x3ba664['slice'](_0x3c1f88,_0x1efc9d[_0x289a75]),'parent':_0x50c67d,'offset':_0x572855,'limitId':_0x3bb0e2}),_0x3c1f88=_0x1efc9d[_0x289a75],_0x572855=_0x5681a4['offset']+_0x1efc9d[_0x289a75];return _0x487d02;}_getElementCategory(_0x3b5807){const _0x2f2144=this['_editor']['model']['schema'];return _0x2f2144['isLimit'](_0x3b5807)||_0x2f2144['isContent'](_0x3b5807)||_0x2f2144['isInline'](_0x3b5807)?'solid':_0x2f2144['isBlock'](_0x3b5807)?'block':function(_0x37e56a,_0x495b37){const _0x2da0eb=_0x37e56a['parent'];if(!_0x2da0eb||_0x2da0eb['is']('documentFragment'))return!0x1;if(_0x495b37['checkChild'](_0x2da0eb,'$text'))return!0x1;for(const _0x32c234 of _0x37e56a['getChildren']())if(_0x32c234['is']('$text'))return!0x0;return!0x1;}(_0x3b5807,_0x2f2144)?'solid':'container';}['_diffModelTokens'](_0x2bd84d,_0x130512){const _0x298216=_0x218245(_0x2bd84d,_0x130512,{'comparator':Gn});this['_handleUnclosedBlockOpeningTags'](_0x298216);const _0x466a3a=_0x298216['flatMap'](_0x459da6=>{const _0x2c9119=_0x459da6['added']?'added':_0x459da6['removed']?'removed':'unchanged';return _0x459da6['value']['map'](_0x163199=>({'token':_0x163199,'change':_0x2c9119}));});let _0x2a3a78=0x0;for(const _0x994ee4 of _0x466a3a)'added'!=_0x994ee4['change']&&('unchanged'==_0x994ee4['change']&&(_0x994ee4['before']=_0x2bd84d[_0x2a3a78]),_0x2a3a78++);return _0x466a3a;}['_handleUnclosedBlockOpeningTags'](_0x47a22c){for(let _0x375299=0x0;_0x375299<_0x47a22c['length']-0x1;_0x375299++)if(_0x47a22c[_0x375299]['removed']&&_0x47a22c[_0x375299+0x1]['added']){const _0xc65cb2=this['_findUnclosedBlockOpeningToken'](_0x47a22c[_0x375299]['value']);if(null!==_0xc65cb2){const _0x3de019=this['_findUnclosedBlockOpeningToken'](_0x47a22c[_0x375299+0x1]['value']),_0x31b050=_0x47a22c[_0x375299]['value']['splice'](_0xc65cb2),_0x23a27f=_0x47a22c[_0x375299+0x1]['value']['splice'](_0x3de019),_0x320ad6=[_0x23a27f['shift']()];_0x31b050['shift']();const _0x233f18={'value':_0x31b050,'removed':!0x0},_0x5f2f60={'value':_0x23a27f,'added':!0x0},_0x41f209={'value':_0x320ad6};_0x47a22c['splice'](_0x375299+0x2,0x0,_0x41f209,_0x233f18,_0x5f2f60);}}}['_findUnclosedBlockOpeningToken'](_0x395633){let _0x39de13=0x0,_0x1e93cd=-0x1;for(let _0x5c5708=0x0;_0x5c5708<_0x395633['length'];_0x5c5708++){const _0x3da9c1=_0x395633[_0x5c5708];'element'==_0x3da9c1['type']&&'block'==_0x3da9c1['category']&&(_0x39de13+=_0x3da9c1['isStart']?0x1:-0x1,_0x3da9c1['isStart']&&(_0x1e93cd=_0x5c5708));}return 0x0===_0x39de13?null:_0x1e93cd;}_calculateOperationsData(){this['_handleUnwraps'](),this['_path']=[0x0],this['_parents']=[];for(let _0x46f35f=0x0;_0x46f35f<this['_diffItems']['length'];_0x46f35f++){const _0x16a388=this['_diffItems'][_0x46f35f]['change'],_0x311476=[];_0x311476['push'](this['_diffItems'][_0x46f35f]);let _0x50b50f=_0x46f35f+0x1;for(;this['_diffItems'][_0x50b50f]&&this['_diffItems'][_0x50b50f]['change']==_0x16a388;)_0x311476['push'](this['_diffItems'][_0x50b50f]),_0x50b50f++,_0x46f35f++;const _0x5d4ae9=_0x311476['map'](_0x39eab9=>_0x39eab9['token']);if('unchanged'==_0x16a388)_0x311476['map'](_0x3f9f3d=>_0x3f9f3d['before'])['forEach'](_0x345ae5=>this['_traverseOverItem'](_0x345ae5));else{if('removed'==_0x16a388){if(this['_markDeletions']){const _0x4e6bf1=this['_path']['slice']();_0x5d4ae9['forEach'](_0x5c3876=>this['_traverseOverItem'](_0x5c3876));const _0x20d23e=this['_path']['slice']();this['_operationsData']['push']({'type':'markedRemove','range':{'start':_0x4e6bf1,'end':_0x20d23e}});}else this['_handleChanged'](_0x5d4ae9,!0x0,this['_path']['slice']());}else{const _0x7ea19a=_0x5d4ae9['filter'](_0x3db09c=>'element'!=_0x3db09c['type']||'container'!=_0x3db09c['category']);this['_handleChanged'](_0x7ea19a,!0x1,this['_path']);}}}this['_handleWraps'](),this['_path']=[0x0],this['_parents']=[];for(let _0x41eae2=0x0;_0x41eae2<this['_diffItems']['length'];_0x41eae2++){const _0x188a2c=this['_diffItems'][_0x41eae2]['change'],_0x3e1f13=[];_0x3e1f13['push'](this['_diffItems'][_0x41eae2]);let _0x41d8fe=_0x41eae2+0x1;for(;this['_diffItems'][_0x41d8fe]&&this['_diffItems'][_0x41d8fe]['change']==_0x188a2c;)_0x3e1f13['push'](this['_diffItems'][_0x41d8fe]),_0x41d8fe++,_0x41eae2++;const _0xd28c0b=_0x3e1f13['map'](_0x8dbcdb=>_0x8dbcdb['token']);if('unchanged'==_0x188a2c){const _0xb3a858=_0x3e1f13['map'](_0x5202d4=>_0x5202d4['before']);this['_handleUnchanged'](_0xb3a858,_0xd28c0b);}else('added'==_0x188a2c||this['_markDeletions'])&&_0xd28c0b['forEach'](_0x5b97e8=>{'element'==_0x5b97e8['type']&&_0x5b97e8['isStart']&&this['_splitPostponedData']['has'](_0x5b97e8['element'])&&this['_handleSplitPostponedData'](_0x5b97e8['element'],this['_path']),this['_traverseOverItem'](_0x5b97e8);});}}_handleSplitPostponedData(_0x5d9495,_0x567f29){const _0x5d1b3c=this['_splitPostponedData']['get'](_0x5d9495);for(const _0x1626ff of _0x5d1b3c)'rename'==_0x1626ff['type']?this['_operationsData']['push']({'type':'rename','path':_0x567f29['slice'](),'oldName':_0x1626ff['oldValue'],'newName':_0x5d9495['name']}):this['_operationsData']['push']({'type':'attribute','path':_0x567f29['slice'](),'howMany':0x1,'key':_0x1626ff['key'],'oldValue':_0x1626ff['oldValue'],'newValue':JSON['stringify'](_0x5d9495['getAttribute'](_0x1626ff['key'])??null)});}_calculateMarkersOperationsData(_0x380065,_0x401131){const _0x434cac={};for(const [_0x4b41d5]of _0x380065)_0x434cac[_0x4b41d5]=null;for(const [_0x507464,_0x39733d]of _0x401131)_0x434cac[_0x507464]=_0x39733d;const _0x275e34=Object['entries'](_0x434cac)['map'](([_0x22f997,_0x156954])=>({'type':'marker','name':_0x22f997,'range':_0x156954?{'start':_0x156954['start']['path']['slice'](),'end':_0x156954['end']['path']['slice']()}:null}));this['_operationsData']['push'](..._0x275e34);}['_handleUnwraps'](){const _0x40d568=new Map(),_0x2025dc=[],_0x5806b6=[0x0];let _0x21787d=this['_diffItems']['length']+0x1;for(let _0x26a58d=this['_diffItems']['length']-0x1;_0x26a58d>=0x0;_0x26a58d--){const {token:_0x5dd87c,before:_0x3b905d,change:_0x4bab46}=this['_diffItems'][_0x26a58d];if('removed'!=_0x4bab46&&(_0x21787d=_0x26a58d),'element'!=_0x5dd87c['type']||'container'!=_0x5dd87c['category']||'added'==_0x4bab46)continue;const _0x3ec384=_0x3b905d?_0x3b905d['element']:_0x5dd87c['element'];if(_0x5dd87c['isStart']){const _0x1d8f61=_0x40d568['get'](_0x3ec384),_0x4bd462=this['_diffItems'][_0x1d8f61];('removed'==_0x4bab46||'removed'==_0x4bd462['change'])&&_0x21787d<_0x1d8f61&&(this['_operationsData']['push']({'type':'unwrap','path':_0x3ec384['getPath'](),'howMany':_0x3ec384['maxOffset']+_0x5806b6[0x0]}),_0x5806b6['shift'](),_0x5806b6[0x0]+=_0x3ec384['maxOffset']-0x1,_0x2025dc['push'](_0x26a58d),_0x2025dc['push'](_0x1d8f61));}else _0x40d568['set'](_0x3ec384,_0x26a58d),_0x5806b6['unshift'](0x0);}_0x2025dc['sort']((_0x410c4e,_0x503cf7)=>_0x503cf7-_0x410c4e),_0x2025dc['forEach'](_0x53c2b6=>{const _0x1a6a7a=this['_diffItems'][_0x53c2b6];'removed'==_0x1a6a7a['change']?this['_diffItems']['splice'](_0x53c2b6,0x1):(_0x1a6a7a['change']='added',delete _0x1a6a7a['before']);});}['_handleWraps'](){this['_path']=[0x0],this['_parents']=[];const _0x533555=[];for(let _0x348314=0x0;_0x348314<this['_diffItems']['length'];_0x348314++){const {change:_0x1aa04a,token:_0x1e6510}=this['_diffItems'][_0x348314];if('added'==_0x1aa04a&&'element'==_0x1e6510['type']&&'container'==_0x1e6510['category']){if(_0x1e6510['isStart'])_0x533555['push'](this['_path']['slice']());else{if(!_0x1e6510['isStart']){const _0x469b1d=_0x533555['pop']();this['_operationsData']['push']({'type':'wrap','range':{'start':_0x469b1d,'end':this['_path']['slice']()},'token':_0x1e6510}),this['_path'][this['_path']['length']-0x1]=_0x469b1d[this['_path']['length']-0x1]+0x1;}}}else('removed'!=_0x1aa04a||this['_markDeletions'])&&this['_traverseOverItem'](_0x1e6510);}}['_handleUnchanged'](_0x141f4c,_0x42b57f){for(let _0x3efc1b=0x0;_0x3efc1b<_0x141f4c['length'];_0x3efc1b++){const _0x139a20=_0x141f4c[_0x3efc1b];if('element'==_0x139a20['type']&&_0x139a20['isStart']){const _0x26bdcd=_0x42b57f[_0x3efc1b];'block'==_0x139a20['category']&&this['_handleElementRename'](_0x139a20['element'],_0x26bdcd['element'],this['_path']),this['_handleElementAttributeChanges'](_0x139a20['element'],_0x26bdcd['element'],this['_path']),this['_path']['push'](0x0),this['_parents']['push'](_0x26bdcd);}else{if('element'!=_0x139a20['type']||_0x139a20['isStart']){if('text'==_0x139a20['type']){const _0x337ca7=this['_path']['slice'](),_0x30591f=[],_0x191b41=[];for(;_0x141f4c[_0x3efc1b]&&'text'==_0x141f4c[_0x3efc1b]['type'];)_0x30591f['push'](_0x141f4c[_0x3efc1b]),_0x191b41['push'](_0x42b57f[_0x3efc1b]),this['_path'][this['_path']['length']-0x1]+=_0x141f4c[_0x3efc1b]['data']['length'],_0x3efc1b++;_0x3efc1b--,this['_handleTextAttributeChanges'](_0x30591f,_0x191b41,_0x337ca7);}}else this['_path']['pop'](),this['_path'][this['_path']['length']-0x1]++,this['_parents']['pop']();}}}['_handleChanged'](_0x1bb73f,_0x4d5e04,_0x2a6056){const _0x13df58=[],_0x97af82=[],_0xdcdbf0=_0x2a6056['slice']();let _0x18aaf0=this['_parents']['length']-0x1;for(let _0x1561e8=0x0;_0x1561e8<_0x1bb73f['length'];_0x1561e8++){const _0x3099b9=_0x1bb73f[_0x1561e8],_0x2a1c1e=_0x2a6056['slice']();'element'!=_0x3099b9['type']||_0x3099b9['isStart']?'element'==_0x3099b9['type']&&_0x3099b9['isStart']?(_0x2a6056['push'](0x0),_0x18aaf0++,_0x97af82['push']({'before':_0x2a1c1e,'after':_0x2a6056['slice'](),'index':_0x1561e8})):_0x2a6056[_0x2a6056['length']-0x1]+=_0x3099b9['data']['length']:(_0x2a6056['pop'](),_0x2a6056[_0x2a6056['length']-0x1]++,_0x18aaf0--,_0x97af82['length']?_0x97af82['pop']():_0x13df58['push']({'before':_0x2a1c1e,'after':_0x2a6056['slice'](),'index':_0x1561e8}));}if(_0x97af82['length']!==_0x13df58['length'])throw new dt('model-diff-incorrect-matching-and-closing-tags',null,{'tokens':_0x1bb73f,'isRemove':_0x4d5e04});const _0x26154b=[{'after':_0xdcdbf0['slice'](),'index':-0x1},..._0x13df58,..._0x97af82,{'before':_0x2a6056['slice'](),'index':_0x1bb73f['length']}];if(_0x4d5e04){for(let _0x3e2a6b=_0x26154b['length']-0x1;_0x3e2a6b>=0x1;_0x3e2a6b--){const _0x179de5=_0x26154b[_0x3e2a6b-0x1]['after'],_0x2b97f7=_0x26154b[_0x3e2a6b]['before'],_0x1f641b=_0x2b97f7[_0x2b97f7['length']-0x1]-_0x179de5[_0x179de5['length']-0x1];_0x1f641b&&(this['_operationsData']['push']({'type':'remove','path':_0x179de5,'howMany':_0x1f641b}),_0x2b97f7[_0x2b97f7['length']-0x1]-=_0x1f641b);}for(const {before:_0x4abce5}of _0x13df58)this['_operationsData']['push']({'type':'merge','path':_0x4abce5});}else for(let _0x59d8de=0x0;_0x59d8de<_0x26154b['length']-0x1;_0x59d8de++){const _0x57aecc=_0x26154b[_0x59d8de]['after'],_0x31120a=_0x26154b[_0x59d8de+0x1]['before'],_0x34f801=_0x26154b[_0x59d8de]['index']+0x1,_0x59acfc=_0x26154b[_0x59d8de+0x1]['index'];if(_0x34f801!==_0x59acfc&&this['_operationsData']['push']({'type':'insert','path':_0x57aecc,'tokens':_0x1bb73f['slice'](_0x34f801,_0x59acfc)}),_0x59d8de<_0x13df58['length']){this['_operationsData']['push']({'type':'split','path':_0x31120a});const _0x1c40bc=_0x1bb73f[_0x97af82[_0x97af82['length']-0x1-_0x59d8de]['index']],_0x270b87=this['_parents'][_0x18aaf0]['element'];_0x270b87['name']!=_0x1c40bc['element']['name']&&this['_addSplitPostponedData'](_0x1c40bc['element'],{'type':'rename','oldValue':_0x270b87['name']});const _0xfc1a1c=this['_getAttributeChanges'](_0x270b87['getAttributes'](),_0x1c40bc['element']['getAttributes']());for(const _0x19aa09 in _0xfc1a1c){const _0x10fa93=_0xfc1a1c[_0x19aa09]['oldValue'];this['_addSplitPostponedData'](_0x1c40bc['element'],{'type':'attribute','key':_0x19aa09,'oldValue':_0x10fa93});}}}}_addSplitPostponedData(_0x1f2ef7,_0x2a0e03){const _0x1c33c6=this['_splitPostponedData']['get'](_0x1f2ef7)||[];_0x1c33c6['push'](_0x2a0e03),this['_splitPostponedData']['set'](_0x1f2ef7,_0x1c33c6);}_traverseOverItem(_0x378b75){'element'==_0x378b75['type']&&_0x378b75['isStart']?(this['_path']['push'](0x0),this['_parents']['push'](_0x378b75)):'element'!=_0x378b75['type']||_0x378b75['isStart']?'text'==_0x378b75['type']&&(this['_path'][this['_path']['length']-0x1]+=_0x378b75['data']['length']):(this['_path']['pop'](),this['_path'][this['_path']['length']-0x1]++,this['_parents']['pop']());}_handleElementRename(_0x756d6e,_0x531aa8,_0x418348){_0x756d6e['name']!=_0x531aa8['name']&&this['_operationsData']['push']({'type':'rename','path':_0x418348['slice'](),'oldName':_0x756d6e['name'],'newName':_0x531aa8['name']});}_handleElementAttributeChanges(_0x5300a3,_0x49682b,_0x3695b3){const _0x1928e9=this['_getAttributeChanges'](_0x5300a3['getAttributes'](),_0x49682b['getAttributes']());for(const _0x58c19e in _0x1928e9){const {oldValue:_0x35606f,newValue:_0x54c9d5}=_0x1928e9[_0x58c19e];this['_operationsData']['push']({'type':'attribute','path':_0x3695b3['slice'](),'howMany':0x1,'key':_0x58c19e,'oldValue':_0x35606f,'newValue':_0x54c9d5});}}_handleTextAttributeChanges(_0x16c0bd,_0x5034c8,_0x59cd7b){const _0x40f368=this['_operationsData'],_0x43f322=_0x16c0bd[0x0]['parent'],_0x173ddc=_0x16c0bd[0x0]['offset'],_0x5f5be9=_0x5034c8[0x0]['parent'],_0x14390c=_0x5034c8[0x0]['offset'],_0x493549=_0x16c0bd['reduce']((_0x148527,_0x2575c4)=>_0x148527+_0x2575c4['data']['length'],0x0),_0x1743fe=this['_getAttrsForOffsets'](_0x43f322,_0x173ddc,_0x493549),_0x4eb427=this['_getAttrsForOffsets'](_0x5f5be9,_0x14390c,_0x493549),_0x2f04ac={};for(let _0x5d0f5d=0x0;_0x5d0f5d<_0x493549;_0x5d0f5d++){const _0x20ad1a=_0x1743fe[_0x173ddc+_0x5d0f5d],_0x1407a6=_0x4eb427[_0x14390c+_0x5d0f5d],_0x42a364=this['_getAttributeChanges'](_0x20ad1a,_0x1407a6);for(const _0x2f26a7 in _0x2f04ac)_0x42a364[_0x2f26a7]||_0x536b62(_0x2f26a7);for(const _0x324f59 in _0x42a364){const {oldValue:_0x25f0f7,newValue:_0x439a86}=_0x42a364[_0x324f59],_0x2fd82a=_0x2f04ac[_0x324f59];_0x2fd82a?_0x2fd82a['oldValue']==_0x25f0f7&&_0x2fd82a['newValue']==_0x439a86?_0x2fd82a['length']++:(_0x536b62(_0x324f59),_0x2f04ac[_0x324f59]={'oldValue':_0x25f0f7,'newValue':_0x439a86,'start':_0x5d0f5d,'length':0x1}):_0x2f04ac[_0x324f59]={'oldValue':_0x25f0f7,'newValue':_0x439a86,'start':_0x5d0f5d,'length':0x1};}}for(const _0x1c07d5 in _0x2f04ac)_0x536b62(_0x1c07d5);function _0x536b62(_0x438687){const _0x542186=_0x2f04ac[_0x438687],_0x3286ba=_0x59cd7b['slice']();_0x3286ba[_0x3286ba['length']-0x1]+=_0x542186['start'],_0x40f368['push']({'type':'attribute','path':_0x3286ba,'howMany':_0x542186['length'],'key':_0x438687,'oldValue':_0x542186['oldValue'],'newValue':_0x542186['newValue']}),delete _0x2f04ac[_0x438687];}}_getAttributeChanges(_0xd0aa0c,_0x324c22){const _0x38f014={};for(const [_0x18e0a3,_0x2e6580]of _0xd0aa0c)_0x38f014[_0x18e0a3]={'oldValue':JSON['stringify'](_0x2e6580),'newValue':'null'};for(const [_0xb0346c,_0x143233]of _0x324c22){const _0x32cfd9=JSON['stringify'](_0x143233);_0x38f014[_0xb0346c]?_0x38f014[_0xb0346c]['oldValue']==_0x32cfd9?delete _0x38f014[_0xb0346c]:_0x38f014[_0xb0346c]['newValue']=_0x32cfd9:_0x38f014[_0xb0346c]={'oldValue':'null','newValue':_0x32cfd9};}return delete _0x38f014[Vn],_0x38f014;}_getAttrsForOffsets(_0x110dd3,_0x440e23,_0x588ebd){const _0x58ed82=new Array(_0x440e23+_0x588ebd);let _0x3e2f6f=_0x110dd3['getChildAtOffset'](_0x440e23),_0x2788ab=_0x3e2f6f['startOffset'];for(;_0x3e2f6f&&_0x2788ab<_0x440e23+_0x588ebd;){const _0x13da70=Array['from'](_0x3e2f6f['getAttributes']());_0x58ed82['fill'](_0x13da70,_0x2788ab,_0x2788ab+_0x3e2f6f['offsetSize']),_0x2788ab+=_0x3e2f6f['offsetSize'],_0x3e2f6f=_0x3e2f6f['nextSibling'];}return _0x58ed82;}_getPositionFromAnchorAndPath(_0x15e6b8,_0x407318){const _0x4543cb=[..._0x15e6b8['path']['slice'](0x0,-0x1),_0x15e6b8['offset']+_0x407318[0x0],..._0x407318['slice'](0x1)];return new _0x22fec2(_0x15e6b8['root'],_0x4543cb);}['_makeModelFromTokens'](_0x47f412){const _0x5a76fb=[];let _0x22b02c=null;for(const _0x38ec12 of _0x47f412)if('element'!=_0x38ec12['type']||_0x38ec12['isStart']||_0x22b02c!=_0x38ec12['element']){if(!_0x22b02c){if('text'==_0x38ec12['type']){const _0x1a2a26=_0x22fec2['_createAt'](_0x38ec12['parent'],_0x38ec12['offset']),_0x12eb88=_0x3e534d['_createFromPositionAndShift'](_0x1a2a26,_0x38ec12['data']['length']),_0x264e5c=Array['from'](_0x12eb88['getItems']())['map'](_0x1a3e0a=>new _0x113230(_0x1a3e0a['data'],_0x1a3e0a['getAttributes']()));_0x5a76fb['push'](..._0x264e5c);}else{_0x22b02c=_0x38ec12['element'];const _0x453585=_0x38ec12['element']['_clone'](!0x0);_0x453585['_removeAttribute'](Vn);for(const _0x3e2841 of this['_editor']['model']['createRangeIn'](_0x453585)['getItems']())_0x3e2841['is']('element')&&_0x3e2841['_removeAttribute'](Vn);_0x5a76fb['push'](_0x453585);}}}else _0x22b02c=null;return _0x5a76fb;}};function Gn(_0x427d8b,_0x400ced){return _0x427d8b['type']===_0x400ced['type']&&(_0x427d8b['limitId']===_0x400ced['limitId']&&('text'==_0x427d8b['type']?_0x427d8b['data']==_0x400ced['data']:function(_0x39445a,_0x2c4b97){if(_0x39445a['isStart']!=_0x2c4b97['isStart'])return!0x1;if(_0x39445a['isStart']&&_0x39445a['elementId']!=_0x2c4b97['elementId'])return!0x1;if(_0x39445a['category']!=_0x2c4b97['category'])return!0x1;if('block'==_0x39445a['category'])return!0x0;if('container'==_0x39445a['category']&&_0x39445a['elementId']!=_0x2c4b97['elementId'])return!0x1;return _0x39445a['element']['name']==_0x2c4b97['element']['name'];}(_0x427d8b,_0x400ced)));}function Wn(_0x9e263f){return _0x395975({'name':_0x9e263f['name'],...Object['fromEntries'](_0x9e263f['getAttributes']())});}const Fn=/* #__PURE__ -- @preserve */
|
|
26
|
+
mt();var Kn=class extends Fn{_generateUid;_uidCounter=0x0;_touchedNodesState={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null,'rescuedNewIds':new Set()};_existingDataIds=new Set();_referencedExistingIds=new Set();constructor(_0x26524a){super(),this['_generateUid']=_0x26524a||(()=>'e'+String(this['_uidCounter']++));}['merge'](_0x39ad32,_0x590f75,_0x3d9c95){this['_uidCounter']=0x0;const _0xdac948=_0x39ad32['cloneNode'](!0x0);qn(_0x590f75,_0xdac948);const _0x3bbf1d=_0xdac948['childNodes'],_0x174aa1=Array['from'](_0x3bbf1d)['filter'](_0x479745=>!(0x3===_0x479745['nodeType']&&''===sn(_0x479745)['trim']())),_0x23d9ea=_0x174aa1['length'];this['_existingDataIds']=new Set(rn('data-id',null,_0x590f75)['map'](_0x4013d7=>ln(_0x4013d7,'data-id'))['filter'](_0x2db990=>!!_0x2db990));for(const _0x5ed712 of _0x174aa1)_0x5ed712&&_0x350de8(_0x5ed712)&&void 0x0===_0x5ed712['attribs']['data-id']&&un(_0x5ed712,'data-id','new-element');if(rn('data-id',null,_0xdac948)['forEach'](_0x49e517=>{const _0x1b0373=ln(_0x49e517,'data-id');'new-element'===_0x1b0373||this['_existingDataIds']['has'](_0x1b0373)||un(_0x49e517,'data-id','new-element');}),0x0===_0x590f75['childNodes']['length']){const _0x322753=[];return rn('data-id','new-element',_0xdac948)['forEach'](_0x238661=>{const _0x3535d5=this['_generateUid']();un(_0x238661,'data-id',_0x3535d5),_0x322753['push'](_0x3535d5);}),this['_removeSpecialComments'](_0xdac948),{'parsedContent':_0xdac948,'newNodeIds':_0x322753,'modifiedNodeIds':[],'removedNodeIds':[]};}this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_touchedNodesState']['rescuedNewIds']=new Set(),this['_referencedExistingIds']=new Set();let _0x40c733=-0x1,_0xf163f8=!0x1;for(let _0x1d5486=0x0;_0x1d5486<_0x23d9ea;_0x1d5486++){const _0x125607=_0x174aa1[_0x1d5486],_0x3326c7=_0x174aa1[_0x1d5486+0x1];if(this['_isNewNode'](_0x125607)){if(-0x1===_0x40c733&&(_0x40c733=_0x1d5486),this['_markWrappedElements'](_0x125607),!this['_isNewNode'](_0x3326c7)){const [_0x4d9cc0,_0x44c453]=this['_findReferenceNode'](_0x125607,_0xf163f8,_0x590f75);if(_0x4d9cc0){const _0x53565c=Array['from'](_0x174aa1)['slice'](_0x40c733,_0x1d5486+0x1);this['_insertNodes'](_0x4d9cc0,_0x53565c,_0x44c453),_0x40c733=-0x1;}}}else{if(this['_isExistingContentComment'](_0x125607))_0xf163f8=!0x0;else{if(this['_isExistingNode'](_0x125607)){const _0xf3918c=ln(_0x125607,'data-id');if(_0xf3918c&&this['_existingDataIds']['has'](_0xf3918c)){this['_referencedExistingIds']['add'](_0xf3918c);const _0x191acb=nn('data-id',_0xf3918c,_0x590f75);this['_replaceNode'](_0x191acb,_0x125607);}}else{if($n(_0x125607)){const _0x49328a=Yn(_0x125607);nn('data-id',_0x49328a,_0xdac948)||this['_touchedNodesState']['removedIds']['push'](_0x49328a);}}}}}for(const _0x113ab9 of this['_touchedNodesState']['removedIds']){const _0x32ae61=nn('data-id',_0x113ab9,_0x590f75);_0x32ae61&&(this['_rescueUnwrappedElements'](_0x32ae61),this['_removeNode'](_0x32ae61,_0x113ab9,_0x3d9c95));}if(rn('data-id','new-element',_0x590f75)['forEach'](_0x4d0b5a=>{const _0x5b09a6=this['_getUid'](_0x4d0b5a);un(_0x4d0b5a,'data-id',_0x5b09a6),this['_touchedNodesState']['newIds']['push'](_0x5b09a6);}),this['_removeSpecialComments'](_0x590f75),_0x3d9c95&&_0x3d9c95['cutAfterUnstable']){const _0xe29f26=this['_findLastConfirmationPoint'](_0x174aa1),_0x33ad83=this['_getLastStableElement'](_0x590f75,_0xe29f26);this['_markUnstableElements'](_0x590f75,_0x33ad83);}if(this['_processWrappedElements'](_0x590f75,_0x3d9c95),_0x3d9c95&&_0x3d9c95['cutAfterUnstable']&&this['_touchedNodesState']['lastTouchedId']){const _0x11a4c3=rn('data-id',this['_touchedNodesState']['lastTouchedId'],_0x590f75);let _0x28d728=_0x11a4c3[_0x11a4c3['length']-0x1];for(;_0x28d728;)An(_0x28d728),_0x28d728=_0x28d728['parentNode'];}return{'parsedContent':_0x590f75,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}_insertNodes(_0x10de9c,_0x896702,_0x51e3ef){for(const _0x5d637b of _0x896702){const _0x446191=this['_getUid'](_0x5d637b);un(_0x5d637b,'data-id',_0x446191),this['_touchedNodesState']['newIds']['push'](_0x446191),this['_touchedNodesState']['lastTouchedId']=_0x446191;}const _0x1c064b='afterbegin'===_0x51e3ef||'afterend'===_0x51e3ef?_0x896702['reverse']():_0x896702;for(const _0x3c34dd of _0x1c064b)dn(_0x10de9c,_0x3c34dd,_0x51e3ef);}['_replaceNode'](_0x4c568d,_0x3d5903){if(!_0x4c568d)return;if(_0x27cc35=_0x3d5903,gn(sn(_0x4c568d))===gn(sn(_0x27cc35)))return;var _0x27cc35;const _0x443718=ln(_0x4c568d,'data-id');this['_touchedNodesState']['modifiedIds']['push'](_0x443718),this['_touchedNodesState']['lastTouchedId']=_0x443718,_0x1a0dae(_0x4c568d,_0x3d5903['cloneNode'](!0x0));}['_removeNode'](_0x5b5b4b,_0x404cb3,_0x5c0538){if(_0x5c0538&&_0x5c0538['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x404cb3;const _0x22b192=_0x5c0538['replaceRemovedWith']['cloneNode'](!0x0);un(_0x22b192,'data-id',_0x404cb3),un(_0x22b192,'data-removed','true'),_0x1a0dae(_0x5b5b4b,_0x22b192);}else _0x20a4a8(_0x5b5b4b);}['_findReferenceNode'](_0x495e86,_0x4802e1,_0x3c1e55){const _0x30ff8b=this['_findPrevElementWithDataId'](_0x495e86,!0x1);if(_0x30ff8b){const _0x539b63=Yn(_0x30ff8b),_0x100e4b=nn('data-id',_0x539b63,_0x3c1e55);if(_0x100e4b)return[_0x100e4b,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x539b63);}const _0x5ad589=this['_findNextElementWithDataId'](_0x495e86,!0x1);if(_0x5ad589){const _0x326dae=Yn(_0x5ad589),_0x2e2dcc=nn('data-id',_0x326dae,_0x3c1e55);if(_0x2e2dcc)return[_0x2e2dcc,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x326dae);}return _0x4802e1?_0x495e86['nextSibling']?this['_findFallbackReferenceNode'](_0x495e86,_0x3c1e55):[_0x3c1e55['childNodes'][_0x3c1e55['childNodes']['length']-0x1],'afterend']:[_0x3c1e55['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x18b360,_0x1208df){const _0x30cf7d=[],_0x107905=this['_findPrevElementWithDataId'](_0x18b360,!0x0);if(_0x107905){const _0x5f03c3=nn('data-id',Yn(_0x107905),_0x1208df);_0x5f03c3&&_0x30cf7d['push']([_0x5f03c3,'afterend']);}const _0x5c61f6=this['_findNextElementWithDataId'](_0x18b360,!0x0);if(_0x5c61f6){const _0x18a089=nn('data-id',Yn(_0x5c61f6),_0x1208df);_0x18a089&&_0x30cf7d['push']([_0x18a089,'beforebegin']);}return _0x30cf7d['length']>0x1?In(_0x30cf7d[0x0][0x0])<=In(_0x30cf7d[0x1][0x0])?_0x30cf7d[0x0]:_0x30cf7d[0x1]:0x1===_0x30cf7d['length']?_0x30cf7d[0x0]:[_0x1208df['lastChild'],'afterend'];}_findNextElementWithDataId(_0x47e868,_0x234ce7){let _0x28af00=_0x47e868['nextSibling'],_0x3b42e1=null,_0x1269cd=!0x1;for(;_0x28af00;){if(_0x3e33bf(_0x28af00)){if($n(_0x28af00)&&(_0x3b42e1=_0x28af00),this['_isExistingContentComment'](_0x28af00)&&_0x234ce7&&!_0x1269cd){_0x1269cd=!0x0,_0x28af00=_0x28af00['nextSibling'];continue;}break;}const _0x3caac9=ln(_0x28af00,'data-id');if(_0x3caac9&&'new-element'!==_0x3caac9&&this['_existingDataIds']['has'](_0x3caac9)){_0x3b42e1=_0x28af00;break;}_0x28af00=_0x28af00['nextSibling'];}return _0x3b42e1;}_findPrevElementWithDataId(_0x20f827,_0x54ea93){let _0xc866c8=_0x20f827['previousSibling'],_0x416781=null,_0x259534=!0x1;for(;_0xc866c8;){if(_0x3e33bf(_0xc866c8)){if($n(_0xc866c8)&&(_0x416781=_0xc866c8),this['_isExistingContentComment'](_0xc866c8)&&_0x54ea93&&!_0x259534){_0x259534=!0x0,_0xc866c8=_0xc866c8['previousSibling'];continue;}break;}const _0x1049cd=ln(_0xc866c8,'data-id');if(_0x1049cd&&'new-element'!==_0x1049cd&&this['_existingDataIds']['has'](_0x1049cd)){_0x416781=_0xc866c8;break;}_0xc866c8=_0xc866c8['previousSibling'];}return _0x416781;}_markWrappedElements(_0x202fbe){_0x350de8(_0x202fbe)&&rn('data-id',null,_0x202fbe)['forEach'](_0x2650cf=>{this['_isExistingNode'](_0x2650cf)&&(un(_0x2650cf,'data-wrapped-id',ln(_0x2650cf,'data-id')),un(_0x2650cf,'data-id',null));});}_processWrappedElements(_0xde43d7,_0x428c29){rn('data-wrapped-id',null,_0xde43d7)['forEach'](_0x392229=>{const _0x40255f=ln(_0x392229,'data-wrapped-id');if(this['_hasUnstableParent'](_0x392229))return;const _0x1240f5=nn('data-id',_0x40255f,_0xde43d7);un(_0x392229,'data-id',_0x40255f),_0x1240f5&&(this['_removeNode'](_0x1240f5,_0x40255f,_0x428c29),this['_touchedNodesState']['removedIds']['push'](_0x40255f),this['_touchedNodesState']['lastTouchedId']=_0x40255f);});}_hasUnstableParent(_0x46c9b0){let _0x3011bb=_0x46c9b0['parentNode'];for(;_0x3011bb;){if(ln(_0x3011bb,'data-unstable'))return!0x0;_0x3011bb=_0x3011bb['parentNode'];}return!0x1;}_rescueUnwrappedElements(_0x3bbe39){const _0x49eae6=new Set(this['_touchedNodesState']['removedIds']),_0x121c95=new Set(this['_touchedNodesState']['newIds']);rn('data-id',null,_0x3bbe39)['forEach'](_0x558599=>{const _0x19af11=ln(_0x558599,'data-id'),_0x1f576b=!!_0x19af11&&this['_referencedExistingIds']['has'](_0x19af11),_0x8bd4bc=!!_0x19af11&&_0x121c95['has'](_0x19af11);if(!_0x19af11||!_0x1f576b&&!_0x8bd4bc)return;if(_0x49eae6['has'](_0x19af11))return;let _0x38cd2a=_0x558599['parentNode'],_0x287379=!0x1;for(;_0x38cd2a;){if(_0x38cd2a===_0x3bbe39){_0x287379=!0x0;break;}const _0x142a26=ln(_0x38cd2a,'data-id');if(_0x142a26&&(this['_referencedExistingIds']['has'](_0x142a26)||_0x121c95['has'](_0x142a26)))return;_0x38cd2a=_0x38cd2a['parentNode'];}if(_0x287379){if(_0x21a8b9(_0x3bbe39,_0x558599),_0x1f576b){const _0x376257=this['_generateUid'](),_0x5633ed=this['_touchedNodesState']['modifiedIds']['indexOf'](_0x19af11);-0x1!==_0x5633ed&&this['_touchedNodesState']['modifiedIds']['splice'](_0x5633ed,0x1),un(_0x558599,'data-unwrapped-id',_0x19af11),un(_0x558599,'data-id',_0x376257),this['_touchedNodesState']['newIds']['push'](_0x376257),this['_touchedNodesState']['rescuedNewIds']['add'](_0x376257),this['_touchedNodesState']['lastTouchedId']=_0x376257;}else this['_touchedNodesState']['rescuedNewIds']['add'](_0x19af11),this['_touchedNodesState']['lastTouchedId']=_0x19af11;}});}_getUid(_0x166c87){return this['_isExistingNode'](_0x166c87)?ln(_0x166c87,'data-id'):this['_generateUid']();}_removeSpecialComments(_0x352183){cn(_0x352183)['filter'](_0x1b0c92=>$n(_0x1b0c92)||this['_isExistingContentComment'](_0x1b0c92))['forEach'](_0x360ac1=>{_0x20a4a8(_0x360ac1);});}_findLastConfirmationPoint(_0x1d50e4){let _0x277bcf=null,_0x32f54e=null,_0x485954=null,_0x54ee50=null;const _0x149f7b=_0x1ac25c=>{_0x1ac25c&&(_0x277bcf=_0x1ac25c),_0x485954=null,_0x54ee50=null;};for(let _0x2a17ae=0x0;_0x2a17ae<_0x1d50e4['length'];_0x2a17ae++){const _0x56640a=_0x1d50e4[_0x2a17ae];if(this['_isExistingContentComment'](_0x56640a)){_0x149f7b(_0x32f54e);continue;}if(_0x350de8(_0x56640a)){const _0x58bfa2=ln(_0x56640a,'data-id'),_0x2b4070=_0x2a17ae===_0x1d50e4['length']-0x1;if(_0x58bfa2&&'new-element'!==_0x58bfa2&&this['_touchedNodesState']['modifiedIds']['includes'](_0x58bfa2)&&!_0x2b4070){_0x149f7b(_0x58bfa2),_0x32f54e=_0x58bfa2;continue;}}let _0x10148e;const _0x581120=Yn(_0x56640a);if(_0x581120&&this['_touchedNodesState']['rescuedNewIds']['has'](_0x581120))_0x32f54e=_0x581120;else{if(_0x581120&&this['_touchedNodesState']['newIds']['includes'](_0x581120))_0x10148e='N';else{if(!$n(_0x56640a))continue;_0x10148e='R';}_0x10148e===_0x54ee50||null===_0x54ee50?_0x54ee50=_0x10148e:null!==_0x485954?(_0x149f7b(_0x32f54e),_0x54ee50=_0x10148e):(_0x485954=_0x54ee50,_0x54ee50=_0x10148e),_0x32f54e=_0x581120;}}const _0x4a8dc4=_0x1d50e4[_0x1d50e4['length']-0x1];return _0x4a8dc4&&!_0x350de8(_0x4a8dc4)&&!$n(_0x4a8dc4)&&_0x32f54e&&_0x149f7b(_0x32f54e),_0x277bcf;}_getLastStableElement(_0x276595,_0x25959f){if(!_0x25959f)return null;const _0x3ab74e=nn('data-id',_0x25959f,_0x276595);if(!_0x3ab74e)return null;const _0x593403=[_0x3ab74e,..._n(_0x3ab74e)]['at'](-0x2);if(_0x593403===_0x3ab74e)return _0x3ab74e;let _0x35d08e=_0x593403['previousSibling'];for(;_0x35d08e&&!_0x350de8(_0x35d08e);)_0x35d08e=_0x35d08e['previousSibling'];return _0x35d08e;}_markUnstableElements(_0x4b95fb,_0x4a4b9f){const _0x39c9c2=new Set([...this['_touchedNodesState']['newIds'],...this['_touchedNodesState']['modifiedIds'],...this['_touchedNodesState']['removedIds']]);let _0x51462b=_0x4a4b9f?_0x4a4b9f['nextSibling']:_0x4b95fb['firstChild'];for(;_0x51462b;)_0x350de8(_0x51462b)&&(_0x39c9c2['has'](ln(_0x51462b,'data-id'))||rn('data-id',null,_0x51462b)['some'](_0x119554=>_0x39c9c2['has'](ln(_0x119554,'data-id'))))&&un(_0x51462b,'data-unstable','true'),_0x51462b=_0x51462b['nextSibling'];}['_isNewNode'](_0x5df602){return Boolean('new-element'===ln(_0x5df602,'data-id'));}_isExistingNode(_0x4f7bca){return Boolean((ln(_0x4f7bca,'data-id')||'')['length']>0x0&&'new-element'!==ln(_0x4f7bca,'data-id'));}_isExistingContentComment(_0x16f025){return Boolean(_0x3e33bf(_0x16f025)&&sn(_0x16f025)['match'](/\s*existing[\s*-](content|document)\s*/g));}};function $n(_0x542472){return!!_0x542472&&Boolean(_0x3e33bf(_0x542472)&&sn(_0x542472)['match'](/removed[\s*-]data-id="[^"]+"/));}function Yn(_0x1d7f1c){if(!_0x1d7f1c)return null;if(_0x350de8(_0x1d7f1c))return ln(_0x1d7f1c,'data-id')??null;if(_0x3e33bf(_0x1d7f1c)){const _0x474ec6=sn(_0x1d7f1c)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x474ec6&&_0x474ec6[0x1])return _0x474ec6[0x1];}return null;}function qn(_0x15b7e4,_0x1ac215){const _0x37222e=new Map();for(const _0x90ca11 of on(_0x15b7e4))hn(_0x90ca11)||_0x37222e['set'](ln(_0x90ca11,'data-id'),_0x90ca11);const _0xe7841a=new Set();for(const _0x1f8f71 of on(_0x1ac215)){if(hn(_0x1f8f71))continue;const _0x4d94b9=ln(_0x1f8f71,'data-id'),_0x4ef0a3=_0x4d94b9?_0x37222e['get'](_0x4d94b9):void 0x0;_0x4ef0a3?(_0x1a0dae(_0x1f8f71,_0x26ae61(_0x4ef0a3,!0x0)),_0xe7841a['add'](_0x4d94b9)):_0x20a4a8(_0x1f8f71);}for(const _0x1475e2 of cn(_0x1ac215))$n(_0x1475e2)&&_0x37222e['has'](Yn(_0x1475e2))&&_0x20a4a8(_0x1475e2);const _0x1f5978=new Set(rn('data-id',null,_0x1ac215)['map'](_0x194599=>ln(_0x194599,'data-id')));for(const [_0x19d2ba,_0x45398e]of _0x37222e){if(_0xe7841a['has'](_0x19d2ba))continue;let _0xd1f8ca=_0x45398e['parent'],_0x4a1aeb=null;for(;_0xd1f8ca&&_0x350de8(_0xd1f8ca);){const _0x3681d8=ln(_0xd1f8ca,'data-id');if(_0x3681d8&&_0x1f5978['has'](_0x3681d8)){_0x4a1aeb=_0x3681d8;break;}_0xd1f8ca=_0xd1f8ca['parent'];}if(!_0x4a1aeb)continue;const _0x1d2f04=nn('data-id',_0x4a1aeb,_0x1ac215);_0x1d2f04&&_0x581dad(_0x1d2f04,_0x26ae61(_0x45398e,!0x0));}}const Qn=/* #__PURE__ -- @preserve */
|
|
27
|
+
mt();var Xn=class extends Qn{_m2html;constructor(){super();const _0x42fca4=Object['entries'](_0x583496),_0x20f33b=_0x42fca4['findIndex'](([_0x494e98])=>'rehypeDomRaw'===_0x494e98);if(-0x1===_0x20f33b)throw new dt('ai-response-parser-unable-to-set-up-parser');_0x42fca4['splice'](_0x20f33b+0x1,0x0,['rehypeSanitize',_0x5bf231]),this['_m2html']=new _0xaf752({'plugins':Object['fromEntries'](_0x42fca4)});}convertMarkdownToHTML(_0x14d317){const _0x16d535=this['_m2html']['parse'](_0x14d317);return this['parseAndNormalizeHTML'](_0x16d535);}['parseAndNormalizeHTML'](_0x118b55){return this['_parseHTML'](_0x118b55);}['_parseHTML'](_0x22ed2d){const _0x1eb055=en('<dummy>'+_0x22ed2d['replace'](/<[^>]*?$/g,'')+'</dummy>');return zn(_0x1eb055),_0x1eb055['children']=_0x1eb055['children'][0x0]['children'],_0x1eb055;}};function zn(_0x420c12){for(const _0x44cbfd of _0x420c12['children'])_0x350de8(_0x44cbfd)?'pre'!==_0x44cbfd['name']&&zn(_0x44cbfd):_0x36bb90(_0x44cbfd)&&(_0x44cbfd['data']=_0x44cbfd['data']['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/[ \t\r\f\v]+/g,'\x20'));}function jn(_0x5e64fc,_0x3054ef){for(const _0x3e38b3 of _0x5e64fc)'noop'!==_0x3e38b3['type']&&(_0x3e38b3['_aiSource']=_0x3054ef);}var Jn=class extends _0x4f3978{static get['pluginName'](){return'AIGateway';}static get requires(){return[Un,Js];}get['models'](){return this['context']['plugins']['get'](Js)['models'];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['apply'](_0x35753f,_0x32346e){const {applyMethod:_0x2abf7b,roots:_0x78fcb7}=_0x32346e,_0x35b3f5='suggest'===_0x2abf7b;if(_0x35753f['error']||!_0x35753f['results']['length'])throw new dt('ai-gateway-apply-invalid-status',this,{'status':_0x35753f['status']});if(_0x78fcb7){if(0x0===_0x78fcb7['length'])throw new dt('ai-gateway-apply-empty-roots',this);for(const {channelId:_0x302ae4,rootName:_0x3c43e4}of _0x78fcb7)if(!_0x35753f['results']['some'](_0x114dee=>_0x114dee['channelId']===_0x302ae4&&_0x114dee['rootName']===_0x3c43e4))throw new dt('ai-gateway-apply-root-not-found',this,{'channelId':_0x302ae4,'rootName':_0x3c43e4});}const _0x4fbca7=_0x35753f['results']['reduce']((_0x47fce9,_0x4f00e7)=>{if(_0x78fcb7&&!_0x78fcb7['some'](_0x2fe765=>_0x2fe765['channelId']===_0x4f00e7['channelId']&&_0x2fe765['rootName']===_0x4f00e7['rootName']))return _0x47fce9;if('completed'!==_0x4f00e7['status'])throw new dt('ai-gateway-apply-invalid-status',this,{'status':_0x4f00e7['status'],'channelId':_0x4f00e7['channelId'],'rootName':_0x4f00e7['rootName']});if(_0x35b3f5&&!_0x4f00e7['editor']['plugins']['has']('TrackChanges'))throw new dt('ai-no-track-changes',this,{'channelId':_0x4f00e7['channelId'],'rootName':_0x4f00e7['rootName']});let _0x29f7ba=_0x47fce9['get'](_0x4f00e7['editor']);return _0x29f7ba||(_0x29f7ba=[],_0x47fce9['set'](_0x4f00e7['editor'],_0x29f7ba)),_0x29f7ba['push'](_0x4f00e7),_0x47fce9;},new Map()),_0x1b06a6=this['context']['plugins']['get'](Un);for(const [_0x43deb9,_0x35ecea]of _0x4fbca7){const _0x2a90de=_0x35ecea['map'](_0x89ec1f=>{const _0x1fa1c0=_0x43deb9['model']['createPositionAt'](_0x43deb9['model']['document']['getRoot'](_0x89ec1f['rootName']),0x0),_0x2a2eec=Rn(_0x43deb9,_0x89ec1f['rootName'],_0x89ec1f['contentRawOld'],_0x89ec1f['contentRawNew']);if(!_0x2a2eec)return _0x89ec1f['droppedUnsupportedInlineChange']=!0x0,null;const _0xf84644=_0x1b06a6['getDiff'](_0x2a2eec['before'],_0x2a2eec['after'],{'anchor':_0x1fa1c0,'markDeletions':_0x35b3f5,'targetEditor':_0x43deb9}),_0x10b689=_0x43deb9['model']['document']['history']['getOperations'](_0x89ec1f['documentVersion']),_0xc3c28b={'document':_0x43deb9['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x1a64d0=_0x3d40c6(_0xf84644,_0x10b689,_0xc3c28b)['operationsA'];return jn(_0x1a64d0,_0x32346e['aiSource']??'api'),_0x1a64d0;});_0x43deb9['model']['change'](_0x1e6db5=>{for(const _0x1675ea of _0x2a90de)_0x1675ea&&(_0x35b3f5?_0x43deb9['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x1675ea):_0x1b06a6['applyOperations'](_0x1e6db5,_0x1675ea));});}}mergeChangesIntoContent(_0xdd349a,_0x353c26){const _0x7d505a=new Xn(),_0x18f524=new Kn();let _0x9d6e77=_0x7d505a['parseAndNormalizeHTML'](_0x353c26);for(const _0xc91c44 of _0xdd349a)try{const _0x3e1003=_0x7d505a['parseAndNormalizeHTML'](_0xc91c44['content']);_0x9d6e77=_0x18f524['merge'](_0x3e1003,_0x9d6e77,{'cutAfterUnstable':!0x1,'replaceRemovedWith':void 0x0})['parsedContent'];}catch(_0x2af078){throw new dt('ai-gateway-merge-failed',this,{..._0xc91c44},_0x2af078);}return _0x9d6e77;}};const Zn=/* #__PURE__ -- @preserve */
|
|
28
|
+
It(),tr=['capabilitiesUpdated'];var er=class extends Zn{['_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(_0xf06e34){const _0x483726={};if(!_0xf06e34)return _0x483726;('isWebSearchEnabled'in _0xf06e34?_0xf06e34['isWebSearchEnabled']:_0xf06e34['webSearch'])&&(_0x483726['webSearch']={});const _0x3f8168='isReasoningEnabled'in _0xf06e34?_0xf06e34['isReasoningEnabled']:_0xf06e34['reasoning'];return _0x3f8168&&(_0x483726['reasoning']='string'==typeof _0x3f8168?{'level':_0x3f8168}:{}),_0x483726;}toggleWebSearch(){this['setWebSearch'](!this['_isWebSearchEnabled']);}toggleReasoning(){this['setReasoning'](!this['_isReasoningEnabled']);}setWebSearch(_0x43be7d){_0x43be7d!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x43be7d,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}setReasoning(_0x5c1e6a){_0x5c1e6a!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x5c1e6a,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}};const ir='defaultContextIds',sr=/* #__PURE__ -- @preserve */
|
|
29
|
+
mt();var nr=class AIContext extends sr{['_refs'];constructor(_0x529ec4=[]){super(),this['_refs']=[..._0x529ec4];}get['refs'](){return[...this['_refs']];}get isEmpty(){return 0x0===this['_refs']['length'];}cloneWith(..._0xe8f355){return new AIContext([...this['_refs'],..._0xe8f355]);}addDefaultContext(_0x513ba9){this['_refs']=[...this['_refs'],..._0x513ba9];}toRequestParts(_0x568ea9=[]){return[...this['toRequestContexts'](),..._0x568ea9];}toRequestContexts(){return this['_refs']['map'](_0x35db97=>({..._0x35db97,'type':'context'}));}toMessageAttributes(_0x589fbe){return this['isEmpty']?_0x589fbe:{..._0x589fbe,[ir]:[...new Set(this['_refs']['map'](_0x546a94=>_0x546a94['id']))]};}static getDefaultContextIds(_0x430e5b){const _0x5af407=_0x430e5b&&_0x430e5b[ir];return new Set(Array['isArray'](_0x5af407)?_0x5af407:[]);}};function rr(_0x1bec13,_0x95766,_0x3b5456,_0x3d0246){if(_0x1bec13 instanceof dt)return _0x1bec13;const _0x14599f=_0x1bec13?.['data'],_0x557b89=void 0x0!==_0x14599f?{..._0x3d0246,'backendData':_0x14599f}:_0x3d0246;return new dt(_0x95766,_0x3b5456,_0x557b89,_0x1bec13);}var or=class{_editor;_rootName;['_channelId'];['_sessionId'];_documentVersion;_contentRawOld;_contentRawNew;['_error'];_isAborted=!0x1;_droppedUnsupportedInlineChange=!0x1;constructor(_0x27a7a2){this['_editor']=_0x27a7a2['editor'],this['_rootName']=_0x27a7a2['rootName'],this['_channelId']=_0x27a7a2['channelId'],this['_sessionId']=_0x27a7a2['sessionId'];}get status(){return this['_error']?'error':this['_isAborted']?'aborted':void 0x0!==this['_contentRawNew']?'completed':'initialized';}get editor(){return this['_editor'];}get rootName(){return this['_rootName'];}get['channelId'](){return this['_channelId'];}get['sessionId'](){return this['_sessionId'];}get documentVersion(){return this['_documentVersion'];}set documentVersion(_0x561dee){this['_documentVersion']=_0x561dee;}get contentRawOld(){return this['_contentRawOld'];}set contentRawOld(_0xeaf1cf){this['_contentRawOld']=_0xeaf1cf;}get contentRawNew(){return this['_contentRawNew'];}set contentRawNew(_0x99efe){this['_contentRawNew']=_0x99efe;}get contentOld(){return this['_dropDataIds'](this['_contentRawOld']||'');}get contentNew(){return this['_dropDataIds'](this['_contentRawNew']||'');}get['error'](){return this['_error'];}set['error'](_0x1eb244){this['_error']=_0x1eb244;}get droppedUnsupportedInlineChange(){return this['_droppedUnsupportedInlineChange'];}set droppedUnsupportedInlineChange(_0x4bb409){this['_droppedUnsupportedInlineChange']=_0x4bb409;}abort(){this['_isAborted']=!0x0;}_dropDataIds(_0x41d703){return _0x41d703['replace'](/ data-id="[a-z0-9]+"/g,'');}},ar=class extends or{['_summary']='';get['summary'](){return this['_summary'];}set['summary'](_0x1d649e){this['_summary']=_0x1d649e;}},hr=class{_results;constructor(_0x5a778e=[]){this['_results']=_0x5a778e;}_status='initialized';['_error'];abort(){'error'!==this['_status']&&(this['_status']='aborted');}get status(){return this['_status'];}set status(_0x4a44d9){this['_status']=_0x4a44d9;}get['error'](){return this['_error'];}set['error'](_0x490215){this['_status']='error',this['_error']=_0x490215;}get results(){return this['_results'];}addResult(..._0x419285){this['_results']['push'](..._0x419285);}},cr=class extends _0x4f3978{static get['pluginName'](){return'AIDocumentProcessingGateway';}static get requires(){return[$s,Pn,Jn,Js];}get['models'](){return this['context']['plugins']['get'](Js)['models'];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async processDocument(_0x4afa64,_0x3a959d){if(!_0x4afa64)throw new dt('ai-documentprocessinggateway-missing-prompt',this);const _0x12d1c1=await this['context']['plugins']['get'](Pn)['getDocumentData'](),_0x28728f=_0x3a959d['roots'];if(0x0===(_0x28728f??_0x12d1c1)['length'])throw new dt('ai-documentprocessinggateway-empty-roots',this);if(_0x28728f){for(const _0x1b174d of _0x28728f)if(!_0x12d1c1['some'](_0xba38e9=>_0xba38e9['rootName']===_0x1b174d['rootName']&&_0xba38e9['channelId']===_0x1b174d['channelId']))throw new dt('ai-documentprocessinggateway-root-not-found',this,{'channelId':_0x1b174d['channelId'],'rootName':_0x1b174d['rootName']});}const _0x4fc76c=_0x28728f?_0x12d1c1['filter'](_0x530766=>_0x28728f['some'](_0x2d20db=>_0x2d20db['rootName']===_0x530766['rootName']&&_0x2d20db['channelId']===_0x530766['channelId'])):_0x12d1c1,_0x4616ea=[],_0x86cdb2=[];for(const _0x132b08 of _0x4fc76c){const _0x33b7fa={'editor':_0x132b08['editor'],'rootName':_0x132b08['rootName'],'sessionId':_0x132b08['sessionId'],'channelId':_0x132b08['channelId'],'contentRawOld':_0x132b08['content'],'documentVersion':_0x132b08['version']};_0x4616ea['push'](_0x33b7fa),_0x86cdb2['push']({'type':'document','content':_0x33b7fa['contentRawOld']});}const _0xdeff8d=this['context']['plugins']['get']('AIConnector')['processDocument']({'content':_0x86cdb2,'prompt':_0x4afa64,'model':_0x3a959d['model'],'capabilities':er['getCapabilitiesRequestData'](_0x3a959d['capabilities']),'contexts':new nr(_0x3a959d['contexts'])['toRequestContexts']()});let _0x3d1292;if(_0x3a959d?.['signal']){_0x3a959d['signal']['aborted']&&_0xdeff8d['abortController']['abort']();const _0xadac94=_0x3a959d['signal'],_0x13ca32=()=>_0xdeff8d['abortController']['abort']();_0xadac94['addEventListener']('abort',_0x13ca32),_0x3d1292=()=>_0xadac94['removeEventListener']('abort',_0x13ca32);}const _0x333367=new hr();let _0x31c639=[];try{if(_0x31c639=(await _0xdeff8d['getResult']())['documents'],!(_0x31c639&&_0x31c639['length']>0x0))throw new dt('ai-documentprocessinggateway-empty-reply',this);if(_0x31c639['length']!==_0x86cdb2['length'])throw new dt('ai-documentprocessinggateway-reply-count-mismatch',this,{'expected':_0x86cdb2['length'],'received':_0x31c639['length']});const _0x4924e3=_0x31c639['findIndex'](({document:_0x383290})=>!_0x383290['length']);if(-0x1!==_0x4924e3){const _0x3d4cf6=_0x4616ea[_0x4924e3];throw new dt('ai-documentprocessinggateway-empty-root-content',this,{'channelId':_0x3d4cf6['channelId'],'rootName':_0x3d4cf6['rootName']});}_0x333367['status']='completed';}catch(_0x5e2de8){_0x5e2de8 instanceof Error&&_0x5e2de8['message']['includes']('ai-request-aborted')?_0x333367['abort']():_0x333367['error']=rr(_0x5e2de8,'ai-documentprocessinggateway-run-failed',this);}finally{_0x3d1292&&_0x3d1292();}if('completed'===_0x333367['status'])for(const [_0x56332d,_0x3f2c24]of _0x4616ea['entries']()){const {channelId:_0x4d3186,contentRawOld:_0x5c39cc,documentVersion:_0x4b3086,editor:_0x2cae4c,rootName:_0x23d567,sessionId:_0xff493e}=_0x3f2c24,_0x4a246f=new ar({'channelId':_0x4d3186,'editor':_0x2cae4c,'rootName':_0x23d567,'sessionId':_0xff493e});_0x4a246f['contentRawOld']=_0x5c39cc,_0x4a246f['documentVersion']=_0x4b3086,_0x4a246f['contentRawNew']=_0x31c639[_0x56332d]['document'],_0x4a246f['summary']=_0x31c639[_0x56332d]['summary'],_0x333367['addResult'](_0x4a246f);}return _0x333367;}applyResult(_0x5928e0,_0x3b3d09){this['context']['plugins']['get']('AIGateway')['apply'](_0x5928e0,_0x3b3d09);}};function lr(_0x23ad53){return _0x23ad53 instanceof Error&&('AbortError'===_0x23ad53['name']||('AICoreError'===_0x23ad53['name']?!0x0===_0x23ad53['isAbort']:_0x23ad53['message']['startsWith']('ai-request-aborted')));}var ur=class extends Error{['code'];severity;type;context;isAbort;constructor(_0x2088ea){super(_0x2088ea['code'],_0x2088ea['cause']instanceof Error?{'cause':_0x2088ea['cause']}:void 0x0),this['name']='AICoreError',this['code']=_0x2088ea['code'],this['severity']=_0x2088ea['severity']??'error',this['type']=_0x2088ea['type']??'system',this['context']=_0x2088ea['context'],this['isAbort']=_0x2088ea['isAbort']??lr(_0x2088ea['cause']);}},dr=class extends _0x4f3978{static get['pluginName'](){return'AIErrorSink';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}createReporter(_0x1dfbc8){return new _r(this,_0x1dfbc8);}},_r=class{['_sink'];_component;constructor(_0x18a571,_0xc0ecaf){this['_sink']=_0x18a571,this['_component']=_0xc0ecaf;}['logError'](_0x2ad80a,_0x4fc56e={}){this['_emit'](_0x2ad80a,_0x4fc56e),this['_defaultLog'](_0x2ad80a);}reportError(_0x36c5e2,_0x2d6d94={}){this['_emit'](_0x36c5e2,_0x2d6d94);}_emit(_0x409957,_0x5884dd){if(lr(_0x409957))return;const _0x2e148a=_0x409957 instanceof ur?_0x409957:void 0x0,_0x14ff25=_0x2e148a?.['context']||_0x5884dd['context']?{..._0x2e148a?.['context'],..._0x5884dd['context']}:void 0x0;this['_sink']['fire']('error',{'error':_0x409957,'component':this['_component'],'code':_0x2e148a?.['code'],'type':_0x2e148a?.['type'],'severity':_0x2e148a?.['severity'],'context':_0x14ff25});}_defaultLog(_0x1d9cec){if(!lr(_0x1d9cec)){if(_0x1d9cec instanceof ur){if('user'===_0x1d9cec['type']||'network'===_0x1d9cec['type'])return;if('warning'===_0x1d9cec['severity'])return void console['warn'](this['_component'],_0x1d9cec);}console['error'](this['_component'],_0x1d9cec);}}};const gr='ck-ai-button-primary\x20ck-button-action',Ir='ck-ai-button-secondary\x20ck-button_outline',Ar='ck-ai-button-tertiary',Er='ck-ai-button-surface\x20ck-button_surface',pr='ck-button_small',mr='ck-button_standard';function Tr(_0x3e8887,_0x2ff1f1){const _0x1d4363=new _0x1b12df(_0x3e8887),_0x257c70=qs(_0x3e8887,'AI_TABS_LABEL_MINIMIZE'),_0x25d85d=qs(_0x3e8887,'AI_TABS_LABEL_MAXIMIZE');return _0x1d4363['set']({'withText':!0x1,'icon':_0x3c5ba5,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-button_small\x20'+Ar}),_0x1d4363['bind']('label')['to'](_0x2ff1f1,'isMaximized',_0x5f48ff=>_0x5f48ff?_0x257c70:_0x25d85d),_0x1d4363['bind']('icon')['to'](_0x2ff1f1,'isMaximized',_0x463409=>_0x463409?_0x52c31f:_0x3c5ba5),_0x1d4363['bind']('isOn')['to'](_0x2ff1f1,'isMaximized'),_0x1d4363['on']('execute',()=>{_0x2ff1f1['fire']('resizeTabs');}),_0x1d4363;}function wr({changeGroups:_0x5cd44f,documentContextContent:_0x2ecb8b,showDiff:_0x197684,trimUnchanged:_0x238db3=!0x0}){const _0x46e3f3=fn(_0x5cd44f,_0x2ecb8b);return _0x5cd44f['map'](_0x3fbe00=>{if(!_0x3fbe00['editor']||'destroyed'===_0x3fbe00['editor']['state'])return null;const _0x548455=En(_0x3fbe00['editor'],_0x3fbe00['rootName']),_0xe60cfa=new _0x52d767([]),_0x5486bb=new _0x52d767([]),_0x3d062f=new Set();for(const _0x585ff0 of _0x3fbe00['changes'])'new'==_0x585ff0['type']&&rn('data-id',null,_0x585ff0['node'])['forEach'](_0x2809b8=>{_0x3d062f['add'](ln(_0x2809b8,'data-id'));});for(const _0x358e86 of _0x3fbe00['changes'])if('removed'!=_0x358e86['type']?_0x5486bb['children']['push'](_0x358e86['node']['cloneNode'](!0x0)):_0x197684||_0x3d062f['has'](_0x358e86['id'])||_0x5486bb['children']['push'](_0x358e86['node']['cloneNode'](!0x0)),'new'!=_0x358e86['type']&&(_0x197684||'removed'!=_0x358e86['type'])){const _0x4e87fd=_0x4cc400(_0x5951ba=>ln(_0x5951ba,'data-id')==_0x358e86['id'],_0x2ecb8b['get'](_0x3fbe00['documentId']),!0x0);_0x4e87fd&&_0xe60cfa['children']['push'](_0x4e87fd['cloneNode'](!0x0));}if(_0x548455&&_0x46e3f3['has'](_0x3fbe00['index']))return{'type':_0x3fbe00['changes'][0x0]['type'],'index':_0x3fbe00['index'],'state':_0x3fbe00['state'],'outdatedReason':_0x3fbe00['outdatedReason'],'content':new _0x52d767([]),'hasChanges':!0x1};let _0x3d568e,_0x531b3b,_0x374723;try{({content:_0x3d568e,hasChanges:_0x531b3b}=function(_0x3fe2c9,_0x23d912,_0x231812,_0x58e0a1,_0x3617d9=!0x0){const _0x1ea762=_0x3fe2c9['plugins']['get']('DocumentChanges'),_0x2e27e9=sn(_0x23d912),_0x3798f9=sn(_0x231812),_0x52d7d1=_0x3fe2c9['data']['parse'](_0x2e27e9,'$root'),_0x24616f=_0x3fe2c9['model']['createPositionAt'](_0x52d7d1,0x0),_0x449496=_0x1ea762['getDiff'](_0x2e27e9,_0x3798f9,{'anchor':_0x24616f,'markDeletions':_0x58e0a1,'targetEditor':_0x3fe2c9});if(0x0==_0x449496['length'])return{'content':_0x23d912['cloneNode'](!0x0),'hasChanges':!0x1};_0x58e0a1?function(_0x35f723,_0x37bbff,_0x5c444e){if(0x0==_0x35f723['length'])return;const _0x4961aa=_0x5c444e['plugins']['get']('DocumentChanges'),_0x37b5a3=_0x5c444e['plugins']['get']('SuggestionsConversion');_0x5c444e['model']['change'](_0xcf68ec=>{const _0x27d721=new Set();for(let _0x33db54=0x0;_0x33db54<_0x35f723['length'];_0x33db54++){const _0x31c6e6=_0x35f723[_0x33db54];if(_0x31c6e6['baseVersion']=null,_0x31c6e6['isDocumentOperation']=!0x1,!_0x2b9cbb(_0x31c6e6)){if(_0x4961aa['isMarkedRemoveOperation'](_0x31c6e6)){const _0x52bf99=_0x307024(_0x31c6e6['newRange'],_0x5c444e['model']),_0x580c23='suggestion:deletion:'+Xt()+':$aiSuggestion';_0x37bbff['markers']['set'](_0x580c23,_0x52bf99);}else switch(_0x31c6e6['type']){case'rename':{if(_0x31c6e6['oldName']==_0x31c6e6['newName'])break;_0xcf68ec['batch']['addOperation'](_0x31c6e6),_0x5c444e['model']['applyOperation'](_0x31c6e6);const _0x353732='$elementName',_0x2101d2=_0x31c6e6['position'],_0x1eb327=_0x5c444e['model']['createRange'](_0x2101d2,_0x5c444e['model']['createPositionAt'](_0x2101d2['nodeAfter'],'end')),_0x1ec191='suggestion:attribute:'+_0x353732+':'+Xt()+':$aiSuggestion';_0x37bbff['markers']['set'](_0x1ec191,_0x1eb327);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x31c6e6['oldValue']==_0x31c6e6['newValue'])break;_0xcf68ec['batch']['addOperation'](_0x31c6e6),_0x5c444e['model']['applyOperation'](_0x31c6e6);const _0x397d3a=_0x31c6e6['key'];if(!_0x37b5a3['isRegisteredAttribute'](_0x397d3a))break;const _0x59ea3a=_0x307024(_0x31c6e6['range'],_0x5c444e['model']),_0x31e121='suggestion:attribute:'+_0x397d3a+':'+Xt()+':$aiSuggestion';_0x37bbff['markers']['set'](_0x31e121,_0x59ea3a);break;}case'insert':{if(_0xcf68ec['batch']['addOperation'](_0x31c6e6),_0x5c444e['model']['applyOperation'](_0x31c6e6),Cr(_0x37bbff,_0x31c6e6),_0x35f723[_0x33db54+0x1]&&'move'==_0x35f723[_0x33db54+0x1]['type'])break;const _0x5551f4=_0x31c6e6['position'],_0x41636d=_0x31c6e6['howMany'],_0x3e1d94=_0x307024(_0x5c444e['model']['createRange'](_0x5551f4,_0x5551f4['getShiftedBy'](_0x41636d)),_0x5c444e['model']),_0xda67fb='suggestion:insertion:'+Xt()+':$aiSuggestion';_0x37bbff['markers']['set'](_0xda67fb,_0x3e1d94);break;}case'split':{_0xcf68ec['batch']['addOperation'](_0x31c6e6),_0x5c444e['model']['applyOperation'](_0x31c6e6),Cr(_0x37bbff,_0x31c6e6);const _0x4b5f41=_0x31c6e6['splitPosition'],_0x24fbc6=_0x31c6e6['moveTargetPosition'],_0x5be604=_0x5c444e['model']['createRange'](_0x4b5f41,_0x24fbc6),_0x2af8b6='suggestion:insertion:'+Xt()+':$aiSuggestion';_0x37bbff['markers']['set'](_0x2af8b6,_0x5be604);break;}case'move':{_0xcf68ec['batch']['addOperation'](_0x31c6e6),_0x5c444e['model']['applyOperation'](_0x31c6e6),Cr(_0x37bbff,_0x31c6e6);const _0x3745da=_0x31c6e6['getMovedRangeStart'](),_0x4e4bfc=_0x31c6e6['howMany'];for(let _0x4ec41c=0x0;_0x4ec41c<_0x4e4bfc;_0x4ec41c++){const _0x1dc3cb=_0x3745da['getShiftedBy'](_0x4ec41c)['nodeAfter'];_0x27d721['add'](_0x1dc3cb);}break;}case'remove':{const _0x550a60=_0x31c6e6['sourcePosition'],_0x55ddc4=_0x31c6e6['howMany'],_0xe62891=new _0x3961c2(_0x550a60,_0x55ddc4);_0xcf68ec['batch']['addOperation'](_0xe62891),_0x5c444e['model']['applyOperation'](_0xe62891),Cr(_0x37bbff,_0x31c6e6);break;}}}}for(const _0x5c0f0e of _0x27d721){const _0x162cbf=_0x5c444e['model']['createRangeOn'](_0x5c0f0e),_0x34a29d='suggestion:formatBlock:$fakeWrap:'+Xt()+':$aiSuggestion';_0x37bbff['markers']['set'](_0x34a29d,_0x307024(_0x162cbf,_0x5c444e['model']));}});}(_0x449496,_0x52d7d1,_0x3fe2c9):_0x3fe2c9['model']['change'](_0x5ee381=>{for(const _0x2a2583 of _0x449496)if(!_0x2b9cbb(_0x2a2583)){if('remove'==_0x2a2583['type']){const _0x7f67ce=_0x2a2583['sourcePosition'],_0x5d5347=_0x2a2583['howMany'],_0x1e1a52=new _0x3961c2(_0x7f67ce,_0x5d5347);_0x5ee381['batch']['addOperation'](_0x1e1a52),_0x3fe2c9['model']['applyOperation'](_0x1e1a52),Cr(_0x52d7d1,_0x2a2583);}else{if('marker'==_0x2a2583['type']){const _0x54277a=_0x2a2583['name'],_0x2789de=_0x2a2583['newRange'];null!==_0x2789de?_0x52d7d1['markers']['set'](_0x54277a,_0x2789de):_0x52d7d1['markers']['delete'](_0x54277a);}else _0x2a2583['baseVersion']=null,_0x2a2583['isDocumentOperation']=!0x1,_0x5ee381['batch']['addOperation'](_0x2a2583),_0x3fe2c9['model']['applyOperation'](_0x2a2583),Cr(_0x52d7d1,_0x2a2583);}}});if(_0x3617d9){const _0x92098=fr(_0x3fe2c9,_0x449496,_0x52d7d1);br(_0x3fe2c9['model'],_0x92098),function(_0x4488c0,_0x142676){const _0x35fde2=_0x142676['getFirstRange']()['start'];let _0x373985=_0x142676['getFirstRange']()['end'];const _0x5894e1=_0x35fde2['root'];(_0x373985['textNode']||_0x373985['nodeAfter']&&_0x373985['nodeAfter']['is']('$text'))&&(_0x367b34(_0x373985,'...'),vr(_0x5894e1,_0x373985,0x3),_0x373985=_0x373985['getShiftedBy'](0x3)),(_0x35fde2['textNode']||_0x35fde2['nodeBefore']&&_0x35fde2['nodeBefore']['is']('$text'))&&(_0x367b34(_0x35fde2,'...'),vr(_0x5894e1,_0x35fde2,0x3),_0x35fde2['parent']==_0x373985['parent']&&(_0x373985=_0x373985['getShiftedBy'](0x3)));const _0x187cdc=_0x4488c0['createRange'](_0x4488c0['createPositionAt'](_0x5894e1,0x0),_0x35fde2),_0x3ea9ba=_0x4488c0['createRange'](_0x373985,_0x4488c0['createPositionAt'](_0x5894e1,'end')),_0x30cb36=[..._0x187cdc['getMinimalFlatRanges'](),..._0x3ea9ba['getMinimalFlatRanges']()];_0x30cb36['reverse']();for(const _0x1490a4 of _0x30cb36)_0x48de72(_0x1490a4),Or(_0x5894e1,_0x1490a4);}(_0x3fe2c9['model'],_0x92098);}return{'content':en(_0x3fe2c9['data']['stringify'](_0x52d7d1,{'showSuggestionHighlights':!0x0})),'hasChanges':!0x0};}(_0x3fbe00['editor'],_0xe60cfa,_0x5486bb,_0x197684,_0x238db3));}catch{return{'type':_0x3fbe00['changes'][0x0]['type'],'index':_0x3fbe00['index'],'state':_0x3fbe00['state'],'outdatedReason':_0x3fbe00['outdatedReason'],'content':new _0x52d767([]),'hasChanges':!0x1};}if(_0x548455){_0x374723=_0x3fbe00['editor']['ui']['getEditableElement'](_0x3fbe00['rootName'])?.['tagName']['toLowerCase']();const _0x43e0e5=_0x3d568e['children']['filter'](_0x350de8);0x1===_0x43e0e5['length']&&(_0x3d568e=new _0x52d767(_0x43e0e5[0x0]['children']));}return{'type':_0x3fbe00['changes'][0x0]['type'],'index':_0x3fbe00['index'],'state':_0x3fbe00['state'],'outdatedReason':_0x3fbe00['outdatedReason'],'content':_0x3d568e,'hasChanges':_0x531b3b,'wrapperTag':_0x374723};})['filter'](_0x47a1c8=>null!==_0x47a1c8);}function Cr(_0x3d5407,_0x1ce231){for(const [_0xa4474a,_0x356bd1]of _0x3d5407['markers']){const _0x2b9533=_0x3e534d['_createFromRanges'](_0x356bd1['getTransformedByOperation'](_0x1ce231));_0x2b9533['root']==_0x3d5407?_0x3d5407['markers']['set'](_0xa4474a,_0x2b9533):_0x3d5407['markers']['delete'](_0xa4474a);}}function fr(_0x51c707,_0x310e9b,_0x178823){const _0x37e73d=_0x51c707['plugins']['get']('DocumentChanges');let _0x2efc95=_0x51c707['model']['createPositionAt'](_0x178823,Number['POSITIVE_INFINITY']),_0x1a25e9=_0x51c707['model']['createPositionAt'](_0x178823,0x0);for(const _0x132a3a of _0x310e9b){let _0x32b93d,_0x1926b2;if(_0x37e73d['isMarkedRemoveOperation'](_0x132a3a))_0x32b93d=_0x132a3a['newRange']['start'],_0x1926b2=_0x132a3a['newRange']['end'];else switch(_0x2efc95=Rr(_0x2efc95,_0x132a3a),_0x1a25e9=Rr(_0x1a25e9,_0x132a3a),_0x132a3a['type']){case'rename':_0x32b93d=_0x132a3a['position'],_0x1926b2=_0x32b93d['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x32b93d=_0x132a3a['range']['start'],_0x1926b2=_0x132a3a['range']['end'];break;case'insert':_0x32b93d=_0x132a3a['position'],_0x1926b2=_0x32b93d['getShiftedBy'](_0x132a3a['howMany']);break;case'split':_0x32b93d=_0x132a3a['splitPosition'],_0x1926b2=_0x132a3a['moveTargetPosition'];break;case'merge':{const _0x3487d5=_0x132a3a['targetPosition']['path']['slice'](0x0,-0x1);_0x32b93d=_0x51c707['model']['createPositionFromPath'](_0x178823,_0x3487d5),_0x1926b2=_0x32b93d['getShiftedBy'](0x1);break;}case'move':case'remove':{const _0x4af4d5=_0x132a3a['howMany'],_0x1425cf=_0x132a3a['sourcePosition']['_getTransformedByInsertion'](_0x132a3a['targetPosition'],_0x4af4d5),_0x4e535b=_0x132a3a['getMovedRangeStart']();'remove'==_0x132a3a['type']?(_0x32b93d=_0x1425cf,_0x1926b2=_0x1425cf):(_0x32b93d=_0x4e535b,_0x1926b2=_0x4e535b['getShiftedBy'](_0x4af4d5));break;}}_0x32b93d&&_0x32b93d['isBefore'](_0x2efc95)&&(_0x2efc95=_0x32b93d['clone'](),_0x2efc95['stickiness']='toNone'),_0x1926b2&&_0x1926b2['isAfter'](_0x1a25e9)&&(_0x1a25e9=_0x1926b2['clone'](),_0x1a25e9['stickiness']='toNone');}return _0x51c707['model']['createSelection'](_0x51c707['model']['createRange'](_0x2efc95,_0x1a25e9));}function Rr(_0x56c54b,_0x204fcd){return'move'!=_0x204fcd['type']&&'remove'!=_0x204fcd['type']||_0x204fcd['sourceRange']['containsPosition'](_0x56c54b)&&((_0x56c54b=_0x204fcd['sourcePosition']['clone']())['stickiness']='toNone'),_0x56c54b['getTransformedByOperation'](_0x204fcd);}function br(_0x4bbb84,_0x283122){Sr(_0x4bbb84,_0x283122,'forward');const _0x3745df=_0x283122['getFirstRange']();_0x283122['setTo']([]),_0x283122['setTo'](_0x3745df,{'backward':!0x0}),Sr(_0x4bbb84,_0x283122,'backward');}function Sr(_0x1df0fc,_0x1cedb9,_0x49bcda){let _0xb29120=0x14;for(;_0xb29120;){_0x1df0fc['modifySelection'](_0x1cedb9,{'unit':'word','direction':_0x49bcda}),_0xb29120--;const _0x5769a6=_0x1cedb9['focus']['forward'==_0x49bcda?'nodeBefore':'nodeAfter'];if(_0x5769a6&&_0x5769a6['is']('element')&&_0x1df0fc['schema']['isBlock'](_0x5769a6)&&_0x1df0fc['schema']['isObject'](_0x5769a6))break;}}function Or(_0x333986,_0x5b1a6b){for(const [_0x35c3f7,_0x4d01c4]of _0x333986['markers']){const _0x58352c=_0x4d01c4['_getTransformedByDeletion'](_0x5b1a6b['start'],_0x5b1a6b['end']['offset']-_0x5b1a6b['start']['offset']);null!=_0x58352c?_0x333986['markers']['set'](_0x35c3f7,_0x58352c):_0x333986['markers']['delete'](_0x35c3f7);}}function vr(_0x24a6ba,_0x13c4d1,_0x27bf4f){for(let [_0x57b5cf,_0x3dbf65]of _0x24a6ba['markers'])_0x3dbf65=_0x3dbf65['_getTransformedByInsertion'](_0x13c4d1,_0x27bf4f,!0x1)[0x0],_0x24a6ba['markers']['set'](_0x57b5cf,_0x3dbf65);}const yr=/* #__PURE__ -- @preserve */
|
|
30
|
+
mt();var Nr=class extends yr{['id'];interactionId;type;content=new Map();['sources']=[];parsedContent=new Map();parsedMergedContent=new Map();['changeGroups']=[];areActionsDisabled=!0x1;_outdatedReasonByDocumentId;isFromHistory=!0x1;documentContextContent;_documentIdToSource=new Map();['aiResponseParser'];['aiResponseApplier'];['locale'];cachedSuggestionContentParts={'withDiff':[],'withoutDiff':[]};constructor({type:_0x1b6b4b,isDone:_0x28225d=!0x1,isComplete:_0x12c06a,interactionId:_0x3b09ba,areActionsDisabled:_0x1cec4e,outdatedReasonByDocumentId:_0x4b4b3a,isFromHistory:_0x4bc98c=!0x1,documentContextContent:_0x3246da,locale:_0x19f210,id:_0x25fdd4,channelsToEditors:_0x3f733e}){super(),this['id']=_0x25fdd4||Xt(),this['interactionId']=_0x3b09ba,this['type']=_0x1b6b4b,this['areActionsDisabled']=!!_0x1cec4e,this['_outdatedReasonByDocumentId']=_0x4b4b3a,this['isFromHistory']=_0x4bc98c,this['locale']=_0x19f210,this['aiResponseParser']=new Xn(),this['aiResponseApplier']=new Kn(),this['documentContextContent']=new Map(_0x3246da?.['map'](_0x26e08f=>[_0x26e08f['id'],en(_0x26e08f['content'])])||[]),this['_documentIdToSource']=new Map(_0x3246da?.['map'](_0x2088a8=>[_0x2088a8['id'],{'editor':_0x3f733e['get'](_0x2088a8['channelId']),'rootName':_0x2088a8['rootName']}])||[]),this['set']('isDone',_0x28225d),this['set']('isComplete',_0x12c06a??_0x28225d),'text'===this['type']&&this['content']['set']('text','');}appendContent(_0x66b636,_0x37e2a9){const _0x925e3b='text'===this['type']?'text':_0x37e2a9;this['content']['has'](_0x925e3b)||this['content']['set'](_0x925e3b,''),this['content']['set'](_0x925e3b,this['content']['get'](_0x925e3b)+_0x66b636),this['onContentChange'](_0x925e3b);}['done'](_0x2a36ad=!0x0){this['isComplete']=_0x2a36ad,this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}destroy(){this['stopListening']();}setChangeGroupState(_0x406b7e,_0x3cbfa0,_0x508461){this['changeGroups'][_0x406b7e]['state']=_0x3cbfa0,this['changeGroups'][_0x406b7e]['outdatedReason']=_0x508461,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x406b7e,'state':_0x3cbfa0,'outdatedReason':_0x508461});}getContentParts({showDiff:_0x1dbfd3,groupIndex:_0x3f7daa}){const _0x538b9d=this['_getCachedContentParts'](_0x1dbfd3,_0x3f7daa);if(_0x538b9d)return _0x538b9d;let _0x46c39f;if(void 0x0===_0x3f7daa)_0x46c39f=this['changeGroups'];else{const _0x3f4a87=this['changeGroups']['find'](({index:_0x56ba2c})=>_0x56ba2c===_0x3f7daa);if(!_0x3f4a87)throw new dt('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x3f7daa});_0x46c39f=[_0x3f4a87];}const _0x39f7fc=wr({'showDiff':_0x1dbfd3,'changeGroups':_0x46c39f,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x1dbfd3,_0x39f7fc),_0x39f7fc;}_getCachedContentParts(_0x2a8ed3,_0x386e18){const _0x244a33=_0x2a8ed3?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x244a33]['length'])return null;const _0x318fe6=this['cachedSuggestionContentParts'][_0x244a33];if(void 0x0===_0x386e18)return _0x318fe6['length']>0x0&&_0x318fe6['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x2a8ed3,null),null):_0x5bff5d(_0x318fe6);{const _0x1720e5=_0x318fe6['find'](({index:_0x1816aa})=>_0x1816aa===_0x386e18);if(_0x1720e5)return[_0x5bff5d(_0x1720e5)];}return null;}_setCachedContentParts(_0x3dddaf,_0x55866b){const _0x42b167=_0x3dddaf?'withDiff':'withoutDiff';_0x55866b?_0x55866b['forEach'](_0x4add61=>{const _0x4f84f4=this['cachedSuggestionContentParts'][_0x42b167],_0x30ffcd=_0x4f84f4['find'](({index:_0x9b8f54})=>_0x9b8f54===_0x4add61['index']);if(_0x30ffcd){const _0x230517=_0x4f84f4['indexOf'](_0x30ffcd);_0x4f84f4['splice'](_0x230517,0x1,_0x4add61);}else _0x4f84f4['push'](_0x4add61);}):this['cachedSuggestionContentParts'][_0x42b167]['length']=0x0;}onContentChange(_0x48852b){if('modification'===this['type']){if(_0x48852b)this['parsedContent']['set'](_0x48852b,this['aiResponseParser']['parseAndNormalizeHTML'](this['content']['get'](_0x48852b)));else{for(const [_0xe73149,_0x29de9a]of this['content'])this['parsedContent']['set'](_0xe73149,this['aiResponseParser']['parseAndNormalizeHTML'](_0x29de9a));}const _0x139a3b=this['changeGroups'];for(const _0xdcb733 of this['content']['keys']())this['updateChangeGroups'](_0xdcb733);const _0x80e3d4=this['_getDifferentChangeGroups'](_0x139a3b,this['changeGroups']);(_0x80e3d4['length']||this['isDone'])&&(this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0,this['fire']('replyContentUpdated',this,_0x80e3d4));}else this['parsedContent']['set']('text',this['aiResponseParser']['convertMarkdownToHTML'](this['content']['get']('text'))),this['fire']('replyContentUpdated',this);}_getDifferentChangeGroups(_0xbb2f17,_0x485dda){const _0xd3d398=[];for(const _0x35f3a1 of _0x485dda){const _0x5f3e7b=_0xbb2f17[_0x35f3a1['index']];_0x5f3e7b?_0x5f3e7b['changes']['length']!==_0x35f3a1['changes']['length']?_0xd3d398['push'](_0x35f3a1):_0x5f3e7b['changes']['forEach']((_0x3c0dda,_0x5c8649)=>{const _0xbc69b7=_0x35f3a1['changes'][_0x5c8649];_0x3c0dda['id']!==_0xbc69b7['id']&&_0xd3d398['push'](_0x35f3a1);}):_0xd3d398['push'](_0x35f3a1);}return _0xd3d398;}updateChangeGroups(_0x214549){const _0x5ab3c6=this['documentContextContent']['get'](_0x214549),_0x876118=this['parsedContent']['get'](_0x214549);if(!_0x5ab3c6||!_0x876118)return;const _0x1b9f5b=new _0x47f524('p',{},[new _0x47f524('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x2980ba(qs(this['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x5f5110=this['aiResponseApplier']['merge'](_0x876118,_0x5ab3c6['cloneNode'](!0x0),{'cutAfterUnstable':!this['isDone']||!this['isComplete'],'replaceRemovedWith':_0x1b9f5b});this['parsedMergedContent']['set'](_0x214549,_0x5f5110['parsedContent']);let _0x41cae1=[];if(_0x3ddd9a(_0x19f4bb=>{const _0x3ed0f1=ln(_0x19f4bb,'data-id');if(!_0x3ed0f1||!_0xdae1ca(_0x3ed0f1))return!0x1;const _0x540fc6=[_0x19f4bb,..._n(_0x19f4bb)]['at'](-0x2);if(_0x19f4bb!=_0x540fc6){const _0x26e70e=ln(_0x540fc6,'data-id');_0xdae1ca(_0x26e70e)||(_0x41cae1['push']({'node':_0x540fc6,'id':_0x26e70e,'type':'modified'}),_0x5f5110['modifiedNodeIds']['push'](_0x26e70e));}else _0x5f5110['modifiedNodeIds']['includes'](_0x3ed0f1)?_0x41cae1['push']({'node':_0x19f4bb,'type':'modified','id':_0x3ed0f1}):_0x5f5110['newNodeIds']['includes'](_0x3ed0f1)?_0x41cae1['push']({'node':_0x19f4bb,'type':'new','id':_0x3ed0f1,'anchorId':ln(_0x19f4bb['previousSibling'],'data-id')}):_0x41cae1['push']({'node':_0x19f4bb,'type':'removed','id':_0x3ed0f1});return!0x0;},this['parsedMergedContent']['get'](_0x214549)),_0x41cae1=_0x41cae1['filter'](({node:_0x4fe8f9})=>[..._n(_0x4fe8f9),_0x4fe8f9]['every'](_0x1a6877=>!ln(_0x1a6877,'data-unstable'))),this['changeGroups']=this['changeGroups']['filter'](_0xfbeec2=>_0xfbeec2['documentId']!==_0x214549),0x0==_0x41cae1['length'])return;const _0x57f449=[[_0x41cae1[0x0]]];for(let _0x45dc2e=0x1;_0x45dc2e<_0x41cae1['length'];_0x45dc2e++){const _0x1d33b3=_0x57f449[_0x57f449['length']-0x1],_0x4190b4=_0x1d33b3[_0x1d33b3['length']-0x1];_0x41cae1[_0x45dc2e]['node']['previousSibling']==_0x4190b4['node']&&'modified'!=_0x41cae1[_0x45dc2e]['type']&&'modified'!=_0x4190b4['type']?_0x1d33b3['push'](_0x41cae1[_0x45dc2e]):_0x57f449['push']([_0x41cae1[_0x45dc2e]]);}for(const _0x1477f0 of _0x57f449){const _0x3c8fca=_0x1477f0[0x0],_0x359d0e=_0x1477f0[_0x1477f0['length']-0x1],_0x11296b=_0x103d57(_0x3c8fca['node']['previousSibling']);_0x11296b&&_0x1477f0['unshift'](_0x11296b);const _0x3306d7=_0x103d57(_0x359d0e['node']['nextSibling']);_0x3306d7&&_0x1477f0['push'](_0x3306d7);}rn('data-wrapped-id',null,this['parsedMergedContent']['get'](_0x214549))['forEach'](_0x424eb3=>{un(_0x424eb3,'data-wrapped-id',null);});const _0x1a5040=new Map();rn('data-unwrapped-id',null,this['parsedMergedContent']['get'](_0x214549))['forEach'](_0x8cff93=>{const _0x3abe8a=ln(_0x8cff93,'data-unwrapped-id'),_0x561857=ln(_0x8cff93,'data-id');_0x1a5040['set'](_0x561857,_0x3abe8a),un(_0x8cff93,'data-id',_0x3abe8a),un(_0x8cff93,'data-unwrapped-id',null);});for(const _0x3c57cd of _0x41cae1){const _0x214110=_0x1a5040['get'](_0x3c57cd['id']);_0x214110&&(_0x3c57cd['id']=_0x214110);}this['changeGroups']['push'](..._0x57f449['map']((_0x40458e,_0x25faf9)=>{const _0x57ab1c=this['_documentIdToSource']['get'](_0x214549),_0x567172=this['_outdatedReasonByDocumentId']?.['get'](_0x214549),_0x485c87=this['areActionsDisabled']||void 0x0!==_0x567172;return{'changes':_0x40458e,'state':_0x485c87?'outdated':'pending','outdatedReason':_0x485c87?_0x567172:void 0x0,'index':_0x25faf9,'editor':_0x57ab1c['editor'],'rootName':_0x57ab1c['rootName'],'documentId':_0x214549};}));const _0x4cfcb5=Array['from'](this['documentContextContent']['keys']());function _0xdae1ca(_0x38cf05){return _0x5f5110['modifiedNodeIds']['includes'](_0x38cf05)||_0x5f5110['newNodeIds']['includes'](_0x38cf05)||_0x5f5110['removedNodeIds']['includes'](_0x38cf05);}function _0x103d57(_0x448f24){if(_0x448f24&&ln(_0x448f24,'data-id')&&!ln(_0x448f24,'data-unstable')){const _0x123fb2=ln(_0x448f24,'data-id');if(!_0xdae1ca(_0x123fb2))return{'node':_0x448f24,'type':'context','id':_0x123fb2};}return null;}this['changeGroups']['sort']((_0x3f1ea3,_0x3fc17d)=>_0x4cfcb5['indexOf'](_0x3f1ea3['documentId'])-_0x4cfcb5['indexOf'](_0x3fc17d['documentId'])),this['changeGroups']['forEach']((_0x32f49b,_0x338b7c)=>{_0x32f49b['index']=_0x338b7c;});}};const kr=/* #__PURE__ -- @preserve */
|
|
31
|
+
It(),xr=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];var Lr=class extends kr{['id'];['replies']=[];currentReply;['messageId'];actionCallId;currentRequest;connector;isStopped=!0x1;isDestroyed=!0x1;['locale'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;_channelsToEditors;constructor({connector:_0x17c976,locale:_0x5ee271,channelsToEditors:_0x3d6abd}){super(),this['id']=Xt(),this['connector']=_0x17c976,this['isStopped']=!0x0,this['locale']=_0x5ee271,this['_channelsToEditors']=_0x3d6abd||new Map();}async start(){await this['_run']();}async['resume'](_0x2de03c){await this['_run'](_0x2de03c);}async['_run'](_0x32f958){const _0x85d645=[];let _0x5ae278,_0x11464b,_0x4e8dd6,_0x19b5da=!0x1;this['isStopped']=!0x1;try{this['currentRequest']=_0x32f958||this['sendRequest'](),this['fire']('interactionStarted',this);const _0x99d3f8=await this['currentRequest']['getStream']();for await(const _0x1bbecc of _0x99d3f8){if(this['isStopped'])return;if('error'==_0x1bbecc['event'])return void this['fire']('error',{'error':new dt('ai-chat-interaction-error',this)});switch(_0x1bbecc['event']){case'message-metadata':this['messageId']=_0x1bbecc['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x1bbecc['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x1bbecc['data']['conversationTitle'],!0x0);break;case'source':_0x85d645['push'](_0x1bbecc['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'](),_0x5ae278='modification-delta'==_0x1bbecc['event']?'modification':'text',_0x11464b='modification-delta'==_0x1bbecc['event']?_0x1bbecc['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x5ae278&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x5ae278,'interactionId':this['id'],'id':_0x11464b,'channelsToEditors':this['_channelsToEditors'],...'modification-delta'==_0x1bbecc['event']&&{'documentId':_0x1bbecc['data']['documentId']}}),'modification'==_0x5ae278&&(this['currentReply']['sources']=_0x85d645['splice'](0x0))),this['currentReply']['appendContent'](_0x1bbecc['data']['textDelta'],_0x1bbecc['data']['documentId']);break;case'mcp-tool-result':_0x4e8dd6=JSON['parse'](_0x1bbecc['data']['result']),this['_handleToolResultData']({'toolName':_0x1bbecc['data']['toolName'],'data':_0x4e8dd6['data'],'attributes':_0x4e8dd6['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x1bbecc['data']['toolName'],'data':_0x1bbecc['data']['data']});}}_0x19b5da=!0x0;}finally{this['isStopped']||(this['currentReply']&&_0x85d645['length']>0x0&&(this['currentReply']['sources']=_0x85d645['splice'](0x0)),this['_finalizeInteraction'](_0x19b5da),this['fire']('interactionFinished',this));}}stop(){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}getReply(_0x12af32){return this['replies']['find'](_0x43ca92=>_0x43ca92['id']===_0x12af32);}destroy(){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x55cd41=>_0x55cd41['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}createReply(_0x61de6){const _0x15fdfc=this['getDocumentContext'](),_0x37b4ee=new Nr({'locale':this['locale'],'documentContextContent':_0x15fdfc?.['documents'],..._0x61de6});return this['replies']['push'](_0x37b4ee),_0x37b4ee['delegate'](...xr)['to'](this),this['fire']('replyCreated',_0x37b4ee),_0x37b4ee;}setConversationTitle(_0x46283e,_0x37533c=!0x1){this['fire']('setConversationTitle',_0x46283e,_0x37533c);}resetWebSearchState(){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}resetReasoningState(){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}_handleToolResultData(_0x35d734){this['fire']('toolDataReceived',{'type':'result','toolName':_0x35d734['toolName'],'data':structuredClone(_0x35d734['data']||{}),'attributes':structuredClone(_0x35d734['attributes']||{})},this);}_handleToolNotificationData(_0x3d84e9){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x3d84e9['toolName'],'data':structuredClone(_0x3d84e9['data'])},this);}_finalizeInteraction(_0x179e9e=!0x1){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](_0x179e9e),this['currentRequest']=this['currentReply']=void 0x0;}};const Dr=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']]),Pr=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];var Mr=class AIChatContext extends nr{_connector;['_config'];['_ownerId'];constructor({connector:_0xd66665,config:_0x5e839a,ownerId:_0x3c667b}){super(),this['_connector']=_0xd66665,this['_config']=_0x5e839a,this['_ownerId']=_0x3c667b;}init(){this['_pendingContextItems']=new Map(),this['_conversationContextItems']=new Map(),this['_shownLibraryContextRefIds']=new Set(),this['_ongoingUploads']=new Map(),this['_ongoingUploadOperations']=new Map(),this['_setAddContextOptionsDefaultState']();}getPendingContextItems(){return new Map(this['_pendingContextItems']);}async populateFromMessage(_0x420a3c,_0x593d3d,_0x2b974f=new Set()){const _0x293c0b=new Map(),{contextItem:_0x3c3995,unmatchedDocumentIds:_0xb26267}=await this['_populateDocumentContextItem'](_0x420a3c,_0x593d3d);_0x3c3995&&_0x293c0b['set'](_0x3c3995['id'],_0x3c3995);for(const _0x3e03f4 of _0x420a3c){if('document'===_0x3e03f4['type'])continue;const _0x1085a5=await this['_createContextItemFromContent'](_0x3e03f4,_0x2b974f);Vr(_0x1085a5)?this['_hideRepeatedContextReference'](_0x1085a5,_0x2b974f):this['_addToConversationContextItem'](_0x1085a5),_0x293c0b['set'](_0x1085a5['id'],_0x1085a5);}return this['_restoreContextReferencesAttachment'](_0x293c0b,_0x2b974f),{'contextItems':_0x293c0b,'hasUnmatched':_0xb26267['size']>0x0,'unmatchedDocumentIds':_0xb26267};}async _populateDocumentContextItem(_0x32a39c,_0x4119cc){const _0x35ddcb=_0x32a39c['filter'](_0x62036a=>'document'===_0x62036a['type']);if(0x0===_0x35ddcb['length'])return{'unmatchedDocumentIds':new Set()};const _0x121422=_0x35ddcb['map'](_0x30e07d=>_0x30e07d['id']),_0x442682=await this['_connector']['fetchDocuments'](this['_ownerId'],_0x121422)['getDocuments'](),_0x338d73=new Map(_0x442682['map'](_0x39fb0e=>[_0x39fb0e['id'],_0x39fb0e])),_0x24d54f=[],_0x2ccba9=new Set();for(const _0x2e4eec of _0x35ddcb){const _0x99c647=_0x338d73['get'](_0x2e4eec['id']);_0x99c647&&(this['_matchDocumentToRoot'](_0x99c647,_0x4119cc)||_0x2ccba9['add'](_0x99c647['id']),_0x24d54f['push']({'id':_0x99c647['id'],'content':_0x99c647['content'],'version':_0x99c647['attributes']?.['version']??0x0,'sessionId':_0x99c647['attributes']?.['sessionId']??null,'selection':[],'selectionSignature':'','channelId':_0x99c647['attributes']?.['channelId']??_0x4119cc[0x0]?.['config']['get']('collaboration.channelId')??'','rootName':_0x99c647['attributes']?.['rootName']??_0x4119cc[0x0]?.['model']['document']['getRoots']()[0x0]['rootName']??'','editorConfig':_0x2e4eec['editorConfig']}));}const _0x2a0fc1={'id':'current-document','uiId':'current-document','label':'Current\x20document','type':'document','hidden':this['_conversationContextItems']['has']('current-document'),'documents':_0x24d54f};return this['_addToConversationContextItem'](_0x2a0fc1),this['toggleAddCurrentDocumentOptionVisibility'](),{'contextItem':_0x2a0fc1,'unmatchedDocumentIds':_0x2ccba9};}_matchDocumentToRoot(_0x56e8f4,_0xf9343a){const _0x548df1=_0x56e8f4['attributes']?.['channelId'],_0x1a420d=_0x56e8f4['attributes']?.['rootName'];if(_0x548df1&&_0x1a420d){for(const _0x391bb2 of _0xf9343a)if(_0x391bb2['config']['get']('collaboration.channelId')===_0x548df1){for(const _0x4b9750 of _0x391bb2['model']['document']['getRoots']())if('$graveyard'!==_0x4b9750['rootName']&&_0x4b9750['rootName']===_0x1a420d)return{'editor':_0x391bb2,'rootName':_0x4b9750['rootName']};}}}async _createContextItemFromContent(_0x13a3d3,_0x21058f=new Set()){if('mcp-tool-context'===_0x13a3d3['type'])return{'id':_0x13a3d3['id'],'uiId':_0x13a3d3['id'],'label':_0x13a3d3['data']?.['label']||_0x13a3d3['id'],'type':'mcp-tool-context','mcpServerName':_0x13a3d3['mcpServerName'],'toolName':_0x13a3d3['toolName'],'data':_0x13a3d3['data']||{}};const _0x18867d=_0x13a3d3['attributes']?.['resourceId']||(Vr(_0x13a3d3)?_0x13a3d3['id']:void 0x0);return{'id':_0x13a3d3['id'],'uiId':_0x13a3d3['id'],'label':_0x13a3d3['attributes']?.['label']||_0x13a3d3['name']||_0x13a3d3['url']||_0x13a3d3['id'],'type':_0x13a3d3['type'],..._0x18867d?{'resourceId':_0x18867d}:{},...Vr(_0x13a3d3)&&_0x21058f['has'](_0x13a3d3['id'])?{'hidden':!0x0}:{}};}_restoreContextReferencesAttachment(_0x360005,_0x5c88a2){const _0xde0bbd=new Set(),_0x215724=new Set();for(const _0x2e2dca of _0x360005['values']())Vr(_0x2e2dca)&&!_0x5c88a2['has'](_0x2e2dca['id'])&&_0xde0bbd['add'](_0x2e2dca['id']);for(const _0x5d1689 of Array['from'](this['_pendingContextItems']['values']()))Vr(_0x5d1689)&&(_0xde0bbd['has'](_0x5d1689['id'])?_0x215724['add'](_0x5d1689['id']):this['_removeContextItem'](_0x5d1689['uiId']));for(const _0xfaa97d of _0x360005['values']())_0xde0bbd['has'](_0xfaa97d['id'])&&!_0x215724['has'](_0xfaa97d['id'])&&this['_keepContextItemAttached'](_0xfaa97d);}getSentContextItems(){return new Map(this['_conversationContextItems']);}removeFromContext(_0x380eba){this['_pendingContextItems']['get'](_0x380eba)?.['isReadOnly']||this['_removeContextItem'](_0x380eba);}clearPendingContextItems(){if(0x0===this['_pendingContextItems']['size'])return;const _0x3ddc38=Array['from'](this['_pendingContextItems']['values']());for(const _0x464481 of _0x3ddc38)Vr(_0x464481)&&_0x464481['hidden']||(this['_removeContextItem'](_0x464481['uiId']),Vr(_0x464481)&&this['_keepContextItemAttached'](_0x464481));const _0x2658dc=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x2658dc&&this['_keepContextItemAttached'](_0x2658dc);}addToConversationContext(_0x466c4c){for(const _0x1022c2 of _0x466c4c['values']())Vr(_0x1022c2)||this['_addToConversationContextItem'](_0x1022c2);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(_0x1d8629){return Array['from'](_0x1d8629['values']())['flatMap'](_0x6aa834=>this['_mapContextItemToRequestData'](_0x6aa834));}async addFilesToContext(_0x4a409f,_0x16f763,_0x4f9a12='file'){const _0x45e8e1='files-'+Xt();this['_startUploadOperation'](_0x45e8e1);try{await Promise['all'](_0x4a409f['map'](async _0xc43de6=>{const _0x275c32='file-'+Xt(),_0xc0682f=_0x137309(_0xc43de6['name']),_0x24e3ce='file'===_0x4f9a12&&_0xc43de6['type']['startsWith']('image/')?'image':_0x4f9a12;try{this['_addContextItem']({'type':_0x24e3ce,'label':_0x16f763?.['label']||_0xc0682f,'uiId':_0x275c32,'resourceId':_0x16f763?.['resourceId']},!0x0);const _0x36713e=this['_connector']['uploadFile'](this['_ownerId'],_0xc43de6,_0x16f763);this['_ongoingUploads']['set'](_0x275c32,_0x36713e['abortController']);const {id:_0x5b7fb6}=await _0x36713e['getId']();this['_ongoingUploads']['delete'](_0x275c32),this['_finishContextItemLoading']({'type':_0x24e3ce,'id':_0x5b7fb6,'label':_0x16f763?.['label']||_0xc0682f,'uiId':_0x275c32,'resourceId':_0x16f763?.['resourceId']},!0x1);}catch(_0x39c504){if(this['_ongoingUploads']['delete'](_0x275c32),!lr(_0x39c504)){const _0x55ceb6=Dr['get'](_0x39c504['code'])||'ai-chat-file-upload-failed',_0x91cea1=new ur({'code':_0x55ceb6,'cause':_0x39c504,'context':{'fileName':_0xc0682f}});this['fire']('error',{'error':_0x91cea1});}this['_removeContextItem'](_0x275c32);}}));}finally{this['_finishUploadOperation'](_0x45e8e1);}}addCurrentDocumentToContext(_0x5e9007){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x387ba5={'type':'document','uiId':'current-document','label':_0x5e9007,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x387ba5);}getCurrentDocumentContext(){return this['_pendingContextItems']['get']('current-document');}async updateCurrentDocuments(_0x33d9e5,_0x2b3a08){const _0x295160=this['getCurrentDocumentContext']();if(!_0x295160)return;_0x33d9e5['length']>0x1&&_0x33d9e5['some'](_0x396722=>!_0x396722['description'])&&Ft('ai-chat-documents-missing-description');try{const _0x2713f3=(_0x295160['documents']||[])['filter'](_0x30111d=>_0x2b3a08['has'](_0x30111d['channelId']));if(!_0x33d9e5['length'])return void(_0x295160['documents']=_0x2713f3);const _0x2c77f7=await this['_connector']['uploadDocuments'](this['_ownerId'],_0x33d9e5)['getIds']();if(_0x2c77f7['length']!==_0x33d9e5['length']||_0x2c77f7['some'](_0x1fb1f9=>!_0x1fb1f9?.['id'])){const _0x36566f=new dt('ai-chat-document-upload-reply-mismatch',null);return void this['fire']('error',{'error':_0x36566f});}const _0x4293d4=_0x33d9e5['map']((_0x1f8ed6,_0x593ea0)=>{return{'id':_0x2c77f7[_0x593ea0]['id'],'content':_0x1f8ed6['content'],'version':_0x1f8ed6['version'],'sessionId':_0x1f8ed6['sessionId'],'selection':(_0x4e9013=_0x1f8ed6['selections'],_0x4e9013?_0x4e9013['map'](_0x285b68=>({'start':_0x285b68['start'],'end':_0x285b68['end']})):[]),'selectionSignature':_0x1f8ed6['selectionSignature'],'channelId':_0x1f8ed6['channelId'],'rootName':_0x1f8ed6['rootName'],'editorConfig':_0x1f8ed6['editorConfig']};var _0x4e9013;});_0x295160['documents']=[..._0x2713f3,..._0x4293d4];}catch(_0x409dd8){throw new ur({'code':'ai-chat-document-upload-failed','type':'network','cause':_0x409dd8});}}addSelectionToContext(_0x47ac78){this['_addContextItem']({'type':'selection','label':_0x47ac78,'uiId':'selection','content':_0x47ac78});}removeSelectionFromContext(){this['_removeContextItem']('selection');}addLibraryContextToContext(_0x22fa20,_0x4ce0d4){this['_isResourceInContext'](_0x22fa20)||this['_addContextItem']({'type':'context','id':_0x22fa20,'label':_0x4ce0d4||_0x22fa20,'uiId':'context-'+Xt(),'resourceId':_0x22fa20});}async addUrlToContext(_0x93a5c0,_0xcc0269){const _0x471676='url-'+Xt();this['_startUploadOperation'](_0x471676);const _0x2d8855='url-'+Xt();try{this['_addContextItem']({'type':'web-resource','label':_0xcc0269?.['label']||_0x93a5c0,'uiId':_0x2d8855,'resourceId':_0xcc0269?.['resourceId']},!0x0);const _0x2abe56=this['_connector']['uploadUrl'](this['_ownerId'],_0x93a5c0,_0xcc0269);this['_ongoingUploads']['set'](_0x2d8855,_0x2abe56['abortController']);const {id:_0x225c91}=await _0x2abe56['getId']();this['_ongoingUploads']['delete'](_0x2d8855),this['_finishContextItemLoading']({'type':'web-resource','id':_0x225c91,'label':_0xcc0269?.['label']||_0x93a5c0,'uiId':_0x2d8855,'resourceId':_0xcc0269?.['resourceId']},!0x1);}catch(_0x4c3985){this['_ongoingUploads']['delete'](_0x2d8855),lr(_0x4c3985)||this['fire']('error',{'error':new dt('ai-chat-url-upload-failed',this,{'url':_0x93a5c0,'originalError':_0x4c3985}),'url':_0x93a5c0}),this['_removeContextItem'](_0x2d8855);}finally{this['_finishUploadOperation'](_0x471676);}}addToolItemToContext(_0x3486b2){_0x3486b2['id']=_0x3486b2['id']??Xt()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x3486b2['uiId'],_0x3486b2),this['fire']('contextItemAdded',{'contextItem':_0x3486b2,'isLoading':!0x1});}async['loadSourceResources'](_0x3c69d4,_0x4a16db,_0x456dfa){const _0x2687f9=this['_addContextOptionsState']['sources']['find'](_0x4b7b67=>_0x4b7b67['id']===_0x3c69d4);if(!_0x2687f9)return this['fire']('error',{'error':new dt('ai-chat-source-not-found',this,{'sourceId':_0x3c69d4}),'sourceId':_0x3c69d4}),[];try{const _0x3de9e4=(await _0x2687f9['getResources'](_0x4a16db))['map'](_0xcd15a5=>{const _0x13a3ec=this['_isResourceInContext'](_0xcd15a5['id']);return{..._0xcd15a5,'isInContext':_0x13a3ec};});return _0x2687f9['resources']=_0x3de9e4,this['fire']('sourceResourcesLoaded',{'sourceId':_0x3c69d4,'source':_0x2687f9,'resources':_0x3de9e4,'uid':_0x456dfa}),_0x3de9e4;}catch(_0x67fb0d){return this['fire']('error',{'error':new dt('ai-chat-source-resources-load-failed',this,{'sourceId':_0x3c69d4,'originalError':_0x67fb0d}),'sourceId':_0x3c69d4,'sourceLabel':_0x2687f9['label']}),[];}}async addResourceToContext(_0x23071e,_0x1dd7d7){if(this['_isResourceInContext'](_0x1dd7d7['id']))return;if(Vr(_0x1dd7d7))return void this['addLibraryContextToContext'](_0x1dd7d7['id'],_0x1dd7d7['label']);let _0x4a217a=_0x1dd7d7['data'];if(!_0x4a217a&&_0x23071e['getData'])try{_0x4a217a=await _0x23071e['getData'](_0x1dd7d7['id']);}catch(_0x4a059f){return void this['fire']('error',{'error':new dt('ai-chat-resource-load-failed',this,{'resourceId':_0x1dd7d7['id'],'sourceId':_0x23071e['id'],'originalError':_0x4a059f}),'resourceId':_0x1dd7d7['id'],'sourceId':_0x23071e['id']});}if(_0x4a217a)switch(_0x1dd7d7['type']){case'web-resource':if('string'!=typeof _0x4a217a)return void this['fire']('error',{'error':new dt('ai-chat-context-invalid-data',this,{'resourceId':_0x1dd7d7['id'],'sourceId':_0x23071e['id'],'expectedType':'string','actualType':typeof _0x4a217a}),'resourceId':_0x1dd7d7['id'],'sourceId':_0x23071e['id']});await this['addUrlToContext'](_0x4a217a,{'label':_0x1dd7d7['label'],'resourceId':_0x1dd7d7['id']});break;case'file':if(!(_0x4a217a instanceof File))return void this['fire']('error',{'error':new dt('ai-chat-context-invalid-data',this,{'resourceId':_0x1dd7d7['id'],'sourceId':_0x23071e['id'],'expectedType':'File','actualType':typeof _0x4a217a}),'resourceId':_0x1dd7d7['id'],'sourceId':_0x23071e['id']});await this['addFilesToContext']([_0x4a217a],{'label':_0x1dd7d7['label'],'resourceId':_0x1dd7d7['id']});break;case'text':if('object'!=typeof _0x4a217a||!('content'in _0x4a217a)||!('type'in _0x4a217a))return void this['fire']('error',{'error':new dt('ai-chat-context-invalid-data',this,{'resourceId':_0x1dd7d7['id'],'sourceId':_0x23071e['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x4a217a}),'resourceId':_0x1dd7d7['id'],'sourceId':_0x23071e['id']});_0x4a217a=AIChatContext['_convertTextResourceToFile'](_0x4a217a,_0x1dd7d7['label']),await this['addFilesToContext']([_0x4a217a],{'label':_0x1dd7d7['label'],'resourceId':_0x1dd7d7['id']},'text');break;case'mcp-tool-context':break;default:this['fire']('error',{'error':new dt('ai-chat-context-unsupported-type',this,{'resourceId':_0x1dd7d7['id'],'sourceId':_0x23071e['id'],'resourceType':_0x1dd7d7['type']}),'resourceId':_0x1dd7d7['id'],'sourceId':_0x23071e['id']});}else this['fire']('error',{'error':new dt('ai-chat-resource-no-data',this,{'resourceId':_0x1dd7d7['id'],'sourceId':_0x23071e['id']}),'resourceId':_0x1dd7d7['id'],'sourceId':_0x23071e['id']});}addContextSource(_0x298bb7){this['_addContextOptionsState']['sources']['some'](_0x33ae77=>_0x33ae77['id']===_0x298bb7['id'])||(this['_addContextOptionsState']['sources']['push']({..._0x298bb7,'resources':[]}),this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']}));}toggleAddCurrentDocumentOptionVisibility(_0x18e485){if(void 0x0!==_0x18e485)this['_addContextOptionsState']['document']['isHidden']=!_0x18e485;else{const _0x54600e=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x54600e;}this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}static _convertTextResourceToFile(_0x4ebe69,_0x2b6c3c){switch(_0x4ebe69['type']){case'markdown':return new File([_0x4ebe69['content']],_0x2b6c3c,{'type':'text/markdown'});case'html':return new File([_0x4ebe69['content']],_0x2b6c3c,{'type':'text/html'});default:return new File([_0x4ebe69['content']],_0x2b6c3c,{'type':'text/plain'});}}static _mapContextItemToRequestData(_0x45343e){switch(_0x45343e['type']){case'file':case'image':case'text':return[{'type':'file','id':_0x45343e['id']}];case'web-resource':return[{'type':'web-resource','id':_0x45343e['id']}];case'context':return[{'type':'context','id':_0x45343e['id']}];case'document':return _0x45343e['documents']?.['length']?_0x45343e['documents']['map'](({id:_0x3bb13a,editorConfig:_0x1d9c4d,selection:_0x3d9c9e})=>({'type':'document','id':_0x3bb13a,..._0x1d9c4d&&{'editorConfig':_0x1d9c4d},..._0x3d9c9e?.['length']&&{'selection':_0x3d9c9e}})):[];case'mcp-tool-context':{const _0x48bc58=_0x45343e;return[{'type':'mcp-tool-context','mcpServerName':_0x48bc58['mcpServerName'],'toolName':_0x48bc58['toolName'],'data':{..._0x48bc58['data'],'label':_0x48bc58['label']||_0x48bc58['data']?.['label']||_0x48bc58['id']},'id':_0x48bc58['id']}];}default:return[];}}_addContextItem(_0x319ff2,_0x3f3ded=!0x1){if(this['_pendingContextItems']['set'](_0x319ff2['uiId'],_0x319ff2),_0x319ff2['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x319ff2,'isLoading':_0x3f3ded}),'current-document'===_0x319ff2['uiId']&&this['toggleAddCurrentDocumentOptionVisibility'](),_0x319ff2['resourceId']){const _0x19ec9b=this['_findSourceIdsByResourceId'](_0x319ff2['resourceId']);_0x19ec9b&&_0x19ec9b['forEach'](_0x278307=>{this['_updateResourceInContextState'](_0x278307,_0x319ff2['resourceId'],!0x0);});}}_keepContextItemAttached(_0x3d456a){this['_addContextItem']({..._0x3d456a,'isReadOnly':!0x0,'hidden':!0x0});}_removeContextItem(_0x204531){const _0x3b0780=this['_pendingContextItems']['get'](_0x204531),_0x4e5572=this['_ongoingUploads']['get'](_0x204531);if(_0x4e5572&&(_0x4e5572['abort'](),this['_ongoingUploads']['delete'](_0x204531)),_0x3b0780?.['resourceId']){const _0x322a0a=this['_findSourceIdsByResourceId'](_0x3b0780['resourceId']);_0x322a0a&&_0x322a0a['forEach'](_0x1f7bad=>{this['_updateResourceInContextState'](_0x1f7bad,_0x3b0780['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x204531),this['fire']('contextItemRemoved',{'uiId':_0x204531,'type':_0x3b0780?.['type']}),'current-document'===_0x204531&&this['toggleAddCurrentDocumentOptionVisibility']();}_finishContextItemLoading(_0x1700bd,_0x4bb606){if(this['_pendingContextItems']['has'](_0x1700bd['uiId'])&&(this['_pendingContextItems']['set'](_0x1700bd['uiId'],_0x1700bd),this['fire']('contextItemLoadingEnded',{'contextItem':_0x1700bd,'isLoading':_0x4bb606}),_0x1700bd['resourceId'])){const _0x2000e3=this['_findSourceIdsByResourceId'](_0x1700bd['resourceId']);_0x2000e3&&_0x2000e3['forEach'](_0x2815c7=>{this['_updateResourceInContextState'](_0x2815c7,_0x1700bd['resourceId'],!0x0);});}}_addToConversationContextItem(_0x4af1f8){this['_conversationContextItems']['set'](_0x4af1f8['uiId'],_0x4af1f8);}_hideRepeatedContextReference(_0xfdec78,_0x1ab5f4){_0x1ab5f4['has'](_0xfdec78['id'])||(this['_shownLibraryContextRefIds']['has'](_0xfdec78['id'])?_0xfdec78['hidden']=!0x0:this['_shownLibraryContextRefIds']['add'](_0xfdec78['id']));}_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'](_0x4454bb=>({..._0x4454bb,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}_getCustomSourcesInitialState(){return this['_config']?.['sources']?.['map'](_0x5f2564=>({..._0x5f2564,'resources':[]}))??[];}_isResourceInContext(_0x5349cc){for(const _0x2c7d44 of this['_pendingContextItems']['values']())if(_0x2c7d44['resourceId']===_0x5349cc)return!0x0;for(const _0x12e76c of this['_conversationContextItems']['values']())if(_0x12e76c['resourceId']===_0x5349cc)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x506b4a){const _0x10d175=[];for(const _0x1fc8da of this['_addContextOptionsState']['sources'])_0x1fc8da['resources']['find'](_0xe21b5e=>_0xe21b5e['id']===_0x506b4a)&&_0x10d175['push'](_0x1fc8da['id']);return 0x0===_0x10d175['length']?null:_0x10d175;}_updateResourceInContextState(_0x284edb,_0x26bdfc,_0x5aa75a){const _0x4f3ccc=this['_addContextOptionsState']['sources']['find'](_0x3c9ad9=>_0x3c9ad9['id']===_0x284edb);if(!_0x4f3ccc)return;const _0x18329d=_0x4f3ccc['resources']['find'](_0x2bcfac=>_0x2bcfac['id']===_0x26bdfc);_0x18329d&&(_0x18329d['isInContext']=_0x5aa75a,this['fire']('resourceStateChanged',{'sourceId':_0x284edb,'resourceId':_0x26bdfc,'isInContext':_0x5aa75a}));}_startUploadOperation(_0x4b4773){this['_ongoingUploadOperations']['set'](_0x4b4773,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}_finishUploadOperation(_0x1a6621){this['_ongoingUploadOperations']['delete'](_0x1a6621),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}};function Vr(_0x461b68){return'context'===_0x461b68['type'];}var Hr=class extends Lr{['userMessage'];conversationId;contextItems=new Map();capabilities;['model'];attributes;context;constructor(_0x204436){super(_0x204436),this['conversationId']=_0x204436['conversationId'],this['contextItems']=_0x204436['contextItems'],this['capabilities']=_0x204436['capabilities'],this['userMessage']=_0x204436['userMessage'],this['model']=_0x204436['model'],this['attributes']=_0x204436['attributes'],this['context']=_0x204436['context']??new nr();}sendRequest(){const _0x4ee2a7=Mr['mapContextItemsToRequestData'](this['contextItems']),_0x48ad23=this['context']['toRequestParts'](_0x4ee2a7);return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':_0x48ad23,'capabilities':er['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['context']['toMessageAttributes'](this['attributes'])});}getDocumentContext(){return this['contextItems']['get']('current-document');}};const Ur=/* #__PURE__ -- @preserve */
|
|
32
|
+
It();var Br=class extends Ur{['id'];isStarted=!0x1;isFromHistory;interactions=[];currentInteraction;selectedModel;connector;options;_abortReject;_channelsToEditors;_getSessionId;constructor(_0x377604){super(),this['options']=_0x377604,this['connector']=_0x377604['connector'],this['chatModels']=_0x377604['chatModels'],this['id']=_0x377604['conversationId'],this['isFromHistory']=_0x377604['isFromHistory'],this['_channelsToEditors']=_0x377604['channelsToEditors'],this['_getSessionId']=_0x377604['getSessionId'];}async init(_0x5b76f4){try{this['chatContext']=new Mr({'connector':this['connector'],'config':_0x5b76f4,'ownerId':this['id']}),this['chatContext']['delegate'](...Pr)['to'](this),this['chatContext']['init'](),this['options']['contextLibrary']?.['resolveContext']({'feature':'chat','extraContexts':this['options']['extraContexts'],'context':this['chatContext']}),this['chatCapabilities']=new er(),this['chatCapabilities']['delegate'](...tr)['to'](this),this['chatCapabilities']['init']();const _0x36a24f=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x36a24f});const _0x2d7c53=await this['chatModels']['resolveModel'](this['options']['selectedModelId']);_0x2d7c53&&await this['setModel'](_0x2d7c53);}catch(_0x5df022){const _0x2a4f11=new ur({'code':'ai-chat-conversation-init-failed','cause':_0x5df022,'type':'network'});this['fire']('error',{'error':_0x2a4f11});}}async start(){if(this['isStarted'])throw new dt('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new dt('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x16b485}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x16b485,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x32cebb){const _0xfbce9b=new ur({'code':'ai-chat-conversation-start-failed','cause':_0x32cebb,'type':'network','context':{'conversationId':this['id']}});throw this['fire']('error',{'error':_0xfbce9b}),_0xfbce9b;}}async['load'](_0x28d99c){try{const _0x4ea52a=await this['connector']['fetchConversation'](_0x28d99c)['getConversation'](),_0x28fcda=await this['connector']['fetchConversationMessages'](_0x28d99c)['getMessages'](),_0x4b9c55=_0x28fcda[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x4ea52a['id'],'title'in _0x4ea52a?this['fire']('setConversationTitle',_0x4ea52a['title'],!this['isFromHistory']):this['fire']('setConversationTitle','',!this['isFromHistory']),this['selectedModel']=await this['chatModels']['getModel'](_0x4b9c55)??void 0x0,this['fire']('modelSelected',{'selectedModel':this['selectedModel'],'isDisabled':!0x0});const {streamingMessageId:_0x496940}=await this['_processMessagesToInteractions'](_0x28fcda,_0x4b9c55);return _0x496940&&this['currentInteraction']?this['_resumeStream'](_0x496940):this['currentInteraction']=void 0x0,this;}catch(_0x257bca){const _0x12e0d6=new ur({'code':'ai-chat-conversation-init-from-id-failed','cause':_0x257bca,'type':'network','context':{'conversationId':_0x28d99c}});throw this['fire']('error',{'error':_0x12e0d6}),_0x12e0d6;}}async _processMessagesToInteractions(_0x229f4c,_0x9bca3f){let _0x3d7cdb,_0x33b540,_0x262d7f=new Set();for(const _0x3a8b8b of _0x229f4c)if('user'===_0x3a8b8b['role']){const {contextItems:_0x4a5a55,unmatchedDocumentIds:_0x41c1f3}=await this['_extractContextItems'](_0x3a8b8b);_0x262d7f=_0x41c1f3;const _0x4bf1ef={'isReasoningEnabled':Object['hasOwn'](_0x3a8b8b['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x3a8b8b['capabilities'],'webSearch')};_0x3d7cdb=this['createInteraction']({'userMessage':_0x3a8b8b['prompt'],'contextItems':_0x4a5a55,'capabilities':_0x4bf1ef,'modelId':_0x9bca3f,'attributes':_0x3a8b8b['attributes'],'channelsToEditors':this['_channelsToEditors']}),this['currentInteraction']=_0x3d7cdb,_0x33b540=void 0x0,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x3a8b8b['role']&&_0x3d7cdb){if('streaming'===_0x3a8b8b['status']){_0x33b540=_0x3a8b8b['id'];continue;}if('error'===_0x3a8b8b['status'])continue;const _0x3b5c8d=[];for(const _0x1bc45a of _0x3a8b8b['content'])switch(_0x1bc45a['type']){case'text':case'modification':{const _0x23d20b=_0x3d7cdb['getDocumentContext'](),_0x1c62d9=this['_getOutdatedReasonsByDocumentId'](_0x23d20b,_0x262d7f),_0x5861ec=_0x23d20b?.['documents']??[],_0x459731=_0x5861ec['length']>0x0&&_0x5861ec['every'](_0xdde384=>_0x1c62d9['has'](_0xdde384['id']));_0x3d7cdb['currentReply']?.['type']!==_0x1bc45a['type']&&(_0x3d7cdb['currentReply']=_0x3d7cdb['createReply']({'type':_0x1bc45a['type'],'isDone':!0x0,'interactionId':_0x3d7cdb['id'],'areActionsDisabled':_0x459731,'outdatedReasonByDocumentId':_0x1c62d9,'isFromHistory':!0x0,'channelsToEditors':this['_channelsToEditors']}),_0x3b5c8d['length']>0x0&&(_0x3d7cdb['currentReply']['sources']=_0x3b5c8d['splice'](0x0))),_0x3d7cdb['currentReply']['appendContent'](_0x1bc45a['content'],_0x1bc45a['documentId']);break;}case'url':_0x3b5c8d['push'](_0x1bc45a);break;case'mcp-tool-result':{const {data:_0x6b794e,attributes:_0x357d9f}=JSON['parse'](_0x1bc45a['content']);_0x3d7cdb['_handleToolResultData']({'toolName':_0x1bc45a['toolName'],'data':_0x6b794e,'attributes':_0x357d9f});break;}}'cancelled'===_0x3a8b8b['status']&&this['fire']('error',{'interactionId':_0x3d7cdb['id'],'error':new dt('ai-request-aborted',this)});}}return{'streamingMessageId':_0x33b540};}async _resumeStream(_0x22d6d8){if(this['currentInteraction'])try{const _0x1d9082=this['connector']['resumeStream'](this['id'],_0x22d6d8);await this['currentInteraction']['resume'](_0x1d9082);}catch(_0x14ff76){_0x14ff76 instanceof dt&&this['fire']('error',{'interactionId':this['currentInteraction']?.['id'],'error':_0x14ff76});}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}async _extractContextItems(_0x351a4b){return _0x351a4b['content']?this['chatContext']['populateFromMessage'](_0x351a4b['content'],Array['from'](this['_channelsToEditors']['values']()),nr['getDefaultContextIds'](_0x351a4b['attributes'])):{'contextItems':new Map(),'unmatchedDocumentIds':new Set()};}async handleUserInteraction({userMessage:_0x2d0656,attributes:_0x426d7f}){if(!this['isStarted'])throw new dt('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new dt('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x558a3e=new Map(this['getPendingContextItems']()),_0x154c51=this['chatCapabilities']['getCapabilitiesConfig'](),_0x343e1a=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x2d0656,'contextItems':_0x558a3e,'capabilities':_0x154c51,'modelId':_0x343e1a,'attributes':_0x426d7f,'channelsToEditors':this['_channelsToEditors']}),await this['updateCurrentDocumentsInContext'](),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0xbd4a3d){if(_0xbd4a3d instanceof dt)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0xbd4a3d});else{const _0x175951=Dr['get'](_0xbd4a3d['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new dt(_0x175951,null,{'error':_0xbd4a3d})});}}finally{this['stopProcessing']();}}stopProcessing(){this['_abortReject']&&(this['_abortReject'](),this['_abortReject']=void 0x0),this['currentInteraction']&&(this['currentInteraction']['stop'](),this['currentInteraction']=void 0x0);}createInteraction({userMessage:_0x2f1a4d,contextItems:_0x30b3d0,capabilities:_0x30d0a5,modelId:_0x474e0a,attributes:_0x487199,channelsToEditors:_0x3f41a1}){const _0x26fc7c=new Hr({'userMessage':_0x2f1a4d,'contextItems':_0x30b3d0,'capabilities':_0x30d0a5,'conversationId':this['id'],'connector':this['connector'],'locale':this['options']['locale'],'model':_0x474e0a,'attributes':_0x487199,'channelsToEditors':_0x3f41a1,'context':this['chatContext']['isEmpty']?void 0x0:new nr(this['chatContext']['refs'])});return _0x26fc7c['delegate'](...xr)['to'](this),this['interactions']['push'](_0x26fc7c),this['fire']('interactionCreated',_0x26fc7c),_0x26fc7c;}getInteraction(_0x37ab02){return this['interactions']['find'](_0x335361=>_0x335361['id']===_0x37ab02);}removeInteraction(_0x5eeccc){const _0x83edf3=this['getInteraction'](_0x5eeccc);_0x83edf3&&(_0x83edf3['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x83edf3),0x1));}get lastInteraction(){return this['interactions'][this['interactions']['length']-0x1];}cancelLastInteractionStream(){const _0x71a3fb=this['lastInteraction'];_0x71a3fb?.['conversationId']&&_0x71a3fb['messageId']&&this['connector']['cancelStream'](_0x71a3fb['conversationId'],_0x71a3fb['messageId'])['execute']()['catch'](()=>{});}addCurrentDocumentToContext(_0x5cecc8){this['chatContext']['addCurrentDocumentToContext'](_0x5cecc8);}async updateCurrentDocumentsInContext(){if(!this['isCurrentDocumentInContext']())return;const {changedIds:_0x8c195b,unchangedIds:_0x384185}=this['_compareEditorStateWithDocumentContext'](),_0x31128d=new Promise((_0x1466bf,_0x54acad)=>{this['_abortReject']=()=>_0x54acad(new dt('ai-request-aborted',this));}),_0x1e0962=await Promise['race']([this['options']['aiEditing']['getDocumentData'](_0x8c195b),_0x31128d]);await Promise['race']([this['chatContext']['updateCurrentDocuments'](_0x1e0962,_0x384185),_0x31128d]);}_compareEditorStateWithDocumentContext(){const _0x5d1cfd=new Set(),_0x4bc76c=new Set(),_0x513d31=this['options']['aiEditing']['getEditorsVersions'](),_0x42be1d=this['options']['aiEditing']['getEditorsSelections'](),_0x3b6a55=this['chatContext']['getCurrentDocumentContext']()['documents']||[],_0x18487b=new Map(_0x3b6a55['map'](({channelId:_0x3011d5,version:_0x576d38})=>[_0x3011d5,_0x576d38])),_0x1942f1=new Map(_0x3b6a55['map'](({channelId:_0x461a94,selectionSignature:_0x5df91a})=>[_0x461a94,_0x5df91a]));for(const [_0x804e47,_0xd3c5f3]of _0x513d31){const _0x3041ad=_0x42be1d['get'](_0x804e47);_0x18487b['get'](_0x804e47)!=_0xd3c5f3||_0x1942f1['get'](_0x804e47)!=_0x3041ad?_0x5d1cfd['add'](_0x804e47):_0x18487b['has'](_0x804e47)&&_0x4bc76c['add'](_0x804e47);}return{'changedIds':_0x5d1cfd,'unchangedIds':_0x4bc76c};}toggleAddCurrentDocumentOptionVisibility(_0x4c3eb2){this['chatContext']['toggleAddCurrentDocumentOptionVisibility'](_0x4c3eb2);}_getOutdatedReasonsByDocumentId(_0xc078ee,_0x3c2c40){const _0x488c88=new Map();if(!_0xc078ee||!_0xc078ee['documents'])return _0x488c88;for(const _0x436b29 of _0xc078ee['documents']){const _0x169fe9=this['_channelsToEditors']['get'](_0x436b29['channelId']);_0x169fe9&&'destroyed'!==_0x169fe9['state']?_0x436b29['sessionId']!==this['_getSessionId'](_0x169fe9)?_0x488c88['set'](_0x436b29['id'],'session-changed'):_0x3c2c40['has'](_0x436b29['id'])&&_0x488c88['set'](_0x436b29['id'],'content-removed'):_0x488c88['set'](_0x436b29['id'],'editor-removed');}return _0x488c88;}addSelectionToContext(_0xb4475f){this['chatContext']['addSelectionToContext'](_0xb4475f);}removeSelectionFromContext(){this['chatContext']['removeSelectionFromContext']();}addFilesToContext(_0x25b1ab){this['chatContext']['addFilesToContext'](_0x25b1ab);}addUrlToContext(_0x288bcd){this['chatContext']['addUrlToContext'](_0x288bcd);}addToolItemToContext(_0x5a0271){this['chatContext']['addToolItemToContext'](_0x5a0271);}addLibraryContextToContext(_0x48b4f1,_0x9019c1){this['chatContext']['addLibraryContextToContext'](_0x48b4f1,_0x9019c1);}addResourceToContext(_0x30b320,_0xda524f){this['chatContext']['addResourceToContext'](_0x30b320,_0xda524f);}['loadSourceResources'](_0x45cf22,_0x784bf6,_0x4eaa42){return this['chatContext']['loadSourceResources'](_0x45cf22,_0x784bf6,_0x4eaa42);}removeFromContext(_0x50a90c){this['chatContext']['removeFromContext'](_0x50a90c);}setWebSearch(_0x3ef645){this['chatCapabilities']['setWebSearch'](_0x3ef645);}toggleWebSearch(){this['chatCapabilities']['toggleWebSearch']();}setReasoning(_0x13f82d){this['chatCapabilities']['setReasoning'](_0x13f82d);}toggleReasoning(){this['chatCapabilities']['toggleReasoning']();}isCurrentDocumentInContext(){return this['chatContext']['isCurrentDocumentInContext']();}isCurrentDocumentInConversation(){return this['chatContext']['isCurrentDocumentInConversation']();}isSelectionInContext(){return this['chatContext']['isSelectionInContext']();}getPendingContextItems(){return this['chatContext']['getPendingContextItems']();}addDefaultContext(_0x22ee27){_0x22ee27['length']&&this['chatContext']['addDefaultContext'](_0x22ee27);}async setModel(_0x46bfd2){_0x46bfd2?!0x1===await this['chatModels']['isAvailable'](_0x46bfd2)&&(Ft('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x46bfd2}),_0x46bfd2=(await this['chatModels']['getAvailableModels']())[0x0]):(Ft('ai-chat-conversation-set-model-null',{'conversation':this}),_0x46bfd2=(await this['chatModels']['getAvailableModels']())[0x0]),_0x46bfd2['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x46bfd2,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x46bfd2}));}};function Gr({documentSuggestions:_0x1c07a5,transform:_0xca95bc,documentChanges:_0x4cd50c,documentChangesOptions:_0x35fb65}){const _0x539051=new Map();for(const [_0x4ecaac,{groups:_0x21b094,documentContext:_0x2d95a9,documentContent:_0x503baa,editor:_0x487b52}]of _0x1c07a5){const _0x4b58ea=_0x2d95a9['content'],_0x5967db=_0x2d95a9['version'],_0x2985ed=_0x503baa['cloneNode'](!0x0);for(const {changes:_0x21659a}of _0x21b094)Cn(_0x2985ed,_0x21659a);const _0x282b0e=sn(_0x2985ed),_0x506939=Rn(_0x487b52,_0x2d95a9['rootName'],_0x4b58ea,_0x282b0e);if(!_0x506939)continue;const _0x4baec2=_0x4cd50c['getDiff'](_0x506939['before'],_0x506939['after'],{'targetEditor':_0x487b52,'anchor':_0x2d95a9['rootName'],..._0x35fb65});if(_0xca95bc){const _0x809e5f=_0x487b52['model']['document']['history']['getOperations'](_0x5967db),_0x431d85={'document':_0x487b52['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};_0x539051['set'](_0x4ecaac,_0x3d40c6(_0x4baec2,_0x809e5f,_0x431d85)['operationsA']);}else _0x539051['set'](_0x4ecaac,_0x4baec2);}return _0x539051;}function Wr({groups:_0x19cd0a,documentContextContent:_0x8dc570,documents:_0x17494c}){const _0x1b07d8=new Map();for(const _0x5993f4 of _0x19cd0a){const {documentId:_0x584243}=_0x5993f4,_0x39a2cf=_0x1b07d8['get'](_0x584243);if(_0x39a2cf)_0x39a2cf['groups']['push'](_0x5993f4),_0x39a2cf['indexes']['push'](_0x5993f4['index']);else{const _0x255ae7=_0x17494c['find'](_0x589bec=>_0x589bec['id']===_0x584243),_0x46de5f=_0x8dc570['get'](_0x584243);if(!_0x255ae7||!_0x46de5f)continue;_0x1b07d8['set'](_0x584243,{'groups':[_0x5993f4],'documentContext':_0x255ae7,'documentContent':_0x46de5f,'editor':_0x5993f4['editor'],'indexes':[_0x5993f4['index']]});}}return _0x1b07d8;}function Fr(_0x48338e,_0x5ef433){const _0x17d0bc=_0x48338e['files']['length']>0x0&&_0x48338e['files']['every'](_0x47c53e=>_0x47c53e['type']['startsWith']('image/')),_0x47d408=_0x48338e['plainText']['trim']()['length']>0x0;if(_0x48338e['files']['length']>0x0&&_0x5ef433['filesEnabled']&&(!_0x17d0bc||!_0x47d408)){const _0x547dfa=_0x48338e['files']['filter'](_0x13cbc5=>_0x13cbc5['name']);return _0x547dfa['length']>0x0?{'type':'file','files':_0x547dfa}:null;}if(_0x5ef433['urlsEnabled']){const _0x37b62d=function(_0x3be626){const _0x9689fa=_0x3be626['trim']();if(/\s/['test'](_0x9689fa))return null;try{const _0x528241=new URL(_0x9689fa);return'http:'!==_0x528241['protocol']&&'https:'!==_0x528241['protocol']?null:_0x528241['toString']();}catch{return null;}}(_0x48338e['plainText']);if(_0x37b62d)return{'type':'url','url':_0x37b62d};}const _0xe69ca1=_0x48338e['forceTextAttachment']?0x1:_0x5ef433['longTextThreshold']??0x1/0x0;if(_0x48338e['plainText']['length']>=Math['max'](_0xe69ca1,0x1)&&_0x5ef433['filesEnabled']){const _0x5dd11=_0x5ef433['pastedTextLabel']+'.txt';return{'type':'text','files':[new File([_0x48338e['plainText']],_0x5dd11,{'type':'text/plain'})]};}return null;}var Kr=class extends _0x4f3978{activeConversation;_aiEditing;_aiConnector;_aiChatUi;['_aiModels'];_aiContextLibrary;_contextLibrarySource=null;_hasAIChatBalloon=!0x1;_activeBalloon;_reporter;_batchToChanges=new Map();_currentPreviewedChangeGroup=null;_channelsToEditors=new Map();static get requires(){return[$s,dr,Un,Js];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['set']('isConversationReady',!0x1),this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_reporter']=this['context']['plugins']['get'](dr)['createReporter']('aichat'),this['_aiModels']=this['context']['plugins']['get'](Js)['models'],this['_aiContextLibrary']=this['context']['plugins']['get'](Js)['contextLibrary'];const _0x53e063=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x15895d,_0x3c1c83)=>{this['sendMessage']({'message':_0x3c1c83});}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',()=>{this['activeConversation']?.['stopProcessing']();}),this['listenTo'](_0x53e063['view'],'change:activeTab',(_0x9fc5e7,_0x4d767,_0x28593b)=>{'chat'!==_0x28593b&&this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['addCurrentDocumentToChatContext']();}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x49bf51,_0x23ff23)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x23ff23));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x593527,_0x20b49f)=>{this['activeConversation']?.['addUrlToContext'](_0x20b49f);}),this['listenTo'](this['_aiChatUi'],'promptInputPaste',(_0x2c83ce,_0x13a56f)=>{const _0x236256=this['activeConversation'];if(!_0x236256)return;_0x13a56f['hasDirectory']&&(_0x13a56f['preventDefault'](),this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_CONTEXT_FOLDER_NOT_SUPPORTED'),'id':'folder-error-'+Xt()}));const _0x3386b3=Fr(_0x13a56f,{'pastedTextLabel':qs(this['context']['locale'],'AI_CHAT_CONTEXT_PASTED_TEXT_NAME'),'longTextThreshold':this['context']['config']['get']('ai.chat.context.paste.textThreshold'),'filesEnabled':!0x1!==this['context']['config']['get']('ai.chat.context.files.enabled'),'urlsEnabled':!0x1!==this['context']['config']['get']('ai.chat.context.urls.enabled')});_0x3386b3&&(_0x13a56f['preventDefault'](),'url'===_0x3386b3['type']?_0x236256['addUrlToContext'](_0x3386b3['url']):_0x236256['chatContext']['addFilesToContext'](_0x3386b3['files'],void 0x0,_0x3386b3['type']));}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x3226e4,_0x7ae023)=>{_0x7ae023['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0xb64931,_0x386cee)=>{this['activeConversation']?.['addResourceToContext'](_0x386cee['source'],_0x386cee['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x19e718,_0x45d62d)=>{this['_removeFromContext'](_0x45d62d);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x3cb427,_0x3678ba)=>{this['activeConversation']?.['loadSourceResources'](_0x3678ba['sourceId'],_0x3678ba['query'],_0x3678ba['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x1499bd,_0x5a7419)=>{this['activeConversation']?.['setModel'](_0x5a7419);}),this['listenTo'](this['_aiChatUi'],'like',(_0x1dfb22,{replyId:_0x2ea2d9})=>{console['log']('Liked\x20response',_0x2ea2d9);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x1b7f89,{replyId:_0x480f9c})=>{console['log']('Disliked\x20response',_0x480f9c);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x236b7c,_0x200022)=>{this['_insertSuggestion'](_0x200022);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x11c250,{replyId:_0xa86c5c,partIndex:_0xbf6d32})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0xa86c5c,_0xbf6d32);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x1e88d7,{replyId:_0x5c48e3,partIndex:_0x117b67})=>{const _0x164aa6=this['_getDocumentRangeForReplyChanges'](_0x5c48e3,_0x117b67);if(!_0x164aa6)return;const {reply:_0x5b9f55}=this['getInteractionAndReplyById'](_0x5c48e3);'$graveyard'!=_0x164aa6['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'editor':_0x5b9f55['changeGroups'][_0x117b67]['editor'],'ranges':[_0x164aa6['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x5ec679,_0x153be3)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x153be3);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x4f4d81,{replyId:_0x367511,showDiff:_0x3721ac})=>{const {interaction:_0xa6879,reply:_0x380e69}=this['getInteractionAndReplyById'](_0x367511),_0x442349=_0x380e69['getContentParts']({'showDiff':_0x3721ac});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0xa6879['id']+':'+_0x380e69['id'],'parts':_0x442349});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x34b188,{replyId:_0xb48bcc,partIndex:_0x37f4f})=>{this['_rejectSuggestion']({'replyId':_0xb48bcc,'partIndex':_0x37f4f}),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['set']('_aiChatBalloonShowDiff',!0x1),this['on']('interactionCreated',(_0x4ddfc6,_0x335382)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x335382);}),this['on']('replyCreated',(_0x1e4904,_0x484af5)=>{this['_addFeedItemReply'](_0x484af5);});}afterInit(){this['context']instanceof _0xfb41df?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x2487c2,_0x36f05b)=>{_0x36f05b['on']('ready',()=>{this['_integrateEditor'](_0x36f05b);});}),this['context']['config']['get']('ai.chat.context')?.['contextLibrary']?.['enabled']&&this['_setUpContextLibrarySource'](),this['_initConversation']();}async _initConversation(){const _0x308733=this['context']['config']['get']('ai.chat.initialConversation');let _0x3355a7=_0x308733;try{if('lastCreated'==_0x308733&&(_0x3355a7=await this['_getLastCreatedConversationId'](),!_0x3355a7))return;'new'==_0x3355a7?await this['_startConversationSafely']():(this['context']['plugins']['get'](Ks)['view']['activateTab']('chat'),await this['loadConversation'](_0x3355a7)),await this['_aiChatUi']['idleUiPromise'];}finally{this['_aiChatUi']['toggleLoadingSkeleton'](!0x1,'init');}}async destroy(){return this['_stopLastInteraction'](),super['destroy']();}async loadConversation(_0x148819){this['_closeActiveBalloon'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0,'conversation'),this['_detachFromActiveConversation'](),this['_stopLastInteraction'](),this['_aiChatUi']['toggleConversationLoading'](!0x0);try{this['_aiChatUi']['emptyConversationTitle'](),await this['_aiConnector']['fetchConversation'](_0x148819)['getConversation'](),await this['_startConversationSafely']({'id':_0x148819}),await this['activeConversation']['load'](_0x148819),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext'](),this['set']('isConversationReady',!0x0),this['activeConversation']?.['currentInteraction']?this['_aiChatUi']['enableControls']():this['_aiChatUi']['toggleConversationLoading'](!0x1);}catch(_0x1e4aaa){this['_aiChatUi']['resetConversationTitle'](),this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x148819}),this['_reporter']['logError'](new dt('ai-chat-conversation-not-found',this,void 0x0,_0x1e4aaa),{'context':{'operation':'load-conversation'}}),await this['_stopLastInteraction'](),this['_aiChatUi']['disableControls'](),this['set']('isConversationReady',!0x1),this['_aiChatUi']['resetChatBusyStateToIdle'](),this['activeConversation']?.['cancelLastInteractionStream']();}finally{this['_aiChatUi']['startAutoScroll']({'smooth':!0x1}),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1,'conversation');}}registerToolDataCallback(_0x4d493d){let _0x44dcdc=null,_0x1d2ec4=null;this['on']('toolDataReceived',(_0x387fe5,_0x4a5890,_0x162501)=>{_0x162501['id']!==_0x44dcdc&&(_0x44dcdc=_0x162501['id'],_0x1d2ec4=this['_getAIChatFeedAPI'](_0x162501)),_0x4d493d(_0x4a5890,_0x1d2ec4);});}addCurrentDocumentToChatContext(){Zs(this['context'])['length']&&this['activeConversation']?.['addCurrentDocumentToContext'](qs(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async addSelectionToChatContext(_0x401ec2){const _0x26d213=this['_aiEditing']['getSelectionText'](_0x401ec2);this['activeConversation']?.['addSelectionToContext'](_0x26d213),this['addCurrentDocumentToChatContext']();}removeSelectionFromChatContext(){this['activeConversation']?.['removeSelectionFromContext']();}addLibraryContextToChatContext(_0x5211b4,_0x4566dc){this['activeConversation']?.['addLibraryContextToContext'](_0x5211b4,_0x4566dc);}focusPromptInput(){this['_aiChatUi']['focusPromptInput']();}async startConversation(_0x36bdb3){await this['_startConversationSafely']({'modelId':_0x36bdb3?.['modelId'],'contexts':_0x36bdb3?.['contexts']});}async['sendMessage']({message:_0x5494e5,attributes:_0x3d3b95}){if(!this['activeConversation'])throw new dt('ai-chat-controller-no-active-conversation');this['activeConversation']['id']&&this['activeConversation']['isStarted']&&(this['_aiChatUi']['startInteraction'](),await this['activeConversation']['handleUserInteraction']({'userMessage':_0x5494e5,'attributes':_0x3d3b95}));}getGroupId(){const _0x245249=this['context']['config']['get']('collaboration.channelId');if(!_0x245249)throw new dt('ai-missing-channel-id',this);return _0x245249;}_handleRemovedConversation(_0x4ef60b){this['activeConversation']['id']===_0x4ef60b&&this['_startConversationSafely']();}['_isGroupReadOnly'](_0x4efa2e){return!(!_0x4efa2e['editor']||'destroyed'===_0x4efa2e['editor']['state']||!_0x4efa2e['editor']['isReadOnly']);}_isGroupWriteable(_0xc06770){return!(!_0xc06770['editor']||'destroyed'===_0xc06770['editor']['state']||_0xc06770['editor']['isReadOnly']);}_computeSuggestionGating(_0x2f3eea){const _0x5f3334=new Map();for(const _0x337435 of _0x2f3eea['changeGroups'])_0x5f3334['set'](_0x337435['index'],this['_isGroupReadOnly'](_0x337435));const _0x348303=new Set(_0x2f3eea['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']})['filter'](_0x20157e=>_0x20157e['hasChanges'])['map'](_0x2805c8=>_0x2805c8['index']));return{'readOnlyByIndex':_0x5f3334,'isAcceptAllEnabled':_0x2f3eea['changeGroups']['some'](_0x11855a=>'pending'===_0x11855a['state']&&this['_isGroupWriteable'](_0x11855a)&&_0x348303['has'](_0x11855a['index']))};}_refreshSuggestionGating(){if(this['activeConversation']){for(const _0x5c9005 of this['activeConversation']['interactions'])for(const _0x4fc5ef of _0x5c9005['replies'])'modification'===_0x4fc5ef['type']&&this['_aiChatUi']['hasFeedItem'](_0x4fc5ef['id'])&&this['_aiChatUi']['setSuggestionGating'](_0x4fc5ef['id'],this['_computeSuggestionGating'](_0x4fc5ef));}if(this['_activeBalloon']&&this['_currentPreviewedChangeGroup']){const {reply:_0xc12354}=this['getInteractionAndReplyById'](this['_currentPreviewedChangeGroup']['replyId']),_0x320efb=_0xc12354['changeGroups']['find'](_0x3cd578=>_0x3cd578['index']===this['_currentPreviewedChangeGroup']['partIndex']);_0x320efb&&this['_activeBalloon']['setTargetReadOnly'](this['_isGroupReadOnly'](_0x320efb));}}_prepareDocumentSuggestions(_0x2b4de1){const {reply:_0x320bff,interaction:_0x126f5d}=this['getInteractionAndReplyById'](_0x2b4de1['replyId']),_0x13659f=void 0x0!==_0x2b4de1['partIndex']?[_0x320bff['changeGroups'][_0x2b4de1['partIndex']]]:_0x320bff['changeGroups']['filter'](_0x3c902f=>'pending'===_0x3c902f['state']&&!this['_isGroupReadOnly'](_0x3c902f)),_0x10bf6e=_0x13659f['map'](_0x525110=>_0x320bff['changeGroups']['indexOf'](_0x525110)),_0x40058a=fn(_0x320bff['changeGroups'],_0x320bff['documentContextContent']);return _0x10bf6e['forEach'](_0x601c89=>{if(_0x40058a['has'](_0x601c89))return;const _0x22afaf=this['_getDocumentRangeForReplyChanges'](_0x2b4de1['replyId'],_0x601c89);_0x22afaf&&'$graveyard'!=_0x22afaf['range']['root']['rootName']?(_0x320bff['setChangeGroupState'](_0x601c89,'accepted'),void 0x0!==_0x2b4de1['partIndex']&&this['_scrollToSuggestionRange'](_0x22afaf['range'],!0x1,_0x22afaf['targetEditor'])):_0x320bff['setChangeGroupState'](_0x601c89,'outdated',this['_getOutdatedReason'](_0x320bff['changeGroups'][_0x601c89]));}),Wr({'groups':_0x13659f['filter'](_0x1d00ad=>'accepted'===_0x1d00ad['state']),'documentContextContent':_0x320bff['documentContextContent'],'documents':_0x126f5d['getDocumentContext']()?.['documents']??[]});}_insertSuggestion(_0x267ffd){const _0x171930=this['context']['plugins']['get'](Un),{reply:_0x148466,interaction:_0x2e4a1f}=this['getInteractionAndReplyById'](_0x267ffd['replyId']),_0x2c6f61=this['_prepareDocumentSuggestions'](_0x267ffd),_0x19f106=Gr({'documentSuggestions':_0x2c6f61,'transform':!0x0,'documentChanges':_0x171930,'documentChangesOptions':{'markDeletions':!0x0}});for(const [_0x51e8ac,_0x27e90c]of _0x19f106){const {editor:_0xaa4635,indexes:_0x3d5ca2}=_0x2c6f61['get'](_0x51e8ac);if(!_0xaa4635['plugins']['has']('TrackChanges')){Ft('ai-no-track-changes',{'editor':_0xaa4635});continue;}let _0x1cbc78;jn(_0x27e90c,'chat'),_0xaa4635['model']['change'](_0x2c435d=>{_0x1cbc78=_0x2c435d['batch'],_0xaa4635['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x27e90c),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x1cbc78,{'interactionId':_0x2e4a1f['id'],'replyId':_0x148466['id'],'indexes':_0x3d5ca2});}this['_updateRatings'](_0x148466);}_applySuggestion(_0x567e0a){const _0x240334=this['context']['plugins']['get'](Un),{reply:_0x2eea78,interaction:_0x390ade}=this['getInteractionAndReplyById'](_0x567e0a['replyId']),_0x1a1c47=this['_prepareDocumentSuggestions'](_0x567e0a),_0x2922e9=Gr({'documentSuggestions':_0x1a1c47,'transform':!0x0,'documentChanges':_0x240334,'documentChangesOptions':{'markDeletions':!0x1}});for(const [_0x1772d9,_0x1f22ef]of _0x2922e9){const {editor:_0x3703b0,indexes:_0x2f17e5}=_0x1a1c47['get'](_0x1772d9);let _0x47dc0e;jn(_0x1f22ef,'chat');try{_0x3703b0['model']['change'](_0x596a0a=>{_0x47dc0e=_0x596a0a['batch'],_0x240334['applyOperations'](_0x596a0a,_0x1f22ef);}),this['_batchToChanges']['set'](_0x47dc0e,{'interactionId':_0x390ade['id'],'replyId':_0x2eea78['id'],'indexes':_0x2f17e5});}catch(_0x424475){throw this['_reporter']['logError'](new ur({'code':'ai-applying-suggestion-failed','type':'runtime','cause':_0x424475})),_0x424475;}}this['_updateRatings'](_0x2eea78);}_rejectSuggestion(_0x4f172b){const {reply:_0x53d949}=this['getInteractionAndReplyById'](_0x4f172b['replyId']);_0x53d949['setChangeGroupState'](_0x4f172b['partIndex'],'rejected');}['_openBalloonFor'](_0xfdc5cb,_0x768468){if(!this['_hasAIChatBalloon'])return;const {reply:_0x343b14}=this['getInteractionAndReplyById'](_0xfdc5cb),_0x425e13=_0x343b14['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(!_0x425e13['length'])return;let _0x357c8c,_0x123868;if(void 0x0!==_0x768468?(_0x123868=_0x425e13['find'](_0x31c81b=>_0x31c81b['index']==_0x768468),_0x357c8c=_0x123868?.['index']):(_0x123868=_0x425e13[0x0],_0x357c8c=_0x123868['index']),!_0x123868)return void _0x343b14['setChangeGroupState'](_0x768468??0x0,'outdated','editor-removed');if(this['_currentPreviewedChangeGroup']?.['replyId']==_0xfdc5cb&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x357c8c)return;const _0x556559=this['_getUserPresentableContentPartDocumentRange'](_0xfdc5cb,_0x343b14,_0x123868),_0x81e215=_0x343b14['changeGroups']['find'](_0x2bcb51=>_0x2bcb51['index']==_0x357c8c),_0x119079=_0x81e215['editor'],_0x51b08a=_0x119079['plugins']['get']('AIChatBalloon');if(this['_activeBalloon']&&this['_activeBalloon']!==_0x51b08a&&this['_activeBalloon']['close'](),!_0x556559)return _0x51b08a['close'](),void(this['_activeBalloon']=void 0x0);this['_activeBalloon']=_0x51b08a,this['_currentPreviewedChangeGroup']={'replyId':_0xfdc5cb,'partIndex':_0x357c8c},this['_scrollToSuggestionRange'](_0x556559,!0x0,_0x119079);const _0x25ecf6=this['_getPresentableSiblingContentPartIndex'](_0xfdc5cb,_0x357c8c,'next');_0x51b08a['clearContent'](),_0x51b08a['updateContent']({'part':_0x123868,'renderingStrategy':'static'});const _0x4652b0=_0x425e13['filter'](_0x1acb47=>_0x1acb47['hasChanges']),_0x4283d2=this['_aiChatUi']['getFeedItemAIReplySuggestionPartUIIndex']({'id':_0xfdc5cb,'index':_0x357c8c})??_0x4652b0['findIndex'](_0x4656c0=>_0x4656c0['index']==_0x357c8c)+0x1;_0x51b08a['open']({'index':_0x357c8c,'title':qs(this['context']['locale'],'AI_CHAT_BALLOON_HEADER_TITLE',[_0x4283d2['toString'](),_0x4652b0['length']['toString']()]),'showRotator':null!==_0x25ecf6,'ranges':[_0x556559],'areActionsDisabled':_0x343b14['areActionsDisabled'],'targetEditor':_0x119079,'isTargetReadOnly':this['_isGroupReadOnly'](_0x81e215)}),_0x51b08a['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0xfdc5cb,_0x357c8c),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0xfdc5cb,'index':_0x357c8c,'isActive':!0x0});}_closeActiveBalloon(){this['_activeBalloon']?.['close'](),this['_activeBalloon']=void 0x0,this['_currentPreviewedChangeGroup']=null;}_getPresentableSiblingContentPartIndex(_0x41805e,_0x15c0c8,_0x5371f7){const {reply:_0x49fd06}=this['getInteractionAndReplyById'](_0x41805e),_0x3487d4=_0x49fd06['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x3487d4['length'])return null;const _0x3e0e66='next'==_0x5371f7?0x1:-0x1;function _0x1d00cc(_0x2c1228){const _0x41e043=(_0x2c1228+_0x3e0e66+_0x3487d4['length'])%_0x3487d4['length'];return{'siblingIndex':_0x41e043,'siblingPart':_0x3487d4[_0x41e043]};}const _0x152992=_0x3487d4['findIndex'](_0x5c695f=>_0x5c695f['index']==_0x15c0c8);let {siblingIndex:_0x3de7a3,siblingPart:_0x5a518b}=_0x1d00cc(_0x152992);for(;!this['_getUserPresentableContentPartDocumentRange'](_0x41805e,_0x49fd06,_0x5a518b);)if({siblingIndex:_0x3de7a3,siblingPart:_0x5a518b}=_0x1d00cc(_0x3de7a3),_0x3de7a3===_0x152992)return null;return _0x5a518b['index'];}_getOutdatedReason(_0x4bdc28){return _0x4bdc28?.['editor']&&'destroyed'!==_0x4bdc28['editor']['state']?'content-removed':'editor-removed';}_getUserPresentableContentPartDocumentRange(_0x181b41,_0x249a35,_0x35fb0c){const _0x344782=_0x249a35['changeGroups'];if(!_0x35fb0c['hasChanges'])return null;const _0x15160b=_0x344782['find'](_0xf623f5=>_0xf623f5['index']==_0x35fb0c['index']);if('pending'!==_0x15160b?.['state'])return null;if(!_0x15160b?.['editor']||'destroyed'===_0x15160b['editor']['state'])return _0x249a35['setChangeGroupState'](_0x35fb0c['index'],'outdated',this['_getOutdatedReason'](_0x15160b)),null;const _0x759083=this['_getDocumentRangeForReplyChanges'](_0x181b41,_0x35fb0c['index']);if(!_0x759083)return _0x249a35['setChangeGroupState'](_0x35fb0c['index'],'outdated',this['_getOutdatedReason'](_0x15160b)),null;const {range:_0x2c9c46,currentIndex:_0x592283}=_0x759083;return'$graveyard'==_0x2c9c46['root']['rootName']?(_0x249a35['setChangeGroupState'](_0x592283,'outdated',this['_getOutdatedReason'](_0x15160b)),null):_0x759083['range'];}_getDocumentRangeForReplyChanges(_0x6256a0,_0x1157d6){const {reply:_0x57580a,interaction:_0x26f639}=this['getInteractionAndReplyById'](_0x6256a0),_0x4ecdd7=_0x57580a['changeGroups']['filter'](_0x24b36d=>'pending'==_0x24b36d['state']),_0x32bdeb=_0x4ecdd7['map'](_0x1e1361=>_0x57580a['changeGroups']['indexOf'](_0x1e1361));void 0x0===_0x1157d6&&(_0x1157d6=_0x32bdeb[0x0]);const _0x3a1d38=_0x32bdeb['indexOf'](_0x1157d6);if(-0x1==_0x3a1d38)return null;const _0x43bfd0=_0x4ecdd7[_0x3a1d38],_0x3ca0d8=_0x43bfd0['editor'];if(!_0x3ca0d8||'destroyed'===_0x3ca0d8['state'])return null;const _0x45f950=En(_0x3ca0d8,_0x43bfd0['rootName']),_0xf421a8=_0x57580a['documentContextContent']['get'](_0x43bfd0['documentId']),_0xc06234=new _0x52d767([]),_0x5855a1=new _0x52d767([]);for(const _0x969337 of _0x43bfd0['changes'])if('removed'!=_0x969337['type']&&_0x5855a1['children']['push'](_0x969337['node']['cloneNode'](!0x0)),'new'!=_0x969337['type']){const _0x2ebbd6=_0x4cc400(_0x1ddd9f=>ln(_0x1ddd9f,'data-id')==_0x969337['id'],_0xf421a8,!0x0);_0xc06234['children']['push'](_0x2ebbd6['cloneNode'](!0x0));}if(0x0==_0xc06234['children']['length']){if(_0x43bfd0['changes'][0x0]['anchorId']){const _0x2993de=nn('data-id',_0x43bfd0['changes'][0x0]['anchorId'],_0xf421a8);_0xc06234['children']['unshift'](_0x2993de['cloneNode'](!0x0)),_0x5855a1['children']['unshift'](_0x2993de['cloneNode'](!0x0)),_0x2993de['nextSibling']&&(_0xc06234['children']['push'](_0x2993de['nextSibling']['cloneNode'](!0x0)),_0x5855a1['children']['push'](_0x2993de['nextSibling']['cloneNode'](!0x0)));}else{const _0x4a6dba=_0xf421a8['children'][0x0];if(!_0x4a6dba)return null;_0xc06234['children']['push'](_0x4a6dba['cloneNode'](!0x0)),_0x5855a1['children']['push'](_0x4a6dba['cloneNode'](!0x0));}}if(_0x45f950&&fn(_0x57580a['changeGroups'],_0x57580a['documentContextContent'])['has'](_0x43bfd0['index']))return null;const _0x1468cc=_0x26f639['getDocumentContext'](),_0x273f2b=_0x1468cc['documents']['find'](_0x175262=>_0x175262['id']==_0x43bfd0['documentId'])['content'],_0x38c7c5=_0x3ca0d8['model']['document']['getRoot'](_0x43bfd0['rootName']),_0x4c95cb=_0x3ca0d8['data']['parse'](_0x273f2b,_0x38c7c5),_0x44a119=_0x45f950?Tn(sn(_0xc06234)):sn(_0xc06234),_0x26a75d=_0x3ca0d8['data']['parse'](_0x44a119,_0x38c7c5),_0x5128f6=_0x3ca0d8['data']['parse'](_0x44a119,_0x38c7c5),_0x439b97=_0x3ca0d8['model']['createPositionAt'](_0x26a75d,0x0),_0x8cb5d=_0x45f950?Tn(sn(_0x5855a1)):sn(_0x5855a1),_0x12f7df={'targetEditor':_0x3ca0d8,'anchor':_0x439b97,'markDeletions':!0x1};let _0xeb2320;try{_0xeb2320=_0x3ca0d8['plugins']['get'](Un)['getDiff'](_0x44a119,_0x8cb5d,_0x12f7df);}catch(_0x355ab2){return this['_reporter']['reportError'](new ur({'code':'ai-chat-suggestion-diff-failed','type':'runtime','severity':'warning','cause':_0x355ab2,'context':{'replyId':_0x6256a0,'partIndex':_0x1157d6}})),null;}if(!_0xeb2320['length'])return null;_0x3ca0d8['model']['change'](_0x27e7e5=>{for(const _0x436d4d of _0xeb2320)if(!_0x2b9cbb(_0x436d4d)){if('remove'==_0x436d4d['type']){const _0x3c00d5=_0x436d4d['sourcePosition'],_0x106bfe=_0x436d4d['howMany'],_0x232591=new _0x3961c2(_0x3c00d5,_0x106bfe);_0x27e7e5['batch']['addOperation'](_0x232591),_0x3ca0d8['model']['applyOperation'](_0x232591);}else'marker'!==_0x436d4d['type']&&(_0x436d4d['baseVersion']=null,_0x436d4d['isDocumentOperation']=!0x1,_0x27e7e5['batch']['addOperation'](_0x436d4d),_0x3ca0d8['model']['applyOperation'](_0x436d4d));}});const _0x35c713=fr(_0x3ca0d8,_0xeb2320,_0x26a75d);br(_0x3ca0d8['model'],_0x35c713);const _0x4a3d46=_0x35c713['getFirstRange']()['start']['path']['slice'](),_0x26f45d=_0x35c713['getFirstRange']()['end']['path']['slice'](),_0x8de393=[];let _0x1531d5=_0x26a75d,_0x51b1ae=_0x5128f6;for(let _0x2b0eaa=0x0;_0x2b0eaa<_0x26f45d['length'];_0x2b0eaa++){const _0x4b6b76=_0x1531d5['maxOffset']-_0x26f45d[_0x2b0eaa];_0x8de393[_0x2b0eaa]=_0x51b1ae['maxOffset']-_0x4b6b76,_0x1531d5=_0x1531d5['getChildAtOffset'](_0x26f45d[_0x2b0eaa]),_0x51b1ae=_0x51b1ae['getChildAtOffset'](_0x8de393[_0x2b0eaa]);}const _0x1473cc=_0x3ca0d8['model']['createRange'](_0x3ca0d8['model']['createPositionFromPath'](_0x5128f6,_0x4a3d46),_0x3ca0d8['model']['createPositionFromPath'](_0x5128f6,_0x8de393)),_0x4c34b5=_0x1473cc['start']['path']['slice'](),_0x344849=_0x1473cc['end']['path']['slice']();if(!_0x45f950){const _0xe073f5=_0x5128f6['getChild'](0x0)['getAttribute'](Vn),_0x342d6f=Array['from'](_0x4c95cb['getChildren']())['find'](_0x3e1cec=>_0x3e1cec['getAttribute'](Vn)==_0xe073f5)['getPath']();_0x4c34b5[0x0]=_0x342d6f[0x0]+_0x4c34b5[0x0],_0x344849[0x0]=_0x342d6f[0x0]+_0x344849[0x0];}let _0x65bbd9=_0x3ca0d8['model']['createRange'](_0x3ca0d8['model']['createPositionFromPath'](_0x3ca0d8['model']['document']['getRoot'](_0x43bfd0['rootName']),_0x4c34b5),_0x3ca0d8['model']['createPositionFromPath'](_0x3ca0d8['model']['document']['getRoot'](_0x43bfd0['rootName']),_0x344849));const _0x2120e6=_0x1468cc['documents']['find'](_0x36e983=>_0x36e983['id']==_0x43bfd0['documentId'])['version'],_0x2294fd=_0x3ca0d8['model']['document']['history']['getOperations'](_0x2120e6);for(const _0x523330 of _0x2294fd)_0x65bbd9=_0x3e534d['_createFromRanges'](_0x65bbd9['getTransformedByOperation'](_0x523330));return{'range':_0x65bbd9,'currentIndex':_0x1157d6,'targetEditor':_0x3ca0d8};}_integrateEditorBalloon(_0x5d9993){if(!_0x5d9993['plugins']['has']('AIChatBalloon'))return;const _0x57cbd1=_0x5d9993['plugins']['get']('AIChatBalloon');this['_hasAIChatBalloon']=!0x0,_0x57cbd1['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](_0x57cbd1,'toggleSuggestionDisplayMode',()=>{const {replyId:_0x249cf7,partIndex:_0x1cf091}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x5986c7}=this['getInteractionAndReplyById'](_0x249cf7),_0x3481d7=_0x5986c7['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x1cf091});_0x57cbd1['updateContent']({'part':_0x3481d7[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](_0x57cbd1,'applySuggestion',()=>{const {replyId:_0x3ea8d1,partIndex:_0x260eeb}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x3ea8d1,'partIndex':_0x260eeb}),_0x57cbd1['setState']('accepted');}),this['listenTo'](_0x57cbd1,'insertSuggestion',()=>{const {replyId:_0x4320cf,partIndex:_0x58b681}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x4320cf,'partIndex':_0x58b681}),_0x57cbd1['setState']('accepted');}),this['listenTo'](_0x57cbd1,'rejectSuggestion',()=>{const {replyId:_0x2f2e1e,partIndex:_0x36ee45}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x2f2e1e,'partIndex':_0x36ee45}),_0x57cbd1['setState']('rejected');}),this['listenTo'](_0x57cbd1,'showNext',()=>{const {replyId:_0x1083f3,partIndex:_0x2593f7}=this['_currentPreviewedChangeGroup'],_0x4de460=this['_getPresentableSiblingContentPartIndex'](_0x1083f3,_0x2593f7,'next');null!==_0x4de460&&this['_openBalloonFor'](_0x1083f3,_0x4de460);}),this['listenTo'](_0x57cbd1,'showPrevious',()=>{const {replyId:_0x4f248e,partIndex:_0x48ecba}=this['_currentPreviewedChangeGroup'],_0x368f3c=this['_getPresentableSiblingContentPartIndex'](_0x4f248e,_0x48ecba,'previous');null!==_0x368f3c&&this['_openBalloonFor'](_0x4f248e,_0x368f3c);}),this['listenTo'](_0x57cbd1,'dialogClosed',(_0x43d4f7,{id:_0x2f6b15})=>{if('aiChatBalloon'!==_0x2f6b15)return;const {replyId:_0x5c20a1,partIndex:_0x30a425}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x5c20a1,'index':_0x30a425,'isActive':!0x1}),this['_activeBalloon']===_0x57cbd1&&(this['_activeBalloon']=void 0x0);});}_integrateEditor(_0x29f9dc){if(this['_channelsToEditors']['set'](_0x29f9dc['config']['get']('collaboration.channelId'),_0x29f9dc),this['_integrateEditorBalloon'](_0x29f9dc),this['addCurrentDocumentToChatContext'](),this['listenTo'](_0x29f9dc,'change:isReadOnly',()=>this['_refreshSuggestionGating']()),_0x29f9dc['once']('destroy',()=>{this['_checkRemoveCurrentDocumentFromChatContext']();}),_0x29f9dc['plugins']['has']('Undo')){const _0x183c51=_0x29f9dc['commands']['get']('undo'),_0x2a2709=_0x29f9dc['commands']['get']('redo');this['listenTo'](_0x183c51,'revert',(_0x4581a7,_0x541d86,_0xb0f20d)=>{const _0x39c0ad=this['_batchToChanges']['get'](_0x541d86);if(!_0x39c0ad)return;const _0x32d83b=this['activeConversation']['getInteraction'](_0x39c0ad['interactionId']),_0x1cefc7=_0x32d83b?.['getReply'](_0x39c0ad['replyId']);this['_batchToChanges']['delete'](_0x541d86),_0x32d83b&&_0x1cefc7&&(_0x39c0ad['indexes']['forEach'](_0x46ca5e=>_0x1cefc7['setChangeGroupState'](_0x46ca5e,'pending')),this['_batchToChanges']['set'](_0xb0f20d,_0x39c0ad));}),this['listenTo'](_0x2a2709,'revert',(_0x3999ba,_0x43698e,_0xe819c2)=>{const _0x2214cd=this['_batchToChanges']['get'](_0x43698e);if(!_0x2214cd)return;const _0x20a3e7=this['activeConversation']['getInteraction'](_0x2214cd['interactionId']),_0x3eef76=_0x20a3e7?.['getReply'](_0x2214cd['replyId']);this['_batchToChanges']['delete'](_0x43698e),_0x20a3e7&&_0x3eef76&&(_0x2214cd['indexes']['forEach'](_0x2ecd13=>_0x3eef76['setChangeGroupState'](_0x2ecd13,'accepted')),this['_batchToChanges']['set'](_0xe819c2,_0x2214cd));});}const _0x2ec2c5=_0x29f9dc['config']['get']('ai.chat.context');_0x2ec2c5['alwaysAddSelection']&&_0x2ec2c5['document']['enabled']&&this['listenTo'](_0x29f9dc['model']['document']['selection'],'change:range',(_0x146873,_0x4078dd)=>{_0x4078dd['directChange']&&'chat'===_0x29f9dc['plugins']['get']('AITabs')['view']['activeTab']&&(_0x29f9dc['model']['hasContent'](_0x29f9dc['model']['document']['selection'])?this['addSelectionToChatContext'](_0x29f9dc):this['removeSelectionFromChatContext']());});}async _getLastCreatedConversationId(){const _0x1f3b94=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x499c99=await _0x1f3b94['getConversations']();return _0x499c99['length']?_0x499c99[0x0]['id']:'new';}catch(_0x42ca1b){return this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':Xt()}),this['_reporter']['logError'](new dt('ai-chat-conversation-init-failed',this,{'error':_0x42ca1b})),this['_aiChatUi']['disableControls'](),null;}}async _startConversationSafely(_0x442279={}){this['set']('isConversationReady',!0x1);try{await this['_handleStartConversation'](_0x442279),_0x442279['id']||this['set']('isConversationReady',!0x0);}catch(_0x361971){this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x442279['id']||Xt()}),this['_reporter']['logError'](_0x361971),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}_detachFromActiveConversation(){this['_aiChatUi']['setIsUploadInProgress'](!0x1),this['activeConversation']&&this['stopListening'](this['activeConversation']);}async _handleStartConversation({id:_0xe7d05c,modelId:_0x1a33fc,contexts:_0x3e7996}={}){this['_detachFromActiveConversation'](),this['_closeActiveBalloon']();let _0x40023c=_0x1a33fc;_0x40023c||(_0xe7d05c||!this['activeConversation']?_0x40023c=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x40023c=this['activeConversation']['selectedModel']?.['id'])),this['_stopLastInteraction']();const _0x145ca3=this['getGroupId'](),_0x47ea75=_0xe7d05c||Xt(),_0x2fdc62=await this['_aiModels']['getAvailableModels']();let _0x5f3212;this['activeConversation']=new Br({'connector':this['_aiConnector'],'chatModels':this['_aiModels'],'selectedModelId':_0x40023c,'conversationId':_0x47ea75,'group':_0x145ca3,'locale':this['context']['locale'],'isFromHistory':!!_0xe7d05c,'channelsToEditors':this['_channelsToEditors'],'contextLibrary':this['_aiContextLibrary'],'extraContexts':_0x3e7996,'getSessionId':_0x2bf60e=>this['_aiEditing']['getSessionId'](_0x2bf60e),'aiEditing':this['_aiEditing']}),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','interactionStarted','replyCreated')['to'](this),this['listenTo'](this['activeConversation'],'conversationInitialized',()=>{this['_aiChatUi']['createConversation']({'availableModels':_0x2fdc62}),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0xe7d05c||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['listenTo'](this['activeConversation'],'uploadProgressChanged',(_0x315099,_0x45410f)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x45410f['isUploadInProgress']);}),this['listenTo'](this['activeConversation'],'webSearchStarted',()=>{const _0x4a7287=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x4a7287);}),this['listenTo'](this['activeConversation'],'reasoningStarted',()=>{const _0x38b2d3=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x38b2d3);}),this['listenTo'](this['activeConversation'],'webSearchFinished',(_0x36d84f,_0x19355d)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x19355d,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['listenTo'](this['activeConversation'],'reasoningFinished',(_0x3bfaba,_0x4c0c1d)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x4c0c1d,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['listenTo'](this['activeConversation'],'interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['listenTo'](this['activeConversation'],'interactionFinished',async()=>{this['_updateReplyContentThrottled']['flush'](),await this['_aiChatUi']['finishInteraction']();}),this['listenTo'](this['activeConversation'],'interactionDestroyed',(_0x42e9e8,_0x28d57a)=>{this['_aiChatUi']['removeFeedInteraction'](_0x28d57a['id']);}),this['listenTo'](this['activeConversation'],'setConversationTitle',(_0x41ff0f,_0x10403a,_0x191904)=>{this['_updateConversationTitle'](_0x10403a,_0x191904);}),this['listenTo'](this['activeConversation'],'replyContentUpdated',async(_0x52e601,_0x3c549b)=>{void 0x0!==_0x5f3212&&_0x5f3212!==_0x3c549b['id']&&this['_updateReplyContentThrottled']['flush'](),_0x5f3212=_0x3c549b['id'],_0x3c549b['isFromHistory']?await this['_updateReplyContent']({'reply':_0x3c549b}):await this['_updateReplyContentThrottled']({'reply':_0x3c549b});}),this['listenTo'](this['activeConversation'],'replyChangeGroupStateUpdated',(_0x150554,{reply:_0x28f985,index:_0x148f5b,state:_0x358621,outdatedReason:_0x542541})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x28f985['id'],'index':_0x148f5b,'state':_0x358621,'outdatedReason':_0x542541}),this['_aiChatUi']['hasFeedItem'](_0x28f985['id'])&&this['_aiChatUi']['setSuggestionGating'](_0x28f985['id'],this['_computeSuggestionGating'](_0x28f985)),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x28f985['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x148f5b&&this['_activeBalloon']?.['setState'](_0x358621,_0x542541);}),this['listenTo'](this['activeConversation'],'contextItemAdded',(_0x39e77b,_0x4103e1)=>{if(this['_aiChatUi']['addContextItem'](_0x4103e1['contextItem'],_0x4103e1['isLoading']),'selection'===_0x4103e1['contextItem']['type']){const _0x12d4fd=tn(this['context']),_0x8cdd1d=[..._0x12d4fd['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'editor':_0x12d4fd,'ranges':_0x8cdd1d,'id':'context','priority':0x1});}}),this['listenTo'](this['activeConversation'],'contextItemRemoved',(_0x45a945,_0x143736)=>{this['_aiChatUi']['removeContextItem'](_0x143736['uiId']),'current-document'==_0x143736['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x143736['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['listenTo'](this['activeConversation'],'contextItemLoadingEnded',(_0x360f93,_0x1944f4)=>{this['_aiChatUi']['setContextItemLoading'](_0x1944f4['contextItem']['uiId'],_0x1944f4['isLoading']);}),this['listenTo'](this['activeConversation'],'contextSent',(_0x2c0295,_0x3b1ba1)=>{this['_aiChatUi']['setConversationContext'](_0x3b1ba1['contextItems']);}),this['listenTo'](this['activeConversation'],'addContextOptionsChanged',(_0x49f182,_0x370e30)=>{this['_aiChatUi']['setAddContextOptions'](_0x370e30['options']);}),this['listenTo'](this['activeConversation'],'sourceResourcesLoaded',(_0x48f7dd,_0x25c7d4)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x25c7d4['sourceId'],_0x25c7d4['source'],_0x25c7d4['resources'],_0x25c7d4['uid']);}),this['listenTo'](this['activeConversation'],'resourceStateChanged',(_0x193a9a,_0x249864)=>{this['_aiChatUi']['updateResourceState'](_0x249864['sourceId'],_0x249864['resourceId'],_0x249864['isInContext']);}),this['listenTo'](this['activeConversation'],'capabilitiesUpdated',(_0x175858,_0x239f2b)=>{this['_aiChatUi']['updateCapabilities'](_0x239f2b);}),this['listenTo'](this['activeConversation'],'modelSelected',(_0x3154b1,_0x312b33)=>{this['_aiChatUi']['setSelectedModel'](_0x312b33['selectedModel']??null,_0x312b33['isDisabled']);}),this['listenTo'](this['activeConversation'],'error',async(_0x5ce9f5,{error:_0xc896ff,interactionId:_0x1dfd62,fileName:_0x45b9b5,url:_0x338ab0,sourceId:_0x334bea,sourceLabel:_0x5e3dfa})=>{let _0x2a1362;const _0x33f7b2=_0x1dfd62?_0x1dfd62+':'+Xt():Xt();this['_reporter']['reportError'](_0xc896ff),this['_aiChatUi']['startAutoScroll'](),_0xc896ff['message']['startsWith']('ai-request-aborted')?(this['_cancelProcessing'](),this['activeConversation']?.['cancelLastInteractionStream'](),_0x2a1362=this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':qs(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x33f7b2})):_0xc896ff['message']['startsWith']('ai-chat-conversation-init-failed')||_0xc896ff['message']['startsWith']('ai-chat-conversation-start-failed')?_0x2a1362=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x33f7b2}):_0xc896ff['message']['startsWith']('ai-chat-file-upload-failed')?_0x2a1362=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x45b9b5),'id':_0x33f7b2}):_0xc896ff['message']['startsWith']('ai-chat-url-upload-failed')?_0x2a1362=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x338ab0),'id':_0x33f7b2}):_0xc896ff['message']['startsWith']('ai-chat-context-invalid-data')?_0x2a1362=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x33f7b2}):_0xc896ff['message']['startsWith']('ai-chat-context-unsupported-type')?_0x2a1362=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x33f7b2}):_0xc896ff['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x334bea&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x334bea),_0x2a1362=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x5e3dfa||'source'),'id':_0x33f7b2})):_0xc896ff['message']['startsWith']('ai-chat-resource-load-failed')?_0x2a1362=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x33f7b2}):_0xc896ff['message']['startsWith']('ai-chat-invalid-request')?_0x2a1362=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x33f7b2}):_0xc896ff['message']['startsWith']('ai-chat-context-unsupported-file-type')?_0x2a1362=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x33f7b2}):_0xc896ff['message']['startsWith']('ai-chat-context-file-too-large')?_0x2a1362=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x33f7b2}):_0xc896ff['message']['startsWith']('ai-chat-context-file-too-many-pages')?_0x2a1362=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x33f7b2}):_0xc896ff['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?_0x2a1362=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x33f7b2}):(this['_cancelProcessing'](),_0x2a1362=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x33f7b2}));try{await Promise['race']([_0x2a1362,this['_aiChatUi']['idleUiPromise']]);}finally{this['_aiChatUi']['isBusy']||this['_aiChatUi']['stopAutoScroll']();}}),await this['activeConversation']['init'](this['_buildConversationContextConfig']()),_0xe7d05c||(await this['activeConversation']['start'](),this['_aiChatUi']['enableControls']());}_buildConversationContextConfig(){const _0x8c4566=this['context']['config']['get']('ai.chat.context');return this['_contextLibrarySource']?{..._0x8c4566,'sources':[..._0x8c4566?.['sources']??[],this['_contextLibrarySource']]}:_0x8c4566;}async _setUpContextLibrarySource(){const _0x14a01f=await this['_createContextLibrarySource']();_0x14a01f&&(this['_contextLibrarySource']=_0x14a01f,this['activeConversation']&&this['activeConversation']['chatContext']['addContextSource'](_0x14a01f));}async _createContextLibrarySource(){let _0x406e54;try{_0x406e54=await this['_aiContextLibrary']['getAvailableContexts']();}catch{return null;}if(!_0x406e54['length'])return null;const _0xdfb647=_0x406e54['map'](_0x1eb92f=>({'id':_0x1eb92f['id'],'type':'context','label':_0x1eb92f['name']||_0x1eb92f['id']}));return{'id':'ck-ai-context-library','label':qs(this['context']['locale'],'AI_CHAT_CONTEXT_LIBRARY_LABEL'),'useDefaultFiltering':!0x0,'getResources':()=>Promise['resolve'](_0xdfb647)};}_removeFromContext(_0x3e5342){this['activeConversation']?.['removeFromContext'](_0x3e5342);}_toggleWebSearch(){this['activeConversation']?.['toggleWebSearch']();}_toggleReasoning(){this['activeConversation']?.['toggleReasoning']();}getInteractionAndReplyById(_0x5905c0){const [_0x17ee34,_0x497bda]=_0x5905c0['split'](':'),_0x2d19e4=this['activeConversation']['getInteraction'](_0x17ee34);return{'interaction':_0x2d19e4,'reply':_0x2d19e4['getReply'](_0x497bda)};}_scrollToSuggestionRange(_0x1c4296,_0x387609=!0x1,_0x4dfa1e){const _0x2c989c={'target':_0x4dfa1e['editing']['view']['domConverter']['viewRangeToDom'](_0x4dfa1e['editing']['mapper']['toViewRange'](_0x1c4296)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x387609};_0x387609&&(_0x2c989c['alignToTop']=!0x0),Yt(_0x2c989c);}_updateConversationTitle(_0x31aff4,_0x2537a5=!0x1){this['_aiChatUi']['setConversationTitle'](_0x31aff4||qs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x2537a5);}_addFeedItemReply(_0x565ed7){'text'===_0x565ed7['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x565ed7):this['_aiChatUi']['addFeedItemAISuggestion'](_0x565ed7);}async _updateReplyContent({reply:_0x339670,renderingStrategy:_0x1eccbd}){const {id:_0x4cd533,interactionId:_0x38ea1d,isDone:_0x3ed5e1,type:_0x5a89d7,parsedContent:_0x56cc64}=_0x339670,_0x28f190=_0x38ea1d+':'+_0x4cd533;if('modification'===_0x5a89d7){const _0x12d7a2=_0x339670['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x28f190,'parts':_0x12d7a2,'isDone':_0x3ed5e1,'skipLoadingEffects':_0x339670['isFromHistory']}),this['_aiChatUi']['hasFeedItem'](_0x339670['id'])&&this['_aiChatUi']['setSuggestionGating'](_0x339670['id'],this['_computeSuggestionGating'](_0x339670));}else'text'===_0x5a89d7&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x28f190,'parsedContent':_0x56cc64['get']('text'),'renderingStrategy':_0x1eccbd,'isDone':_0x3ed5e1});_0x3ed5e1&&_0x339670['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x28f190,_0x339670['sources']);}_updateReplyContentThrottled=_0x1de37f(this['_updateReplyContent']['bind'](this),0xc8);_stopLastInteraction(){this['activeConversation']?.['stopProcessing'](),this['_aiChatUi']['stopInteraction'](this['activeConversation']?.['lastInteraction']),this['_updateReplyContentThrottled']['cancel']();}async _flushLastInteractionUI(){const _0x180d48=this['activeConversation']?.['lastInteraction'];if(_0x180d48){for await(const _0x37e509 of _0x180d48['replies'])this['_aiChatUi']['hasFeedItem'](_0x37e509['id'])||this['_addFeedItemReply'](_0x37e509),await this['_updateReplyContent']({'reply':_0x37e509,'renderingStrategy':'static'});}}async['_cancelProcessing'](){this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}_updateRatings(_0x15e7b2){const _0x494905={'positiveCount':_0x15e7b2['changeGroups']['filter'](_0x1ab4f6=>'accepted'===_0x1ab4f6['state'])['length'],'totalCount':_0x15e7b2['changeGroups']['length'],'modificationId':_0x15e7b2['id']},_0x43281=this['activeConversation']['getInteraction'](_0x15e7b2['interactionId'])['messageId'];_0x43281&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x43281,_0x494905);}_getAIChatFeedAPI(_0x233597){const _0x1e30aa=this['_aiChatUi'],_0x5c8cfa=()=>{_0x233597['resetWebSearchState'](),_0x233597['resetReasoningState'](),_0x1e30aa['clearLoadingMessage']();},_0x351264=()=>{_0x233597['currentReply']&&(_0x233597['currentReply']['done'](),_0x233597['currentReply']=void 0x0);};return{'insertTextReply':(_0x5f1c80,_0x5412eb)=>{_0x351264(),_0x5c8cfa();const _0x3cbf80=_0x233597['currentReply']=_0x233597['createReply']({'type':'text','interactionId':_0x233597['id'],'id':_0x5412eb||Xt(),'channelsToEditors':this['_channelsToEditors']});return _0x3cbf80['appendContent'](_0x5f1c80),_0x351264(),_0x3cbf80;},'insertCustomElement':async(_0x1fa260,_0x27dff3)=>(_0x351264(),_0x5c8cfa(),_0x1e30aa['addFeedItemCustomElement'](_0x1fa260,_0x27dff3||Xt())),'setLoadingMessage':_0x4bfeaa=>{_0x1e30aa['setLoadingMessage'](_0x4bfeaa);},'clearLoadingMessage':()=>{_0x1e30aa['clearLoadingMessage']();}};}_checkRemoveCurrentDocumentFromChatContext(){Zs(this['context'])['find'](_0x4a895a=>'destroyed'!==_0x4a895a['state'])||(this['activeConversation']?.['removeFromContext']('current-document'),this['activeConversation']?.['toggleAddCurrentDocumentOptionVisibility'](!0x1));}};const $r=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],Yr=[...$r,'startConversation','sendUserMessage','promptInputPaste','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];function qr(_0x7df50){const _0x316b09=new AbortController();return{'promise':new Promise((_0x119f6b,_0x4cc6a1)=>{const _0x26985e=setTimeout(_0x119f6b,_0x7df50);_0x316b09['signal']['addEventListener']('abort',()=>{clearTimeout(_0x26985e),_0x4cc6a1();});}),'abortController':_0x316b09};}var Qr=class{options;isStreaming=!0x1;document=null;nodesList=[];currentIndex=0x0;timeoutAbortController=null;lastUpdateTime=0x0;constructor(_0x454e95){this['options']={'delay':_0x454e95?.['delay']??0xa,'textNodeStyle':_0x454e95?.['textNodeStyle']??'animation:\x20ck-html-streamer-fade-in\x20.3s'};}async stream({document:_0x37d04c,targetElement:_0x5a3e3f,abortSignal:_0x23fd6b}){this['isStreaming']&&this['stop'](),_0x23fd6b?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x26ae61(_0x37d04c,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x375a18=0x0;_0x375a18<this['currentIndex'];_0x375a18++)this['nodesList'][_0x375a18]['shouldBeStreamed']=!0x0;do{const _0x42e008=Date['now'](),_0x4b4cbc=this['nodesList'][this['currentIndex']],_0x3ed570=_0x42e008-this['lastUpdateTime'];if(_0x4b4cbc){_0x4b4cbc['shouldBeStreamed']=!0x0;let _0x56e984=_0x4b4cbc['parent'];for(;_0x56e984;)_0x56e984['shouldBeStreamed']=!0x0,_0x56e984=_0x56e984['parent'];}if(_0x3ed570<this['options']['delay'])try{const {promise:_0x3e5261,abortController:_0x11c3b2}=qr(this['options']['delay']-_0x3ed570);this['timeoutAbortController']=_0x11c3b2,await _0x3e5261;}catch(_0x52f9df){return;}const _0x11027e=_0x5a3e3f['ownerDocument']['createElement'](_0x5a3e3f['tagName']);_0x11027e['innerHTML']=Qt(this['renderNode'](this['document'])),_0x507afe(_0x5a3e3f,_0x11027e,{'childrenOnly':!0x0}),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:_0x4bdcfd}){Array['from'](_0x4bdcfd['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x399101=>{_0x399101['replaceWith'](_0x399101['childNodes'][0x0]);});}stop(){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x4c8c2){let _0x4b0cdd='';if(function(_0x3611f6){return _0x23dcb3(_0x3611f6);}(_0x4c8c2)){for(const _0x59aa4f of _0x4c8c2['children'])_0x4b0cdd+=this['renderNode'](_0x59aa4f);}else{if(jr(_0x4c8c2)){if(!_0x4c8c2['shouldBeStreamed'])return'';const _0x110190=_0x4c8c2,_0x4bfd04=Object['entries'](_0x110190['attribs'])['map'](([_0x1981f6,_0x129e00])=>_0x1981f6+'=\x22'+_0x129e00+'\x22')['join']('\x20');_0x4b0cdd+='<'+_0x110190['tagName']+(_0x4bfd04?'\x20'+_0x4bfd04:'')+'>';for(const _0x1a913b of _0x156cfd(_0x110190))_0x4b0cdd+=this['renderNode'](_0x1a913b);_0x4b0cdd+='</'+_0x110190['tagName']+'>';}else{if(!zr(_0x4c8c2))return'';if(!_0x4c8c2['shouldBeStreamed'])return'';!function(_0x39cefc){return!(!_0x39cefc['parent']||!jr(_0x39cefc['parent']))&&(!!Xr['includes'](_0x39cefc['parent']['tagName'])&&!_0xf328de(_0x39cefc)['match'](/^\s*[<>]\s*$/));}(_0x4c8c2)?_0x4b0cdd+=_0x3b6490(_0x4c8c2):_0x4b0cdd+=_0x3b6490(new _0x47f524('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x4c8c2]));}}return _0x4b0cdd;}getParsedDocumentNodeList(){const _0x21575b=[];return function(_0x3ca4f6,_0x15d6f6){const _0x836797=_0x51e2c1=>{if(_0x15d6f6(_0x51e2c1),_0x51e2c1 instanceof _0x4c4a4a)for(let _0xc9ff88=0x0;_0xc9ff88<_0x51e2c1['children']['length'];_0xc9ff88++){const _0x1c8df7=_0x51e2c1['children'][_0xc9ff88];_0x836797(_0x1c8df7);}};for(let _0xea6f9c=0x0;_0xea6f9c<_0x3ca4f6['children']['length'];_0xea6f9c++)_0x836797(_0x3ca4f6['children'][_0xea6f9c]);}(this['document'],_0x1ac33c=>{if(zr(_0x1ac33c)){const _0x30c808=this['splitTextNodeIntoWordNodes'](_0x1ac33c);_0x30c808['length']&&_0x21575b['push'](..._0x30c808);}_0x1ac33c['isWordSplitSource']||_0x1ac33c['isWordSplitResult']||_0x21575b['push'](_0x1ac33c);}),_0x21575b;}splitTextNodeIntoWordNodes(_0x45145d){if(_0x45145d['isWordSplitSource']||_0x45145d['isWordSplitResult'])return[];const _0x5203a3=_0xf328de(_0x45145d)['match'](/(?:\s*\S+\s*)/g),_0x219225=[];if(_0x5203a3&&_0x5203a3['length']>0x1){for(const _0x5cbe77 of _0x5203a3){const _0x281460=new _0x2980ba(_0x5cbe77);_0x281460['isWordSplitResult']=!0x0,_0x21a8b9(_0x45145d,_0x281460),_0x219225['push'](_0x281460);}_0x45145d['isWordSplitSource']=!0x0,_0x20a4a8(_0x45145d);}return _0x219225;}};const Xr=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function zr(_0x129084){return _0x36bb90(_0x129084);}function jr(_0x38dc7d){return _0x350de8(_0x38dc7d);}function Jr(_0x206ea9,_0x2aa096){_0x206ea9['cleanUpAnimations']({'targetElement':_0x2aa096}),_0x2aa096['querySelectorAll']('[data-id]')['forEach'](_0x4e37d5=>{_0x4e37d5['removeAttribute']('data-id');});}var Zr=class extends _0x43ad99{options;content='';htmlStreamer;['children'];constructor(_0x48c2ad){super();const _0x24bfca=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new Qr(),this['options']=_0x48c2ad,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x24bfca['if']('isDone','ck-ai-chat__feed__item_done'),_0x24bfca['if']('isVisible','ck-hidden',_0x13a043=>!_0x13a043),'ck-ai-chat__feed__text-item'],'data-cke-ai-id':this['options']['id']},'children':this['children']});}['markAsDone'](){Jr(this['htmlStreamer'],this['element']),this['isDone']=!0x0;}async streamIntoElement(_0x4e0633,_0x22a35f,_0x5779c3){await this['htmlStreamer']['stream']({'document':_0x4e0633,'targetElement':_0x22a35f,'abortSignal':_0x5779c3});}},to=class extends _0x43ad99{['showChangesToggleView'];constructor(_0x19b8e9,_0x4ba4eb){super(_0x19b8e9),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new _0x1b12df(_0x19b8e9),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-button_small\x20'+Ir,'label':qs(_0x19b8e9,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x4ba4eb['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x4f4c14=>_0x4f4c14?nt:st),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0xbf7232=new _0x3188b1();_0xbf7232['content']=_0x2f2aeb,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x4ba4eb['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0xbf7232,{'tag':'span','children':[qs(_0x19b8e9,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}};const eo={'title':'AI_SUGGESTION_CONTENT_PART_TITLE','apply':'AI_SUGGESTION_CONTENT_PART_APPLY','suggest':'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION','reject':'AI_SUGGESTION_CONTENT_PART_REJECT','stateAccepted':'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED','stateRejected':'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED','stateOutdated':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED'},io={'accepted':_0x3e619a,'rejected':_0x467543,'outdated':tt};var so=class extends _0x43ad99{statePillView;constructor(_0x398d21,_0x4307f6=eo){super(_0x398d21);const _0x5f3e6e=this['bindTemplate'];this['set']('state','accepted'),this['set']('outdatedReason',void 0x0),this['set']('isVisible',!0x0),this['statePillView']=new _0x6dc41b(_0x398d21),this['statePillView']['bind']('label')['to'](this,'state',_0x4d0c47=>function(_0xbfb20b,_0x4d76cd,_0x24dbed){const _0x519fce={'accepted':_0x24dbed['stateAccepted'],'rejected':_0x24dbed['stateRejected'],'outdated':_0x24dbed['stateOutdated']};return qs(_0xbfb20b,_0x519fce[_0x4d76cd]);}(_0x398d21,_0x4d0c47,_0x4307f6)),this['statePillView']['bind']('icon')['to'](this,'state',_0x574baf=>io[_0x574baf]),this['statePillView']['bind']('class')['to'](this,'state',_0x291b5f=>'ck-pill_'+_0x291b5f),this['statePillView']['bind']('tooltip')['to'](this,'state',this,'outdatedReason',(_0x2a3f21,_0x4bcd73)=>function(_0x128553,_0x5396f0,_0xa51c9){if('outdated'!==_0x5396f0)return;return qs(_0x128553,_0xa51c9?no[_0xa51c9]:'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_TOOLTIP');}(_0x398d21,_0x2a3f21,_0x4bcd73)),this['statePillView']['size']='small',this['statePillView']['tooltipPosition']='s',this['statePillView']['tooltipClass']='ck-tooltip_multi-line',this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x5f3e6e['if']('isVisible','ck-hidden',_0x59f953=>!_0x59f953)]},'children':[this['statePillView']]});}setState(_0x3c78f1,_0x286518){this['state']=_0x3c78f1,this['outdatedReason']='outdated'===_0x3c78f1?_0x286518:void 0x0;}};const no={'content-removed':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_CONTENT_REMOVED_TOOLTIP','editor-removed':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_EDITOR_REMOVED_TOOLTIP','session-changed':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_SESSION_CHANGED_TOOLTIP'};var ro=class extends _0x526787{_applyButton;_suggestButton;constructor(_0x2c6758,_0x5a8d59,_0x255b5f,_0x4827f4=eo){super(_0x2c6758);const _0x599c18=Boolean(_0x255b5f);this['set']('isEnabled',!_0x599c18),this['set']('isVisible',!0x0),this['set']('isTrackChangesOn',!0x1),this['set']('isTargetReadOnly',!0x1),this['set']('isApplyVisible',!0x0),this['set']('isSuggestVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x2eaa8e=[];if(!_0x599c18){_0x5a8d59['includes']('applySuggestion')&&(this['_applyButton']=new _0x1b12df(_0x2c6758),this['_applyButton']['set']({'label':qs(_0x2c6758,_0x4827f4['apply']),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x39d2e5,'class':pr}),this['_applyButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isTargetReadOnly',(_0x2df6bd,_0x47a74e)=>_0x2df6bd&&!_0x47a74e),this['_applyButton']['bind']('isVisible')['to'](this,'isTrackChangesOn',this,'isApplyVisible',(_0x2fbb04,_0x248dc7)=>!_0x2fbb04&&_0x248dc7),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x2eaa8e['push'](this['_applyButton'])),_0x5a8d59['includes']('insertSuggestion')&&(this['_suggestButton']=new _0x1b12df(_0x2c6758),this['_suggestButton']['set']({'label':qs(_0x2c6758,_0x4827f4['suggest']),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x4b6aa4,'class':pr}),this['_suggestButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isTargetReadOnly',(_0x1b69c8,_0x1ae431)=>_0x1b69c8&&!_0x1ae431),this['_suggestButton']['bind']('isVisible')['to'](this,'isSuggestVisible'),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x2eaa8e['push'](this['_suggestButton']));const _0x53586d=new _0x1b12df(_0x2c6758);_0x53586d['set']({'label':qs(_0x2c6758,_0x4827f4['reject']),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x2d4095,'class':pr}),_0x53586d['bind']('isEnabled')['to'](this),_0x53586d['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x2eaa8e['push'](_0x53586d);}this['items']['addMany'](_0x2eaa8e);const _0x21bc5a=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x21bc5a['if']('isVisible','ck-hidden',_0x4ffd15=>!_0x4ffd15)]}});}setButtonsVisibility({showApplyButton:_0x42e40f,showSuggestButton:_0x26e486}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x42e40f),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x26e486);}},oo=class extends _0x43ad99{toolbarView;stateView;titleLabelView;['children'];constructor(_0x1101ae,{part:_0x547913,uiIndex:_0x1d6c14,availableActions:_0x274de4,areActionsDisabled:_0x47619d,translationKeys:_0x10190d=eo}){super(_0x1101ae),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['set']('isTrackChangesOn',!0x1),this['set']('isTargetReadOnly',!0x1),this['set']('isApplyVisible',!0x0),this['set']('isSuggestVisible',!0x0),this['toolbarView']=new ro(_0x1101ae,_0x274de4,_0x47619d,_0x10190d),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x547913['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x547913['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x547913['index']});}),this['toolbarView']['bind']('isEnabled','isTrackChangesOn','isTargetReadOnly','isApplyVisible','isSuggestVisible')['to'](this),this['stateView']=new so(_0x1101ae,_0x10190d),this['titleLabelView']=new ao(_0x1101ae,_0x1d6c14,_0x10190d['title']),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',(_0x37fbc3,_0x24ef6e,_0x423ffc,_0x3dabfb)=>{'pending'===_0x3dabfb?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x423ffc?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x423ffc,this['outdatedReason']),this['children']['add'](this['stateView']));});}},ao=class extends _0x43ad99{constructor(_0x135873,_0xb792b2,_0x4df911){super(_0x135873),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[qs(_0x135873,_0x4df911,_0xb792b2['toString']())]});}},ho=class extends _0x43ad99{htmlStreamer;constructor(_0x5332b9){super(_0x5332b9),this['htmlStreamer']=new Qr(),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async update({part:_0x9033b5,renderingStrategy:_0x5780d3,abortSignal:_0x515a0c}){this['_ensureHostElementTag'](_0x9033b5['wrapperTag']||'div');const _0x290d77=_0x26ae61(_0x9033b5['content'],!0x0);for(const _0x109793 of on(_0x290d77))_0x20a4a8(_0x109793);if('streaming'===_0x5780d3)await this['htmlStreamer']['stream']({'document':_0x290d77,'targetElement':this['element'],'abortSignal':_0x515a0c});else{const _0x4a81a5=this['element']['ownerDocument']['createElement'](this['element']['tagName']);_0x4a81a5['innerHTML']=Qt(sn(_0x290d77)),_0x507afe(this['element'],_0x4a81a5,{'childrenOnly':!0x0});}}['clear'](){this['htmlStreamer']['reset'](),this['element']&&(this['element']['replaceChildren'](),this['element']['scrollTop']=0x0);}cleanUpStreamingArtifacts(){Jr(this['htmlStreamer'],this['element']);}_ensureHostElementTag(_0x25375d){if(!this['element']||this['element']['tagName']['toLowerCase']()===_0x25375d)return;const _0x420bf3=new _0x373278({'tag':_0x25375d,'attributes':{'class':this['element']['className']}})['render']();this['element']['replaceWith'](_0x420bf3),this['element']=_0x420bf3;}},co=class extends _0x43ad99{['uiIndex'];['_children'];['_headerView'];_streamableContentView;constructor(_0x448c6f,{part:_0x231214,uiIndex:_0x41e77b,areActionsDisabled:_0x2347fa,availableActions:_0x2d0003,translationKeys:_0x20e22a=eo}){super(_0x448c6f);const _0x34fcfb=this['bindTemplate'];this['uiIndex']=_0x41e77b,this['set']('state',_0x231214['state']),this['set']('outdatedReason',_0x231214['outdatedReason']),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('isTargetReadOnly',!0x1),this['set']('isApplyVisible',!0x0),this['set']('isSuggestVisible',!0x0);const _0x453e84=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x2347fa;};this['on']('change:state',_0x453e84),this['on']('change:isDone',_0x453e84),_0x453e84(),this['_children']=this['createCollection'](),this['_headerView']=new oo(_0x448c6f,{'part':_0x231214,'uiIndex':_0x41e77b,'availableActions':_0x2d0003,'areActionsDisabled':_0x2347fa,'translationKeys':_0x20e22a}),this['_headerView']['bind']('isEnabled','outdatedReason','state','isTrackChangesOn','isTargetReadOnly','isApplyVisible','isSuggestVisible')['to'](this),this['_headerView']['delegate'](...$r)['to'](this),this['_streamableContentView']=new ho(_0x448c6f),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x34fcfb['to']('state',_0x51cd84=>'ck-ai-suggestion__body__content-part_'+_0x51cd84),_0x34fcfb['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x34fcfb['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x34fcfb['if']('isVisible','ck-hidden',_0x25d236=>!_0x25d236)]},'children':this['_children'],'on':{'mouseenter':_0x34fcfb['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x231214['index']});}),'mouseleave':_0x34fcfb['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x231214['index']});}),'click':_0x34fcfb['to'](_0x2ca178=>{const _0x590d41=_0x2ca178['target'];_0x590d41&&'A'===_0x590d41['tagName']&&_0x2ca178['preventDefault'](),this['isEnabled']&&!Rt(this['_headerView']['toolbarView']['element'],_0x590d41)&&this['fire']('showChangeInText',{'index':_0x231214['index']});})}});}async updateContent({part:_0x27c93f,showUnchangedParts:_0x16239a=!0x1,abortSignal:_0x53b85c}){this['partDefinition']=_0x27c93f,this['isVisible']=this['partDefinition']['hasChanges']||_0x16239a,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x27c93f,'renderingStrategy':'static','abortSignal':_0x53b85c});}['markAsDone'](){this['isDone']=!0x0;}},lo=class extends _0x43ad99{constructor(_0x2bcfe7,_0x3d4964){super(_0x2bcfe7),this['set']('isVisible',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton',this['bindTemplate']['if']('isVisible','ck-hidden',_0xea5d1e=>!_0xea5d1e)]},'children':this['_createSkeletonItems'](_0x3d4964)});}_createSkeletonItems(_0x54c96e){const _0x45b81a=['ck','ck-ai-skeleton__item'];return _0x54c96e['map'](_0x510dab=>{if('children'in _0x510dab)return{'tag':_0x510dab['tag'],'attributes':{'class':['ck','ck-ai-skeleton__row']},'children':this['_createSkeletonItems'](_0x510dab['children'])};let _0x5ae796='';switch(_0x510dab['attributes']['align']){case'right':_0x5ae796='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x5ae796='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x5ae796='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x510dab['tag'],'attributes':{'class':[..._0x45b81a,_0x510dab['attributes']['class']?_0x510dab['attributes']['class']:''],'style':'width:\x20'+_0x510dab['attributes']['width']+';\x20height:\x20'+_0x510dab['attributes']['height']+';'+_0x5ae796}};});}};const uo={'aiSuggestionBody':[{'tag':'div','attributes':{'width':'50%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'85%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'75%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}}],'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'}}],'aiChatInit':[{'tag':'div','attributes':{'width':'70%','height':'36px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'36px','align':'left'}}],'aiChatControls':[{'tag':'div','attributes':{'width':'100%','height':'30px','align':'left'}},{'tag':'div','attributes':{'width':'150px','height':'20px','align':'left'}}],'aiHistory':_o(0x5,'100%','44px','right'),'aiChatResources':_o(0x8,'100%','24px','right'),'aiReviewChecks':go(0x10,[{'tag':'div','attributes':{'width':'50%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'85%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'75%','height':'24px','align':'left'}}]),'aiTranslateChecks':go(0x10,[{'tag':'div','attributes':{'width':'50%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'83%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'98%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'72%','height':'24px','align':'left'}}]),'aiActionsBalloon':[{'tag':'div','attributes':{'width':'76%','height':'20px','align':'left'}},{'tag':'div','attributes':{'width':'87%','height':'20px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'20px','align':'left'}},{'tag':'div','attributes':{'width':'87%','height':'20px','align':'left'}}],'aiReviewInitCheck':go(0x6,[{'tag':'div','attributes':{'width':'30%','height':'18px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'18px','align':'left'}}])};function _o(_0x2e8349,_0x233b5d,_0x1805d2,_0x5f1773){return new Array(_0x2e8349)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x233b5d,'height':_0x1805d2,'align':_0x5f1773}}));}function go(_0x1e3047,_0xb7d7b2){return new Array(_0x1e3047)['fill'](null)['map'](()=>({'tag':'div','children':_0xb7d7b2}));}const Io=/* #__PURE__ -- @preserve */
|
|
33
|
+
It();var Ao=class extends Io{['queue']=[];['isProcessing']=!0x1;_abortController;async['enqueue'](_0x43eb43){const _0x59515c=this['createTask'](_0x43eb43);return this['queue']['push'](_0x59515c),this['_processQueue'](),_0x59515c['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(_0x5207fe=>{this['once']('_queueEmpty',()=>{_0x5207fe();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x2a9796=this['queue']['shift']();try{await _0x2a9796['callback'](this['_abortController']['signal']),_0x2a9796['resolve']();}catch(_0x1bb672){_0x2a9796['reject'](_0x1bb672);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}createTask(_0x4ba97a){let _0xb5077a,_0x514bc4;const _0x4ef975=new Promise((_0x14ee0b,_0x3b87d9)=>{_0xb5077a=_0x14ee0b,_0x514bc4=_0x3b87d9;});return{'callback':_0x4ba97a,'resolve':_0xb5077a,'reject':_0x514bc4,'completePromise':_0x4ef975};}},Eo=class extends Zr{constructor(_0x4b7170){super(_0x4b7170),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x4b7170['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}setContent(_0x50525f){this['element']['innerHTML']=Qt(_0x50525f);}};const po=['applySuggestion','insertSuggestion'];var mo=class extends _0x43ad99{_applyChangesButton;_insertSuggestionsButton;['children'];constructor(_0x44daef,_0x3d12c0=[...po],_0x48bd8b){super(_0x44daef);const _0x1b1e7f=this['bindTemplate'],_0x36e7d3=Boolean(_0x48bd8b);this['set']('isEnabled',!_0x36e7d3),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x36e7d3||(this['_applyChangesButton']=new _0x1b12df(_0x44daef),this['_applyChangesButton']['set']({'label':qs(_0x44daef,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x3d12c0['includes']('applySuggestion'),'class':gr}),this['_insertSuggestionsButton']=new _0x1b12df(_0x44daef),this['_insertSuggestionsButton']['set']({'label':qs(_0x44daef,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x3d12c0['includes']('insertSuggestion'),'class':Ir}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x276360=>{_0x276360['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',_0x1b1e7f['if']('isVisible','ck-hidden',_0x2caca1=>!_0x2caca1)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}updateVisibility(_0x258acb){this['isVisible']=_0x258acb;}_switchButtonLabelsPlurality(_0x20598e){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x20598e?(this['_applyChangesButton']['label']=qs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=qs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=qs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=qs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}},To=class extends _0x43ad99{['children'];['balloonPanelView'];bodyCollection;constructor(_0x1fbb32,_0x23d662){super(_0x1fbb32),this['bodyCollection']=_0x23d662,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',_0x267eed=>!_0x267eed)]},'children':this['children']});const _0xbfda17=new _0x43ad99(this['locale']),_0x36641d=new _0x3188b1();_0x36641d['content']=ut,_0xbfda17['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x36641d,{'tag':'span','children':[{'text':qs(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0xbfda17),this['_setupBalloonPanel'](_0x1fbb32);}['addSource'](_0x4ef232){this['children']['add'](new wo(this['locale'],_0x4ef232,this['balloonPanelView']));}_setupBalloonPanel(_0x2a2d51){this['balloonPanelView']=new Jt(_0x2a2d51),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}},wo=class extends _0x1b12df{['balloonPanelView'];['source'];constructor(_0x47492e,_0x54681e,_0x106ad){super(_0x47492e),this['source']=_0x54681e,this['balloonPanelView']=_0x106ad,this['set']({'label':_0x54681e['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x2cf10f=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x2cf10f['to'](()=>{window['open'](_0x54681e['url'],'_blank');}),'mouseenter':_0x2cf10f['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x2cf10f['to'](()=>{this['_hideTooltip']();})}}),_0x54681e['favicon']){const _0x194632=new _0x43ad99(_0x47492e);_0x194632['setTemplate']({'tag':'img','attributes':{'src':_0x54681e['favicon']||ut,'alt':_0x54681e['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x194632);}else this['set']('icon',ut);}_createTooltipContentView(_0x55161e,_0x1a9195){const _0x2a6809=new _0x43ad99(_0x55161e),_0x48f930=[];let _0x35ca9b;_0x1a9195?.['favicon']?(_0x35ca9b=new _0x43ad99(_0x55161e),_0x35ca9b['setTemplate']({'tag':'img','attributes':{'src':_0x1a9195['favicon'],'alt':_0x1a9195['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x35ca9b=new _0x3188b1(),_0x35ca9b['content']=ut,_0x35ca9b['extendTemplate']({'attributes':{'alt':_0x1a9195['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x48f930['push'](_0x35ca9b);const _0x4078e6=new _0x43ad99(_0x55161e);_0x4078e6['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x1a9195['url']},'children':[{'text':new URL(_0x1a9195['url'])?.['hostname']}]}),_0x48f930['push'](_0x4078e6);const _0x3e64c3=new _0x43ad99(_0x55161e);_0x3e64c3['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x48f930});const _0x568ebf=new _0x43ad99(_0x55161e);return _0x568ebf['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x1a9195['title']['length']>0x190?_0x1a9195['title']['substring'](0x0,0x190)+'...':_0x1a9195['title']}]}),_0x2a6809['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x3e64c3,_0x568ebf]}),_0x2a6809;}_showTooltip(){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[Jt['defaultPositions']['northArrowSouth'],Jt['defaultPositions']['northArrowSouthWest'],Jt['defaultPositions']['northArrowSouthEast']],'limiter':()=>ah(this['element'])}),this['balloonPanelView']['show']();}_hideTooltip(){this['balloonPanelView']['hide']();}_updateTooltipContent(){this['balloonPanelView']['content']['get'](0x0)?.['destroy'](),this['balloonPanelView']['content']['clear']();const _0x1631c2=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x1631c2);}},Co=class extends _0x43ad99{_actionsView;['_readOnlyByIndex']=new Map();['_sourcesView'];['_children'];_skeletonView;_showSkeletonDebounced=_0x2dbd18(()=>{this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now']();},0x3e8);_skeletonShownAt=null;_areActionsDisabled;_showUnchangedParts;_updateContentPartsPromiseQueue;_emptyPartsWarningView;_availableActions;_cachedContentParts=[];constructor(_0x31a454,_0x2f57fd){super(_0x31a454);const {areActionsDisabled:_0x29f48c,showUnchangedParts:_0x11c35c,availableActions:_0x39374f}=_0x2f57fd;this['_areActionsDisabled']=_0x29f48c,this['_showUnchangedParts']=_0x11c35c,this['_availableActions']=_0x39374f,this['set']('isTrackChangesOn',!0x1),this['set']('isAcceptAllEnabled',!0x1),this['_children']=this['createCollection'](),this['_skeletonView']=new lo(_0x31a454,uo['aiSuggestionBody']),this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now'](),this['_children']['add'](this['_skeletonView']),this['_updateContentPartsPromiseQueue']=new Ao(),this['_emptyPartsWarningView']=new Eo({'id':'empty-parts-warning','initialContent':qs(_0x31a454,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new mo(_0x31a454,_0x2f57fd['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new To(this['locale'],_0x2f57fd['bodyCollection']),_0x2f57fd['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'isAcceptAllEnabled'),this['_actionsView']['delegate'](...$r)['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']]});}destroy(){this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),super['destroy']();}get partsCount(){return this['_contentPartViews']['length'];}get _contentPartViews(){return Array['from'](this['_children'])['filter'](_0x303714=>_0x303714 instanceof co);}async updateContentParts({parts:_0xcf856e,abortSignal:_0xa0ff50,skipLoadingEffects:_0x486966}){this['_cachedContentParts']['length']?_0xcf856e['forEach'](_0xf43a74=>{const _0x29fd13=this['_cachedContentParts']['findIndex'](_0xf4b686=>_0xf4b686['index']==_0xf43a74['index']);-0x1===_0x29fd13?this['_cachedContentParts']['push'](_0xf43a74):this['_cachedContentParts'][_0x29fd13]=_0xf43a74;}):this['_cachedContentParts']=_0xcf856e;const _0x474e37=this['_showUnchangedParts']?_0xcf856e:_0xcf856e['filter'](_0x24bb72=>_0x24bb72['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x474e37['length']>0x1),_0x486966&&(this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1);for(const _0x355b8b of _0xcf856e)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x3366e3=>{let _0x51336a=this['getPartView'](_0x355b8b['index']);if(_0x51336a||_0x355b8b['hasChanges']||this['_showUnchangedParts']){if(!_0x51336a){if(_0x51336a=new co(this['locale'],{'part':_0x355b8b,'uiIndex':this['_contentPartViews']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x51336a['delegate'](...$r)['to'](this),_0x51336a['bind']('isTrackChangesOn')['to'](this),!_0x486966&&(this['_showSkeletonDebounced']['cancel'](),await this['_awaitMinimumSkeletonDisplayTime'](_0x3366e3),_0x3366e3['aborted']))return;_0x51336a['isTargetReadOnly']=this['_readOnlyByIndex']['get'](_0x355b8b['index'])??!0x1,this['_skeletonView']['isVisible']=!0x1,this['_children']['add'](_0x51336a,this['_children']['length']-0x1),_0x486966||this['_showSkeletonDebounced']();}await _0x51336a['updateContent']({'part':_0x355b8b,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x3366e3}),_0x51336a['markAsDone']();}});return _0xa0ff50?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1;}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}updatePartState(_0x21a345,_0x1ac67d,_0x56cd67){const _0x75923e=this['getPartView'](_0x21a345);_0x75923e&&(_0x75923e['outdatedReason']=_0x56cd67,_0x75923e['state']=_0x1ac67d);}setGating({readOnlyByIndex:_0x4ef557,isAcceptAllEnabled:_0x461057}){this['_readOnlyByIndex']=_0x4ef557,this['isAcceptAllEnabled']=_0x461057;for(const _0x2d9010 of this['_contentPartViews'])_0x2d9010['isTargetReadOnly']=_0x4ef557['get'](_0x2d9010['partDefinition']['index'])??!0x1;}setPartActive(_0x3ce3c0,_0x5f5c53){if(!0x1===_0x3ce3c0){for(const _0x43e2e5 of this['_contentPartViews'])_0x43e2e5['isActive']=!0x1;}else{const _0x14c55f=this['getPartView'](_0x3ce3c0);_0x14c55f&&(_0x14c55f['isActive']=_0x5f5c53);}}updateSources(_0x29371c){_0x29371c['forEach'](_0x3695f8=>this['_sourcesView']['addSource'](_0x3695f8)),this['_sourcesView']['isVisible']=!0x0;}getPartView(_0x40a81d){return this['_contentPartViews']['find'](_0x2815ca=>_0x2815ca['partDefinition']['index']==_0x40a81d)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x485aee=!this['_cachedContentParts']['find'](({hasChanges:_0x5af10d})=>_0x5af10d),_0x2be36e=!!this['_cachedContentParts']['find'](({hasChanges:_0x5094a6})=>!_0x5094a6);this['_emptyPartsWarningView']['isVisible']=0x0==this['_contentPartViews']['length']||_0x2be36e,_0x485aee?this['_emptyPartsWarningView']['setContent'](qs(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](qs(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_contentPartViews']['forEach'](_0x564432=>_0x564432['markAsDone']()),this['_skeletonView']['isVisible']=!0x1,this['_showSkeletonDebounced']['cancel'](),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']&&!this['_areActionsDisabled']);}async _awaitMinimumSkeletonDisplayTime(_0x5a5be1){if(!this['_skeletonView']['isVisible']||null===this['_skeletonShownAt'])return;const _0x22a60f=0x3e8-(Date['now']()-this['_skeletonShownAt']);if(this['_skeletonShownAt']=null,_0x22a60f>0x0){const {promise:_0x2d9c9e,abortController:_0x4df836}=qr(_0x22a60f);_0x5a5be1?.['addEventListener']('abort',()=>_0x4df836['abort']()),await _0x2d9c9e['catch'](()=>{});}}get hasNonEmptyParts(){return this['_contentPartViews']['filter'](_0xaff698=>_0xaff698['partDefinition']['hasChanges'])['length']>0x0;}},fo=class extends _0x43ad99{['bodyView'];['children'];['headerView'];constructor(_0x31f07f,_0x2ca97f,_0x1288d7){super(_0x31f07f);const {showDiff:_0x4ffefa,areActionsDisabled:_0x2e94ba,showUnchangedParts:_0x219bd6,availableActions:_0x2335d4}=_0x2ca97f;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new to(_0x31f07f,{'showDiff':_0x4ffefa}),this['headerView']['on']('toggleShowChanges',(_0x2bbd4f,_0x5d4ed5)=>{this['areChangesVisible']=_0x5d4ed5['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x5d4ed5['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new Co(_0x31f07f,{'areActionsDisabled':_0x2e94ba,'showUnchangedParts':!!_0x219bd6,'availableActions':_0x2335d4,'bodyCollection':_0x1288d7}),this['bodyView']['delegate'](...$r)['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(_0x4b3627){await this['bodyView']['updateContentParts'](_0x4b3627);}updateSources(_0x5b8f41){this['bodyView']['updateSources'](_0x5b8f41);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}},Ro=class extends Zr{containerView;constructor(_0x36d210,_0x53d376,_0x4217d8){super(_0x53d376),this['set']('isTrackChangesOn',!0x1),this['containerView']=new fo(_0x36d210,{'showDiff':_0x53d376['showDiff'],'areActionsDisabled':_0x53d376['areActionsDisabled'],'availableActions':_0x53d376['availableActions']},_0x4217d8),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x2f7483,_0x2920c3)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x2920c3['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',(_0x17a61b,{index:_0x38f6d5})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x38f6d5});}),this['containerView']['on']('applySuggestion',(_0x156058,{index:_0x468a04}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x468a04});}),this['containerView']['on']('insertSuggestion',(_0x582c22,{index:_0x3cd479}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3cd479});}),this['containerView']['on']('rejectSuggestion',(_0x187aca,{index:_0x499821})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x499821});}),this['containerView']['on']('mouseOverSuggestion',(_0x9147b1,{index:_0x5e9f73})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x5e9f73});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x46cb02,{index:_0xa5bf86})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0xa5bf86});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async updateContent(_0xd416a8){await this['containerView']['updateContent'](_0xd416a8);}updatePartState(_0x2158cb,_0x520e6c,_0x363ef6){this['containerView']['bodyView']['updatePartState'](_0x2158cb,_0x520e6c,_0x363ef6);}setPartActive(_0x37ad92,_0x419192){!0x1===_0x37ad92?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x37ad92,_0x419192);}updateSources(_0x5499c5){this['containerView']['updateSources'](_0x5499c5);}getPartView(_0x3d31da){return this['containerView']['bodyView']['getPartView'](_0x3d31da);}setGating(_0x3f72df){this['containerView']['bodyView']['setGating'](_0x3f72df);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}},bo=class extends Zr{replyContainer;_bodyCollection;constructor(_0x44406b,_0x510a9b,_0x5cbddc){super(_0x510a9b),this['_bodyCollection']=_0x5cbddc,this['locale']=_0x44406b,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x43ad99(),this['replyContainer']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-chat__feed__ai-reply-container','ck-ai-chat-content']}}),this['children']['add'](this['replyContainer']);}async['render'](){super['render'](),this['options']['initialContent']&&(await this['updateContent']({'parsedContent':en(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async updateContent({parsedContent:_0x4f683b,renderingStrategy:_0xc4d36e,abortSignal:_0x28094b}){'streaming'===_0xc4d36e?await this['streamIntoElement'](_0x4f683b,this['replyContainer']['element'],_0x28094b):this['replyContainer']['element']['innerHTML']=Qt(_0x3b6490(_0x4f683b));}updateSources(_0xe603e2){const _0x75ca04=new To(this['locale'],this['_bodyCollection']);_0x75ca04['children']['addMany'](_0xe603e2['map'](_0x31f104=>new wo(this['locale'],_0x31f104,_0x75ca04['balloonPanelView']))),_0x75ca04['isVisible']=!0x0,this['children']['add'](_0x75ca04);}},So=class extends _0x20aef5{constructor(_0x402aab=void 0x0){super();const _0x544f7a=_0x402aab?'ck-ai-spinner_'+_0x402aab:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x544f7a]}});}};const Oo={'file':_0x3ee9d9,'image':_0x5b4f6a,'document':_0x2f2aeb,'web-resource':_0x4d1c13,'text':_0x3ee9d9,'selection':it,'mcp-tool-context':_0x2f2aeb,'context':_0x2f2aeb},vo='ck-ai-chat-context-chip',yo='ck-ai-chat-context-chip_wide',No='ck-ai-chat-context-chip_document',ko='ck-ai-chat-context-chip__label',xo='ck-ai-chat-context-chip__type-icon',Lo='ck-ai-chat-context-controls__chip-tooltip',Do='n';var Po=class extends _0x1b12df{constructor(_0x9e64cf,_0x5eb63d,_0x376188,_0x492e03,_0x394665=!0x1){super(_0x9e64cf),this['_isAnimationOnEnterEnabled']=_0x492e03,this['_initializeProperties'](_0x5eb63d,_0x376188,_0x394665),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(_0x4dddbf,_0x49271c,_0x2243a8){this['set']('label',_0x4dddbf['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x4dddbf['type']),this['set']('id',_0x4dddbf['uiId']),this['set']('readonly',_0x49271c),this['set']('isLoading',_0x2243a8);}_setupTemplate(){const _0x17d87c=this['_createIconView'](),_0x279281=this['_createRemoveButton'](),_0x3209c8=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x3209c8),'children':this['_createTemplateChildren'](_0x17d87c,_0x279281,_0x3209c8)});}_createTemplateAttributes(_0x575d1d){return{'class':[vo,_0x575d1d['if']('itemType',No,_0xa3be22=>'document'==_0xa3be22),_0x575d1d['if']('itemType',yo,_0x2fe088=>'selection'==_0x2fe088)],'data-cke-tooltip-text':_0x575d1d['to']('label',Mo),'data-cke-tooltip-position':Do,'data-cke-tooltip-class':Lo};}_createTemplateChildren(_0x6217ba,_0x518506,_0x3c9826){const _0xea6eeb=this['_createLabelElement'](_0x3c9826),_0x5f54a8=this['_createLoaderIcon']();return this['readonly']?[_0x6217ba,_0xea6eeb]:[_0x6217ba,_0x5f54a8,_0xea6eeb,_0x518506];}_createLabelElement(_0xc33898){return{'tag':'span','attributes':{'class':ko},'children':[{'text':_0xc33898['to']('label')}]};}_createRemoveButton(){const _0x141720=new _0x1b12df(this['locale']);return _0x141720['set']({'label':qs(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x467543}),this['_setupRemoveButtonEvent'](_0x141720),_0x141720;}_setupRemoveButtonEvent(_0x20e0e6){_0x20e0e6['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}_createIconView(){const _0x45555b=this['bindTemplate'],_0x3568a3=new _0x3188b1();return _0x3568a3['content']=Oo[this['itemType']],_0x3568a3['extendTemplate']({'attributes':{'class':[xo,_0x45555b['if']('isLoading','ck-hidden',_0x1ae6fe=>_0x1ae6fe)]}}),_0x3568a3;}_handleAnimationEndOnce(_0x5643a6,_0x29b449){if(!_0x5643a6)return;const _0x2e5cd9=()=>{_0x29b449(),_0x5643a6['removeEventListener']('animationend',_0x2e5cd9),_0x5643a6['removeEventListener']('webkitAnimationEnd',_0x2e5cd9);};_0x5643a6['addEventListener']('animationend',_0x2e5cd9),_0x5643a6['addEventListener']('webkitAnimationEnd',_0x2e5cd9);}_createLoaderIcon(){const _0x4c1016=new So('small');return _0x4c1016['bind']('isVisible')['to'](this,'isLoading',_0x3615e6=>_0x3615e6),_0x4c1016;}};function Mo(_0x3bc346){if(!_0x3bc346)return _0x3bc346;if(_0x3bc346['length']<=0x78)return _0x3bc346;const _0x5f5071=_0x3bc346['slice'](0x0,0x78),_0x5236c0=_0x5f5071['lastIndexOf']('\x20');return(_0x5236c0>0x0?_0x5f5071['slice'](0x0,_0x5236c0):_0x5f5071)+'…';}const Vo={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+','viewportOffset':{'top':0x64,'bottom':0xa}},Ho='300px';var Uo=class{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];_showMoreButtonView=null;['_showMoreBalloonPanelView']=null;_containerElement=null;_bodyCollection;_parentView;_intersectionObserver=null;_pendingCalculation=!0x1;constructor(_0x384e27,_0x578600,_0x1690ad,_0x3045a5,_0x2d2948){this['_locale']=_0x384e27,this['_visibleChips']=_0x578600,this['_config']={...Vo,..._0x1690ad,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x1690ad['cssClasses']}},this['_overflowChips']=new _t(),this['_bodyCollection']=_0x3045a5,this['_parentView']=_0x2d2948;}setContainerElement(_0x10d1a4){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x10d1a4,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':this['_getLimiterElement']()}));}['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 _0x1e5970=[...this['_visibleChips'],...this['_overflowChips']],_0x15babf=this['_createCalculationContainer'](),_0x488328=this['_calculateOverflowInContainer'](_0x15babf,_0x1e5970),_0x5e52c6=_0x15babf['_ancestorsToRestore'];_0x5e52c6&&this['_restoreAncestorVisibility'](_0x5e52c6),_0x15babf['remove'](),this['_applyOverflowResults'](_0x1e5970,_0x488328);}_createShowMoreButton(){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x8f06c5({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}_createShowMoreButtonView(){const _0x549ad3=new _0x1b12df(this['_locale']);_0x549ad3['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x9cbb3a=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x9cbb3a['push'](this['_config']['cssClasses']['controlsButton']),_0x549ad3['extendTemplate']({'attributes':{'class':_0x9cbb3a}}),_0x549ad3;}_createShowMoreBalloonPanelView(){const _0x4364cf=new Jt(this['_locale']);return _0x4364cf['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x4364cf),_0x4364cf;}_updateBalloonContent(){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x1a6097=>{_0x1a6097['disableAnimationOnEnter']();});const _0x3511c5=new _0x43ad99(this['_locale']);_0x3511c5['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x3511c5);}}_handleShowMoreButtonClick(){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}_updateShowMoreButtonVisibility(){const _0x3e663b=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x3e663b?'':'none');}['_repinBalloonPanel'](){this['_showMoreButtonView']?.['isOn']&&this['_showMoreBalloonPanelView']?.['isVisible']&&this['_showMoreButtonView']['element']&&this['_showMoreBalloonPanelView']['pin']({'target':this['_showMoreButtonView']['element'],'limiter':this['_getLimiterElement']()});}_getLimiterElement(){return this['_config']['getLimiterElement']?.()||null;}_findTargetContainer(_0x40ecd6){const _0x5cb179=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x2a71b0=this['_containerElement']?.['classList'];if(_0x2a71b0){const _0x15154a=_0x2a71b0[0x0]||'',_0x13a0f5=_0x40ecd6['querySelector']('.'+_0x15154a),_0x411ccf=_0x40ecd6['querySelector'](_0x5cb179);return _0x13a0f5||_0x411ccf||_0x40ecd6;}return _0x40ecd6['querySelector'](_0x5cb179)||_0x40ecd6;}_calculateContainerWidth(){const _0x54151d=this['_parentView']['element']||this['_containerElement'];if(!_0x54151d)return Ho;const _0x5e0f50=window['getComputedStyle'](_0x54151d)['width'];if('auto'===_0x5e0f50||'0px'===_0x5e0f50||!_0x5e0f50){const _0x14e5b9=kt(_0x54151d);if(_0x14e5b9){const _0x12cf40=window['getComputedStyle'](_0x14e5b9);return'auto'!==_0x12cf40['width']?_0x12cf40['width']:Ho;}return Ho;}return _0x5e0f50;}_applyCalculationStyles(_0x211bd0,_0x204760){this['_config']['cssClasses']['calculationContainer']&&_0x211bd0['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x211bd0['style']['width']=_0x204760,_0x211bd0['style']['position']='absolute',_0x211bd0['style']['top']='-9999px',_0x211bd0['style']['left']='-9999px',_0x211bd0['style']['opacity']='0',_0x211bd0['style']['pointerEvents']='none',_0x211bd0['style']['zIndex']='-1',_0x211bd0['style']['visibility']='visible\x20!important',_0x211bd0['style']['display']='block\x20!important',_0x211bd0['style']['boxSizing']='border-box';}_restoreAncestorVisibility(_0x2f5bca){_0x2f5bca['forEach'](({element:_0x2a3254,originalDisplay:_0x265f82,originalVisibility:_0x11b5f4})=>{_0x2a3254['style']['display']=_0x265f82,_0x2a3254['style']['visibility']=_0x11b5f4;});}_makeAncestorsVisible(_0x47d0ea){const _0xb6697e=[],_0x50071d=Mt(_0x47d0ea),_0x4f7c43=_0x50071d['length']?_0x50071d[_0x50071d['length']-0x1]['host']:null;let _0x3b417a=kt(_0x47d0ea);for(;_0x3b417a&&_0x3b417a!==document['body']&&_0x3b417a!==_0x4f7c43;){const _0x5abc46=window['getComputedStyle'](_0x3b417a);_0x3b417a instanceof HTMLElement&&('none'===_0x5abc46['display']||'hidden'===_0x5abc46['visibility'])&&(_0xb6697e['push']({'element':_0x3b417a,'originalDisplay':_0x3b417a['style']['display'],'originalVisibility':_0x3b417a['style']['visibility']}),_0x3b417a['style']['display']='block',_0x3b417a['style']['visibility']='visible'),_0x3b417a=kt(_0x3b417a);}return _0xb6697e;}_createContainerElements(){let _0x580bed,_0x11d908;return this['_parentView']['element']?(_0x580bed=this['_parentView']['element']['cloneNode'](!0x0),_0x11d908=this['_findTargetContainer'](_0x580bed)):(_0x580bed=document['createElement']('div'),_0x11d908=_0x580bed),{'calculationContainer':_0x580bed,'targetContainer':_0x11d908};}_createCalculationContainer(){const _0xdc2df2=this['_parentView']['element']||this['_containerElement'],_0xb76e38=Dt(_0xdc2df2),_0x4d281d=_0xb76e38 instanceof HTMLElement?_0xb76e38:xt(_0xdc2df2),{calculationContainer:_0x1c4225,targetContainer:_0x46f608}=this['_createContainerElements'](),_0x196577=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x1c4225,_0x196577),_0x4d281d['appendChild'](_0x1c4225),_0x1c4225['_targetContainer']=_0x46f608;const _0x4fb6f0=this['_makeAncestorsVisible'](_0xdc2df2);return _0x1c4225['offsetWidth'],_0x1c4225['_ancestorsToRestore']=_0x4fb6f0,_0x1c4225;}_calculateOverflowInContainer(_0x387335,_0x3ff387){const _0x4f1f24=_0x387335['_targetContainer']||_0x387335,_0x5183c5=[],{rowCount:_0x5cf5f5}=this['_renderChipsAndCountRows'](_0x4f1f24,_0x3ff387);if(_0x5cf5f5<=this['_config']['maxVisibleRows'])return _0x5183c5;const _0x403140=_0x3ff387['slice']();for(;_0x403140['length']>0x0;){if(this['_testButtonFit'](_0x387335,_0x4f1f24,_0x403140)){const _0x2b54d7=_0x3ff387['filter'](_0x2082b9=>!_0x403140['includes'](_0x2082b9));_0x5183c5['push'](..._0x2b54d7);break;}if(!_0x403140['pop']())break;}return _0x5183c5;}_renderChipsAndCountRows(_0x422a15,_0x2a14e4){_0x422a15['replaceChildren'](),_0x2a14e4['forEach'](_0x191fab=>{if(_0x191fab['element']){const _0x5749e1=_0x191fab['element']['cloneNode'](!0x0);_0x422a15['appendChild'](_0x5749e1);}}),_0x422a15['offsetWidth'];const _0x53206b=_0x422a15['children'],_0x3a8ac5=[];return Array['from'](_0x53206b)['forEach'](_0x25c7f4=>{const _0x2ba85d=_0x25c7f4['getBoundingClientRect']()['top'];_0x3a8ac5['some'](_0x10a1f0=>Math['abs'](_0x10a1f0-_0x2ba85d)<this['_config']['rowDetectionTolerance'])||_0x3a8ac5['push'](_0x2ba85d);}),{'rowCount':_0x3a8ac5['length']};}_createMockButton(){const _0x46e83c=document['createElement']('button');_0x46e83c['className']='ck\x20ck-button\x20ck-off\x20ck-button_with-text\x20'+this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x46e83c['classList']['add'](this['_config']['cssClasses']['controlsButton']);const _0x6f99f9=document['createElement']('span');return _0x6f99f9['className']='ck\x20ck-button__label',_0x6f99f9['textContent']=this['_config']['showMoreLabelPrefix']+'1',_0x46e83c['appendChild'](_0x6f99f9),_0x46e83c;}_testButtonFit(_0x4b3661,_0x3d6cbc,_0x4bf279){this['_renderChipsAndCountRows'](_0x3d6cbc,_0x4bf279);const _0x59ea0d=this['_createMockButton']();_0x4b3661['appendChild'](_0x59ea0d),_0x4b3661['offsetWidth'];const _0x14d82c=[..._0x3d6cbc['children'],_0x59ea0d],_0x4d6644=[];_0x14d82c['forEach'](_0x514e6=>{const _0x358dbd=_0x514e6['getBoundingClientRect']()['top'];_0x4d6644['some'](_0x5cd2d5=>Math['abs'](_0x5cd2d5-_0x358dbd)<this['_config']['rowDetectionTolerance'])||_0x4d6644['push'](_0x358dbd);});const _0x439e36=_0x4d6644['length'];return _0x59ea0d['remove'](),_0x439e36<=this['_config']['maxVisibleRows'];}_distributeChips(_0x15f1cd,_0x13fec6){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x15f1cd['forEach'](_0x175433=>{_0x13fec6['includes'](_0x175433)?this['_overflowChips']['add'](_0x175433):this['_visibleChips']['add'](_0x175433);});}_updateOverflowUI(_0x4b5489){if(_0x4b5489>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x4b5489>0x0&&this['_showMoreButtonView']){const _0x4a9f0c=''+this['_config']['showMoreLabelPrefix']+Math['min'](_0x4b5489,0x9);this['_showMoreButtonView']['label']=_0x4a9f0c;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}_applyOverflowResults(_0x336c50,_0x40ea46){this['_distributeChips'](_0x336c50,_0x40ea46),this['_updateOverflowUI'](_0x40ea46['length']);}_setupVisibilityObserver(){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0xbb712c=>{_0xbb712c[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 _0x2abc24=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x2abc24['width']||0x0===_0x2abc24['height'])return!0x1;const _0x5bcce6=window['innerHeight']||document['documentElement']['clientHeight'],_0x2a3ebf=window['innerWidth']||document['documentElement']['clientWidth'];return _0x2abc24['bottom']>=-0xc8&&_0x2abc24['top']<=_0x5bcce6+0xc8&&_0x2abc24['right']>=-0xc8&&_0x2abc24['left']<=_0x2a3ebf+0xc8;}};const Bo='ck-ai-chat__feed__context-chips',Go='ck-ai-chat-context-chips-wrapper',Wo='ck-ai-chat-context-chips-wrapper-balloon',Fo='ck-ai-chat-controls-button',Ko='ck-ai-chat-controls_context_show-more-button',$o='ck-ai-chat-context-controls__show-more-balloon-panel';var Yo=class extends _0x43ad99{_contextChips=this['createCollection']();['_overflowManager'];_bodyCollection;constructor(_0x1e499e,_0x5d917b,_0x341901){super(_0x1e499e),this['_bodyCollection']=_0x341901,this['_createContextChips'](_0x5d917b);const _0x3fbe96={'cssClasses':{'showMoreButton':Ko+'\x20'+Ar,'showMoreBalloon':$o,'overflowContainer':Wo,'controlsButton':Fo},'getLimiterElement':()=>ah(this['element'])};this['_overflowManager']=new Uo(_0x1e499e,this['_contextChips'],_0x3fbe96,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Bo,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Go},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x442aa7=this['element']['querySelector']('.'+Go);_0x442aa7&&(this['_overflowManager']['setContainerElement'](_0x442aa7),this['_overflowManager']['reorganizeChips']());}destroy(){super['destroy'](),this['_overflowManager']['destroy']();}_createContextChips(_0x5dd32f){for(const _0x586055 of _0x5dd32f){const _0x249878=new Po(this['locale'],_0x586055,!0x0,!0x1);this['_contextChips']['add'](_0x249878);}}},qo=class extends Zr{_contextChipsView=null;['_locale'];_bodyCollection;_messageContentView;constructor(_0x2858d2,_0x3edd47,_0x52996d){super(_0x3edd47),this['_locale']=_0x2858d2,this['_bodyCollection']=_0x52996d,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 Yo(this['_locale'],this['options']['contextItems']['filter'](_0x52c148=>!_0x52c148['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}_createMessageContentView(){this['_messageContentView']=new _0x43ad99(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':['ck-reset_all-excluded','ck-ai-chat__feed__message-content','ck-ai-chat-content']}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=Qt(this['options']['initialContent']),this['markAsDone']();}},Qo=class extends Zr{capabilities;constructor(_0x507b44,_0x4d7098){super(_0x4d7098);const {isWebSearchEnabled:_0x4206eb,isReasoningEnabled:_0x30e2a3}=_0x4d7098['capabilities'],_0x20d2c3=[];let _0x6e3acf='';_0x4206eb&&_0x30e2a3?(_0x6e3acf=qs(_0x507b44,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x20d2c3['push'](Xo(ut)),_0x20d2c3['push'](Xo(_0x18ee94))):_0x4206eb?(_0x6e3acf=qs(_0x507b44,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x20d2c3['push'](Xo(ut))):_0x30e2a3&&(_0x6e3acf=qs(_0x507b44,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x20d2c3['push'](Xo(_0x18ee94))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x6e3acf?'':'ck-hidden']}});const _0xea5864=new _0x43ad99();_0xea5864['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x20d2c3,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x6e3acf]}]}),this['children']['add'](_0xea5864),this['capabilities']=_0x4d7098['capabilities'];}};function Xo(_0x43d40a){const _0x37e57e=new _0x3188b1();return _0x37e57e['content']=_0x43d40a,_0x37e57e;}const zo=['wheel','touchstart','pointerdown','keydown'],jo=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];var Jo=class{element;animationFrameId;['isRunning'];abortController;['isUserPaused'];['scrollBehavior'];constructor(_0x464255){this['element']=_0x464255,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1,this['scrollBehavior']='smooth';for(const _0x3aa9f0 of zo){const _0x52e9dc='keydown'!==_0x3aa9f0;this['element']['addEventListener'](_0x3aa9f0,this['_onUserEvent']['bind'](this),{'passive':_0x52e9dc,'signal':this['abortController']['signal']});}}start({smooth:_0x538405=!0x0}={}){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,this['scrollBehavior']=_0x538405?'smooth':'auto',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(_0x5caf94){if(this['isRunning']){if('keydown'===_0x5caf94['type']){const _0x519d60=_0x5caf94['key'];if(!jo['includes'](_0x519d60))return;}_0x5caf94 instanceof WheelEvent?_0x5caf94['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}_isAtBottom(){const {scrollTop:_0x102b60,scrollHeight:_0x5eb5ed,clientHeight:_0x468980}=this['element'];return _0x5eb5ed-_0x102b60-_0x468980<=0x5;}_rafUpdate(){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':this['scrollBehavior']}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}},Zo=class extends _0x43ad99{constructor(_0x22c5cd){super(_0x22c5cd),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-dots-loader']},'children':new Array(0x3)['fill'](null)['map'](()=>({'tag':'div','attributes':{'class':['ck-ai-dots-loader__dot']}}))});}},ta=class extends Zr{constructor(_0x5b13ed){super(_0x5b13ed),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__custom-element']}});}async['render'](){super['render'](),'string'==typeof this['options']['content']?this['element']['innerHTML']=Qt(this['options']['content']):this['element']['appendChild'](this['options']['content']);}},ea=class extends _0x43ad99{['children'];['scrollManager'];_bodyCollection;constructor(_0x502721,_0x3fb47e){super(_0x502721),this['_bodyCollection']=_0x3fb47e,this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('loadingSkeletonType','conversation'),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Yr)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Jo(this['element']);}destroy(){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}addItem(_0x6f916f,_0x291f18){let _0xa5f74b;return'ai-reply'===_0x6f916f?_0xa5f74b=new bo(this['locale'],_0x291f18,this['_bodyCollection']):'ai-suggestion-reply'===_0x6f916f?(_0xa5f74b=new Ro(this['locale'],_0x291f18,this['_bodyCollection']),_0xa5f74b['bind']('isTrackChangesOn')['to'](this)):_0xa5f74b='user-message'===_0x6f916f?new qo(this['locale'],_0x291f18,this['_bodyCollection']):'interaction-header'===_0x6f916f?new Qo(this['locale'],_0x291f18):'custom-element'===_0x6f916f?new ta(_0x291f18):new Eo(_0x291f18),this['children']['add'](_0xa5f74b),_0xa5f74b;}async updateReplyItem({id:_0x1e98c3,parsedContent:_0x399917,renderingStrategy:_0x10fe1d,abortSignal:_0x63e087}){const _0x4ebbdb=this['getItemById'](_0x1e98c3);if(!(_0x4ebbdb instanceof bo))throw new dt('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x4ebbdb,'id':_0x1e98c3,'parsedContent':_0x399917});await _0x4ebbdb['updateContent']({'parsedContent':_0x399917,'renderingStrategy':_0x10fe1d,'abortSignal':_0x63e087});}async updateWebSources(_0x4024d5,_0x2f8ccc){const _0x5c425c=this['getItemById'](_0x4024d5);if(_0x5c425c instanceof Ro)_0x5c425c['updateSources'](_0x2f8ccc);else{if(!(_0x5c425c instanceof bo))throw new dt('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x5c425c,'id':_0x4024d5,'sources':_0x2f8ccc});_0x5c425c['updateSources'](_0x2f8ccc);}}async updateSuggestionItem({id:_0x12e0c3,parts:_0x2ea8b0,abortSignal:_0x2de598,skipLoadingEffects:_0x1f4f6d}){const _0x16993a=this['getItemById'](_0x12e0c3);if(!(_0x16993a instanceof Ro))throw new dt('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x16993a,'id':_0x12e0c3,'parts':_0x2ea8b0});await _0x16993a['updateContent']({'parts':_0x2ea8b0,'abortSignal':_0x2de598,'skipLoadingEffects':_0x1f4f6d});}updateSuggestionPartState({id:_0x51a952,index:_0x6f22f6,state:_0x33bbfc,outdatedReason:_0x11629c}){const _0x3acbcf=this['getItemById'](_0x51a952);if(!(_0x3acbcf instanceof Ro))throw new dt('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x51a952});_0x3acbcf['updatePartState'](_0x6f22f6,_0x33bbfc,_0x11629c);}updateSuggestionGating(_0x312a0e,_0x537b1e){const _0x11b8fd=this['getItemById'](_0x312a0e);if(!(_0x11b8fd instanceof Ro))throw new dt('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x312a0e});_0x11b8fd['setGating'](_0x537b1e);}getSuggestionPartUIIndex({id:_0x275753,index:_0x3a96d4}){if(!this['hasItem'](_0x275753))return null;const _0x33e60f=this['getItemById'](_0x275753);return _0x33e60f instanceof Ro?_0x33e60f['getPartView'](_0x3a96d4)?.['uiIndex']??null:null;}setSuggestionPartActive({id:_0x46c5f3,index:_0x123a4e,isActive:_0x2fa8ad}){const _0x3d3077=this['getItemById'](_0x46c5f3);if(!(_0x3d3077 instanceof Ro))throw new dt('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x46c5f3});this['children']['filter'](_0x4d755a=>_0x4d755a instanceof Ro)['forEach'](_0x55542f=>{_0x55542f['setPartActive'](!0x1);}),_0x3d3077['setPartActive'](_0x123a4e,_0x2fa8ad);}markItemAsDone(_0x2f2179){this['getItemById'](_0x2f2179)['markAsDone']();}getItemIds(){return this['children']['map'](_0x2b9e65=>_0x2b9e65['options']['id']);}removeItem(_0x54a11c){this['children']['remove'](this['getItemById'](_0x54a11c));}hasItem(_0x32305a){return!!this['children']['find'](_0x34db7d=>_0x34db7d['options']['id']['includes'](_0x32305a));}scrollToSuggestion(_0x2335ef,_0x5ae9de){const _0x953cdb=this['getItemById'](_0x2335ef);if(!(_0x953cdb instanceof Ro))return void Ft('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x2335ef,'partIndex':_0x5ae9de});const _0x4ed11e=_0x953cdb['getPartView'](_0x5ae9de);if(_0x4ed11e){const _0x77c939=kt(this['element']);_0x77c939 instanceof HTMLElement&&$t(_0x4ed11e['element'],0x14,_0x77c939,!0x0,!0x0);}else Ft('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x2335ef,'partIndex':_0x5ae9de});}_setupTemplate(){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}_createTemplateChildren(){const _0x47ddf6=this['_createSkeletonLoader']('init',uo['aiChatInit'],'ck-ai-chat__feed__init-skeleton'),_0xb9ab5f=this['_createSkeletonLoader']('conversation',uo['aiFeed']);return[this['_createFeedItems'](),_0x47ddf6,_0xb9ab5f,this['_createFeedLoader']()];}_createSkeletonLoader(_0x42e610,_0x5e7285,_0x3f33aa){const _0x5d88ec=new lo(this['locale'],_0x5e7285);return _0x3f33aa&&_0x5d88ec['extendTemplate']({'attributes':{'class':[_0x3f33aa]}}),_0x5d88ec['bind']('isVisible')['to'](this,'isLoadingSkeletonVisible',this,'loadingSkeletonType',(_0x24e23a,_0x1298cb)=>_0x24e23a&&_0x1298cb==_0x42e610),_0x5d88ec;}_createFeedItems(){const _0x4ae9d1=new _0x43ad99(this['locale']);return _0x4ae9d1['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x4ae9d1;}_createFeedLoader(){const _0x441de7=new _0x43ad99(this['locale']);return _0x441de7['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('loadingMessage','ck-hidden',_0xb3d00e=>!_0xb3d00e)]},'children':this['_createLoaderChildren']()}),_0x441de7;}_createLoaderChildren(){return[new Zo(this['locale']),{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}getItemById(_0x3b7fae){const _0x4e80f5=this['children']['find'](_0x36e79f=>_0x36e79f['options']['id']['includes'](_0x3b7fae));if(!_0x4e80f5)throw new dt('ai-chat-feed-view-item-not-found',this,{'id':_0x3b7fae});return _0x4e80f5;}setLoadingMessage(_0x370441){this['set']('loadingMessage',_0x370441);}toggleLoadingSkeleton(_0x496eb7,_0x195250='conversation'){(_0x496eb7||this['loadingSkeletonType']==_0x195250)&&(this['set']('loadingSkeletonType',_0x195250),this['set']('isLoadingSkeletonVisible',_0x496eb7));}startAutoScroll(_0x389916={}){this['scrollManager']['start'](_0x389916);}stopAutoScroll(){this['scrollManager']['stop']();}},ia=class extends _0x35138b{filter(){let _0x39ceae=0x0;for(const _0x1cef8f of this['items'])_0x39ceae+=_0x1cef8f['items']['length'];return{'resultsCount':_0x39ceae,'totalItemsCount':_0x39ceae};}};function sa(_0x11a8be){const _0x3bf49b=[];let _0x27c123=!0x1;for(const _0x4bd032 of Array['from'](_0x11a8be['items'])){if('file'!==_0x4bd032['kind'])continue;if(_0x4bd032['webkitGetAsEntry']()?.['isDirectory']){_0x27c123=!0x0;continue;}const _0x29c662=_0x4bd032['getAsFile']();_0x29c662&&_0x3bf49b['push'](_0x29c662);}return{'files':_0x3bf49b,'hasDirectory':_0x27c123};}const na='ck-ai-chat__prompt-input_highlighted';var ra=class AIChatPromptInputView extends jt{actionButtonView;static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;_addContextButtonView;['_queryViewResizeObserver'];constructor(_0x281866,_0x26067c){super(_0x281866,{'queryView':{'label':'','creator':_0x2f0e4a,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new ia(_0x281866),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['set']('isBusy',!0x1),this['_addContextButtonView']=_0x26067c,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=AIChatPromptInputView['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=AIChatPromptInputView['MAX_ROWS'],this['bind']('isEnabled')['to'](this,'isBusy',_0x798c40=>!_0x798c40),this['queryView']['fieldWrapperChildren']['add'](this['_addContextButtonView']),this['_setUpAddContextButtonPositioning'](),this['extendTemplate']({'attributes':{'class':['ck','ck-ai-chat__prompt-input']}}),this['bind']('canSubmit')['to'](this,'isEmpty',this,'isUploadInProgress',this,'isBusy',(_0x4b4abe,_0x4abf6d,_0x5bb262)=>!_0x4b4abe&&!_0x4abf6d&&!_0x5bb262),this['actionButtonView']=this['_createActionButton'](),this['actionButtonView']['bind']('isEnabled')['to'](this,'canSubmit',this,'isBusy',(_0x2e0e7f,_0x501dc8)=>_0x2e0e7f||_0x501dc8),this['focusableChildren']['add'](this['actionButtonView']),this['on']('change:isBusy',(_0x3a9c32,_0x57e31d,_0x12a0d4)=>{_0x12a0d4||vt(this['actionButtonView']['element'])!==this['actionButtonView']['element']||this['focus']();});}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['actionButtonView']),this['keystrokes']['set']('enter',(_0x1409fb,_0x532024)=>{this['canSubmit']&&_0x1409fb['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x532024());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();}),this['queryView']['fieldView']['element']['addEventListener']('paste',_0x415b2b=>this['_handlePaste'](_0x415b2b)),this['element']['addEventListener']('drop',_0x35b9ca=>this['_handleDrop'](_0x35b9ca));}_handlePaste(_0x594d84){const _0x18ac7b=_0x594d84['clipboardData'];if(!_0x18ac7b||this['isBusy'])return;const {files:_0x4d9c83,hasDirectory:_0x385653}=sa(_0x18ac7b),_0x370d0e={'files':_0x4d9c83,'plainText':_0x18ac7b['getData']('text/plain'),'hasDirectory':_0x385653,'forceTextAttachment':!0x1,'preventDefault':()=>_0x594d84['preventDefault']()};this['fire']('promptInputPaste',_0x370d0e);}['_handleDrop'](_0x31cd52){const _0x4bb503=_0x31cd52['dataTransfer'];if(!_0x4bb503||this['isBusy'])return;const _0x29dbb0={'files':[],'plainText':_0x4bb503['getData']('text/uri-list')||_0x4bb503['getData']('text/plain'),'hasDirectory':!0x1,'forceTextAttachment':!0x1,'preventDefault':()=>_0x31cd52['preventDefault']()};this['fire']('promptInputPaste',_0x29dbb0);}destroy(){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}submit(){const _0xdf8798=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0xdf8798)return this['queryView']['errorText']=qs(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x10f089=_0x137309(_0xdf8798);this['fire']('sendUserMessage',_0x10f089),this['queryView']['fieldView']['reset']();}setPlaceholderText(_0x52658c){this['queryView']['fieldView']['set']('placeholder',_0x52658c);}['focus'](_0x4026ec=!0x1){super['focus'](),_0x4026ec&&(this['element']['classList']['contains'](na)||(this['element']['classList']['add'](na),setTimeout(()=>{this['element']['classList']['remove'](na);},0x320)));}_createActionButton(){const _0xcf1a57=new _0x1b12df(this['locale']);return _0xcf1a57['set']({'isVisible':!0x0,'tooltip':!0x0,'isEnabled':!0x1}),_0xcf1a57['bind']('icon')['to'](this,'isBusy',_0x1ae5a2=>_0x1ae5a2?ot:at),_0xcf1a57['bind']('label')['to'](this,'isBusy',_0xa0bdc3=>qs(this['locale'],_0xa0bdc3?'AI_CHAT_STOP_GENERATING':'AI_CHAT_LABEL_SUBMIT')),_0xcf1a57['bind']('class')['to'](this,'isBusy',_0x4f9812=>'ck-ai-chat__prompt-submit-button\x20'+(_0x4f9812?Ir:gr)),_0xcf1a57['on']('execute',()=>{this['isBusy']?this['fire']('abortPromptStream'):this['submit']();}),_0xcf1a57;}setIsUploadInProgress(_0x2cb573){this['isUploadInProgress']=_0x2cb573;}_setUpAddContextButtonPositioning(){const _0xaab3c4=this['locale'],_0x3f537e=()=>{Vt['window']['requestAnimationFrame'](()=>{if(Bt(this['element'])){const _0x440fb6=new Tt(this['queryView']['fieldView']['element']),_0x2836f6=new Tt(this['_addContextButtonView']['element']),_0xaa2e9=_0x440fb6['width'],_0x335904='rtl'===_0xaab3c4['uiLanguageDirection']?'right':'left';_0x440fb6['excludeScrollbarsAndBorders']();const _0x3c3f60=_0xaa2e9-_0x440fb6['width']+0x1;this['_addContextButtonView']['element']['style'][_0x335904]='calc('+(_0xaa2e9-_0x2836f6['width']-_0x3c3f60)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x3f537e),this['on']('render',()=>{_0x3f537e(),this['_queryViewResizeObserver']=new wt(this['queryView']['fieldView']['element'],()=>{_0x3f537e();});});}},oa=class extends _0x43ad99{constructor(_0x16ecce){super(_0x16ecce),this['set']('isEnabled',!0x0);const _0x322bfb=new _0x3188b1();_0x322bfb['content']=_0x3ee9d9,this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-controls__drop-overlay']},'children':[_0x322bfb,{'tag':'span','attributes':{'class':['ck-ai-chat-controls__drop-overlay__label']},'children':[{'text':qs(_0x16ecce,'AI_CHAT_DROP_ZONE_HINT')}]}]});}attach(_0x583583){let _0x2fd427=0x0;const _0x4ad08a=()=>{_0x583583['classList']['toggle']('ck-ai-chat-controls_drag-over',this['isEnabled']&&_0x2fd427>0x0);};this['on']('change:isEnabled',(_0x59036e,_0x194c6f,_0x11df81)=>{_0x11df81&&_0x2fd427>0x0&&this['fire']('dragEnter'),_0x4ad08a();}),_0x583583['addEventListener']('dragenter',_0x1c322d=>{_0x1c322d['dataTransfer']&&(_0x2fd427++,0x1===_0x2fd427&&this['isEnabled']&&this['fire']('dragEnter'),_0x4ad08a());}),_0x583583['addEventListener']('dragover',_0x3f981a=>{_0x3f981a['dataTransfer']&&_0x3f981a['preventDefault']();}),_0x583583['addEventListener']('dragleave',()=>{--_0x2fd427<0x0&&(_0x2fd427=0x0),_0x4ad08a();}),_0x583583['addEventListener']('drop',_0x5b7eed=>{_0x5b7eed['preventDefault'](),_0x2fd427=0x0,_0x4ad08a(),this['isEnabled']&&this['_handleDrop'](_0x5b7eed);});}['_handleDrop'](_0x222b9c){const _0x40b3e1=_0x222b9c['dataTransfer'];if(!_0x40b3e1)return;const {files:_0x3bd54f,hasDirectory:_0x2e5059}=sa(_0x40b3e1),_0xb2c02e={'files':_0x3bd54f,'plainText':_0x40b3e1['getData']('text/uri-list')||_0x40b3e1['getData']('text/plain'),'hasDirectory':_0x2e5059,'forceTextAttachment':!0x0,'preventDefault':()=>{}};this['fire']('promptInputPaste',_0xb2c02e);}};const aa='ck-ai-model-selector__item-name',ha='ck-ai-model-selector__item-description',ca='ck-ai-model-selector__item-capabilities';var la=class extends _0x43ad99{['dropdownView'];['nameView'];_items;['_config'];constructor(_0x5253b9,_0x1d8478){super(_0x5253b9),this['_config']=_0x1d8478,this['set']('modelDisplayMode','selector'),this['set']('activeModelId',null),this['set']('activeModelName',null),this['set']('isEnabled',!0x0),this['dropdownView']=this['_createDropdown'](),this['_items']=new _t(),_0xb17444(this['dropdownView'],this['_items']),this['nameView']=new ua(_0x5253b9,_0x1d8478['nameClass']),this['nameView']['bind']('text')['to'](this,'activeModelName',_0x404c2c=>_0x404c2c??''),this['nameView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x143e58=>'name'===_0x143e58),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-model-selector']},'children':[this['dropdownView'],this['nameView']]});}setModels(_0x37ffed,_0x279e01){var _0x5001a0;this['set']('modelDisplayMode',(_0x5001a0=_0x37ffed['length'],_0x279e01?0x1===_0x5001a0?'name':'selector':'hidden')),this['_items']['clear'](),0x1===_0x37ffed['length']&&this['set']('activeModelName',_0x37ffed[0x0]['name']||_0x37ffed[0x0]['id']);for(const _0x1a231a of _0x37ffed){const _0x9203f=new _0x5f2643({'label':_0x1a231a['name'],'withText':!0x0,'role':'menuitemradio','id':_0x1a231a['id'],'model':_0x1a231a});_0x9203f['bind']('isOn')['to'](this,'activeModelId',_0x2e0cb8=>_0x2e0cb8===_0x1a231a['id']),this['_items']['add']({'type':'button','model':_0x9203f,'labelView':new da(this['locale'],_0x1a231a,{'nameClass':this['_config']['itemClasses']['name'],'descriptionClass':this['_config']['itemClasses']['description'],'capabilitiesClass':this['_config']['itemClasses']['capabilities'],'extraContent':this['_config']['showCapabilities']?_a(this['locale'],_0x1a231a,this['_config']['tooltipPosition']):void 0x0})});}}setSelectedModel(_0x4b3451){this['set']('activeModelId',_0x4b3451?_0x4b3451['id']:null),this['set']('activeModelName',_0x4b3451?_0x4b3451['name']||_0x4b3451['id']:null);}_createDropdown(){const _0x5d5701=_0x348de2(this['locale']);return _0x5d5701['set']({'panelPosition':this['_config']['panelPosition'],'class':Array['isArray'](this['_config']['dropdownClass'])?this['_config']['dropdownClass']['join']('\x20'):this['_config']['dropdownClass']}),_0x5d5701['panelPositionLimiter']=()=>{const _0xd84c8=_0x5d5701['buttonView']['element'];return _0xd84c8&&St(_0xd84c8);},_0x5d5701['buttonView']['set']({'withText':!0x0,'tooltipPosition':this['_config']['tooltipPosition'],'class':'ck-button_small\x20'+Ar}),_0x5d5701['buttonView']['bind']('label')['to'](this,'activeModelName',_0x41bcc5=>_0x41bcc5??this['_config']['defaultLabel']??''),_0x5d5701['buttonView']['bind']('tooltip')['to'](this,'activeModelName',this,'isEnabled',(_0x2ab00f,_0x19e432)=>!_0x19e432&&this['_config']['disabledTooltip']?this['_config']['disabledTooltip']:_0x2ab00f??this['_config']['defaultLabel']??''),_0x5d5701['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x85ce98=>'selector'===_0x85ce98),_0x5d5701['bind']('isEnabled')['to'](this,'isEnabled'),this['listenTo'](_0x5d5701,'execute',_0x545c2c=>{this['fire']('selectModel',_0x545c2c['source']['model']);}),_0x5d5701;}},ua=class extends _0x43ad99{constructor(_0x1c32c1,_0xf00716){super(_0x1c32c1),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x8a25a6=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck',_0xf00716,_0x8a25a6['if']('isVisible','ck-hidden',_0x13a3ad=>!_0x13a3ad)]},'children':[{'text':_0x8a25a6['to']('text')}]});}},da=class extends te{constructor(_0x3270f0,_0x2e8916,_0x5dfbaa){super();const _0xcfb2fc=this['bindTemplate'],_0x1fc2a6=[{'tag':'span','children':[{'text':_0xcfb2fc['to']('text')}]}];_0x5dfbaa['extraContent']?.['length']&&_0x5dfbaa['capabilitiesClass']&&_0x1fc2a6['push']({'tag':'div','attributes':{'class':[ca,_0x5dfbaa['capabilitiesClass']]},'children':_0x5dfbaa['extraContent']});const _0x50d82b=[{'tag':'div','attributes':{'class':[aa,_0x5dfbaa['nameClass']]},'children':_0x1fc2a6},{'tag':'div','attributes':{'class':[ha,_0x5dfbaa['descriptionClass']]},'children':[{'tag':'span','children':[_0x2e8916['description']||'']}]}];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0xcfb2fc['to']('style'),'id':_0xcfb2fc['to']('id')},'children':_0x50d82b});}};function _a(_0x6df93c,_0x368c87,_0x75e14a){const _0x440b99=[];return _0x368c87['capabilities']['webSearch']?.['enabled']&&_0x440b99['push'](ga(_0x6df93c,ut,'AI_CHAT_SEARCH_WEB',_0x75e14a)),_0x368c87['capabilities']['reasoning']?.['enabled']&&_0x440b99['push'](ga(_0x6df93c,_0x18ee94,'AI_CHAT_REASONING',_0x75e14a)),_0x440b99;}function ga(_0x482c9d,_0x1306ca,_0x145265,_0x52d35e){const _0x503e52=qs(_0x482c9d,_0x145265),_0x2ca6d4=new _0x3188b1();_0x2ca6d4['content']=_0x1306ca;const _0x3067b7=new _0x43ad99(_0x482c9d);return _0x3067b7['setTemplate']({'tag':'span','attributes':{'role':'img','aria-label':_0x503e52,'data-cke-tooltip-text':_0x503e52,'data-cke-tooltip-position':_0x52d35e},'children':[_0x2ca6d4]}),_0x3067b7;}const Ia='ck-ai-chat__prompt-capabilities',Aa='ck-ai-chat-controls-button',Ea='ck-ai-chat-controls__model-selection',pa='ck-ai-chat-controls__model-selection__item-name',ma='ck-ai-chat-controls__model-selection__item-description',Ta='ck-ai-chat-controls__model-selection__item-capabilities',wa='n';var Ca=class extends _0x43ad99{_webSearchButton;_reasoningButton;_modelSelector;constructor(_0x34b274){super(_0x34b274),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelSelectorEnabled',!0x0),this['set']('isBusy',!0x1),this['_modelSelector']=function(_0xb6725f){return new la(_0xb6725f,{'panelPosition':'ne','dropdownClass':[Ea],'nameClass':'ck-ai-chat-controls__model-name','itemClasses':{'name':pa,'description':ma,'capabilities':Ta},'defaultLabel':qs(_0xb6725f,'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'disabledTooltip':qs(_0xb6725f,'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP'),'tooltipPosition':wa,'showCapabilities':!0x0});}(_0x34b274),this['_modelSelector']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x3c24ff=>_0x3c24ff),this['_modelSelector']['delegate']('selectModel')['to'](this),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['setTemplate']({'tag':'div','attributes':{'class':[Ia]},'children':[this['_modelSelector'],this['_webSearchButton'],this['_reasoningButton']]});}setWebSearch(_0xcac77b){this['set']('webSearchActive',_0xcac77b);}setReasoning(_0x25c2f4){this['set']('reasoningActive',_0x25c2f4);}setModelList(_0x5cc740,_0x423268){this['_modelSelector']['setModels'](_0x5cc740,!_0x423268);}setModel(_0x694f02){if(!_0x694f02)return;this['_modelSelector']['setSelectedModel'](_0x694f02);const _0x2d1533=_0x694f02['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isVisible',_0x2d1533);const _0x55c607=_0x694f02['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isVisible',_0x55c607);}enableModelSelector(){this['set']('modelSelectorEnabled',!0x0);}disableModelSelector(_0x2f8b2e){this['set']('modelSelectorEnabled',!0x1),_0x2f8b2e&&(this['_modelSelector']['modelDisplayMode']='hidden');}_createWebSearchButton(){const _0x560a7a=new _0x1b12df();return _0x560a7a['set']({'label':qs(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':ut,'class':Aa+'\x20'+Ar+'\x20ck-button_small','isToggleable':!0x0,'tooltipPosition':wa}),_0x560a7a['bind']('isEnabled')['to'](this,'isBusy',_0x440f26=>!_0x440f26),_0x560a7a['bind']('isOn')['to'](this,'webSearchActive',_0x16caa6=>_0x16caa6),_0x560a7a['bind']('tooltip')['to'](this,'webSearchActive',_0x1bb6e9=>qs(this['locale'],_0x1bb6e9?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),_0x560a7a['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x560a7a;}_createReasoningButton(){const _0x2eea26=new _0x1b12df();return _0x2eea26['set']({'label':qs(this['locale'],'AI_CHAT_REASONING'),'icon':_0x18ee94,'class':Aa+'\x20'+Ar+'\x20ck-button_small','isToggleable':!0x0,'tooltipPosition':wa}),_0x2eea26['bind']('isEnabled')['to'](this,'isBusy',_0x34375c=>!_0x34375c),_0x2eea26['bind']('isOn')['to'](this,'reasoningActive',_0x213e18=>_0x213e18),_0x2eea26['bind']('tooltip')['to'](this,'reasoningActive',_0x203e9e=>qs(this['locale'],_0x203e9e?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),_0x2eea26['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x2eea26;}};const fa='ck-ai-chat-context-controls__url-form',Ra='ck-ai-chat-context-controls__url-input-section';var ba=class extends _0x43ad99{['focusTracker'];keystrokes;['_focusables'];['focusCycler'];urlInputField;backButton;confirmButton;constructor(_0x1632f1){super(_0x1632f1),this['focusTracker']=new Et(),this['keystrokes']=new pt(),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 _0x2dd4b2({'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'](_0x1166f3=>{this['focusTracker']['add'](_0x1166f3['element']),this['keystrokes']['listenTo'](_0x1166f3['element']);}),_0x319cf6({'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(_0x29ee04){this['urlInputField']['errorText']=_0x29ee04,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}_createBackButton(){const _0x83bbc2=new _0x1b12df(this['locale']);return _0x83bbc2['set']({'icon':_0x5c3f8c,'tooltip':qs(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x5f594b,_0x1c1276,_0x2a6ce2)=>{_0x83bbc2['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x2a6ce2?'':'\x20ck-hidden')]});}),_0x83bbc2;}_createUrlInputField(){const _0xfbe4bf=new _0x39833d(this['locale'],_0x220632);return _0xfbe4bf['set']({'label':qs(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0xfbe4bf['fieldView']['set']({'placeholder':qs(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0xfbe4bf;}_createConfirmButton(){const _0x950a5a=new _0x1b12df(this['locale']);return _0x950a5a['set']({'icon':_0x3e619a,'tooltip':qs(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x950a5a;}_setupTemplate(){const _0x6ddf7=new _0x2bed87(this['locale'],{'label':qs(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL')});_0x6ddf7['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':fa,'tabindex':'-1'},'children':[_0x6ddf7,{'tag':'div','attributes':{'class':Ra},'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',_0x502083=>{_0x502083['stop'](),this['_handleSubmit']();});}_setupKeystrokes(){this['keystrokes']['set']('esc',(_0x59375a,_0xbd1111)=>{this['clear'](),this['fire']('cancel'),_0xbd1111();});}_handleSubmit(){const _0x369508=this['getValue']()['trim']();_0x369508?this['_isValidUrl'](_0x369508)?(this['clearError'](),this['fire']('submitUrl',_0x369508)):this['setError'](qs(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](qs(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}_updateConfirmButtonState(){const _0xb4bd58=this['getValue']()['trim'](),_0x2bc984=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0xb4bd58['length']>0x0&&!_0x2bc984;}['_isValidUrl'](_0xa44f94){try{return!!new URL(_0xa44f94);}catch{return!0x1;}}};const Sa='ck-ai-chat-resources__item',Oa='ck-ai-chat-resources__item--in-context',va='ck-ai-chat-resources__item-title',ya='ck-ai-chat-resources__item__icon',Na='ck-ai-chat-resources__item__check';var ka=class extends _0x5be144{['resource'];_titleView;['_iconView'];['_checkIconView'];constructor(_0x4ce485,_0x916ed4){super(_0x4ce485),this['resource']=_0x916ed4,this['set']('isInContext',!!_0x916ed4['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_checkIconView']=this['_createCheckIconView'](),this['_setupTemplate']();}['render'](){super['render']();}getResourceIcon(_0x53706e){switch(_0x53706e['type']){case'document':return _0x2f2aeb;case'web-resource':return _0x4d1c13;case'file':case'text':return _0x3ee9d9;default:return _0x286228;}}highlightText(_0x1e04fc){if(!_0x1e04fc||''===_0x1e04fc['trim']())return void this['_titleView']['highlightText'](null);const _0x57cc32=new RegExp(_0x55bbed(_0x1e04fc),'gi');this['_titleView']['highlightText'](_0x57cc32);}updateResourceState(_0x2ea9c4){this['resource']['isInContext']=_0x2ea9c4,this['isInContext']=_0x2ea9c4;}_createTitleView(){const _0x1ad353=new _0x473cf4();return _0x1ad353['text']=this['resource']['label'],_0x1ad353['extendTemplate']({'tag':'span','attributes':{'class':[va]}}),_0x1ad353;}_createIconView(){const _0x257530=new _0x3188b1();return _0x257530['content']=this['getResourceIcon'](this['resource']),_0x257530;}_createCheckIconView(){const _0x5984bb=new _0x3188b1();return _0x5984bb['content']=_0x3e619a,_0x5984bb['bind']('isVisible')['to'](this,'isInContext'),_0x5984bb;}_setupTemplate(){const _0x31b070=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Sa,_0x31b070['if']('isVisible','ck-hidden',_0x38c8ef=>!_0x38c8ef),_0x31b070['if']('isInContext',Oa)]},'children':[{'tag':'div','attributes':{'class':[Na]},'children':[this['_checkIconView']]},{'tag':'div','attributes':{'class':[ya]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x31b070['to']('execute')}});}};const xa='ck-ai-chat-resources__list';var La=class extends _0x35138b{['_source'];constructor(_0x162d2e,_0x1a32ac){super(_0x162d2e),this['_source']=_0x1a32ac,this['extendTemplate']({'attributes':{'class':[xa]}});}setResources(_0x3e8090,_0x453f30){this['items']['clear']();let _0x3bd96d=_0x3e8090;if(this['_source']['useDefaultFiltering']&&_0x453f30&&''!==_0x453f30['trim']()){const _0x3ebddd=new RegExp(_0x453f30['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x3bd96d=_0x3e8090['filter'](_0x1a7537=>_0x3ebddd['test'](_0x1a7537['label']));}for(const _0x310adb of _0x3bd96d){const _0x32ff0c=new ka(this['locale'],_0x310adb);_0x32ff0c['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x310adb);}),this['items']['add'](_0x32ff0c);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x453f30);}highlightText(_0x5f5bb9){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x8c32bc=>{_0x8c32bc['highlightText'](_0x5f5bb9);});}updateResourceState(_0x28b12a,_0x4d07df){for(const _0x1d2911 of this['items']){const _0x2268c3=_0x1d2911;_0x2268c3['resource']['id']===_0x28b12a&&_0x2268c3['updateResourceState'](_0x4d07df);}}_handleResourceSelection(_0x3a5794,_0x46e14f){this['fire']('addResourceToContext',{'source':_0x3a5794,'resource':_0x46e14f});}},Da=class extends _0x39833d{['iconView'];resetButtonView;['_viewConfig'];constructor(_0x63c4f5){const t=_0x63c4f5['t'],_0x130d97={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x220632,'label':qs(_0x63c4f5,'AI_CHAT_SEARCH_RESOURCES')};super(_0x63c4f5,_0x130d97['creator']),this['label']=_0x130d97['label'],this['_viewConfig']=_0x130d97,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x63c4f5,t),this['_setupEventListeners']();}reset(){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x595fff){this['fire']('search',_0x595fff);}getQuery(){return this['fieldView']['element']?.['value']||'';}_setupSearchIcon(){this['iconView']=new _0x3188b1(),this['iconView']['content']=_0x214d18,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}_setupResetButton(_0x27ca84,t){this['resetButtonView']=new _0x1b12df(_0x27ca84),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x467543,'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',_0x2840d7=>!_0x2840d7),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);}},Pa=class extends _0x43ad99{['_searchView'];_searchSection;_searchInputVisibleFrom;_resourcesListView;_skeletonLoader;['_source'];['children'];_latestLoadResourcesUid=null;constructor(_0x349cd8,_0x545444){super(_0x349cd8),this['_source']=_0x545444['source'],this['_searchInputVisibleFrom']=_0x545444['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 _0x4a09f9([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}_createSearchView(){return new Da(this['locale']);}_createSearchSection(){const _0x15edad=new _0x43ad99(this['locale']);return _0x15edad['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x312295,_0x57668c)=>{this['loadResources'](_0x57668c),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x57668c);}),_0x15edad;}_createResourcesListView(){const _0x2c790b=new La(this['locale'],this['_source']);return _0x2c790b['delegate']('addResourceToContext')['to'](this),_0x2c790b['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x2c790b;}_createSkeletonView(){const _0xd44908=new lo(this['locale'],uo['aiChatResources']);return _0xd44908['bind']('isVisible')['to'](this,'isLoading'),_0xd44908;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x1e1633){const _0x5376ff=Xt();this['_latestLoadResourcesUid']=_0x5376ff,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x1e1633,'uid':_0x5376ff}),this['isLoading']=!0x0;}setResources(_0x829532,_0x2def80){if(_0x2def80&&_0x2def80!==this['_latestLoadResourcesUid'])return;const _0x3069f2=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x829532,_0x3069f2),_0x829532['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}updateResourceState(_0x55136a,_0x4ae9a3){this['_resourcesListView']['updateResourceState'](_0x55136a,_0x4ae9a3);}};const Ma='ck-ai-chat-context-controls__source-balloon-panel',Va='ck-button-icon\x20ck-button-back';var Ha=class{['_sourceResourceBalloons']=new Map();_bodyCollection;['_locale'];['_config'];constructor(_0x56d49c,_0x254b53,_0x22a9ed){this['_locale']=_0x56d49c,this['_bodyCollection']=_0x254b53,this['_config']=_0x22a9ed;}['showSourceResourcesBalloon']({source:_0x250b84,withBackButton:_0x2b5663}){let _0x45cb8e=this['_sourceResourceBalloons']['get'](_0x250b84['id']);_0x45cb8e||(_0x45cb8e=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x250b84['id'],_0x45cb8e),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x45cb8e)),this['_addSourceResourceContent']({'balloonPanel':_0x45cb8e,'source':_0x250b84,'withBackButton':_0x2b5663}),_0x45cb8e['show']();const _0x2ee754=this['_config']['getTargetElement']();_0x2ee754&&_0x45cb8e['pin']({'target':_0x2ee754,'limiter':this['_config']['getLimiterElement']()});}populateSourceResourceBalloon(_0x22b995,_0x14878c,_0x59b333){const _0x5d0ede=this['_sourceResourceBalloons']['get'](_0x22b995);if(!_0x5d0ede)return;const _0xae6dcf=this['_getResourcesViewFromBalloon'](_0x5d0ede);_0xae6dcf&&(_0xae6dcf['setResources'](_0x14878c,_0x59b333),_0xae6dcf['once']('change:isLoading',()=>{_0x5d0ede['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x524b6b){const _0x13b16a=this['_sourceResourceBalloons']['get'](_0x524b6b);_0x13b16a&&requestAnimationFrame(()=>{_0x13b16a['hide'](),this['_sourceResourceBalloons']['delete'](_0x524b6b),this['_config']['onBalloonClosed']();});}['closeAll'](){for(const _0x295a31 of Array['from'](this['_sourceResourceBalloons']['keys']()))this['closeSourceResourceBalloon'](_0x295a31);}['isAnyResourceBalloonVisible'](){for(const _0x3c5a50 of this['_sourceResourceBalloons']['values']())if(_0x3c5a50['isVisible'])return!0x0;return!0x1;}updateResourceState(_0x5e6fab,_0x217a75,_0x429810){const _0x547198=this['_sourceResourceBalloons']['get'](_0x5e6fab);if(!_0x547198||!_0x547198['isVisible'])return;const _0x59f53d=this['_config']['getTargetElement']();if(!_0x59f53d)return;_0x547198['pin']({'target':_0x59f53d,'limiter':this['_config']['getLimiterElement']()});const _0x2e8817=this['_getResourcesViewFromBalloon'](_0x547198);_0x2e8817&&_0x2e8817['updateResourceState'](_0x217a75,_0x429810);}destroy(){for(const _0x36b38c of this['_sourceResourceBalloons']['values']())_0x36b38c['destroy']();this['_sourceResourceBalloons']['clear']();}_createSourceResourceBalloonPanel(){const _0x5d8d22=new Jt(this['_locale']);return _0x5d8d22['extendTemplate']({'attributes':{'class':Ma}}),this['_bodyCollection']['add'](_0x5d8d22),_0x5d8d22;}_addSourceResourceContent({balloonPanel:_0xe7ccd1,source:_0x51ab3d,withBackButton:_0x1f8be3}){_0xe7ccd1['content']['clear']();const _0x3a62a1=this['_createBalloonHeader']({'balloonPanel':_0xe7ccd1,'source':_0x51ab3d,'withBackButton':_0x1f8be3});_0xe7ccd1['content']['add'](_0x3a62a1);const _0x4d74ce=this['_createBalloonResourcesView'](_0x51ab3d);_0xe7ccd1['content']['add'](_0x4d74ce);}_createBalloonHeader({balloonPanel:_0x257035,source:_0x4f32db,withBackButton:_0x2c89f5}){const _0x123cd0=new _0x2bed87(this['_locale'],{'label':_0x4f32db['label']});return _0x2c89f5&&_0x123cd0['children']['add'](this['_createBackButton'](_0x257035),0x0),_0x123cd0;}_createBackButton(_0x4e0b4f){const _0x25a2d3=new _0x1b12df(this['_locale']);return _0x25a2d3['set']({'icon':_0x5c3f8c,'tooltip':qs(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Va}),_0x25a2d3['on']('execute',()=>{_0x4e0b4f['hide'](),this['_config']['onBackToContext']();}),_0x25a2d3;}_createBalloonResourcesView(_0x4af7a0){const _0x6056db=new Pa(this['_locale'],{'source':_0x4af7a0,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x6056db['on']('loadSourceResources',(_0x312434,_0x4483c6)=>{this['_config']['onLoadSourceResources'](_0x4483c6);}),_0x6056db['on']('addResourceToContext',(_0x3b3ee5,_0x121d43)=>{this['_config']['onResourceSelected'](_0x121d43['source'],_0x121d43['resource']),this['closeSourceResourceBalloon'](_0x4af7a0['id']);}),_0x6056db;}_getResourcesViewFromBalloon(_0x560178){const _0x5e1ddd=_0x560178['content']['get'](0x1);return _0x5e1ddd instanceof Pa?_0x5e1ddd:null;}_setupSingleResourceBalloonClickOutsideHandler(_0x2d9e0e){_0x8f06c5({'emitter':_0x2d9e0e,'contextElements':[_0x2d9e0e['element']],'callback':()=>{_0x2d9e0e['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x2d9e0e['isVisible']});}};const Ua=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Ba='ck-ai-chat-context-controls',Ga='ck-ai-chat-context-controls__pending-contexts',Wa='ck-ai-chat-context-controls__add-context-balloon-panel',Fa='ck-ai-chat-context-controls__add-context-button',Ka='ck-ai-chat-context-controls__url-balloon-panel',$a='ck-ai-chat-context-controls__balloon-list',Ya='ck-ai-chat-context-controls__balloon-button',qa='ck-ai-chat-context-controls__balloon-button-source',Qa='ck-ai-chat-controls-button',Xa='ck-ai-chat-context-chips-wrapper-balloon',za='ck-ai-chat-controls_context_show-more-button',ja='ck-ai-chat-context-controls__show-more-balloon-panel',Ja=[Jt['defaultPositions']['northArrowSouthWest'],Jt['defaultPositions']['northArrowSouth'],Jt['defaultPositions']['northArrowSouthEast'],Jt['defaultPositions']['southArrowNorthWest'],Jt['defaultPositions']['southArrowNorth'],Jt['defaultPositions']['southArrowNorthEast']];var Za=class extends _0x43ad99{addContextButtonView;_currentContextsChips=this['createCollection']();_conversationContextsChips=this['createCollection']();['_overflowManager'];_addContextBalloonPanelView;_addContextListView;['_urlBalloonPanelView'];_urlInputView;['_resourcesBalloonView'];_addContextBalloonConfig;_hasExactlyOneSource=!0x1;bodyCollection;constructor(_0x1245be,_0x3b94e9){super(_0x1245be),this['bodyCollection']=_0x3b94e9['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['set']('isBusy',!0x1),this['set']('hasContextOptions',!0x1),this['addContextButtonView']=this['_createAddContextButtonView'](_0x1245be),this['addContextButtonView']['bind']('isEnabled')['to'](this,'hasContextOptions',this,'isBusy',(_0x3b523a,_0x56dee4)=>_0x3b523a&&!_0x56dee4),this['_addContextListView']=this['_createAddContextListView'](_0x1245be),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x1245be),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x1245be),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x1245be,_0x3b94e9);const _0x2c42c9={'cssClasses':{'showMoreButton':za+'\x20'+Ar,'showMoreBalloon':ja,'overflowContainer':Xa,'controlsButton':Qa},'getLimiterElement':()=>ah(this['element'])};this['_overflowManager']=new Uo(_0x1245be,this['_currentContextsChips'],_0x2c42c9,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(_0x359d56,_0x29ea21){const _0x4eb04b=this['_createContextButton'](_0x359d56,'current',!0x0,_0x29ea21);this['_addContextToCollection'](_0x4eb04b,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}removeContextItem(_0xf77e32){this['_removeContextFromCollection'](_0xf77e32,this['_currentContextsChips']),this['_removeContextFromCollection'](_0xf77e32,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}setContextItemLoading(_0x2de7df,_0xcb5d7d){let _0x5804c5=this['_currentContextsChips']['find'](_0x23dce2=>_0x23dce2['id']===_0x2de7df);_0x5804c5||(_0x5804c5=this['_overflowManager']['overflowChips']['find'](_0x339c15=>_0x339c15['id']===_0x2de7df)),_0x5804c5&&(_0x5804c5['isLoading']=_0xcb5d7d);}setConversationContext(_0x49c375){this['_conversationContextsChips']['clear']();for(const _0x2c46db of _0x49c375){const _0x20676a=this['_createContextButton'](_0x2c46db,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x20676a,this['_conversationContextsChips']);}}clearCurrentContextItems(){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}clearConversationContextItems(){this['_conversationContextsChips']['clear']();}updateResourceState(_0x535458,_0x510830,_0x500dd4){this['_resourcesBalloonView']['updateResourceState'](_0x535458,_0x510830,_0x500dd4);}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;}['hideAllBalloons'](){this['hideAddContextBalloonPanel'](),this['hideUrlBalloonPanel'](),this['_resourcesBalloonView']['closeAll']();}['_showSourceResourcesBalloon']({source:_0x3469af,withBackButton:_0x53339c}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x3469af,'withBackButton':_0x53339c}),this['addContextButtonView']['isOn']=!0x0;}populateSourceResourceBalloon(_0xc3bc74,_0x1c79bb,_0x1685c5,_0x5aac99){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0xc3bc74,_0x1685c5,_0x5aac99);}['closeSourceResourceBalloon'](_0x3c035d){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x3c035d),this['addContextButtonView']['isOn']=!0x1;}setAddContextOptions(_0x16f9a8){this['_setBalloonPanelContent'](this['locale'],_0x16f9a8),this['_setAddContextButtonEnabled'](_0x16f9a8);}_setAddContextButtonEnabled(_0x291bab){const _0x5384c7=!_0x291bab['document']['isHidden']&&_0x291bab['document']['enabled'],_0x1e8ed1=_0x291bab['urls']['enabled'],_0x4e5415=_0x291bab['files']['enabled'],_0x36620b=_0x291bab['sources']['length']>0x0,_0x48164c=!!_0x291bab['customItems']?.['length'];this['hasContextOptions']=_0x5384c7||_0x1e8ed1||_0x4e5415||_0x36620b||_0x48164c;}_setupTemplate(){this['setTemplate']({'tag':'div','attributes':{'class':[Ba,'ck-reset_all-excluded',this['bindTemplate']['if']('isBusy','ck-hidden')]},'children':[{'tag':'div','attributes':{'class':Ga},'children':this['_currentContextsChips']}]});}_bindEventHandlers(){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}_createAddContextButtonView(_0x10ceeb){const _0x911c65=new _0x1b12df(_0x10ceeb);return _0x911c65['set']({'label':qs(_0x10ceeb,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Qa+'\x20'+Fa+'\x20'+Ar+'\x20ck-button_small','icon':_0x4074f7,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x911c65;}_createAddContextListView(_0x427497){const _0x6a5628=new _0x35138b(_0x427497);return _0x6a5628['extendTemplate']({'attributes':{'class':$a}}),_0x6a5628;}_createAddContextBalloonPanelView(_0x18fb00){const _0x3f0db0=this['_createBaseBalloonPanel'](_0x18fb00,Wa);return _0x3f0db0['content']['add'](this['_addContextListView']),_0x3f0db0;}_createUrlBalloonPanelView(_0x21a03d){const _0x5cc7e8=this['_createBaseBalloonPanel'](_0x21a03d,Ka);return this['_addUrlContent'](_0x5cc7e8,_0x21a03d),_0x5cc7e8;}_createResourcesBalloonView(_0x4d9195,_0x4b695a){const _0x277e0c={'searchInputVisibleFrom':_0x4b695a['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':ah(this['element']),'positions':Ja});},'onResourceSelected':(_0x16c244,_0x2b9fdd)=>{this['fire']('addResourceToContext',{'source':_0x16c244,'resource':_0x2b9fdd});},'onLoadSourceResources':_0x46782c=>{this['fire']('loadSourceResources',_0x46782c);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>ah(this['element']),'getTargetElement':()=>this['addContextButtonView']['element']};return new Ha(_0x4d9195,_0x4b695a['bodyCollection'],_0x277e0c);}_createBaseBalloonPanel(_0x20517b,_0x585785){const _0x3c7291=new Jt(_0x20517b);return _0x3c7291['extendTemplate']({'attributes':{'class':_0x585785}}),this['bodyCollection']['add'](_0x3c7291),_0x3c7291;}_setBalloonPanelContent(_0x1b1825,_0x204e33){if(this['_addContextListView']['items']['clear'](),!_0x204e33['document']['isHidden']&&_0x204e33['document']['enabled']){const _0xed70c3=this['_createBalloonButton'](_0x1b1825,{'label':qs(_0x1b1825,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x2f2aeb});_0xed70c3['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),this['_addBalloonListItem'](_0x1b1825,_0xed70c3);}if(_0x204e33['urls']['enabled']){const _0x41e89f=this['_createBalloonButton'](_0x1b1825,{'label':qs(_0x1b1825,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x4d1c13});_0x41e89f['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':ah(this['element']),'positions':Ja}),this['_urlInputView']['focus']();}),this['_addBalloonListItem'](_0x1b1825,_0x41e89f);}if(_0x204e33['files']['enabled']){const _0x5782be=new _0x144683(_0x1b1825);_0x5782be['set']({'label':qs(_0x1b1825,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x287262,'withText':!0x0,'tooltip':!0x0,'class':Ya,'allowMultipleFiles':!0x0}),_0x5782be['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x5782be['on']('done',(_0xaafb4f,_0x327858)=>{this['fire']('addFileToContext',_0x327858);}),_0x5782be['tooltip']=!0x0,this['_addBalloonListItem'](_0x1b1825,_0x5782be);}for(const _0x30d2b6 of _0x204e33['sources']){const _0x44071f=this['_createBalloonButton'](_0x1b1825,{'label':_0x30d2b6['label'],'icon':_0x30d2b6['icon']||_0x286228,'type':'source'});this['_addBalloonListItem'](_0x1b1825,_0x44071f),_0x44071f['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x30d2b6,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x88b47c of _0x204e33['customItems']||[]){const _0x195a25=this['_createBalloonButton'](_0x1b1825,{'label':_0x88b47c['label'],'icon':_0x88b47c['icon']||_0x286228,'type':'customItem'});this['_addBalloonListItem'](_0x1b1825,_0x195a25),_0x195a25['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x88b47c);});}this['_hasExactlyOneSource']=0x1===this['_addContextListView']['items']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}_addBalloonListItem(_0x2912bf,_0x393c76){const _0x4f8e60=new _0x5be144(_0x2912bf);_0x4f8e60['children']['add'](_0x393c76),this['_addContextListView']['items']['add'](_0x4f8e60);}_getBalloonListButton(_0x18d065){return this['_addContextListView']['items']['get'](_0x18d065)?.['children']['first'];}_addUrlContent(_0x3ccb5f,_0x1b0028){this['_urlInputView']=new ba(_0x1b0028),this['_urlInputView']['on']('submitUrl',(_0x3965b2,_0x130ea9)=>{this['_handleUrlSubmit'](_0x130ea9);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':ah(this['element']),'positions':Ja}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':ah(this['element']),'positions':Ja});}),_0x3ccb5f['content']['add'](this['_urlInputView']);}_createBalloonButton(_0x52ba7f,_0x30bb56){const _0x286917='source'===_0x30bb56['type']?new th(_0x52ba7f):new _0x474fcf(_0x52ba7f);return _0x286917['set']({'label':_0x30bb56['label'],'icon':_0x30bb56['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Ya}),_0x286917;}_setupAllBalloonClickOutsideHandlers(){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}_setupUrlBalloonClickOutsideHandler(){_0x8f06c5({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}_toggleAddContextBalloon(_0x16f659){const _0x465b83=this['_addContextBalloonConfig'];_0x465b83['buttonView']['isOn']=_0x16f659,_0x16f659?_0x465b83['balloonView']['show']():_0x465b83['balloonView']['hide']();}_setupAddContextBalloonClickOutsideHandler(){const {balloonView:_0x2affe4,buttonView:_0x56ad3c,hideMethod:_0xe08523}=this['_addContextBalloonConfig'];_0x8f06c5({'emitter':_0x2affe4,'contextElements':[_0x2affe4['element'],_0x56ad3c['element']],'callback':()=>{_0xe08523();},'activator':()=>_0x56ad3c['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}_createContextButton(_0x5e8b66,_0x3e0a27,_0x3326d1=!0x1,_0x3560ea=!0x1){const _0x54295e='conversation'===_0x3e0a27||!0x0===_0x5e8b66['isReadOnly'],_0x3414ec=new Po(this['locale'],_0x5e8b66,_0x54295e,_0x3326d1,_0x3560ea);return _0x54295e||_0x3414ec['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x3414ec['id']);}),_0x3414ec;}_addContextToCollection(_0x3e1245,_0x3fdf2f){_0x3fdf2f['add'](_0x3e1245,0x0);}_removeContextFromCollection(_0xecef4a,_0x240467){const _0x383cda=_0x240467['find'](_0x4f7204=>_0x4f7204['id']===_0xecef4a);_0x383cda&&_0x240467['remove'](_0x383cda);}_handleAddContextButtonClick(){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':ah(this['element']),'positions':Ja}),this['_hasExactlyOneSource']&&this['_getBalloonListButton'](0x0)?.['fire']('execute'));}_handleUrlSubmit(_0x493cdb){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x493cdb);}},th=class extends _0x474fcf{['arrowView'];constructor(_0x5e4284){super(_0x5e4284),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[qa]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}_createArrowView(){const _0x4d97d0=new _0x3188b1();return _0x4d97d0['content']=_0x5133fa,_0x4d97d0['extendTemplate']({'attributes':{'class':qa+'__arrow'}}),_0x4d97d0;}},eh=class extends _0x43ad99{_contextPanelView;_promptInputView;['_dropZoneView'];_promptCapabilitiesView;['_modelUnavailableMessageView'];['_filesEnabled'];constructor(_0x3d8582,_0x525dec){super(_0x3d8582),this['_filesEnabled']=_0x525dec['filesEnabled'],this['_contextPanelView']=this['_createContextPanelView'](_0x3d8582,{'bodyCollection':_0x525dec['bodyCollection'],'searchInputVisibleFrom':_0x525dec['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x3d8582),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x3d8582),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x3d8582),this['_dropZoneView']=new oa(_0x3d8582),this['_promptInputView']['delegate']('sendUserMessage','promptInputPaste','abortPromptStream')['to'](this),this['_promptInputView']['bind']('isBusy')['to'](this,'isBusy'),this['_contextPanelView']['bind']('isBusy')['to'](this,'isBusy'),this['_promptCapabilitiesView']['bind']('isBusy')['to'](this,'isBusy'),this['_dropZoneView']['delegate']('promptInputPaste')['to'](this),this['_dropZoneView']['on']('dragEnter',()=>this['_contextPanelView']['hideAllBalloons']()),this['_dropZoneView']['bind']('isEnabled')['to'](this,'isBusy',_0xeacddd=>!_0xeacddd),this['_promptCapabilitiesView']['delegate']('toggleWebSearch')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleReasoning')['to'](this),this['_promptCapabilitiesView']['delegate']('selectModel')['to'](this),this['_contextPanelView']['delegate'](...Ua)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1),this['set']('isLoadingSkeletonVisible',!0x1);const _0x54d883=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x54d883['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x54d883['if']('isModelAvailable','ck-hidden',_0x58c231=>!_0x58c231),_0x54d883['if']('isLoadingSkeletonVisible','ck-ai-chat-controls__content_covered')]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x54d883['if']('isModelAvailable','ck-hidden',_0x178768=>_0x178768)]},'children':[this['_modelUnavailableMessageView']]},this['_dropZoneView'],this['_createSkeletonView']()]});}['render'](){super['render'](),this['_filesEnabled']&&this['_dropZoneView']['attach'](this['element']);}_createContextPanelView(_0x585d3c,_0x4513ae){return new Za(_0x585d3c,_0x4513ae);}_createPromptInputView(_0x1b7d4b){return new ra(_0x1b7d4b,this['_contextPanelView']['addContextButtonView']);}_createPromptCapabilitiesView(_0x2adeab){return new Ca(_0x2adeab);}_createSkeletonView(){const _0x221b11=new lo(this['locale'],uo['aiChatControls']);return _0x221b11['bind']('isVisible')['to'](this,'isLoadingSkeletonVisible'),_0x221b11;}_createModelUnavailableMessageView(_0x4c361e){const _0x1b173f=new ih(_0x4c361e);return _0x1b173f['delegate']('startConversation')['to'](this),_0x1b173f;}addContextItem(_0x440d88,_0x40a656){this['_contextPanelView']['addContextItem'](_0x440d88,_0x40a656);}removeContextItem(_0x47fc8d){this['_contextPanelView']['removeContextItem'](_0x47fc8d);}setContextItemLoading(_0x487a94,_0x149e7b){this['_contextPanelView']['setContextItemLoading'](_0x487a94,_0x149e7b);}setIsUploadInProgress(_0x278210){this['_promptInputView']['setIsUploadInProgress'](_0x278210);}setConversationContext(_0x2d861b){this['_contextPanelView']['setConversationContext'](_0x2d861b);}clearPendingContextUI(){this['_contextPanelView']['clearCurrentContextItems']();}clearConversationContextUI(){this['_contextPanelView']['clearConversationContextItems']();}updateResourceState(_0x1bcdff,_0x35b4af,_0x3f7aa3){this['_contextPanelView']['updateResourceState'](_0x1bcdff,_0x35b4af,_0x3f7aa3);}setWebSearch(_0x3a6f74){this['_promptCapabilitiesView']['setWebSearch'](_0x3a6f74);}setReasoning(_0x5b2bbc){this['_promptCapabilitiesView']['setReasoning'](_0x5b2bbc);}resetMessageInput(){this['_promptInputView']['reset']();}setAddContextOptions(_0x112df9){this['_contextPanelView']['setAddContextOptions'](_0x112df9);}setInputPlaceholder(_0x104039){this['_promptInputView']['setPlaceholderText'](_0x104039);}setModelList(_0x526e30,_0x4519ca){this['_promptCapabilitiesView']['setModelList'](_0x526e30,_0x4519ca);}setModel(_0x22f811){_0x22f811?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x22f811)):this['isModelAvailable']=!0x1;}enableModelSelector(){this['_promptCapabilitiesView']['enableModelSelector']();}disableModelSelector(_0x5d6ba1){this['_promptCapabilitiesView']['disableModelSelector'](_0x5d6ba1);}populateSourceResourceBalloon(_0x4a48dd,_0x5accb2,_0x329630,_0x380d33){this['_contextPanelView']['populateSourceResourceBalloon'](_0x4a48dd,_0x5accb2,_0x329630,_0x380d33);}['closeSourceResourceBalloon'](_0x10072a){this['_contextPanelView']['closeSourceResourceBalloon'](_0x10072a);}focusPromptInput(_0x3b69c3=!0x1){this['_promptInputView']['focus'](_0x3b69c3);}setPromptInputValue(_0x4d52a6){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x4d52a6;}},ih=class extends _0x43ad99{constructor(_0x17fe33){super(_0x17fe33);const _0x4bac20=new _0x1b12df(_0x17fe33);_0x4bac20['set']({'label':qs(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x4bac20['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':qs(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x4bac20]}]});}},sh=class extends _0x2bed87{resizeButton;constructor(_0x4dda39,_0x32b63d){super(_0x4dda39,{'label':_0x32b63d['label'],'class':'ck-ai-header\x20'+_0x32b63d['class'],'icon':_0x32b63d['icon']}),this['set']('isMaximized',!0x1),this['set']('isLoadingSkeletonVisible',!0x1),this['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-ai-header_loading')]}}),_0x32b63d['content']&&this['children']['add'](_0x32b63d['content']),_0x32b63d['showResizeButton']&&(this['resizeButton']=Tr(_0x4dda39,this),this['children']['add'](this['resizeButton']));}},nh=class extends _0x43ad99{constructor(_0x3d0039){super(_0x3d0039),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':qs(_0x3d0039,'AI_DISCLAIMER_TEXT')}]}]});}};function rh(_0x3a0810,_0x5729d6){const _0x3c085b=new _0x1b12df(_0x3a0810);return _0x3c085b['set']({'label':qs(_0x3a0810,'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x5bade3,'class':'ck-ai-chat__start-conversation\x20ck-button_small\x20'+Ir}),_0x3c085b['on']('execute',()=>{_0x5729d6['fire']('startConversation');}),_0x3c085b;}const oh='ck-ai-chat';function ah(_0x125ef4){return _0x125ef4?.['closest']('.'+oh)||null;}var hh=class extends _0x43ad99{chatHeader;chatFeed;chatControls;chatDisclaimer;constructor(_0x61cb6,_0x23100b){super(_0x61cb6);const _0xd92f93=rh(_0x61cb6,this);this['chatHeader']=new sh(_0x61cb6,{'label':qs(_0x61cb6,'AI_CHAT_HEADING'),'icon':_0x31d0de,'class':'ck-ai-header_chat','content':_0xd92f93,'showResizeButton':_0x23100b['showResizeButton']}),this['chatHeader']['delegate']('resizeTabs')['to'](this),this['chatFeed']=new ea(_0x61cb6,_0x23100b['bodyCollection']),this['chatFeed']['delegate'](...Yr)['to'](this),this['chatControls']=new eh(_0x61cb6,{'bodyCollection':_0x23100b['bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x23100b['contextResourcesSearchInputVisibleFrom'],'filesEnabled':_0x23100b['filesEnabled']}),this['chatControls']['delegate'](...Yr)['to'](this),this['chatControls']['bind']('isLoadingSkeletonVisible')['to'](this['chatFeed']),this['chatHeader']['bind']('isLoadingSkeletonVisible')['to'](this['chatFeed']),this['chatDisclaimer']=new nh(_0x61cb6),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all',oh,'ck-rounded-corners'],'dir':_0x61cb6['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}populateSourceResourceBalloon(_0x2a9306,_0x4003bc,_0x8a4c19,_0x6f24f0){this['chatControls']['populateSourceResourceBalloon'](_0x2a9306,_0x4003bc,_0x8a4c19,_0x6f24f0);}['closeSourceResourceBalloon'](_0x3cc1c8){this['chatControls']['closeSourceResourceBalloon'](_0x3cc1c8);}},ch=class extends _0x4f3978{static get requires(){return[Ks];}['_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;get['idleUiPromise'](){return this['_promiseQueue']['queueEmptyPromise'];}constructor(_0x381288){super(_0x381288);const _0x21bb38=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['set']('isChatStreaming',!0x1),this['_promiseQueue']=new Ao(),this['_view']=new hh(this['context']['locale'],{'bodyCollection':_0x21bb38['bodyCollection'],'showResizeButton':_0x21bb38['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom'),'filesEnabled':!0x1!==this['context']['config']['get']('ai.chat.context.files.enabled')}),this['_view']['delegate']('resizeTabs')['to'](_0x21bb38),this['_view']['delegate'](...Yr)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x494326,{showDiff:_0x130540})=>{this['showDiff']=_0x130540;}),this['disableControls'](),this['toggleLoadingSkeleton'](!0x0,'init'),_0x21bb38['view']['addTab']({'id':'chat','buttonLabel':qs(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x31d0de,'order':0x0,'content':this['_view']}),this['_view']['chatHeader']['bind']('isMaximized')['to'](_0x21bb38['view'],'isMaximized',_0x5f5d74=>_0x5f5d74),this['_view']['chatControls']['bind']('isBusy')['to'](this,'isChatStreaming',_0x41c6f0=>_0x41c6f0),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}destroy(){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}createConversation({availableModels:_0x2b63a0}){const _0x454edf=this['context']['config']['get']('ai.chat.welcomeMessage')??qs(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x2b63a0,!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x454edf}),this['fire']('conversationCreated');}async addFeedItemStaticMessage({id:_0x1ea759,staticMessage:_0x1237dd}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x1ea759,'initialContent':'<p>'+_0x1237dd+'</p>'});});}async addFeedItemUserMessage(_0x56453b){const _0x16a9df=_0x56453b['attributes']?.['displayedPrompt']||_0x56453b['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x56453b['contextItems']['values']()),'initialContent':'<p>'+_0x16a9df+'</p>','id':_0x56453b['id']});});}async addFeedItemError({errorMessage:_0x5dae93,id:_0x45f99d}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x5dae93+'</p>','id':_0x45f99d});});}async addFeedItemAIReply(_0x46cec6){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x46cec6['interactionId']+':'+_0x46cec6['id']}),this['clearLoadingMessage']();});}async addFeedItemAISuggestion(_0xe1e840){const _0x69b28a=Zs(this['context']),_0x335928=_0x69b28a['map'](_0x59973e=>_0x59973e['config']['get']('ai.availableReplyActions')||[...po]);let _0x86ff11=_0x335928['reduce']((_0x5ba999,_0x8b3f5f)=>_0x5ba999['filter'](_0x55b9fa=>_0x8b3f5f['includes'](_0x55b9fa)),_0x335928[0x0]||[...po]);const _0x47a3e1=_0x69b28a['every'](_0x5f081f=>_0x5f081f['plugins']['has']('TrackChanges')),_0x3ea3a4=_0x69b28a['map'](_0x3bcc6d=>_0x3bcc6d['commands']['get']('trackChanges'));return _0x47a3e1?this['_isTrackChangesCommandValueBound']||(this['_isTrackChangesCommandValueBound']=!0x0,this['_view']['chatFeed']['bind']('isTrackChangesOn')['toMany'](_0x3ea3a4,'value',(..._0x1e81f8)=>_0x1e81f8['some'](_0xdf8a6=>_0xdf8a6))):_0x86ff11=_0x86ff11['filter'](_0x1e4c6c=>'insertSuggestion'!=_0x1e4c6c),this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0xe1e840['interactionId']+':'+_0xe1e840['id'],'areActionsDisabled':_0xe1e840['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x86ff11}),this['clearLoadingMessage']();});}async addFeedInteractionHeader(_0x445340,_0x30d921){return this['_promiseQueue']['enqueue'](async()=>{const _0x413c75=this['_view']['chatFeed']['children']['last'];if(_0x413c75 instanceof Qo)return this['_view']['chatFeed']['children']['remove'](_0x413c75),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x445340['id'],'capabilities':{'isWebSearchEnabled':_0x413c75['capabilities']['isWebSearchEnabled']||_0x30d921['isWebSearchEnabled'],'isReasoningEnabled':_0x413c75['capabilities']['isReasoningEnabled']||_0x30d921['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x445340['id'],'capabilities':_0x30d921});});}async addFeedItemCustomElement(_0x128dbe,_0x2c51fb){let _0x4bf04a;return await this['_promiseQueue']['enqueue'](async()=>{_0x4bf04a=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x128dbe,'id':_0x2c51fb});}),_0x4bf04a;}removeFeedItem(_0x1180aa){this['_view']['chatFeed']['removeItem'](_0x1180aa);}hasFeedItem(_0x460a4a){return this['_view']['chatFeed']['hasItem'](_0x460a4a);}updateFeedInteractionHeader(_0x244083){const _0x2d6aec=this['_view']['chatFeed']['children']['find'](_0x3209e6=>_0x3209e6['options']['id']==_0x244083['id']&&_0x3209e6 instanceof Qo);_0x2d6aec&&_0x2d6aec['set']('isVisible',_0x244083['isVisible']);}async updateFeedItemAIReplyContent(_0x3c91ad){const _0x3a1a1e=_0x3c91ad['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x398b73=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x3c91ad,'abortSignal':_0x398b73,'renderingStrategy':_0x3a1a1e}),_0x3c91ad['isDone']&&this['markFeedItemAsDone'](_0x3c91ad['id']);});}updateFeedItemAIReplySources(_0x594589,_0x38a0a6){this['_view']['chatFeed']['updateWebSources'](_0x594589,_0x38a0a6);}async updateFeedItemAIReplySuggestionContent(_0x43326b){return this['_promiseQueue']['enqueue'](async _0x35dcc2=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x43326b,'abortSignal':_0x35dcc2}),_0x43326b['isDone']&&this['markFeedItemAsDone'](_0x43326b['id']);});}updateFeedItemAIReplySuggestionPartState(_0x1e812f){this['_view']['chatFeed']['updateSuggestionPartState'](_0x1e812f);}setSuggestionGating(_0x219d88,_0x5a8cd2){this['_view']['chatFeed']['updateSuggestionGating'](_0x219d88,_0x5a8cd2);}setFeedItemAIReplySuggestionPartActive(_0x40729a){this['_view']['chatFeed']['setSuggestionPartActive'](_0x40729a);}getFeedItemAIReplySuggestionPartUIIndex(_0x48e1a1){return this['_view']['chatFeed']['getSuggestionPartUIIndex'](_0x48e1a1);}markFeedItemAsDone(_0x486785){this['_view']['chatFeed']['markItemAsDone'](_0x486785);}removeFeedInteraction(_0x5e0898){this['_view']['chatFeed']['getItemIds']()['filter'](_0x2c0232=>_0x2c0232['startsWith'](_0x5e0898))['forEach'](_0x39c8e9=>this['_view']['chatFeed']['removeItem'](_0x39c8e9));}startInteraction(){const _0x4e8a9e=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x4e8a9e),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['isChatStreaming']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}stopInteraction(_0x187209){this['_promiseQueue']['abort'](),_0x187209&&this['_view']['chatFeed']['getItemIds']()['filter'](_0x2583c7=>_0x2583c7['startsWith'](_0x187209['id']))['forEach'](_0x95a10d=>this['markFeedItemAsDone'](_0x95a10d)),this['resetChatBusyStateToIdle']();}resetChatBusyStateToIdle(){this['isBusy']=!0x1,this['isChatStreaming']=!0x1,this['clearLoadingMessage'](),this['_view']['chatFeed']['stopAutoScroll']();}async finishInteraction(){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['resetChatBusyStateToIdle']();});}addContextItem(_0x3a7488,_0x42f2ab){this['_view']['chatControls']['addContextItem'](_0x3a7488,_0x42f2ab);}removeContextItem(_0x22de6d){this['_view']['chatControls']['removeContextItem'](_0x22de6d);}setContextItemLoading(_0x1a50b7,_0x700f9e){this['_view']['chatControls']['setContextItemLoading'](_0x1a50b7,_0x700f9e);}setIsUploadInProgress(_0x43664d){this['_view']['chatControls']['setIsUploadInProgress'](_0x43664d);}setConversationContext(_0x2e75b0){this['_view']['chatControls']['setConversationContext'](_0x2e75b0);}clearPendingContextUI(){this['_view']['chatControls']['clearPendingContextUI']();}clearConversationContextUI(){this['_view']['chatControls']['clearConversationContextUI']();}updateResourceState(_0x3feb3d,_0x4d45b1,_0x57cf12){this['_view']['chatControls']['updateResourceState'](_0x3feb3d,_0x4d45b1,_0x57cf12);}resetMessageInput(){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}setAddContextOptions(_0x499192){this['_view']['chatControls']['setAddContextOptions'](_0x499192);}updateCapabilities(_0x16dd45){this['_view']['chatControls']['setWebSearch'](_0x16dd45['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x16dd45['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x16dd45));}setSelectedModel(_0x3b39f1,_0x1b5ba2){this['_view']['chatControls']['setModel'](_0x3b39f1),_0x1b5ba2&&this['_view']['chatControls']['disableModelSelector'](!0x1);}setFeedItemRenderingStrategy(_0x123e50){this['feedItemRenderingStrategy']=_0x123e50;}toggleLoadingSkeleton(_0xa277c7,_0x4127e0='conversation'){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0xa277c7,_0x4127e0);}resetConversationTitle(){this['setConversationTitle'](qs(this['context']['locale'],'AI_CHAT_HEADING'));}emptyConversationTitle(){this['setConversationTitle']('');}setConversationTitle(_0x210c29,_0x39781c=!0x1){if(clearInterval(this['_titleAnimationInterval']),_0x39781c&&!ft()&&_0x210c29['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x210c29);this['_view']['chatHeader']['label']=_0x210c29;}setLoadingMessage(_0x329eb3){this['_view']['chatFeed']['setLoadingMessage'](_0x329eb3);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}_animateConversationTitle(_0x2173aa){let _0x328e0e=0x0;this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x2173aa[_0x328e0e],_0x328e0e++,_0x328e0e===_0x2173aa['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['prepareLoadingMessage'](_0x259210){return _0x259210['isWebSearchEnabled']&&_0x259210['isReasoningEnabled']?qs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x259210['isWebSearchEnabled']?qs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x259210['isReasoningEnabled']?qs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):qs(this['context']['locale'],'AI_CHAT_IS_WRITING');}_getInputPlaceholder(_0xcce229){return _0xcce229?_0xcce229['isWebSearchEnabled']&&_0xcce229['isReasoningEnabled']?qs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0xcce229['isWebSearchEnabled']?qs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0xcce229['isReasoningEnabled']?qs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):qs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):qs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}populateSourceResourceBalloon(_0x4a2807,_0x17b4fc,_0x51ac5a,_0x55ad85){this['_view']['populateSourceResourceBalloon'](_0x4a2807,_0x17b4fc,_0x51ac5a,_0x55ad85);}['closeSourceResourceBalloon'](_0x4ceb15){this['_view']['closeSourceResourceBalloon'](_0x4ceb15);}setPromptInputValue(_0x106ec7){this['_view']['chatControls']['setPromptInputValue'](_0x106ec7);}focusPromptInput(_0x3fe754=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x3fe754);}scrollFeedToSuggestion(_0x40dd13,_0x51fa66){this['_view']['chatFeed']['scrollToSuggestion'](_0x40dd13,_0x51fa66);}startAutoScroll(_0x16622e={}){this['_view']['chatFeed']['startAutoScroll'](_0x16622e);}stopAutoScroll(){this['_view']['chatFeed']['stopAutoScroll']();}disableControls(){this['_view']['chatControls']['isDisabled']=!0x0;}enableControls(){this['_view']['chatControls']['isDisabled']=!0x1;}toggleConversationLoading(_0x233924){_0x233924?(this['isBusy']=_0x233924,this['disableControls']()):(this['enableControls'](),this['resetChatBusyStateToIdle']());}},lh=class extends _0x35138b{sections;constructor(_0x5bd1a5,_0x345f53){super(_0x5bd1a5),this['sections']=_0x345f53,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}filter(_0x509aea){let _0xbd14fd=0x0,_0x4a51ba=0x0;for(const _0x1680c9 of this['sections']){const {resultsCount:_0x1dc48b,totalItemsCount:_0x197618}=_0x1680c9['filter'](_0x509aea);_0xbd14fd+=_0x1dc48b,_0x4a51ba+=_0x197618;}return{'resultsCount':_0xbd14fd,'totalItemsCount':_0x4a51ba};}},uh=class extends _0x5be144{title;itemsViews;_itemsListView;constructor(_0x4cdd7c,{title:_0xf8888f,items:_0x3640be}){super(_0x4cdd7c);const _0x1bfae9=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0xf8888f,this['itemsViews']=_0x3640be;const _0x4f21c6=new _0x43ad99(_0x4cdd7c);_0x4f21c6['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x35138b(_0x4cdd7c),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x1bfae9['if']('isVisible','ck-hidden',_0xca150e=>!_0xca150e)]},'children':[_0x4f21c6,this['_itemsListView']]});}filter(_0x557e8f){const _0x4a3d20=this['itemsViews']['length'];let _0x5bfa9a=0x0;for(const _0x527b8a of this['itemsViews'])_0x557e8f?(_0x527b8a['isVisible']=!!_0x527b8a['isMatching'](_0x557e8f),_0x527b8a['highlightText'](_0x557e8f)):(_0x527b8a['isVisible']=!0x0,_0x527b8a['highlightText'](null)),_0x527b8a['isVisible']&&_0x5bfa9a++;return this['isVisible']=_0x5bfa9a>0x0,{'resultsCount':_0x5bfa9a,'totalItemsCount':_0x4a3d20};}getItem(_0x5abe3a){return this['itemsViews']['find'](_0x8a3857=>_0x8a3857['id']===_0x5abe3a);}removeItem(_0x3cb1c0){const _0x24366e=this['itemsViews']['indexOf'](_0x3cb1c0);-0x1!==_0x24366e&&(this['itemsViews']['splice'](_0x24366e,0x1),this['_itemsListView']['items']['remove'](_0x3cb1c0));}};const dh=/* #__PURE__ -- @preserve */
|
|
34
|
+
_0x18407b(_0x5be144);var _h=class AIChatHistoryListItemView extends dh{['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(_0x5ca150,_0x38a1a9){super(_0x5ca150);const _0x16af9d=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x38a1a9['pinned']),this['set']('loadingState',null),this['set']('title',_0x38a1a9['title']),this['id']=_0x38a1a9['id'];const {createdAt:_0x3402ca,active:_0x31879e=!0x1}=_0x38a1a9;this['_titleView']=new _0x473cf4(),this['_titleView']['bind']('text')['to'](this,'title'),this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x5f5c06=this['_createCheckView'](),_0x4afb33=this['_createPinButtonView'](_0x5ca150),_0xfee6e9=this['_createMenuDropdownView'](),_0xc6424c=this['_createEditInputView'](_0x5ca150),_0xdfb7a5=this['_createAcceptEditButtonView'](_0x5ca150,_0xc6424c),_0x509112=this['_createCancelEditButtonView'](_0x5ca150);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x4afb33),this['actions']['add'](_0xfee6e9),this['on']('change:isEdit',(_0x578059,_0x39bd27,_0x616e9)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x616e9?(this['actions']['add'](_0xdfb7a5),this['actions']['add'](_0x509112),this['mainContent']['add'](_0xc6424c),_0xc6424c['element']['value']=this['title']||'',_0xc6424c['element']['focus']()):(this['actions']['add'](_0x4afb33),this['actions']['add'](_0xfee6e9),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x31879e?'ck-ai-chat-history__item--active':'',_0x16af9d['if']('isVisible','ck-hidden',_0x1822c7=>!_0x1822c7),_0x16af9d['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',_0x16af9d['if']('loadingState','ck-hidden',_0x1f6878=>!!_0x1f6878)]},'children':_0x31879e?[_0x5f5c06]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x16af9d['if']('loadingState','ck-hidden',_0x6a5b90=>!_0x6a5b90)]},'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-container',_0x16af9d['if']('loadingState','ck-hidden',_0x1b8adf=>!!_0x1b8adf)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x16af9d['if']('loadingState','ck-hidden',_0x572c3b=>!_0x572c3b)]},'children':[{'text':_0x16af9d['to']('loadingState',_0x181829=>_0x181829?qs(this['locale'],AIChatHistoryListItemView['LOADING_LABELS'][_0x181829]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x3402ca]}]},{'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(_0x33b0b7){this['set']('title',_0x33b0b7);}updateLoadingState(_0x3a19d2,_0x27d4e8){this['set']('loadingState',_0x27d4e8?_0x3a19d2:null);}_createCheckView(){const _0x2d34fd=new _0x3188b1();return _0x2d34fd['set']({'content':_0x3e619a}),_0x2d34fd;}_createPinButtonView(_0x5694ca){const _0x5c59cb=new _0x1b12df(_0x5694ca);return _0x5c59cb['set']({'label':qs(_0x5694ca,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x143f91,'withText':!0x1,'tooltip':!0x0,'class':Er}),_0x5c59cb['bind']('isOn')['to'](this,'pinned'),_0x5c59cb['on']('execute',()=>{const _0x1a001f=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x1a001f});}),_0x5c59cb;}_createMenuDropdownView(){const _0x4b3381=_0x348de2(this['locale']),_0x567da0=_0x4b3381['panelView']['children'];_0x4b3381['buttonView']['set']({'label':qs(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':ht,'class':Er}),_0x4b3381['panelPosition']='sw';const _0x2a4cc3=new _0x1b12df(this['locale']);_0x2a4cc3['label']=qs(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x2a4cc3['icon']=_0x1f254b,_0x2a4cc3['withText']=!0x0,_0x2a4cc3['on']('execute',()=>{this['isEdit']=!0x0;});const _0x2ad455=new _0x1b12df(this['locale']);_0x2ad455['label']=qs(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x2ad455['icon']=_0x59f57d,_0x2ad455['withText']=!0x0,_0x2ad455['on']('execute',()=>{this['showConfirm'](qs(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0xf493a3=new _0x35138b(this['locale']),_0x135f46=new _0x5be144(this['locale']);_0x135f46['children']['add'](_0x2a4cc3);const _0x418a33=new _0x5be144(this['locale']);return _0x418a33['children']['add'](_0x2ad455),_0xf493a3['items']['addMany']([_0x135f46,_0x418a33]),_0x567da0['add'](_0xf493a3),_0x4b3381;}_createEditInputView(_0x1c8232){const _0x2042d5=new _0x2adc12(_0x1c8232),_0x4dde81=_0x2042d5['bindTemplate'];return _0x2042d5['extendTemplate']({'on':{'keydown':_0x4dde81['to'](_0xcf14c5=>{'Enter'==_0xcf14c5['key']&&this['_commitEditInputValue'](_0x2042d5);})}}),_0x2042d5;}_createAcceptEditButtonView(_0x30f950,_0x1117dd){const _0x23857e=new _0x1b12df(_0x30f950);return _0x23857e['set']({'icon':_0x3e619a,'withText':!0x1,'tooltip':qs(_0x30f950,'AI_CHAT_HISTORY_ACCEPT'),'class':Er}),_0x23857e['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x23857e['on']('execute',()=>{this['_commitEditInputValue'](_0x1117dd);}),_0x23857e;}_commitEditInputValue(_0x349882){const _0x12e773=_0x349882['element']['value']||'';this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x12e773});}_createCancelEditButtonView(_0x1aead1){const _0x4a7666=new _0x1b12df(_0x1aead1);return _0x4a7666['set']({'icon':_0x467543,'withText':!0x1,'tooltip':qs(_0x1aead1,'AI_CHAT_HISTORY_CANCEL'),'class':Er}),_0x4a7666['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x4a7666['on']('execute',()=>{this['isEdit']=!0x1,this['fire']('edit:cancel');}),_0x4a7666;}_createSpinnerView(){const _0xe86656=new So('small');return _0xe86656['isVisible']=!0x0,_0xe86656;}isMatching(_0x4a61aa){return'string'==typeof this['title']&&this['title']['match'](_0x4a61aa)?{'title':!0x0}:null;}highlightText(_0x3e9a97){this['_titleView']['highlightText'](_0x3e9a97);}},gh=class extends _0x43ad99{['headerView'];['searchView'];['mainErrorView'];skeletonView;emptyView;sectionsView;constructor(_0x15e77f,_0x2e6177){super(_0x15e77f),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x494e9f=rh(_0x15e77f,this);this['headerView']=new sh(_0x15e77f,{'label':qs(_0x15e77f,'AI_CHAT_HISTORY_HEADING'),'icon':_0x2239e4,'class':'ck-ai-header_history','content':_0x494e9f,'showResizeButton':_0x2e6177}),this['headerView']['delegate']('resizeTabs')['to'](this),this['sectionsView']=new lh(_0x15e77f,[]),this['sectionsView']['delegate'](...Ih)['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',_0x476680=>!_0x476680)]}}),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':[this['headerView'],{'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 _0x40e204=new _0x248c98(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':qs(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x2a01f8=>qs(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x2a01f8),'secondary':qs(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x36c1ee=this['_createErrorView']();return _0x36c1ee['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x46ca02=>!_0x46ca02)]}}),_0x40e204['on']('render',()=>{_0x40e204['children']['add'](_0x36c1ee,0x1);}),_0x40e204['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x1e38f5=>!_0x1e38f5)]}}),_0x40e204;}_createSkeletonView(){const _0x5deed6=new lo(this['locale'],uo['aiHistory']);return _0x5deed6['bind']('isVisible')['to'](this,'isLoading'),_0x5deed6;}_createErrorView(){const _0x3f8ef9=new _0x43ad99(this['locale']),_0x1a9f93=new _0x1b12df(this['locale']);_0x1a9f93['set']({'withText':!0x1,'icon':_0x467543,'class':'ck-ai-notification_error__dismiss-button'}),_0x1a9f93['bind']('isVisible')['to'](this,'hasItems',_0x3a5d7f=>!!_0x3a5d7f),_0x1a9f93['on']('execute',()=>{this['errorMessage']='';});const _0x5dfff0=this['bindTemplate'];return _0x3f8ef9['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x5dfff0['to']('errorMessage')}]},_0x1a9f93]}),_0x3f8ef9;}_createEmptyStateView(){const _0x1f540e=new _0x43ad99(this['locale']);return _0x1f540e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x5abbe=>!_0x5abbe)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[qs(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]}]}),_0x1f540e;}_createListItemViews(_0x3a5659,_0x2cfcde){const _0x48575d=[];for(const _0xe6b8ce of _0x3a5659){const _0x234ff4=new _h(_0x2cfcde,_0xe6b8ce);_0x234ff4['delegate'](...Ih)['to'](this),_0x48575d['push'](_0x234ff4);}return _0x48575d;}updateHistoryItemsWithCategories(_0x232b2f){const _0x1fe560=this['locale']||'en',_0x449ac6=[];for(const _0x31856e of _0x232b2f){const _0x352eec=this['_createListItemViews'](_0x31856e['items'],_0x1fe560);_0x449ac6['push'](new uh(_0x1fe560,{'title':_0x31856e['title'],'items':_0x352eec}));}this['sectionsView']['sections']=_0x449ac6,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x449ac6),this['hasItems']=_0x232b2f['some'](_0x2affda=>_0x2affda['items']['length']>0x0),this['_refreshSearch']();}removeHistoryItem(_0x33ab18){for(const _0x427445 of this['sectionsView']['sections']){const _0x2601e3=_0x427445['getItem'](_0x33ab18);if(_0x2601e3){if(_0x427445['removeItem'](_0x2601e3),0x0===_0x427445['itemsViews']['length']){const _0x117472=this['sectionsView']['sections']['indexOf'](_0x427445);-0x1!==_0x117472&&(this['sectionsView']['sections']['splice'](_0x117472,0x1),this['sectionsView']['items']['remove'](_0x427445));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}updateItemTitle(_0x425090,_0x381da0){for(const _0x5855dc of this['sectionsView']['sections']){const _0xdf98fe=_0x5855dc['getItem'](_0x425090);if(_0xdf98fe){_0xdf98fe['updateTitle'](_0x381da0);break;}}}updateItemLoadingState(_0x4b6507,_0x3830d9,_0x4f6b12){for(const _0xc33970 of this['sectionsView']['sections']){const _0xa8f942=_0xc33970['getItem'](_0x4b6507);if(_0xa8f942){_0xa8f942['updateLoadingState'](_0x3830d9,_0x4f6b12);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x510f23=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x510f23);}}};const Ih=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','startConversation'];var Ah=class extends _0x4f3978{static get requires(){return[Ks];}_historyView;static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x33811d){super(_0x33811d);const _0x3d7a6f=this['context']['plugins']['get']('AITabs');this['_historyView']=new gh(this['context']['locale'],_0x3d7a6f['showResizeButton']),this['_historyView']['delegate']('resizeTabs')['to'](_0x3d7a6f),this['_historyView']['delegate'](...Ih)['to'](this),this['_historyView']['headerView']['bind']('isMaximized')['to'](_0x3d7a6f['view'],'isMaximized',_0x12c80c=>_0x12c80c),_0x3d7a6f['view']['addTab']({'id':'history','buttonLabel':qs(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x2239e4,'order':0x0,'content':this['_historyView']});}removeHistoryItem(_0x295f89){this['_historyView']['removeHistoryItem'](_0x295f89);}updateItems(_0x3d3bc4){this['_historyView']['updateHistoryItemsWithCategories'](_0x3d3bc4);}updateItemTitle(_0x46a782,_0xed9845){this['_historyView']['updateItemTitle'](_0x46a782,_0xed9845);}updateItemLoadingState(_0x4c8ea4,_0x5a3833,_0x1a9da2){this['_historyView']['updateItemLoadingState'](_0x4c8ea4,_0x5a3833,_0x1a9da2);}setLoadingSkeleton(_0x518b03){this['_historyView']['isLoading']=_0x518b03;}['showError'](_0x514081){this['_historyView']['errorMessage']=_0x514081;}['hideError'](){this['_historyView']['errorMessage']='';}};const Eh=/* #__PURE__ -- @preserve */
|
|
35
|
+
mt();var ph=class extends Eh{['id'];createdAt;constructor({id:_0x19bf84,title:_0x5886cd,createdAt:_0x4873a6,updatedAt:_0x23dafe,pinned:_0x4df47c}){super(),this['id']=_0x19bf84,this['createdAt']=new Date(_0x4873a6),this['set']('title',_0x5886cd),this['set']('updatedAt',_0x23dafe?new Date(_0x23dafe):null),this['set']('pinned',_0x4df47c||!0x1);}updateTitle(_0x404c69){this['set']('title',_0x404c69),this['updatedAt']=new Date();}updatePinned(_0x223098){this['set']('pinned',_0x223098),this['updatedAt']=new Date();}};const mh=/* #__PURE__ -- @preserve */
|
|
36
|
+
It();var Th=class extends mh{items=[];connector;['group'];constructor({connector:_0x1553ab,group:_0x5100d5}){super(),this['connector']=_0x1553ab,this['group']=_0x5100d5;}async init(){try{const _0x453eb5=await this['connector']['fetchConversations'](this['group'])['getConversations']();this['loadItems'](_0x453eb5);}catch(_0x35f858){this['fire']('error',{'error':_0x35f858,'operation':'init'});}}addItem(_0x417dfa){this['items']['push'](_0x417dfa);}async removeItem(_0x5a86b7){const _0x304e5f=this['items']['findIndex'](_0x46cbf8=>_0x46cbf8['id']===_0x5a86b7);if(-0x1===_0x304e5f)return!0x1;try{return await this['connector']['deleteConversation'](_0x5a86b7)['execute'](),this['items']['splice'](_0x304e5f,0x1),this['fire']('itemRemoved',{'itemId':_0x5a86b7}),!0x0;}catch(_0x4c1cc4){return this['fire']('error',{'error':_0x4c1cc4,'operation':'removeItem','itemId':_0x5a86b7}),!0x1;}}getItem(_0x50a817){return this['items']['find'](_0x3dcf4b=>_0x3dcf4b['id']===_0x50a817);}async updateItemTitle(_0x4a8270,_0x2a218e){const _0x4793db=this['getItem'](_0x4a8270);if(!_0x4793db)return!0x1;try{return await this['connector']['updateConversation'](_0x4a8270,{'title':_0x2a218e})['getResult'](),_0x4793db['updateTitle'](_0x2a218e),this['fire']('itemUpdated',{'itemId':_0x4a8270,'updates':{'title':_0x2a218e}}),!0x0;}catch(_0x2f3377){return this['fire']('error',{'error':_0x2f3377,'operation':'updateItemTitle','itemId':_0x4a8270}),!0x1;}}async updateItemPinned(_0x3a4605,_0x476b6c){const _0x102ae8=this['getItem'](_0x3a4605);if(!_0x102ae8)return!0x1;try{return await this['connector']['updateConversation'](_0x3a4605,{'pinned':_0x476b6c})['getResult'](),_0x102ae8['updatePinned'](_0x476b6c),this['fire']('itemUpdated',{'itemId':_0x3a4605,'updates':{'pinned':_0x476b6c}}),!0x0;}catch(_0x222878){return this['fire']('error',{'error':_0x222878,'operation':'updateItemPinned','itemId':_0x3a4605}),!0x1;}}loadItems(_0x4c9b26){try{this['items']=[],_0x4c9b26['map'](_0x597e39=>{this['addItem'](new ph(_0x597e39));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x441a2a){this['fire']('error',{'error':_0x441a2a,'operation':'loadItems'});}}getItems(_0x322e3c={}){const _0x32d62e=void 0x0!==_0x322e3c['pinned']&&_0x322e3c['pinned'],_0x38b86c=_0x322e3c['from']?new Date(_0x322e3c['from']['getFullYear'](),_0x322e3c['from']['getMonth'](),_0x322e3c['from']['getDate']()):null,_0x57a568=_0x322e3c['to']?new Date(_0x322e3c['to']['getFullYear'](),_0x322e3c['to']['getMonth'](),_0x322e3c['to']['getDate']()):null;return this['items']['filter'](_0xb87981=>{if(_0xb87981['pinned']!==_0x32d62e)return!0x1;if(_0x57a568){const _0x5835c5=new Date(_0xb87981['createdAt']['getFullYear'](),_0xb87981['createdAt']['getMonth'](),_0xb87981['createdAt']['getDate']());return _0x38b86c?_0x38b86c['getTime']()===_0x57a568['getTime']()?_0x5835c5['getTime']()===_0x38b86c['getTime']():_0x5835c5<_0x57a568&&_0x5835c5>=_0x38b86c:_0x5835c5<_0x57a568;}return!0x0;});}},wh=class extends _0x4f3978{_aiConnector;_reporter;_aiChatHistoryUi;_aiChatController;static get requires(){return[$s,dr,Kr,Ah,Ks];}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'](Ah),this['_aiChatController']=this['context']['plugins']['get'](Kr),this['_reporter']=this['context']['plugins']['get'](dr)['createReporter']('aichathistory');const _0x1bb1be=this['context']['plugins']['get'](Ks);try{const _0x6c7ae2=this['_aiChatController']['getGroupId']();this['history']=new Th({'connector':this['_aiConnector'],'group':_0x6c7ae2}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x39da8e,_0x838737)=>{this['_setItemLoading'](_0x838737['id'],'remove'),this['_handleRemove'](_0x838737['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x14ec0e,_0x3ef4b2)=>{this['_setItemLoading'](_0x3ef4b2['id'],'rename'),this['_handleEditTitle'](_0x3ef4b2['id'],_0x3ef4b2['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x18baca,_0x9dc709)=>{void 0x0!==_0x9dc709['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x9dc709['itemId'],_0x9dc709['updates']['title']),void 0x0!==_0x9dc709['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x9dc709['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x416021,_0x25684c)=>{this['_aiChatController']['_handleRemovedConversation'](_0x25684c['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x25684c['itemId']),this['_clearItemLoading'](_0x25684c['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x21277a,_0x3837b1)=>{this['_handleHistoryErrorUI'](_0x3837b1['error'],_0x3837b1['operation'],_0x3837b1['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x5321a6,_0x240409)=>{this['_handleSelectConversation'](_0x240409['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x1fc832,_0xff8183)=>{const _0x479929=_0xff8183['pinned']?'pin':'unpin';this['_setItemLoading'](_0xff8183['id'],_0x479929),this['_handleTogglePin'](_0xff8183['id'],_0xff8183['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'startConversation',()=>{_0x1bb1be['view']['activateTab']('chat'),this['_aiChatController']['startConversation']();}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x1bb1be['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();});}catch(_0x58509d){this['_handleHistoryErrorUI'](_0x58509d,'init');}}async _handleEditTitle(_0x263a4a,_0x4ab591){await this['history']['updateItemTitle'](_0x263a4a,_0x4ab591);}async['_handleTogglePin'](_0xdc13a3,_0x32f99e){await this['history']['updateItemPinned'](_0xdc13a3,_0x32f99e);}async['_handleRemove'](_0x2b65e5){await this['history']['removeItem'](_0x2b65e5);}async _handleSelectConversation(_0x106035){this['context']['plugins']['get'](Ks)['view']['activateTab']('chat'),await this['_aiChatController']['loadConversation'](_0x106035);}async _showConversationHistory(){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}_updateHistoryItemsUI(){const _0x4e4a58=this['_aiChatController']['activeConversation']?.['id'],_0x40ebfc=this['_getCategorizedItems']()['map'](_0x4fca25=>({'title':_0x4fca25['title'],'items':_0x4fca25['items']['map'](_0x22f4f3=>({'id':_0x22f4f3['id'],'title':_0x22f4f3['title']||qs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x22f4f3['createdAt'])['toLocaleDateString'](),'active':_0x22f4f3['id']===_0x4e4a58,'pinned':_0x22f4f3['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x40ebfc);}_setItemLoading(_0x2fb87d,_0x15bb7a){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x2fb87d,_0x15bb7a,!0x0);}_clearItemLoading(_0x7b6fa1){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x7b6fa1,null,!0x1);}_handleHistoryErrorUI(_0x38cebf,_0x506599,_0x42dfd6){const _0x11d5e3=this['_generateErrorMessage'](_0x506599,_0x42dfd6);this['_aiChatHistoryUi']['showError'](_0x11d5e3),this['_reporter']['reportError'](_0x38cebf,{'context':{'operation':_0x506599}}),_0x42dfd6&&this['_clearItemLoading'](_0x42dfd6),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}_generateErrorMessage(_0x5ac3e4,_0x37a44d){const _0x3356b7=_0x37a44d?this['history']['getItem'](_0x37a44d):null,_0x1dfdf2=_0x3356b7?.['title']||qs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x5ac3e4){case'updateItemTitle':return qs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x1dfdf2);case'updateItemPinned':{const _0x3885b5=qs(this['context']['locale'],_0x3356b7?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return qs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x3885b5,_0x1dfdf2]);}case'removeItem':return qs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x1dfdf2);case'init':case'loadItems':return qs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return qs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}_getCategorizedItems(){const _0x51eb20=new Date(),_0x589da1=new Date(_0x51eb20['getFullYear'](),_0x51eb20['getMonth'](),_0x51eb20['getDate']()),_0x2b0fbc=new Date(_0x589da1);_0x2b0fbc['setDate'](_0x2b0fbc['getDate']()-0x1);const _0x5e5c15=new Date(_0x589da1);_0x5e5c15['setDate'](_0x5e5c15['getDate']()-0xe);const _0x5914d2=this['history']['getItems']({'pinned':!0x0}),_0x17a275=this['history']['getItems']({'from':_0x589da1,'to':_0x589da1}),_0x3eae94=this['history']['getItems']({'from':_0x2b0fbc,'to':_0x2b0fbc}),_0x5912d5=this['history']['getItems']({'from':_0x5e5c15,'to':_0x2b0fbc}),_0x24d7cb=this['history']['getItems']({'to':_0x5e5c15}),_0x2ae1be=[];return _0x5914d2['length']>0x0&&_0x2ae1be['push']({'title':qs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x5914d2}),_0x17a275['length']>0x0&&_0x2ae1be['push']({'title':qs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x17a275}),_0x3eae94['length']>0x0&&_0x2ae1be['push']({'title':qs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x3eae94}),_0x5912d5['length']>0x0&&_0x2ae1be['push']({'title':qs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x5912d5}),_0x24d7cb['length']>0x0&&_0x2ae1be['push']({'title':qs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x24d7cb}),_0x2ae1be;}},Ch=class extends _0x4f3978{static get requires(){return[wh,Ah];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},fh=class extends _0x4f3978{static get requires(){return[Kr,Pn,ch,Ch,cr];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1db59b){super(_0x1db59b),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'contextLibrary':{'enabled':!0x1},'sources':[],'alwaysAddSelection':!0x1,'paste':{'textThreshold':0x5dc}}),this['context']['config']['define']('ai.chat.initialConversation','new');}},Rh=class extends _0x1b12df{['id'];constructor(_0x37409e,_0x47e5f9){super(_0x37409e);const {id:_0x57c8e9,type:_0x10b529,icon:_0x23ae2d}=_0x47e5f9;this['id']=_0x57c8e9,this['set']({'label':_0x47e5f9['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x47e5f9['id']}}),_0x23ae2d?this['icon']=_0x23ae2d:'chat'===_0x10b529?this['icon']=_0x31d0de:'review'===_0x10b529?this['icon']=_0x15e980:'translate'===_0x10b529&&(this['icon']=_0x2f431a);}},bh=class extends _0x43ad99{listView;constructor(_0x375cfb,_0x102491){super(_0x375cfb),this['set']('isEnabled',!0x0);const _0x451ec6=_0x102491['map'](_0x139194=>{const _0x5d03a3=new _0x5be144(this['locale']),_0x351333=new Rh(this['locale'],_0x139194);return _0x351333['bind']('isEnabled')['to'](this),_0x5d03a3['children']['add'](_0x351333),_0x351333['delegate']('execute')['to'](this),_0x5d03a3;});this['listView']=new _0x35138b(this['locale']),this['listView']['items']['addMany'](_0x451ec6),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}};const Sh='reviewMode',Oh='translate',vh='chat-shortcuts';var yh=class extends _0x4f3978{_shortcuts;_shortcutsView;_aiChatUI;_listenedConversation;static get requires(){return[ch,Js];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['_aiChatUI']=this['context']['plugins']['get'](ch),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x1e4200=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{const _0xa5b966=_0x1e4200['activeConversation'];_0xa5b966['isFromHistory']||this['_injectShortcuts'](_0xa5b966);}),this['listenTo'](_0x1e4200,'interactionCreated',()=>{this['_removeShortcuts']();}));}_validateShortcuts(){const _0x45ddd4=['chat','review','translate'];this['_shortcuts']['forEach'](_0x540b23=>{let _0x2f81d3=!0x0;if(_0x540b23['id']&&_0x540b23['label']&&_0x45ddd4['includes'](_0x540b23['type'])?'chat'===_0x540b23['type']&&(_0x2f81d3='string'==typeof _0x540b23['prompt']):_0x2f81d3=!0x1,!_0x2f81d3)throw new dt('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x540b23});});}_injectShortcuts(_0x37ee0d){this['_removeShortcuts'](),this['_shortcutsView']=new bh(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),this['_aiChatUI']['addFeedItemCustomElement'](this['_shortcutsView']['element'],vh),this['_shortcutsView']['on']('execute',_0x1dfa8c=>{const _0x3c9fb1=_0x1dfa8c['source']['id'];this['_executeShortcut'](_0x3c9fb1);}),this['_listenedConversation']=_0x37ee0d,this['listenTo'](_0x37ee0d,'uploadProgressChanged',(_0x215c34,_0x1c29a4)=>{this['_shortcutsView']['isEnabled']=!_0x1c29a4['isUploadInProgress'];});}_removeShortcuts(){const _0x4b902a=this['context']['plugins']['get'](ch);_0x4b902a['hasFeedItem'](vh)&&_0x4b902a['removeFeedItem'](vh),this['_listenedConversation']&&(this['stopListening'](this['_listenedConversation'],'uploadProgressChanged'),this['_listenedConversation']=void 0x0),this['_shortcutsView']?.['destroy']();}_executeShortcut(_0x47d603){const _0x54c2af=this['_shortcuts']['find'](_0x524325=>_0x524325['id']===_0x47d603),_0x181031=_0x54c2af['type'];'chat'===_0x181031?this['_runChatShortcut'](_0x54c2af):'review'===_0x181031?_0x54c2af['commandId']?this['_runReviewShortcut'](_0x54c2af):this['_switchTab'](Sh):'translate'===_0x181031&&(_0x54c2af['language']?this['_runTranslateShortcut'](_0x54c2af):this['_switchTab'](Oh));}_switchTab(_0x3acae0){if(!this['context']['plugins']['has']('AITabs'))throw new dt('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x3acae0});return this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x3acae0);}async _runChatShortcut({id:_0x13c4a0,prompt:_0x1f9a1e,draftMode:_0x2601f6,useWebSearch:_0xd7cc00=!0x1,useReasoning:_0x2f860f=!0x1,model:_0x1b4364}){const _0x372a15=this['context']['plugins']['get']('AIChatController'),_0x5a3a86=_0x372a15['activeConversation'],_0x2f8d1c=this['context']['plugins']['get'](Js),_0x41e54e=await _0x2f8d1c['models']['resolveModel'](_0x1b4364);_0x41e54e&&await _0x5a3a86['setModel'](_0x41e54e),_0x5a3a86['setWebSearch'](_0xd7cc00),_0x5a3a86['setReasoning'](_0x2f860f);const _0x561df4=_0x2f8d1c['contextLibrary']['resolveContext']({'feature':'chat','ids':[_0x13c4a0],'idScopedOnly':!0x0,'context':new nr()});_0x5a3a86['addDefaultContext'](_0x561df4['refs']),_0x372a15['addCurrentDocumentToChatContext'](),_0x2601f6?(this['_aiChatUI']['setPromptInputValue'](_0x1f9a1e),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x372a15['sendMessage']({'message':_0x1f9a1e});}_runReviewShortcut({commandId:_0x56d2fb,model:_0x53ebc3,prompt:_0x4d3eb3,params:_0x3283c4}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new dt('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab'](Sh);const _0x22e90b={'id':_0x56d2fb,'isCustom':'custom'===_0x56d2fb};_0x53ebc3&&_0x4d3eb3&&(_0x22e90b['args']={'model':_0x53ebc3,'prompt':_0x4d3eb3}),_0x3283c4&&(_0x22e90b['params']=_0x3283c4),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x22e90b);}_runTranslateShortcut({language:_0x2dc95a}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new dt('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x2dc95a,'args':{'language':_0x2dc95a}});}},Nh=class extends _0x1aa85e{constructor(_0x75e0c0){super(_0x75e0c0);const _0x4d35f1=_0x75e0c0['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x4d35f1,'isVisible'),this['isEnabled']=!0x0;}execute(){const _0x1409f9=this['editor']['plugins']['get']('AITabs')['view'];_0x1409f9['isVisible']=!_0x1409f9['isVisible'];}},kh=class extends _0x52da8c{static get requires(){return[Ks];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x3cf3ab=this['editor'];_0x3cf3ab['commands']['add']('toggleAi',new Nh(_0x3cf3ab)),_0x3cf3ab['ui']['componentFactory']['add']('toggleAi',()=>{const _0x8bf142=this['_createAIUIButton'](_0x1b12df);return _0x8bf142['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x8bf142;}),_0x3cf3ab['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x5c272d=this['_createAIUIButton'](_0x12150b);return _0x5c272d['set']({'role':'menuitemcheckbox'}),_0x5c272d;});}_createAIUIButton(_0xa47b2c){const _0x174bac=this['editor'],_0x25cce0=_0x174bac['commands']['get']('toggleAi'),_0x5ca14a=new _0xa47b2c(_0x174bac['locale']);return _0x5ca14a['set']({'label':qs(_0x174bac['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x3a4672,'isToggleable':!0x0}),_0x5ca14a['bind']('isEnabled')['to'](_0x25cce0),_0x5ca14a['bind']('isOn')['to'](_0x25cce0,'value',_0x171ebb=>!!_0x171ebb),this['listenTo'](_0x5ca14a,'execute',()=>{_0x25cce0['execute']();}),_0x5ca14a;}},xh=class extends _0x43ad99{constructor(_0x5c5613){super(_0x5c5613),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':qs(_0x5c5613,'AI_DISCLAIMER_TEXT')}]}]});}};const Lh='ck-ai-mini-toolbar-copy-button\x20'+Ar,Dh=Lh+'\x20ck-ai-mini-toolbar-copy-button_copied';var Ph=class extends _0x526787{copyButton;likeButton;dislikeButton;showChangesButton;['_config'];constructor(_0x4197d8,_0x400405={}){super(_0x4197d8),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x400405};const _0x160c30=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x160c30?'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(_0xd33dca){this['showChangesButton']['isEnabled']=_0xd33dca;}_setupRatingButtons(){this['likeButton']=new _0x1b12df(this['locale']),this['likeButton']['set']({'icon':lt,'label':qs(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'class':Ar,'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x1b12df(this['locale']),this['dislikeButton']['set']({'icon':ct,'label':qs(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'class':Ar,'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}_setupCopyButton(){this['copyButton']=new _0x1b12df(this['locale']),this['copyButton']['set']({'icon':_0x28b239,'label':qs(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':Lh,'tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x1c0d34=new _0x3188b1();_0x1c0d34['set']({'content':_0x3e619a}),_0x1c0d34['extendTemplate']({'attributes':{'class':['ck-ai-mini-toolbar-copy-button__check-mark']}}),this['copyButton']['on']('execute',()=>{this['copyButton']['class']=Dh,setTimeout(()=>{this['copyButton']['class']=Lh;},0x7d0);}),this['copyButton']['children']['add'](_0x1c0d34);}_setupShowChangesButton(){this['showChangesButton']=new _0x1b12df(this['locale']),this['showChangesButton']['set']({'icon':st,'label':qs(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':Ar}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x4085ca=>_0x4085ca?nt:st),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}},Mh=class extends _0x526787{constructor(_0x224d8f,_0x3e1116=!0x0,_0x2eaf59=!0x0){super(_0x224d8f),this['set']('isEnabled',!0x1),this['set']('isVisible',!0x0),this['set']('isTargetReadOnly',!0x1),this['rejectButton']=this['_createButton'](qs(_0x224d8f,'AI_BALLOON_REJECT_BUTTON'),Ar),this['rejectButton']['bind']('isEnabled')['to'](this),this['rejectButton']['on']('execute',()=>{this['fire']('rejectSuggestion');}),this['items']['add'](this['rejectButton']),_0x2eaf59&&(this['suggestButton']=this['_createButton'](qs(_0x224d8f,'AI_BALLOON_SUGGEST_BUTTON'),Ir),this['suggestButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isTargetReadOnly',(_0x5221d1,_0x121e98)=>_0x5221d1&&!_0x121e98),this['suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['items']['add'](this['suggestButton'])),_0x3e1116&&(this['applyButton']=this['_createButton'](qs(_0x224d8f,'AI_BALLOON_APPLY_BUTTON'),gr),this['applyButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isTargetReadOnly',(_0x1028da,_0x5451f2)=>_0x1028da&&!_0x5451f2),this['applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),this['items']['add'](this['applyButton'])),this['setButtonsVisibility']({'showApplyButton':_0x3e1116,'showSuggestButton':_0x2eaf59});const _0x44f79b=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar',_0x44f79b['if']('isVisible','ck-hidden',_0x245539=>!_0x245539)]}});}get primaryActionButton(){return this['applyButton']&&this['applyButton']['isVisible']?this['applyButton']:this['suggestButton']&&this['suggestButton']['isVisible']?this['suggestButton']:this['rejectButton'];}setButtonsVisibility({showApplyButton:_0x4add7c,showSuggestButton:_0x54ad43}){this['applyButton']&&(this['applyButton']['isVisible']=_0x4add7c),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x54ad43);}_createButton(_0x398281,_0x5e8c14){const _0x191483=new _0x1b12df(this['locale']);return _0x191483['set']({'label':_0x398281,'class':mr+'\x20'+_0x5e8c14,'isVisible':!0x0,'withText':!0x0}),_0x191483;}};const Vh=['applySuggestion','insertSuggestion','rejectSuggestion','showNext','showPrevious'];var Hh=class extends _0x43ad99{['_errorView'];['children'];_streamableContentView;_contentView;_contentChildren;_toolbarContainerView;_toolbarView;['_disclaimerView'];['_miniToolbarView'];['_config'];constructor(_0x23dbe5,_0x351d46){super(_0x23dbe5),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1),this['set']('width',null),this['set']('isTrackChangesOn',!0x1),this['set']('isTargetReadOnly',!0x1),this['_streamableContentView']=new ho(_0x23dbe5),this['_disclaimerView']=new xh(_0x23dbe5),this['_miniToolbarView']=new Ph(_0x23dbe5,{'showChanges':_0x351d46['showChangesButtonMode']??'icon'}),this['_config']=_0x351d46,this['_toolbarView']=new Mh(_0x23dbe5,_0x351d46['showApplyButton'],_0x351d46['showSuggestButton']),this['_toolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_toolbarView']['bind']('isTargetReadOnly')['to'](this),this['_toolbarContainerView']=new Uh(_0x23dbe5,[this['_miniToolbarView'],this['_toolbarView']]),this['_toggleToolbarButtonsVisibility'](_0x351d46),this['on']('change:isTrackChangesOn',()=>{this['_toggleToolbarButtonsVisibility'](_0x351d46);}),this['_contentView']=new _0x43ad99(_0x23dbe5),this['_contentChildren']=this['_contentView']['createCollection']([this['_streamableContentView']]),this['_contentView']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__content']},'children':this['_contentChildren']}),this['children']=this['createCollection']([this['_contentView'],this['_disclaimerView'],this['_toolbarContainerView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon-main']},'children':this['children']});}['showBlockingError'](_0x3bc426){this['showError'](_0x3bc426);}['showError'](_0x43a169){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_contentChildren']['has'](this['_errorView'])||this['_contentChildren']['add'](this['_errorView'],0x0),this['_errorMessage']=_0x43a169,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}clearContent(){this['_streamableContentView']['clear']();}async updateContent(_0x36ee2d){_0x36ee2d?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x36ee2d);}_createErrorView(){const _0x43b2d8=new _0x43ad99(this['locale']),_0x445d95=new _0x43ad99(this['locale']);return _0x445d95['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x43b2d8['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x2ba7bf=>!_0x2ba7bf)]},'children':[_0x445d95]}),_0x43b2d8;}_toggleToolbarButtonsVisibility({showApplyButton:_0x1cb962,showSuggestButton:_0x40f40c}){_0x1cb962=_0x1cb962&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x40f40c=_0x40f40c&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x1cb962,'showSuggestButton':_0x40f40c});}},Uh=class extends _0x43ad99{['children'];constructor(_0x35c943,_0x95c028){super(_0x35c943),this['children']=this['createCollection'](_0x95c028),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-balloon__toolbar-container']},'children':this['children']});}};const Bh=0xa;var Gh=class extends _0x4f3978{static get requires(){return[Pn];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;_currentConfig;_editor;_isUpdatingMarkers=!0x1;['open'](_0x54eace){const {id:_0x36400e}=this['_currentConfig']??{};this['_currentConfig']=_0x54eace,this['_editor']=_0x54eace['targetEditor'];const {id:_0x5479e9}=this['_currentConfig'];this['isOpen']&&_0x36400e===_0x5479e9?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x2ed2d4=this['_editor'];if(!_0x2ed2d4)return;const _0x58cf93=_0x2ed2d4['plugins']['get']('Dialog');_0x58cf93['isOpen']&&this['_currentConfig']&&_0x58cf93['id']===this['_currentConfig']['id']&&_0x58cf93['hide']();}_updateDialog(){const _0x52ddca=this['_editor']['plugins']['get']('Dialog');if(!_0x52ddca['view'])return;const {icon:_0x2f4f1f,title:_0xc02ace,mainView:_0x1e5ea1}=this['_currentConfig'];this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x52ddca['view']['headerView']&&(_0x52ddca['view']['headerView']['label']=_0xc02ace,_0x52ddca['view']['headerView']['iconView']&&_0x2f4f1f&&(_0x52ddca['view']['headerView']['iconView']['content']=_0x2f4f1f)),this['_adjustBalloonWidth'](_0x1e5ea1),_0x52ddca['view']['updatePosition']();}_showFakeVisualSelection(){this['context']['plugins']['get'](Pn)['showFakeVisualSelection']({'editor':this['_editor'],'ranges':this['_currentConfig']['ranges'],'id':'balloon','priority':0x64}),Pt(Array['from'](this['_editor']['editing']['view']['domRoots']['values']()))?.['removeAllRanges']();}_hideFakeVisualSelection(){this['context']['plugins']['get'](Pn)['hideFakeVisualSelection']('balloon');}['_showDialog'](){const _0x435412=this['_editor']['plugins']['get']('Dialog'),{id:_0x9bf650,title:_0x152fcb,icon:_0x10112b,class:_0x25f4c6,mainView:_0x1a439c}=this['_currentConfig'];_0x1a439c['delegate'](...Vh)['to'](this),_0x435412['show']({'title':_0x152fcb,'icon':_0x10112b,'hasCloseButton':!0x0,'id':_0x9bf650,'position':this['_calculateDialogPosition']['bind'](this),'getRootName':this['_getCurrentDomRootName']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x25f4c6||''),'content':_0x1a439c,'onShow':_0x1fa899=>{this['_adjustBalloonWidth'](_0x1a439c),this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener'](),_0x1fa899['view']?.['updatePosition']();const _0x154955=this['_getSelectionElements']();_0x154955&&_0x154955[0x0]&&Yt({'target':_0x154955[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x1fa899['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x9bf650});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x9bf650}),this['isOpen']=!0x1;}});}_calculateDialogPosition(_0x3e6827,_0x52be06,_0x30e446){const _0x103911=_0x52be06||_0x30e446;if(!_0x103911)return null;const _0x5968ac=this['_getSelectionElements']();if(!_0x5968ac||0x0===_0x5968ac['length'])return{'left':Math['round'](_0x103911['left']+_0x103911['width']/0x2-_0x3e6827['width']/0x2),'top':Math['round'](_0x103911['top']+_0x103911['height']/0x2-_0x3e6827['height']/0x2)};const _0x3bf1ed=Math['round'](_0x103911['left']+_0x103911['width']/0x2-_0x3e6827['width']/0x2),_0x4679de=_0x5968ac['map'](_0x242910=>new Tt(_0x242910)),_0x3321c1=_0x3e6827['height'];return{'left':_0x3bf1ed,'top':this['_calculateOptimalTopPosition'](_0x4679de,_0x3321c1,_0x103911)};}_calculateOptimalTopPosition(_0x22c607,_0x28ff71,_0x4277ff){const _0x46f53f=new Tt(Vt['window']),_0x4b71d9=_0x22c607['map'](_0x1ba7db=>_0x1ba7db['getVisible']())['filter'](_0x28db75=>_0x28db75),_0x55b3d0=Tt['getBoundingRect'](_0x4b71d9);if(!_0x55b3d0)return Math['round'](_0x4277ff['top']+_0x4277ff['height']/0x2);const _0x4ee95f=_0x46f53f['getIntersection'](_0x55b3d0);if(!_0x4ee95f)return Math['round'](_0x4277ff['top']+_0x4277ff['height']/0x2);const _0x251deb=_0x4277ff['getVisible'](),_0x2adde4=_0x251deb&&_0x55b3d0['height']>_0x251deb['height'],_0x3fab51=_0x4ee95f['top'],_0x548970=_0x4ee95f['bottom'];if(_0x2adde4){const _0x49497a=_0x46f53f['top']+_0x46f53f['height']/0x2-_0x28ff71/0x2,_0x266fee=_0x3fab51-Bh-_0x46f53f['top'],_0x434baf=_0x46f53f['bottom']-_0x548970-Bh;return _0x266fee>=_0x28ff71?Math['max'](Bh,_0x3fab51-_0x28ff71-Bh):_0x434baf>=_0x28ff71?_0x548970+Bh:Math['max'](Bh,_0x49497a);}const _0x395136=_0x3fab51-_0x28ff71,_0x26cb3c=_0x46f53f['bottom']-_0x548970-Bh,_0x460aad=_0x3fab51-Bh-_0x46f53f['top'];let _0x5d1bd5;return _0x5d1bd5=_0x26cb3c>=_0x28ff71?_0x548970+Bh:_0x460aad>=_0x28ff71?_0x395136-Bh:_0x3fab51+_0x55b3d0['height']/0x2-_0x28ff71/0x2,_0x5d1bd5;}_setupFakeVisualSelectionMarkerRemovalListener(){const _0x2d4fa5=this['_editor'];this['listenTo'](_0x2d4fa5['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x4b3f08,data:{newRange:_0x5259eb}}of _0x2d4fa5['model']['document']['differ']['getChangedMarkers']())if(_0x4b3f08['startsWith']('ai-selection:')&&(_0x5259eb&&(_0x5259eb['start']['isEqual'](_0x5259eb['end'])||'$graveyard'==_0x5259eb['root']['rootName'])||null==_0x5259eb)){const _0x5aed65=qs(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x5aed65),this['fire']('selectionRemoved');}}});}_cleanupFakeVisualSelectionMarkerRemovalListener(){const _0x3f654c=this['_editor'];this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x3f654c['model']['document']);}_getSelectionElements(){const _0x25bf41=this['_editor'];return _0x2d82a6(_0x25bf41['editing'],[..._0x25bf41['model']['markers']['getMarkersGroup']('ai-selection'),..._0x25bf41['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}_getCurrentDomRootName(){const _0x5622b7=this['_currentConfig']?.['ranges']?.[0x0]?.['root'];return _0x5622b7&&_0x5622b7['rootName']?_0x5622b7['rootName']:null;}_adjustBalloonWidth(_0x49c390){const _0x17e101=this['_getCurrentDomRootName'](),_0x5187d0=_0x17e101?this['_editor']['editing']['view']['getDomRoot'](_0x17e101):null;_0x5187d0&&_0x49c390['adjustWidthToEditable'](_0x5187d0);}};function Wh({domRoot:_0xa97d9f,innerElement:_0x436899,outerElement:_0x5f5a02,widthCustomProperty:_0x9973f5}){if(!_0x436899||!_0x5f5a02)return null;const _0xc8b40a=function(_0x347fc9,_0x5caeee){let _0x9257d1=0x0,_0x5c3307=_0x347fc9;for(;_0x5c3307;){const {paddingLeft:_0x3c8a0d,paddingRight:_0x39754c,borderLeftWidth:_0x460393,borderRightWidth:_0x17f63a}=Fh(_0x5c3307);if(_0x9257d1+=Kh(_0x3c8a0d)+Kh(_0x39754c)+Kh(_0x460393)+Kh(_0x17f63a),_0x5c3307===_0x5caeee)return _0x9257d1;_0x5c3307=Lt(_0x5c3307);}return null;}(_0x436899,_0x5f5a02);if(null===_0xc8b40a)return null;const _0x28a9cb=function(_0x4a92c3){const {paddingLeft:_0x216771,paddingRight:_0x4ccf43}=Fh(_0x4a92c3);return _0x4a92c3['clientWidth']-Kh(_0x216771)-Kh(_0x4ccf43);}(_0xa97d9f)+_0xc8b40a;return _0x28a9cb<=0x0?null:'var('+_0x9973f5+','+Math['min'](Math['ceil'](_0x28a9cb),0x384)+'px)';}function Fh(_0x1ac050){return _0x1ac050['ownerDocument']['defaultView']['getComputedStyle'](_0x1ac050);}function Kh(_0x4c123c){return parseFloat(_0x4c123c)||0x0;}var $h=class extends _0x43ad99{constructor(_0x58bf77,_0x208353){super(_0x58bf77);const _0x28023=this['bindTemplate'];this['set']('isVisible',!0x0),this['setTemplate']({'tag':'span','attributes':{'class':['ck',_0x208353,_0x28023['if']('isVisible','ck-hidden',_0x5989b2=>!_0x5989b2)]}});}},Yh=class extends Hh{nextButtonView;previousButtonView;headerSeparatorView;['focusCycler'];['_focusables'];['_focusTracker'];_keystrokes;_stateView;constructor(_0x29045f,_0x3ff052){super(_0x29045f,{'showChangesButtonMode':'full',..._0x3ff052});const _0x4e75a8=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['set']('_outdatedReason',void 0x0),this['set']('areActionsDisabled',!0x1),this['_focusTracker']=new Et(),this['_keystrokes']=new pt(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x2dd4b2({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['headerSeparatorView']=new $h(_0x29045f,'ck-ai-chat-balloon-header-separator'),this['_toolbarView']['bind']('isEnabled')['to'](this,'areActionsDisabled',this,'_isErrorVisible',(_0x2c4bf1,_0x5b2b50)=>!_0x2c4bf1&&!_0x5b2b50),this['_stateView']=new so(_0x29045f),this['_stateView']['isVisible']=!0x1,this['_toolbarContainerView']['children']['add'](this['_stateView']),this['_setupMiniToolbar'](),this['on']('change:_state',(_0x6473a,_0x223c21,_0x2ca1f6,_0x2e0508)=>{let _0x354802,_0x3506ac;'pending'===_0x2e0508?(_0x354802=this['_toolbarView'],_0x3506ac=this['_stateView']):(_0x354802=this['_stateView'],_0x3506ac=this['_toolbarView']),this['_stateView']['setState'](_0x2ca1f6,this['_outdatedReason']),_0x354802['isVisible']=!0x1,_0x3506ac['isVisible']=!0x0;}),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon-main',_0x4e75a8['to']('_state',_0x414f6e=>'ck-ai-chat-balloon-main_state_'+_0x414f6e)],'style':{'width':_0x4e75a8['to']('width')}}});}['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['_toolbarView']),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['_miniToolbarView'],this['_toolbarView']]);}destroy(){super['destroy'](),this['previousButtonView']['destroy'](),this['nextButtonView']['destroy'](),this['headerSeparatorView']['destroy']();}['focus'](){this['focusCycler']['focusFirst']();}focusLast(){this['focusCycler']['focusLast']();}setState(_0x25a39d,_0xe1988c){this['_outdatedReason']=_0xe1988c,this['_state']=_0x25a39d;}toggleRotatorButtonsVisibility(_0x1ca11e){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=this['headerSeparatorView']['isVisible']=_0x1ca11e;}_createNextButtonView(){const _0x4d1705=new _0x1b12df(this['locale']);return _0x4d1705['set']({'icon':_0x3b2b34,'label':qs(this['locale'],'AI_BALLOON_NEXT_LABEL'),'class':pr,'isVisible':!0x0}),_0x4d1705['on']('execute',()=>{this['fire']('showNext');}),_0x4d1705;}_createPreviousButtonView(){const _0x424b2e=new _0x1b12df(this['locale']);return _0x424b2e['set']({'icon':_0x40bbde,'label':qs(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'class':pr,'isVisible':!0x0}),_0x424b2e['on']('execute',()=>{this['fire']('showPrevious');}),_0x424b2e;}adjustWidthToEditable(_0x4faae5){const _0x47a9cf=Wh({'domRoot':_0x4faae5,'innerElement':this['_streamableContentView']['element'],'outerElement':this['element'],'widthCustomProperty':'--ck-ai-chat-balloon-width'});_0x47a9cf&&(this['width']=_0x47a9cf);}_setupMiniToolbar(){this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');});}},qh=class extends _0x52da8c{static get requires(){return[_0x2c281f,Gh];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}_chatBalloonView;constructor(_0x4d0def){super(_0x4d0def),this['set']('showDiff',!0x1);}['open'](_0x395675){const _0x516273=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x516273['plugins']['get']('AIBalloon')['open']({..._0x395675,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x395675['showRotator']),this['_chatBalloonView']['areActionsDisabled']=_0x395675['areActionsDisabled'],this['_chatBalloonView']['isTargetReadOnly']=_0x395675['isTargetReadOnly'],this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}updateContent(_0x4b22d0){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x4b22d0);}clearContent(){this['_chatBalloonView']&&this['_chatBalloonView']['clearContent']();}setState(_0x439a5d,_0x3de085){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x439a5d,_0x3de085);}setTargetReadOnly(_0x3b14a7){this['_chatBalloonView']&&(this['_chatBalloonView']['isTargetReadOnly']=_0x3b14a7);}_createChatBalloonView(){const _0x22d453=this['editor'],_0x17204f=_0x22d453['plugins']['get']('AIBalloon'),_0x3885d1=_0x22d453['commands']['get']('trackChanges');let _0x51e57a=_0x22d453['config']['get']('ai.availableReplyActions')||[...po];_0x22d453['plugins']['has']('TrackChanges')||(_0x51e57a=_0x51e57a['filter'](_0x1b4ba5=>'insertSuggestion'!=_0x1b4ba5));const _0x53fffe=new Yh(_0x22d453['locale'],{'availableActions':_0x51e57a,'showApplyButton':!0x0,'showSuggestButton':!!_0x3885d1});return _0x53fffe['bind']('showDiff')['to'](this),_0x53fffe['delegate'](...$r)['to'](this),_0x53fffe['delegate']('showPrevious','showNext')['to'](this),_0x17204f['delegate']('dialogClosed')['to'](this),_0x53fffe['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x53fffe['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x53fffe['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x3885d1&&_0x53fffe['bind']('isTrackChangesOn')['to'](_0x3885d1,'value'),_0x53fffe['render'](),_0x53fffe;}_toggleRotatorButtonsInDialogHeader(_0x28ed3d){const _0xc3f6bb=this['editor'],_0x1cbe7f=_0xc3f6bb['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x28ed3d),_0x1cbe7f['has'](this['_chatBalloonView']['previousButtonView'])||(_0x1cbe7f['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView'],this['_chatBalloonView']['headerSeparatorView']],0x0),_0xc3f6bb['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x1cbe7f['remove'](this['_chatBalloonView']['previousButtonView']),_0x1cbe7f['remove'](this['_chatBalloonView']['nextButtonView']),_0x1cbe7f['remove'](this['_chatBalloonView']['headerSeparatorView']);}));}_restoreDefaultViewFocus(){this['_chatBalloonView']['focus']();}},Qh=class extends _0x52da8c{static get requires(){return[kh,qh,_0x1d949b];}get['dialog'](){return this['editor']['plugins']['get'](_0x2c281f);}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};function Xh(_0x4970c1){const {editor:_0x5b51d3,action:_0x26c61f,withText:_0x4a150b=!0x1,withIcon:_0x4dee15=!0x0,isInDropdown:_0x29fbad=!0x0,shouldPreventFocus:_0x5ab23e=!0x1,actionButtons:_0x24cd50}=_0x4970c1;return()=>{const _0x1c8008=_0x5b51d3['locale'],_0x371b21=new _0x1b12df(_0x1c8008),_0x55d6c1=_0x371b21['bindTemplate'];_0x29fbad&&_0x371b21['extendTemplate']({'on':{'mouseenter':_0x55d6c1['to'](()=>{_0x5ab23e&&_0x5ab23e()||_0x371b21['focus']();})}}),_0x24cd50['push']({'buttonView':_0x371b21,'action':_0x26c61f});const _0x2c74d9=_0x26c61f['icon']??_0x26c61f['parent']?.['icon'];return _0x371b21['set']({'label':_0x26c61f['label'],'withText':_0x4a150b,'role':'menuitem','icon':_0x4dee15?_0x2c74d9??_0x211114:void 0x0,'tooltip':!_0x4a150b,'class':'ck-ai-quick-actions-button','isEnabled':_0x26c61f['isEnabled']}),_0x371b21['on']('execute',()=>{_0x5b51d3['editing']['view']['focus'](),_0x5b51d3['commands']['execute']('aiQuickAction',_0x26c61f);}),_0x371b21;};}var zh=class extends _0x474fcf{['arrowView'];constructor(_0x24f728,_0x10d0f4){super(_0x24f728,_0x10d0f4);const _0x2b46c7=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',_0x443f14=>String(_0x443f14)),'data-cke-tooltip-disabled':_0x2b46c7['to']('isOn')},'on':{'mouseenter':_0x2b46c7['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}_createArrowView(){const _0x3b8280=new _0x3188b1();return _0x3b8280['content']=_0x5133fa,_0x3b8280['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x3b8280;}},jh=class extends _0x35138b{_allListItems;_allSearchableItems;constructor(_0x29280c,_0x5e9904,_0x382b05){super(_0x29280c),this['_allListItems']=_0x5e9904,this['_allSearchableItems']=_0x382b05;}filter(_0x40bca6){if(!_0x40bca6)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x119197=_0x40bca6['source']['toLowerCase']()['trim'](),_0x22dbe4=this['_allSearchableItems']['filter'](_0x499937=>(_0x499937['groupLabel']?_0x499937['label']+'\x20('+_0x499937['groupLabel']+')':_0x499937['label'])['toLowerCase']()['includes'](_0x119197));return this['items']['clear'](),this['items']['addMany'](_0x22dbe4['sort']((_0x5def6a,_0x6de3c7)=>{const _0x52c497=_0x5def6a['groupLabel'],_0xe575e1=_0x6de3c7['groupLabel'];return _0x52c497||_0xe575e1?_0x52c497?0x1:-0x1:0x0;})['map'](_0x13adbe=>_0x13adbe['item'])),this['_highlightQuery'](_0x119197,_0x22dbe4),{'resultsCount':_0x22dbe4['length'],'totalItemsCount':this['_allSearchableItems']['length']};}_highlightQuery(_0x53614f,_0x3d606e){if(!_0x53614f)return;const _0x4a5a50=new RegExp(_0x55bbed(_0x53614f),'gi');_0x3d606e['forEach'](_0x1e9ce1=>{_0x1e9ce1['highlightViews']&&_0x1e9ce1['highlightViews']['forEach'](_0x122533=>{'function'==typeof _0x122533['highlightText']&&_0x122533['highlightText'](_0x4a5a50);});});}_clearHighlight(){this['_allSearchableItems']['forEach'](_0xa679c=>{_0xa679c['highlightViews']&&_0xa679c['highlightViews']['forEach'](_0x4470fb=>{'function'==typeof _0x4470fb['highlightText']&&_0x4470fb['highlightText'](null);});});}};const Jh='menu',Zh='menuitem';var tc=class extends _0x43ad99{_bodyCollection;optionsListView;_searchTextView=null;_allSearchableItems=[];['children'];['focusTracker'];keystrokes;['_focusables'];['focusCycler'];_openNestedPanels=new Set();_nestedPanels=new Set();['_hasSearch'];_actionButtons;constructor(_0x17778c,_0x41ce83,_0x6768d1,_0x5241ed,_0x14ac47=!0x1,_0x5f49d5=[]){const _0x2014d2=_0x17778c['locale'];super(_0x2014d2),this['_bodyCollection']=_0x5241ed,this['_hasSearch']=_0x14ac47,this['_actionButtons']=_0x5f49d5;const _0x11e69a=this['_createListItems'](_0x17778c,_0x41ce83,_0x6768d1);this['optionsListView']=new jh(_0x2014d2,_0x11e69a,this['_allSearchableItems']),this['optionsListView']['role']=Jh,this['optionsListView']['items']['addMany'](_0x11e69a),this['focusTracker']=new Et(),this['keystrokes']=new pt(),_0x14ac47&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x11e69a,this['focusCycler']=new _0x2dd4b2({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x14ac47&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x5a7707=_0x14ac47&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x4a09f9(_0x5a7707),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x2014d2['uiLanguageDirection']},'children':this['children']});}_createSearchTextView(){return new _0x248c98(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':qs(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':qs(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x145a31=this['_searchTextView']['queryView']['fieldView']['element'];return Rt(_0x145a31,vt(_0x145a31));}_createListItems(_0xaeb20,_0x302b8c,_0x4d0683){const _0x23c92b=new _0x4a09f9();return _0x302b8c['forEach'](_0x4b458f=>{if('actions'in _0x4b458f){const {listItem:_0x21c8a6}=this['_createActionGroupButton'](_0xaeb20,_0x4b458f,_0x4d0683);_0x23c92b['add'](_0x21c8a6),_0x4b458f['actions']['forEach'](_0x17abc8=>{const {listItem:_0x42baea,highlightViews:_0x37d4c8}=this['_createSearchResultActionButton'](_0xaeb20,_0x17abc8,_0x4b458f['label'],_0x4b458f['icon']);this['_allSearchableItems']['push']({'item':_0x42baea,'label':_0x17abc8['label'],'groupLabel':_0x4b458f['label'],'highlightViews':_0x37d4c8});});}else{const {listItem:_0x49b390}=this['_createActionButton'](_0xaeb20,_0x4b458f);_0x23c92b['add'](_0x49b390);const _0x293aba=_0x49b390['children']['first'];if(_0x293aba){const {listItem:_0x357e01,highlightViews:_0x2fcd8e}=this['_createSearchResultActionButton'](_0xaeb20,_0x4b458f);this['_allSearchableItems']['push']({'item':_0x357e01,'label':_0x293aba['label']||'','highlightViews':_0x2fcd8e});}}}),_0x23c92b;}_createActionButton(_0x3ae2a7,_0x2154f3,_0xd05082,_0x5b3182){const _0x26a039=new _0x5be144(this['locale']);if(_0xd05082&&_0x5b3182){const _0x4a0bff=new _0x1b12df(this['locale']),_0x107327=_0x4a0bff['bindTemplate'],_0x513631=new _0x473cf4();_0x513631['text']=_0x2154f3['label'];const _0x12b3ce=new _0x473cf4();_0x12b3ce['text']=_0xd05082;const _0x5cde16=new _0x3188b1();_0x5cde16['content']=_0x5b3182,_0x5cde16['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x32c194=new _0x43ad99(this['locale']);_0x32c194['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x35e842=new _0x43ad99(this['locale']);return _0x35e842['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x4a0bff['set']({'label':_0x2154f3['label']+'\x20('+_0xd05082+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1,'isEnabled':_0x2154f3['isEnabled']}),_0x4a0bff['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-button_with-group',_0x107327['if']('isEnabled','ck-disabled',_0x492d21=>!_0x492d21)],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x513631,_0x32c194,_0x5cde16,_0x12b3ce,_0x35e842],'on':{'mouseenter':_0x107327['to'](()=>{this['_isSearchFocused']()||_0x4a0bff['focus']();}),'click':_0x107327['to'](()=>{_0x4a0bff['fire']('execute');})}}),_0x4a0bff['on']('execute',()=>{_0x4a0bff['isEnabled']&&(_0x3ae2a7['editing']['view']['focus'](),_0x3ae2a7['commands']['execute']('aiQuickAction',_0x2154f3));}),_0x26a039['children']['add'](_0x4a0bff),this['_actionButtons']['push']({'buttonView':_0x4a0bff,'action':_0x2154f3}),{'listItem':_0x26a039,'highlightViews':[_0x513631,_0x12b3ce]};}{const _0x478b47=new _0x3b187d(),_0x1cbd27=new _0x1b12df(this['locale'],_0x478b47),_0x28e165=_0x1cbd27['bindTemplate'],_0x34dd04=_0x2154f3['icon']??_0x2154f3['parent']?.['icon'],_0x3aa255=void 0x0!==_0x2154f3['icon'];return _0x1cbd27['set']({'label':_0x2154f3['label'],'withText':!0x0,'role':'menuitem','icon':_0x3aa255?_0x34dd04??_0x211114:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button','isEnabled':_0x2154f3['isEnabled']}),_0x1cbd27['extendTemplate']({'on':{'mouseenter':_0x28e165['to'](()=>{this['_isSearchFocused']()||_0x1cbd27['focus']();})}}),_0x1cbd27['on']('execute',()=>{_0x3ae2a7['editing']['view']['focus'](),_0x3ae2a7['commands']['execute']('aiQuickAction',_0x2154f3);}),_0x26a039['children']['add'](_0x1cbd27),this['_actionButtons']['push']({'buttonView':_0x1cbd27,'action':_0x2154f3}),{'listItem':_0x26a039,'highlightViews':[_0x478b47]};}}_createSearchResultActionButton(_0x14e504,_0xd806b1,_0x133d53,_0x342108){return _0x133d53&&_0x342108?this['_createSearchResultGroupedActionButton'](_0x14e504,_0xd806b1,_0x133d53,_0x342108):this['_createSearchResultIndividualActionButton'](_0x14e504,_0xd806b1);}_createSearchResultGroupedActionButton(_0x1bf16f,_0x4f5083,_0x20f4a4,_0x4c9358){const _0x32a99f=new _0x5be144(this['locale']),_0x3317e9=new _0x1b12df(this['locale']),_0x21d50d=_0x3317e9['bindTemplate'],{view:_0x226cf8,highlightView:_0x10c2a8}=this['_createSearchResultGroupRow'](_0x20f4a4,_0x4c9358),{view:_0xf34ce,highlightView:_0x218cda}=this['_createSearchResultActionRow'](_0x4f5083['label']),_0x3b9273=this['_createSearchResultContentView'](_0x226cf8,_0xf34ce);return _0x3317e9['set']({'label':_0x4f5083['label'],'withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button\x20ck-ai-quick-actions-search-result-button_with-group','tooltip':!0x1,'isEnabled':_0x4f5083['isEnabled']}),_0x3317e9['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',_0x21d50d['if']('isEnabled','ck-disabled',_0x535b18=>!_0x535b18)],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x3b9273],'on':{'mouseenter':_0x21d50d['to'](()=>{this['_isSearchFocused']()||_0x3317e9['focus']();}),'click':_0x21d50d['to'](()=>{this['_handleSearchResultButtonClick'](_0x3317e9);})}}),this['_setupActionButtonExecution'](_0x3317e9,_0x1bf16f,_0x4f5083),_0x32a99f['children']['add'](_0x3317e9),this['_actionButtons']['push']({'buttonView':_0x3317e9,'action':_0x4f5083}),{'listItem':_0x32a99f,'highlightViews':[_0x10c2a8,_0x218cda]};}_createSearchResultIndividualActionButton(_0x441c22,_0x2ed29b){const _0x4f6cf9=new _0x5be144(this['locale']),_0x44487d=new _0x3b187d(),_0x20fd7f=new _0x1b12df(this['locale'],_0x44487d),_0x518bf4=_0x20fd7f['bindTemplate'];return _0x20fd7f['set']({'label':_0x2ed29b['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button','isEnabled':_0x2ed29b['isEnabled']}),_0x20fd7f['extendTemplate']({'on':{'mouseenter':_0x518bf4['to'](()=>{this['_isSearchFocused']()||_0x20fd7f['focus']();})}}),this['_setupActionButtonExecution'](_0x20fd7f,_0x441c22,_0x2ed29b),_0x4f6cf9['children']['add'](_0x20fd7f),this['_actionButtons']['push']({'buttonView':_0x20fd7f,'action':_0x2ed29b}),{'listItem':_0x4f6cf9,'highlightViews':[_0x44487d]};}_createSearchResultGroupRow(_0x6068a,_0x55a102){const _0xa1848d=new _0x43ad99(this['locale']),_0x39a980=new _0x3188b1();_0x39a980['content']=_0x55a102,_0x39a980['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x3ca00f=new _0x473cf4();return _0x3ca00f['text']=_0x6068a,_0xa1848d['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x39a980,_0x3ca00f]}),{'view':_0xa1848d,'highlightView':_0x3ca00f};}_createSearchResultActionRow(_0x2c9432){const _0xc3fd57=new _0x43ad99(this['locale']),_0x3a063d=new _0x473cf4();return _0x3a063d['text']=_0x2c9432,_0xc3fd57['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x3a063d]}),{'view':_0xc3fd57,'highlightView':_0x3a063d};}_createSearchResultContentView(_0x40833c,_0x6200ce){const _0x1a63cf=new _0x43ad99(this['locale']);return _0x1a63cf['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x40833c,_0x6200ce]}),_0x1a63cf;}_setupActionButtonExecution(_0xd70387,_0xdc3d76,_0x36c8b3){_0xd70387['on']('execute',()=>{_0xd70387['isEnabled']&&(_0xdc3d76['editing']['view']['focus'](),_0xdc3d76['commands']['execute']('aiQuickAction',_0x36c8b3));});}_createActionGroupButton(_0x281bc8,_0x41c818,_0x158168){const _0x4b2242=new _0x5be144(this['locale']),_0x509618=new _0x3b187d(),_0x4d775a=new zh(this['locale'],_0x509618),_0x480df5=_0x4d775a['bindTemplate'],_0x2ee61a=this['_getPanelKeystroke'](_0x158168),_0x25e861=this['_createGroupActionsList'](_0x281bc8,_0x41c818['actions'],_0x158168);_0x4d775a['set']({'label':_0x41c818['label'],'withText':!0x0,'role':Zh,'icon':_0x41c818['icon']??_0x211114,'isEnabled':_0x41c818['actions']['some'](_0x37066b=>_0x37066b['isEnabled'])}),_0x4d775a['extendTemplate']({'on':{'mouseenter':_0x480df5['to'](()=>{this['_isSearchFocused']()||_0x4d775a['focus']();})}});const _0x938280=new Jt(this['locale']);return _0x938280['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel','ck-toolbar-context']},'on':{'keydown':_0x480df5['to'](_0x55ad74=>{this['_handlePanelKeydown'](_0x55ad74,_0x2ee61a,_0x4d775a,_0x938280);})}}),_0x4d775a['bind']('isOn')['to'](_0x938280,'isVisible'),this['_bodyCollection']['add'](_0x938280),this['_nestedPanels']['add'](_0x938280),_0x938280['content']['add'](_0x25e861),this['_setupGroupMenuBehavior'](_0x4d775a,_0x938280),_0x4b2242['children']['add'](_0x4d775a),this['_actionButtons']['push']({'buttonView':_0x4d775a,'action':_0x41c818}),{'listItem':_0x4b2242,'highlightView':_0x509618};}_createGroupActionsList(_0x2e48ef,_0x3beb3e,_0x2f6985){const _0x17e9d4=new _0x35138b(this['locale']);return _0x17e9d4['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x3beb3e['forEach'](_0x4ac8a3=>{const _0x2817d4=new _0x5be144(this['locale']),_0x48b6ed=Xh({'editor':_0x2e48ef,'action':_0x4ac8a3,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused'](),'actionButtons':this['_actionButtons']})();_0x2817d4['children']['add'](_0x48b6ed),_0x2f6985['focusTracker']['add'](_0x48b6ed),_0x17e9d4['items']['add'](_0x2817d4);}),_0x17e9d4;}_setupGroupMenuBehavior(_0x1f40ff,_0x11b326){const _0x6db2df=_0x1f40ff['bindTemplate'],_0x1c10f4=this['_getButtonKeystroke'](_0x1f40ff);_0x1f40ff['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x6db2df['to'](()=>{this['_showNestedPanel'](_0x11b326,_0x1f40ff);}),'mouseleave':_0x6db2df['to'](_0x3384ad=>{ec(_0x3384ad,_0x1f40ff,_0x11b326)||this['_hideNestedPanel'](_0x11b326);}),'keydown':_0x6db2df['to'](_0x215d8c=>{_0x215d8c['key']==_0x1c10f4&&(this['_showNestedPanel'](_0x11b326,_0x1f40ff),_0x11b326['content']['get'](0x0)['focus']());})}}),_0x11b326['on']('render',()=>{this['listenTo'](_0x11b326['element'],'mouseleave',(_0x5d530,_0x523f44)=>{ec(_0x523f44,_0x1f40ff,_0x11b326)||this['_hideNestedPanel'](_0x11b326);});});}_showNestedPanel(_0x2908b6,_0x1316b2){this['_openNestedPanels']['forEach'](_0x3223f5=>{_0x3223f5!==_0x2908b6&&_0x3223f5['isVisible']&&_0x3223f5['hide']();}),_0x2908b6['show'](),_0x2908b6['pin']({'positions':[_0x56862a['eastSouth']],'target':_0x1316b2['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x2908b6);}_hideNestedPanel(_0x550362){_0x550362['hide'](),this['_openNestedPanels']['delete'](_0x550362);}_hideAllNestedPanels(){this['_openNestedPanels']['forEach'](_0x44b421=>_0x44b421['hide']()),this['_openNestedPanels']['clear']();}resetSearch(){this['_searchTextView']&&this['_searchTextView']['reset']();}destroy(){this['_hideAllNestedPanels']();for(const _0x5085ea of this['_nestedPanels'])this['_bodyCollection']['has'](_0x5085ea)&&this['_bodyCollection']['remove'](_0x5085ea),_0x5085ea['destroy']();this['_nestedPanels']['clear'](),super['destroy']();}['focus'](){this['_searchTextView']?this['_searchTextView']['focus']():this['optionsListView']['focus']();}_getPanelKeystroke(_0x5484fc){return'rtl'===_0x5484fc['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}_getButtonKeystroke(_0x1c2210){return'rtl'===_0x1c2210['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x125dc0,_0x539c0c,_0x353054,_0x2f08a7){_0x125dc0['key']==_0x539c0c&&(_0x353054['focus'](),this['_hideNestedPanel'](_0x2f08a7));}_handleSearchResultButtonClick(_0x25ddde){_0x25ddde['fire']('execute');}};function ec(_0x3e2493,_0x31f93a,_0x3f27bc){return[_0x31f93a['element'],_0x3f27bc['element']]['filter'](_0x4060e7=>!!_0x4060e7)['some'](_0x5d0aad=>_0x2c12b5(_0x5d0aad,_0x3e2493));}function ic(_0x475c3d){const {editor:_0x2c8c1f,content:_0x392502,buttonDefinition:_0x549314,bodyCollection:_0x342246,hasSearch:_0x419ec4=!0x1,actionButtons:_0x501e88}=_0x475c3d;return()=>{const _0x189232=_0x2c8c1f['locale'],_0x2c701d=_0x2c8c1f['commands']['get']('aiQuickAction'),_0x3d343d=_0x348de2(_0x189232);_0x3d343d['bind']('isEnabled')['to'](_0x2c701d),_0x3d343d['buttonView']['set']({'icon':_0x549314['icon']??_0x211114,'label':_0x549314['label'],'tooltip':!0x0}),_0x3d343d['set']({'class':'ck-ai-quick-actions-dropdown'});const _0xffe8a0=new tc(_0x2c8c1f,_0x392502,_0x3d343d,_0x342246,_0x419ec4,_0x501e88);return _0x3d343d['panelView']['children']['add'](_0xffe8a0),_0x419ec4&&_0x3d343d['on']('change:isOpen',(_0x5f0c8f,_0x88443,_0x44a982)=>{if(_0x44a982){if(_0x2c8c1f['plugins']['has']('AIEditing')){const _0xe35762=_0x2c8c1f['plugins']['get'](Pn),_0x166dc3=_0x2c8c1f['model']['document']['selection'],_0x202f9e=Array['from'](_0x166dc3['getRanges']());_0x202f9e['length']>0x0&&_0xe35762['showFakeVisualSelection']({'editor':_0x2c8c1f,'ranges':_0x202f9e,'id':'quick-action','priority':0x14});}}else _0x2c8c1f['plugins']['has']('AIEditing')&&_0x2c8c1f['plugins']['get'](Pn)['hideFakeVisualSelection']('quick-action'),_0xffe8a0['resetSearch']();}),_0x3d343d;};}const sc='<task>Explain\x20the\x20selected\x20part\x20of\x20the\x20document\x20in\x20plain,\x20simple\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).-\x20Avoid\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><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20explanation,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant,\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',nc='<task>Summarize\x20the\x20selected\x20part\x20of\x20the\x20document\x20in\x202–4\x20clear\x20sentences,\x20capturing\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><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20summary,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',rc='<task>Extract\x20and\x20present\x20the\x20key\x20points\x20from\x20the\x20selected\x20part\x20of\x20the\x20document\x20as\x20a\x20concise\x20bulleted\x20list.</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><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20key\x20points\x20list,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',oc=/* #__PURE__ -- @preserve */
|
|
37
|
+
((()=>({'chat':'AIChat','action':'AIActions'}))());var ac=class AIQuickActionsUI extends _0x52da8c{_actionButtons=[];['_menuBarGroupViews']=[];_reporter;static get requires(){return[Zt,$s,dr,Js];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['_reporter']=this['editor']['plugins']['get'](dr)['createReporter']('aiquickactions');const _0x3290f3=this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x3290f3),this['_initializeQuickActionsComponentsAndCommands'](),this['_initActionTypeQuickActions'](),this['_initChatTypeQuickActions']();}static getDefaultQuickActions(_0x2231d8){return function(_0x5ec3df){const _0x4cf025=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x5ec3df['uiLanguage'])||'English';return[{'id':'ask-ai','label':qs(_0x5ec3df,'AI_QUICK_ACTIONS_ASK_AI'),'type':'chat','icon':_0x3392ac},{'id':'chat-commands','label':qs(_0x5ec3df,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x3392ac,'actions':[{'id':'explain','label':qs(_0x5ec3df,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':qs(_0x5ec3df,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':sc['replace']('%0',_0x4cf025),'type':'chat'},{'id':'summarize','label':qs(_0x5ec3df,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':qs(_0x5ec3df,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':nc['replace']('%0',_0x4cf025),'type':'chat'},{'id':'highlight-key-points','label':qs(_0x5ec3df,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':qs(_0x5ec3df,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':rc['replace']('%0',_0x4cf025),'type':'chat'}]},{'id':'improve-writing','label':qs(_0x5ec3df,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'action','icon':_0x3d577c},{'id':'continue','label':qs(_0x5ec3df,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'action','icon':_0x3664c0},{'id':'fix-grammar','label':qs(_0x5ec3df,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'action','icon':_0x264045},{'id':'adjust-length','label':qs(_0x5ec3df,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0xc0a4f4,'actions':[{'id':'make-shorter','label':qs(_0x5ec3df,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'action'},{'id':'make-longer','label':qs(_0x5ec3df,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'action'}]},{'id':'change-tone','label':qs(_0x5ec3df,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x2e6b7e,'actions':[{'id':'make-tone-casual','label':qs(_0x5ec3df,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'action'},{'id':'make-tone-direct','label':qs(_0x5ec3df,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'action'},{'id':'make-tone-friendly','label':qs(_0x5ec3df,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'action'},{'id':'make-tone-confident','label':qs(_0x5ec3df,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'action'},{'id':'make-tone-professional','label':qs(_0x5ec3df,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'action'}]},{'id':'translate','label':qs(_0x5ec3df,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x2f431a,'actions':[{'id':'translate-to-english','label':qs(_0x5ec3df,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'action','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':qs(_0x5ec3df,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'action','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':qs(_0x5ec3df,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'action','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':qs(_0x5ec3df,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'action','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':qs(_0x5ec3df,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'action','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':qs(_0x5ec3df,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'action','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':qs(_0x5ec3df,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'action','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':qs(_0x5ec3df,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'action','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':qs(_0x5ec3df,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'action','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':qs(_0x5ec3df,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'action','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':qs(_0x5ec3df,'AI_QUICK_ACTIONS_OTHER'),'icon':_0x382db1,'actions':[]}];}(_0x2231d8);}_getDefaultAndCustomActions(){const _0x49ed60=AIQuickActionsUI['getDefaultQuickActions'](this['editor']['locale']),_0x14cfcd=(this['editor']['config']['get']('ai.quickActions.extraCommands')||[])['map'](_0x4e9253=>({..._0x4e9253,'type':'chat'===_0x4e9253['type']?'chat':'action','icon':void 0x0}));return _0x49ed60['find'](_0x509ed2=>'other'===_0x509ed2['id'])['actions']['push'](..._0x14cfcd),_0x49ed60;}async _initActionTypeQuickActions(){try{const _0x563919=this['editor']['plugins']['get'](Js),_0x186069=await _0x563919['models']['getAllModels'](),_0x4e72db=(await _0x563919['models']['getDefault']())?.['id'];this['_assignDefaultModelToCustomActions'](_0x4e72db),this['_enableButtonsByType']('action',_0x508b82=>!!_0x186069['find'](_0x434ff3=>_0x434ff3['id']===_0x508b82['model'])||void 0x0===_0x508b82['model']);}catch(_0x525e02){const _0x423cae=new dt('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x525e02});this['_reporter']['logError'](_0x423cae);}}_initChatTypeQuickActions(){if(!this['editor']['plugins']['has']('AIChatController'))return;const _0x263cfd=this['editor']['plugins']['get']('AIChatController'),_0x5f3a95=this['editor']['plugins']['has']('AIChatUI')?this['editor']['plugins']['get']('AIChatUI'):null;this['listenTo'](_0x263cfd,'change:isConversationReady',(_0x239e12,_0x310e82,_0x6182d9)=>{this['_enableButtonsByType']('chat',()=>_0x6182d9&&!_0x5f3a95?.['isBusy']);}),_0x5f3a95&&this['listenTo'](_0x5f3a95,'change:isBusy',(_0x2bae34,_0x34d44d,_0x3491a5)=>{this['_enableButtonsByType']('chat',()=>_0x263cfd['isConversationReady']&&!_0x3491a5);}),this['_enableButtonsByType']('chat',()=>_0x263cfd['isConversationReady']&&!_0x5f3a95?.['isBusy']);}_enableButtonsByType(_0x50803b,_0x2c1cad){this['_quickActionsDefinition']['forEach'](_0x492af1=>{'actions'in _0x492af1?_0x492af1['actions']['forEach'](_0x5a5128=>{_0x5a5128['type']===_0x50803b&&(_0x5a5128['isEnabled']=_0x2c1cad(_0x5a5128));}):_0x492af1['type']===_0x50803b&&(_0x492af1['isEnabled']=_0x2c1cad(_0x492af1));}),this['_actionButtons']['forEach'](_0x166dcb=>{if(hc(_0x166dcb['action']))return;if(_0x166dcb['action']['type']!==_0x50803b)return;const _0x56b68a=_0x2c1cad(_0x166dcb['action']);if(_0x166dcb['action']['isEnabled']=_0x56b68a,_0x166dcb['buttonView']['isEnabled']=_0x56b68a,'action'===_0x50803b&&!_0x56b68a&&_0x166dcb['action']['model']){const _0x225cc2=new dt('ai-quick-actions-unavailable-model',this,{'actionId':_0x166dcb['action']['id'],'modelId':_0x166dcb['action']['model']});this['_reporter']['logError'](_0x225cc2);}}),this['_actionButtons']['filter'](_0x2d1d88=>hc(_0x2d1d88['action']))['forEach'](_0x684cba=>{_0x684cba['buttonView']['isEnabled']=_0x684cba['action']['actions']['some'](_0x1ba949=>_0x1ba949['isEnabled']);}),this['_menuBarGroupViews']['forEach'](({view:_0x4ffd8d,group:_0x5a2457})=>{_0x4ffd8d['isEnabled']=_0x5a2457['actions']['some'](_0x4eba5b=>_0x4eba5b['isEnabled']);});}_enableButtonById(_0x211433,_0x1f2ff7){this['_quickActionsDefinition']['forEach'](_0x350794=>{'actions'in _0x350794?_0x350794['actions']['forEach'](_0x2f92ba=>{_0x2f92ba['id']===_0x211433&&(_0x2f92ba['isEnabled']=_0x1f2ff7(_0x2f92ba));}):_0x350794['id']===_0x211433&&(_0x350794['isEnabled']=_0x1f2ff7(_0x350794));}),this['_actionButtons']['forEach'](_0x568e19=>{if(hc(_0x568e19['action']))return;if(_0x568e19['action']['id']!==_0x211433)return;const _0x1c51ad=_0x1f2ff7(_0x568e19['action']);_0x568e19['action']['isEnabled']=_0x1c51ad,_0x568e19['buttonView']['isEnabled']=_0x1c51ad;});}_assignDefaultModelToCustomActions(_0x1db876){this['_actionButtons']['forEach'](_0x3d8be5=>{hc(_0x3d8be5['action'])||'action'===_0x3d8be5['action']['type']&&(_0x3d8be5['action']['model']||(_0x3d8be5['action']['model']=_0x1db876));});}_initializeQuickActionsComponentsAndCommands(){const _0x8ea2a3=this['editor']['ui']['view']['body'];this['_initializeQuickActionsDropdown'](_0x8ea2a3),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x8ea2a3);}_initializeQuickActionsDropdown(_0x4b9858){const _0x17c80b=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',ic({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x211114,'label':qs(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x4b9858,'hasSearch':_0x17c80b,'actionButtons':this['_actionButtons']}));}_prepareQuickActionsDefinition(_0x4f0f57){this['_quickActionsDefinition']=_0x4f0f57['map'](_0x5b6399=>{if('actions'in _0x5b6399){const _0xe4d82d=_0x5b6399;return{..._0xe4d82d,'actions':_0xe4d82d['actions']['map'](_0x464896=>{const {actions:_0xe75182,..._0x45d8b2}=_0xe4d82d;return{..._0x464896,'isEnabled':!0x1,'parent':_0x45d8b2};})['filter'](_0x3fbbb3=>this['_shouldIncludeAction'](_0x3fbbb3))};}return{..._0x5b6399,'isEnabled':!0x1};})['filter'](_0x8362b5=>'actions'in _0x8362b5?_0x8362b5['actions']['length']>0x0:this['_shouldIncludeAction'](_0x8362b5));}_shouldIncludeAction(_0xc74b5b){const _0x1d06c0=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](oc[_0xc74b5b['type']])&&!_0x1d06c0['includes'](_0xc74b5b['id'])&&!('chat'===_0xc74b5b['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}_initializeQuickActionsComponents(_0x5ab254){this['_quickActionsDefinition']['forEach'](_0x739c0a=>{if('actions'in _0x739c0a){const _0x155051=ic({'editor':this['editor'],'content':_0x739c0a['actions'],'buttonDefinition':_0x739c0a,'bodyCollection':_0x5ab254,'actionButtons':this['_actionButtons']});this['editor']['ui']['componentFactory']['add'](_0x739c0a['id'],_0x155051),_0x739c0a['actions']['forEach'](_0x245158=>{const _0x312e99=Xh({'editor':this['editor'],'action':_0x245158,'actionButtons':this['_actionButtons']});this['editor']['ui']['componentFactory']['add'](_0x245158['id'],_0x312e99);});}else{const _0x162df4=Xh({'editor':this['editor'],'action':_0x739c0a,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1,'actionButtons':this['_actionButtons']});this['editor']['ui']['componentFactory']['add'](_0x739c0a['id'],_0x162df4);}});}_initializeQuickActionsMenuBar(){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x3ee3a2=>{const _0x2c6dcb=this['editor']['commands']['get']('aiQuickAction'),_0xd94cdb=new _0x30233e(_0x3ee3a2),_0x220270=qs(_0x3ee3a2,'AI_QUICK_ACTIONS_HEADING');_0xd94cdb['buttonView']['set']({'label':_0x220270,'icon':_0x211114});const _0x35cf85=new _0x525003(_0x3ee3a2);return _0x35cf85['set']({'ariaLabel':_0x220270,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x538ee2=>{if('actions'in _0x538ee2){const _0x242231=_0x538ee2,_0x1a5c2c=new _0x1a22a2(_0x3ee3a2,_0xd94cdb),_0x1d725b=new _0x30233e(_0x3ee3a2),_0x194ac9=new _0x525003(_0x3ee3a2);_0x1d725b['buttonView']['set']({'label':_0x242231['label'],'icon':_0x242231['icon']}),_0x242231['actions']['forEach'](_0x5e6016=>{const _0x34ef74=new _0x1a22a2(_0x3ee3a2,_0x1d725b),_0x505ecc=new _0x12150b(_0x3ee3a2);_0x505ecc['set']({'label':_0x5e6016['label'],'icon':_0x5e6016['icon'],'role':'menuitem','isEnabled':_0x5e6016['isEnabled']}),_0x505ecc['on']('execute',()=>{this['_executeQuickAction'](_0x5e6016);}),this['_actionButtons']['push']({'buttonView':_0x505ecc,'action':_0x5e6016}),_0x505ecc['delegate']('execute')['to'](_0x1d725b),_0x34ef74['children']['add'](_0x505ecc),_0x194ac9['items']['add'](_0x34ef74);}),_0x1d725b['isEnabled']=_0x242231['actions']['some'](_0xdb873e=>_0xdb873e['isEnabled']),this['_menuBarGroupViews']['push']({'view':_0x1d725b,'group':_0x242231}),_0x1d725b['panelView']['children']['add'](_0x194ac9),_0x1a5c2c['children']['add'](_0x1d725b),_0x35cf85['items']['add'](_0x1a5c2c);}else{const _0xf99b46=_0x538ee2,_0x1c8383=new _0x1a22a2(_0x3ee3a2,_0xd94cdb),_0x415c73=new _0x12150b(_0x3ee3a2);_0x415c73['set']({'label':_0xf99b46['label'],'icon':_0xf99b46['icon'],'role':'menuitem','isEnabled':_0xf99b46['isEnabled']}),this['_actionButtons']['push']({'buttonView':_0x415c73,'action':_0xf99b46}),_0x415c73['on']('execute',()=>{this['_executeQuickAction'](_0xf99b46);}),_0x415c73['delegate']('execute')['to'](_0xd94cdb),_0x1c8383['children']['add'](_0x415c73),_0x35cf85['items']['add'](_0x1c8383);}}),Object['values'](oc)['some'](_0xc460a0=>this['editor']['plugins']['has'](_0xc460a0))?_0xd94cdb['bind']('isEnabled')['to'](_0x2c6dcb):_0xd94cdb['set']({'isEnabled':!0x1}),_0xd94cdb['panelView']['children']['add'](_0x35cf85),_0xd94cdb;});}_executeQuickAction(_0x382e83){const _0x32c0df=this['editor'];_0x32c0df['editing']['view']['focus'](),_0x32c0df['commands']['execute']('aiQuickAction',_0x382e83);const _0x361f3f=_0x32c0df['ui']['view']['menuBarView'];_0x361f3f&&_0x361f3f['close']&&_0x361f3f['close']();}};function hc(_0x518892){return'actions'in _0x518892;}function cc(_0x338686,_0x5ba6b0){const _0x20791d=_0x338686['plugins']['get']('AITabs')['view'];return _0x20791d['isVisible']=!0x0,_0x20791d['activateTabAwaitingConfirmation'](_0x5ba6b0);}var lc=class extends _0x1aa85e{execute(_0x513bba){switch(_0x513bba['type']){case'chat':if(!this['editor']['plugins']['has']('AIChat')){const _0x139274=qs(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new dt('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x139274});}this['_handleAIChatAction'](_0x513bba);break;case'action':if(this['_expandSelectionIfCollapsed'](),!this['editor']['plugins']['has']('AIActions')){const _0x35d9d5=qs(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new dt('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x35d9d5});}this['_handleAIActionsAction'](_0x513bba);}}async _handleAIChatAction(_0x327e70){const _0x374d04=this['editor']['plugins']['get']('AIChatController');if(await cc(this['editor'],'chat')){if(this['_expandSelectionIfCollapsed'](),'ask-ai'===_0x327e70['id'])_0x374d04['removeSelectionFromChatContext'](),_0x374d04['addSelectionToChatContext'](this['editor']),_0x374d04['focusPromptInput']();else await _0x374d04['startConversation']({'modelId':_0x327e70['model'],'contexts':this['_resolveActionContexts'](_0x327e70)}),_0x374d04['removeSelectionFromChatContext'](),_0x374d04['addSelectionToChatContext'](this['editor']),_0x374d04['focusPromptInput'](),await _0x374d04['sendMessage']({'message':_0x327e70['prompt']||_0x327e70['displayedPrompt']||_0x327e70['label'],'attributes':{'quickActionData':{'id':_0x327e70['id']},'displayedPrompt':_0x327e70['displayedPrompt']}});}}_expandSelectionIfCollapsed(){const _0x1ada2f=this['editor'],_0x296c6b=_0x1ada2f['model']['document']['selection'];if(!_0x296c6b['isCollapsed'])return;const _0x5bd8e5=Ot(_0x296c6b['getSelectedBlocks']())||_0x1ada2f['model']['schema']['getLimitElement'](_0x296c6b);_0x1ada2f['model']['change'](_0x87a0e8=>{_0x87a0e8['setSelection'](_0x5bd8e5,'in');});}_handleAIActionsActionLabel(_0x337a42){return _0x337a42['parent']?.['label']&&'other'!==_0x337a42['parent']?.['id']?_0x337a42['parent']['label']+':\x20'+_0x337a42['label']:_0x337a42['label'];}async _handleAIActionsAction(_0x240570){const _0x520857=this['editor']['plugins']['get']('AIActions'),_0x4b0052=this['_resolveActionContexts'](_0x240570);let _0x321bb0;_0x321bb0=_0x240570['prompt']?{'userMessage':_0x240570['prompt'],'model':_0x240570['model'],'contexts':_0x4b0052}:_0x240570['context']?{'model':_0x240570['model'],'contexts':_0x4b0052}:{'actionName':_0x240570['actionName']||_0x240570['id'],'args':_0x240570['args'],'contexts':_0x4b0052};const _0x34a484=this['_handleAIActionsActionLabel'](_0x240570);await _0x520857['executeAction'](_0x321bb0,_0x34a484,_0x240570['icon']);}_resolveActionContexts(_0x56909e){const _0x3f356f=_0x56909e['parent']?.['id']?[_0x56909e['id'],_0x56909e['parent']['id']]:[_0x56909e['id']];return this['editor']['plugins']['get'](Js)['contextLibrary']['resolveContext']({'feature':'quickActions','ids':_0x3f356f,'extraContexts':_0x56909e['context']?[_0x56909e['context']]:[],'context':new nr()})['refs'];}},uc=class extends _0x52da8c{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x29e15b=this['editor'],_0x2ceaf6=new lc(this['editor']);if(_0x29e15b['commands']['add']('aiQuickAction',_0x2ceaf6),_0x29e15b['plugins']['has']('AIChat')){const _0xb8553d=this['editor']['plugins']['get']('AIChatController');_0x29e15b['model']['document']['selection']['on']('change:range',(_0x2b649b,_0x6563f0)=>{_0x6563f0['directChange']&&_0xb8553d['removeSelectionFromChatContext']();});}}},dc=class extends Nr{appendContent(_0x2bc83a,_0x4c0776='text'){'modification'===this['type']&&'text'===_0x4c0776&&(_0x4c0776=this['documentContextContent']['keys']()['next']()['value']),super['appendContent'](_0x2bc83a,_0x4c0776);}updateChangeGroups(_0x319285){const _0x565dfb=this['parsedContent']['get'](_0x319285)['cloneNode'](!0x0);if(this['parsedMergedContent']['set'](_0x319285,_0x565dfb),this['changeGroups']=[],0x0==_0x565dfb['childNodes']['length'])return;qn(this['documentContextContent']['get'](_0x319285),this['parsedMergedContent']['get'](_0x319285));const _0x59634e=this['documentContextContent']['get'](_0x319285)['children']['map'](_0x433f2c=>({'node':_0x433f2c,'id':ln(_0x433f2c,'data-id')})),_0x180e30=_0x565dfb['children']['map'](_0x4b1d31=>({'node':_0x4b1d31,'id':ln(_0x4b1d31,'data-id')||Xt()})),_0x17584d=_0x218245(_0x59634e,_0x180e30,{'comparator':(_0x13ddba,_0x5ec2de)=>_0x13ddba['id']==_0x5ec2de['id'],'oneChangePerToken':!0x0});if(!this['isDone']||!this['isComplete']){for(;_0x17584d['length']&&_0x17584d[_0x17584d['length']-0x1]['removed'];)_0x17584d['pop']();}const _0x11bc9f=_0x17584d['map'](_0x199fc8=>{const _0x1621fd=_0x199fc8['added']?'new':_0x199fc8['removed']?'removed':'modified';return{'node':_0x199fc8['value'][0x0]['node'],'type':_0x1621fd,'id':_0x199fc8['value'][0x0]['id']};}),_0x15bcad=this['_documentIdToSource']['get'](_0x319285);this['changeGroups']['push']({'changes':_0x11bc9f,'state':'pending','index':this['changeGroups']['length'],'editor':_0x15bcad['editor'],'rootName':_0x15bcad['rootName'],'documentId':_0x319285});}_getDifferentChangeGroups(_0x217a28,_0x552bec){return _0x552bec;}},_c=class extends Lr{content;['version'];editor;rootName;actionName;['args'];['userMessage'];['model'];context;['hasError']=!0x1;stoppedExplicitly=!0x1;constructor(_0x455f7d){super(_0x455f7d),this['content']=_0x455f7d['content'],this['version']=_0x455f7d['version'],this['editor']=_0x455f7d['editor'],this['rootName']=_0x455f7d['rootName'],this['actionName']=_0x455f7d['actionName'],this['args']=_0x455f7d['args'],this['userMessage']=_0x455f7d['userMessage'],this['model']=_0x455f7d['model'],this['context']=new nr(_0x455f7d['contexts']),this['on']('interactionStopped',()=>{this['stoppedExplicitly']=!0x0;});}sendRequest(){const _0x445c93=this['context']['toRequestContexts']();return this['actionName']?this['connector']['executeAction']({'content':this['content'],'actionName':this['actionName'],'args':this['args'],'contexts':_0x445c93}):this['connector']['executeCustomAction']({'content':this['content'],'message':this['userMessage'],'model':this['model'],'outputFormat':'html','contexts':_0x445c93});}getDocumentContext(){return{'type':'document','documents':[{'id':this['id'],'content':this['content'],'version':this['version'],'rootName':this['rootName'],'sessionId':Xt(),'channelId':this['editor']['config']['get']('collaboration.channelId'),'selectionSignature':''}],'label':'Current\x20document','uiId':'current-document'};}createReply(_0x4e89f9){const _0x5de2cc=this['editor']['config']['get']('collaboration.channelId'),_0x3baaa9=new dc({..._0x4e89f9,'locale':this['locale'],'documentContextContent':[{'id':this['id'],'content':this['content'],'channelId':_0x5de2cc,'rootName':this['rootName']}],'channelsToEditors':new Map([[_0x5de2cc,this['editor']]])});return this['replies']['push'](_0x3baaa9),_0x3baaa9['delegate'](...xr)['to'](this),this['fire']('replyCreated',_0x3baaa9),_0x3baaa9;}},gc=class extends Hh{['focusCycler'];_skeletonView;['_focusTracker'];_keystrokes;['_focusables'];_navigationPreviousButton;_navigationNextButton;_navigationTryAgainButton;_navigationCounter;constructor(_0x140415,_0x341403){super(_0x140415,{'showChangesButtonMode':'icon',..._0x341403}),this['set']('isBusy',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_focusTracker']=new Et(),this['_keystrokes']=new pt(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x2dd4b2({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_setupToolbar'](),this['_createSkeletonView'](),this['_setupMiniToolbar'](),this['_focusables']['clear'](),this['_focusables']['addMany']([this['_miniToolbarView'],this['_toolbarView']]),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-main'],'style':{'width':this['bindTemplate']['to']('width')}}});}['render'](){super['render']();for(const _0x35a8e7 of this['_focusables'])this['_focusTracker']['add'](_0x35a8e7['element']);this['_keystrokes']['listenTo'](this['element']);}['focus'](_0x3d44f8){-0x1===_0x3d44f8?this['focusCycler']['focusLast']():this['_toolbarView']['primaryActionButton']['focus']();}setErrorState(){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}clearErrorState(){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x2dd9de){super['showBlockingError'](_0x2dd9de),this['setErrorState']();}addMiniToolbarItem(_0x5ce9fa){this['_miniToolbarView']['items']['has'](_0x5ce9fa)||this['_miniToolbarView']['items']['add'](_0x5ce9fa);}removeMiniToolbarItem(_0x2a51c8){this['_miniToolbarView']['items']['has'](_0x2a51c8)&&this['_miniToolbarView']['items']['remove'](_0x2a51c8);}setIsLoading(_0x1c8cc4){this['_isLoading']=_0x1c8cc4;}finalizeContent(){this['_streamableContentView']['cleanUpStreamingArtifacts']();}_setupToolbar(){this['_toolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',this,'_hasError',(_0x27f6a8,_0x5f3342,_0xd1c728)=>!(_0x27f6a8||_0x5f3342||_0xd1c728));}_setupMiniToolbar(){this['_miniToolbarView']['delegate'](...$r)['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',(_0x2c8bca,_0xb1ec91)=>!(_0x2c8bca||_0xb1ec91));}_createSkeletonView(){this['_skeletonView']=new lo(this['locale'],uo['aiActionsBalloon']),this['_skeletonView']['bind']('isVisible')['to'](this,'_isLoading',this,'_isErrorVisible',(_0x58c95a,_0x5ef1d8)=>_0x58c95a&&!_0x5ef1d8),this['_contentChildren']['add'](this['_skeletonView']);}_setupMiniToolbarButtons(){const _0x1ab58e=new _0x1b12df(this['locale']),_0x3cac81=new _0x1b12df(this['locale']),_0x5d75a0=new Ic(this['locale']),_0x4e1c11=new _0x1b12df(this['locale']);_0x1ab58e['set']({'icon':_0x21cbbb,'label':qs(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':Ar}),_0x3cac81['set']({'icon':_0x2bd669,'tooltip':qs(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+Ar}),_0x4e1c11['set']({'icon':_0x1a780a,'tooltip':qs(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+Ar}),_0x1ab58e['bind']('isEnabled')['to'](this,'isBusy',_0x2f572f=>!_0x2f572f),_0x1ab58e['on']('execute',()=>{this['fire']('tryAgain');}),_0x3cac81['bind']('isEnabled')['to'](this,'isBusy',_0x17ee45=>!_0x17ee45),_0x3cac81['on']('execute',()=>{this['fire']('showPrevious');}),_0x4e1c11['bind']('isEnabled')['to'](this,'isBusy',_0x548abb=>!_0x548abb),_0x4e1c11['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x3cac81,this['_navigationCounter']=_0x5d75a0,this['_navigationNextButton']=_0x4e1c11,this['_navigationTryAgainButton']=_0x1ab58e;}updateMiniToolbarButtons(_0x50a85a,_0x5dce05){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x805b18=_0x50a85a>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x805b18){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x221972=_0x50a85a-_0x5dce05;this['_navigationCounter']['setInteractionCount'](_0x221972,_0x50a85a),this['_navigationPreviousButton']['isEnabled']=_0x5dce05<_0x50a85a-0x1,this['_navigationNextButton']['isEnabled']=_0x5dce05>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;}setShowChangesButton(_0x2d497f){this['_miniToolbarView']['isShowChangesOn']=_0x2d497f;}adjustWidthToEditable(_0x3299bc){const _0x5924f4=Wh({'domRoot':_0x3299bc,'innerElement':this['_streamableContentView']['element'],'outerElement':this['element'],'widthCustomProperty':'--ck-ai-actions-balloon-width'});_0x5924f4&&(this['width']=_0x5924f4);}},Ic=class extends _0x43ad99{constructor(_0x1570d3){super(_0x1570d3);const _0x235f04=this['bindTemplate'];this['set']('currentInteraction',0x1),this['set']('totalInteractions',0x1),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x235f04['to']('currentInteraction')},{'text':_0x235f04['to']('totalInteractions',_0xb99592=>'\x20/\x20'+_0xb99592)}]});}setInteractionCount(_0x5cac78,_0x49b448){this['set']({'currentInteraction':_0x5cac78,'totalInteractions':_0x49b448});}},Ac=class extends _0x52da8c{static get requires(){return[$s,dr,_0x2c281f,Pn,Gh,Un];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}_aiConnector;_interactions=[];_currentInteractionIndex=0x0;_interactionParams;['_balloonShowDiff']=!0x0;['_promiseQueue'];get _interaction(){return this['_interactions'][this['_interactions']['length']-0x1];}_actionsBalloonView;_reporter;constructor(_0x1e56c2){super(_0x1e56c2),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['_reporter']=this['editor']['plugins']['get'](dr)['createReporter']('aiactions'),this['set']('isBusy',!0x1),this['_promiseQueue']=new Ao();}stopInteraction(){this['_stopInteraction']();}async executeAction(_0x2ec50b,_0x2e4d28,_0x3e7eca){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')&&this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x59ed65,anchorData:_0x424939,root:_0x3e12b2}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x2ec50b,_0x59ed65,_0x424939,_0x3e12b2,_0x2e4d28,_0x3e7eca);}const {modelFragment:_0x25af06,anchorData:_0x3294bc,root:_0x17854a}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x2ec50b,_0x25af06,_0x3294bc,_0x17854a,_0x2e4d28,_0x3e7eca);}async destroy(){return this['_stopInteraction'](),super['destroy']();}_createActionsBalloonView(){const _0x15e666=this['editor']['plugins']['has']('TrackChanges');let _0x4a29ae=this['editor']['config']['get']('ai.availableReplyActions')||[...po];_0x15e666||(_0x4a29ae=_0x4a29ae['filter'](_0x4dc879=>'insertSuggestion'!=_0x4dc879));const _0x3973f8=this['editor']['commands']['get']('trackChanges'),_0x30b7ac=new gc(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x15e666,'availableActions':_0x4a29ae});return _0x30b7ac['bind']('isBusy')['to'](this),_0x30b7ac['setShowChangesButton'](this['_balloonShowDiff']),_0x30b7ac['bind']('isTargetReadOnly')['to'](this['editor'],'isReadOnly'),_0x3973f8&&_0x30b7ac['bind']('isTrackChangesOn')['to'](_0x3973f8,'value'),_0x30b7ac['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x30b7ac['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x30b7ac['on']('showNext',()=>{this['_navigateToNext']();}),_0x30b7ac;}_normalizeSelectionStart(){const _0x463416=this['editor']['model'],_0x548628=_0x463416['document']['selection'],_0x24f6a1=_0x548628['getFirstRange']();if(!_0x24f6a1||_0x24f6a1['isCollapsed'])return;const _0x1ae0a7=Ot(_0x548628['getSelectedBlocks']());if(!_0x1ae0a7)return;const _0x5bd575=_0x463416['createPositionAt'](_0x1ae0a7,0x0);_0x5bd575['isAfter'](_0x24f6a1['start'])&&_0x463416['change'](_0x332a1d=>{_0x332a1d['setSelection'](_0x332a1d['createRange'](_0x5bd575,_0x24f6a1['end']));});}_getExecuteDataRegular(){const _0x5ce69e=this['editor']['model']['document']['selection'],_0x1321e4=_0x5ce69e['getFirstRange']()['start']['root'];if(_0x5ce69e['isCollapsed']){const _0x4608ee=Ot(_0x5ce69e['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x5ce69e);this['editor']['model']['change'](_0x59195b=>{_0x59195b['setSelection'](_0x4608ee,'in');});}this['_normalizeSelectionStart']();const _0x55714a=_0x5ce69e['getFirstRange'](),_0x2408df=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x5ce69e),_0x55714a['start'],_0x55714a['end']);this['_copyMarkersToFragment'](_0x2408df,_0x5ce69e,{'isTableSelection':!0x1});const _0x55d727=_0x5ce69e['getFirstRange']()['start'],_0x5a71c1=new Map();let _0x569bc6=_0x2408df;for(let _0x31b0a6=0x0;_0x31b0a6<_0x55d727['path']['length'];_0x31b0a6++)_0x5a71c1['set'](_0x569bc6,_0x55d727['path'][_0x31b0a6]),_0x569bc6=_0x569bc6['getChild'](0x0);return{'modelFragment':_0x2408df,'anchorData':_0x5a71c1,'root':_0x1321e4};}_getExecuteDataInTable(){const _0x1f0d9d=this['editor']['model']['document']['selection'],_0x17a771=this['editor']['plugins']['get']('TableSelection'),_0xb60926=_0x1f0d9d['getFirstRange']()['start']['root'],_0x456879=_0x17a771['getSelectionAsFragment'](),_0x14fda1=_0x1f0d9d['getFirstRange']()['start']['parent']['parent'],_0x21e4f9=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x14fda1),this['editor']['model']['createPositionAfter'](_0x14fda1)),_0x2c7ba0=this['_wrapWithCommonAncestors'](_0x456879,_0x21e4f9['start'],_0x21e4f9['end']);this['_copyMarkersToFragment'](_0x2c7ba0,_0x1f0d9d,{'isTableSelection':!0x0});const _0x470eaa=_0x1f0d9d['getFirstRange']()['start'],_0xecaa21=new Map();let _0x4a903c=_0x2c7ba0;for(let _0x2d67d5=0x0;_0x2d67d5<_0x470eaa['path']['length'];_0x2d67d5++)if(_0xecaa21['set'](_0x4a903c,_0x470eaa['path'][_0x2d67d5]),_0x2d67d5<_0x470eaa['path']['length']-0x1)_0x4a903c=_0x4a903c['getChild'](0x0);else{let _0x2de868=_0x4a903c['nextSibling'];for(;_0x2de868;)_0xecaa21['set'](_0x2de868,_0x470eaa['path'][_0x2d67d5]),_0x2de868=_0x2de868['nextSibling'];}return{'modelFragment':_0x2c7ba0,'anchorData':_0xecaa21,'root':_0xb60926};}async _executeAction(_0x4981d7,_0x2c4ec8,_0x1bf87a,_0xba985b,_0x26a309,_0x42c488){const _0x12828e=this['editor']['plugins']['get'](Pn),_0x1ffc2f=this['editor']['plugins']['get'](Gh),_0x4eb8c3=this['editor']['model']['document']['selection'],_0xf962ed=await _0x12828e['modelToDataWithIds'](_0x2c4ec8,this['editor'],_0xba985b['rootName']),_0x20f756=this['editor']['model']['document']['version'],_0x56031d=[..._0x4eb8c3['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),_0x1ffc2f['open']({'targetEditor':this['editor'],'index':0x3e8*Math['random']()%0x3e8,'title':_0x26a309,'icon':_0x42c488||_0x211114,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x56031d,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x1ffc2f),this['_interactionParams']={'action':_0x4981d7,'content':_0xf962ed,'version':_0x20f756,'aiBalloon':_0x1ffc2f,'modelFragment':_0x2c4ec8,'anchorData':_0x1bf87a,'root':_0xba985b},this['_setupApplyListeners'](),this['listenTo'](_0x1ffc2f,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x1ffc2f,'dialogClosed',(_0x528ca7,{id:_0x52dfd2})=>{if('aiActionsBalloon'===_0x52dfd2){for(const _0x3dc496 of this['_interactions']){if(0x0===_0x3dc496['replies']['length']||_0x3dc496['stoppedExplicitly'])continue;const _0x478c9d=_0x3dc496['replies'][_0x3dc496['replies']['length']-0x1],_0x236e35=_0x478c9d['changeGroups'][0x0];_0x236e35&&'pending'===_0x236e35['state']&&_0x478c9d['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x1ffc2f);}}),this['_createInteraction'](_0xf962ed,_0x20f756,_0x1ffc2f,_0x4981d7);}_setupApplyListeners(){if(!this['_interactionParams'])return;const {modelFragment:_0x5df99f,anchorData:_0x52dec1,root:_0x1a2408}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x5df99f,_0x52dec1,_0x1a2408,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x5df99f,_0x52dec1,_0x1a2408,!0x0);}),this['listenTo'](this['_actionsBalloonView'],'rejectSuggestion',()=>{this['editor']['plugins']['get']('AIBalloon')['close']();});}_wrapWithCommonAncestors(_0x3439a0,_0x329a04,_0x2a9196){const _0x3e8bd2=this['editor']['model']['createRange'](_0x329a04,_0x2a9196)['getCommonAncestor'](),_0x38bb36=_0x3e8bd2['is']('documentFragment')?[]:_0x3e8bd2['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x38bb36['length']){const _0x2e12f5=_0x38bb36['map'](_0xa9f35f=>_0xa9f35f['_clone'](!0x1));for(let _0x45ecdf=0x1;_0x45ecdf<_0x2e12f5['length'];_0x45ecdf++)_0x2e12f5[_0x45ecdf-0x1]['_appendChild'](_0x2e12f5[_0x45ecdf]);return _0x2e12f5[_0x2e12f5['length']-0x1]['_appendChild'](_0x3439a0),new _0x3a5946(_0x2e12f5[0x0]);}return _0x3439a0;}_copyMarkersToFragment(_0x55ad8c,_0xf126d7,_0x526947={'isTableSelection':!0x1}){const _0x4d0783=this['editor']['model'],_0x4ec450=Array['from'](_0xf126d7['getRanges']()),_0x2630fb=_0xf126d7['getFirstRange']()['start'];for(const _0x10e0b4 of _0x4d0783['markers']){if(_0x10e0b4['name']['startsWith']('ai-selection')||!_0x10e0b4['affectsData'])continue;const _0x2db356=_0x10e0b4['getRange']();if(!_0x4ec450['some'](_0x22fd8c=>_0x22fd8c['containsRange'](_0x2db356,!0x0)))continue;const _0xa4c533=this['_regularCalculateMarkerPath'](_0x2db356['start'],_0x2630fb,_0x526947['isTableSelection']),_0x165cb2=this['_regularCalculateMarkerPath'](_0x2db356['end'],_0x2630fb,_0x526947['isTableSelection']),_0x2a7e66=_0x4d0783['createPositionFromPath'](_0x55ad8c,_0xa4c533),_0x4f42a8=_0x4d0783['createPositionFromPath'](_0x55ad8c,_0x165cb2);if(!_0x2a7e66['isEqual'](_0x4f42a8)){const _0xdd7e31=_0x4d0783['createRange'](_0x2a7e66,_0x4f42a8);_0x55ad8c['markers']['set'](_0x10e0b4['name'],_0xdd7e31);}}}_regularCalculateMarkerPath(_0x415eaf,_0x37da1c,_0x2a9275=!0x1){const _0x19d233=[..._0x415eaf['path']['slice']()];for(let _0x5253c3=0x0;_0x5253c3<Math['max'](_0x37da1c['path']['length'],_0x415eaf['path']['length']);_0x5253c3++){const _0x253f45=_0x37da1c['path'][_0x5253c3]||0x0,_0x4409e3=(_0x415eaf['path'][_0x5253c3]||0x0)-_0x253f45;if(_0x19d233[_0x5253c3]=_0x4409e3,0x0!==_0x4409e3&&!_0x2a9275)break;}return _0x19d233;}async _createInteraction(_0x3042bb,_0x287be8,_0x39dce1,_0x592de6){const _0x3e3dfb=this['editor'],_0x26abe0=_0x3e3dfb['model']['document']['selection']['getFirstRange']()['start']['root'];this['_interactionParams']||(this['_interactionParams']={'action':_0x592de6,'content':_0x3042bb,'version':_0x287be8,'aiBalloon':_0x39dce1,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map(),'root':_0x26abe0});const _0xd92b92=new _c({'connector':this['_aiConnector'],'locale':_0x3e3dfb['locale'],'content':_0x3042bb,'version':_0x287be8,'editor':_0x3e3dfb,'rootName':_0x26abe0['rootName'],..._0x592de6});this['_interactions']['push'](_0xd92b92);const _0x178656=(_0x94c7de,_0x502b82=this['_balloonShowDiff'])=>this['_promiseQueue']['enqueue'](async _0x464763=>{try{if(this['_isUnsupportedInlineRootChange'](_0x94c7de,_0x26abe0))return this['_actionsBalloonView']['showBlockingError'](qs(_0x3e3dfb['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')),void this['_actionsBalloonView']['finalizeContent']();const _0x3371df=wr({'changeGroups':_0x94c7de['changeGroups'],'documentContextContent':_0x94c7de['documentContextContent'],'showDiff':_0x502b82,'trimUnchanged':!0x1});_0x3371df['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x3371df[0x0],'renderingStrategy':'static','abortSignal':_0x464763,'keepErrors':!_0x94c7de['isComplete']}),this['_actionsBalloonView']['finalizeContent']();}catch(_0x5c8d94){if(lr(_0x5c8d94))return;throw _0x5c8d94;}});_0xd92b92['on']('replyContentUpdated',(_0x5d571a,_0x35827c)=>{_0x35827c['isDone']&&_0x178656(_0x35827c)['catch'](_0x366938=>{this['_reporter']['logError'](_0x366938,{'context':{'operation':'reply-update'}}),this['_setErrorState'](_0xd92b92,_0x366938);});}),_0xd92b92['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x4108d1){this['_reporter']['logError'](_0x4108d1,{'context':{'operation':'interaction-finish'}}),this['_setErrorState'](_0xd92b92,_0x4108d1);}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x43657f,{showDiff:_0x386ccd})=>{try{this['_balloonShowDiff']=_0x386ccd;const _0x3113ea=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x3113ea&&await _0x178656(_0x3113ea,_0x386ccd);}catch(_0x14beb1){this['_reporter']['logError'](_0x14beb1,{'context':{'operation':'toggle-suggestion-display'}}),this['_setErrorState'](_0xd92b92,_0x14beb1);}}),_0xd92b92['on']('replyChangeGroupStateUpdated',()=>{const _0xd0ef87={'positiveCount':_0xd92b92['replies']['reduce']((_0x5d7576,_0x24f6b5)=>_0x5d7576+_0x24f6b5['changeGroups']['filter'](_0x2f6b33=>'accepted'===_0x2f6b33['state'])['length'],0x0),'totalCount':_0xd92b92['replies']['reduce']((_0xd059eb,_0x231670)=>_0xd059eb+_0x231670['changeGroups']['length'],0x0)},_0x450841=_0xd92b92['actionCallId'],_0x283d78=_0xd92b92['actionName'];_0x283d78?this['_aiConnector']['upsertAIActionRating'](_0x283d78,_0x450841,_0xd0ef87):this['_aiConnector']['upsertCustomAIActionRating'](_0x450841,_0xd0ef87);}),this['_setLoadingState']();try{const _0x5d6714=await _0xd92b92['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x5d6714;}catch(_0x9bad15){lr(_0x9bad15)||this['_actionsBalloonView']['setIsLoading'](!0x1),this['_reporter']['logError'](_0x9bad15,{'context':{'operation':'create-interaction'}}),this['_setErrorState'](_0xd92b92,_0x9bad15);}}_isUnsupportedInlineRootChange(_0x15da0e,_0x147fa1){const _0x59c367=this['editor'];if(!En(_0x59c367,_0x147fa1['rootName']))return!0x1;return!wn(_0x59c367,new _0x52d767((_0x15da0e['changeGroups'][0x0]?.['changes']??[])['filter'](_0x1f51b5=>'removed'!==_0x1f51b5['type'])['map'](_0xbfe0db=>_0xbfe0db['node']['cloneNode'](!0x0))));}['_applyChanges'](_0x15ba38,_0x30bb6f,_0x29726e,_0x4da6dc){const _0x2bed29=this['editor'];if(_0x4da6dc&&!_0x2bed29['plugins']['has']('TrackChanges'))throw new dt('ai-no-track-changes',null);const _0x5402a9=this['editor']['plugins']['get'](Un),_0x3e7fe1=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x3e7fe1||!_0x3e7fe1['replies']['length'])return;const _0x188c1a=_0x3e7fe1['replies'][_0x3e7fe1['replies']['length']-0x1];if(this['_isUnsupportedInlineRootChange'](_0x188c1a,_0x29726e))return void this['_actionsBalloonView']['showBlockingError'](qs(_0x2bed29['locale'],'AI_SUGGESTION_NO_PARTS_WARNING'));_0x188c1a['setChangeGroupState'](0x0,'accepted');const _0x3b92c7=Gr({'documentSuggestions':Wr({'groups':[_0x188c1a['changeGroups'][0x0]],'documentContextContent':_0x188c1a['documentContextContent'],'documents':_0x3e7fe1['getDocumentContext']()['documents']}),'transform':!0x1,'documentChanges':_0x5402a9,'documentChangesOptions':{'anchor':_0x2bed29['model']['createPositionAt'](_0x15ba38,0x0),'markDeletions':_0x4da6dc}})['values']()['next']()['value']??[],_0x59c473=this['_filterOperationsOutsideRange'](_0x3b92c7,_0x30bb6f);for(const _0xf4793f of _0x59c473)this['_anchorOperation'](_0x30bb6f,_0xf4793f,_0x29726e);const _0x5b73be=_0x3e7fe1['getDocumentContext']()['documents'][0x0]['version'],_0x5e7c7a=_0x2bed29['model']['document']['history']['getOperations'](_0x5b73be),_0x9886b5={'document':_0x2bed29['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x2a2460=_0x3d40c6(_0x59c473,_0x5e7c7a,_0x9886b5)['operationsA'];jn(_0x2a2460,'quickActions');try{_0x2bed29['model']['change'](_0x48f05e=>{_0x48f05e['setSelection'](_0x2bed29['model']['document']['selection']['focus']),_0x4da6dc?_0x2bed29['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x2a2460):_0x5402a9['applyOperations'](_0x48f05e,_0x2a2460);});}catch(_0x109e05){throw this['_reporter']['logError'](new ur({'code':'ai-applying-suggestion-failed','type':'runtime','cause':_0x109e05})),_0x109e05;}this['editor']['plugins']['get']('AIBalloon')['close']();}_filterOperationsOutsideRange(_0x2b9d18,_0x415751){return _0x2b9d18['filter'](_0x2656cd=>{if('rename'==_0x2656cd['type']){const _0x8f3756=_0x2656cd['position']['nodeAfter'];return!_0x415751['has'](_0x8f3756);}if(_0x2656cd['type']['indexOf']('Attribute')>-0x1){const _0x49e816=_0x2656cd['range']['start']['nodeAfter'];return!_0x415751['has'](_0x49e816);}return!0x0;});}_anchorOperation(_0x2c5094,_0x3c49a8,_0x31b26f){const _0x54c7a7=_0x3c49a8['clone']();for(const _0x2c3314 in _0x3c49a8){const _0x59ee48=_0x3c49a8[_0x2c3314];_0x59ee48 instanceof _0x3e534d?_0x3c49a8[_0x2c3314]=new _0x3e534d(_0x1e2104(_0x59ee48['start']),_0x1e2104(_0x59ee48['end'])):_0x59ee48 instanceof _0x22fec2&&(_0x3c49a8[_0x2c3314]=_0x1e2104(_0x59ee48));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x54c7a7['type'])){if(_0x54c7a7['isDocumentOperation']=!0x1,_0x54c7a7['baseVersion']=null,'remove'==_0x54c7a7['type']){const _0x337973=_0x54c7a7['sourcePosition'],_0x4be368=_0x54c7a7['howMany'];new _0x3961c2(_0x337973,_0x4be368)['_execute']();}else _0x54c7a7['_execute']();}function _0x1e2104(_0x2b3c83){if('$graveyard'==_0x2b3c83['root']['rootName'])return _0x2b3c83;const _0x39342b=[];let _0x44da68=_0x2b3c83['root'];for(let _0x33f2e8=0x0;_0x33f2e8<_0x2b3c83['path']['length'];_0x33f2e8++){const _0x2002c4=_0x2c5094['get'](_0x44da68)||0x0;_0x39342b[_0x33f2e8]=_0x2b3c83['path'][_0x33f2e8]+_0x2002c4,_0x44da68=_0x44da68['getChildAtOffset'](_0x2b3c83['path'][_0x33f2e8]);}return new _0x22fec2(_0x31b26f,_0x39342b,_0x2b3c83['stickiness']);}}_refreshInteraction(){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0;const {action:_0x11af7c,content:_0x376e96,version:_0x404bd4,aiBalloon:_0x27bc88}=this['_interactionParams'];this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),this['_actionsBalloonView']['setIsLoading'](!0x0),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),this['stopListening'](this['_actionsBalloonView']),this['_setupApplyListeners'](),this['_createInteraction'](_0x376e96,_0x404bd4,_0x27bc88,_0x11af7c)['catch'](_0x272b9b=>{this['_reporter']['logError'](_0x272b9b,{'context':{'operation':'refresh-interaction'}});});}_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['_actionsBalloonView']&&!this['_actionsBalloonView']['_isErrorVisible']&&this['_actionsBalloonView']['setIsLoading'](!0x1);}_navigateToPrevious(){const _0x55ccb1=this['_interactions']['length'];this['_currentInteractionIndex']<_0x55ccb1-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}_navigateToNext(){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async _displayInteractionAtIndex(_0x2a29a8){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x2a29a8;const _0x377948=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x377948)return;if(_0x377948['hasError'])return this['_setErrorState'](_0x377948),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x377948['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x3281e5=_0x377948['replies'][_0x377948['replies']['length']-0x1];if(_0x3281e5)try{const _0x2eb79f=wr({'changeGroups':_0x3281e5['changeGroups'],'documentContextContent':_0x3281e5['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x4f9c1e=>setTimeout(_0x4f9c1e,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x2eb79f[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x5b490c){this['_reporter']['logError'](_0x5b490c,{'context':{'operation':'navigation-update'}});}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}_setLoadingState(){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async _setErrorState(_0x306490,_0x20a30b){if(void 0x0!==_0x20a30b&&lr(_0x20a30b))return;const _0x3025c0=qs(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x3025c0),_0x306490['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],this['_actionsBalloonView']['setErrorState'](),this['_actionsBalloonView']['setIsLoading'](!0x0);}_clearErrorState(){this['_actionsBalloonView']['hideError'](),this['_actionsBalloonView']['setIsLoading'](!0x1);}async _clearLoadingState(){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,this['_actionsBalloonView']['setIsLoading'](!0x1);}},Ec=class extends _0x52da8c{static get requires(){return[ac,uc,Ac];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5852a4){super(_0x5852a4),_0x5852a4['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}},pc=class extends _0x43ad99{['dropdownView'];constructor(_0x11c7d6,_0x432c19){super(_0x11c7d6),this['set']('hasPendingChanges',!0x0),this['dropdownView']=this['_createDropdown'](_0x11c7d6,_0x432c19),this['setTemplate']({'tag':'div','children':[this['dropdownView']],'attributes':{'class':[this['bindTemplate']['if']('isVisible','ck-hidden',_0x493bdc=>!_0x493bdc)]}});}_createDropdown(_0xddf18,_0x48b243){const _0xeadf17=_0x348de2(_0xddf18);_0xeadf17['set']({'class':'ck-ai_review__complete-review-dropdown'}),_0xeadf17['panelPositionLimiter']=()=>{const _0x5ec277=_0xeadf17['buttonView']['element'];return _0x5ec277&&St(_0x5ec277);},_0xeadf17['on']('execute',_0x270144=>{_0x270144['source']['onClick']();}),_0xeadf17['buttonView']['set']({'label':qs(_0xddf18,'AI_REVIEW_MODE_COMPLETE_REVIEW'),'class':_0x48b243,'withText':!0x0});const _0x4e641d=new _0x5f2643({'withText':!0x0,'role':'menuitem','onClick':()=>this['fire']('acceptAllChanges')});_0x4e641d['bind']('label')['to'](this,'isAnyResultReviewed',_0xd41866=>qs(_0xddf18,_0xd41866?'AI_REVIEW_MODE_ACCEPT_REMAINING':'AI_REVIEW_MODE_ACCEPT_ALL')),_0x4e641d['bind']('isEnabled')['to'](this,'hasPendingChanges');const _0x34f93d=new _0x5f2643({'withText':!0x0,'role':'menuitem','onClick':()=>this['fire']('rejectAllChanges')});_0x34f93d['bind']('label')['to'](this,'isAnyResultReviewed',_0x4322e9=>qs(_0xddf18,_0x4322e9?'AI_REVIEW_MODE_REJECT_REMAINING':'AI_REVIEW_MODE_REJECT_ALL')),_0x34f93d['bind']('isEnabled')['to'](this,'hasPendingChanges');const _0x508db4=new _0x5f2643({'withText':!0x0,'label':qs(_0xddf18,'AI_REVIEW_MODE_EXIT_REVIEW'),'role':'menuitem','onClick':()=>this['fire']('leaveReviewCoreResultList')}),_0x45a375=new _t([{'type':'button','model':_0x4e641d},{'type':'button','model':_0x34f93d},{'type':'separator'},{'type':'button','model':_0x508db4}]);return _0xb17444(_0xeadf17,_0x45a375,{'role':'menu'}),_0xeadf17;}};const mc={'title':'AI_REVIEW_MODE_CONTENT_PART_TITLE','apply':'AI_REVIEW_MODE_ACCEPT_CHANGE','suggest':'AI_REVIEW_MODE_SUGGEST_CHANGE','reject':'AI_REVIEW_MODE_DISMISS_CHANGE','stateAccepted':'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED','stateRejected':'AI_REVIEW_MODE_CHECK_STATUS_REJECTED','stateOutdated':'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'};var Tc=class AIReviewCoreNavigationPanelView extends Jt{_previousButtonView;_nextButtonView;_toggleDiffButtonView;_completeReviewDropdownView;_acceptButtonView;_suggestButtonView;_dismissButtonView;_stateView;['_changeId']='';_pinOptions=void 0x0;_getTarget;['_reflowObservers']=[];constructor(_0x28b3f4,_0x48d37e){super(_0x28b3f4),this['set']({'isVisible':!0x1,'position':'arrow_se','class':null,'top':0x0,'left':0x0}),this['set']('changeIndex',0x0),this['set']('changesCount',0x0),this['set']('hasChangesToNavigate',!0x1),this['set']('isDiffOn',!0x1),this['set']('isAnyResultReviewed',!0x1),this['set']('hasPendingChanges',!0x1),this['set']('isError',!0x1),this['set']('isResultReady',!0x1),this['set']('changeStatus','pending'),this['bind']('counterLabel')['to'](this,'changeIndex',this,'changesCount',(_0xec962f,_0x342eb2)=>qs(this['locale'],'AI_REVIEW_MODE_NAVIGATION_COUNTER',[_0xec962f,_0x342eb2])),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai_review-navigation-panel-balloon'],'tabindex':'-1'}}),this['content']['add'](this['_createContentView']()),_0x48d37e['add'](this);}get['changeId'](){return this['_changeId'];}updateContent(_0x72cfdc){this['_acceptButtonView']['isVisible']=_0x72cfdc['isAcceptButtonVisible'],this['_suggestButtonView']['isVisible']=_0x72cfdc['isSuggestButtonVisible'],this['_changeId']=_0x72cfdc['change']['id'],this['changeStatus']=_0x72cfdc['change']['status'],this['updateChangePosition'](_0x72cfdc['position']);}updateChangePosition(_0xd9d521){this['changeIndex']=_0xd9d521['index'],this['changesCount']=_0xd9d521['total'],this['hasChangesToNavigate']=_0xd9d521['pendingCount']>('pending'===this['changeStatus']?0x1:0x0);}updateChangeState(_0x5cdae8,_0x4e373a){_0x5cdae8===this['_changeId']&&(this['changeStatus']=_0x4e373a);}['showPanel'](_0x28a6ae){const {getTarget:_0x19ff7c,domEvent:_0x5e2bad,limiter:_0x3c994b,viewportOffset:_0x26f569}=_0x28a6ae;this['updateContent'](_0x28a6ae);const _0x3751aa=_0x19ff7c();if(!_0x3751aa)return void this['hidePanel']();this['_prepareMoveAnimation'](),this['_getTarget']=_0x19ff7c,this['show']();const _0x29f7ca=Array['from'](_0x3751aa['getClientRects']())['reverse'](),_0x54e186=this['_getPointedRectIndexFromEvent'](_0x5e2bad,_0x29f7ca),_0x257289=_0x29f7ca[_0x54e186??0x0];this['_pinOptions']={'target':()=>(this['_stretchToDocument'](_0x3c994b),this['_getBestRectPosition'](_0x19ff7c(),_0x54e186,_0x3c994b,_0x26f569)||_0x257289),'positions':this['_createPanelPositions'](),..._0x3c994b?{'limiter':_0x3c994b}:{}},this['pin'](this['_pinOptions']),this['_observeDocumentResize'](_0x3c994b),this['_endMoveAnimation']();}_prepareMoveAnimation(){const _0x1116cb=new Tt(Vt['window']),_0x23e58c=this['isVisible']?new Tt(this['element']):null,_0x4adaf4=[];let _0x325f85=!!_0x23e58c;if(this['element']['style']['transition']='none',_0x23e58c&&!_0x23e58c['getIntersection'](_0x1116cb)){const _0x38a94f=this['_getTarget'](),_0x320b86=_0x38a94f?new Tt(_0x38a94f):null;_0x320b86&&_0x320b86['bottom']<=_0x1116cb['top']?(this['top']=Vt['window']['scrollY']-_0x23e58c['height'],_0x4adaf4['push']('top')):_0x320b86&&_0x320b86['top']>=_0x1116cb['bottom']&&(this['top']=Vt['window']['scrollY']+_0x1116cb['height'],_0x4adaf4['push']('top')),_0x320b86&&_0x320b86['right']<=_0x1116cb['left']?(this['left']=Vt['window']['scrollX']-_0x23e58c['width'],_0x4adaf4['push']('left')):_0x320b86&&_0x320b86['left']>=_0x1116cb['right']&&(this['left']=Vt['window']['scrollX']+_0x1116cb['width'],_0x4adaf4['push']('left')),_0x325f85=_0x4adaf4['length']>0x0;}this['element']['getBoundingClientRect'](),this['element']['style']['transition']=_0x325f85?'':'none',_0x4adaf4['length']&&(this['element']['style']['transitionProperty']=_0x4adaf4['join'](',\x20'));}_endMoveAnimation(){const _0x1a511c=this['element'],_0x2b290a=_0x1a511c['getAnimations']();_0x2b290a['length']?Promise['allSettled'](_0x2b290a['map'](_0x15c61a=>_0x15c61a['finished']))['then'](()=>this['_endMoveAnimation']()):_0x1a511c['style']['transition']='none';}_stretchToDocument(_0x4d015a){this['element']['style']['width']=_0x4d015a?new Tt(_0x4d015a)['width']+'px':'';}_createPanelPositions(){return[(_0x425abf,_0x95ef72,_0x459a7e,_0x10c88e)=>({'top':_0x425abf['bottom']+AIReviewCoreNavigationPanelView['verticalOffset'],'left':this['_getLeftFollowingChange'](_0x425abf,_0x95ef72,_0x10c88e||_0x459a7e),'name':'arrow_n','config':{'withArrow':!0x1}}),(_0x412a7a,_0x53840b,_0x183ec7,_0x3e0eac)=>({'top':_0x412a7a['top']-_0x53840b['height']-AIReviewCoreNavigationPanelView['verticalOffset'],'left':this['_getLeftFollowingChange'](_0x412a7a,_0x53840b,_0x3e0eac||_0x183ec7),'name':'arrow_s','config':{'withArrow':!0x1}})];}_getLeftFollowingChange(_0x2fefef,_0x2d8892,_0x456abc){const _0x458451=parseFloat(Vt['window']['getComputedStyle'](this['content']['first']['element'])['marginInlineStart']),_0x294505='rtl'===this['locale']['contentLanguageDirection']?_0x2fefef['right']+_0x458451-_0x2d8892['width']:_0x2fefef['left']-_0x458451;return Math['max'](_0x456abc['left'],Math['min'](_0x294505,_0x456abc['right']-_0x2d8892['width']));}['hidePanel'](){this['hide'](),this['unpin'](),this['_stopObservingReflow'](),this['_pinOptions']=void 0x0;}isInViewport(){return this['isVisible']&&!!new Tt(this['element'])['getIntersection'](new Tt(Vt['window']));}destroy(){this['_stopObservingReflow'](),super['destroy']();}_observeDocumentResize(_0x453cea){this['_stopObservingReflow']();const _0x3571d7=()=>{this['isVisible']&&this['_pinOptions']&&this['attachTo'](this['_pinOptions']);};for(const _0x9ff3d3 of[_0x453cea,Vt['document']['body']])_0x9ff3d3&&this['_reflowObservers']['push'](new wt(_0x9ff3d3,_0x3571d7));}_stopObservingReflow(){for(const _0x8c76f9 of this['_reflowObservers'])_0x8c76f9['destroy']();this['_reflowObservers']=[];}_createActionButtonView(_0x31ef54,_0x1cc8bc,_0x171e09){const _0xf2fb62=new _0x1b12df(this['locale']);return _0xf2fb62['set']({'label':qs(this['locale'],_0x31ef54),'withText':!0x0,'class':_0x1cc8bc+'\x20'+pr}),_0xf2fb62['on']('execute',_0x171e09),_0xf2fb62;}_createIconButtonView(_0x3f80ef,_0x1130f9,_0x1b86dc){const _0x2c98c4=new _0x1b12df(this['locale']);return _0x2c98c4['set']({'label':qs(this['locale'],_0x3f80ef),'icon':_0x1130f9,'tooltip':!0x0,'class':Ar+'\x20'+pr}),_0x2c98c4['on']('execute',_0x1b86dc),_0x2c98c4;}_createNavigationButtonViews(){this['_previousButtonView']=this['_createIconButtonView']('AI_REVIEW_MODE_NAVIGATION_PREVIOUS_CHANGE',_0x40bbde,()=>this['fire']('navigateChange',{'direction':'previous'})),this['_nextButtonView']=this['_createIconButtonView']('AI_REVIEW_MODE_NAVIGATION_NEXT_CHANGE',_0x3b2b34,()=>this['fire']('navigateChange',{'direction':'next'}));for(const _0x54ef84 of[this['_previousButtonView'],this['_nextButtonView']])_0x54ef84['bind']('isEnabled')['to'](this,'hasChangesToNavigate');const _0x86de07=new _0x43ad99(this['locale']);return _0x86de07['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review-navigation-panel__navigation']},'children':[this['_previousButtonView'],this['_nextButtonView']]}),_0x86de07;}_createToggleDiffButtonView(){const _0x352fea=this['_createIconButtonView']('AI_REVIEW_MODE_SHOW_CHANGES',_0x4bd9a2,()=>{this['isDiffOn']=!this['isDiffOn'],this['fire']('toggleDiff',{'on':this['isDiffOn'],'changeId':this['_changeId']});}),_0x553704=qs(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x316505=qs(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x352fea['set']({'isToggleable':!0x0}),_0x352fea['bind']('isOn')['to'](this,'isDiffOn'),_0x352fea['bind']('icon')['to'](this,'isDiffOn',_0x13856b=>_0x13856b?_0xc0c807:_0x4bd9a2),_0x352fea['bind']('label')['to'](this,'isDiffOn',_0x444487=>_0x444487?_0x553704:_0x316505),_0x352fea;}_createHeaderView(){const _0x2beb36=new _0x43ad99(this['locale']);this['_completeReviewDropdownView']=this['_createCompleteReviewDropdownView']();const _0x3ec9d7=new _0x3188b1();return _0x3ec9d7['content']=_0x243ec8,_0x3ec9d7['extendTemplate']({'attributes':{'class':'ck-ai_review-navigation-panel__header__icon'}}),_0x2beb36['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review-navigation-panel__header']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review-navigation-panel__header__notice']},'children':[_0x3ec9d7,{'text':qs(this['locale'],'AI_REVIEW_MODE_NAVIGATION_READ_ONLY_NOTICE')}]},this['_completeReviewDropdownView']]}),_0x2beb36;}_createCompleteReviewDropdownView(){const _0x1f7c86=new pc(this['locale'],Ir+'\x20'+pr);return _0x1f7c86['set']('isVisible',!0x0),_0x1f7c86['extendTemplate']({'attributes':{'class':'ck-ai_review-navigation-panel__complete-container'}}),_0x1f7c86['bind']('isAnyResultReviewed')['to'](this,'isAnyResultReviewed'),_0x1f7c86['bind']('hasPendingChanges')['to'](this,'hasPendingChanges',this,'isError',this,'isResultReady',(_0x12540c,_0x1a83ab,_0x392b91)=>_0x12540c&&!_0x1a83ab&&_0x392b91),_0x1f7c86['delegate']('acceptAllChanges')['to'](this),_0x1f7c86['delegate']('rejectAllChanges')['to'](this),_0x1f7c86['delegate']('leaveReviewCoreResultList')['to'](this),_0x1f7c86;}_createContentView(){const _0x33ac7f=new _0x43ad99(this['locale']);return this['_toggleDiffButtonView']=this['_createToggleDiffButtonView'](),this['_acceptButtonView']=this['_createActionButtonView']('AI_REVIEW_MODE_ACCEPT_CHANGE',gr,()=>this['fire']('acceptChange',{'id':this['_changeId']})),this['_suggestButtonView']=this['_createActionButtonView']('AI_REVIEW_MODE_SUGGEST_CHANGE',Ir,()=>this['fire']('suggestChange',{'changeId':this['_changeId']})),this['_dismissButtonView']=this['_createActionButtonView']('AI_REVIEW_MODE_DISMISS_CHANGE',Ar,()=>this['fire']('dismissChange',{'id':this['_changeId']})),this['_stateView']=this['_createStateView'](),_0x33ac7f['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai_review-navigation-panel']},'children':[this['_createHeaderView'](),{'tag':'div','attributes':{'class':['ck-ai_review-navigation-panel__body']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review-navigation-panel__controls']},'children':[this['_createNavigationButtonViews'](),new $h(this['locale'],'ck-ai_review-navigation-panel__divider'),{'tag':'span','attributes':{'class':['ck-ai_review-navigation-panel__counter'],'aria-live':'polite'},'children':[{'text':this['bindTemplate']['to']('counterLabel')}]},new $h(this['locale'],'ck-ai_review-navigation-panel__divider'),this['_toggleDiffButtonView']]},{'tag':'div','attributes':{'class':['ck-ai_review-navigation-panel__actions',this['bindTemplate']['if']('changeStatus','ck-hidden',_0x2ddf36=>'pending'!==_0x2ddf36)]},'children':[this['_dismissButtonView'],this['_suggestButtonView'],this['_acceptButtonView']]},this['_stateView']]}]}),_0x33ac7f;}_createStateView(){const _0xd1fe70=new so(this['locale'],mc);return _0xd1fe70['bind']('isVisible')['to'](this,'changeStatus',_0x47225c=>'pending'!==_0x47225c),_0xd1fe70['bind']('state')['to'](this,'changeStatus',_0x56441b=>'pending'===_0x56441b?'outdated':_0x56441b),_0xd1fe70;}_getBestRectPosition(_0x132e0e,_0x20b404,_0x8399ee,_0x30ae0e){if(!_0x132e0e)return null;const _0x3db20c=this['position']['replace']('arrow_',''),_0x291724=Array['from'](_0x132e0e['getClientRects']());if(!_0x291724['length'])return _0x132e0e['getBoundingClientRect']();const _0xc3c031=[..._0x291724]['reverse'](),_0x38ef92=void 0x0===_0x20b404?void 0x0:_0xc3c031[_0x20b404];let _0x19e263;return _0x38ef92&&this['_isPinnedRectVisible'](_0x38ef92,_0x8399ee,_0x30ae0e)?_0x19e263=_0x38ef92:void 0x0===_0x20b404&&this['_isPinnedRectVisible'](_0xc3c031[0x0],_0x8399ee,_0x30ae0e)?_0x19e263=_0xc3c031[0x0]:('s'==_0x3db20c[0x0]?_0x291724:_0xc3c031)['forEach'](_0x542775=>{this['_isPinnedRectVisible'](_0x542775,_0x8399ee,_0x30ae0e)&&(_0x19e263=_0x542775);}),_0x19e263||_0x132e0e;}_getPointedRectIndexFromEvent(_0x3baeb6,_0x5e90b2){if(_0x3baeb6)for(let _0x54cb36=0x0;_0x54cb36<_0x5e90b2['length'];_0x54cb36++){const _0xdc2483=_0x5e90b2[_0x54cb36];if(_0x3baeb6['clientX']>=_0xdc2483['left']-0x3&&_0x3baeb6['clientX']<=_0xdc2483['right']+0x3&&_0x3baeb6['clientY']>=_0xdc2483['top']-0x3&&_0x3baeb6['clientY']<=_0xdc2483['bottom']+0x3)return _0x54cb36;}}_isPinnedRectVisible(_0x203a0f,_0x1c8816,_0x476e8c){const _0x4609fc=new Tt(_0x203a0f),_0x276bfc=_0x1c8816||document['documentElement'],_0x6e1ba2=_0x4609fc['getIntersection'](yt(_0x476e8c)),_0x40f891=new Tt(_0x276bfc)['getVisible'](),_0xe670f4=_0x40f891&&_0x40f891['getIntersection'](_0x4609fc);return!!(_0x6e1ba2&&_0xe670f4&&_0x4609fc['width']>0x0);}static verticalOffset=0x8;};const wc=['getReviewCheckList','runReviewCheck','abortReviewStream','acceptAllChanges','rejectAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','suggestChange','learnMore','finishReview','retryReview'];var Cc=class extends _0x4f3978{['_mainView'];_navigationPanelView;_bodyCollection;static get requires(){return[Ks];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x187012){super(_0x187012),this['_bodyCollection']=this['context']['plugins']['get'](Ks)['bodyCollection'];}init(){this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...wc)['to'](this),this['_navigationPanelView']=new Tc(this['context']['locale'],this['_bodyCollection']),this['_navigationPanelView']['bind']('isAnyResultReviewed')['to'](this['_mainView']['reviewCheckResultsView'],'isAnyResultReviewed'),this['_navigationPanelView']['bind']('hasPendingChanges')['to'](this['_mainView']['reviewCheckResultsView'],'hasPendingChanges'),this['_navigationPanelView']['bind']('isError')['to'](this['_mainView']['reviewCheckResultsView'],'isError'),this['_navigationPanelView']['bind']('isResultReady')['to'](this['_mainView']['reviewCheckResultsView'],'isResultReady'),this['_navigationPanelView']['delegate']('acceptChange','dismissChange','suggestChange','navigateChange','toggleDiff','acceptAllChanges','rejectAllChanges','leaveReviewCoreResultList')['to'](this),this['toggleLoadingSkeleton'](!0x0);const _0x5049eb=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x5049eb);}setAvailableChecks(_0x2b09c7){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x3291ff=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x2b09c7,_0x3291ff);}this['_mainView']['showReviewCheckListView']();}toggleLoadingSkeleton(_0x5d7104){this['_mainView']['toggleLoadingSkeleton'](_0x5d7104);}showReviewCheckList(){this['fire']('getReviewCheckList');}showCheckRunResults(_0x3e33e3){_0x3e33e3&&('error-general'!==_0x3e33e3['status']?'error-chunk'!==_0x3e33e3['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}showCheckRunResult(_0x3d67ba){this['_mainView']['addCheckRunResult'](_0x3d67ba,this['_isAcceptButtonVisibleForChange'](),this['_isSuggestButtonVisibleForChange']());}showGeneralResultsErrorView(){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x459cc2){this['_mainView']['showGeneralReviewCoreErrorView'](_0x459cc2??qs(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}showUnsupportedInlineChangeView(){this['_mainView']['showUnsupportedInlineChangeView']();}setCheckResultTitle(_0x59e98c,_0x2a5845){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x59e98c,_0x2a5845);}setHasPendingChanges(_0x5cbde9){this['_mainView']['reviewCheckResultsView']['hasPendingChanges']=_0x5cbde9;}setActiveStateInResults(_0xf97e8b){this['_mainView']['reviewCheckResultsView']['setActiveResult'](_0xf97e8b);}resetActiveStateInResults(){this['_mainView']['reviewCheckResultsView']['resetActiveResults']();}updateChangeState(_0x107149,_0x4f0ef5){this['_navigationPanelView']['updateChangeState'](_0x107149,_0x4f0ef5),this['_mainView']['reviewCheckResultsView']['updateChangeState'](_0x107149,_0x4f0ef5);}updateProgress(_0x191406,_0x408709){this['_mainView']['reviewCheckResultsView']['updateProgress'](_0x191406,_0x408709);}showReviewCompletedView(){this['_mainView']['showReviewCompletedView']();}showActionsWhenResultIsReady(){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}hideActionsWhenResultIsReady(){this['_mainView']['hideActionsWhenResultIsReady']();}showNavigationPanel(_0x32d2ee){this['_navigationPanelView']['showPanel']({..._0x32d2ee,'isAcceptButtonVisible':this['_isAcceptButtonVisibleForChange'](),'isSuggestButtonVisible':this['_isSuggestButtonVisibleForChange']()});}hideNavigationPanel(){this['_navigationPanelView']['hidePanel']();}isNavigationPanelInViewport(){return this['_navigationPanelView']['isInViewport']();}updateNavigationPanelPosition(_0x344a16){this['_navigationPanelView']['updateChangePosition'](_0x344a16);}getNavigationPanelChangeId(){return this['_navigationPanelView']['changeId'];}scrollResultsToChange(_0x25ba3a){this['_mainView']['reviewCheckResultsView']['scrollToResult'](_0x25ba3a);}_isAcceptButtonVisibleForChange(){return!0x0;}_isSuggestButtonVisibleForChange(){return!0x1;}showLeaveConfirmationDialog(_0x13701f,_0x57c516,_0xb0cd61){const _0x35bdec=tn(this['context']),_0x2b335e=new _0x43ad99(_0x35bdec['locale']);_0x2b335e['setTemplate']({'tag':'div','attributes':{'style':{'padding':'var(--ck-spacing-large)','whiteSpace':'initial'}},'children':[_0x13701f['content']]}),function(_0x34c0aa,_0x421f83,_0x58244e,_0x33074a,_0x3c7aae){if(!_0x34c0aa['plugins']['has']('AIEditorIntegration'))return void _0x33074a();const _0x47e11b=_0x34c0aa['plugins']['get']('AIEditorIntegration')['dialog'];let _0x108d71=!0x1;_0x47e11b['show']({'id':_0x421f83['dialogId'],'isModal':!0x0,'hasCloseButton':!0x0,'className':'ck-ai-leave-confirmation','title':_0x421f83['title'],'content':_0x58244e,'actionButtons':[{'label':_0x421f83['exitButton'],'withText':!0x0,'onExecute':()=>{_0x108d71=!0x0,_0x47e11b['hide'](),_0x33074a();}},{'label':_0x421f83['stayButton'],'class':gr,'withText':!0x0,'onExecute':()=>_0x47e11b['hide']()}],'onHide':()=>{_0x108d71||_0x3c7aae?.();}});}(_0x35bdec,_0x13701f,_0x2b335e,_0x57c516,_0xb0cd61);}},fc=class extends _0x43ad99{constructor(_0x2ee0a6){super(_0x2ee0a6),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x1d37a3=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x1d37a3['if']('isVisible','ck-hidden',_0x369e40=>!_0x369e40)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x1d37a3['to']('errorMessage')}]}]});}},Rc=class extends _0x43ad99{['reviewCoreHeader'];['generalErrorView'];reviewCheckListView;reviewCheckResultsView;reviewCompletedView;constructor(_0x78e2fe,_0x1e85e0){super(_0x78e2fe),this['reviewCoreHeader']=_0x1e85e0['header'],this['generalErrorView']=new fc(_0x78e2fe),this['reviewCheckListView']=_0x1e85e0['list'],this['reviewCheckListView']['delegate'](...wc)['to'](this),this['reviewCheckResultsView']=_0x1e85e0['results'],this['reviewCheckResultsView']['delegate'](...wc)['to'](this),this['reviewCompletedView']=_0x1e85e0['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['set']('isLoadingSkeletonVisible',!0x1),this['reviewCoreHeader']['bind']('isLoadingSkeletonVisible')['to'](this,'isLoadingSkeletonVisible'),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'],this['_createLoadingSkeletonView']()]});}toggleLoadingSkeleton(_0x48fc58){this['set']('isLoadingSkeletonVisible',_0x48fc58);}_createLoadingSkeletonView(){const _0x290556=new lo(this['locale'],uo['aiReviewInitCheck']);return _0x290556['extendTemplate']({'attributes':{'class':['ck-ai_review__init-skeleton']}}),_0x290556['bind']('isVisible')['to'](this,'isLoadingSkeletonVisible'),_0x290556;}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(_0x52a241,_0x18777b,_0x5c45b8){this['reviewCheckResultsView']['addResult'](_0x52a241,_0x18777b,_0x5c45b8),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'](_0x39cebf){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x39cebf;}showGeneralResultsErrorView(){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}showUnsupportedInlineChangeView(){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showUnsupportedInlineChangeMessage']();}},bc=class extends _0x43ad99{resultResponseView;acceptButtonView;dismissButtonView;infoButtonView;outdatedButtonView;suggestButtonView;constructor(_0x5e0a3b,_0x992d92,_0x13a79a,_0x1251ce){super(_0x5e0a3b),this['id']=_0x992d92,this['set']('status','pending'),this['set']('changeId',_0x992d92),this['set']('isAcceptButtonVisible',_0x13a79a),this['set']('isSuggestButtonVisible',_0x1251ce),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['outdatedButtonView']=this['_createOutdatedButtonView'](),this['suggestButtonView']=this['_createSuggestButtonView'](),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['suggestButtonView'],this['dismissButtonView'],this['outdatedButtonView']]},this['infoButtonView']]}]}),this['on']('click',(_0x133e04,_0xd56bce)=>{_0xd56bce&&_0xd56bce['target']&&'A'===_0xd56bce['target']['tagName']&&_0xd56bce['preventDefault'](),this['fire']('activateChange',{'id':_0x992d92,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x992d92,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x992d92,'source':this});}),this['on']('change:showDiff',()=>this['_syncResponseVisibility']());}['render'](){super['render'](),this['_syncResponseVisibility']();}setItemAsActive(){this['isActive']=!0x0;}setItemAsInactive(){this['isActive']=!0x1;}_createResultResponseView(){const _0x4e7e3e=new _0x43ad99(this['locale']);return _0x4e7e3e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai_review__check-run-result-response']}}),_0x4e7e3e;}updateResponseContent(_0x1b910d,_0x3820b0){const _0x137edd=_0x3820b0||'div',_0x29e495=this['resultResponseView']['element'];if(_0x29e495['tagName']['toLowerCase']()!==_0x137edd){const _0x479703=new _0x373278({'tag':_0x137edd,'attributes':{'class':_0x29e495['className']}})['render']();_0x29e495['replaceWith'](_0x479703),this['resultResponseView']['element']=_0x479703,this['_syncResponseVisibility']();}this['resultResponseView']['element']['innerHTML']=Qt(_0x1b910d);}_syncResponseVisibility(){this['resultResponseView']['element']?.['classList']['toggle']('ck-hidden',!this['showDiff']);}_createAcceptButtonView(){const _0x27a417=new _0x1b12df(this['locale']);return _0x27a417['set']({'label':qs(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x27a417['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4f8a48=>{_0x4f8a48['stopPropagation']();})},'attributes':{'class':[this['bindTemplate']['if']('status',gr,_0x465270=>'pending'===_0x465270),this['bindTemplate']['if']('status',Ar,_0x4cbb50=>'pending'!==_0x4cbb50),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x303581=>'accepted'===_0x303581),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button_success',_0x2e4682=>'accepted'===_0x2e4682)]}}),_0x27a417['bind']('isVisible')['to'](this,'isAcceptButtonVisible',this,'status',(_0x546e6f,_0x14de6d)=>'accepted'===_0x14de6d||_0x546e6f&&'pending'===_0x14de6d),_0x27a417['bind']('isEnabled')['to'](this,'status',_0x1198b4=>'pending'===_0x1198b4),_0x27a417['on']('execute',()=>{this['fire']('acceptChange',{'id':this['changeId']});}),this['on']('change:status',(_0x38240e,_0x20f38d,_0x4dbcc1)=>{'accepted'===_0x4dbcc1&&(_0x27a417['label']=qs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x27a417['icon']=_0x3e619a);}),_0x27a417;}_createDismissButtonView(){const _0x44cc2b=new _0x1b12df(this['locale']);return _0x44cc2b['set']({'label':qs(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x44cc2b['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x158f17=>{_0x158f17['stopPropagation']();})},'attributes':{'class':[Ar,this['bindTemplate']['if']('status','ck-hidden',_0x262fd4=>'pending'!==_0x262fd4&&'rejected'!==_0x262fd4),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x9934cd=>'pending'===_0x9934cd),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x5352df=>'rejected'===_0x5352df),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button_error',_0x5923ce=>'rejected'===_0x5923ce)]}}),_0x44cc2b['on']('execute',()=>{this['fire']('dismissChange',{'id':this['changeId']});}),this['on']('change:status',(_0xd4e89b,_0x19fdcb,_0x54a808)=>{_0x44cc2b['isEnabled']='pending'===_0x54a808,'rejected'===_0x54a808&&(_0x44cc2b['label']=qs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x44cc2b['icon']=_0x467543);}),_0x44cc2b;}_createInfoButtonView(){const _0x5baf11=new _0x1b12df(this['locale']);return _0x5baf11['set']({'label':qs(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x52f52d,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':Ar+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x5baf11['bind']('isOn')['to'](this,'isInfoToggleOn',_0x24042b=>_0x24042b),_0x5baf11['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x5baf11;}_createOutdatedButtonView(){const _0x51d422=new _0x1b12df(this['locale']);return _0x51d422['set']({'label':qs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':_0x44817c,'withText':!0x0,'isEnabled':!0x1}),_0x51d422['extendTemplate']({'attributes':{'class':[Ar,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x23da86=>'outdated'!==_0x23da86)],'disabled':'disabled'}}),_0x51d422;}_createSuggestButtonView(){const _0x4e9416=new _0x1b12df(this['locale']);return _0x4e9416['set']({'label':qs(this['locale'],'AI_REVIEW_MODE_SUGGEST_CHANGE'),'withText':!0x0}),_0x4e9416['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x18bd11=>{_0x18bd11['stopPropagation']();})},'attributes':{'class':[Ir]}}),_0x4e9416['on']('execute',()=>{this['fire']('suggestChange',{'changeId':this['changeId']});}),_0x4e9416['bind']('isVisible')['to'](this,'isSuggestButtonVisible',this,'status',(_0x3ec6e6,_0x380378)=>_0x3ec6e6&&'pending'===_0x380378),_0x4e9416['bind']('isEnabled')['to'](this,'status',_0x641d7e=>'pending'===_0x641d7e),_0x4e9416;}},Sc=class extends _0x1b12df{constructor(_0x234fb7,_0x428f80){super(_0x428f80),this['set']({'label':_0x234fb7,'withText':!0x0,'class':gr}),this['on']('execute',()=>{this['fire']('finishReview');});}},Oc=class extends _0x43ad99{['_labelView'];constructor(_0x36615a){super(_0x36615a),this['_labelView']=new _0x43ad99(_0x36615a),this['_labelView']['setTemplate']({'tag':'span','attributes':{'class':['ck-ai_review__progress-bar-label']}}),this['_labelView']['render'](),this['set']('isVisible',!0x1),this['set']('_percentageDone',0x0);const _0x67619e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__progress-bar-container',_0x67619e['if']('isVisible','ck-hidden',_0x488e00=>!_0x488e00)]},'children':[this['_labelView'],{'tag':'div','attributes':{'class':['ck-ai_review__progress-bar-track']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__progress-bar-fill'],'style':{'width':_0x67619e['to']('_percentageDone',_0x33dbc1=>_0x33dbc1+'%')}}}]}]});}updateProgress(_0x2120a1,_0x1dda43){this['_percentageDone']=_0x1dda43?Math['round'](_0x2120a1/_0x1dda43*0x64):0x0,this['_labelView']['element']['innerHTML']=Qt(qs(this['locale'],'AI_REVIEW_MODE_PROGRESS',['<strong>'+_0x2120a1+'</strong>',_0x1dda43]));}},vc=class extends _0x5be144{_resultViews;get _tileViews(){return Array['from'](this['_resultViews']);}_resultsHeader;_resultsBody;['reviewDisclaimer'];_titleContentResizeObserver=null;_cancelButtonView;['_errorMessageView'];_finishReviewButtonView;_completeReviewDropdownView;['_progressBarView'];_contents;constructor(_0x2ed45a,_0x24b46c){super(_0x2ed45a),this['_contents']=_0x24b46c,this['_resultViews']=new _0x4a09f9(),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['_completeReviewDropdownView']=this['_createCompleteReviewDropdownView'](),this['_progressBarView']=this['_createProgressBarView'](),this['_resultsHeader']=this['_createResultHeaderView'](),this['_resultsBody']=this['_createResultsBodyView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new nh(_0x2ed45a),this['set']('isLoading',!0x1),this['set']('isResultReady',!0x1),this['set']('headerTitle',''),this['set']('headerSubtitle',''),this['set']('_headerTitleTooltipText',''),this['set']('_headerSubtitleTooltipText',''),this['set']('isError',!0x1),this['set']('showErrorMessage',!0x1),this['set']('errorType','general'),this['set']('isCompleted',!0x1),this['set']('hasPendingChanges',!0x1),this['set']('isAnyResultReviewed',!0x1);const _0x21a019=this['_createCombinedSkeletonLoader'](),_0xcd122d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0xcd122d['if']('isLoading','ck-ai_review__check-run_loading',_0x1f1867=>_0x1f1867),_0xcd122d['if']('isVisible','ck-hidden',_0x51daad=>!_0x51daad)]},'children':[this['_resultsHeader'],this['_errorMessageView'],this['_resultsBody'],_0x21a019,this['reviewDisclaimer']]});}['render'](){super['render']();const _0x26164d=this['element']['querySelector']('.ck-ai_review__check-run-results-header-title-content');this['_titleContentResizeObserver']=new wt(_0x26164d,()=>{this['_updateTitleTooltipText'](),this['_updateSubtitleTooltipText']();}),this['listenTo'](this,'change:headerTitle',()=>this['_updateTitleTooltipText']()),this['listenTo'](this,'change:headerSubtitle',()=>this['_updateSubtitleTooltipText']());}destroy(){super['destroy'](),this['_titleContentResizeObserver']&&this['_titleContentResizeObserver']['destroy']();}clearResults(){this['_resultViews']['clear'](),this['_resultsBody']['element']&&(this['_resultsBody']['element']['scrollTop']=0x0);}updateProgress(_0x516647,_0x4f0fa6){this['isAnyResultReviewed']=_0x516647>0x0,this['_progressBarView']['updateProgress'](_0x516647,_0x4f0fa6);}getResults(){return this['_resultViews'];}setActiveResult(_0x33cbe3){for(const _0x4683bb of this['_tileViews'])_0x4683bb['id']===_0x33cbe3&&_0x4683bb['setItemAsActive']();}resetActiveResults(){for(const _0xc3c045 of this['_tileViews'])_0xc3c045['setItemAsInactive']();}scrollToResult(_0x32e803){const _0x4dc1b6=this['_resultsBody']['element'],_0x418412=this['getResultElement'](_0x32e803);if(!_0x4dc1b6||!_0x418412)return;const _0x33dafc=_0x418412['getBoundingClientRect']()['top']-_0x4dc1b6['getBoundingClientRect']()['top'];_0x4dc1b6['scrollTo']({'top':_0x4dc1b6['scrollTop']+_0x33dafc,'behavior':'smooth'});}getResultElement(_0x16ec9b){const _0x5cc4b5=this['_tileViews']['find'](_0x3374fa=>_0x3374fa['id']===_0x16ec9b);return _0x5cc4b5?_0x5cc4b5['element']:null;}addResult(_0xeb4ca4,_0x3161c9,_0xede3e4){const _0xff0a52=new bc(this['locale'],_0xeb4ca4['id'],_0x3161c9,_0xede3e4);_0xff0a52['delegate']('acceptChange','dismissChange','activateChange','deactivateChange','suggestChange')['to'](this),this['_resultViews']['add'](_0xff0a52),_0xff0a52['updateResponseContent'](_0xeb4ca4['contentDiffed'],_0xeb4ca4['wrapperTag']);}updateChangeState(_0x1f5b53,_0x5a7567){const _0x5b0431=this['_tileViews']['find'](_0x2b8da1=>_0x2b8da1['id']===_0x1f5b53);_0x5b0431&&(_0x5b0431['status']=_0x5a7567,_0x5b0431['element']?.['classList']['toggle']('ck-ai_review__check-run-result_grayout','pending'!==_0x5a7567));}setTitle(_0xe542f9,_0xc733b0){this['headerTitle']=_0xe542f9,this['headerSubtitle']=_0xc733b0||'';}['showChunkErrorMessage'](){this['errorType']='chunk',this['showErrorMessage']=!0x0;}showUnsupportedInlineChangeMessage(){this['errorType']='unsupported-inline',this['showErrorMessage']=!0x0;}['showGeneralErrorMessage'](){this['isError']=!0x0,this['errorType']='general',this['showErrorMessage']=!0x0;}resetErrorState(){this['isError']=!0x1,this['errorType']='general',this['showErrorMessage']=!0x1;}_createCombinedSkeletonLoader(){const _0x27a61d=new lo(this['locale'],this['_getSkeletonDefinition']());return _0x27a61d['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-container']}}),_0x27a61d['bind']('isVisible')['to'](this,'isLoading'),_0x27a61d;}_getSkeletonDefinition(){return uo['aiReviewChecks'];}_createResultsBodyView(){const _0x95c0aa=new _0x43ad99(this['locale']);return _0x95c0aa['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x5ec787=>_0x5ec787)]},'children':this['_resultViews']}),_0x95c0aa;}_createErrorView(){const _0x1c81e2=new _0x43ad99(this['locale']),_0x35f7d5=new _0x1b12df(this['locale']),t=this['locale']['t'];return _0x1c81e2['delegate']('retryReview')['to'](this),_0x35f7d5['set']({'label':t('Try\x20again'),'withText':!0x0,'class':Ir}),_0x35f7d5['on']('execute',()=>{this['fire']('retryReview');}),_0x1c81e2['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x369898=>!_0x369898),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x5c83a2=>'chunk'===_0x5c83a2)]},'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',_0x8c931e=>'chunk'===_0x8c931e||'unsupported-inline'===_0x8c931e)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x4a0eb1=>'general'!==_0x4a0eb1)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x1353f3=>'chunk'!==_0x1353f3)]},'children':[{'text':qs(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x354282=>'unsupported-inline'!==_0x354282)]},'children':[{'text':qs(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')}]}]},_0x35f7d5]}),_0x1c81e2;}_createCancelButtonView(){const _0x3dd8db=new _0x1b12df(this['locale']);return _0x3dd8db['set']({'label':qs(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[Ir+'\x20ck-ai-button-stop-generating'],'icon':rt}),_0x3dd8db['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x3fa029=>_0x3fa029),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x42f65d=>_0x42f65d)]}}),_0x3dd8db['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x3dd8db;}_createHeaderControlViews(){return[this['_cancelButtonView'],this['_completeReviewDropdownView'],this['_finishReviewButtonView']];}_createResultHeaderView(){const _0x133141=new _0x43ad99(this['locale']),_0x205b05=this['_createTitleView']();return _0x133141['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x9bcbf7=>_0x9bcbf7)]},'children':[_0x205b05,{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2356b6=>!_0x2356b6)],'title':qs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')},'children':[{'text':qs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':this['_createHeaderControlViews']()},...this['_createProgressBarViewList']()]}),_0x133141;}_createTitleView(){const _0x542ca0=new _0x43ad99(this['locale']);return _0x542ca0['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3f3ffd=>_0x3f3ffd)]},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-title'],'data-cke-tooltip-text':this['bindTemplate']['to']('_headerTitleTooltipText'),'data-cke-tooltip-class':'ck-tooltip_multi-line'},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-subtitle'],'data-cke-tooltip-text':this['bindTemplate']['to']('_headerSubtitleTooltipText'),'data-cke-tooltip-class':'ck-tooltip_multi-line'},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]}]}),_0x542ca0;}_updateTitleTooltipText(){const _0x341ccf=this['element']['querySelector']('.ck-ai_review__check-run-results-header-title');this['_headerTitleTooltipText']=_0x341ccf['scrollWidth']>_0x341ccf['clientWidth']?this['headerTitle']:'';}_updateSubtitleTooltipText(){const _0x77c4e=this['element']['querySelector']('.ck-ai_review__check-run-results-header-subtitle');this['_headerSubtitleTooltipText']=_0x77c4e['scrollWidth']>_0x77c4e['clientWidth']?this['headerSubtitle']:'';}_createProgressBarView(){const _0x2c43c9=new Oc(this['locale']);return _0x2c43c9['bind']('isVisible')['to'](this,'isResultReady'),_0x2c43c9;}_createProgressBarViewList(){return[this['_progressBarView']];}_createFinishReviewButtonView(){const _0x43491d=new Sc(qs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x43491d['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5584b7=>!_0x5584b7)]}}),_0x43491d['delegate']('finishReview')['to'](this),_0x43491d;}_createCompleteReviewDropdownView(){const _0x4fcd42=new pc(this['locale'],gr);return _0x4fcd42['bind']('isAnyResultReviewed')['to'](this,'isAnyResultReviewed'),_0x4fcd42['bind']('isVisible')['to'](this,'isCompleted',this,'isResultReady',(_0x2b93cb,_0x3ddb50)=>!_0x2b93cb&&_0x3ddb50),_0x4fcd42['bind']('hasPendingChanges')['to'](this,'hasPendingChanges',this,'isError',(_0x3fa9ae,_0x125e0e)=>_0x3fa9ae&&!_0x125e0e),_0x4fcd42['delegate']('acceptAllChanges')['to'](this),_0x4fcd42['delegate']('rejectAllChanges')['to'](this),_0x4fcd42['delegate']('leaveReviewCoreResultList')['to'](this),_0x4fcd42;}},yc=class extends vc{_changeIdByPartIndex=new Map();clearResults(){super['clearResults'](),this['_changeIdByPartIndex']['clear']();}addResult(_0x3f3652,_0x493dfb,_0x4fadf1){const _0x48508a=this['_resultViews']['length'],_0x3ced6d=function(_0x1a0d74,_0x584920){return{'type':'modified','index':_0x584920,'state':_0x1a0d74['status'],'content':en(_0x1a0d74['contentDiffed']),'hasChanges':!0x0,'wrapperTag':_0x1a0d74['wrapperTag']};}(_0x3f3652,_0x48508a);this['_changeIdByPartIndex']['set'](_0x48508a,_0x3f3652['id']);const _0x96fbe8=new co(this['locale'],{'part':_0x3ced6d,'uiIndex':_0x48508a+0x1,'areActionsDisabled':!0x1,'availableActions':[...po],'translationKeys':mc});_0x96fbe8['isApplyVisible']=_0x493dfb,_0x96fbe8['isSuggestVisible']=_0x4fadf1,_0x96fbe8['on']('applySuggestion',()=>this['fire']('acceptChange',{'id':_0x3f3652['id']})),_0x96fbe8['on']('insertSuggestion',()=>this['fire']('suggestChange',{'changeId':_0x3f3652['id']})),_0x96fbe8['on']('rejectSuggestion',()=>this['fire']('dismissChange',{'id':_0x3f3652['id']})),_0x96fbe8['on']('showChangeInText',()=>this['fire']('activateChange',{'id':_0x3f3652['id'],'source':_0x96fbe8,'uiInteraction':'click'})),_0x96fbe8['on']('mouseOverSuggestion',()=>this['fire']('activateChange',{'id':_0x3f3652['id'],'source':_0x96fbe8,'uiInteraction':'hover'})),_0x96fbe8['on']('mouseLeaveSuggestion',()=>this['fire']('deactivateChange',{'origin':'panel','id':_0x3f3652['id'],'source':_0x96fbe8})),this['_resultViews']['add'](_0x96fbe8),_0x96fbe8['markAsDone'](),_0x96fbe8['updateContent']({'part':_0x3ced6d})['catch'](_0x484035=>Wt('ai-review-content-part-render-failed',_0x484035));}updateChangeState(_0x5dca29,_0x3936f6){const _0x518857=this['_getPartView'](_0x5dca29);_0x518857&&(_0x518857['state']=_0x3936f6);}setActiveResult(_0x2cb164){for(const _0x2b048f of this['_partViews'])_0x2b048f['isActive']=this['_changeIdByPartIndex']['get'](_0x2b048f['partDefinition']['index'])===_0x2cb164;}resetActiveResults(){for(const _0x3382d9 of this['_partViews'])_0x3382d9['isActive']=!0x1;}getResultElement(_0x21a70f){return this['_getPartView'](_0x21a70f)?.['element']??null;}get _partViews(){return Array['from'](this['_resultViews']);}_getPartView(_0x18d44d){for(const _0x16572c of this['_partViews'])if(this['_changeIdByPartIndex']['get'](_0x16572c['partDefinition']['index'])===_0x18d44d)return _0x16572c;return null;}},Nc=class extends _0x5be144{_resultsHeader;_finishReviewButtonView;constructor(_0x3e62be,_0x3c6874){super(_0x3e62be),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x3c6874['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x3c6874['headerText']);const _0x1cc51b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x1cc51b['if']('isVisible','ck-hidden',_0xd91d61=>!_0xd91d61)]},'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':_0x3c6874['emptyResultsText']}]}]}]});}_createFinishReviewButtonView(_0x267eac){const _0x34ed6f=new Sc(_0x267eac,this['locale']);return _0x34ed6f['delegate']('finishReview')['to'](this),_0x34ed6f;}_createResultHeaderView(_0x67ba61){const _0x21c0ac=new _0x43ad99(this['locale']);return _0x21c0ac['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title'],'title':_0x67ba61},'children':[{'text':_0x67ba61}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x21c0ac;}},kc=class extends _0x43ad99{['_dropdownView'];_defaultValue;_defaultLabel;constructor(_0x4e03f2,_0x413070){super(_0x4e03f2),this['_defaultValue']=_0x413070['default']||(_0x413070['data']['length']>0x0?_0x413070['data'][0x0]['id']:''),this['_defaultLabel']=_0x413070['data']['find'](_0x3e8b90=>_0x3e8b90['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x348de2(this['locale']);const _0x260586=this['_prepareListOptions'](_0x413070['data']);_0xb17444(this['_dropdownView'],_0x260586,{'role':'menu','ariaLabel':_0x413070['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x10a4b3=>{_0x10a4b3['stopPropagation']();})}}),this['_dropdownView']['panelPositionLimiter']=()=>{const _0x58a689=this['_dropdownView']['buttonView']['element'];return _0x58a689&&St(_0x58a689);},this['listenTo'](this['_dropdownView'],'execute',_0x5f2fac=>{this['formValue']=_0x5f2fac['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x5f2fac['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(_0x185e12=[]){const _0x3fe518=new _t();this['resetToDefault']();for(const _0x3af179 of _0x185e12){const _0x19c671=new _0x5f2643({'label':_0x3af179['label'],'withText':!0x0,'role':'menuitemradio','id':_0x3af179['id'],'model':_0x3af179});_0x19c671['bind']('isOn')['to'](this,'formValue',_0xa73d21=>_0xa73d21===_0x19c671['id']);const _0x36884d={'type':'button','model':_0x19c671};_0x3fe518['add'](_0x36884d);}return _0x3fe518;}},xc=class extends _0x5be144{_formItem=null;constructor(_0x2bbec8,_0x5d460c,_0x17384a){if(super(_0x2bbec8),this['argsKey']=_0x5d460c?.['argsKey'],'dropdown'===_0x5d460c['formType'])this['_formItem']=new kc(this['locale'],_0x5d460c);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x3b69cf=new _0x50a5bf(this['locale'],{'children':[this['_formItem']],'class':[_0x17384a?'ck-form__row_with-submit':'']});_0x17384a&&_0x3b69cf['children']['add'](_0x17384a),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x3b69cf]});}resetToDefault(){this['_formItem']['resetToDefault']();}},Lc=class AIReviewCorePromptInputView extends _0x56db51{keystrokes;static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x38b037){super(_0x38b037),this['set']('isEmpty',!0x0),this['keystrokes']=new pt(),this['minRows']=AIReviewCorePromptInputView['MIN_ROWS'],this['maxRows']=AIReviewCorePromptInputView['MAX_ROWS'],this['placeholder']=qs(_0x38b037,'AI_REVIEW_MODE_CUSTOM_PROMPT_PLACEHOLDER'),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']);}},Dc=class extends _0x43ad99{['focusTracker']=new Et();keystrokes=new pt();['focusCycler'];['_focusables']=new _0x4a09f9();submitButtonView;cancelButtonView;promptInputView;actionsFooterView;_modelSelector;['_check'];constructor(_0x1ff198,_0x10b7a9,_0x1e1093=!0x1){super(_0x1ff198),this['_check']=_0x10b7a9,this['set']('prompt',''),this['set']('modelId',''),this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x39833d(this['locale'],()=>new Lc(_0x1ff198)),this['promptInputView']['fieldView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['fieldView']['on']('input',()=>{this['prompt']=this['promptInputView']['fieldView']['element']['value'];}),this['_modelSelector']=new la(_0x1ff198,{'panelPosition':'auto','dropdownClass':'ck-ai_review__check-list-item-model-dropdown','nameClass':'ck-ai_review__check-list-item-model-name','itemClasses':{'name':'ck-ai_review__check-list-item-model-dropdown-name','description':'ck-ai_review__check-list-item-model-dropdown-description'}}),this['listenTo'](this['_modelSelector'],'selectModel',(_0x95eac1,_0x557423)=>{this['modelId']=_0x557423['id'],this['_modelSelector']['setSelectedModel'](_0x557423);}),this['_setModelList'](_0x1e1093),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions-rows']},'children':[new _0x50a5bf(this['locale'],{'children':[this['promptInputView']]}),new _0x50a5bf(this['locale'],{'children':[this['actionsFooterView']]})]}]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x103103,_0x54702c)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x54702c()):_0x54702c();}),this['focusCycler']=new _0x2dd4b2({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}));}['render'](){super['render'](),[this['promptInputView'],this['_modelSelector']['dropdownView'],this['cancelButtonView'],this['submitButtonView']]['forEach'](_0x2fd49b=>{this['_focusables']['add'](_0x2fd49b),this['focusTracker']['add'](_0x2fd49b['element']);}),this['keystrokes']['listenTo'](this['element']);}resetToDefault(){this['prompt']='',this['modelId']=this['_check']['defaultModel']?.['id']??'',this['_check']['defaultModel']&&this['_modelSelector']['setSelectedModel'](this['_check']['defaultModel']),this['resetFormValidationStatus']();}resetFormValidationStatus(){this['promptInputView']['errorText']='';}['_isValid'](){this['resetFormValidationStatus']();for(const _0x54de2a of this['_getFormValidators']()){const _0x2f8853=_0x54de2a();if(_0x2f8853)return this['promptInputView']['errorText']=_0x2f8853,!0x1;}return!0x0;}_getFormValidators(){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return qs(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}_createSubmitButtonView(){const _0x41fbd5=new _0x1b12df(this['locale']);return _0x41fbd5['set']({'label':qs(this['locale'],'AI_REVIEW_MODE_RUN_REVIEW_BUTTON_LABEL'),'withText':!0x0,'class':gr+'\x20'+pr}),_0x41fbd5['bind']('isEnabled')['to'](this,'prompt',_0x5e1797=>_0x5e1797['trim']()['length']>0x0),_0x41fbd5['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x41fbd5;}_createCancelButtonView(){const _0x5564a8=new _0x1b12df(this['locale']),t=this['locale']['t'];return _0x5564a8['set']({'label':t('Cancel'),'withText':!0x0,'class':Ar+'\x20'+pr}),_0x5564a8['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5ae1b9=>{_0x5ae1b9['stopPropagation']();})}}),_0x5564a8['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x5564a8;}_setModelList(_0x352b81){this['_modelSelector']['setModels'](this['_check']['models'],!_0x352b81),this['resetToDefault']();}_createActionsFooterView(){const _0x23c069=new _0x43ad99(this['locale']);return _0x23c069['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions-footer']},'children':[this['_modelSelector'],{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x23c069;}},Pc=class extends _0x5be144{_formItemsCollection=new _0x4a09f9();_customCheckView=null;['_headerView'];_contentFormView;['_hideModels']=!0x1;['check'];constructor(_0xb8fd06,_0x5143b3,_0x54715e,_0x58e600=!0x1){super(_0xb8fd06),this['_hideModels']=_0x58e600,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x5143b3['isParameterized']),this['check']=_0x5143b3,this['_headerView']=this['_createHeaderView'](_0x5143b3),this['_contentFormView']=this['_createContentFormView'](),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai_review__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai_review__check-list-item_selected',_0xd2b889=>_0xd2b889),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x1c422e=>_0x1c422e)],'style':{'--ck-ai-review-check-list-item-index':_0x54715e}},'on':{'keydown':this['bindTemplate']['to'](_0x3d6d70=>{const _0x466ee3=_0x3d6d70;'ArrowUp'!==_0x466ee3['key']&&'ArrowDown'!==_0x466ee3['key']||this['_headerView']['element']['contains'](_0x3d6d70['target'])||_0x3d6d70['stopPropagation']();}),'click':this['bindTemplate']['to'](_0xb945a5=>{_0xb945a5['target']===_0xb945a5['currentTarget']&&(this['focus'](),this['fire']('click',_0xb945a5));})},'children':[this['_headerView'],...this['_contentFormView']?[this['_contentFormView']]:[]]}),this['on']('click',()=>{_0x5143b3['isParameterized']?this['isParametrizedViewOpen']=!this['isParametrizedViewOpen']:this['fire']('runReviewCheck',{'id':_0x5143b3['id'],'args':_0x5143b3['useArgs']?_0x5143b3['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['focus'](){this['_headerView']['element']['focus']();}resetToDefault(){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0xf3193d=>{_0xf3193d['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}_createHeaderView(_0x1dae3b){const _0x420d25=new _0x43ad99(),_0x4bdc35=this['_createIconView']();return _0x420d25['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-content'],'tabindex':'-1','role':'button',..._0x1dae3b['isParameterized']?{'aria-expanded':this['bindTemplate']['to']('isParametrizedViewOpen',_0xff5f94=>String(_0xff5f94))}:{}},'on':{'click':this['bindTemplate']['to']('click'),'keydown':this['bindTemplate']['to'](_0x2e871f=>{const _0x4cba5b=_0x2e871f;_0x2e871f['target']!==_0x2e871f['currentTarget']||'Enter'!==_0x4cba5b['key']&&'\x20'!==_0x4cba5b['key']||(_0x2e871f['preventDefault'](),this['fire']('click',_0x2e871f));})},'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':_0x1dae3b['title']}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x1dae3b['description']?[{'text':_0x1dae3b['description']}]:[]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-icon-wrapper']},'children':[_0x4bdc35]}]}),_0x420d25;}_createIconView(){const _0x55e9db=new _0x3188b1();return _0x55e9db['content']=_0x5133fa,_0x55e9db['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x55e9db;}_createParameterizedView(_0x227f3d){const _0x4ab2c8=new _0x43ad99(),_0x2552b1=this['_createFormView'](_0x227f3d);return _0x4ab2c8['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x37c423=>!_0x37c423)]},'children':[_0x2552b1]}),_0x4ab2c8;}_createFormView(_0x4c1cb0){const _0x3508c9=new _0x43ad99(),_0x5d8df1=Array['isArray'](_0x4c1cb0['options'])?_0x4c1cb0['options']:[],_0x3c7bab=new _0x1b12df(this['locale']);_0x3c7bab['set']({'label':qs(this['locale'],'AI_REVIEW_MODE_RUN_REVIEW_BUTTON_LABEL'),'withText':!0x0,'class':gr}),_0x3c7bab['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2fc666=>{_0x2fc666['stopPropagation']();})}}),_0x3c7bab['on']('execute',()=>{const _0x5aef6b=[],_0x14ec2f={};this['_formItemsCollection']['forEach'](_0x3581f0=>{_0x5aef6b['push'](_0x3581f0['value']),_0x4c1cb0['useArgs']&&_0x4c1cb0['options']&&(_0x14ec2f[_0x3581f0['argsKey']]=_0x3581f0['value']);}),this['fire']('runReviewCheck',{'id':_0x4c1cb0['id'],'params':_0x5aef6b['length']?_0x5aef6b:void 0x0,'args':Object['keys'](_0x14ec2f)['length']?_0x14ec2f:void 0x0});});const _0x1c5cb0=_0x5d8df1['length'];return _0x5d8df1['forEach']((_0x5b868d,_0x14c2bb)=>{const _0x4cebbd=_0x14c2bb===_0x1c5cb0-0x1;this['_formItemsCollection']['add'](new xc(this['locale'],_0x5b868d,_0x4cebbd?_0x3c7bab:null));}),_0x3508c9['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x3508c9;}_createCustomView(_0x440d17,_0x215d7b=!0x1){return this['_customCheckView']=new Dc(this['locale'],_0x440d17,_0x215d7b),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',_0x36e201=>!_0x36e201)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x20cbb4,_0x24de18,_0x39699a)=>{_0x39699a||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}_createContentFormView(){return'custom'===this['check']['id']?this['_createCustomView'](this['check'],this['_hideModels']):this['check']['isParameterized']?this['_createParameterizedView'](this['check']):null;}},Mc=class extends _0x35138b{constructor(_0x28b2ec){super(_0x28b2ec),this['set']('isVisible',!0x0);}setChecks(_0x561b0f,_0x335e5f=!0x1){this['_clearCheckViews']();for(const [_0x47675d,_0x4a7f6c]of this['_getVisualOrder'](_0x561b0f)['entries']()){const _0x485330=this['_createCheckView'](_0x4a7f6c,_0x47675d,_0x335e5f);this['_addCheckView'](_0x485330);}this['_onChecksSet']();}_getVisualOrder(_0x46b9ce){return _0x46b9ce;}_onChecksSet(){}_createCheckView(_0x4b8a62,_0x2c8936,_0x5d0e46){const _0x4c604f=new Pc(this['locale'],_0x4b8a62,_0x2c8936,_0x5d0e46);return _0x4c604f['delegate']('runReviewCheck')['to'](this),this['listenTo'](_0x4c604f,'change:isParametrizedViewOpen',(_0x841cc4,_0x3a0b03,_0x1644cb)=>{_0x1644cb&&this['_closeCheckViewsOtherThan'](_0x4c604f);}),_0x4c604f;}_closeCheckViewsOtherThan(_0x353c3e=null){for(const _0x609725 of this['getCheckViews']())_0x609725!==_0x353c3e&&_0x609725['isParametrizedViewOpen']&&(_0x609725['isParametrizedViewOpen']=!0x1);}['render'](){super['render'](),_0x8f06c5({'emitter':this,'activator':()=>this['getCheckViews']()['some'](_0x25c0a2=>_0x25c0a2['isParametrizedViewOpen']),'contextElements':()=>this['getCheckViews']()['filter'](_0x553659=>_0x553659['isItemParametrized'])['map'](_0x1b93e3=>_0x1b93e3['element']),'callback':()=>this['_closeCheckViewsOtherThan']()});}getCheckViewById(_0x31e7d9){return this['getCheckViews']()['find'](_0x2c21cf=>_0x2c21cf['check']['id']===_0x31e7d9);}['hasChecks'](){return this['getCheckViews']()['length']>0x0;}resetAllParameterizedChecks(){for(const _0x21658b of this['getCheckViews']())_0x21658b['isItemParametrized']&&_0x21658b['resetToDefault']();}},Vc=class extends Mc{_parameterizedCheckViews;_nonParameterizedCheckViews;constructor(_0x28ed7b){super(_0x28ed7b),this['_parameterizedCheckViews']=new _0xa68267(_0x28ed7b),this['_parameterizedCheckViews']['label']=qs(_0x28ed7b,'AI_REVIEW_MODE_REVIEW_CATEGORY_TITLE_PARAMETERIZED'),this['_parameterizedCheckViews']['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-group']}}),this['_nonParameterizedCheckViews']=new _0xa68267(_0x28ed7b),this['_nonParameterizedCheckViews']['label']=qs(_0x28ed7b,'AI_REVIEW_MODE_REVIEW_CATEGORY_TITLE_NON_PARAMETERIZED'),this['_nonParameterizedCheckViews']['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-group']}}),this['_setupTemplate']();}_getVisualOrder(_0x53792e){return[..._0x53792e['filter'](_0x43f5c1=>!_0x43f5c1['isParameterized']),..._0x53792e['filter'](_0x33f4eb=>_0x33f4eb['isParameterized'])];}['_clearCheckViews'](){this['_parameterizedCheckViews']['items']['clear'](),this['_nonParameterizedCheckViews']['items']['clear'](),this['items']['clear']();}['_addCheckView'](_0x15e00){_0x15e00['isItemParametrized']?this['_parameterizedCheckViews']['items']['add'](_0x15e00):this['_nonParameterizedCheckViews']['items']['add'](_0x15e00),this['items']['add'](_0x15e00);}_onChecksSet(){this['_parameterizedCheckViews']['isVisible']=this['_parameterizedCheckViews']['items']['length']>0x0,this['_nonParameterizedCheckViews']['isVisible']=this['_nonParameterizedCheckViews']['items']['length']>0x0;}getCheckViews(){return[...this['_nonParameterizedCheckViews']['items'],...this['_parameterizedCheckViews']['items']]['filter'](_0x353274=>_0x353274 instanceof Pc);}_setupTemplate(){const _0x1f4e84=this['bindTemplate'];this['setTemplate']({'tag':'ul','attributes':{'class':['ck-ai_review__check-list',_0x1f4e84['if']('isVisible','ck-hidden',_0x3185b2=>!_0x3185b2)]},'children':[this['_nonParameterizedCheckViews'],this['_parameterizedCheckViews']]});}};function Hc(_0x2e1d4e){const _0x345a29=Zs(_0x2e1d4e);return _0x345a29['length']>0x0&&_0x345a29['every'](_0x32d2b7=>_0x32d2b7['plugins']['has']('TrackChanges'));}function Uc(_0x5c1cbb){return Zs(_0x5c1cbb)['some'](_0x4b8372=>function(_0x77d5b1){return Boolean(_0x77d5b1['commands']['get']('trackChanges')?.['value']);}(_0x4b8372));}var Bc=class extends Cc{static get['pluginName'](){return'AIReviewModeUI';}createMainView(){const _0x5daca7=this['context']['plugins']['get']('AITabs'),_0x31f44a=this['context']['locale'],_0x2413b1=new sh(_0x31f44a,{'label':qs(_0x31f44a,'AI_REVIEW_MODE'),'icon':_0x15e980,'class':'ck-ai-header_review','showResizeButton':_0x5daca7['showResizeButton']});_0x2413b1['delegate']('resizeTabs')['to'](_0x5daca7),_0x2413b1['bind']('isMaximized')['to'](_0x5daca7['view'],'isMaximized',_0x1b1d5f=>_0x1b1d5f);const _0x217f4c=new Rc(this['context']['locale'],{'header':_0x2413b1,'list':new Vc(_0x31f44a),'results':new yc(_0x31f44a,{'generalErrorText':qs(_0x31f44a,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new Nc(_0x31f44a,{'headerText':qs(_0x31f44a,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':qs(_0x31f44a,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':qs(_0x31f44a,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});return _0x217f4c['extendTemplate']({'attributes':{'class':'ck-ai-review-mode'}}),_0x217f4c;}registerTab(){const _0x86f6cf=this['context']['plugins']['get']('AITabs');_0x86f6cf['view']['on']('activateTab',(_0x2bed16,{newTab:_0x34089c,oldTab:_0x1afa27})=>{_0x34089c===Sh?this['fire']('getReviewCheckList'):_0x1afa27===Sh&&this['fire']('leaveReview');}),_0x86f6cf['view']['addTab']({'id':Sh,'buttonLabel':qs(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x15e980,'order':0x0,'content':this['_mainView']});}_isSuggestButtonVisibleForChange(){return Hc(this['context']);}_isAcceptButtonVisibleForChange(){return!this['_isSuggestButtonVisibleForChange']()||!Uc(this['context']);}},Gc=class extends or{_affectedBlocks=[];get affectedBlocks(){return this['_affectedBlocks']['slice']();}set affectedBlocks(_0x1a5385){this['_affectedBlocks']=_0x1a5385;}};const Wc='review-',Fc=['softBreak'],Kc=['htmlScript','htmlStyle','htmlCustomElement'];var $c=class extends _0x4f3978{static get requires(){return[Un,Pn];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();_activeMarkers=new Set();_domEmitter;_eventEmitter;shadowRootRegistry=new Ct();_reviewEditingAttachedEditors=new WeakSet();_boundEditables=new WeakMap();_inlineRootDataIds=new WeakMap();['_markerBlurHandler']=null;constructor(_0xf45434){super(_0xf45434),this['_domEmitter']=new(gt())(),this['_eventEmitter']=new(It())();}get emitter(){return this['_eventEmitter'];}afterInit(){const _0x593941=_0x4e219c=>this['_scheduleAttachReviewEditingToEditor'](_0x4e219c);if(this['_registerGlobalMarkerBlurHandler'](),this['context']instanceof _0xfb41df)return void _0x593941(this['context']);const _0x808c2a=this['context'];for(const _0xfc4b4 of _0x808c2a['editors'])_0x593941(_0xfc4b4);this['listenTo'](_0x808c2a['editors'],'add',(_0x1769dd,_0x4f2aee)=>{_0x593941(_0x4f2aee);}),this['listenTo'](_0x808c2a['editors'],'remove',(_0x107b69,_0x55c4c7)=>{for(const [_0x4b2586,_0xa345fe]of this['_markers'])_0xa345fe['editor']===_0x55c4c7&&(this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x4b2586,'changeId':_0xa345fe['groupId']}),this['_markers']['delete'](_0x4b2586));});}destroy(){super['destroy'](),this['_domEmitter']['stopListening'](),this['shadowRootRegistry']['destroy'](),this['_markerBlurHandler']?.['cancel']();}_scheduleAttachReviewEditingToEditor(_0x1e387e){const _0x3af606=()=>{'destroyed'!==_0x1e387e['state']&&_0x1e387e['conversion']&&this['_attachReviewEditingToEditor'](_0x1e387e);};if('ready'===_0x1e387e['state'])return void _0x3af606();const _0x17a2c8=()=>{this['stopListening'](_0x1e387e,'ready',_0x17a2c8),_0x3af606();};this['listenTo'](_0x1e387e,'ready',_0x17a2c8);}_attachReviewEditingToEditor(_0xcf0696){this['_reviewEditingAttachedEditors']['has'](_0xcf0696)||(_0xcf0696['conversion']['for']('editingDowncast')['markerToElement']({'model':Wc+'insert','view':(_0x16fa33,{writer:_0x5efdae})=>{const _0x4e358b=this['_markers']['get'](_0x16fa33['markerName']),_0x29e6c1={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x4e358b?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x16fa33['markerName']};return _0x5efdae['createUIElement']('span',_0x29e6c1,function(_0x1f329b){const _0x601fc=this['toDomElement'](_0x1f329b);return _0x601fc['innerHTML']=Qt(_0x4e358b?.['content']?.['asString']||''),_0x601fc;});}}),_0xcf0696['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Wc+'remove-only','view':_0x185e45=>{const _0x1bbbfb=this['_markers']['get'](_0x185e45['markerName']),_0x274a9d=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x1bbbfb?.['id']||'')&&_0x274a9d['push']('ck-ai_review__change_active'),{'classes':_0x274a9d,'attributes':{'data-marker-id':_0x185e45['markerName']}};}}),_0xcf0696['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Wc+'remove-context','view':_0x28063e=>{const _0x5d6311=this['_markers']['get'](_0x28063e['markerName']),_0x2a6a2e=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x5d6311?.['id']||'')&&_0x2a6a2e['push']('ck-ai_review__change_active'),{'classes':_0x2a6a2e,'attributes':{'data-marker-id':_0x28063e['markerName']}};}}),_0xcf0696['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Wc+'remove-text','view':_0x152a72=>{const _0x12fe60=this['_markers']['get'](_0x152a72['markerName']),_0x481cf9=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x12fe60?.['id']||'')&&_0x481cf9['push']('ck-ai_review__change_active'),{'classes':_0x481cf9,'attributes':{'data-marker-id':_0x152a72['markerName']}};}}),_0xcf0696['conversion']['for']('dataDowncast')['markerToElement']({'model':Wc+'suggestion-context','view':(_0x143041,{writer:_0xbbe3f})=>_0xbbe3f['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x143041['isOpening']?'start':'end')})}),_0xcf0696['conversion']['for']('downcast')['attributeToAttribute']({'model':Vn,'view':Hn}),this['_updateMouseMarkerInteractionListeners'](_0xcf0696),this['listenTo'](_0xcf0696,'addRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0xcf0696),{'priority':'lowest'}),this['listenTo'](_0xcf0696,'detachRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0xcf0696),{'priority':'lowest'}),_0xcf0696['model']['document']['registerPostFixer'](_0x14c9ae=>this['_validateMarkers'](_0xcf0696,_0x14c9ae)),_0xcf0696['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0xcf0696)),this['_reviewEditingAttachedEditors']['add'](_0xcf0696));}_updateMouseMarkerInteractionListeners(_0x134207){let _0x17a2a1=this['_boundEditables']['get'](_0x134207);_0x17a2a1||(_0x17a2a1=new Map(),this['_boundEditables']['set'](_0x134207,_0x17a2a1));const _0x52aa36=new Set(_0x134207['ui']['getEditableElementsNames']());for(const _0xa22bab of _0x52aa36){if(_0x17a2a1['has'](_0xa22bab))continue;const _0x37483f=_0x134207['ui']['getEditableElement'](_0xa22bab);_0x17a2a1['set'](_0xa22bab,_0x37483f),this['_attachMouseMarkerInteractionListeners'](_0x37483f),this['shadowRootRegistry']['registerNode'](_0x37483f);}for(const [_0x5493a1,_0x41641a]of _0x17a2a1)_0x52aa36['has'](_0x5493a1)||(_0x17a2a1['delete'](_0x5493a1),this['_domEmitter']['stopListening'](_0x41641a),this['shadowRootRegistry']['unregisterNode'](_0x41641a));}_attachMouseMarkerInteractionListeners(_0x18164a){this['_domEmitter']['listenTo'](_0x18164a,'mouseup',(_0x4c0b3c,_0x2ea38b)=>{const _0x3752e9=_0x2ea38b['target'],_0x2ffda8=this['_findMarkerElement'](_0x3752e9);if(!_0x2ffda8)return;const _0x37de1d=_0x2ffda8['getAttribute']('data-marker-id'),_0x2ae777=_0x37de1d['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x37de1d,'changeId':_0x2ae777,'markerElement':()=>this['_findMarkerElementById'](_0x37de1d),'domEvent':_0x2ea38b});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x18164a,'mouseover',(_0x23666e,_0x5bdde0)=>{const _0x4ad5d8=_0x5bdde0['target'],_0x276a49=_0x5bdde0['relatedTarget'];let _0x4d6ff1=this['_findMarkerElement'](_0x4ad5d8);if(!_0x4d6ff1&&_0x276a49&&(_0x4d6ff1=this['_findMarkerElement'](_0x276a49)),!_0x4d6ff1)return;const _0x2dbef3=_0x4d6ff1['getAttribute']('data-marker-id'),_0x5c4ac0=_0x2dbef3['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x5c4ac0,'markerElement':()=>this['_findMarkerElementById'](_0x2dbef3),'domEvent':_0x5bdde0});});}_registerGlobalMarkerBlurHandler(){const _0x530107=_0x2dbd18((_0x3e9cd0,_0x3b1c09)=>{const _0x2d7851=this['_getHoveredElement'](_0x3b1c09);_0x2d7851&&(this['_findMarkerElement'](_0x2d7851)||this['_eventEmitter']['fire']('changeMarkerBlurred'));},0xc8);this['_markerBlurHandler']=_0x530107,this['_domEmitter']['listenTo'](document,'mouseover',_0x530107),Gt(this['shadowRootRegistry'],{'emitter':this['_domEmitter'],'event':'mouseover','callback':_0x530107});}_getHoveredElement(_0x39df4f){return this['shadowRootRegistry']['refresh'](),Nt(_0x39df4f['clientX'],_0x39df4f['clientY'],Array['from'](this['shadowRootRegistry']['getShadowRoots']()));}getDocumentData(_0x413916){const _0x570bcc=this['context']['plugins']['get']('AIEditing'),_0x521acb=Zs(this['context']);if(!_0x521acb['length'])throw new dt('ai-get-editor-from-context-no-editor',this);const _0x4f159a=_0x413916?.['roots'];if(_0x4f159a&&0x0===_0x4f159a['length'])throw new dt('ai-reviewcoreediting-empty-roots',this);const _0x4dacac=_0x4f159a?new Set(_0x4f159a['map'](_0x190e25=>_0x190e25['channelId']+'\x00'+_0x190e25['rootName'])):null,_0x33c1aa=_0x4dacac?new Set():null,_0x55702b=new Set(),_0x589e9e=[],_0x47046d=new Map(),_0x547016=[];for(const _0x219d1c of _0x521acb){const _0x2de0ac=_0x219d1c['config']['get']('collaboration.channelId');for(const _0x5f3dd6 of _0x219d1c['model']['document']['getRoots']()){const _0x5cc8dc=_0x2de0ac+'\x00'+_0x5f3dd6['rootName'];if(_0x4dacac&&!_0x4dacac['has'](_0x5cc8dc))continue;const _0x544bb2=this['_buildDocumentDataSliceForRoot'](_0x219d1c,_0x5f3dd6,_0x570bcc,_0x55702b);_0x589e9e['push'](_0x544bb2['content']);for(const [_0xea847d,_0x47c004]of _0x544bb2['elements'])_0x47046d['set'](_0xea847d,_0x47c004);_0x547016['push']({'channelId':_0x2de0ac,'rootName':_0x5f3dd6['rootName'],'content':_0x544bb2['content'],'documentVersion':_0x544bb2['documentVersion']}),_0x33c1aa?.['add'](_0x5cc8dc);}}if(_0x4f159a&&_0x33c1aa['size']!==_0x4dacac['size']){const _0x1017d1=_0x4f159a['find'](_0x1b97e4=>!_0x33c1aa['has'](_0x1b97e4['channelId']+'\x00'+_0x1b97e4['rootName']));throw new dt('ai-reviewcoreediting-root-not-found',this,{'channelId':_0x1017d1['channelId'],'rootName':_0x1017d1['rootName']});}return{'elements':_0x47046d,'content':_0x589e9e['join'](''),'roots':_0x547016};}async['runCheck'](_0x69576b,_0x33a60a){const _0x19cbad=new hr(),_0x5eb493=_0x33a60a?.['signal'];let _0x48d6b4;const _0xcd053d=()=>{_0x19cbad['abort'](),_0x69576b['abort']();};if(_0x5eb493){if(_0x5eb493['aborted'])return _0xcd053d(),_0x19cbad;_0x5eb493['addEventListener']('abort',_0xcd053d),_0x48d6b4=()=>_0x5eb493['removeEventListener']('abort',_0xcd053d);}const _0xd9b0d1={'apiId':_0x69576b['sourceCheck']['apiId']};try{_0x69576b['on']('reviewCheckRunUpdated',(_0x1ae1c4,_0x51f652)=>{'aborted'===_0x51f652['status']?_0x19cbad['abort']():'error-general'!==_0x51f652['status']&&'error-chunk'!==_0x51f652['status']||(_0x19cbad['error']=rr(_0x51f652['error'],'ai-reviewcoreediting-check-run-failed',this,_0xd9b0d1));}),'aborted'!==_0x19cbad['status']&&await _0x69576b['start']();}catch(_0x266a21){_0x19cbad['error']=rr(_0x266a21,'ai-reviewcoreediting-check-run-failed',this,_0xd9b0d1);}finally{_0x48d6b4&&_0x48d6b4();}return'error'===_0x19cbad['status']||'aborted'===_0x19cbad['status']||(_0x19cbad['addResult'](...this['_buildPerRootResults'](_0x69576b)),_0x19cbad['status']='completed'),_0x19cbad;}buildErrorContext(_0x3b4917){return{'apiId':_0x3b4917['sourceCheck']['apiId']};}_buildPerRootResults(_0x33dda3){const _0x1b5b26=this['buildErrorContext'](_0x33dda3),_0x438c20=this['context']['plugins']['get']('AIEditing'),_0x55d3c4=this['context']['plugins']['get']('AIGateway'),_0x4c51d0=new Map();for(const _0x7b9377 of Zs(this['context']))_0x4c51d0['set'](_0x7b9377['config']['get']('collaboration.channelId'),_0x7b9377);return _0x33dda3['documentData']['roots']['map'](({channelId:_0x3e039d,rootName:_0x8f5e8a,content:_0x20ae9c,documentVersion:_0x295d20})=>{const _0x1c7e2f=_0x4c51d0['get'](_0x3e039d),_0x1db239=new Gc({'editor':_0x1c7e2f,'rootName':_0x8f5e8a,'channelId':_0x3e039d,'sessionId':_0x438c20['getSessionId'](_0x1c7e2f)});_0x1db239['contentRawOld']=_0x20ae9c,_0x1db239['documentVersion']=_0x295d20;const _0x2f3a01=this['_collectResultAffectedBlocks'](_0x1db239,_0x33dda3['results'],_0x33dda3['documentData']['elements']);_0x1db239['affectedBlocks']=_0x2f3a01;try{_0x1db239['contentRawNew']=sn(_0x55d3c4['mergeChangesIntoContent'](_0x2f3a01,_0x1db239['contentRawOld']));}catch(_0x494597){_0x1db239['error']=rr(_0x494597,'ai-reviewcoreediting-check-run-failed',this,_0x1b5b26);}return _0x1db239;});}_collectResultAffectedBlocks(_0x2c8ec4,_0x19ac1e,_0x543fee){return _0x19ac1e['filter'](_0x1bce74=>{const _0x5a1279=_0x543fee['get'](_0x1bce74['id']);return!!_0x5a1279&&_0x5a1279['editor']===_0x2c8ec4['editor']&&_0x5a1279['rootName']===_0x2c8ec4['rootName'];})['map'](_0x28e5da=>({'id':_0x28e5da['id'],'content':_0x28e5da['contentNew']}));}_buildDocumentDataSliceForRoot(_0x54b1ad,_0x2034d7,_0x10817a,_0x4acf50){const _0x44721f=_0x54b1ad['model'],_0x5a2ea9=new _0x3a5946();for(const _0x5833bf of _0x2034d7['getChildren']())_0x5a2ea9['_appendChild'](_0x5833bf['_clone'](!0x0));for(const _0x58c73b of _0x44721f['markers']){const _0x5155c0=_0x58c73b['getRange']();_0x5155c0&&_0x5155c0['root']['rootName']===_0x2034d7['rootName']&&_0x5a2ea9['markers']['set'](_0x58c73b['name'],this['_changeRangeOwnerDocument'](_0x5155c0['clone'](),_0x5a2ea9));}const _0x10ef6a=new Map(),_0x73aecd=_0x44721f['document']['version'];if(En(_0x54b1ad,_0x2034d7['rootName'])){let _0x1db5a2=this['_inlineRootDataIds']['get'](_0x2034d7);_0x1db5a2?_0x4acf50['add'](_0x1db5a2):(_0x1db5a2=_0x10817a['_nextDataId'](_0x4acf50),this['_inlineRootDataIds']['set'](_0x2034d7,_0x1db5a2));const _0x3d4d72=pn(_0x54b1ad['data']['processor']['toData'](_0x54b1ad['data']['toView'](_0x5a2ea9)),_0x1db5a2);return _0x10ef6a['set'](_0x1db5a2,{'editor':_0x54b1ad,'rootName':_0x2034d7['rootName'],'path':[],'documentVersion':_0x73aecd,'getContent':()=>_0x3d4d72}),{'content':_0x3d4d72,'documentVersion':_0x73aecd,'elements':_0x10ef6a};}const _0x4b362d=new _0x2e5c20({'ignoreElementEnd':!0x0,'startPosition':_0x44721f['createPositionAt'](_0x5a2ea9,0x0)});for(const {item:_0x4c0dce}of _0x4b362d){if(_0x4c0dce['is']('element')&&_0x4c0dce['name']&&Kc['includes'](_0x4c0dce['name'])){const _0x3c9236=this['_upsertDataId'](_0x4c0dce,()=>_0x10817a['_nextDataId'](_0x4acf50));_0x4acf50['add'](_0x3c9236);}if(!_0x4c0dce['is']('$textProxy'))continue;const _0x473b93=_0x4c0dce['parent'];if(!_0x473b93||!_0x473b93['is']('element'))continue;const _0x19bd5e=this['_upsertDataId'](_0x473b93,()=>_0x10817a['_nextDataId'](_0x4acf50));_0x4acf50['add'](_0x19bd5e);for(const _0x83833f of _0x473b93['getChildren']())_0x83833f['is']('element')&&(_0x83833f['name']&&Fc['includes'](_0x83833f['name'])||_0x4acf50['add'](this['_upsertDataId'](_0x83833f,()=>_0x10817a['_nextDataId'](_0x4acf50))));let _0x278342=_0x473b93;for(;_0x278342['parent']&&!_0x278342['parent']['is']('documentFragment');)_0x278342=_0x278342['parent'],_0x278342['hasAttribute']('$elementId')&&_0x278342['_removeAttribute'](Vn);_0x10ef6a['set'](_0x19bd5e,{'editor':_0x54b1ad,'rootName':_0x2034d7['rootName'],'path':_0x473b93['getPath'](),'documentVersion':_0x73aecd,'getContent':this['_createGetContentUsingDataIdFn'](_0x278342['_clone'](!0x0),_0x19bd5e,_0x54b1ad['data'])}),_0x4b362d['jumpTo'](_0x44721f['createPositionAfter'](_0x473b93));}return{'content':_0x54b1ad['data']['processor']['toData'](_0x54b1ad['data']['toView'](_0x5a2ea9)),'documentVersion':_0x73aecd,'elements':_0x10ef6a};}diffContent(_0x49daa1,_0x3897f2,_0x5d7053,_0x1e14d7=!0x1){const {contentInitial:_0x2aedc7,contentNew:_0x322f51}=this['_neutralizeChangesOnUnsupportedElements'](_0x3897f2,_0x5d7053),_0x38bf32=[],_0x9d6c1f=_0x49daa1['data']['parse'](_0x322f51,'$documentFragment'),_0xf0b7eb=_0x49daa1['data']['parse'](_0x2aedc7,'$documentFragment'),_0xc3231b=_0x49daa1['model']['createPositionAt'](_0xf0b7eb,0x0);if(this['_haveSingleTopLevelElement'](_0x9d6c1f)){if(!this['_hasSameTopLevelElement'](_0xf0b7eb,_0x9d6c1f))return _0x38bf32;}else{const _0x3607ab=_0x49daa1['model']['schema'];if(!this['_haveOnlyInlineContent'](_0xf0b7eb,_0x3607ab)||!this['_haveOnlyInlineContent'](_0x9d6c1f,_0x3607ab))return _0x38bf32;}const _0xff1c43=this['context']['plugins']['get']('DocumentChanges')['getDiff'](_0x2aedc7,_0x322f51,{'targetEditor':_0x49daa1,'anchor':_0xc3231b,'markDeletions':!0x0})['filter'](_0x5b0d52=>'insert'===_0x5b0d52['type']||'marker'===_0x5b0d52['type']&&_0x5b0d52['name']['startsWith']('$markedRemove')),_0x1ca69f=this['_groupAdjacentOperations'](_0xff1c43),_0x4ec7bf=[];if(_0x1e14d7){if(_0x1ca69f['length']){const _0x6b69bb=_0x1ca69f[0x0]['operations'][0x0],_0x1c4a40='insert'===_0x6b69bb['type']?_0x6b69bb['position']:_0x6b69bb['newRange']['start'],_0x5177cb=this['_getPositionLimitingRange'](_0x1c4a40,_0x49daa1,'inside'),_0xd22ea2=_0x5177cb?_0x5177cb['start']['parent']:_0xf0b7eb,_0x26ce53=_0x5177cb?_0x9d6c1f['getChild'](0x0):_0x9d6c1f;let _0x2c1c68=_0x26ce53['getChildren'](),_0x57b20a=_0x5177cb||_0x49daa1['model']['createRangeIn'](_0xf0b7eb);const _0x1384cf=this['_getTrailingSoftBreaks'](_0xd22ea2),_0x52bd0c=this['_getTrailingSoftBreaks'](_0x26ce53),_0x2d4aa8=Math['min'](_0x1384cf['length'],_0x52bd0c['length']);if(_0x2d4aa8>0x0){const _0x183df0=_0x1384cf[_0x1384cf['length']-_0x2d4aa8]['startOffset'],_0x22d8ed=_0x52bd0c[_0x52bd0c['length']-_0x2d4aa8]['startOffset'];_0x57b20a=new _0x3e534d(_0x57b20a['start'],_0x49daa1['model']['createPositionAt'](_0xd22ea2,_0x183df0)),_0x2c1c68=Array['from'](_0x2c1c68)['filter'](_0x81565f=>_0x81565f['startOffset']<_0x22d8ed);}const _0x463e89=[new _0x4226e6('$markedRemove:synthetic'+Xt(),null,_0x57b20a,_0x49daa1['model']['document']['model']['markers'],!0x0,_0x49daa1['model']['document']['version']+0x1),new _0x596b48(_0x57b20a['end'],_0x2c1c68,_0x49daa1['model']['document']['version']+0x2)];_0x4ec7bf['push']({'operations':_0x463e89,'operationsIsolated':_0x463e89,'groupOffset':0x0});}}else _0x4ec7bf['push'](..._0x1ca69f);let _0x1b2051=0x0;return _0x49daa1['model']['change'](_0xecd730=>{for(let _0x39c502=0x0;_0x39c502<_0x4ec7bf['length'];_0x39c502++){const _0x492a05=_0x4ec7bf[_0x39c502],_0x11a841=_0xecd730['createDocumentFragment']();for(const _0x52d1d2 of _0xf0b7eb['getChildren']())_0xecd730['append'](_0x52d1d2['_clone'](!0x0),_0x11a841);for(const _0x2c42dd of _0x492a05['operationsIsolated'])if('insert'===_0x2c42dd['type']){const _0x499b32=_0x2c42dd;_0x499b32['baseVersion']=null,_0x499b32['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x499b32,_0x11a841),_0xecd730['batch']['addOperation'](_0x2c42dd),_0x49daa1['model']['applyOperation'](_0x2c42dd);const _0x59b4ef='suggestion:insertion:id:authorId:'+_0x1b2051++,_0x4a2e61=_0x49daa1['model']['createRange'](_0x499b32['position'],_0x499b32['position']['getShiftedBy'](_0x499b32['howMany']));_0x11a841['markers']['set'](_0x59b4ef,_0x4a2e61);}else{if('marker'===_0x2c42dd['type']&&_0x2c42dd['name']['startsWith']('$markedRemove')){const _0x5f2118=_0x2c42dd,_0x36a46a='suggestion:deletion:id:authorId:'+_0x1b2051++;this['_changeOperationOwnerDocument'](_0x5f2118,_0x11a841),_0x11a841['markers']['set'](_0x36a46a,_0x5f2118['newRange']);}}if(_0x1e14d7)_0x38bf32['push']({..._0x492a05,'context':this['_createGetContentFn'](_0xf0b7eb,_0x49daa1['data']),'content':this['_createGetContentFn'](_0xf0b7eb,_0x49daa1['data'])});else{const _0x361461=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x492a05['operationsIsolated'][0x0]),_0x11a841),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x492a05['operationsIsolated'][_0x492a05['operationsIsolated']['length']-0x1]),_0x11a841),_0x49daa1);_0x11a841['markers']['set'](Wc+'suggestion-context',new _0x3e534d(_0x361461['start'],_0x361461['end'])),_0x38bf32['push']({..._0x492a05,'context':this['_createGetContextFn'](_0x11a841,_0x49daa1['data'],{'ellipsisBefore':_0x361461['hasContentBefore'],'ellipsisAfter':_0x361461['hasContentAfter']}),'content':this['_createGetContentFn'](_0x11a841,_0x49daa1['data'])});}}}),_0x38bf32;}markChangePositionInEditorContent(_0x444ba5,_0x15846e){if(!_0x444ba5['length'])return;const _0x434a44=_0x444ba5[0x0]['parent']['id'],_0x51bb19=_0x15846e['elements']['get'](_0x434a44);if(!_0x51bb19)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x434a44);const _0x467531=_0x51bb19['path'],_0x318ae9=_0x51bb19['editor'],_0x44761a=_0x318ae9['model']['document']['getRoot'](_0x51bb19['rootName']);if(!_0x44761a)return void console['warn']('No\x20model\x20root\x20found\x20for\x20name:\x20'+_0x51bb19['rootName']);const _0x47d3e6=_0x318ae9['model']['document']['history']['getOperations'](_0x51bb19['documentVersion']),_0x322acc=[];for(const _0x4ff84d of _0x444ba5){const _0x1e2fbb=_0x4ff84d['operationsIsolated']['map'](_0x2c4c1a=>this['_translateOperationToEditorContent'](_0x2c4c1a,_0x467531,_0x44761a));if(!_0x1e2fbb||!_0x1e2fbb['length'])continue;const _0x15dcc4=_0x1e2fbb['every'](_0x2702cc=>'marker'===_0x2702cc['type']&&_0x2702cc['name']['startsWith']('$markedRemove')),_0x2bfd63={'document':_0x318ae9['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x819b85=_0x3d40c6(_0x1e2fbb,_0x47d3e6,_0x2bfd63)['operationsA'];for(const _0x4a9f20 of _0x819b85)if('insert'===_0x4a9f20['type']){const _0x2d4ce8=_0x4a9f20;_0x2d4ce8['position']=this['_clampPositionToParent'](_0x2d4ce8['position']);const _0x2c4666=_0x2d4ce8['nodes'];_0x318ae9['model']['change'](_0x532e35=>{const _0x27fe3c=_0x532e35['createDocumentFragment']();for(const _0x187944 of _0x2c4666)_0x532e35['append'](_0x187944['_clone'](!0x0),_0x27fe3c);_0x322acc['push']({'start':_0x2d4ce8['position'],'end':_0x2d4ce8['position'],'type':'insert','groupId':_0x4ff84d['id'],'content':{'asString':this['_createGetContentFn'](_0x27fe3c,_0x318ae9['data'])(),'asFragment':_0x27fe3c}});});}else{if('marker'===_0x4a9f20['type']&&_0x4a9f20['name']['startsWith']('$markedRemove')){const _0xbd4f64=_0x4a9f20;_0xbd4f64['newRange']=new _0x3e534d(this['_clampPositionToParent'](_0xbd4f64['newRange']['start']),this['_clampPositionToParent'](_0xbd4f64['newRange']['end']));let _0x42db72='remove-text';if(_0x15dcc4){const _0x5a4edc=this['_findAdjacentContextDistance'](_0xbd4f64['newRange']['start'],'backward',_0x318ae9['model']['schema']),_0x142dc7=this['_findAdjacentContextDistance'](_0xbd4f64['newRange']['end'],'forward',_0x318ae9['model']['schema']);if(_0x5a4edc||_0x142dc7){const _0xafbd49=_0xbd4f64['newRange']['start']['getShiftedBy'](-_0x5a4edc),_0x143e6e=_0xbd4f64['newRange']['end']['getShiftedBy'](_0x142dc7);_0x322acc['push']({'start':_0xafbd49,'end':_0x143e6e,'groupId':_0x4ff84d['id'],'type':'remove-context'});}else _0x42db72='remove-only';}_0x322acc['push']({'start':_0xbd4f64['newRange']['start'],'end':_0xbd4f64['newRange']['end'],'groupId':_0x4ff84d['id'],'type':_0x42db72});}}}this['_insertMarkers'](_0x322acc,_0x318ae9);}['clearAllMarkers'](){const _0x46e711=new Map();for(const _0x5a1d83 of this['_markers']['keys']()){const _0x2e613e=this['_markers']['get'](_0x5a1d83);_0x2e613e?.['editor']&&(_0x46e711['has'](_0x2e613e['editor'])||_0x46e711['set'](_0x2e613e['editor'],[]),_0x46e711['get'](_0x2e613e['editor'])['push'](_0x5a1d83));}for(const [_0x56d67d,_0x31f3e5]of _0x46e711)_0x56d67d['model']['change'](_0x5424ca=>{for(const _0x2d647b of _0x31f3e5)_0x56d67d['model']['markers']['get'](_0x2d647b)&&_0x5424ca['removeMarker'](_0x2d647b);});this['_markers']['clear'](),this['_activeMarkers']['clear']();}switchToReadOnly(){for(const _0x4c3414 of this['getEditors']())_0x4c3414['enableReadOnlyMode']('ai-review');}switchToEdit(){for(const _0x1d208b of this['getEditors']())_0x1d208b['disableReadOnlyMode']('ai-review');}['applyChange'](_0x5a9478,_0x4cb606=null){const _0x5ea9db=_0x5a9478['map'](_0x26ddf3=>this['_getMarkersDataForGroup'](_0x26ddf3))['flat'](),_0x47f830=new Map();for(const _0x7147d4 of _0x5ea9db)_0x47f830['has'](_0x7147d4['editor'])||_0x47f830['set'](_0x7147d4['editor'],[]),_0x47f830['get'](_0x7147d4['editor'])['push'](_0x7147d4);for(const [_0x404d68,_0x147eec]of _0x47f830){const _0x1724f9=_0x404d68['model'],_0x338c58=_0x404d68['plugins']['has']('TrackChangesEditing')?_0x404d68['plugins']['get']('TrackChangesEditing'):null;_0x1724f9['change'](_0x3af51a=>{for(const _0xde4aa5 of _0x147eec){const _0x22d797=_0x404d68['model']['markers']['get'](_0xde4aa5['id']);if(!_0x22d797)continue;const _0x46f7fd=_0x3af51a['batch']['operations']['length'];if('insert'===_0xde4aa5['type']){if(!_0xde4aa5['content'])continue;_0x1724f9['insertContent'](_0xde4aa5['content']['asFragment']||null,_0x22d797['getRange']()['start']);}else'remove-text'!==_0xde4aa5['type']&&'remove-only'!==_0xde4aa5['type']||_0x1724f9['deleteContent'](_0x1724f9['createSelection'](_0x22d797['getRange']()));if(_0x3af51a['removeMarker'](_0xde4aa5['id']),this['_markers']['delete'](_0xde4aa5['id']),!_0x4cb606)continue;const _0x54db61=_0x3af51a['batch']['operations']['slice'](_0x46f7fd),_0xe7c126=[],_0x56f0c2=new Set();for(const _0x9ac170 of _0x54db61){if('marker'!=_0x9ac170['type']||null!==_0x9ac170['oldRange'])continue;const _0x2963f1=_0x9ac170['name'],{group:_0x45f1cd,id:_0x2c071f}=_0x7b3abe(_0x2963f1);if('suggestion'!=_0x45f1cd||!_0x338c58||!_0x338c58['hasSuggestion'](_0x2c071f))continue;const _0x46a979=_0x338c58['getSuggestion'](_0x2c071f);null===_0x46a979['_originalSuggestionId']&&(_0xe7c126['push'](_0x46a979),_0x56f0c2['add'](_0x2963f1));}const _0x3b4d4e='insert'===_0xde4aa5['type']&&_0x56f0c2['size']>0x0;jn(_0x54db61['filter'](_0x3348ba=>'marker'==_0x3348ba['type']?_0x56f0c2['has'](_0x3348ba['name']):!_0x3b4d4e),_0x4cb606);for(const _0x25bcd6 of _0xe7c126)_0x25bcd6['setAttribute']('@ai',{'type':_0x4cb606});}});}}applyChangesAsSuggestions(_0x506296,_0x4b1029=null){const _0xaab490=_0x506296['map'](_0x1108e3=>this['_getMarkersDataForGroup'](_0x1108e3))['flat'](),_0x577005=new Map();for(const _0x18a1da of _0xaab490)_0x577005['has'](_0x18a1da['editor'])||_0x577005['set'](_0x18a1da['editor'],[]),_0x577005['get'](_0x18a1da['editor'])['push'](_0x18a1da);for(const _0x1ee73d of _0x577005['keys']())if(!_0x1ee73d['plugins']['has']('TrackChangesEditing'))throw new dt('ai-no-track-changes',this);for(const [_0x15a8fd,_0x2ba224]of _0x577005){const _0x465aba=_0x15a8fd['plugins']['get']('TrackChangesEditing');_0x15a8fd['model']['change'](_0x35f832=>{for(const _0x26a615 of _0x2ba224){const _0x4691c1=_0x15a8fd['model']['markers']['get'](_0x26a615['id']);if(_0x4691c1){const _0x1b5f14=this['_buildSuggestionOperationForMarker'](_0x26a615,_0x4691c1,_0x15a8fd);_0x1b5f14&&(_0x4b1029&&jn([_0x1b5f14],_0x4b1029),_0x465aba['_applyOperationsAsSuggestions']([_0x1b5f14])),_0x35f832['removeMarker'](_0x26a615['id']);}this['_markers']['delete'](_0x26a615['id']);}});}}_buildSuggestionOperationForMarker(_0x3eba67,_0x1c848b,_0x258b3c){if('insert'===_0x3eba67['type']){if(!_0x3eba67['content'])return null;const _0x2448e3=Array['from'](_0x3eba67['content']['asFragment']['getChildren']())['map'](_0x547e52=>_0x547e52['_clone'](!0x0));return _0x2448e3['length']?new _0x596b48(_0x1c848b['getRange']()['start'],_0x2448e3,_0x258b3c['model']['document']['version']):null;}if('remove-text'===_0x3eba67['type']||'remove-only'===_0x3eba67['type']){const _0x53e1d1=_0x1c848b['getRange']();return _0x53e1d1['isCollapsed']?null:new _0x4226e6('$markedRemove:aireview'+Xt(),null,_0x53e1d1,_0x258b3c['model']['markers'],!0x0,_0x258b3c['model']['document']['version']);}return null;}rejectChange(_0x1d84a6){this['_rejectMarkersForChanges']([_0x1d84a6]);}rejectAllChanges(_0x282769){this['_rejectMarkersForChanges'](_0x282769);}_rejectMarkersForChanges(_0x29d7da){const _0x559019=_0x29d7da['map'](_0x33a362=>this['_getMarkersDataForGroup'](_0x33a362))['flat'](),_0x3c6c2a=new Map();for(const _0x373976 of _0x559019)_0x3c6c2a['has'](_0x373976['editor'])||_0x3c6c2a['set'](_0x373976['editor'],[]),_0x3c6c2a['get'](_0x373976['editor'])['push'](_0x373976);for(const [_0x1998f3,_0x511f21]of _0x3c6c2a)_0x1998f3['model']['change'](_0x585133=>{for(const _0x527f88 of _0x511f21)_0x1998f3['model']['markers']['get'](_0x527f88['id'])&&(_0x585133['removeMarker'](_0x527f88['id']),this['_markers']['delete'](_0x527f88['id']));});}getEditor(){return tn(this['context']);}getEditors(){return Zs(this['context']);}getEditorForChange(_0x5aa28a){return this['_getMarkersDataForGroup'](_0x5aa28a)[0x0]?.['editor'];}getMarkerElementForChange(_0x20cb6e){const _0x51bd43=Array['from'](this['_markers']['values']())['filter'](_0x57a3f0=>_0x57a3f0['groupId']===_0x20cb6e);if(!_0x51bd43['length'])return null;const _0x100637=0x1===_0x51bd43['length']?_0x51bd43[0x0]:this['_sortMarkers'](_0x51bd43)[0x0],_0x41686e=_0x100637['editor']['model']['markers']['get'](_0x100637['id']);return _0x41686e?{'modelRange':_0x41686e['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x100637['id'])}:null;}getContentElementForChange(_0x537aff){const _0x20bf4e=Array['from'](this['_markers']['values']())['filter'](_0x5b9cff=>_0x5b9cff['groupId']===_0x537aff);if(!_0x20bf4e['length'])return null;const _0x5f2aa3=0x1===_0x20bf4e['length']?_0x20bf4e[0x0]:this['_sortMarkers'](_0x20bf4e)[0x0],_0x248dda=_0x5f2aa3['editor'],_0x10518d=_0x248dda['model']['markers']['get'](_0x5f2aa3['id']);if(!_0x10518d)return null;const _0x336eeb=_0x10518d['getRange'](),_0x3fe32a=_0x248dda['editing']['view']['getDomRoot'](_0x336eeb['root']['rootName'])||_0x248dda['editing']['view']['getDomRoot']();if(!_0x3fe32a||!_0x336eeb)return null;let _0x3dd4a9=_0x336eeb['start']['parent'];for(;_0x3dd4a9['parent']&&!_0x3dd4a9['parent']['is']('rootElement');)_0x3dd4a9=_0x3dd4a9['parent'];if(!_0x3dd4a9||!_0x3dd4a9['name'])return null;const _0x2bedde=_0x3fe32a['querySelector']('[data-marker-id=\x22'+_0x5f2aa3['id']+'\x22]');if(!_0x2bedde)return null;if(_0x3dd4a9['is']('rootElement'))return _0x2bedde;let _0x10210b=null;_0x248dda['model']['change'](_0x216bc3=>{_0x10210b=_0x216bc3['createDocumentFragment'](),_0x216bc3['append'](_0x3dd4a9['_clone'](!0x0),_0x10210b);});const _0x9b51c6=_0x248dda['data']['toView'](_0x10210b)['getChild'](0x0);return _0x2bedde['closest'](_0x9b51c6['name']);}reactivateMarkers(_0x5a4dc3){const _0x3ae9b9=this['_getMarkersDataForGroup'](_0x5a4dc3);if(!_0x3ae9b9['length'])return;const _0xf4ac95=Array['from'](this['_activeMarkers'])['sort'](),_0x4f5e1c=Array['from'](new Set(_0x3ae9b9['map'](_0x3cc7c5=>_0x3cc7c5['id'])))['sort']();_0xf4ac95['join']('|')!==_0x4f5e1c['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x5a4dc3));}setMarkersInElementAsActive(_0x4a81c2){const _0x2c547f=this['_getMarkersDataForGroup'](_0x4a81c2);if(!_0x2c547f['length'])return;const _0x248f5f=_0x2c547f[0x0]['editor'],_0x332796=new Set(_0x2c547f['map'](_0x75d9e2=>_0x75d9e2['id'])),_0x3008af=Array['from'](_0x332796['values']())['map'](_0x4c39b8=>_0x248f5f['model']['markers']['get'](_0x4c39b8))['filter'](_0x5f573d=>!!_0x5f573d);_0x332796['forEach'](_0x272500=>{this['_activeMarkers']['add'](_0x272500);}),_0x248f5f['model']['change'](()=>{_0x3008af['forEach'](_0x3bf184=>{_0x248f5f['editing']['reconvertMarker'](_0x3bf184);});});}setAllMarkersAsInactive(){const _0x528c61=Array['from'](this['_activeMarkers']);if(!_0x528c61['length'])return;this['_activeMarkers']['clear']();const _0xad6872=new Map();for(const _0x38a59b of _0x528c61){const _0x1897ee=this['_markers']['get'](_0x38a59b);if(!_0x1897ee)continue;const _0x525076=_0x1897ee['editor'],_0x28da1f=_0x525076['model']['markers']['get'](_0x38a59b);_0x28da1f&&(_0xad6872['has'](_0x525076)||_0xad6872['set'](_0x525076,[]),_0xad6872['get'](_0x525076)['push'](_0x28da1f));}for(const [_0x2fafd5,_0x1edbef]of _0xad6872)_0x2fafd5['model']['change'](()=>{_0x1edbef['forEach'](_0x279399=>{_0x2fafd5['editing']['reconvertMarker'](_0x279399);});});}_getTrailingSoftBreaks(_0x466a83){const _0x2ca237=Array['from'](_0x466a83['getChildren']());let _0x3c9a69=_0x2ca237['length'];const _0x117bcd=_0x2ca237[_0x3c9a69-0x1];_0x117bcd&&_0x117bcd['is']('$text')&&''===_0x117bcd['data']['trim']()&&_0x3c9a69--;let _0x1fa1f1=_0x3c9a69;for(;_0x1fa1f1>0x0&&_0x2ca237[_0x1fa1f1-0x1]['is']('element','softBreak');)_0x1fa1f1--;return _0x2ca237['slice'](_0x1fa1f1,_0x3c9a69);}_getPositionLimitingRange(_0x4cc9de,_0x18a6a5,_0x2c1f1e='outside'){if(!_0x4cc9de)return null;let _0x18914a=_0x4cc9de['parent'];for(;_0x18914a&&_0x18914a['parent']&&!_0x18914a['parent']['is']('rootElement')&&!_0x18a6a5['model']['schema']['isLimit'](_0x18914a)&&!_0x18a6a5['model']['schema']['isBlock'](_0x18914a);)_0x18914a=_0x18914a['parent'];if(!_0x18914a||!_0x18914a['name']||_0x18914a['is']('rootElement'))return null;let _0x425626=null;return _0x18a6a5['model']['change'](_0x2368cc=>{_0x425626='inside'===_0x2c1f1e?_0x2368cc['createRangeIn'](_0x18914a):_0x2368cc['createRangeOn'](_0x18914a);}),_0x425626;}_validateMarkers(_0x22d91b,_0xddc999){const _0x1bc6ce=Array['from'](this['_markers']['keys']()),_0x5c0465=new Map();for(const _0x55f73e of _0x1bc6ce){const _0x29abe6=_0x22d91b['model']['markers']['get'](_0x55f73e);if(!_0x29abe6)continue;const _0x3c9865=_0x29abe6['getStart']()['root']['rootName']+':'+_0x29abe6['getStart']()['path'][0x0];_0x5c0465['has'](_0x3c9865)||_0x5c0465['set'](_0x3c9865,[]),_0x5c0465['get'](_0x3c9865)['push'](_0x29abe6);}const _0x2b284d=new Set();for(const _0x163111 of _0x22d91b['model']['document']['differ']['getChanges']()){let _0x402c36,_0x2846b4;if('insert'===_0x163111['type'])_0x2846b4=new _0x3e534d(_0x163111['position'],_0x163111['position']['getShiftedBy'](_0x163111['length'])),_0x402c36=_0x163111['position']['root']['rootName']+':'+_0x163111['position']['path'][0x0];else{if('remove'!==_0x163111['type'])continue;_0x2846b4=new _0x3e534d(_0x163111['position']),_0x402c36=_0x163111['position']['root']['rootName']+':'+_0x163111['position']['path'][0x0];}const _0x4d0641=_0x5c0465['get'](_0x402c36)||[];if(_0x4d0641['length']){for(const _0x4d7691 of _0x4d0641)if(_0x2846b4['root']['rootName']===_0x4d7691['getRange']()['root']['rootName']&&('insert'!==_0x163111['type']||!_0x2846b4['containsRange'](_0x4d7691['getRange']()))&&(_0x2846b4['isIntersecting'](_0x4d7691['getRange']())||_0x2846b4['start']['isTouching'](_0x4d7691['getRange']()['end'])||_0x2846b4['end']['isTouching'](_0x4d7691['getRange']()['start']))){const _0x26dd47=this['_parseMarkerName'](_0x4d7691['name']);Array['from'](this['_markers']['values']())['filter'](_0x1a7119=>_0x1a7119['groupId']===_0x26dd47['groupId'])['forEach'](_0x3bfe28=>_0x2b284d['add'](_0x3bfe28['id']));}}}if(_0x2b284d['size']){for(const _0x27bc37 of _0x2b284d)_0xddc999['removeMarker'](_0x27bc37);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x21afbf){for(const {name:_0x115e4a,data:_0x1dbe46}of _0x21afbf['model']['document']['differ']['getChangedMarkers']()){if(!_0x115e4a['startsWith'](Wc))continue;const _0x4a67f1=_0x1dbe46['oldRange'],_0x5b34df=_0x1dbe46['newRange'],_0x458b93=_0x4a67f1&&'$graveyard'===_0x4a67f1['root']['rootName'],_0x2dd06a=_0x5b34df&&'$graveyard'===_0x5b34df['root']['rootName'];if(_0x458b93&&_0x2dd06a)continue;const _0x279e5b=this['_parseMarkerName'](_0x115e4a);this['_markers']['get'](_0x115e4a)&&(_0x2dd06a||!_0x5b34df?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x115e4a,'changeId':_0x279e5b['groupId']}):_0x458b93&&_0x5b34df&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x115e4a,'changeId':_0x279e5b['groupId']}));}}['_parseMarkerName'](_0x5b2271){const _0x16327e=_0x5b2271['split'](':'),_0x431668=(_0x16327e[0x1]||'')['split']('_');return{'prefix':_0x16327e[0x0],'groupId':_0x431668[0x0],'suffix':_0x431668[0x1]};}_translateOperationToEditorContent(_0x50e9b2,_0xec79f4,_0x44a1d5){if('insert'===_0x50e9b2['type']){const _0x5c9ec8=_0x50e9b2;return new _0x596b48(this['_changePosition'](_0xec79f4['concat'](_0x5c9ec8['position']['offset']),_0x44a1d5),_0x5c9ec8['nodes'],_0x5c9ec8['baseVersion']);}if('marker'===_0x50e9b2['type']&&_0x50e9b2['name']['startsWith']('$markedRemove')){const _0xf5d9c6=_0x50e9b2;return new _0x4226e6(_0xf5d9c6['name'],_0xf5d9c6['oldRange'],this['_changeRange'](_0xf5d9c6['newRange'],_0xec79f4['concat'](_0xf5d9c6['newRange']['start']['offset']),_0xec79f4['concat'](_0xf5d9c6['newRange']['end']['offset']),_0x44a1d5),_0xf5d9c6['_markers'],_0xf5d9c6['affectsData'],_0xf5d9c6['baseVersion']);}return _0x50e9b2;}_groupAdjacentOperations(_0x13f635){if(!_0x13f635['length'])return[];const _0x1ddd53=[];let _0x1e4ded=0x0,_0x3c7bc2=0x0,_0x3abeef=[];for(let _0x23b8f8=0x0;_0x23b8f8<=_0x13f635['length'];_0x23b8f8++){const _0x4feef3=_0x13f635[_0x23b8f8],_0x38ef02=_0x13f635[_0x23b8f8-0x1];!_0x4feef3||_0x38ef02&&!this['_getOperationEnd'](_0x38ef02)['isTouching'](this['_getOperationStart'](_0x4feef3))?(_0x1ddd53['push']({'operations':_0x3abeef,'operationsIsolated':_0x3abeef['map'](_0x9e1c05=>this['_shiftOperation'](_0x9e1c05['clone'](),-_0x3c7bc2)),'groupOffset':_0x1e4ded}),_0x3abeef=_0x4feef3?[_0x4feef3]:[],_0x3c7bc2+=_0x1e4ded,_0x1e4ded=0x0):_0x3abeef['push'](_0x4feef3),_0x4feef3&&'insert'===_0x4feef3['type']&&(_0x1e4ded+=_0x4feef3['howMany']);}return _0x1ddd53;}_findAdjacentContextDistance(_0x1563c3,_0x5ce3cd,_0x3ca3de,_0x2103da=0x1){const _0x5db7c7=new _0x2e5c20({'startPosition':_0x1563c3,'direction':_0x5ce3cd});let _0x320af5=0x0;for(let _0x3b17f3=0x0;_0x3b17f3<_0x2103da;_0x3b17f3++){let _0x29a755=0x0,_0x499e67=!0x1,_0x124e34='forward'===_0x5ce3cd?/^\W*\w+/:/\w+\W*$/;for(const {item:_0xfa8255}of _0x5db7c7)if(_0xfa8255['is']('$textProxy')){const _0x5b5bfd=_0x124e34['exec'](_0xfa8255['data']);if(_0x5b5bfd&&_0x5b5bfd['length']){if(_0x29a755+='forward'===_0x5ce3cd?_0x5b5bfd['index']+_0x5b5bfd[0x0]['length']:_0xfa8255['data']['length']-_0x5b5bfd['index'],_0x5b5bfd[0x0]['length']!==_0xfa8255['data']['length'])break;_0x499e67=!0x0,_0x124e34='forward'===_0x5ce3cd?/^\w+/:/\w+$/;}else{if(_0x499e67)break;_0x29a755+=_0xfa8255['offsetSize'];}}else{if(_0xfa8255['is']('element')){_0x3ca3de['isInline'](_0xfa8255)&&!_0x499e67&&(_0x29a755+=0x1);break;}}_0x320af5+=_0x29a755,_0x5db7c7['jumpTo'](_0x1563c3['getShiftedBy']('forward'===_0x5ce3cd?_0x320af5:-_0x320af5));}return _0x320af5;}_getChangeContext(_0x51467b,_0x41d831,_0xe90897){const _0x68f74c=_0xe90897['model']['schema'],_0x1120bf=this['_findAdjacentContextDistance'](_0x51467b,'backward',_0x68f74c,0x6),_0x501541=this['_findAdjacentContextDistance'](_0x41d831,'forward',_0x68f74c,0x6),_0x44e9e3=_0x51467b['getShiftedBy'](-_0x1120bf),_0x4b8a2d=_0x41d831['getShiftedBy'](_0x501541);return{'start':_0x44e9e3,'end':_0x4b8a2d,'hasContentBefore':!_0x44e9e3['isAtStart'],'hasContentAfter':!_0x4b8a2d['isAtEnd']};}_insertMarkers(_0x5f1184,_0x419092){const _0x684f2d=this['context']['plugins']['get']('AIEditing'),_0x4c205a=new Set();_0x419092['model']['change'](_0x1fe7c9=>{for(const _0x59f7e3 of _0x5f1184){const _0x650238=''+Wc+_0x59f7e3['type']+':'+_0x59f7e3['groupId']+'_'+_0x684f2d['_nextDataId'](_0x4c205a);this['_markers']['set'](_0x650238,{'id':_0x650238,'groupId':_0x59f7e3['groupId'],'type':_0x59f7e3['type'],'content':_0x59f7e3['content'],'editor':_0x419092}),_0x1fe7c9['addMarker'](_0x650238,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1fe7c9['createRange'](_0x59f7e3['start'],_0x59f7e3['end'])});}});}_createGetContextFn(_0x238c3a,_0x34c11a,_0x3394a9){let _0x953e77='';return()=>{if(!_0x953e77){const _0x3a0075=_0x34c11a['toView'](_0x238c3a,{'showSuggestionHighlights':!0x0});let _0x5de3e7=_0x3a0075['getChild'](0x0);if(_0x5de3e7['is']('containerElement')||(_0x5de3e7=_0x3a0075),!_0x5de3e7)return'';let _0x598833=!0x1;const _0x574f65=[];for(const _0x473911 of _0x5de3e7['getChildren']())_0x473911['is']('element','span')&&_0x473911['hasClass']('ck-ai_review-marker_context-end')&&(_0x598833=!0x1),_0x598833&&_0x574f65['push'](_0x473911),_0x473911['is']('element','span')&&_0x473911['hasClass']('ck-ai_review-marker_context-start')&&(_0x598833=!0x0);_0x5de3e7['_removeChildren'](0x0,_0x5de3e7['childCount']),_0x3394a9?.['ellipsisBefore']&&_0x5de3e7['_appendChild']('…'),_0x5de3e7['_appendChild'](_0x574f65),_0x3394a9?.['ellipsisAfter']&&_0x5de3e7['_appendChild']('…');const _0x345d58=_0x34c11a['htmlProcessor']['domConverter']['viewToDom'](_0x3a0075),_0xed4dd0=_0x34c11a['htmlProcessor']['htmlWriter']['getHtml'](_0x345d58);_0x953e77=this['_removeUnsupportedElements'](_0xed4dd0);}return _0x953e77;};}_createGetContentFn(_0xf1010,_0x21e88f){let _0x1b1869='';return()=>(_0x1b1869||(_0x1b1869=this['_removeUnsupportedElements'](_0x21e88f['stringify'](_0xf1010,{'showSuggestionHighlights':!0x0}))),_0x1b1869);}_createGetContentUsingDataIdFn(_0x4afc81,_0x2c9c02,_0x1652ec){let _0x196af3='';return()=>{if(!_0x196af3){const _0x4dbb31=_0x1652ec['toView'](new _0x3a5946(_0x4afc81));_0x196af3=_0x1652ec['htmlProcessor']['domConverter']['viewToDom'](_0x4dbb31)['querySelector']('[data-id=\x22'+_0x2c9c02+'\x22]')?.['outerHTML']||'';}return _0x196af3;};}_removeUnsupportedElements(_0x59e562){if(!_0x59e562)return'';const _0xa40a7d=en(_0x59e562,{'decodeEntities':!0x1}),_0x13a743=on(_0xa40a7d);if(!_0x13a743['length'])return _0x59e562;for(const _0xc1d12 of _0x13a743)_0x20a4a8(_0xc1d12);return sn(_0xa40a7d,{'encodeEntities':!0x1});}_neutralizeChangesOnUnsupportedElements(_0x83eacc,_0x2694f3){const _0x40404a=en(_0x83eacc,{'decodeEntities':!0x1}),_0x49fc3b=en(_0x2694f3,{'decodeEntities':!0x1}),_0x3434a6=on(_0x40404a),_0x24571d=on(_0x49fc3b);if(!_0x3434a6['length']&&!_0x24571d['length'])return{'contentInitial':_0x83eacc,'contentNew':_0x2694f3};const _0xbcf305=new Map(),_0x3b1240=new Map();for(const _0x579917 of _0x3434a6){const _0x3e11ed=ln(_0x579917,'data-id');if(_0x3e11ed)_0xbcf305['set'](_0x3e11ed,_0x579917);else{const _0x69be3d=sn(_0x579917,{'encodeEntities':!0x1}),_0x37dd92=_0x3b1240['get'](_0x69be3d);_0x37dd92?_0x37dd92['push'](_0x579917):_0x3b1240['set'](_0x69be3d,[_0x579917]);}}for(const _0x2594dc of _0x24571d){const _0x2b4b0c=ln(_0x2594dc,'data-id');let _0x4b5438;if(_0x2b4b0c)_0x4b5438=_0xbcf305['get'](_0x2b4b0c);else{const _0x158cd9=_0x3b1240['get'](sn(_0x2594dc,{'encodeEntities':!0x1}));_0x4b5438=_0x158cd9&&_0x158cd9['length']?_0x158cd9['shift']():void 0x0;}_0x4b5438?_0x1a0dae(_0x2594dc,_0x26ae61(_0x4b5438,!0x0)):_0x20a4a8(_0x2594dc);}return{'contentInitial':sn(_0x40404a,{'encodeEntities':!0x1}),'contentNew':sn(_0x49fc3b,{'encodeEntities':!0x1})};}_findMarkerElement(_0x598cae,_0x3ce923=0x5){let _0x111e8e=_0x598cae,_0x4d5b69=null;for(let _0x437cda=0x0;_0x437cda<_0x3ce923&&_0x111e8e;_0x437cda++)if(_0x111e8e instanceof HTMLElement&&_0x111e8e['className']){if((''+_0x111e8e['className'])['includes']('ck-ai_review-marker_')){if(!_0x111e8e['getAttribute']('data-marker-id'))break;_0x4d5b69=_0x111e8e;break;}_0x111e8e=Lt(_0x111e8e);}else _0x111e8e=Lt(_0x111e8e);return _0x4d5b69;}_findMarkerElementById(_0x12e728){const _0x2aaed1=this['_markers']['get'](_0x12e728);if(!_0x2aaed1)return null;const _0xf4a0b1=_0x2aaed1['editor']['model']['markers']['get'](_0x12e728);return _0xf4a0b1?_0x4fcc06(_0x2aaed1['editor']['editing'],_0xf4a0b1):null;}_getMarkersDataForGroup(_0x39d6ec){return Array['from'](this['_markers']['values']())['filter'](_0x80a1a6=>_0x80a1a6['groupId']===_0x39d6ec);}_getOperationStart(_0x4aba16){return'insert'===_0x4aba16['type']?_0x4aba16['position']:_0x4aba16['newRange']['start'];}_getOperationEnd(_0x57ed51,_0x57492b=!0x1){return'insert'===_0x57ed51['type']?_0x57492b?_0x57ed51['position']:_0x57ed51['position']['getShiftedBy'](_0x57ed51['howMany']):_0x57ed51['newRange']['end'];}_shiftOperation(_0x41a0d3,_0x6c6d67){return'insert'===_0x41a0d3['type']?_0x41a0d3['position']=_0x41a0d3['position']['getShiftedBy'](_0x6c6d67):'marker'===_0x41a0d3['type']&&_0x41a0d3['newRange']&&(_0x41a0d3['newRange']=new _0x3e534d(_0x41a0d3['newRange']['start']['getShiftedBy'](_0x6c6d67),_0x41a0d3['newRange']['end']['getShiftedBy'](_0x6c6d67))),_0x41a0d3;}_changeOperationOwnerDocument(_0x479ce3,_0x32f69f){'insert'===_0x479ce3['type']?_0x479ce3['position']=this['_changePositionOwnerDocument'](_0x479ce3['position'],_0x32f69f):'marker'===_0x479ce3['type']&&_0x479ce3['newRange']&&(_0x479ce3['newRange']=this['_changeRangeOwnerDocument'](_0x479ce3['newRange'],_0x32f69f));}_changePositionOwnerDocument(_0x4b059f,_0x4491ab){return new _0x22fec2(_0x4491ab,_0x4b059f['path']);}_changeRangeOwnerDocument(_0xdfbe66,_0x3a6518){return new _0x3e534d(this['_changePositionOwnerDocument'](_0xdfbe66['start'],_0x3a6518),this['_changePositionOwnerDocument'](_0xdfbe66['end'],_0x3a6518));}_changePosition(_0x3b6ae1,_0x7427c7){return new _0x22fec2(_0x7427c7,[..._0x3b6ae1]);}_clampPositionToParent(_0x5f31c3){const _0x3e3d74=_0x5f31c3['parent'];return!_0x3e3d74['is']('element')||_0x5f31c3['offset']<=_0x3e3d74['maxOffset']?_0x5f31c3:_0x22fec2['_createAt'](_0x3e3d74,_0x3e3d74['maxOffset']);}['_changeRange'](_0x69dcb0,_0x2ca09d,_0x1f3811,_0x12b5e2){return new _0x3e534d(this['_changePosition'](_0x2ca09d,_0x12b5e2),this['_changePosition'](_0x1f3811,_0x12b5e2));}_sortMarkers(_0x450600){const _0x3d7e03=_0x3a0fe1=>{switch(_0x3a0fe1){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x450600['sort']((_0x4aa4cd,_0x21269c)=>_0x3d7e03(_0x4aa4cd['type'])-_0x3d7e03(_0x21269c['type']));}_hasSameTopLevelElement(_0x5cd3c5,_0x12d836){const _0x3f02e8=_0x5cd3c5['getChild'](0x0),_0x431a03=_0x12d836['getChild'](0x0);return!(!_0x3f02e8||!_0x431a03)&&((!_0x3f02e8['is']('element')||!_0x431a03['is']('element')||_0x3f02e8['name']===_0x431a03['name'])&&!(_0x3f02e8['is']('element')&&!_0x431a03['is']('element')||!_0x3f02e8['is']('element')&&_0x431a03['is']('element')));}_haveSingleTopLevelElement(_0x244520){return 0x1===_0x244520['childCount'];}_haveOnlyInlineContent(_0x3097f7,_0x545c53){for(const _0x2c34fa of _0x3097f7['getChildren']())if(_0x2c34fa['is']('element')&&!_0x545c53['isInline'](_0x2c34fa))return!0x1;return!0x0;}_upsertDataId(_0x331d7c,_0x4df20a){let _0x12f937=_0x331d7c['getAttribute'](Vn);return _0x12f937||(_0x12f937=_0x4df20a(),_0x331d7c['_setAttribute'](Vn,_0x12f937)),_0x12f937;}};const Yc=/* #__PURE__ -- @preserve */
|
|
38
|
+
It();var qc=class extends Yc{['id'];contentNew;contentInitial;documentVersion;constructor({id:_0x76fb18,contentNew:_0x4df7c7,contentInitial:_0x28c0aa,documentVersion:_0x11e063}){super(),this['id']=_0x76fb18,this['contentNew']=_0x4df7c7,this['contentInitial']=_0x28c0aa,this['documentVersion']=_0x11e063;}};const Qc=/* #__PURE__ -- @preserve */
|
|
39
|
+
mt();var Xc=class extends Qc{['id'];parent;editor;_data;_editorOperations=[];constructor(_0x263e6a,_0xfd4127,_0x1f70ab,_0x4f547f){super(),this['id']=_0x263e6a,this['parent']=_0x1f70ab,this['editor']=_0x4f547f,this['_data']=_0xfd4127,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']['wrapperTag']?function(_0x1f11a0){const _0x5d4437=en(_0x1f11a0)['children']['filter'](_0x350de8);return 0x1!==_0x5d4437['length']?_0x1f11a0:_0x5d4437[0x0]['children']['map'](_0x2c3bd1=>sn(_0x2c3bd1))['join']('');}(this['_data']['context']()):this['_data']['context']();}get['wrapperTag'](){return this['_data']['wrapperTag'];}get operations(){return this['_data']['operations']['slice']();}get operationsIsolated(){return this['_data']['operationsIsolated']['slice']();}};const zc=/* #__PURE__ -- @preserve */
|
|
40
|
+
mt();var jc=class extends zc{get['isUnresolved'](){return'initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['pendingChangesCount']>0x0;}['id']=Xt();['callId'];_results=new Map();['_changes']=[];_hasUnsupportedInlineChange=!0x1;['_sourceCheck'];_documentData;_aiConnector;['_reviewParams'];['_reviewArgs'];_context;_activeRequest=null;_currentError;_wasAborted=!0x1;constructor(_0x36135e,_0x598458,_0x27f5f0,_0x30dace,_0x174863,_0x4244e4=new nr()){super(),this['_sourceCheck']=_0x598458,this['_documentData']=_0x36135e,this['_aiConnector']=_0x27f5f0,this['_reviewParams']=_0x30dace,this['_reviewArgs']=_0x174863,this['_context']=_0x4244e4,this['on']('change:status',(_0x5a43bb,_0xc15b7b,_0x48345c)=>{'aborted'==_0x48345c&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x48345c,'run':this,'error':this['_currentError']});}),this['set']('status','initialized');}get documentData(){return this['_documentData'];}get['sourceCheck'](){return this['_sourceCheck'];}get processedResultsCount(){return this['_results']['size'];}get hasUnsupportedInlineChange(){return this['_hasUnsupportedInlineChange'];}get title(){return this['_sourceCheck']['title'];}get subTitle(){return'';}get['reviewName'](){return this['_sourceCheck']['id'];}get hasModifications(){return!this['_changes']['every'](_0x23782e=>'pending'===_0x23782e['status']);}get currentError(){return this['_currentError'];}get results(){return Array['from'](this['_results']['values']());}updateDocumentData(_0x57eaa2){this['_documentData']=_0x57eaa2;}async start(){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x40eb51=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x572195 of _0x40eb51)'unmodified'!==_0x572195['data']['operation']&&('error'!==_0x572195['data']['operation']?'review-metadata'!==_0x572195['event']?this['_addReviewCheckResult'](_0x572195['data']['dataId'],_0x572195['data']['textDelta']):this['callId']=_0x572195['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(_0x51ae55){this['_currentError']=_0x51ae55,lr(_0x51ae55)?this['status']='aborted':this['status']='error-general';}finally{this['_activeRequest']=null;}}async restart(){this['_results']['clear'](),this['_changes']['length']=0x0,this['_currentError']=void 0x0,this['_hasUnsupportedInlineChange']=!0x1,await this['start']();}addResultChanges(_0x53c3c9,_0x5ea587){const _0x5e0497=this['_results']['get'](_0x53c3c9);if(!_0x5e0497)return;if(0x0===_0x5ea587['length'])return;const _0x5d1344=this['_documentData']['elements']['get'](_0x53c3c9);if(!_0x5d1344)return;const _0x367063=[];_0x5ea587['forEach']((_0x466345,_0x2d6c02)=>{const _0x434784=new Xc(_0x5e0497['id']+'-'+_0x2d6c02,_0x466345,_0x5e0497,_0x5d1344['editor']);_0x434784['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x434784,'status':_0x434784['status']});}),_0x434784['on']('change:isActivated',()=>{_0x434784['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x434784}):this['fire']('reviewCheckResultDeactivated',{'change':_0x434784});}),this['_changes']['push'](_0x434784),_0x367063['push'](_0x434784);}),this['fire']('reviewCheckResultReady',{'changes':_0x367063,'result':_0x5e0497,'source':this});}abort(){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}isChangeActive(_0x1be85e){const _0x2e4af0=this['_changes']['find'](_0x4a07c2=>_0x4a07c2['id']===_0x1be85e);return!(!_0x2e4af0||'pending'!==_0x2e4af0['status']);}isAnyChangeActivated(){return this['_changes']['some'](_0x513be8=>!0x0===_0x513be8['isActivated']);}getActiveChanges(){return this['_changes']['filter'](_0x51d48d=>'pending'===_0x51d48d['status']);}getChangeById(_0x45c5a8){return this['_changes']['find'](_0x573ebe=>_0x573ebe['id']===_0x45c5a8);}getChangePosition(_0xedc026){return this['_changes']['findIndex'](_0x149e8d=>_0x149e8d['id']===_0xedc026)+0x1;}get totalChangesCount(){return this['_changes']['length'];}get pendingChangesCount(){return this['getActiveChanges']()['length'];}get reviewedChangesCount(){return this['totalChangesCount']-this['pendingChangesCount'];}markAllChangesAsAccepted(){for(const _0x169e04 of this['_changes'])'pending'===_0x169e04['status']&&(_0x169e04['status']='accepted');this['_checkIfFinished']();}markAllChangesAsRejected(){for(const _0x1b679f of this['_changes'])'pending'===_0x1b679f['status']&&(_0x1b679f['status']='rejected');this['_checkIfFinished']();}markChangeAsAccepted(_0x3b536b){const _0x565163=this['_changes']['find'](_0x5dc040=>_0x5dc040['id']===_0x3b536b);_0x565163&&'pending'===_0x565163['status']&&(_0x565163['status']='accepted'),this['_checkIfFinished']();}markChangeAsRejected(_0x599714){const _0x1651bc=this['_changes']['find'](_0x25b29d=>_0x25b29d['id']===_0x599714);_0x1651bc&&'pending'===_0x1651bc['status']&&(_0x1651bc['status']='rejected'),this['_checkIfFinished']();}markChangeAsOutdated(_0x421922){const _0x56d2e1=this['_changes']['find'](_0x4a09c0=>_0x4a09c0['id']===_0x421922);_0x56d2e1&&'pending'===_0x56d2e1['status']&&(_0x56d2e1['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x443fdb){const _0x1bb25c=this['_changes']['find'](_0x2b3da4=>_0x2b3da4['id']===_0x443fdb);_0x1bb25c&&'outdated'===_0x1bb25c['status']&&(_0x1bb25c['status']='pending'),this['_checkIfFinished']();}activateChange(_0x44c3c2){this['_changes']['filter'](_0x2fc401=>_0x2fc401['isActivated']&&_0x2fc401['id']!==_0x44c3c2)['forEach'](_0x5669c9=>{_0x5669c9['isActivated']=!0x1;});const _0x5af835=this['_changes']['find'](_0x5ad617=>_0x5ad617['id']===_0x44c3c2);_0x5af835&&'pending'===_0x5af835['status']&&(_0x5af835['isActivated']=!0x0);}deactivateChange(){this['_changes']['filter'](_0x3fb37a=>_0x3fb37a['isActivated'])['forEach'](_0x286229=>{_0x286229['isActivated']=!0x1;});}forceReadyState(){this['status']='ready';}async sendRating(_0x5b92bc){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x24be88;if(_0x5b92bc){const _0x4514f3=this['_changes']['find'](_0x6bc0de=>_0x6bc0de['id']===_0x5b92bc);if(_0x4514f3&&_0x4514f3['isRated'])return;_0x4514f3&&(_0x24be88=_0x4514f3['parent']['id'],_0x4514f3['isRated']=!0x0);}const _0x4ecdcd={'positiveCount':this['_changes']['filter'](_0x4e493a=>'accepted'===_0x4e493a['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x4ecdcd,this['callId'],_0x24be88);}_addReviewCheckResult(_0x4def26,_0x363f73){const _0xe99a75=this['_documentData']['elements']['get'](_0x4def26);if(!_0xe99a75)return;if(En(_0xe99a75['editor'],_0xe99a75['rootName'])&&!wn(_0xe99a75['editor'],en(_0x363f73)))return void(this['_hasUnsupportedInlineChange']=!0x0);const _0x4d7ea5=_0xe99a75['getContent']();if(_0x4d7ea5===_0x363f73)return;const _0x213b87=new qc({'id':_0x4def26,'contentInitial':_0x4d7ea5,'contentNew':_0x363f73,'documentVersion':_0xe99a75['documentVersion']});this['_results']['set'](_0x213b87['id'],_0x213b87),this['fire']('reviewCheckResultAdded',{'result':_0x213b87,'source':this,'editor':_0xe99a75['editor'],'rootName':_0xe99a75['rootName']});}['_checkIfFinished'](){'finished'===this['status']&&this['_changes']['filter'](_0x540687=>'pending'===_0x540687['status'])['length']>0x0&&(this['status']='ready'),'ready'===this['status']&&0x0===this['_changes']['filter'](_0x35ffee=>'pending'===_0x35ffee['status'])['length']&&(this['status']='finished');}},Jc=class extends jc{get subTitle(){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x11cf03=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x1dd34e=0x0;_0x1dd34e<this['_reviewParams']['length'];_0x1dd34e++){if(!this['_reviewParams'][_0x1dd34e]||!this['_sourceCheck']['options'][_0x1dd34e])continue;const _0x495175=this['_sourceCheck']['options'][_0x1dd34e]['data']?.['find'](_0x1badf8=>_0x1badf8['id']===this['_reviewParams'][_0x1dd34e]);_0x495175&&_0x11cf03['push'](_0x495175['label']);}return _0x11cf03['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}_createApiRequest(){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs'],'contexts':this['_context']['toRequestContexts']()});}_sendRatingRequest(_0x32a109,_0x108a14,_0xfff85a){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x108a14,_0x32a109,_0xfff85a);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}},Zc=class extends _0x4f3978{_aiConnector;['_aiTabs'];['_aiReviewCoreUi'];_aiReviewCoreEditing;['_availableReviewChecks'];_reporter;_currentReviewCheckRun;_changeActivationSource=null;_shouldAcceptAsSuggestion(){return!0x1;}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['_initRequiredPlugins'](),this['_initAvailableReviewChecks'](),this['_initUIListeners']();}async _initAvailableReviewChecks(){try{this['_availableReviewChecks']=await this['_getReviewChecks'](),this['_aiReviewCoreUi']['setAvailableChecks'](this['_availableReviewChecks']);}finally{this['_aiReviewCoreUi']['toggleLoadingSkeleton'](!0x1);}}_initUIListeners(){this['listenTo'](this['_aiReviewCoreUi'],'getReviewCheckList',()=>{this['_availableReviewChecks']&&this['_aiReviewCoreUi']['setAvailableChecks'](this['_availableReviewChecks']);}),this['listenTo'](this['_aiReviewCoreUi'],'runReviewCheck',(_0x30df98,_0x2d7da9)=>this['runCheck'](_0x2d7da9)),this['listenTo'](this['_aiReviewCoreUi'],'leaveReview',()=>{this['_onReviewRunLeave']();}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReviewCoreResultList',()=>{this['_currentReviewCheckRun']?.['isUnresolved']?this['_aiReviewCoreUi']['showLeaveConfirmationDialog'](this['_leaveConfirmationDialogOptions'],()=>{this['_onReviewRunLeave'](!0x0);}):this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'abortReviewStream',()=>this['abort']()),this['listenTo'](this['_aiReviewCoreUi'],'finishReview',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x3e6ce0=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x3e6ce0['length'])return;this['_shouldAcceptAsSuggestion']()?this['_aiReviewCoreEditing']['applyChangesAsSuggestions'](_0x3e6ce0['map'](_0x1ee115=>_0x1ee115['id']),this['_aiSource']):this['_aiReviewCoreEditing']['applyChange'](_0x3e6ce0['map'](_0x5c23a0=>_0x5c23a0['id']),this['_aiSource']);const _0x138d61=this['_currentReviewCheckRun'];_0x138d61['markAllChangesAsAccepted'](),_0x138d61['sendRating'](),this['_leaveReviewAfterBulkAction']();}),this['listenTo'](this['_aiReviewCoreUi'],'rejectAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x484da0=this['_currentReviewCheckRun'],_0x542243=_0x484da0['getActiveChanges']();_0x542243['length']&&(this['_aiReviewCoreEditing']['rejectAllChanges'](_0x542243['map'](({id:_0x330cfd})=>_0x330cfd)),_0x484da0['markAllChangesAsRejected'](),_0x484da0['sendRating'](),this['_leaveReviewAfterBulkAction']());}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x2f6034,_0x187dcd)=>{if(!this['_currentReviewCheckRun']||!this['_currentReviewCheckRun']['isChangeActive'](_0x187dcd['id']))return;const _0x565965=this['_getPendingChangeIndex'](_0x187dcd['id']);this['_aiReviewCoreEditing']['applyChange']([_0x187dcd['id']],this['_aiSource']),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x187dcd['id']),this['_onChangeResolved'](_0x565965),this['_currentReviewCheckRun']['sendRating'](_0x187dcd['id']);}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x599e51,_0x24dab9)=>{if(!this['_currentReviewCheckRun']||!this['_currentReviewCheckRun']['isChangeActive'](_0x24dab9['id']))return;const _0x3aa6fb=this['_getPendingChangeIndex'](_0x24dab9['id']);this['_aiReviewCoreEditing']['rejectChange'](_0x24dab9['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x24dab9['id']),this['_onChangeResolved'](_0x3aa6fb),this['_currentReviewCheckRun']['sendRating'](_0x24dab9['id']);}),this['listenTo'](this['_aiReviewCoreUi'],'suggestChange',(_0x4ffba3,_0x29b78e)=>{if(!this['_currentReviewCheckRun']||!this['_currentReviewCheckRun']['isChangeActive'](_0x29b78e['changeId']))return;const _0x4b1ee4=this['_getPendingChangeIndex'](_0x29b78e['changeId']);this['_aiReviewCoreEditing']['applyChangesAsSuggestions']([_0x29b78e['changeId']],this['_aiSource']),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x29b78e['changeId']),this['_onChangeResolved'](_0x4b1ee4),this['_currentReviewCheckRun']['sendRating'](_0x29b78e['changeId']);}),this['listenTo'](this['_aiReviewCoreUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewCoreUi']['hideNavigationPanel'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreUi']['setHasPendingChanges'](!0x1),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewCoreEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewCoreUi'],'activateChange',(_0x3c528c,_0x45037c)=>{this['_onActivateChange'](_0x45037c);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x2000a7,_0x15fd54)=>{this['_onDeactivateChange'](_0x15fd54);}),this['listenTo'](this['_aiReviewCoreUi'],'navigateChange',(_0x2e907f,_0x324c75)=>{this['_onNavigateChange'](_0x324c75['direction']);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x461d4b,_0x32d3c7)=>{this['_onChangeMarkerClicked'](_0x461d4b,_0x32d3c7);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x24af05,_0xd5c09d)=>{this['_onChangeMarkerHovered'](_0x24af05,_0xd5c09d);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x162b90,_0x565549)=>{this['_onChangeMarkerRemoved'](_0x162b90,_0x565549);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x2c1fa1,_0x2992c6)=>{this['_onChangeMarkerRestored'](_0x2c1fa1,_0x2992c6);}),this['listenTo'](this['_aiTabs']['view'],'beforeActivateTab',(_0x55f1ae,{newTab:_0x2562c4,oldTab:_0x5be7ba,resolveActivation:_0x7d9b55})=>{_0x2562c4!==_0x5be7ba&&_0x5be7ba===this['_aiTabId']&&this['_currentReviewCheckRun']?.['isUnresolved']&&(_0x55f1ae['stop'](),this['_aiReviewCoreUi']['showLeaveConfirmationDialog'](this['_leaveConfirmationDialogOptions'],()=>{_0x7d9b55?_0x7d9b55(!0x0):this['_aiTabs']['view']['forceActivateTab'](_0x2562c4);},()=>{_0x7d9b55?.(!0x1);}));});}async['runCheck'](_0x28a3eb){if(this['_hideOpenDialog'](),!this['_availableReviewChecks'])return;const _0xc32544=this['_availableReviewChecks']['find'](_0x36be14=>_0x36be14['id']===_0x28a3eb['id']);if(!_0xc32544)return void this['_logError'](new dt('ai-review-mode-source-check-not-found',this,{'checkId':_0x28a3eb['id']}));this['_onReviewCheckRun'](_0x28a3eb),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_aiReviewCoreUi']['setHasPendingChanges'](!0x1);const _0x9900f9=this['context']['plugins']['get'](Js)['contextLibrary']['resolveContext']({'feature':this['_defaultContextFeature'],'ids':[_0x28a3eb['id']],'context':new nr()});this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x28a3eb,_0xc32544,_0x9900f9);const _0x185942=this['_currentReviewCheckRun'];_0x185942['on']('reviewCheckResultChangeStatusUpdated',(_0x1b07f9,_0x3cff53)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x3cff53['change']['id'],_0x3cff53['status']),this['_aiReviewCoreUi']['updateProgress'](_0x185942['reviewedChangesCount'],_0x185942['totalChangesCount']),this['_refreshNavigationPanelPosition'](),this['_pushHasPendingChanges'](_0x185942);}),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x5deaaf,_0x156dff)=>{switch(_0x156dff['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x156dff);break;case'finished':this['_onCheckRunFinished']();break;case'ready':this['_currentReviewCheckRun']?.['hasUnsupportedInlineChange']?this['_aiReviewCoreUi']['showUnsupportedInlineChangeView']():(this['_aiReviewCoreUi']['updateProgress'](this['_currentReviewCheckRun']['reviewedChangesCount'],this['_currentReviewCheckRun']['totalChangesCount']),this['_aiReviewCoreUi']['showActionsWhenResultIsReady']());break;case'unmodified':this['_currentReviewCheckRun']?.['hasUnsupportedInlineChange']?this['_aiReviewCoreUi']['showUnsupportedInlineChangeView']():this['_aiReviewCoreUi']['showNoChangesView']();break;case'error-general':this['_aiReviewCoreUi']['showGeneralResultsErrorView'](),this['_logError'](new dt('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new dt('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'!==_0x156dff['status']&&'error-chunk'!==_0x156dff['status']&&'error-general'!==_0x156dff['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x3f5ea5,_0xc96a18)=>{if(!this['_currentReviewCheckRun'])throw new dt('ai-review-mode-no-current-check-run',this);const _0x41393d=En(_0xc96a18['editor'],_0xc96a18['rootName']);let _0x324cfc=_0xc96a18['result']['contentInitial'],_0x515087=_0xc96a18['result']['contentNew'];_0x41393d&&(_0x324cfc=Tn(_0x324cfc),_0x515087=Tn(_0x515087));const _0x2b26b5=this['_diffContent'](_0xc96a18['editor'],_0x324cfc,_0x515087);if(_0x41393d){const _0xf9d747=_0xc96a18['editor']['ui']['getEditableElement'](_0xc96a18['rootName'])?.['tagName']['toLowerCase']();for(const _0xa52225 of _0x2b26b5)_0xa52225['wrapperTag']=_0xf9d747;}_0xc96a18['source']['addResultChanges'](_0xc96a18['result']['id'],_0x2b26b5);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x242491,_0x1fb06f)=>{for(const _0x152215 of _0x1fb06f['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x152215);this['_pushHasPendingChanges'](_0x1fb06f['source']),this['_markChangePositionInEditorContent'](_0x1fb06f['changes'],_0x1fb06f['source']['documentData']),this['_onReviewCheckResultsRendered'](),this['_refreshNavigationPanelPosition']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x58ac5e,_0x3f9341)=>{this['_onReviewCheckResultActivated'](_0x3f9341);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x21d1a1){if(lr(_0x21d1a1))return;_0x21d1a1 instanceof dt?this['_logError'](_0x21d1a1):this['_logError'](new dt('ai-review-mode-check-run-failed',this,void 0x0,_0x21d1a1));}}abort(){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}getAvailableChecks(){return(this['_availableReviewChecks']??[])['slice']();}getCurrentCheckRun(){return this['_currentReviewCheckRun'];}['_pushHasPendingChanges'](_0x1ae0bd){this['_aiReviewCoreUi']['setHasPendingChanges'](_0x1ae0bd['getActiveChanges']()['length']>0x0);}['_hideOpenDialog'](){this['_aiReviewCoreEditing']['getEditors']()['find'](_0x46195c=>_0x46195c['plugins']['has']('AIEditorIntegration'))?.['plugins']['get']('AIEditorIntegration')['dialog']['hide']();}_createReviewCheckRun(_0x4e699d,_0x14dc31,_0x3b913d=new nr()){return new Jc(this['_aiReviewCoreEditing']['getDocumentData'](),_0x14dc31,this['_aiConnector'],_0x4e699d['params'],_0x4e699d['args'],_0x3b913d);}_getNavigationPosition(_0x46d94a){const _0x2be916=this['_currentReviewCheckRun'];return{'index':_0x2be916?.['getChangePosition'](_0x46d94a)??0x0,'total':_0x2be916?.['totalChangesCount']??0x0,'pendingCount':_0x2be916?.['pendingChangesCount']??0x0};}_getPendingChangeIndex(_0x3e15f4){return(this['_currentReviewCheckRun']?.['getActiveChanges']()??[])['findIndex'](_0x4ebd02=>_0x4ebd02['id']===_0x3e15f4);}_refreshNavigationPanelPosition(){const _0xc28067=(this['_currentReviewCheckRun']?.['getActiveChanges']()['find'](_0x3478e9=>_0x3478e9['isActivated']))?.['id']??this['_aiReviewCoreUi']['getNavigationPanelChangeId']();_0xc28067&&this['_aiReviewCoreUi']['updateNavigationPanelPosition'](this['_getNavigationPosition'](_0xc28067));}_onNavigateChange(_0x1b8819){const _0x7eaf94=this['_currentReviewCheckRun']?.['getActiveChanges']()??[],_0x284c23=_0x7eaf94['findIndex'](_0x18a60d=>_0x18a60d['isActivated']);if(_0x7eaf94['length']<(-0x1===_0x284c23?0x1:0x2))return;const _0x4516a8=-0x1===_0x284c23?0x0:(_0x284c23+('next'===_0x1b8819?0x1:-0x1)+_0x7eaf94['length'])%_0x7eaf94['length'];this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x7eaf94[_0x4516a8]['id']);}['_onChangeResolved'](_0x151db4){const _0x5037a2=this['_currentReviewCheckRun'];if(!_0x5037a2?.['pendingChangesCount'])return void this['_aiReviewCoreUi']['hideNavigationPanel']();const _0x1b75c9=_0x5037a2['getActiveChanges'](),_0x575ce8=Math['max'](_0x151db4,0x0),_0x244285=_0x575ce8<_0x1b75c9['length']?_0x575ce8:0x0;this['_changeActivationSource']='panel',_0x5037a2['activateChange'](_0x1b75c9[_0x244285]['id']);}_onReviewCheckResultsRendered(){}['_onChangeMarkerRemoved'](_0x35925d,_0x4bcbc4){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x4bcbc4['changeId']);}_onChangeMarkerRestored(_0x4d61f3,_0x3abf71){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x3abf71['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['hideNavigationPanel'](),this['_aiReviewCoreUi']['showReviewCompletedView']();}_leaveReviewAfterBulkAction(){this['_currentReviewCheckRun']&&this['_onReviewRunLeave'](!0x0);}_initRequiredPlugins(){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_reporter']=this['context']['plugins']['get'](dr)['createReporter']('aireview'),this['_aiTabs']=this['context']['plugins']['get'](Ks);}['_onReviewRunLeave'](_0x5847a3=!0x1){this['_aiReviewCoreUi']['hideNavigationPanel'](),this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x5847a3&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;for(const _0x3d2474 of this['_aiReviewCoreEditing']['getEditors']())_0x3d2474['editing']['view']['change'](_0x1cf6db=>{for(const _0x2a35f2 of _0x3d2474['editing']['view']['document']['getRoots']())_0x1cf6db['removeClass']('ck-ai_review-diff',_0x2a35f2),_0x1cf6db['removeClass']('ck-ai_review-highlights',_0x2a35f2),_0x1cf6db['removeClass']('ck-ai-translate-mode-content',_0x2a35f2);});}['_logError'](_0x293cc2){this['_reporter']['logError'](_0x293cc2),'ai-review-mode-models-unable-to-retrieve'===function(_0xe6de71){return _0xe6de71 instanceof ur?_0xe6de71['code']:_0xe6de71 instanceof Error?_0xe6de71['message']['match'](/^\S+/)?.[0x0]:void 0x0;}(_0x293cc2)?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']();}['_scrollToChange'](_0x439213){if(!this['_changeActivationSource'])return;if(this['_aiReviewCoreUi']['scrollResultsToChange'](_0x439213),'content'===this['_changeActivationSource'])return;const _0x35175f=this['_getChangeContentElement'](_0x439213);_0x35175f&&Yt({'target':_0x35175f,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}},tl=class extends jc{_prompt;['_model'];constructor(_0x4dfc18,_0x2dc7fe,_0x5e13b8,_0x37298b,_0x5f117b,_0x25206b){super(_0x5e13b8,_0x37298b,_0x5f117b,void 0x0,void 0x0,_0x25206b),this['_prompt']=_0x4dfc18,this['_model']=_0x2dc7fe;}get subTitle(){return this['_prompt']??'';}_createApiRequest(){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],...void 0x0!==this['_prompt']&&{'prompt':this['_prompt']},'model':this['_model'],'contexts':this['_context']['toRequestContexts']()});}_sendRatingRequest(_0x279738,_0x1224e9,_0x34d51d){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x1224e9,_0x279738,_0x34d51d);}},el=class{['id'];['commandId'];title;description;isParameterized;['useArgs'];options;['args'];get['apiId'](){return this['commandId'];}constructor(_0x70ddbe){this['id']=_0x70ddbe['id'],this['commandId']=_0x70ddbe['commandId'],this['title']=_0x70ddbe['title'],this['description']=_0x70ddbe['description'],this['isParameterized']=_0x70ddbe['isParameterized'],this['useArgs']=_0x70ddbe['useArgs'],this['options']=_0x70ddbe['options'],this['args']=_0x70ddbe['args'];}},il=class extends el{isExtra=!0x0;prompt;context;['model'];_defaultModel=null;constructor(_0xfa75c3,_0x4f2134,_0x4eb1ea){super(_0xfa75c3),this['prompt']=_0xfa75c3['prompt'],this['context']=_0xfa75c3['context'],this['model']=_0xfa75c3['model'],this['model']?this['_defaultModel']=_0x4f2134['find'](_0x4a75bf=>_0x4a75bf['id']===this['model'])||null:this['_defaultModel']=_0x4eb1ea;}get defaultModel(){return this['_defaultModel'];}},sl=class extends tl{get subTitle(){return'';}set prompt(_0x2f104f){this['_prompt']=_0x2f104f;}set['model'](_0x4bea80){this['_model']=_0x4bea80;}},nl=class extends _0x4f3978{static get requires(){return[$s,dr];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_cache'];_reporter;init(){this['_reporter']=this['context']['plugins']['get'](dr)['createReporter']('aireview');}getChecksList(){return this['_cache']||(this['_cache']=this['_loadChecksList']()),this['_cache'];}};const rl=[{'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'}]}]}],ol=/* #__PURE__ -- @preserve */
|
|
41
|
+
mt();var al=class extends ol{['_checks']=[];setupChecks(_0x302a7b){this['_checks']=_0x302a7b['map'](_0x2eb4f7=>new el(_0x2eb4f7));}get['checks'](){return this['_checks']['slice']();}getCheckById(_0x2a0af6){return this['checks']['find'](_0x5725f0=>_0x5725f0['id']===_0x2a0af6);}['removeCheckById'](_0x3c4d47){this['_checks']=this['_checks']['filter'](_0x3ea36b=>_0x3ea36b['id']!==_0x3c4d47);}},hl=class extends el{['_models']=[];_defaultModel=null;constructor(_0x3e70ac,_0x176bce,_0x3bed76){super(_0x3e70ac),this['_models']=_0x176bce,this['_defaultModel']=_0x3bed76;}get['models'](){return this['_models']['slice']();}get defaultModel(){return this['_defaultModel'];}},cl=class extends al{['_allModels']=[];['_recommendedModels']=[];_defaultModel=null;constructor(_0x12fe6a,_0x21ffb6,_0x8b0e3e){super(),this['_allModels']=_0x12fe6a,this['_recommendedModels']=_0x21ffb6,this['_defaultModel']=_0x8b0e3e;}get['allModels'](){return this['_allModels']['slice']();}setupChecks(_0x5c468f){this['_checks']=_0x5c468f['map'](_0x29a270=>!0x0===_0x29a270['isExtra']?new il(_0x29a270,this['_allModels'],this['_defaultModel']):'custom'===_0x29a270['id']?new hl(_0x29a270,this['_recommendedModels'],this['_defaultModel']):new el(_0x29a270));}},ll=class extends nl{static get['pluginName'](){return'AIReviewModeCheckRegistry';}static get requires(){return[$s,dr,Js];}['_modelsLoadError']=null;constructor(_0x5336e4){super(_0x5336e4),this['context']['config']['define']('ai.review.extraCommands',[]);}get['modelsLoadError'](){return this['_modelsLoadError'];}getExtraChecks(){return this['context']['config']['get']('ai.review.extraCommands')['map'](_0x275922=>({'id':_0x275922['id'],'commandId':_0x275922['id'],'title':_0x275922['label'],'description':_0x275922['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x275922['prompt'],'context':_0x275922['context'],'model':_0x275922['model']}));}async _loadChecksList(){const _0x1c12f4=[...rl,...this['getExtraChecks']()]['map'](_0x27963b=>_0x27963b['isExtra']?_0x27963b:this['_translateReviewCheck'](_0x27963b)),_0x539c3f=this['context']['plugins']['get'](Js);let _0x45d6e5;try{_0x45d6e5=new cl(await _0x539c3f['models']['getAllModels'](),await _0x539c3f['models']['getAvailableModels'](),await _0x539c3f['models']['getDefault']()),this['_modelsLoadError']=null;}catch(_0x3cd775){this['_modelsLoadError']=new dt('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x3cd775),this['_reporter']['logError'](this['_modelsLoadError'],{'context':{'operation':'load-review-models'}}),_0x45d6e5=new cl([],[],null);}return _0x45d6e5['setupChecks'](_0x1c12f4),_0x45d6e5;}_translateReviewCheck(_0x59d90e){const _0x429205='AI_REVIEW_CHECK_'+_0x59d90e['commandId']['toUpperCase']()['replaceAll']('-','_'),_0x372bfe={..._0x59d90e,'title':this['_translate'](_0x429205+'_TITLE',_0x59d90e['title']),'description':this['_translate'](_0x429205+'_DESCRIPTION',_0x59d90e['description'])};return _0x59d90e['options']&&(_0x372bfe['options']=_0x59d90e['options']['map'](_0x30b2a4=>({..._0x30b2a4,'label':this['_translate'](_0x429205+'_OPTIONS_LABEL',_0x30b2a4['label']||''),'data':_0x30b2a4['data']?_0x30b2a4['data']['map'](_0x28c24c=>({..._0x28c24c,'label':this['_translate'](_0x429205+'_OPTIONS_DATA_'+_0x28c24c['id']['toUpperCase'](),_0x28c24c['label'])})):void 0x0}))),_0x372bfe;}_translate(_0x1e803c,_0x2609a9){const _0xed7a30=qs(this['context']['locale'],_0x1e803c);return _0xed7a30===_0x1e803c?_0x2609a9:_0xed7a30;}},ul=class extends Zc{static get['pluginName'](){return'AIReviewModeController';}static get requires(){return[dr,ll,Js];}get['_aiSource'](){return'review';}_shouldAcceptAsSuggestion(){return Hc(this['context'])&&Uc(this['context']);}get _defaultContextFeature(){return'review';}get['_aiTabId'](){return Sh;}get _leaveConfirmationDialogOptions(){const {context:{locale:_0x5d3b8d}}=this;return{'dialogId':'aiReviewModeLeaveConfirmation','title':qs(_0x5d3b8d,'AI_REVIEW_MODE_LEAVE_CONFIRMATION_TITLE'),'content':qs(_0x5d3b8d,'AI_REVIEW_MODE_LEAVE_CONFIRMATION_CONTENT'),'stayButton':qs(_0x5d3b8d,'AI_REVIEW_MODE_LEAVE_CONFIRMATION_STAY_BUTTON'),'exitButton':qs(_0x5d3b8d,'AI_REVIEW_MODE_LEAVE_CONFIRMATION_EXIT_BUTTON')};}['_isDiffOn']=!0x1;['_usesAvailableCommandsConfig'];constructor(_0x12337a){super(_0x12337a),this['_usesAvailableCommandsConfig']=Boolean(this['context']['config']['get']('ai.review.availableCommands')),this['context']['config']['define']('ai.review.availableCommands',rl['map'](_0xff32bf=>_0xff32bf['id']));}init(){super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x54e40a,_0x1d93b6)=>{this['_isDiffOn']=_0x1d93b6['on'],this['_onDiffChange'](this['_isDiffOn']);});}_initRequiredPlugins(){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}_createReviewCheckRun(_0x2b04a8,_0xa2694e,_0x4f47d5=new nr()){if(_0x2b04a8['isCustom'])return new tl(_0x2b04a8['args']['prompt'],_0x2b04a8['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0xa2694e,this['_aiConnector'],_0x4f47d5);if(_0xa2694e['isExtra']){const _0x1c718f=_0xa2694e,_0x3248d1=_0x1c718f['context']?_0x4f47d5['cloneWith'](_0x1c718f['context']):_0x4f47d5;return new sl(_0x2b04a8['args']?.['prompt']??_0x1c718f['prompt'],_0x2b04a8['args']?.['model']??_0x1c718f['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0xa2694e,this['_aiConnector'],_0x3248d1);}return new Jc(this['_aiReviewCoreEditing']['getDocumentData'](),_0xa2694e,this['_aiConnector'],_0x2b04a8['params'],_0x2b04a8['args'],_0x4f47d5);}_onReviewCheckResultActivated(_0x2dddd7){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x2dddd7['change']['id']);const {markerData:_0x43ee1a,editorInstance:_0x2620df}=this['_activateChangeMarkersAndReveal'](_0x2dddd7['change']['id']);'content'!==this['_changeActivationSource']&&this['_aiReviewCoreUi']['showNavigationPanel']({'change':_0x2dddd7['change'],'position':this['_getNavigationPosition'](_0x2dddd7['change']['id']),'getTarget':()=>_0x43ee1a?.['getElement']()??null,'limiter':this['_getBalloonDomRoot'](_0x2620df,_0x43ee1a?.['modelRange']['root']['rootName']),'viewportOffset':_0x2620df?.['ui']?.['viewportOffset']});}_activateChangeMarkersAndReveal(_0x15128b){return this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x15128b),this['_scrollToChange'](_0x15128b),{'markerData':this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x15128b),'editorInstance':this['_aiReviewCoreEditing']['getEditorForChange'](_0x15128b)??this['_aiReviewCoreEditing']['getEditor']()};}_onReviewCheckResultsRendered(){if(!this['_currentReviewCheckRun']||this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const [_0xfc26d5]=this['_currentReviewCheckRun']['getActiveChanges']();_0xfc26d5&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0xfc26d5['id']));}_revealActivatedChange(_0x5a18b0){this['_aiReviewCoreUi']['isNavigationPanelInViewport']()||(this['_changeActivationSource']='panel',this['_onReviewCheckResultActivated']({'change':_0x5a18b0}));}_onDeactivateChange(){}['_onChangeMarkerHovered'](){}['_onChangeMarkerBlurred'](){}_onReviewCheckResultDeactivated(){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}_onActivateChange(_0x1914f2){if(!this['_currentReviewCheckRun']||'click'!==_0x1914f2['uiInteraction'])return;const _0x80e894=this['_currentReviewCheckRun']['getChangeById'](_0x1914f2['id']);_0x80e894?.['isActivated']?this['_revealActivatedChange'](_0x80e894):(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x1914f2['id']));}['_onChangeMarkerClicked'](_0x409c87,_0x4df721){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x4df721['changeId']);const _0x76415d=this['_currentReviewCheckRun']['getChangeById'](_0x4df721['changeId']);if(!_0x76415d)return;const _0x2a7a37=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x4df721['changeId']),_0x159e28=this['_aiReviewCoreEditing']['getEditorForChange'](_0x4df721['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showNavigationPanel']({'change':_0x76415d,'position':this['_getNavigationPosition'](_0x4df721['changeId']),'getTarget':_0x4df721['markerElement'],'domEvent':_0x4df721['domEvent'],'limiter':this['_getBalloonDomRoot'](_0x159e28,_0x2a7a37?.['modelRange']['root']['rootName']),'viewportOffset':_0x159e28?.['ui']?.['viewportOffset']});}_getChangeContentElement(_0x4340f6){const _0x4e2d40=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x4340f6);return _0x4e2d40?_0x4e2d40['getElement']():null;}_markChangePositionInEditorContent(_0x4aa81d,_0x148d46){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x4aa81d,_0x148d46);}_diffContent(_0x132a1d,_0x73cee4,_0x13588e){return this['_aiReviewCoreEditing']['diffContent'](_0x132a1d,_0x73cee4,_0x13588e,!0x1);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x557408){for(const _0x2db25b of this['_aiReviewCoreEditing']['getEditors']())_0x2db25b['editing']['view']['change'](_0x1ded12=>{for(const _0x32c8ac of _0x2db25b['editing']['view']['document']['getRoots']()){for(const _0x52c8e7 of _0x32c8ac['getClassNames']())_0x52c8e7['startsWith']('ck-ai_review-')&&_0x1ded12['removeClass'](_0x52c8e7,_0x32c8ac);_0x1ded12['addClass'](_0x557408?'ck-ai_review-diff':'ck-ai_review-highlights',_0x32c8ac);}});}_getBalloonDomRoot(_0x4059a2,_0x5de6a4){const _0x519247=_0x4059a2['editing']['view'];if(_0x5de6a4){const _0x1915dc=_0x519247['getDomRoot'](_0x5de6a4);if(_0x1915dc)return _0x1915dc;}return _0x519247['getDomRoot']()??void 0x0;}async _getReviewChecks(){const _0x20ee89=this['context']['plugins']['get']('AIReviewModeCheckRegistry'),_0x8cdd90=await _0x20ee89['getChecksList']();_0x20ee89['modelsLoadError']&&this['_logError'](_0x20ee89['modelsLoadError']);let _0xf4cc39=_0x8cdd90['checks'];const _0xec5928=this['context']['config']['get']('ai.review.availableCommands');return this['_logWarningForNonExistentChecks'](_0xec5928,_0xf4cc39),this['_usesAvailableCommandsConfig']&&(_0xf4cc39=_0xec5928['map'](_0x2f3490=>_0xf4cc39['find'](_0x50df97=>_0x50df97['id']===_0x2f3490))['filter'](_0x1c7b64=>!!_0x1c7b64)),this['_filterChecksWithMissingModel'](_0xf4cc39);}_logWarningForNonExistentChecks(_0x5442bc,_0x114848){const _0x2d0329=_0x5442bc['filter'](_0x4df3bb=>!_0x114848['some'](_0x4d1cc1=>_0x4d1cc1['id']===_0x4df3bb));_0x2d0329['length']&&this['_reporter']['logError'](new ur({'code':'ai-review-mode-non-existent-commands-used','severity':'warning','context':{'commandIds':_0x2d0329['join'](',\x20')}}));}_filterChecksWithMissingModel(_0x1c1c3e){const _0x1d583c=[];return _0x1c1c3e['forEach'](_0x35bc24=>{(_0x35bc24 instanceof il&&!_0x35bc24['defaultModel']||_0x35bc24 instanceof hl&&!_0x35bc24['models']['length'])&&_0x1d583c['push'](_0x35bc24['id']);}),_0x1d583c['length']&&_0x1d583c['forEach'](_0x2d24f3=>{_0x1c1c3e=_0x1c1c3e['filter'](_0x1529eb=>_0x1529eb['id']!==_0x2d24f3),this['_reporter']['logError'](new ur({'code':'ai-review-mode-command-unavailable-due-to-missing-model','context':{'commandId':_0x2d24f3}}));}),_0x1c1c3e;}},dl=class extends _0x4f3978{static get['pluginName'](){return'AIReviewGateway';}static get requires(){return[$c,ll,$s,Pn,Jn,Js];}get['models'](){return this['context']['plugins']['get'](Js)['models'];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async getAllCommands(){return(await this['context']['plugins']['get']('AIReviewModeCheckRegistry')['getChecksList']())['checks']['map'](_0x48cedf=>{const _0xce1271={'id':_0x48cedf['id'],'title':_0x48cedf['title'],'description':_0x48cedf['description']};return'custom'!==_0x48cedf['id']&&_0x48cedf['options']?.['length']&&(_0xce1271['parameters']=_0x48cedf['options'][0x0]['data']['map'](_0x4cae31=>({..._0x4cae31}))),_0xce1271;});}async['runReview'](_0x52c712,_0x117ea2){const _0xecdf33=await this['_resolveReviewCheck'](_0x52c712),_0x3677e2=this['context']['plugins']['get']('AIReviewCoreEditing'),_0x1e7563=this['context']['plugins']['get']('AIConnector'),_0x53d2b3=_0x3677e2['getDocumentData']({'roots':_0x117ea2?.['roots']}),_0x119919=this['_createReviewCheckRun'](_0xecdf33,_0x53d2b3,_0x1e7563,_0x117ea2?.['parameterId'],new nr(_0x117ea2?.['contexts']));return _0x3677e2['runCheck'](_0x119919,{'signal':_0x117ea2?.['signal']});}async runCustomReview(_0x13dc59,_0x4cf074){const {reviewCheck:_0x2e4a11,resolvedModel:_0x487d5d}=await this['_resolveCustomReviewCheck'](_0x13dc59,_0x4cf074?.['model']),_0x4c9cb6=this['context']['plugins']['get']('AIReviewCoreEditing'),_0x319103=this['context']['plugins']['get']('AIConnector'),_0x57a8be=_0x4c9cb6['getDocumentData']({'roots':_0x4cf074?.['roots']}),_0x33500c=new tl(_0x13dc59,_0x487d5d,_0x57a8be,_0x2e4a11,_0x319103,new nr(_0x4cf074?.['contexts']));return _0x4c9cb6['runCheck'](_0x33500c,{'signal':_0x4cf074?.['signal']});}['applyReview'](_0x41fdbe,_0x2c981b){this['context']['plugins']['get']('AIGateway')['apply'](_0x41fdbe,{'aiSource':'review',..._0x2c981b});}async['_resolveReviewCheck'](_0x516979){const _0x11fb96=(await this['context']['plugins']['get']('AIReviewModeCheckRegistry')['getChecksList']())['checks']['find'](_0x297a91=>_0x297a91['id']===_0x516979);if(!_0x11fb96)throw new dt('ai-reviewgateway-unknown-command',this,{'checkId':_0x516979});if(_0x11fb96 instanceof hl)throw new dt('ai-reviewgateway-not-a-system-command',this,{'checkId':_0x516979});if(_0x11fb96 instanceof il&&!_0x11fb96['defaultModel']?.['id'])throw new dt('ai-reviewgateway-missing-custom-command-model',this,{'checkId':_0x516979});return _0x11fb96;}async _resolveCustomReviewCheck(_0x48fb3a,_0x154620){const _0xf645af='custom',_0x3e4b31=(await this['context']['plugins']['get']('AIReviewModeCheckRegistry')['getChecksList']())['checks']['find'](_0x29cc6c=>_0x29cc6c['id']===_0xf645af);if(!_0x3e4b31)throw new dt('ai-reviewgateway-unknown-command',this,{'checkId':_0xf645af});if(!(_0x3e4b31 instanceof hl))throw new dt('ai-reviewgateway-not-a-custom-command',this,{'checkId':_0xf645af});if(!_0x48fb3a)throw new dt('ai-reviewgateway-missing-custom-command-prompt',this,{'checkId':_0xf645af});const _0x1a26e1=_0x154620??_0x3e4b31['defaultModel']?.['id'];if(!_0x1a26e1)throw new dt('ai-reviewgateway-missing-custom-command-model',this,{'checkId':_0xf645af});return{'reviewCheck':_0x3e4b31,'resolvedModel':_0x1a26e1};}_createReviewCheckRun(_0x5974dd,_0xa2b41e,_0x430b9b,_0x1a6763,_0x28827d=new nr()){if(_0x5974dd instanceof il){const _0x116a96=_0x5974dd['context']?_0x28827d['cloneWith'](_0x5974dd['context']):_0x28827d;return new sl(_0x5974dd['prompt'],_0x5974dd['defaultModel']['id'],_0xa2b41e,_0x5974dd,_0x430b9b,_0x116a96);}return new Jc(_0xa2b41e,_0x5974dd,_0x430b9b,_0x1a6763?[_0x1a6763]:void 0x0,void 0x0,_0x28827d);}},_l=class extends _0x4f3978{static get requires(){return[ul,Bc,$c,dl];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async startReview(_0x287818,_0x57263d){await this['assertStartReviewPreconditions'](_0x287818,_0x26a9b0=>{if(_0x26a9b0 instanceof hl)throw new dt('ai-reviewmode-not-a-system-command',this,{'commandId':_0x287818});}),await this['context']['plugins']['get']('AIReviewModeController')['runCheck']({'id':_0x287818,'params':_0x57263d?.['parameterId']?[_0x57263d['parameterId']]:void 0x0});}async startCustomReview(_0x54fe16,_0x213eb1){if(!_0x54fe16)throw new dt('ai-reviewmode-missing-custom-command-prompt',this);const _0x7f89e=rl['find'](_0x2a8521=>'custom'===_0x2a8521['commandId'])['id'],_0x4706c6=await this['assertStartReviewPreconditions'](_0x7f89e,_0x5a3f1f=>{if(!this['resolveCustomReviewModel'](_0x5a3f1f,_0x213eb1))throw new dt('ai-reviewmode-missing-custom-command-model',this);}),_0x2b5fe2=this['resolveCustomReviewModel'](_0x4706c6,_0x213eb1);await this['context']['plugins']['get']('AIReviewModeController')['runCheck']({'id':_0x7f89e,'isCustom':!0x0,'args':{'prompt':_0x54fe16,'model':_0x2b5fe2}});}getAvailableCommands(){return this['context']['plugins']['get']('AIReviewModeController')['getAvailableChecks']()['map'](_0x4658c3=>{const _0x1fe6c0={'id':_0x4658c3['id'],'title':_0x4658c3['title'],'description':_0x4658c3['description']};return'custom'!==_0x4658c3['id']&&_0x4658c3['options']?.['length']&&(_0x1fe6c0['parameters']=_0x4658c3['options'][0x0]['data']['map'](_0xb46a3e=>({..._0xb46a3e}))),_0x1fe6c0;});}async assertStartReviewPreconditions(_0x51f6c2,_0x3da765){const _0x5ce434=this['context']['plugins']['get']('AIReviewModeController');if(_0x5ce434['getCurrentCheckRun']())throw new dt('ai-reviewmode-review-already-running',this);const _0x49abcc=_0x5ce434['getAvailableChecks']()['find'](_0x467ddd=>_0x467ddd['id']===_0x51f6c2);if(!_0x49abcc)throw new dt('ai-reviewmode-unknown-command',this,{'commandId':_0x51f6c2});if(_0x3da765(_0x49abcc),!await cc(this['context'],Sh))throw new dt('ai-reviewmode-review-vetoed',this);return _0x49abcc;}resolveCustomReviewModel(_0x4dc1a8,_0x42d9dc){return _0x42d9dc?.['model']??_0x4dc1a8['defaultModel']?.['id'];}},gl=class extends Jc{_title;constructor(_0x8f9d15,_0x3cf4ca,_0x23085d,_0x1ee9a4,_0x2efa9a,_0x5eabcc,_0x18bfdd){super(_0x8f9d15,_0x3cf4ca,_0x23085d,_0x2efa9a,_0x5eabcc,_0x18bfdd),this['_title']=_0x1ee9a4;}get title(){return this['_title'];}get subTitle(){return this['_sourceCheck']['title'];}},Il=class extends el{get['apiId'](){return'translate';}},Al=class extends al{setupChecks(_0x43e588){this['_checks']=_0x43e588['map'](_0x2cf50b=>new Il(_0x2cf50b));}};const El=[{'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'}];var pl=class extends nl{static get['pluginName'](){return'AITranslateCheckRegistry';}constructor(_0x5d77c1){super(_0x5d77c1),this['context']['config']['define']('ai.translate.languages',El);}async _loadChecksList(){const _0xaea6ab=[],_0x2bc045=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x23e78a of _0x2bc045)_0xaea6ab['push']({'title':_0x23e78a['label'],'id':_0x23e78a['id'],'commandId':_0x23e78a['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x23e78a['id']}});const _0x1b2168=new Al();return _0x1b2168['setupChecks'](this['_translateChecks'](_0xaea6ab)),_0x1b2168;}_translateChecks(_0x467e84){const _0x39e789=this['context']['locale'];return _0x467e84['map'](_0x1a7b7f=>{const _0x42f6bc='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x1a7b7f['title']['toUpperCase']()['replaceAll']('-','_'),_0x280066=qs(_0x39e789,_0x42f6bc);return{..._0x1a7b7f,'title':_0x280066===_0x42f6bc?_0x1a7b7f['title']:_0x280066};});}},ml=class extends Zc{static get['pluginName'](){return'AITranslateController';}static get requires(){return[dr,pl,Js];}get['_aiSource'](){return'translate';}get _defaultContextFeature(){return'translate';}get['_aiTabId'](){return Oh;}get _leaveConfirmationDialogOptions(){const {context:{locale:_0x1bfa0f}}=this;return{'dialogId':'aiTranslateLeaveConfirmation','title':qs(_0x1bfa0f,'AI_TRANSLATE_LEAVE_CONFIRMATION_TITLE'),'content':qs(_0x1bfa0f,'AI_TRANSLATE_LEAVE_CONFIRMATION_CONTENT'),'stayButton':qs(_0x1bfa0f,'AI_TRANSLATE_LEAVE_CONFIRMATION_STAY_BUTTON'),'exitButton':qs(_0x1bfa0f,'AI_TRANSLATE_LEAVE_CONFIRMATION_EXIT_BUTTON')};}['_onCheckRunFinished'](){this['_onReviewRunLeave'](!0x0);}_initRequiredPlugins(){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AITranslateUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}_createReviewCheckRun(_0x18cf5f,_0x398cb8,_0x95657b){return new gl(this['_aiReviewCoreEditing']['getDocumentData'](),_0x398cb8,this['_aiConnector'],qs(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x18cf5f['params'],_0x18cf5f['args'],_0x95657b);}_onReviewCheckResultActivated(_0x5a1672){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x5a1672['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x5a1672['change']['id']);}_onReviewCheckResultDeactivated(){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}_onActivateChange(_0x3fcfda){this['_currentReviewCheckRun']&&('hover'===_0x3fcfda['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x3fcfda['id'])),'click'===_0x3fcfda['uiInteraction']&&this['_scrollToChange'](_0x3fcfda['id']));}_onDeactivateChange(_0x411e89){this['_currentReviewCheckRun']&&'panel'===_0x411e89['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x7b5261,_0x26323b){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x26323b['changeId']),this['_scrollToChange'](_0x26323b['changeId']));}['_onChangeMarkerHovered'](_0xaac1c2,_0x491634){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x491634['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x491634['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}_getChangeContentElement(_0x4b849f){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x4b849f);}_markChangePositionInEditorContent(_0x28a1c1,_0x4a2f8e){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x28a1c1,_0x4a2f8e);}_diffContent(_0x2a9c99,_0x3a5ce0,_0x2ec611){return this['_aiReviewCoreEditing']['diffContent'](_0x2a9c99,_0x3a5ce0,_0x2ec611,!0x0);}['_onReviewCheckRun'](){for(const _0x499402 of this['_aiReviewCoreEditing']['getEditors']())_0x499402['editing']['view']['change'](_0x6a17e9=>{for(const _0x348211 of _0x499402['editing']['view']['document']['getRoots']())_0x6a17e9['addClass']('ck-ai-translate-mode-content',_0x348211);});}async _getReviewChecks(){return(await this['context']['plugins']['get']('AITranslateCheckRegistry')['getChecksList']())['checks'];}},Tl=class extends vc{constructor(_0x3c8b9f,_0x2197e9){super(_0x3c8b9f,_0x2197e9),this['on']('set:isLoading',(_0x14db12,_0x17fb49,_0x49d7c4)=>{_0x49d7c4&&(this['headerTitle']=qs(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x3c09aa,_0x48829b,_0x583e43)=>{_0x583e43&&(this['headerTitle']=qs(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}_createAcceptAllButtonView(){const _0x10e257=new _0x1b12df(this['locale']);return _0x10e257['set']({'label':qs(this['locale'],'AI_TRANSLATE_ACCEPT_ALL'),'withText':!0x0}),_0x10e257['bind']('isEnabled')['to'](this,'hasPendingChanges',this,'isError',(_0x570353,_0x4181eb)=>_0x570353&&!_0x4181eb),_0x10e257['extendTemplate']({'attributes':{'class':[gr,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2b4bf0=>!_0x2b4bf0),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x437347=>_0x437347)]}}),_0x10e257['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x10e257;}_createExitButtonView(){const _0x147b5b=new _0x1b12df(this['locale']);return _0x147b5b['set']({'label':qs(this['locale'],'AI_CHAT_HISTORY_CANCEL'),'withText':!0x0}),_0x147b5b['extendTemplate']({'attributes':{'class':[Ar,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x428cf0=>!_0x428cf0),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x32f967=>_0x32f967)]}}),_0x147b5b['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x147b5b;}_createHeaderControlViews(){return this['_acceptAllButtonView']??=this['_createAcceptAllButtonView'](),this['_exitButtonView']??=this['_createExitButtonView'](),[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitButtonView'],this['_finishReviewButtonView']];}_createProgressBarViewList(){return[];}_getSkeletonDefinition(){return uo['aiTranslateChecks'];}},wl=class extends Mc{constructor(_0x1674a3){super(_0x1674a3),this['_setupTemplate']();}['_clearCheckViews'](){this['items']['clear']();}['_addCheckView'](_0x27c30d){this['items']['add'](_0x27c30d);}getCheckViews(){return[...this['items']]['filter'](_0x1776a9=>_0x1776a9 instanceof Pc);}_setupTemplate(){const _0x11a289=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x11a289['if']('isVisible','ck-hidden',_0x1d7f0c=>!_0x1d7f0c)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':qs(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':qs(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'ul','attributes':{'class':['ck-ai_review__check-list',_0x11a289['if']('isVisible','ck-hidden',_0x220655=>!_0x220655)]},'children':this['items']}]});}},Cl=class extends Cc{static get['pluginName'](){return'AITranslateUI';}createMainView(){const _0x251325=this['context']['plugins']['get']('AITabs'),_0x30baed=this['context']['locale'],_0xede18e=new sh(_0x30baed,{'label':qs(_0x30baed,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x2f431a,'class':'ck-ai-header_review-translate','showResizeButton':_0x251325['showResizeButton']});_0xede18e['delegate']('resizeTabs')['to'](_0x251325),_0xede18e['bind']('isMaximized')['to'](_0x251325['view'],'isMaximized',_0x54ce3b=>_0x54ce3b);const _0x3001c=new Rc(_0x30baed,{'header':_0xede18e,'list':new wl(_0x30baed),'results':new Tl(_0x30baed,{'generalErrorText':qs(_0x30baed,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new Nc(_0x30baed,{'headerText':qs(_0x30baed,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':qs(_0x30baed,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':qs(_0x30baed,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x3001c['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x3001c;}registerTab(){const _0x4bd89b=this['context']['plugins']['get']('AITabs');_0x4bd89b['view']['on']('activateTab',(_0x525ded,{newTab:_0x835b9d,oldTab:_0x5c6d0a})=>{_0x835b9d===Oh?this['fire']('getReviewCheckList'):_0x5c6d0a===Oh&&this['fire']('leaveReview');}),_0x4bd89b['view']['addTab']({'id':Oh,'buttonLabel':qs(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x2f431a,'order':0x0,'content':this['_mainView']});}},fl=class extends _0x4f3978{static get['pluginName'](){return'AITranslateGateway';}static get requires(){return[$c,$s,Pn,Jn];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async runTranslate(_0x444524,_0x34d80c){const _0x547032=this['context']['plugins']['get']('AIReviewCoreEditing'),_0x4ed3bd=this['context']['plugins']['get']('AIConnector'),_0x5f49c0=new Il({'id':_0x444524,'commandId':_0x444524,'title':_0x444524,'description':'','isParameterized':!0x1}),_0x4d9167=_0x547032['getDocumentData']({'roots':_0x34d80c?.['roots']}),_0xc2ed6c=new Jc(_0x4d9167,_0x5f49c0,_0x4ed3bd,void 0x0,{'language':_0x444524},new nr(_0x34d80c?.['contexts']));return _0x547032['runCheck'](_0xc2ed6c,{'signal':_0x34d80c?.['signal']});}applyTranslate(_0x2739ef,_0x275df9){this['context']['plugins']['get']('AIGateway')['apply'](_0x2739ef,_0x275df9);}},Rl=class extends _0x4f3978{static get requires(){return[ml,Cl,$c,fl];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async startTranslate(_0x23ee4b){const _0x3e3ed9=await this['assertStartTranslatePreconditions'](_0x23ee4b);await this['context']['plugins']['get']('AITranslateController')['runCheck']({'id':_0x3e3ed9['id'],'args':_0x3e3ed9['useArgs']?_0x3e3ed9['args']:void 0x0});}getAvailableLanguages(){return this['context']['plugins']['get']('AITranslateController')['getAvailableChecks']()['map'](_0x197f50=>({'id':_0x197f50['id'],'label':_0x197f50['title']}));}async assertStartTranslatePreconditions(_0x10711b){const _0x58686a=this['context']['plugins']['get']('AITranslateController');if(_0x58686a['getCurrentCheckRun']())throw new dt('ai-translate-translation-already-running',this);const _0x5bde37=_0x58686a['getAvailableChecks']()['find'](_0x4a34b5=>_0x4a34b5['id']===_0x10711b);if(!_0x5bde37)throw new dt('ai-translate-unknown-language',this,{'languageId':_0x10711b});if(!await cc(this['context'],Oh))throw new dt('ai-translate-translation-vetoed',this);return _0x5bde37;}},bl=class extends _0x52da8c{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'DocumentCompareUtils';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x47d358=[this['editor']];for(const _0x1b6295 of _0x47d358){let _0x400ad2;for(const _0x3480c4 in _0x1b6295){const _0x5a9f55=_0x3480c4,_0x38c6be=_0x1b6295[_0x5a9f55];if('documentCompareLicenseKeyValid'==_0x38c6be||'documentCompareLicenseKeyInvalid'==_0x38c6be||'documentCompareLicenseKeyExpired'==_0x38c6be||'documentCompareLicenseKeyDomainLimit'==_0x38c6be||'documentCompareLicenseKeyNotAllowed'==_0x38c6be||'documentCompareLicenseKeyEvaluationLimit'==_0x38c6be||'documentCompareLicenseKeyUsageLimit'==_0x38c6be){delete _0x1b6295[_0x5a9f55],_0x400ad2=_0x38c6be,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'documentCompareLicenseKeyInvalid'==_0x400ad2&&_0x1b6295['_showLicenseError']('invalid'),'documentCompareLicenseKeyExpired'==_0x400ad2&&_0x1b6295['_showLicenseError']('expired'),'documentCompareLicenseKeyDomainLimit'==_0x400ad2&&_0x1b6295['_showLicenseError']('domainLimit'),'documentCompareLicenseKeyNotAllowed'==_0x400ad2&&_0x1b6295['_showLicenseError']('featureNotAllowed','DocumentCompare'),'documentCompareLicenseKeyEvaluationLimit'==_0x400ad2&&_0x1b6295['_showLicenseError']('evaluationLimit'),'documentCompareLicenseKeyUsageLimit'==_0x400ad2&&_0x1b6295['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}};const Sl=new Set(['br']);var Ol=class{['_usedIds']=new Set();_writer;constructor(_0x4203e6){this['_writer']=new _0x5c06e8(_0x4203e6['editing']['view']['document']);}['assign'](_0x12fc4a){this['_assignToChildren'](_0x12fc4a);}['_assignToChildren'](_0xa61c19){let _0x520671=!0x1;for(const _0x358513 of _0xa61c19['getChildren']()){if(!_0x358513['is']('view:element')||Sl['has'](_0x358513['name']))continue;const _0x11829c=_0x358513['is']('view:containerElement'),_0x3e291c=_0x358513['is']('view:emptyElement'),_0x1252cc=_0x358513['is']('view:rawElement'),_0x7b57d=this['_assignToChildren'](_0x358513);_0x358513['hasAttribute']('data-id')?(this['_usedIds']['add'](_0x358513['getAttribute'](Hn)),_0x520671=!0x0):(_0x11829c||_0x3e291c||_0x1252cc||_0x7b57d)&&(this['_writer']['setAttribute'](Hn,this['_nextId'](),_0x358513),_0x520671=!0x0);}return _0x520671;}_nextId(){let _0x325b0f;do{_0x325b0f='';for(let _0xfa6fa3=0x0;_0xfa6fa3<0x4;_0xfa6fa3++)_0x325b0f+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(this['_usedIds']['has'](_0x325b0f));return this['_usedIds']['add'](_0x325b0f),_0x325b0f;}};function vl(_0xa0e4e6){return new _0x3a5946(Array['from'](_0xa0e4e6['getChildren'](),_0x37457b=>_0x37457b['_clone'](!0x0)));}const yl='documentcompare-selection',Nl='documentcompare-selection-start',kl='documentcompare-selection-end';function xl(_0x47fb1b){const _0x371451='<'+Nl+'></'+Nl+'>',_0x4fa3b5='<'+kl+'></'+kl+'>';let _0x45288a=_0x47fb1b;const _0x4dcd7c=[];let _0x53e1b0=_0x45288a['indexOf'](_0x371451);for(;-0x1!==_0x53e1b0;){_0x45288a=_0x45288a['slice'](0x0,_0x53e1b0)+_0x45288a['slice'](_0x53e1b0+_0x371451['length']);const _0x3d76ea=_0x45288a['indexOf'](_0x371451);let _0x266fc8=_0x45288a['indexOf'](_0x4fa3b5);-0x1===_0x266fc8||-0x1!==_0x3d76ea&&_0x3d76ea<_0x266fc8?_0x266fc8=_0x53e1b0:_0x45288a=_0x45288a['slice'](0x0,_0x266fc8)+_0x45288a['slice'](_0x266fc8+_0x4fa3b5['length']),_0x4dcd7c['push']({'start':_0x53e1b0,'end':_0x266fc8}),_0x53e1b0=_0x45288a['indexOf'](_0x371451);}return{'content':_0x45288a,'selection':_0x4dcd7c};}var Ll=class extends _0x52da8c{['_sessionId'];static get['pluginName'](){return'DocumentCompare';}static get requires(){return[Un,bl];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['editor']['conversion']['for']('dataDowncast')['markerToElement']({'model':yl,'view':(_0x4b7b9c,{writer:_0x5f0904,options:_0x3bbcc7})=>_0x3bbcc7['includeDocumentCompareSelection']?_0x5f0904['createUIElement'](_0x4b7b9c['isOpening']?Nl:kl):null});}afterInit(){!async function(_0x72a4){const _0x2e6909='KpOBJGNSEgqCyfVF1kZ8lbnRjM7eIzAsDQHw9aThu6rcYi05UmPL4d3X2Wotvx',_0x2d3e1c=0x79728,_0x10c33e={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x405de6(_0xafc46d){const _0x30a82e=new window['Promise'](_0x299407=>{_0xafc46d['once']('ready',_0x299407);}),_0x539009=window['Date']['now'](),_0x5b89d3=_0xafc46d['config']['get']('licenseKey');async function _0x23f2f9(){let _0x2cff61,_0x4e9600=null,_0x1c053e=null;try{return'GPL'==_0x5b89d3?'NotAllowed':(_0x2cff61=_0x59916d(),_0x2cff61?(_0x2cff61['usageEndpoint']&&(_0x1c053e=_0x5be2ac(_0x2cff61['usageEndpoint'],_0x2cff61['jti'])),await _0x264a71()?_0x190969()?_0x80583f()?'Expired':_0x24d879()?('evaluation'==_0x2cff61['licenseType']&&(_0x4e9600=_0x3f149e('EvaluationLimit')),await _0x439ba1()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x80583f(){const _0x4dd74a=['evaluation','trial']['includes'](_0x2cff61['licenseType'])?_0x539009/0x3e8:0xe10*_0x2d3e1c;return _0x2cff61['exp']<_0x4dd74a;}function _0x190969(){const _0x45c1fd=_0x2cff61['features'];return!!_0x45c1fd&&(!!_0x45c1fd['includes']('*')||(!!_0x45c1fd['includes']('DC')||!!_0x45c1fd['includes']('ET')));}function _0x24d879(){const _0x58c0f4=_0x2cff61['licensedHosts'];if(!_0x58c0f4||0x0==_0x58c0f4['length'])return!0x0;const {hostname:_0xda8ef3}=new URL(window['location']['href']);if(_0x58c0f4['includes'](_0xda8ef3))return!0x0;const _0x2150bd=_0xda8ef3['split']('.');return _0x58c0f4['filter'](_0x1bb37c=>_0x1bb37c['includes']('*'))['map'](_0x1fce9c=>_0x1fce9c['split']('.'))['filter'](_0x17cbee=>_0x17cbee['length']<=_0x2150bd['length'])['map'](_0x247d5a=>Array(_0x2150bd['length']-_0x247d5a['length'])['fill']('*'===_0x247d5a[0x0]?'*':'')['concat'](_0x247d5a))['some'](_0x42c0fd=>_0x2150bd['every']((_0x57c2c8,_0x4bc167)=>_0x42c0fd[_0x4bc167]===_0x57c2c8||'*'===_0x42c0fd[_0x4bc167]));}function _0x439ba1(){return _0x4e9600&&_0x1c053e?new window['Promise']((_0x5323b0,_0x30840a)=>{_0x4e9600['then'](_0x5323b0,_0x30840a),_0x1c053e['then'](_0xd7ae65=>{'Valid'!=_0xd7ae65&&_0x5323b0(_0xd7ae65);},_0x30840a);}):_0x4e9600||_0x1c053e||'Valid';}}function _0x5be2ac(_0x34de43,_0x3168c8){return new window['Promise'](_0x5f3794=>{if(_0x3ba1a8())return _0x5f3794('Valid');_0x32c51a(),_0xafc46d['decorate']('_sendUsageRequest');let _0x761ef0=!0x1;const _0x63094c=Xt();function _0x192040(_0x19dec9){return!!_0x19dec9&&('object'==typeof _0x19dec9||'function'==typeof _0x19dec9)&&'function'==typeof _0x19dec9['then']&&'function'==typeof _0x19dec9['catch'];}function _0x341d85(_0x41be85){_0x2d929d(_0x41be85)['then'](_0x46cdd1=>_0x46cdd1&&'ok'==_0x46cdd1['status']?_0x165cba(_0x44c96c(_0x63094c+_0x3168c8))!=_0x46cdd1['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x17dd42=>(_0xdf78b3(),_0x17dd42),()=>{const _0x5a9f19=_0x823a1d();return null==_0x5a9f19?(_0xdf78b3(),'Valid'):_0x539009-_0x5a9f19>0x240c8400?'UsageLimit':'Valid';})['then'](_0x5f3794)['catch'](()=>{_0x5f3794('UsageLimit');});const _0x3de501=0x36ee80;function _0xdf78b3(){const _0x58a236='llct-'+_0x165cba(_0x44c96c(_0x34de43)),_0xef7816=_0x20fd25(_0x165cba(window['Math']['ceil'](_0x539009/_0x3de501)));window['localStorage']['setItem'](_0x58a236,_0xef7816);}function _0x823a1d(){const _0x39d1f5='llct-'+_0x165cba(_0x44c96c(_0x34de43)),_0x16880b=window['localStorage']['getItem'](_0x39d1f5);return _0x16880b?window['parseInt'](_0x20fd25(_0x16880b),0x10)*_0x3de501:null;}function _0x2d929d(_0x28210c){return new window['Promise']((_0x3d45f3,_0x11e2ce)=>{_0x28210c['then'](_0x3d45f3,_0x11e2ce),window['setTimeout'](_0x11e2ce,0x1d4c0);});}}_0xafc46d['on']('_sendUsageRequest',(_0x399916,_0x585688)=>{if(_0x585688[0x0]!=_0x34de43)return _0x5f3794('UsageLimit');_0x585688[0x1]={..._0x585688[0x1],'requestId':_0x63094c};},{'priority':'high'}),_0xafc46d['on']('_sendUsageRequest',_0x16fb07=>{_0x192040(_0x16fb07['return'])&&(_0x761ef0=!0x0,_0x341d85(_0x16fb07['return']));},{'priority':'low'}),_0x30a82e['then'](()=>{_0x761ef0||_0x5f3794('UsageLimit');});});function _0x3ba1a8(){return'auto'==_0xafc46d['editing']['view']['_overlayModeHint'];}function _0x32c51a(){_0xafc46d['editing']['view']['_overlayModeHint']='auto';}}function _0x3f149e(_0x5be7a4){const _0x40af35=[new window['Promise'](_0x14e78e=>setTimeout(_0x14e78e,0x93ecc)),_0x30a82e['then'](()=>new window['Promise'](_0x418d98=>{let _0x4b2f07=0x0;_0xafc46d['model']['on']('applyOperation',(_0x4dbb38,_0x37fc71)=>{_0x37fc71[0x0]['isDocumentOperation']&&_0x4b2f07++,0x5e8==_0x4b2f07&&(_0x418d98(),_0x4dbb38['off']());});}))];return window['Promise']['race'](_0x40af35)['then'](()=>_0x5be7a4);}async function _0x2a0136(){await _0x30a82e,_0x72a4['makeSnapshot']=_0x31a51a,_0x72a4['diffSnapshot']=_0x31a51a,_0x72a4['applyPatch']=_0x31a51a,_0xafc46d['model']['change']=_0x31a51a,_0xafc46d['model']['enqueueChange']=_0x31a51a,_0xafc46d['enableReadOnlyMode']('model');}function _0x253ea4(_0x3b28ec){const _0x1a3acf=_0x56884b();_0xafc46d[_0x1a3acf]='documentCompareLicenseKey'+_0x3b28ec,'Valid'!=_0x3b28ec&&_0x2a0136();}function _0x56884b(){const _0x3360f9=window['String'](window['performance']['now']())['replace']('.','');let _0x14a987='K';for(let _0x2ae587=0x0;_0x2ae587<_0x3360f9['length'];_0x2ae587+=0x2){let _0x107106=window['parseInt'](_0x3360f9['substring'](_0x2ae587,_0x2ae587+0x2));_0x107106>=0x3e&&(_0x107106-=0x3e),_0x14a987+=_0x2e6909[_0x107106];}return _0x14a987;}function _0x59916d(){const _0x41c12e=_0x5b89d3['split']('.');if(0x3!=_0x41c12e['length'])return null;return _0xdd3c54(_0x41c12e[0x1]);function _0xdd3c54(_0x10b74f){const _0x4ed701=_0x3f5d86(_0x10b74f);return _0x4ed701&&_0xf102a1()?_0x4ed701:null;function _0xf102a1(){const _0x39b12e=_0x4ed701['jti'],_0x166019=window['parseInt'](_0x39b12e['substring'](_0x39b12e['length']-0x8),0x10),_0x53363e={..._0x4ed701,'jti':_0x39b12e['substring'](0x0,_0x39b12e['length']-0x8)};return delete _0x53363e['vc'],_0x44c96c(_0x53363e)==_0x166019;}}}async function _0x264a71(){let _0x4488f6=!0x0;try{const [_0x4261a0,_0x4654a4,_0x422ad2]=_0x5b89d3['split']('.');return _0x1e5246(_0x4261a0),await _0x37923c(_0x4261a0,_0x4654a4,_0x422ad2),_0x4488f6;}catch{return!0x1;}function _0x1e5246(_0x19d48d){const _0x22f449=_0x3f5d86(_0x19d48d);_0x22f449&&'ES256'==_0x22f449['alg']||(_0x4488f6=!0x1);}async function _0x37923c(_0x192c1f,_0xe974ca,_0x2e0d9f){const _0x2a485f=window['Uint8Array']['from'](_0x484e50(_0x2e0d9f),_0x4b258f=>_0x4b258f['charCodeAt'](0x0)),_0x590a58=new window['TextEncoder']()['encode'](_0x192c1f+'.'+_0xe974ca),_0x355725=window['crypto']['subtle'];if(!_0x355725)return;const _0x5df734=await _0x355725['importKey']('jwk',_0x10c33e,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x355725['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x5df734,_0x2a485f,_0x590a58)||(_0x4488f6=!0x1);}}function _0x3f5d86(_0x4149d2){return _0x4149d2['startsWith']('ey')?JSON['parse'](_0x484e50(_0x4149d2)):null;}function _0x484e50(_0x85a1ac){return window['atob'](_0x85a1ac['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x44c96c(_0x3dff0f){let _0x498ce8=0x1505;function _0x282323(_0x3ffd3a){for(let _0x382033=0x0;_0x382033<_0x3ffd3a['length'];_0x382033++){const _0x260817=_0x3ffd3a['charCodeAt'](_0x382033);_0x498ce8=(_0x498ce8<<0x5)+_0x498ce8+_0x260817,_0x498ce8&=_0x498ce8;}}function _0x134fd4(_0x44eae1){Array['isArray'](_0x44eae1)?_0x44eae1['forEach'](_0x134fd4):_0x44eae1&&'object'==typeof _0x44eae1?Object['entries'](_0x44eae1)['sort']()['forEach'](([_0x5ebe09,_0x10a897])=>{_0x282323(_0x5ebe09),_0x134fd4(_0x10a897);}):_0x282323(window['String'](_0x44eae1));}return _0x134fd4(_0x3dff0f),_0x498ce8>>>0x0;}function _0x165cba(_0x1bccb1){return _0x1bccb1['toString'](0x10)['padStart'](0x8,'0');}function _0x20fd25(_0x5d46e1){return _0x5d46e1['split']('')['reverse']()['join']('');}function _0x31a51a(){}_0x253ea4(await _0x23f2f9());}_0x405de6(_0x72a4['editor']);}(this);}makeSnapshot(_0x2adf0e=[]){const _0x39ae54=this['editor'],_0xb6f306=Array['from'](_0x2adf0e),_0x425f62={},_0x40bd69={},_0xca3827=new Ol(_0x39ae54);for(const _0x464644 of _0x39ae54['model']['document']['getRoots']()){const _0x47bc77=Array['from'](_0x464644['getChildren']())['map'](_0x405d22=>_0x405d22['_clone'](!0x0)),_0x40d52e=new _0x3a5946(_0x47bc77);for(const _0x611efe of _0x39ae54['model']['markers']){const _0x49cd71=_0x611efe['getRange']();_0x611efe['affectsData']&&_0x49cd71['root']===_0x464644&&_0x40d52e['markers']['set'](_0x611efe['name'],_0x39ae54['model']['createRange'](_0x39ae54['model']['createPositionFromPath'](_0x40d52e,_0x49cd71['start']['path']),_0x39ae54['model']['createPositionFromPath'](_0x40d52e,_0x49cd71['end']['path'])));}let _0x2714a2=0x0;for(const _0x31c93f of _0xb6f306)_0x31c93f['root']===_0x464644&&_0x40d52e['markers']['set'](yl+':'+_0x2714a2++,_0x39ae54['model']['createRange'](_0x39ae54['model']['createPositionFromPath'](_0x40d52e,_0x31c93f['start']['path']),_0x39ae54['model']['createPositionFromPath'](_0x40d52e,_0x31c93f['end']['path'])));const _0xedec21=_0x39ae54['data']['toView'](_0x40d52e,{'includeDocumentCompareSelection':!0x0});_0xca3827['assign'](_0xedec21);const {content:_0x2ff263,selection:_0x7b1d1e}=xl(_0x39ae54['data']['processor']['toData'](_0xedec21));_0x425f62[_0x464644['rootName']]=_0x2ff263,_0x7b1d1e['length']&&(_0x40bd69[_0x464644['rootName']]=_0x7b1d1e);}return{'channelId':this['_getChannelId'](),'sessionId':this['_getSessionId'](),'version':_0x39ae54['model']['document']['version'],'content':_0x425f62,'selection':_0x40bd69,'editorConfig':xn(_0x39ae54)};}diffSnapshot(_0x562164,_0x16803b,_0x46a8c4={}){const _0x1d60e=this['editor']['plugins']['get'](Un),_0x48f9f8='string'==typeof _0x16803b?{'main':_0x16803b}:_0x16803b,_0x23275a={};for(const _0x42190e of Object['keys'](_0x562164['content'])){const _0x36fff9=_0x48f9f8[_0x42190e];void 0x0!==_0x36fff9&&(_0x23275a[_0x42190e]=_0x1d60e['getDiff'](_0x562164['content'][_0x42190e],_0x36fff9,{'targetEditor':this['editor'],'anchor':_0x42190e,'markDeletions':_0x46a8c4['asSuggestions']||!0x1}));}return{'channelId':_0x562164['channelId'],'sessionId':_0x562164['sessionId'],'version':_0x562164['version'],'options':_0x46a8c4,'operations':_0x23275a};}applyPatch(_0x45477a){const _0x4f7fe8=this['editor'];if(_0x45477a['channelId']!==this['_getChannelId']()||_0x45477a['sessionId']!==this['_getSessionId']())throw new dt('documentcompare-apply-session-mismatch',_0x4f7fe8);const _0xe952fa=_0x45477a['options']['asSuggestions']||!0x1,_0x387591=Object['values'](_0x45477a['operations'])['filter'](_0x3080d5=>_0x3080d5['length']);if(!_0x387591['length'])return;if(_0xe952fa&&!_0x4f7fe8['plugins']['has']('TrackChangesEditing'))throw new dt('documentcompare-no-track-changes',_0x4f7fe8);const _0x1db750=_0x4f7fe8['model']['document']['history']['getOperations'](_0x45477a['version']),_0x532f08=[];for(const _0x23fe0e of _0x387591)_0x532f08['push'](..._0x3d40c6(_0x23fe0e,_0x1db750,{'document':_0x4f7fe8['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1})['operationsA']);const _0x2b87e1=function(_0x1810c5,_0x24cfe5){const _0x3a7f83=_0x1810c5['model']['document'],_0x1be616=new Map();for(const _0x287bad of _0x3a7f83['roots'])_0x1be616['set'](_0x287bad['rootName'],vl(_0x287bad));for(const _0x4140e0 of _0x24cfe5)if('marker'!==_0x4140e0['type']){if(_0x4140e0 instanceof _0x15cf85||_0x4140e0 instanceof ti)return{'reason':'unsupported','operation':_0x4140e0};try{const _0x5cd928=_0x4140e0['clone']();if(_0x5cd928['baseVersion']=null,_0x5cd928['isDocumentOperation']=!0x1,ts(_0x5cd928,_0x1be616),_0x2b9cbb(_0x5cd928))continue;_0x5cd928['_validate'](),_0x5cd928['_execute']();}catch(_0x3106ec){return{'reason':'invalid','operation':_0x4140e0,'cause':_0x3106ec};}}return null;}(_0x4f7fe8,_0x532f08);if(_0x2b87e1){if('unsupported'===_0x2b87e1['reason'])throw new dt('documentcompare-applypatch-unsupported-operation',_0x4f7fe8,{'history':_0x1db750,'patch':_0x45477a,'operation':_0x2b87e1['operation']});throw new dt('documentcompare-applypatch-invalid-patch',_0x4f7fe8,{'history':_0x1db750,'patch':_0x45477a,'operation':_0x2b87e1['operation']},_0x2b87e1['cause']);}try{_0x4f7fe8['model']['change'](_0xb295ee=>{_0xe952fa?_0x4f7fe8['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x532f08):_0x4f7fe8['plugins']['get'](Un)['applyOperations'](_0xb295ee,_0x532f08);});}catch(_0x1529b1){throw new dt('documentcompare-apply-failed',_0x4f7fe8,{'history':_0x1db750,'patch':_0x45477a},_0x1529b1);}}async['process'](_0x2cf832,_0x494162={}){const _0x2c7f7f=this['makeSnapshot'](),_0x271ea4=await _0x2cf832(_0x2c7f7f);try{return this['applyPatch'](this['diffSnapshot'](_0x2c7f7f,_0x271ea4,_0x494162)),!0x0;}catch(_0x1c6192){if(!_0x494162['overwriteOnError'])throw _0x1c6192;return this['editor']['data']['set'](_0x271ea4,{'suppressErrorInCollaboration':!0x0}),!0x1;}}_getSessionId(){const _0x14e91=this['editor'];return _0x14e91['plugins']['has']('RealTimeCollaborationClient')?_0x14e91['plugins']['get']('RealTimeCollaborationClient')['sessionId']:(this['_sessionId']||(this['_sessionId']=Xt()),this['_sessionId']);}_getChannelId(){return this['editor']['config']['get']('collaboration.channelId')||'';}};export{Ac as AIActions,us as AIAdapter,Ps as AIAssistant,xs as AIAssistantUI,Gh as AIBalloon,fh as AIChat,Kr as AIChatController,ta as AIChatFeedCustomElementView,Ch as AIChatHistory,wh as AIChatHistoryController,Ah as AIChatHistoryUI,Hr as AIChatInteraction,yh as AIChatShortcuts,ch as AIChatUI,Gc as AICheckRunSingleRootResult,$s as AIConnector,nr as AIContext,js as AIContextLibrary,Js as AICore,ur as AICoreError,cr as AIDocumentProcessingGateway,ar as AIDocumentProcessingRunResult,Pn as AIEditing,Qh as AIEditorIntegration,_r as AIErrorReporter,dr as AIErrorSink,Jn as AIGateway,Lr as AIInteraction,Xs as AIModels,Ec as AIQuickActions,ac as AIQuickActionsUI,Nr as AIReply,ds as AIRequestError,el as AIReviewCheck,qc as AIReviewCheckResult,Xc as AIReviewCheckResultChange,jc as AIReviewCheckRun,dl as AIReviewGateway,_l as AIReviewMode,Zc as AIReviewModeController,$c as AIReviewModeEditing,Bc as AIReviewModeUI,hr as AIRunResult,or as AIRunSingleRootResult,Ks as AITabs,Fs as AITabsMainView,Bs as AITabsView,Vs as AITextAdapter,kh as AIToggleButtonUI,Rl as AITranslate,ml as AITranslateController,fl as AITranslateGateway,Cl as AITranslateUI,Us as AWSTextAdapter,Ll as DocumentCompare,Hs as OpenAITextAdapter,gs as ShowAIAssistantCommand,Nh as ToggleAICommand,Tr as createResizeButton,Ms as getDefaultAICommands,jn as markOperationsAsAI};
|