@ckeditor/ckeditor5-ai 44.1.0 → 44.2.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/README.md +1 -1
- package/build/ai.js +2 -2
- package/build/translations/cs.js +1 -1
- package/dist/index-content.css +2 -2
- package/dist/index-editor.css +2 -2
- package/dist/index.css +9 -9
- package/dist/index.js +3 -3
- package/dist/translations/af.d.ts +2 -2
- package/dist/translations/af.js +2 -2
- package/dist/translations/af.umd.js +2 -2
- package/dist/translations/ar.d.ts +2 -2
- package/dist/translations/ar.js +2 -2
- package/dist/translations/ar.umd.js +2 -2
- package/dist/translations/ast.d.ts +2 -2
- package/dist/translations/ast.js +2 -2
- package/dist/translations/ast.umd.js +2 -2
- package/dist/translations/az.d.ts +2 -2
- package/dist/translations/az.js +2 -2
- package/dist/translations/az.umd.js +2 -2
- package/dist/translations/bg.d.ts +2 -2
- package/dist/translations/bg.js +2 -2
- package/dist/translations/bg.umd.js +2 -2
- package/dist/translations/bn.d.ts +2 -2
- package/dist/translations/bn.js +2 -2
- package/dist/translations/bn.umd.js +2 -2
- package/dist/translations/bs.d.ts +2 -2
- package/dist/translations/bs.js +2 -2
- package/dist/translations/bs.umd.js +2 -2
- package/dist/translations/ca.d.ts +2 -2
- package/dist/translations/ca.js +2 -2
- package/dist/translations/ca.umd.js +2 -2
- package/dist/translations/cs.d.ts +2 -2
- package/dist/translations/cs.js +2 -2
- package/dist/translations/cs.umd.js +2 -2
- package/dist/translations/da.d.ts +2 -2
- package/dist/translations/da.js +2 -2
- package/dist/translations/da.umd.js +2 -2
- package/dist/translations/de-ch.d.ts +2 -2
- package/dist/translations/de-ch.js +2 -2
- package/dist/translations/de-ch.umd.js +2 -2
- package/dist/translations/de.d.ts +2 -2
- package/dist/translations/de.js +2 -2
- package/dist/translations/de.umd.js +2 -2
- package/dist/translations/el.d.ts +2 -2
- package/dist/translations/el.js +2 -2
- package/dist/translations/el.umd.js +2 -2
- package/dist/translations/en-au.d.ts +2 -2
- package/dist/translations/en-au.js +2 -2
- package/dist/translations/en-au.umd.js +2 -2
- package/dist/translations/en-gb.d.ts +2 -2
- package/dist/translations/en-gb.js +2 -2
- package/dist/translations/en-gb.umd.js +2 -2
- package/dist/translations/en.d.ts +2 -2
- package/dist/translations/en.js +2 -2
- package/dist/translations/en.umd.js +2 -2
- package/dist/translations/eo.d.ts +2 -2
- package/dist/translations/eo.js +2 -2
- package/dist/translations/eo.umd.js +2 -2
- package/dist/translations/es-co.d.ts +2 -2
- package/dist/translations/es-co.js +2 -2
- package/dist/translations/es-co.umd.js +2 -2
- package/dist/translations/es.d.ts +2 -2
- package/dist/translations/es.js +2 -2
- package/dist/translations/es.umd.js +2 -2
- package/dist/translations/et.d.ts +2 -2
- package/dist/translations/et.js +2 -2
- package/dist/translations/et.umd.js +2 -2
- package/dist/translations/eu.d.ts +2 -2
- package/dist/translations/eu.js +2 -2
- package/dist/translations/eu.umd.js +2 -2
- package/dist/translations/fa.d.ts +2 -2
- package/dist/translations/fa.js +2 -2
- package/dist/translations/fa.umd.js +2 -2
- package/dist/translations/fi.d.ts +2 -2
- package/dist/translations/fi.js +2 -2
- package/dist/translations/fi.umd.js +2 -2
- package/dist/translations/fr.d.ts +2 -2
- package/dist/translations/fr.js +2 -2
- package/dist/translations/fr.umd.js +2 -2
- package/dist/translations/gl.d.ts +2 -2
- package/dist/translations/gl.js +2 -2
- package/dist/translations/gl.umd.js +2 -2
- package/dist/translations/gu.d.ts +2 -2
- package/dist/translations/gu.js +2 -2
- package/dist/translations/gu.umd.js +2 -2
- package/dist/translations/he.d.ts +2 -2
- package/dist/translations/he.js +2 -2
- package/dist/translations/he.umd.js +2 -2
- package/dist/translations/hi.d.ts +2 -2
- package/dist/translations/hi.js +2 -2
- package/dist/translations/hi.umd.js +2 -2
- package/dist/translations/hr.d.ts +2 -2
- package/dist/translations/hr.js +2 -2
- package/dist/translations/hr.umd.js +2 -2
- package/dist/translations/hu.d.ts +2 -2
- package/dist/translations/hu.js +2 -2
- package/dist/translations/hu.umd.js +2 -2
- package/dist/translations/hy.d.ts +2 -2
- package/dist/translations/hy.js +2 -2
- package/dist/translations/hy.umd.js +2 -2
- package/dist/translations/id.d.ts +2 -2
- package/dist/translations/id.js +2 -2
- package/dist/translations/id.umd.js +2 -2
- package/dist/translations/it.d.ts +2 -2
- package/dist/translations/it.js +2 -2
- package/dist/translations/it.umd.js +2 -2
- package/dist/translations/ja.d.ts +2 -2
- package/dist/translations/ja.js +2 -2
- package/dist/translations/ja.umd.js +2 -2
- package/dist/translations/jv.d.ts +2 -2
- package/dist/translations/jv.js +2 -2
- package/dist/translations/jv.umd.js +2 -2
- package/dist/translations/kk.d.ts +2 -2
- package/dist/translations/kk.js +2 -2
- package/dist/translations/kk.umd.js +2 -2
- package/dist/translations/km.d.ts +2 -2
- package/dist/translations/km.js +2 -2
- package/dist/translations/km.umd.js +2 -2
- package/dist/translations/kn.d.ts +2 -2
- package/dist/translations/kn.js +2 -2
- package/dist/translations/kn.umd.js +2 -2
- package/dist/translations/ko.d.ts +2 -2
- package/dist/translations/ko.js +2 -2
- package/dist/translations/ko.umd.js +2 -2
- package/dist/translations/ku.d.ts +2 -2
- package/dist/translations/ku.js +2 -2
- package/dist/translations/ku.umd.js +2 -2
- package/dist/translations/lt.d.ts +2 -2
- package/dist/translations/lt.js +2 -2
- package/dist/translations/lt.umd.js +2 -2
- package/dist/translations/lv.d.ts +2 -2
- package/dist/translations/lv.js +2 -2
- package/dist/translations/lv.umd.js +2 -2
- package/dist/translations/ms.d.ts +2 -2
- package/dist/translations/ms.js +2 -2
- package/dist/translations/ms.umd.js +2 -2
- package/dist/translations/nb.d.ts +2 -2
- package/dist/translations/nb.js +2 -2
- package/dist/translations/nb.umd.js +2 -2
- package/dist/translations/ne.d.ts +2 -2
- package/dist/translations/ne.js +2 -2
- package/dist/translations/ne.umd.js +2 -2
- package/dist/translations/nl.d.ts +2 -2
- package/dist/translations/nl.js +2 -2
- package/dist/translations/nl.umd.js +2 -2
- package/dist/translations/no.d.ts +2 -2
- package/dist/translations/no.js +2 -2
- package/dist/translations/no.umd.js +2 -2
- package/dist/translations/oc.d.ts +2 -2
- package/dist/translations/oc.js +2 -2
- package/dist/translations/oc.umd.js +2 -2
- package/dist/translations/pl.d.ts +2 -2
- package/dist/translations/pl.js +2 -2
- package/dist/translations/pl.umd.js +2 -2
- package/dist/translations/pt-br.d.ts +2 -2
- package/dist/translations/pt-br.js +2 -2
- package/dist/translations/pt-br.umd.js +2 -2
- package/dist/translations/pt.d.ts +2 -2
- package/dist/translations/pt.js +2 -2
- package/dist/translations/pt.umd.js +2 -2
- package/dist/translations/ro.d.ts +2 -2
- package/dist/translations/ro.js +2 -2
- package/dist/translations/ro.umd.js +2 -2
- package/dist/translations/ru.d.ts +2 -2
- package/dist/translations/ru.js +2 -2
- package/dist/translations/ru.umd.js +2 -2
- package/dist/translations/si.d.ts +2 -2
- package/dist/translations/si.js +2 -2
- package/dist/translations/si.umd.js +2 -2
- package/dist/translations/sk.d.ts +2 -2
- package/dist/translations/sk.js +2 -2
- package/dist/translations/sk.umd.js +2 -2
- package/dist/translations/sl.d.ts +2 -2
- package/dist/translations/sl.js +2 -2
- package/dist/translations/sl.umd.js +2 -2
- package/dist/translations/sq.d.ts +2 -2
- package/dist/translations/sq.js +2 -2
- package/dist/translations/sq.umd.js +2 -2
- package/dist/translations/sr-latn.d.ts +2 -2
- package/dist/translations/sr-latn.js +2 -2
- package/dist/translations/sr-latn.umd.js +2 -2
- package/dist/translations/sr.d.ts +2 -2
- package/dist/translations/sr.js +2 -2
- package/dist/translations/sr.umd.js +2 -2
- package/dist/translations/sv.d.ts +2 -2
- package/dist/translations/sv.js +2 -2
- package/dist/translations/sv.umd.js +2 -2
- package/dist/translations/th.d.ts +2 -2
- package/dist/translations/th.js +2 -2
- package/dist/translations/th.umd.js +2 -2
- package/dist/translations/ti.d.ts +2 -2
- package/dist/translations/ti.js +2 -2
- package/dist/translations/ti.umd.js +2 -2
- package/dist/translations/tk.d.ts +2 -2
- package/dist/translations/tk.js +2 -2
- package/dist/translations/tk.umd.js +2 -2
- package/dist/translations/tr.d.ts +2 -2
- package/dist/translations/tr.js +2 -2
- package/dist/translations/tr.umd.js +2 -2
- package/dist/translations/tt.d.ts +2 -2
- package/dist/translations/tt.js +2 -2
- package/dist/translations/tt.umd.js +2 -2
- package/dist/translations/ug.d.ts +2 -2
- package/dist/translations/ug.js +2 -2
- package/dist/translations/ug.umd.js +2 -2
- package/dist/translations/uk.d.ts +2 -2
- package/dist/translations/uk.js +2 -2
- package/dist/translations/uk.umd.js +2 -2
- package/dist/translations/ur.d.ts +2 -2
- package/dist/translations/ur.js +2 -2
- package/dist/translations/ur.umd.js +2 -2
- package/dist/translations/uz.d.ts +2 -2
- package/dist/translations/uz.js +2 -2
- package/dist/translations/uz.umd.js +2 -2
- package/dist/translations/vi.d.ts +2 -2
- package/dist/translations/vi.js +2 -2
- package/dist/translations/vi.umd.js +2 -2
- package/dist/translations/zh-cn.d.ts +2 -2
- package/dist/translations/zh-cn.js +2 -2
- package/dist/translations/zh-cn.umd.js +2 -2
- package/dist/translations/zh.d.ts +2 -2
- package/dist/translations/zh.js +2 -2
- package/dist/translations/zh.umd.js +2 -2
- package/lang/translations/af.po +1 -1
- package/lang/translations/ar.po +1 -1
- package/lang/translations/ast.po +1 -1
- package/lang/translations/az.po +1 -1
- package/lang/translations/bg.po +1 -1
- package/lang/translations/bn.po +1 -1
- package/lang/translations/bs.po +1 -1
- package/lang/translations/ca.po +1 -1
- package/lang/translations/cs.po +2 -2
- package/lang/translations/da.po +1 -1
- package/lang/translations/de-ch.po +1 -1
- package/lang/translations/de.po +1 -1
- package/lang/translations/el.po +1 -1
- package/lang/translations/en-au.po +1 -1
- package/lang/translations/en-gb.po +1 -1
- package/lang/translations/en.po +1 -1
- package/lang/translations/eo.po +1 -1
- package/lang/translations/es-co.po +1 -1
- package/lang/translations/es.po +1 -1
- package/lang/translations/et.po +1 -1
- package/lang/translations/eu.po +1 -1
- package/lang/translations/fa.po +1 -1
- package/lang/translations/fi.po +1 -1
- package/lang/translations/fr.po +1 -1
- package/lang/translations/gl.po +1 -1
- package/lang/translations/gu.po +1 -1
- package/lang/translations/he.po +1 -1
- package/lang/translations/hi.po +1 -1
- package/lang/translations/hr.po +1 -1
- package/lang/translations/hu.po +1 -1
- package/lang/translations/hy.po +1 -1
- package/lang/translations/id.po +1 -1
- package/lang/translations/it.po +1 -1
- package/lang/translations/ja.po +1 -1
- package/lang/translations/jv.po +1 -1
- package/lang/translations/kk.po +1 -1
- package/lang/translations/km.po +1 -1
- package/lang/translations/kn.po +1 -1
- package/lang/translations/ko.po +1 -1
- package/lang/translations/ku.po +1 -1
- package/lang/translations/lt.po +1 -1
- package/lang/translations/lv.po +1 -1
- package/lang/translations/ms.po +1 -1
- package/lang/translations/nb.po +1 -1
- package/lang/translations/ne.po +1 -1
- package/lang/translations/nl.po +1 -1
- package/lang/translations/no.po +1 -1
- package/lang/translations/oc.po +1 -1
- package/lang/translations/pl.po +1 -1
- package/lang/translations/pt-br.po +1 -1
- package/lang/translations/pt.po +1 -1
- package/lang/translations/ro.po +1 -1
- package/lang/translations/ru.po +1 -1
- package/lang/translations/si.po +1 -1
- package/lang/translations/sk.po +1 -1
- package/lang/translations/sl.po +1 -1
- package/lang/translations/sq.po +1 -1
- package/lang/translations/sr-latn.po +1 -1
- package/lang/translations/sr.po +1 -1
- package/lang/translations/sv.po +1 -1
- package/lang/translations/th.po +1 -1
- package/lang/translations/ti.po +1 -1
- package/lang/translations/tk.po +1 -1
- package/lang/translations/tr.po +1 -1
- package/lang/translations/tt.po +1 -1
- package/lang/translations/ug.po +1 -1
- package/lang/translations/uk.po +1 -1
- package/lang/translations/ur.po +1 -1
- package/lang/translations/uz.po +1 -1
- package/lang/translations/vi.po +1 -1
- package/lang/translations/zh-cn.po +1 -1
- package/lang/translations/zh.po +1 -1
- package/package.json +31 -8
- package/src/adapters/aiadapter.d.ts +1 -1
- package/src/adapters/aiadapter.js +2 -2
- package/src/adapters/aitextadapter.d.ts +1 -1
- package/src/adapters/aitextadapter.js +2 -2
- package/src/adapters/awstextadapter.d.ts +1 -1
- package/src/adapters/awstextadapter.js +2 -2
- package/src/adapters/openaitextadapter.d.ts +1 -1
- package/src/adapters/openaitextadapter.js +2 -2
- package/src/aiassistant.d.ts +21 -3
- package/src/aiassistant.js +2 -2
- package/src/aiassistantediting.d.ts +3 -3
- package/src/aiassistantediting.js +2 -2
- package/src/aiassistantui.d.ts +1 -1
- package/src/aiassistantui.js +2 -2
- package/src/aiconfig.d.ts +1 -1
- package/src/aiconfig.js +1 -1
- package/src/augmentation.d.ts +1 -1
- package/src/augmentation.js +1 -1
- package/src/index.d.ts +3 -2
- package/src/index.js +2 -2
- package/src/legacyerrors.d.ts +1 -1
- package/src/legacyerrors.js +2 -2
- package/src/ui/aiassistantcontroller.d.ts +1 -1
- package/src/ui/aiassistantcontroller.js +3 -3
- package/src/ui/form/aiformcontentarea.d.ts +1 -1
- package/src/ui/form/aiformcontentarea.js +2 -2
- package/src/ui/form/aiformerrorview.d.ts +1 -1
- package/src/ui/form/aiformerrorview.js +2 -2
- package/src/ui/form/aiformpromptview.d.ts +1 -1
- package/src/ui/form/aiformpromptview.js +2 -2
- package/src/ui/form/aiformtoolbarview.d.ts +1 -1
- package/src/ui/form/aiformtoolbarview.js +2 -2
- package/src/ui/form/aiformview.d.ts +1 -1
- package/src/ui/form/aiformview.js +2 -2
- package/src/ui/form/aihistorylistitemview.d.ts +1 -1
- package/src/ui/form/aihistorylistitemview.js +2 -2
- package/src/ui/form/aihistorylistview.d.ts +1 -1
- package/src/ui/form/aihistorylistview.js +2 -2
- package/src/ui/form/prompthistory.d.ts +1 -1
- package/src/ui/form/prompthistory.js +2 -2
- package/src/ui/showaiassistantcommand.d.ts +1 -1
- package/src/ui/showaiassistantcommand.js +2 -2
- package/src/utils/common-translations.d.ts +1 -1
- package/src/utils/common-translations.js +2 -2
- package/src/utils/normalizecommandsconfig.d.ts +1 -1
- package/src/utils/normalizecommandsconfig.js +2 -2
- package/theme/ai-dropdown.css +1 -1
- package/theme/ai-form.css +1 -1
- package/theme/ai.css +1 -1
- package/dist/adapters/aiadapter.d.ts +0 -60
- package/dist/adapters/aitextadapter.d.ts +0 -150
- package/dist/adapters/awstextadapter.d.ts +0 -183
- package/dist/adapters/openaitextadapter.d.ts +0 -187
- package/dist/aiassistant.d.ts +0 -393
- package/dist/aiassistantediting.d.ts +0 -59
- package/dist/aiassistantui.d.ts +0 -62
- package/dist/aiconfig.d.ts +0 -73
- package/dist/augmentation.d.ts +0 -31
- package/dist/index.d.ts +0 -17
- package/dist/legacyerrors.d.ts +0 -9
- package/dist/ui/aiassistantcontroller.d.ts +0 -113
- package/dist/ui/form/aiformcontentarea.d.ts +0 -52
- package/dist/ui/form/aiformerrorview.d.ts +0 -30
- package/dist/ui/form/aiformpromptview.d.ts +0 -50
- package/dist/ui/form/aiformtoolbarview.d.ts +0 -62
- package/dist/ui/form/aiformview.d.ts +0 -145
- package/dist/ui/form/aihistorylistitemview.d.ts +0 -22
- package/dist/ui/form/aihistorylistview.d.ts +0 -39
- package/dist/ui/form/prompthistory.d.ts +0 -24
- package/dist/ui/showaiassistantcommand.d.ts +0 -44
- package/dist/utils/common-translations.d.ts +0 -13
- package/dist/utils/normalizecommandsconfig.d.ts +0 -18
package/build/translations/cs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e){const o=e.cs=e.cs||{};o.dictionary=Object.assign(o.dictionary||{},{"AI Assistant":"UI asistent","AI Commands":"Příkazy UI","AI is writing":"AI píše","AI is writing...":"UI píše…",AI_ERROR_CONTEXT_LENGTH:"Vybraný obsah je příliš dlouhý",AI_ERROR_FAILED:"Komunikace se službou UI se nezdařila",AI_ERROR_GET_HEADERS:"Příprava vybraných záhlaví se nezdařila",AI_ERROR_GET_PARAMETERS:"Příprava parametrů požadavku se nezdařila",AI_ERROR_MODERATION:"Požadovaný dotaz neprošel pravidly moderování",AI_ERROR_UNSUPPORTED_MODEL:"Požadovaný AI model („%0“) není podporován",AI_INSERT_CONTENT:"Vložit",AI_REPLACE_CONTENT:"Nahradit",Arabic:"Arabština","Ask AI and your prompts will be listed here for you to use later.":"Zeptejte se UI a vaše výzvy uvedeme zde, abyste je mohli později použít.","Ask AI to edit or generate":"Požádat UI o úpravu nebo generování","Ask AI to improve generated text":"Požádat UI o vylepšení generovaného textu",Business:"Obchodní",Casual:"Neformální","Change style":"Změnit styl
|
|
1
|
+
!function(e){const o=e.cs=e.cs||{};o.dictionary=Object.assign(o.dictionary||{},{"AI Assistant":"UI asistent","AI Commands":"Příkazy UI","AI is writing":"AI píše","AI is writing...":"UI píše…",AI_ERROR_CONTEXT_LENGTH:"Vybraný obsah je příliš dlouhý",AI_ERROR_FAILED:"Komunikace se službou UI se nezdařila",AI_ERROR_GET_HEADERS:"Příprava vybraných záhlaví se nezdařila",AI_ERROR_GET_PARAMETERS:"Příprava parametrů požadavku se nezdařila",AI_ERROR_MODERATION:"Požadovaný dotaz neprošel pravidly moderování",AI_ERROR_UNSUPPORTED_MODEL:"Požadovaný AI model („%0“) není podporován",AI_INSERT_CONTENT:"Vložit",AI_REPLACE_CONTENT:"Nahradit",Arabic:"Arabština","Ask AI and your prompts will be listed here for you to use later.":"Zeptejte se UI a vaše výzvy uvedeme zde, abyste je mohli později použít.","Ask AI to edit or generate":"Požádat UI o úpravu nebo generování","Ask AI to improve generated text":"Požádat UI o vylepšení generovaného textu",Business:"Obchodní",Casual:"Neformální","Change style":"Změnit styl","Change tone":"Změnit tón",Confident:"Sebevědomý",Continue:"Pokračovat",Copy:"Kopírovat",Direct:"Přímý","Edit or review":"Upravit nebo zkontrolovat","Empty history":"Prázdná historie",English:"Angličtina","Error during AI content generation: %0":"Chyba při generování obsahu pomocí AI: %0",French:"Francouzština",Friendly:"Přátelský","Generate from selection":"Generovat z výběru","Generated content: %0":"Generovaný obsah: %0",German:"Němčina",Hindi:"Hindština",History:"Historie","Improve writing":"Zlepšit psaný projev","Insert below":"Vložit níže",Journalism:"Novinářský",Legal:"Právní","Make longer":"Prodloužit","Make shorter":"Zkrátit",Poetic:"Poetický",Portuguese:"Portugalština",Professional:"Profesionální","Prompt history":"Historie výzev","Simplified Chinese":"Zjednodušená čínština","Simplify language":"Zjednodušit jazyk",Spanish:"Španělština",Stop:"Zastavit",Submit:"Potvrdit",Summarize:"Shrnout",Translate:"Přeložit","Try again":"Zkusit znovu"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
package/dist/index-content.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-
|
|
2
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
|
package/dist/index-editor.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-
|
|
2
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
5
|
:root{
|
|
6
6
|
--ck-ai-form-submit-button-text-color:var(--ck-color-text);
|
package/dist/index.css
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-
|
|
2
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
5
|
/*
|
|
6
6
|
* What you're currently looking at is the source code of a legally protected, proprietary software.
|
|
7
7
|
* CKEditor 5 Collaboration is licensed under a commercial license and protected by copyright law. Where not otherwise indicated,
|
|
8
8
|
* all CKEditor 5 Collaboration content is authored by CKSource engineers and consists of CKSource-owned intellectual property.
|
|
9
9
|
*
|
|
10
|
-
* Copyright (c) 2003-
|
|
10
|
+
* Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
11
11
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
12
12
|
*/
|
|
13
13
|
|
|
@@ -121,16 +121,16 @@
|
|
|
121
121
|
* CKEditor 5 Collaboration is licensed under a commercial license and protected by copyright law. Where not otherwise indicated,
|
|
122
122
|
* all CKEditor 5 Collaboration content is authored by CKSource engineers and consists of CKSource-owned intellectual property.
|
|
123
123
|
*
|
|
124
|
-
* Copyright (c) 2003-
|
|
124
|
+
* Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
125
125
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
126
126
|
*/
|
|
127
127
|
|
|
128
128
|
/*
|
|
129
|
-
* Copyright (c) 2003-
|
|
129
|
+
* Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
130
130
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
131
131
|
*/
|
|
132
132
|
/*
|
|
133
|
-
* Copyright (c) 2003-
|
|
133
|
+
* Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
134
134
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
135
135
|
*/
|
|
136
136
|
|
|
@@ -165,16 +165,16 @@
|
|
|
165
165
|
* CKEditor 5 Collaboration is licensed under a commercial license and protected by copyright law. Where not otherwise indicated,
|
|
166
166
|
* all CKEditor 5 Collaboration content is authored by CKSource engineers and consists of CKSource-owned intellectual property.
|
|
167
167
|
*
|
|
168
|
-
* Copyright (c) 2003-
|
|
168
|
+
* Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
169
169
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
170
170
|
*/
|
|
171
171
|
|
|
172
172
|
/*
|
|
173
|
-
* Copyright (c) 2003-
|
|
173
|
+
* Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
174
174
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
175
175
|
*/
|
|
176
176
|
/*
|
|
177
|
-
* Copyright (c) 2003-
|
|
177
|
+
* Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
178
178
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
179
179
|
*/
|
|
180
180
|
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2003-
|
|
2
|
+
* Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
*
|
|
5
5
|
*
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x54da78,Command as _0x4958db,icons as _0x3fbb72}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x1cc8ef,CKEditorError as _0x2f0c49,ObservableMixin as _0x5c535c,global as _0x1fdbd5,isVisible as it,Rect as st,Collection as _0x51fc66,FocusTracker as _0x50c6e1,KeystrokeHandler as ts,first as _0x228044}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as rt,ButtonView as _0x4927a1,View as _0x2d211f,SpinnerView as _0x21ec4f,IconView as _0x197aec,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x32a887,ButtonLabelView as te,FocusCycler as _0x3afe16,createLabeledTextarea as _0x553bc1,Dialog as _0x5320b6,createDropdown as _0x1b379d,addMenuToDropdown as _0x3bc814,MenuBarMenuView as _0xedaeab,MenuBarMenuListItemButtonView as _0x5834a2,DialogViewPosition as _0x43526d,MenuBarMenuListView as _0x3db9f4,MenuBarMenuListItemView as _0x48d377}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as at}from'ckeditor5-collaboration/dist/index.js';import{UpcastWriter as _0x5c996c,Matcher as _0x29a78c,DataTransfer as _0x365b4e,DomEventData as _0x203c5f}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x3eb923,escape as _0x36522b}from'lodash-es';import{ClipboardMarkersUtils as _0x1ceaf2}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{BedrockRuntimeClient as _0x515b30,InvokeModelWithResponseStreamCommand as _0xbf5ada,InvokeModelCommand as _0x3b73f5}from'@aws-sdk/client-bedrock-runtime';const I='_ungrouppedCommands';function o(_0x3a767d,_0x475fbc){const _0x39fdb1=(0x0,_0x475fbc['t'])('Other');return _0x3a767d['length']?'groupId'in _0x3a767d[0x0]?_0x3a767d:[{'groupId':I,'groupLabel':_0x39fdb1,'order':0x1/0x0,'commands':_0x3a767d}]:[{'groupId':I,'groupLabel':_0x39fdb1,'order':0x1/0x0,'commands':[]}];}const u='ai-ui';class a extends _0x54da78{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x3f120d}=this,_0x1ce718=['ck-fake-ai-selection'];_0x3f120d['config']['get']('ai.useTheme')&&_0x1ce718['push']('ck-ai-assistant-ui_theme'),_0x3f120d['conversion']['for']('editingDowncast')['markerToHighlight']({'model':u,'view':{'classes':_0x1ce718,'priority':0xc}}),_0x3f120d['conversion']['for']('editingDowncast')['markerToElement']({'model':u,'view':(_0x9f685d,{writer:_0x1457e2})=>{if(!_0x9f685d['markerRange']['isCollapsed'])return null;const _0x1865d3=_0x1457e2['createUIElement']('span');return _0x1457e2['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x1865d3),_0x1865d3;}});}['afterInit'](){!async function(_0x1b8244){const _0x2642b9=_0x2640f7([0x4d,0x59,0x6a,0x45,0x4e,0x55,0x6e,0x31,0x47,0x4a,0x7a,0x67,0x68,0x6d,0x76,0x78,0x63,0x35,0x41,0x46,0x73,0x54,0x42,0x75,0x74,0x51,0x65,0x39,0x48,0x37,0x4c,0x52,0x70,0x36,0x49,0x43,0x32,0x77,0x50,0x33,0x61,0x79,0x30,0x6b,0x4b,0x56,0x62,0x58,0x66,0x5a,0x6f,0x71,0x4f,0x57,0x69,0x44,0x38,0x6c,0x64,0x34,0x72,0x53]),_0xc923e0=0x3ab66382,_0x4cef80=0x3ab13a5a^_0xc923e0,_0xef9dbd=window[_0x2640f7([0x44,0x61,0x74,0x65])][_0x2640f7([0x6e,0x6f,0x77])](),_0x17db3c=_0x1b8244[_0x2640f7([0x65,0x64,0x69,0x74,0x6f,0x72])],_0xdd7258=new window[(_0x2640f7([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5f57d5=>{_0x17db3c[_0x2640f7([0x6f,0x6e,0x63,0x65])](_0x2640f7([0x72,0x65,0x61,0x64,0x79]),_0x5f57d5);}),_0x23d008={[_0x2640f7([0x6b,0x74,0x79])]:_0x2640f7([0x45,0x43]),[_0x2640f7([0x75,0x73,0x65])]:_0x2640f7([0x73,0x69,0x67]),[_0x2640f7([0x63,0x72,0x76])]:_0x2640f7([0x50,0x2d,0x32,0x35,0x36]),[_0x2640f7([0x78])]:_0x2640f7([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]),[_0x2640f7([0x79])]:_0x2640f7([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]),[_0x2640f7([0x61,0x6c,0x67])]:_0x2640f7([0x45,0x53,0x32,0x35,0x36])},_0x4d1691=_0x17db3c[_0x2640f7([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x2640f7([0x67,0x65,0x74])](_0x2640f7([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x494a7b(){let _0x3d7e78,_0x464a99=null,_0x2812e7=null;try{if(_0x4d1691==_0x2640f7([0x47,0x50,0x4c]))return _0x2640f7([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x3d7e78=_0x46a37a(),!_0x3d7e78)return _0x2640f7([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x3d7e78[_0x2640f7([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x2812e7=_0xc101f4(_0x3d7e78[_0x2640f7([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x3d7e78[_0x2640f7([0x6a,0x74,0x69])])),await _0x59c654()?_0x138b2b()?_0x5b86ad()?_0x2640f7([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x184b69()?(_0x3d7e78[_0x2640f7([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2640f7([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x464a99=_0x6473cd(_0x2640f7([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x3d7e78[_0x2640f7([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2640f7([0x74,0x72,0x69,0x61,0x6c])&&(_0x464a99=_0x6473cd(_0x2640f7([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),_0x3d7e78[_0x2640f7([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2640f7([0x64,0x65,0x76,0x65,0x6c,0x6f,0x70,0x6d,0x65,0x6e,0x74])&&(_0x464a99=_0x6473cd(_0x2640f7([0x44,0x65,0x76,0x65,0x6c,0x6f,0x70,0x6d,0x65,0x6e,0x74,0x4c,0x69,0x6d,0x69,0x74]))),await _0x2ad6c6()):_0x2640f7([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x2640f7([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x2640f7([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x4bc5af){return _0x2640f7([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x5b86ad(){const _0x4f0351=[_0x2640f7([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x2640f7([0x74,0x72,0x69,0x61,0x6c])][_0x2640f7([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3d7e78[_0x2640f7([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0xef9dbd/0x3e8:0xe10*_0x4cef80;return _0x3d7e78[_0x2640f7([0x65,0x78,0x70])]<_0x4f0351;}function _0x138b2b(){const _0x9ac636=_0x3d7e78[_0x2640f7([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x9ac636&&(!!_0x9ac636[_0x2640f7([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2640f7([0x2a]))||!!_0x9ac636[_0x2640f7([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2640f7([0x41,0x49])));}function _0x184b69(){const _0x49def5=_0x3d7e78[_0x2640f7([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x49def5||0x0==_0x49def5[_0x2640f7([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x548455}=new URL(window[_0x2640f7([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x49def5[_0x2640f7([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x548455))return!0x0;const _0x223d33=_0x548455[_0x2640f7([0x73,0x70,0x6c,0x69,0x74])](_0x2640f7([0x2e]));return _0x49def5[_0x2640f7([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x610ac2=>_0x610ac2[_0x2640f7([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2640f7([0x2a])))[_0x2640f7([0x6d,0x61,0x70])](_0x3d49ae=>_0x3d49ae[_0x2640f7([0x73,0x70,0x6c,0x69,0x74])](_0x2640f7([0x2e])))[_0x2640f7([0x73,0x6f,0x6d,0x65])](_0x206e9a=>_0x223d33[_0x2640f7([0x65,0x76,0x65,0x72,0x79])]((_0x1e0799,_0x5eccf7)=>_0x206e9a[_0x5eccf7]===_0x1e0799||_0x206e9a[_0x5eccf7]===_0x2640f7([0x2a])));}function _0x2ad6c6(){return _0x464a99&&_0x2812e7?new window[(_0x2640f7([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4ad465,_0x494076)=>{_0x464a99[_0x2640f7([0x74,0x68,0x65,0x6e])](_0x4ad465,_0x494076),_0x2812e7[_0x2640f7([0x74,0x68,0x65,0x6e])](_0x11fcd6=>{_0x11fcd6!=_0x2640f7([0x56,0x61,0x6c,0x69,0x64])&&_0x4ad465(_0x11fcd6);},_0x494076);}):_0x464a99||_0x2812e7||_0x2640f7([0x56,0x61,0x6c,0x69,0x64]);}}function _0xc101f4(_0x24432b,_0x39ab6b){return new window[(_0x2640f7([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x444f5f=>{if(_0x3c6e9c())return _0x444f5f(_0x2640f7([0x56,0x61,0x6c,0x69,0x64]));_0x1cc4f8(),_0x17db3c[_0x2640f7([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x2640f7([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x16953f=!0x1;const _0x509898=_0x1cc8ef();function _0x468b94(_0x580e7c){return!!_0x580e7c&&(typeof _0x580e7c===_0x2640f7([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x580e7c===_0x2640f7([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x580e7c[_0x2640f7([0x74,0x68,0x65,0x6e])]===_0x2640f7([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x580e7c[_0x2640f7([0x63,0x61,0x74,0x63,0x68])]===_0x2640f7([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x46e8c2(_0x2f0b81){_0x11ac0a(_0x2f0b81)[_0x2640f7([0x74,0x68,0x65,0x6e])](_0x28f91a=>{if(!_0x28f91a||_0x28f91a[_0x2640f7([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x2640f7([0x6f,0x6b]))return _0x2640f7([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x479c8a(_0x20741a(_0x509898+_0x39ab6b))!=_0x28f91a[_0x2640f7([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x2640f7([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x2640f7([0x56,0x61,0x6c,0x69,0x64]);})[_0x2640f7([0x74,0x68,0x65,0x6e])](_0x5c0c56=>(_0x55a670(),_0x5c0c56),()=>{const _0x57b60b=_0x330c34();return null==_0x57b60b?(_0x55a670(),_0x2640f7([0x56,0x61,0x6c,0x69,0x64])):_0x2640f7(_0xef9dbd-_0x57b60b>(0x1ebae782^_0xc923e0)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x2640f7([0x74,0x68,0x65,0x6e])](_0x444f5f)[_0x2640f7([0x63,0x61,0x74,0x63,0x68])](()=>{_0x444f5f(_0x2640f7([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x23fe19=0x3a808d02^_0xc923e0;function _0x55a670(){const _0x5bbd79=_0x2640f7([0x6c,0x6c,0x63,0x74,0x2d])+_0x479c8a(_0x20741a(_0x24432b)),_0x1d8bb3=_0x449efa(_0x479c8a(window[_0x2640f7([0x4d,0x61,0x74,0x68])][_0x2640f7([0x63,0x65,0x69,0x6c])](_0xef9dbd/_0x23fe19)));window[_0x2640f7([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2640f7([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x5bbd79,_0x1d8bb3);}function _0x330c34(){const _0x4c085c=_0x2640f7([0x6c,0x6c,0x63,0x74,0x2d])+_0x479c8a(_0x20741a(_0x24432b)),_0x419081=window[_0x2640f7([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2640f7([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4c085c);return _0x419081?window[_0x2640f7([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x449efa(_0x419081),0x10)*_0x23fe19:null;}function _0x11ac0a(_0x48615c){return new window[(_0x2640f7([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x39fbce,_0x2b9931)=>{_0x48615c[_0x2640f7([0x74,0x68,0x65,0x6e])](_0x39fbce,_0x2b9931),window[_0x2640f7([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x2b9931,0x3ab7b742^_0xc923e0);});}}_0x17db3c[_0x2640f7([0x6f,0x6e])](_0x2640f7([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x3a3565,_0x109cb4)=>{if(_0x109cb4[0x0]!=_0x24432b)return _0x444f5f(_0x2640f7([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x109cb4[0x1]={..._0x109cb4[0x1],[_0x2640f7([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x509898};},{[_0x2640f7([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2640f7([0x68,0x69,0x67,0x68])}),_0x17db3c[_0x2640f7([0x6f,0x6e])](_0x2640f7([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x386d6b=>{_0x468b94(_0x386d6b[_0x2640f7([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x16953f=!0x0,_0x46e8c2(_0x386d6b[_0x2640f7([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x2640f7([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2640f7([0x6c,0x6f,0x77])}),_0xdd7258[_0x2640f7([0x74,0x68,0x65,0x6e])](()=>{_0x16953f||_0x444f5f(_0x2640f7([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x3c6e9c(){return _0x17db3c[_0x2640f7([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2640f7([0x76,0x69,0x65,0x77])][_0x2640f7([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x2640f7([0x61,0x75,0x74,0x6f]);}function _0x1cc4f8(){_0x17db3c[_0x2640f7([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2640f7([0x76,0x69,0x65,0x77])][_0x2640f7([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x2640f7([0x61,0x75,0x74,0x6f]);}}function _0x6473cd(_0x13f145){const _0x352864=[new window[(_0x2640f7([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3af683=>setTimeout(_0x3af683,0x3abf5d4e^_0xc923e0)),_0xdd7258[_0x2640f7([0x74,0x68,0x65,0x6e])](()=>new window[(_0x2640f7([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x234177=>{let _0x283393=0x0;_0x17db3c[_0x2640f7([0x6d,0x6f,0x64,0x65,0x6c])][_0x2640f7([0x6f,0x6e])](_0x2640f7([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x5195d7,_0x9c63ee)=>{_0x9c63ee[0x0][_0x2640f7([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x283393++,_0x283393==(0x3ab6627a^_0xc923e0)&&(_0x234177(),_0x5195d7[_0x2640f7([0x6f,0x66,0x66])]());});}))];return window[_0x2640f7([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x2640f7([0x72,0x61,0x63,0x65])](_0x352864)[_0x2640f7([0x74,0x68,0x65,0x6e])](()=>_0x13f145);}async function _0xd52904(){await _0xdd7258,_0x17db3c[_0x2640f7([0x6d,0x6f,0x64,0x65,0x6c])][_0x2640f7([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x530629,_0x17db3c[_0x2640f7([0x6d,0x6f,0x64,0x65,0x6c])][_0x2640f7([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x530629,_0x17db3c[_0x2640f7([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x2640f7([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x2b536b(_0x222e56){const _0x5c553d=_0x2ed5ce();_0x17db3c[_0x5c553d]=_0x2640f7([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x222e56,_0x222e56!=_0x2640f7([0x56,0x61,0x6c,0x69,0x64])&&_0xd52904();}function _0x2ed5ce(){const _0x4c441e=window[_0x2640f7([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x2640f7([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x2640f7([0x6e,0x6f,0x77])]())[_0x2640f7([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x2640f7([0x2e]),'');let _0x264cf9=_0x2640f7([0x4d]);for(let _0x4da4fc=0x0;_0x4da4fc<_0x4c441e[_0x2640f7([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4da4fc+=0x2){let _0xbbc0fb=window[_0x2640f7([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4c441e[_0x2640f7([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4da4fc,_0x4da4fc+0x2));_0xbbc0fb>=_0x2642b9[_0x2640f7([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0xbbc0fb-=_0x2642b9[_0x2640f7([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x264cf9+=_0x2642b9[_0xbbc0fb];}return _0x264cf9;}function _0x46a37a(){const _0x6ddd13=_0x4d1691[_0x2640f7([0x73,0x70,0x6c,0x69,0x74])](_0x2640f7([0x2e]));if(0x3!=_0x6ddd13[_0x2640f7([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x563f22(_0x6ddd13[0x1]);function _0x563f22(_0xcfbd4f){const _0x1a7bd1=_0x451108(_0xcfbd4f);return _0x1a7bd1&&_0x60aeba()?_0x1a7bd1:null;function _0x60aeba(){const _0x19f4c2=_0x1a7bd1[_0x2640f7([0x6a,0x74,0x69])],_0x221389=window[_0x2640f7([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x19f4c2[_0x2640f7([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x19f4c2[_0x2640f7([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x1e9408={..._0x1a7bd1,[_0x2640f7([0x6a,0x74,0x69])]:_0x19f4c2[_0x2640f7([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x19f4c2[_0x2640f7([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x1e9408[_0x2640f7([0x76,0x63])],_0x20741a(_0x1e9408)==_0x221389;}}}async function _0x59c654(){let _0x9073ad=!0x0;try{const _0x1af171=_0x4d1691[_0x2640f7([0x73,0x70,0x6c,0x69,0x74])](_0x2640f7([0x2e])),[_0x4105f3,_0x39146c,_0x1a9781]=_0x1af171;return _0xff253f(_0x4105f3),await _0x19998e(_0x4105f3,_0x39146c,_0x1a9781),_0x9073ad;}catch(_0x2dedaa){return!0x1;}function _0xff253f(_0xa78588){const _0x558268=_0x451108(_0xa78588);_0x558268&&_0x558268[_0x2640f7([0x61,0x6c,0x67])]==_0x2640f7([0x45,0x53,0x32,0x35,0x36])||(_0x9073ad=!0x1);}async function _0x19998e(_0x3cece7,_0x101f46,_0x347af8){const _0x4001e8=window[_0x2640f7([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x2640f7([0x66,0x72,0x6f,0x6d])](_0x41c437(_0x347af8),_0x44dd33=>_0x44dd33[_0x2640f7([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x4c4827=new window[(_0x2640f7([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x2640f7([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x3cece7+_0x2640f7([0x2e])+_0x101f46),_0x29b54e=window[_0x2640f7([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x2640f7([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x29b54e)return;const _0x20339b=await _0x29b54e[_0x2640f7([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x2640f7([0x6a,0x77,0x6b]),_0x23d008,{[_0x2640f7([0x6e,0x61,0x6d,0x65])]:_0x2640f7([0x45,0x43,0x44,0x53,0x41]),[_0x2640f7([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x2640f7([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x2640f7([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x29b54e[_0x2640f7([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x2640f7([0x6e,0x61,0x6d,0x65])]:_0x2640f7([0x45,0x43,0x44,0x53,0x41]),[_0x2640f7([0x68,0x61,0x73,0x68])]:{[_0x2640f7([0x6e,0x61,0x6d,0x65])]:_0x2640f7([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x20339b,_0x4001e8,_0x4c4827)||(_0x9073ad=!0x1);}}function _0x451108(_0x58ddc1){return _0x58ddc1[_0x2640f7([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x2640f7([0x65,0x79]))?JSON[_0x2640f7([0x70,0x61,0x72,0x73,0x65])](_0x41c437(_0x58ddc1)):null;}function _0x41c437(_0x396f3f){return window[_0x2640f7([0x61,0x74,0x6f,0x62])](_0x396f3f[_0x2640f7([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x2640f7([0x2b]))[_0x2640f7([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x2640f7([0x2f])));}function _0x20741a(_0x107fa0){let _0x23e421=0x1505;function _0x33e282(_0x42793d){for(let _0x5db568=0x0;_0x5db568<_0x42793d[_0x2640f7([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5db568++){const _0x42b4ff=_0x42793d[_0x2640f7([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x5db568);_0x23e421=(_0x23e421<<0x5)+_0x23e421+_0x42b4ff,_0x23e421&=_0x23e421;}}function _0x49de64(_0x340403){Array[_0x2640f7([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x340403)?_0x340403[_0x2640f7([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x49de64):_0x340403&&typeof _0x340403==_0x2640f7([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x2640f7([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x340403)[_0x2640f7([0x73,0x6f,0x72,0x74])]()[_0x2640f7([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x34858d,_0x34cf9a])=>{_0x33e282(_0x34858d),_0x49de64(_0x34cf9a);}):_0x33e282(window[_0x2640f7([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x340403));}return _0x49de64(_0x107fa0),_0x23e421>>>0x0;}function _0x479c8a(_0x280fd3){return _0x280fd3[_0x2640f7([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x2640f7([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x2640f7([0x30]));}function _0x449efa(_0x4eac52){return _0x4eac52[_0x2640f7([0x73,0x70,0x6c,0x69,0x74])]('')[_0x2640f7([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x2640f7([0x6a,0x6f,0x69,0x6e])]('');}function _0x530629(){}function _0x2640f7(_0x339ecb){return _0x339ecb['map'](_0x5cc766=>String['fromCharCode'](_0x5cc766))['join']('');}_0x2b536b(await _0x494a7b());}(this);}['showFakeVisualSelection'](){const _0x2dd42f=this['editor']['model'];_0x2dd42f['change'](_0x13deea=>{const _0x550e26=_0x2dd42f['document']['selection']['getFirstRange']();if(_0x2dd42f['markers']['has'](u))_0x13deea['updateMarker'](u,{'range':_0x550e26});else{if(_0x550e26['start']['isAtEnd']){const _0x245a5d=_0x550e26['start']['getLastMatchingPosition'](({item:_0x8e50cd})=>!_0x2dd42f['schema']['isContent'](_0x8e50cd),{'boundaries':_0x550e26});_0x13deea['addMarker'](u,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x13deea['createRange'](_0x245a5d,_0x550e26['end'])});}else _0x13deea['addMarker'](u,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x550e26});}});}['hideFakeVisualSelection'](){const _0x274984=this['editor']['model'];_0x274984['markers']['has'](u)&&_0x274984['change'](_0xd9ae7a=>{_0xd9ae7a['removeMarker'](u);});}['insertContent'](_0x56f301,_0x287a2d){const _0x178b7c=_0x287a2d||this['editor']['model']['markers']['get'](u)['getRange']();if(!this['editor']['model']['canEditAt'](_0x178b7c))return;const _0x6b1678=this['editor']['data']['processor']['toView'](_0x56f301),_0x19bf25=this['editor']['data']['toModel'](_0x6b1678);this['editor']['model']['change'](_0x48adfd=>{this['hideFakeVisualSelection']();const _0x2a5e05=this['editor']['model']['insertContent'](_0x19bf25,_0x178b7c);_0x2a5e05&&_0x48adfd['setSelection'](_0x2a5e05);});}['insertContentBelow'](_0x449054){const {model:_0x1aa88d}=this['editor'],_0x60e259=Array['from'](_0x1aa88d['createSelection'](this['editor']['model']['markers']['get'](u)['getRange']())['getSelectedBlocks']()),_0x389b4d=_0x60e259['length']?_0x1aa88d['createPositionAfter'](_0x60e259['pop']()):_0x1aa88d['document']['selection']['getLastPosition']();this['insertContent'](_0x449054,_0x389b4d);}}class v extends _0x54da78{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x2f0c49('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x3d0729){super(_0x3d0729),this['name']='AIRequestError';}}function i(_0x538eb1,_0x2d745f,_0x2b917a){const t=_0x538eb1['t'];switch(_0x2d745f){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',_0x2b917a);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2b917a);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'},_0x2b917a);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x2d745f;}}class y extends _0x4958db{['_commandDefinitions'];constructor(_0x1af467,_0x762373){super(_0x1af467),this['_commandDefinitions']=_0x762373,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x1acb21,_0x3157b8,_0x55a416)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x55a416));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x48960d,_0x254602,_0x4fe353)=>{this['enabledCommandsIds']=_0x4fe353?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x1823ed=this['editor']['model'];this['_hasContext']=function(_0x2cc993){const _0x147444=_0x2cc993['document']['selection'];return _0x147444['isCollapsed']?0x0!==[..._0x147444['getSelectedBlocks']()]['length']&&![..._0x147444['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x2cc993['hasContent'](_0x147444['getFirstRange']());}(_0x1823ed);const _0x2b0c68=_0x1823ed['document']['selection'],_0x362ce7=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x220c06 of _0x2b0c68['getRanges']())for(const _0x5f3068 of _0x220c06['getItems']())if(_0x5f3068['is']('element')&&_0x362ce7['includes'](_0x5f3068['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x5bb3f9='',_0x446d04='',_0x180274='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x5bb3f9,_0x446d04,_0x180274);}}function G(_0x14f706,_0x23b746){const _0x50f704=new Set();for(const _0x1ee618 of _0x14f706['values']())(_0x23b746||!0x1===_0x1ee618['requiresContent'])&&_0x50f704['add'](_0x1ee618['id']);return Array['from'](_0x50f704);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class C extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x5c535c(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x360a8d,_0x4a09a1,_0x58f6db){super(),this['editor']=_0x360a8d,this['textAdapter']=_0x4a09a1,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x58f6db,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x5bbf04,_0x344d81,_0x2c30a1)=>{this['view']['value']=this['_sanitizeHTML'](_0x2c30a1);}),this['listenTo'](this['view'],'submitPrompt',(_0x21b336,_0x568f49)=>{const _0x32b2fd=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x568f49,_0x32b2fd,'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:_0x2f44fc,query:_0x4ee884,htmlContent:_0x3a4f10,label:_0x51c58a,mainActionLabel:_0x3ffcec}){this['view']['prompt']=_0x51c58a,this['view']['mainAction']=_0x3ffcec,this['initialContext']=_0x3a4f10,_0x4ee884&&(this['view']['isRendered']?this['_handleQuery'](_0x4ee884,_0x3a4f10,_0x2f44fc,_0x51c58a):this['view']['once']('render',()=>{this['_handleQuery'](_0x4ee884,_0x3a4f10,_0x2f44fc,_0x51c58a);}));}['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'](_0x1c512c,_0x3e2398,_0xe4206b,_0x10eb15){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x3e2398,this['previousQuery']=_0x1c512c,this['previousLabel']=_0x10eb15||_0x1c512c,this['previousActionId']=_0xe4206b,new Promise(_0x2e301f=>{this['textAdapter']['makeRequest']({'query':_0x1c512c,'context':_0x3e2398,'onData':_0x1fa979=>{this['currentResponse']=_0x1fa979,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0xe4206b})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0xe60043=>{_0xe60043 instanceof R?this['view']['handleError'](_0xe60043['message']):this['view']['handleError'](),_0x2e301f();})['finally'](()=>{this['stopProcessing'](),_0x2e301f();});});}['_parseAndNormalizeContent'](_0x44d549,_0xc41ca2=!0x1){const _0x2cdac7=Z['exec'](_0x44d549);_0x44d549=_0x2cdac7?_0x44d549['substring'](_0x2cdac7[0x1]['length']):_0x44d549['length']<0x64&&!_0xc41ca2?'':this['_stripMarkdownSyntax'](_0x44d549);const _0x534464=this['_domParser']['parseFromString'](_0x44d549,'text/html');if(_0x2cdac7){const _0x4ca0f6=Array['from'](_0x534464['body']['childNodes']);_0x4ca0f6['reverse']();for(const _0xacd292 of _0x4ca0f6){if(_0xacd292['nodeType']==Node['ELEMENT_NODE'])break;_0xacd292['remove']();}}const _0x36b2a0=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x534464['body']));return this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x36b2a0),this['editor']['data']['stringify'](this['editor']['data']['toModel'](_0x36b2a0));}['_normalizeResponseHeadings'](_0x967f0){const _0x42c351=new _0x5c996c(this['editor']['editing']['view']['document']),_0x4b19fd=new _0x29a78c({'name':/^h[1-5]$/}),_0x569340=[];let _0x19c2c2=!0x1;for(const _0x112b6b of _0x967f0)_0x112b6b['is']('element')&&_0x4b19fd['match'](_0x112b6b)&&(_0x569340['push'](_0x112b6b),'h1'==_0x112b6b['name']&&(_0x19c2c2=!0x0));if(_0x19c2c2){for(const _0x5572da of _0x569340)_0x42c351['rename']('h'+(parseInt(_0x5572da['name'][0x1])+0x1),_0x5572da);}}['_isH1TagSupportEnabled'](){const {data:_0x54fceb,editing:_0x5d65ea}=this['editor'],_0x322c51=_0x54fceb['htmlProcessor']['toView']('<h1></h1>'),_0x1ffaf4=_0x54fceb['toView'](_0x54fceb['toModel'](_0x322c51));return!!_0x5d65ea['view']['domConverter']['viewToDom'](_0x1ffaf4)['querySelector']('h1');}['_sanitizeHTML'](_0x294f7f){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x294f7f),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x565bd1){const _0x52e2af=_0x565bd1['trim']();return _0x52e2af['startsWith']('```html')?_0x52e2af['endsWith']('```')?_0x52e2af['substring'](0x7,_0x52e2af['length']-0x3):_0x52e2af['substring'](0x7):_0x565bd1;}}const x={'REPLACE':'replace','INSERT':'insert'};class nt extends rt{constructor(_0x26d56a){super(_0x26d56a),this['set']('isVisible',!0x1),this['set']('mainAction',x['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x4adece=>i(_0x26d56a,'AI_'+_0x4adece['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x26d56a,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x26d56a,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x26d56a,'Stop'));const _0x49d7e6=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x49d7e6['if']('isVisible','ck-hidden',_0x22497f=>!_0x22497f)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x49a5a4,_0x516a00){const _0x535c71=new _0x4927a1(this['locale']);return _0x535c71['set']({'label':_0x49a5a4,'class':_0x516a00||'','isVisible':!0x0,'withText':!0x0}),_0x535c71;}}var U='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M5\x202.801a.7.7\x200\x200\x200-.7.7v11.5a.8.8\x200\x200\x201-1.6\x200v-11.5a2.3\x202.3\x200\x200\x201\x202.3-2.3h6.5a.8.8\x200\x200\x201\x200\x201.6H5Zm.7\x203.7a2.3\x202.3\x200\x200\x201\x202.3-2.3h7a2.3\x202.3\x200\x200\x201\x202.3\x202.3v10a2.3\x202.3\x200\x200\x201-2.3\x202.3H8a2.3\x202.3\x200\x200\x201-2.3-2.3v-10Zm2.3-.7a.7.7\x200\x200\x200-.7.7v10a.7.7\x200\x200\x200\x20.7.7h7a.7.7\x200\x200\x200\x20.7-.7v-10a.7.7\x200\x200\x200-.7-.7H8Z\x22/></svg>';class W extends _0x2d211f{['contentFieldView'];['copyButtonView'];constructor(_0x376b02,_0x48c3ce=''){super(_0x376b02),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0xccd0a9=this['bindTemplate'];this['contentFieldView']=new ct(_0x376b02,_0x48c3ce),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0xccd0a9['if']('isVisible','ck-hidden',_0x45c334=>!_0x45c334)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0xccd0a9['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 _0x3f5749=!0x1;this['on']('change:value',(_0x4ac6d3,_0x388585,_0x3b7bc6)=>{const _0x4bdeb8=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x3b7bc6),this['isProcessing']&&_0x4bdeb8&&!_0x3f5749&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x2ffb5a,_0x49c33d,_0x117339)=>{_0x3f5749=!0x1,_0x117339?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x3f5749=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x3f5749=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x1a0d8b=this['locale'],_0x1acc4c=new _0x4927a1(this['locale']),_0x239037='ck-ai-form__copy-button';return _0x1acc4c['set']({'label':i(_0x1a0d8b,'Copy'),'icon':U,'class':_0x239037,'tooltip':!0x0}),_0x1acc4c['bind']('isVisible')['to'](this,'value',_0xaa9cf9=>!!_0xaa9cf9),_0x1acc4c['bind']('isEnabled')['to'](this,'isProcessing',_0x3c6d1b=>!_0x3c6d1b),_0x1acc4c['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x1acc4c['icon']=_0x3fbb72['check'],_0x1acc4c['class']=_0x239037+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x1acc4c['icon']=U,_0x1acc4c['class']=_0x239037;},0x3e8);}),_0x1acc4c;}['_copyHTMLToClipboard'](_0xd3ad00){const {window:_0x3f92bc,document:_0x2d2d65}=_0x1fdbd5;if(_0x3f92bc['ClipboardItem']){const {Blob:_0x3759b9,ClipboardItem:_0x54392c}=_0x3f92bc,_0xf5bf16=[new _0x54392c({'text/html':new _0x3759b9([_0xd3ad00['innerHTML']],{'type':'text/html'}),'text/plain':new _0x3759b9([_0xd3ad00['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0xf5bf16);}else{const _0x299721=_0x2d2d65['createElement']('div');_0x299721['style']['position']='absolute',_0x299721['style']['left']='-9999px',_0x299721['innerHTML']='<span>[</span>'+_0xd3ad00['innerHTML']+'<span>]</span>',_0x2d2d65['body']['appendChild'](_0x299721);const _0x30004f=_0x2d2d65['createRange']();_0x30004f['setStartAfter'](_0x299721['firstElementChild']),_0x30004f['setEndBefore'](_0x299721['lastElementChild']);const _0x3c416c=_0x3f92bc['getSelection']();_0x3c416c['removeAllRanges'](),_0x3c416c['addRange'](_0x30004f),_0x2d2d65['execCommand']('copy'),_0x299721['remove']();}}}class ct extends _0x2d211f{constructor(_0x28cf7b,_0x477c3d=''){super(_0x28cf7b),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x477c3d,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x289bce){this['element']['innerHTML']=_0x289bce;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x421bf2=new _0x2d211f(),_0x2c0e2c=this['locale'],_0x2209e9=new _0x21ec4f();return _0x2209e9['isVisible']=!0x0,_0x421bf2['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x2209e9,{'text':i(_0x2c0e2c,'AI\x20is\x20writing...')}]}),_0x421bf2['render'](),_0x421bf2;}}class tt extends _0x2d211f{constructor(_0x47c0dc,_0x2cf39a=''){super(_0x47c0dc);const _0x2e59c0=new _0x197aec(),_0x25b4ba=this['bindTemplate'];this['set']('text',_0x2cf39a),_0x2e59c0['content']='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M9.9\x204.385a1.2\x201.2\x200\x200\x200-.44.44h.002l-5.284\x209.15a1.2\x201.2\x200\x200\x200\x201.04\x201.8h10.564a1.2\x201.2\x200\x200\x200\x201.04-1.8l-5.282-9.15a1.2\x201.2\x200\x200\x200-1.64-.44Zm.05\x208.363a.301.301\x200\x200\x201\x20.115-.023h.9a.301.301\x200\x200\x201\x20.3.3v.9a.3.3\x200\x200\x201-.3.3h-.9a.3.3\x200\x200\x201-.3-.3v-.9a.3.3\x200\x200\x201\x20.185-.277Zm-.185-4.723a.3.3\x200\x200\x201\x20.3-.3h.9a.3.3\x200\x200\x201\x20.3.3v3.4a.3.3\x200\x200\x201-.3.3h-.9a.301.301\x200\x200\x201-.3-.3v-3.4Z\x22/></svg>\x0a',this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x2e59c0,{'text':_0x25b4ba['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x4aa275,_0x402629){super(_0x4aa275,_0x402629),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',(_0x19b033,_0x638b76)=>{_0x19b033['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x638b76());});}['_createSubmitButton'](){const _0xa4c5c6=new _0x4927a1(this['locale']),_0x331f75=this['locale'];return _0xa4c5c6['set']({'icon':'<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.875\x204.419a.75.75\x200\x200\x200-1.5\x200v7.25H6.818l2.33-1.955a.75.75\x200\x200\x200-.963-1.15l-3.792\x203.182a.75.75\x200\x200\x200-.17.945c.046.11.118.208.21.284l3.788\x203.18a.75.75\x200\x201\x200\x20.965-1.149l-2.19-1.837h7.629c.69\x200\x201.25-.56\x201.25-1.25v-7.5Z\x22/></svg>','label':i(_0x331f75,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0xa4c5c6['on']('execute',()=>{this['submit']();}),_0xa4c5c6['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x5b8321,_0x5ebc0b)=>!_0x5b8321&&_0x5ebc0b),_0xa4c5c6;}['_createShowHistoryButton'](){const _0x52a78d=new _0x4927a1(this['locale']),_0x57fbd4=this['resultsView'],_0x1489de=this['locale'];_0x52a78d['set']({'label':i(_0x1489de,'History'),'withText':!0x1,'icon':_0x3fbb72['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x52a78d['bind']('isOn')['to'](_0x57fbd4,'isVisible'),_0x52a78d['bind']('isEnabled')['to'](this,'isEnabled'),_0x52a78d['on']('execute',()=>{_0x57fbd4['isVisible']=!_0x57fbd4['isVisible'],_0x57fbd4['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x1fe2e7=()=>{_0x1fdbd5['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x4727d1=new st(this['queryView']['fieldView']['element']),_0xe4c2e4=_0x4727d1['width'],_0x255c4d='rtl'===_0x1489de['uiLanguageDirection']?'left':'right';_0x4727d1['excludeScrollbarsAndBorders'](),_0x52a78d['element']['style'][_0x255c4d]=_0xe4c2e4-_0x4727d1['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x1fe2e7),this['on']('render',_0x1fe2e7),_0x52a78d;}['submit'](){const _0x2d32e1=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x2d32e1);}['focus'](_0x29a812){-0x1===_0x29a812?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x424ed3){super(_0x424ed3),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x424ed3,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x3cdabc=0x0;for(const _0x49e87a of this['items'])_0x3cdabc+=_0x49e87a['items']['length'];return{'resultsCount':_0x3cdabc,'totalItemsCount':_0x3cdabc};}['_createClearHistoryButton'](){const _0x25a0db=this['locale'],_0xfc38e0=new _0x4927a1(this['locale']);return _0xfc38e0['set']({'label':'('+i(_0x25a0db,'Clear')+')','withText':!0x0}),_0xfc38e0['on']('execute',()=>this['fire']('clearHistory')),_0xfc38e0;}}class hs extends _0x32a887{constructor(_0x35445a){super();const _0x5e8836=new te(),_0x1f24ee=new _0x4927a1(this['locale'],_0x5e8836);this['children']['add'](_0x1f24ee),_0x1f24ee['set']({'label':_0x35445a['prompt'],'withText':!0x0}),_0x1f24ee['on']('execute',()=>{this['fire']('execute',{'value':_0x3eb923(_0x35445a['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x51fc66{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x1d5988,_0x2e92b7)=>{const _0x5289ca=Ss(_0x2e92b7['prompt']);for(const _0x44b1bc of this)if(_0x44b1bc!=_0x2e92b7&&Ss(_0x44b1bc['prompt'])===_0x5289ca){this['remove'](_0x44b1bc);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x6eec88=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x6eec88));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x120af7=>_0x120af7)));}}function Ss(_0x374a5d){return _0x374a5d['toLowerCase']()['trim']();}class K extends _0x2d211f{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x41b6e1,_0x23d38d,_0x7cbfb9=''){super(_0x41b6e1),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',x['REPLACE']),this['_promptHistory']=new os(),this['errorView']=new tt(_0x41b6e1),this['contentArea']=new W(_0x41b6e1,_0x7cbfb9),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 _0x50c6e1(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x3afe16({'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 _0x88ee5b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x23d38d],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x88ee5b['if']('isError','ck-hidden',_0x2fbeea=>!_0x2fbeea)]},'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'](_0x2b9d58=0x1){-0x1===_0x2b9d58?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 _0x8a426f=this['locale'],_0x15789f=new ht(_0x8a426f,{'queryView':{'label':i(_0x8a426f,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x553bc1,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x8a426f,'Empty\x20history'),'secondary':i(_0x8a426f,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x15789f['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x407179,_0x51f7a3)=>_0x407179&&!_0x51f7a3),this['listenTo'](_0x15789f,'submit',(_0x13461f,_0x46ce83)=>{this['prompt']=_0x46ce83;const _0x58d9e3=_0x36522b(_0x46ce83);this['fire']('submitPrompt',_0x58d9e3),_0x46ce83['trim']()&&this['_promptHistory']['add']({'prompt':_0x58d9e3},0x0);},{'priority':'high'}),_0x15789f;}['_createHistoryView'](){const _0x27e027=new rs(this['locale']);return _0x27e027['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x27e027['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x27e027;}['_createToolbar'](){const _0x345155=new nt(this['locale']);return _0x345155['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x53a332,_0x2000d2,_0x28f99f)=>_0x53a332&&!_0x2000d2&&!!_0x28f99f),_0x345155['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x345155['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x1600c1,_0x41c1a4,_0x281b1b)=>_0x1600c1&&!_0x41c1a4&&!!_0x281b1b),_0x345155['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x345155['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x548a42,_0x318618)=>_0x548a42&&!_0x318618),_0x345155['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x345155['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x345155['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x345155;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x5eb452=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x5eb452,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x344e7a){const _0x40cd28=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x344e7a||i(_0x40cd28,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}var E='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.346\x209.422a.151.151\x200\x200\x201\x20.284\x200l.548\x201.484a.152.152\x200\x200\x200\x20.09.089l1.483.549a.151.151\x200\x200\x201\x200\x20.284l-1.483.548a.151.151\x200\x200\x200-.09.09l-.548\x201.483a.152.152\x200\x200\x201-.142.1.151.151\x200\x200\x201-.142-.1l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.15.15\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.089-.09l.549-1.483Z\x22/><path\x20d=\x22M16.306\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.15.15\x200\x200\x200\x20.089.09l1.483.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.15.15\x200\x200\x200-.09.09l-.548\x201.482a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.09-.089l.548-1.483Z\x22/><path\x20d=\x22M7.665\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.151.151\x200\x200\x200\x20.09.09l1.482.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.151.151\x200\x200\x200-.09.09L7.95\x206.267a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.151.151\x200\x200\x200-.089-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.483-.549a.151.151\x200\x200\x200\x20.09-.089l.548-1.483-.001.001Z\x22/><path\x20d=\x22M14.72\x207.946a.848.848\x200\x200\x200\x20.25-.591.824.824\x200\x200\x200-.241-.588l-1.943-1.938a.812.812\x200\x200\x200-.588-.241.838.838\x200\x200\x200-.591.25l-1.545\x201.539\x203.115\x203.115\x201.542-1.546h.001Z\x22/><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M1.19\x2015.636a.96.96\x200\x200\x201\x20.281-.679l7.835-7.834\x203.121\x203.12-7.834\x207.835a.959.959\x200\x200\x201-1.358\x200l-1.764-1.764a.96.96\x200\x200\x201-.28-.678Zm9.22-5.391-1.121-1.12-6.479\x206.478\x201.121\x201.121\x206.479-6.479Z\x22/></svg>';const j=globalThis['DataTransfer'];class n extends _0x54da78{['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[_0x1ceaf2,a,v,_0x5320b6];}constructor(_0x17d9a9){super(_0x17d9a9),_0x17d9a9['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x17d9a9['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x17d9a9['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x17d9a9['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0xb40aa9}=this;this['_aiAdapter']=_0xb40aa9['plugins']['get'](v),this['_dialog']=_0xb40aa9['plugins']['get'](_0x5320b6),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x103790=new y(_0xb40aa9,Array['from'](this['_commandDefinitions']['values']()));_0xb40aa9['commands']['add']('showAIAssistant',_0x103790),_0xb40aa9['ui']['componentFactory']['add']('aiCommands',_0x5bcfbd=>{const _0x24fd0a=_0x1b379d(_0x5bcfbd);return _0x24fd0a['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x24fd0a['buttonView']['set']({'label':i(_0x5bcfbd,'AI\x20Commands'),'icon':E,'tooltip':!0x0}),_0x24fd0a['on']('execute',_0xb69fb7=>this['_onExecute'](_0xb69fb7['source']['id'])),_0x3bc814(_0x24fd0a,_0xb40aa9['ui']['view']['body'],function(_0x208ce0){const _0x39d564=o(_0x208ce0['config']['get']('ai.aiAssistant.commands'),_0x208ce0['locale']),_0x5828e4=B(_0x208ce0,_0x39d564)['filter'](_0x8a9a1f=>_0x8a9a1f['commands']['length']);if(0x1===_0x5828e4['length'])return B(_0x208ce0,_0x5828e4[0x0]['commands'])['map'](_0x386561=>({'id':_0x386561['id'],'label':_0x386561['label']}));return _0x5828e4['map'](_0xe3927e=>{const {groupId:_0x285664,groupLabel:_0x4d2854,commands:_0x2a0ca1}=_0xe3927e,_0x402da5=B(_0x208ce0,_0x2a0ca1)['map'](_0x98cfbe=>({'id':_0x98cfbe['id'],'label':_0x98cfbe['label']}));return{'id':_0x285664,'menu':_0x4d2854||_0x285664,'children':_0x402da5};});}(_0xb40aa9),{'ariaLabel':i(_0x5bcfbd,'AI\x20Commands')}),_0x24fd0a['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x103790['on']('change:enabledCommandsIds',_0x3e5370),_0x24fd0a['menuView']['once']('render',_0x3e5370),_0x24fd0a;function _0x3e5370(){_0x24fd0a['isEnabled']=_0x103790['enabledCommandsIds']['length']>0x0;for(const _0x3f7b2a of _0x24fd0a['menuView']['buttons'])_0x3f7b2a['isEnabled']=_0x103790['enabledCommandsIds']['includes'](_0x3f7b2a['id']);}}),_0xb40aa9['ui']['componentFactory']['add']('menuBar:aiCommands',_0x4da87c=>{const _0x106b3f=new _0xedaeab(_0x4da87c);_0x106b3f['buttonView']['set']({'label':i(_0x4da87c,'AI\x20Commands'),'icon':E}),_0x106b3f['bind']('isEnabled')['to'](_0x103790,'enabledCommandsIds',_0x1b08bb=>_0x1b08bb['length']>0x0);const _0x520668=o(_0xb40aa9['config']['get']('ai.aiAssistant.commands'),_0x4da87c);return this['_populateMenuBarMenu'](_0x103790,_0x106b3f,_0x520668,_0x1c11dc=>this['_onExecute'](_0x1c11dc)),_0x106b3f;}),_0xb40aa9['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x2a7263=this['_createAIAssistantUIButton'](_0x4927a1);return _0x2a7263['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x2a7263;}),_0xb40aa9['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x47b029=this['_createAIAssistantUIButton'](_0x5834a2);return _0x47b029['set']({'role':'menuitemcheckbox'}),_0x47b029;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x1dee4e=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x529821;for(const _0x5d17f7 in _0x1dee4e){const _0xb0f130=_0x5d17f7,_0x371534=_0x1dee4e[_0xb0f130];if('aiLicenseKeyValid'==_0x371534||'aiLicenseKeyInvalid'==_0x371534||'aiLicenseKeyExpired'==_0x371534||'aiLicenseKeyDomainLimit'==_0x371534||'aiLicenseKeyNotAllowed'==_0x371534||'aiLicenseKeyEvaluationLimit'==_0x371534||'aiLicenseKeyTrialLimit'==_0x371534||'aiLicenseKeyDevelopmentLimit'==_0x371534||'aiLicenseKeyUsageLimit'==_0x371534){delete _0x1dee4e[_0xb0f130],_0x529821=_0x371534,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x529821&&_0x1dee4e['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x529821&&_0x1dee4e['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x529821&&_0x1dee4e['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x529821&&_0x1dee4e['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x529821&&_0x1dee4e['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x529821&&_0x1dee4e['_showLicenseError']('trialLimit'),'aiLicenseKeyDevelopmentLimit'==_0x529821&&_0x1dee4e['_showLicenseError']('developmentLimit'),'aiLicenseKeyUsageLimit'==_0x529821&&_0x1dee4e['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x51906e='',_0x5eba92='',_0x41f4cb='custom'){const _0x13b4cb=this['editor'],_0x1c4b54=_0x13b4cb['editing']['view'],_0x107c1d=_0x13b4cb['plugins']['get'](a),_0x1a61a0=_0x13b4cb['plugins']['get'](_0x1ceaf2);_0x107c1d['showFakeVisualSelection']();const _0x1e1f99=new j(),_0x47413c=new ClipboardEvent('copy',{'clipboardData':_0x1e1f99}),_0x33f19b=new _0x365b4e(_0x1e1f99),_0x55f699=new _0x203c5f(_0x1c4b54,_0x47413c,{'dataTransfer':_0x33f19b});_0x1a61a0['_forceMarkersCopy']('comment',()=>{_0x1c4b54['document']['fire']('copy',_0x55f699);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new C(_0x13b4cb,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x1c14ea=_0x33f19b['getData']('text/html');const _0xe47d70=_0x13b4cb['model']['document']['selection'],_0x4f8e90=Array['from'](_0xe47d70['getRanges']());0x1===_0x4f8e90['length']&&_0x4f8e90[0x0]['isFlat']&&!_0xe47d70['getSelectedElement']()&&''!==_0x1c14ea['replace'](/ /g,'')['trim']()&&(_0x1c14ea='<p>'+_0x1c14ea+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x41f4cb,'query':_0x51906e,'htmlContent':_0x1c14ea,'label':_0x5eba92,'mainActionLabel':x[_0x13b4cb['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':at['robotPencil'],'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x43526d['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x107c1d['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x15e6fc=new Map(),_0x1a72cd=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x2800ce of _0x1a72cd)for(const _0x32e384 of _0x2800ce['commands'])_0x15e6fc['set'](_0x32e384['id'],{..._0x32e384,'groupId':_0x2800ce['groupId'],'groupLabel':_0x2800ce['groupLabel']||_0x2800ce['groupId']});return _0x15e6fc;}['_createAIAssistantUIButton'](_0x3378be){const _0x5a4817=this['editor'],_0x3ab5b1=_0x5a4817['commands']['get']('showAIAssistant'),_0x6fa37f=new _0x3378be(_0x5a4817['locale']);return _0x6fa37f['set']({'label':i(_0x5a4817['locale'],'AI\x20Assistant'),'icon':at['robotPencil'],'isToggleable':!0x0}),_0x6fa37f['bind']('isEnabled')['to'](_0x3ab5b1),_0x6fa37f['bind']('isOn')['to'](this['_dialog'],'id',_0x156318=>'aiAssistant'===_0x156318),this['listenTo'](_0x6fa37f,'execute',()=>{_0x6fa37f['isOn']?this['hideUI']():_0x3ab5b1['execute']();}),_0x6fa37f;}['_initView'](){const _0x5df14b=this['editor']['plugins']['get'](a);this['_formView']=new K(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.aiAssistant.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',()=>{_0x5df14b['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x5df14b['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0xb131bf,ui:{ariaLiveAnnouncer:_0x41f02c}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x404d6e,_0x460b7a,_0x887af7)=>{const _0x455542=this['_aiAssistantController']['currentContext'];_0x887af7?_0x41f02c['announce'](i(_0xb131bf,'AI\x20is\x20writing')):_0x455542&&_0x41f02c['announce'](i(_0xb131bf,'Generated\x20content:\x20%0',_0x455542),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x2527e3,_0x334a07,_0x531f2e)=>{if(_0x531f2e){const _0x55203a=this['_formView']['errorView']['text'];_0x41f02c['announce'](i(_0xb131bf,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x55203a));}});}['_onExecute'](_0x51dbe0){const _0x152b9b=this['_commandDefinitions']['get'](_0x51dbe0),_0x55d2d4=this['editor'],_0x412299=_0x55d2d4['model']['document']['selection'],_0x5b214a=_0x55d2d4['commands']['get']('showAIAssistant'),_0x48a4df=_0x55d2d4['plugins']['get'](a),_0x98e6fb=''+(_0x152b9b['groupId']!==I?_0x152b9b['groupLabel']+':\x20':'')+_0x152b9b['label'];if(!0x1!==_0x152b9b['requiresContent']&&_0x412299['isCollapsed']){const _0x45bff8=_0x228044(_0x412299['getSelectedBlocks']())||_0x55d2d4['model']['schema']['getLimitElement'](_0x412299);_0x55d2d4['model']['change'](_0x5ae0aa=>{_0x5ae0aa['setSelection'](_0x45bff8,'in');});}_0x48a4df['showFakeVisualSelection'](),_0x5b214a['execute'](_0x152b9b['prompt'],_0x98e6fb,'command:'+_0x51dbe0);}['_populateMenuBarMenu'](_0xd28984,_0x1ea852,_0x5c3ef3,_0x3f4c52){const _0x187aa8=this['editor'],_0x64ab82=_0x187aa8['locale'],_0x3b93d1=new _0x3db9f4(_0x64ab82),_0x3ce449=B(_0x187aa8,_0x5c3ef3)['filter'](_0x3a7635=>_0x3a7635['commands']['length']);0x1===_0x3ce449['length']?this['_getMenuBarGroupButtons']({'command':_0xd28984,'commands':_0x3ce449[0x0]['commands'],'parentMenuView':_0x1ea852,'onExecute':_0x3f4c52})['forEach'](_0x5a7ee1=>_0x3b93d1['items']['add'](_0x5a7ee1)):_0x3ce449['forEach'](({groupId:_0x2b29d5,groupLabel:_0x2d3f41,commands:_0x3f3eb8})=>{const _0x116841=new _0x48d377(_0x64ab82,_0x1ea852),_0x187825=new _0xedaeab(_0x64ab82),_0x45f983=new _0x3db9f4(_0x64ab82),_0x1966bd=this['_getMenuBarGroupButtons']({'command':_0xd28984,'commands':_0x3f3eb8,'parentMenuView':_0x187825,'onExecute':_0x3f4c52});_0x187825['buttonView']['set']({'label':_0x2d3f41||_0x2b29d5}),_0x187825['delegate']('execute')['to'](_0x1ea852),_0x45f983['items']['addMany'](_0x1966bd),_0x187825['panelView']['children']['add'](_0x45f983),_0x116841['children']['add'](_0x187825),_0x3b93d1['items']['add'](_0x116841);}),_0x1ea852['panelView']['children']['add'](_0x3b93d1);}['_getMenuBarGroupButtons']({command:_0x2f1aab,commands:_0x57991b,parentMenuView:_0x4b1a31,onExecute:_0x33fc14}){const _0x25ba5b=this['editor'],_0x49feac=_0x25ba5b['locale'];return B(_0x25ba5b,_0x57991b)['map'](_0x520109=>{const _0x43c2f1=new _0x48d377(_0x49feac,_0x4b1a31),_0x3cd678=new _0x5834a2(_0x49feac);return _0x3cd678['set']({'label':_0x520109['label']}),_0x3cd678['delegate']('execute')['to'](_0x4b1a31),_0x3cd678['on']('execute',()=>_0x33fc14(_0x520109['id'])),_0x3cd678['bind']('isEnabled')['to'](_0x2f1aab,'enabledCommandsIds',_0x117a79=>_0x117a79['includes'](_0x520109['id'])),_0x43c2f1['children']['add'](_0x3cd678),_0x43c2f1;});}}function _(_0x257627,_0xd4ecdb){return void 0x0!==_0x257627['order']&&void 0x0===_0xd4ecdb['order']?0x1:void 0x0===_0x257627['order']&&void 0x0!==_0xd4ecdb['order']?-0x1:void 0x0!==_0x257627['order']&&void 0x0!==_0xd4ecdb['order']?_0x257627['order']-_0xd4ecdb['order']:0x0;}function B(_0xc5791d,_0x32055d){_0x32055d['sort'](_);const _0x3a446e={},_0x2ac7ef=[];for(const _0x51f63e of _0x32055d)if(void 0x0!==_0x51f63e['order']){if(_0x51f63e['order']in _0x3a446e)throw new _0x2f0c49('ai-commands-config-order-collision',_0xc5791d,{'conflictingDefinitions':[_0x51f63e,_0x3a446e[_0x51f63e['order']]]});_0x3a446e[_0x51f63e['order']]=_0x51f63e,_0x2ac7ef['splice'](_0x51f63e['order'],0x0,_0x51f63e);}else _0x2ac7ef['push'](_0x51f63e);return _0x2ac7ef;}class r extends _0x54da78{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5486ae){super(_0x5486ae);const _0x1a6d04=_0x5486ae['config'],_0x178cd4=_0x5486ae['locale'];_0x1a6d04['define']('ai.aiAssistant.commands',function(_0x242a7d){return[{'groupId':'editOrReview','groupLabel':i(_0x242a7d,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x242a7d,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x242a7d,'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':i(_0x242a7d,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x242a7d,'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':i(_0x242a7d,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x242a7d,'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':i(_0x242a7d,'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':i(_0x242a7d,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x242a7d,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x242a7d,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x242a7d,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x242a7d,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x242a7d,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x242a7d,'Change\x20style'),'commands':[{'id':'business','label':i(_0x242a7d,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x242a7d,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x242a7d,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x242a7d,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x242a7d,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x242a7d,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x242a7d,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x242a7d,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x242a7d,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x242a7d,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x242a7d,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x242a7d,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x242a7d,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x178cd4)),_0x1a6d04['define']('ai.aiAssistant.extraCommandGroups',[]),_0x1a6d04['define']('ai.aiAssistant.removeCommands',[]);const _0x552a1c=o(_0x1a6d04['get']('ai.aiAssistant.commands'),_0x178cd4),_0x2bb7f9=_0x1a6d04['get']('ai.aiAssistant.extraCommandGroups'),_0x4c79f5=_0x1a6d04['get']('ai.aiAssistant.removeCommands');_0x2bb7f9['forEach'](_0x45dd4c=>{const _0xc15da=_0x552a1c['find'](_0x376c46=>_0x376c46['groupId']===_0x45dd4c['groupId']);_0xc15da?_0xc15da['commands']=_0xc15da['commands']['concat'](_0x45dd4c['commands']):_0x552a1c['push'](_0x45dd4c);}),_0x552a1c['forEach'](_0x5aea82=>{_0x5aea82['commands']=_0x5aea82['commands']['filter'](_0x4020e4=>!_0x4c79f5['includes'](_0x4020e4['id']));}),_0x1a6d04['set']('ai.aiAssistant.commands',_0x552a1c);}}class P extends _0x54da78{['abortController'];static get['requires'](){return[v];}constructor(_0x515323){super(_0x515323),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](v)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x10ce17){return this['sendRequest'](_0x10ce17)['catch'](_0x245610=>{if(_0x245610 instanceof R)return Promise['reject'](_0x245610);if('AbortError'==_0x245610['name'])return Promise['resolve']();throw console['error'](_0x245610),new _0x2f0c49('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x291873,_0x5d7782){const _0x2cd7f6=this['editor']['locale'],_0x149fd8={'Content-Type':'application/json'};if('object'==typeof _0x291873)Object['assign'](_0x149fd8,_0x291873);else{if(_0x291873)try{const _0x466a39=await _0x291873(_0x5d7782);Object['assign'](_0x149fd8,_0x466a39);}catch(_0x4a1f04){return Promise['reject'](new R(i(_0x2cd7f6,'AI_ERROR_GET_HEADERS')));}}return _0x149fd8;}async['_prepareRequestParameters'](_0x2eb647,_0xfa85ed){const _0xe05d21=this['editor']['locale'];if('object'==typeof _0x2eb647)return _0x2eb647;try{return await _0x2eb647(_0xfa85ed);}catch(_0x5e8e68){return Promise['reject'](new R(i(_0xe05d21,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x4e5ac9){super(_0x4e5ac9),_0x4e5ac9['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x4e5ac9['config']['get']('ai.openAI.requestParameters')||_0x4e5ac9['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x4e5ac9['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x4e5ac9['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x4e5ac9['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x59f8a1,context:_0x450fbe,onData:_0xc7ff34,actionId:_0x32fc6e}){const _0x142b11=this['editor']['locale'],_0x2699f6=await this['prepareMessages'](_0x59f8a1,_0x450fbe,_0x32fc6e),_0x13ea3e=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x32fc6e),_0xebc520=await this['_prepareRequestParameters'](this['_requestParameters'],_0x32fc6e),_0x239650={'messages':_0x2699f6,..._0xebc520},_0x4e2d67={'method':'POST','headers':_0x13ea3e,'body':JSON['stringify'](_0x239650),'signal':this['abortController']['signal']},_0x5d079e=await fetch(this['_apiUrl'],_0x4e2d67);if(_0x5d079e['ok'])return _0xebc520['stream']?await this['_readStreamableResponse'](_0x5d079e,_0xc7ff34):await this['_readStaticResponse'](_0x5d079e,_0xc7ff34),Promise['resolve']();{const _0x51d2af=await _0x5d079e['text']();return _0x51d2af['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x142b11,'AI_ERROR_CONTEXT_LENGTH'))):_0x51d2af['includes']('Moderation')?Promise['reject'](new R(i(_0x142b11,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x51d2af));}}async['prepareMessages'](_0x292103,_0x16bfab,_0x444a06){let _0x32e7fd,_0x16fa1a;return _0x16bfab?(_0x32e7fd='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.',_0x16fa1a='Instruction:\x0a'+_0x292103+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x16bfab):(_0x32e7fd='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.',_0x16fa1a=_0x292103),[{'role':'system','content':_0x32e7fd},{'role':'user','content':_0x16fa1a}];}async['_readStreamableResponse'](_0xb7ba9b,_0x71b6e4){const _0x5c72f5=_0xb7ba9b['body']['getReader'](),_0x3f00cf=new TextDecoder();let _0x1bbcae='',_0x3f5493='',_0x1f7d03='',_0x45520c=!0x1;for(;!_0x45520c;){const {done:_0x598278,value:_0x1b3088}=await _0x5c72f5['read'](),_0x48ec0f=_0x1bbcae+_0x3f00cf['decode'](_0x1b3088);let _0x10f2e1='';_0x45520c=_0x598278;try{_0x10f2e1=this['_cleanUpData'](_0x48ec0f),_0x1bbcae='';}catch(_0x3eeec0){_0x1bbcae=_0x48ec0f;continue;}_0x3f5493+=_0x10f2e1,!_0x45520c&&this['_isBufferIncomplete'](_0x3f5493)||_0x3f5493&&(_0x1f7d03+=_0x3f5493,_0x3f5493='',_0x71b6e4(_0x1f7d03));}return Promise['resolve']();}async['_readStaticResponse'](_0x4cabaa,_0x7bbbe6){return _0x7bbbe6((await _0x4cabaa['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x868f93){const _0x389e28=_0x868f93['split']('<')['length']!==_0x868f93['split']('>')['length'],_0x5e16b1=_0x868f93['length']<0x1e;return _0x389e28&&_0x5e16b1;}['_cleanUpData'](_0xa7d9ac){return _0xa7d9ac['split'](/\n(?![^{]*\})/g)['map'](_0x485a4d=>_0x485a4d['replace']('data:\x20',''))['filter'](_0x180f59=>_0x180f59&&_0x180f59['length']>0x0&&'[DONE]'!==_0x180f59)['map'](_0x3550f5=>{const {choices:_0x4d5801}=JSON['parse'](_0x3550f5);if(_0x4d5801[0x0]&&_0x4d5801[0x0]['delta']&&_0x4d5801[0x0]['delta']['content'])return _0x4d5801[0x0]['delta']['content'];})['filter'](_0x44dabc=>_0x44dabc)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x7f388){super(_0x7f388),_0x7f388['config']['get']('ai.aws.requestParameters')||_0x7f388['config']['define']('ai.aws.requestParameters',{'model':'anthropic.claude-v2','max_tokens_to_sample':0x7d0,'temperature':0x1,'top_p':0x1,'top_k':0xfa,'anthropic_version':'bedrock-2023-05-31','stream':!0x0}),this['_apiUrl']=_0x7f388['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x7f388['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x7f388['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x7f388['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x3c0e7a,context:_0x9d0087,onData:_0x565053,actionId:_0xd2feec}){const {model:_0xaeb083,stream:_0x543593,..._0x2c202e}=await this['_prepareRequestParameters'](this['_requestParameters'],_0xd2feec),_0x478bb7={'prompt':await this['preparePrompt'](_0x3c0e7a,_0x9d0087,_0xaeb083,_0xd2feec),..._0x2c202e};this['_apiUrl']?await this['_processProxyRequest'](_0x478bb7,_0xaeb083,_0x543593,_0x565053,_0xd2feec):await this['_processAWSRequest'](_0x478bb7,_0xaeb083,_0x543593,_0x565053);}async['preparePrompt'](_0x107705,_0x2f9258,_0x249859,_0x27adb2){let _0x483cc3,_0x564d8a;return _0x2f9258?(_0x483cc3='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.',_0x564d8a='Instruction:\x0a'+_0x107705+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x2f9258):(_0x483cc3='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.',_0x564d8a=_0x107705),'meta.llama'==this['getModelFamily'](_0x249859)?'<<SYS>>\x0a'+_0x483cc3+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x564d8a+'\x0a[/INST]':'Human:\x0a'+_0x483cc3+'\x0a'+_0x564d8a+'\x0a\x0aAssistant:';}['getModelFamily'](_0x5703e6){if(/^anthropic\.claude/['test'](_0x5703e6))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x5703e6))return'ai21.j2';if(/^cohere\.command/['test'](_0x5703e6))return'cohere.command';if(/^meta\.llama/['test'](_0x5703e6))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x5703e6));}async['_processProxyRequest'](_0x2d2504,_0x27eff9,_0x5c80ba,_0x570c86,_0x2079a4){const _0x2506a7={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2079a4),'body':JSON['stringify']({..._0x2d2504,'model':_0x27eff9,'stream':_0x5c80ba}),'signal':this['abortController']['signal']},_0x4a3986=await fetch(this['_apiUrl'],_0x2506a7);_0x5c80ba?await this['_readStreamableResponse'](_0x4a3986,_0x27eff9,_0x570c86):await this['_readStaticResponse'](_0x4a3986,_0x27eff9,_0x570c86);}async['_processAWSRequest'](_0x1fea57,_0x51506c,_0x3408eb,_0x3192ff){const _0x379f3e=new _0x515b30(this['_bedrockClientConfig']),_0x9668c7={'body':JSON['stringify'](_0x1fea57),'contentType':'application/json','accept':'application/json','modelId':_0x51506c};let _0x176c77;if(_0x3408eb){const _0x37f5a1=new _0xbf5ada(_0x9668c7);_0x176c77=await _0x379f3e['send'](_0x37f5a1,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x176c77,_0x51506c,_0x3192ff);}else{const _0x55e4be=new _0x3b73f5(_0x9668c7);_0x176c77=await _0x379f3e['send'](_0x55e4be,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x176c77,_0x51506c,_0x3192ff);}}async['_readAsyncIterableResponse'](_0x485179,_0x312ad4,_0x149a08){const _0x29fbad=_0x485179['body'],_0x33ec28=new TextDecoder('utf-8');let _0x2984c4='';for await(const _0x5a3318 of _0x29fbad)if(_0x5a3318['chunk']){const _0x4bb4d5=_0x33ec28['decode'](_0x5a3318['chunk']['bytes']),_0x22afee=JSON['parse'](_0x4bb4d5);_0x2984c4+=this['_getGeneratedText'](_0x22afee,_0x312ad4),_0x149a08(_0x2984c4);}return Promise['resolve']();}async['_readStreamableResponse'](_0x3b5334,_0x2402e9,_0x2c1d46){const _0x10bec7=_0x3b5334['body'],_0x13368a=new TextDecoder('utf-8'),_0x185349=_0x10bec7['getReader']();let _0x34054d='',_0x231c22='',_0x298d10=!0x1;for(;!_0x298d10;){const {done:_0x187805,value:_0x4aedc7}=await _0x185349['read']();if(_0x298d10=_0x187805,_0x298d10)break;const _0x6bed60=(_0x34054d+_0x13368a['decode'](_0x4aedc7))['split']('\x0a')['map'](_0x5dacbf=>{try{return _0x34054d='',JSON['parse'](_0x5dacbf);}catch(_0x2d2947){return _0x34054d=_0x5dacbf,null;}})['filter'](_0x5edb44=>null!==_0x5edb44);_0x6bed60['length']&&(_0x231c22+=_0x6bed60['map'](_0x57e235=>this['_getGeneratedText'](_0x57e235,_0x2402e9))['join'](''),_0x2c1d46(_0x231c22));}return Promise['resolve']();}async['_readStaticResponse'](_0x36fa55,_0x2b4b52,_0x26a0f8){let _0x4e4c1b;return _0x4e4c1b=_0x36fa55 instanceof Response?await _0x36fa55['json']():JSON['parse'](Buffer['from'](_0x36fa55['body'])['toString']('utf8')),(_0x26a0f8(this['_getGeneratedText'](_0x4e4c1b,_0x2b4b52)),Promise['resolve']());}['_getGeneratedText'](_0x21b7a5,_0x257934){switch(this['getModelFamily'](_0x257934)){case'anthropic.claude':return _0x21b7a5['completion'];case'ai21.j2':return _0x21b7a5['completions'][0x0]['data']['text'];case'cohere.command':return _0x21b7a5['generations'][0x0]['text'];case'meta.llama':return _0x21b7a5['generation'];}}}export{v as AIAdapter,r as AIAssistant,R as AIRequestError,P as AITextAdapter,O as AWSTextAdapter,H as OpenAITextAdapter};
|
|
23
|
+
import{Plugin as _0x46adca,Command as _0x2ee0a9,icons as _0x3fc795}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x19acd7,CKEditorError as _0x5b5d42,ObservableMixin as _0x568565,global as _0x101cc5,isVisible as it,Rect as st,Collection as _0x548f2a,FocusTracker as _0x1deb4b,KeystrokeHandler as ts,first as _0x283771}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as nt,ButtonView as _0x40189f,View as _0x739eb1,SpinnerView as _0x3d8baa,IconView as _0x474673,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x4f312e,ButtonLabelView as te,FocusCycler as _0x7061df,createLabeledTextarea as _0x116c15,Dialog as _0x3de10b,createDropdown as _0x242bb0,addMenuToDropdown as _0x760a67,MenuBarMenuView as _0x58ac85,MenuBarMenuListItemButtonView as _0xecfb79,DialogViewPosition as _0x13600b,MenuBarMenuListView as _0x48d9e1,MenuBarMenuListItemView as _0x398191}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as ct}from'ckeditor5-collaboration/dist/index.js';import{ClipboardPipeline as _0x49f537,ClipboardMarkersUtils as _0x4ae5bd}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x1fc58a,DataTransfer as _0x52b384,UpcastWriter as _0x33b186,Matcher as _0xcc0195}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x17cf55,escape as _0x29b8a8}from'lodash-es';import{BedrockRuntimeClient as _0x2b981f,InvokeModelWithResponseStreamCommand as _0x512fea,InvokeModelCommand as _0x34df9a}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x4de9db,_0x3b1457){const _0x17a67e=(0x0,_0x3b1457['t'])('Other');return _0x4de9db['length']?'groupId'in _0x4de9db[0x0]?_0x4de9db:[{'groupId':x,'groupLabel':_0x17a67e,'order':0x1/0x0,'commands':_0x4de9db}]:[{'groupId':x,'groupLabel':_0x17a67e,'order':0x1/0x0,'commands':[]}];}const dt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x46adca{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x516fdb}=this,_0x1c5ae3=['ck-fake-ai-selection'];_0x516fdb['config']['get']('ai.useTheme')&&_0x1c5ae3['push']('ck-ai-assistant-ui_theme'),_0x516fdb['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x1c5ae3,'priority':0xc}}),_0x516fdb['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0xe3142c,{writer:_0x45bc5b})=>{if(!_0xe3142c['markerRange']['isCollapsed'])return null;const _0x5078ad=_0x45bc5b['createUIElement']('span');return _0x45bc5b['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x5078ad),_0x5078ad;}});}['afterInit'](){!async function(_0x3acd48){const _0x56c81e=_0x3d2b74([0x52,0x48,0x66,0x6c,0x41,0x62,0x6b,0x61,0x42,0x5a,0x63,0x45,0x4b,0x71,0x53,0x78,0x46,0x4e,0x33,0x43,0x6a,0x37,0x56,0x65,0x67,0x69,0x77,0x54,0x44,0x70,0x4f,0x72,0x32,0x49,0x35,0x57,0x7a,0x59,0x36,0x47,0x31,0x6e,0x51,0x39,0x76,0x79,0x6f,0x75,0x58,0x74,0x50,0x4c,0x38,0x64,0x4a,0x34,0x4d,0x30,0x55,0x68,0x6d,0x73]),_0x1bdafc=0x15e67a3,_0x5f0b5c=0x1593a5b^_0x1bdafc,_0x92a665=window[_0x3d2b74([0x44,0x61,0x74,0x65])][_0x3d2b74([0x6e,0x6f,0x77])](),_0x6fb7c4=_0x3acd48[_0x3d2b74([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x548271=new window[(_0x3d2b74([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x136f42=>{_0x6fb7c4[_0x3d2b74([0x6f,0x6e,0x63,0x65])](_0x3d2b74([0x72,0x65,0x61,0x64,0x79]),_0x136f42);}),_0x3a06fa={[_0x3d2b74([0x6b,0x74,0x79])]:_0x3d2b74([0x45,0x43]),[_0x3d2b74([0x75,0x73,0x65])]:_0x3d2b74([0x73,0x69,0x67]),[_0x3d2b74([0x63,0x72,0x76])]:_0x3d2b74([0x50,0x2d,0x32,0x35,0x36]),[_0x3d2b74([0x78])]:_0x3d2b74([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]),[_0x3d2b74([0x79])]:_0x3d2b74([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]),[_0x3d2b74([0x61,0x6c,0x67])]:_0x3d2b74([0x45,0x53,0x32,0x35,0x36])},_0x467d55=_0x6fb7c4[_0x3d2b74([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x3d2b74([0x67,0x65,0x74])](_0x3d2b74([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x13c899(){let _0x991ff0,_0x5206b6=null,_0x197d32=null;try{if(_0x467d55==_0x3d2b74([0x47,0x50,0x4c]))return _0x3d2b74([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x991ff0=_0x487398(),!_0x991ff0)return _0x3d2b74([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x991ff0[_0x3d2b74([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x197d32=_0x40b048(_0x991ff0[_0x3d2b74([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x991ff0[_0x3d2b74([0x6a,0x74,0x69])])),await _0x2ae02e()?_0x5ac374()?_0x561f65()?_0x3d2b74([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0xacddea()?(_0x991ff0[_0x3d2b74([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x3d2b74([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x5206b6=_0x1354b0(_0x3d2b74([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x991ff0[_0x3d2b74([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x3d2b74([0x74,0x72,0x69,0x61,0x6c])&&(_0x5206b6=_0x1354b0(_0x3d2b74([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x4beeb4()):_0x3d2b74([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x3d2b74([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x3d2b74([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x81a588){return _0x3d2b74([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x561f65(){const _0x37ce82=[_0x3d2b74([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x3d2b74([0x74,0x72,0x69,0x61,0x6c])][_0x3d2b74([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x991ff0[_0x3d2b74([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x92a665/0x3e8:0xe10*_0x5f0b5c;return _0x991ff0[_0x3d2b74([0x65,0x78,0x70])]<_0x37ce82;}function _0x5ac374(){const _0x538c19=_0x991ff0[_0x3d2b74([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x538c19&&(!!_0x538c19[_0x3d2b74([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3d2b74([0x2a]))||!!_0x538c19[_0x3d2b74([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3d2b74([0x41,0x49])));}function _0xacddea(){const _0x36201d=_0x991ff0[_0x3d2b74([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x36201d||0x0==_0x36201d[_0x3d2b74([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0xf7fa17}=new URL(window[_0x3d2b74([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x36201d[_0x3d2b74([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xf7fa17))return!0x0;const _0x3a017b=_0xf7fa17[_0x3d2b74([0x73,0x70,0x6c,0x69,0x74])](_0x3d2b74([0x2e]));return _0x36201d[_0x3d2b74([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x486d56=>_0x486d56[_0x3d2b74([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3d2b74([0x2a])))[_0x3d2b74([0x6d,0x61,0x70])](_0x5a7bc9=>_0x5a7bc9[_0x3d2b74([0x73,0x70,0x6c,0x69,0x74])](_0x3d2b74([0x2e])))[_0x3d2b74([0x73,0x6f,0x6d,0x65])](_0x28710a=>_0x3a017b[_0x3d2b74([0x65,0x76,0x65,0x72,0x79])]((_0x2fa09b,_0x43f870)=>_0x28710a[_0x43f870]===_0x2fa09b||_0x28710a[_0x43f870]===_0x3d2b74([0x2a])));}function _0x4beeb4(){return _0x5206b6&&_0x197d32?new window[(_0x3d2b74([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3f6a6a,_0x53fea1)=>{_0x5206b6[_0x3d2b74([0x74,0x68,0x65,0x6e])](_0x3f6a6a,_0x53fea1),_0x197d32[_0x3d2b74([0x74,0x68,0x65,0x6e])](_0x31ccfc=>{_0x31ccfc!=_0x3d2b74([0x56,0x61,0x6c,0x69,0x64])&&_0x3f6a6a(_0x31ccfc);},_0x53fea1);}):_0x5206b6||_0x197d32||_0x3d2b74([0x56,0x61,0x6c,0x69,0x64]);}}function _0x40b048(_0x572f47,_0x5d1910){return new window[(_0x3d2b74([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3211c7=>{if(_0x1fffd7())return _0x3211c7(_0x3d2b74([0x56,0x61,0x6c,0x69,0x64]));_0x59a439(),_0x6fb7c4[_0x3d2b74([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x3d2b74([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x3a5cc7=!0x1;const _0x1b17ef=_0x19acd7();function _0x4d3cf7(_0x85d09e){return!!_0x85d09e&&(typeof _0x85d09e===_0x3d2b74([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x85d09e===_0x3d2b74([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x85d09e[_0x3d2b74([0x74,0x68,0x65,0x6e])]===_0x3d2b74([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x85d09e[_0x3d2b74([0x63,0x61,0x74,0x63,0x68])]===_0x3d2b74([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x26adda(_0x57ee48){_0x3e0b06(_0x57ee48)[_0x3d2b74([0x74,0x68,0x65,0x6e])](_0x215313=>{if(!_0x215313||_0x215313[_0x3d2b74([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x3d2b74([0x6f,0x6b]))return _0x3d2b74([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x24229(_0xc3f07c(_0x1b17ef+_0x5d1910))!=_0x215313[_0x3d2b74([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x3d2b74([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x3d2b74([0x56,0x61,0x6c,0x69,0x64]);})[_0x3d2b74([0x74,0x68,0x65,0x6e])](_0x5ad5e4=>(_0x7d22ea(),_0x5ad5e4),()=>{const _0x289629=_0x590da0();return null==_0x289629?(_0x7d22ea(),_0x3d2b74([0x56,0x61,0x6c,0x69,0x64])):_0x3d2b74(_0x92a665-_0x289629>(0x2552e3a3^_0x1bdafc)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x3d2b74([0x74,0x68,0x65,0x6e])](_0x3211c7)[_0x3d2b74([0x63,0x61,0x74,0x63,0x68])](()=>{_0x3211c7(_0x3d2b74([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x364739=0x1688923^_0x1bdafc;function _0x7d22ea(){const _0x3c85d5=_0x3d2b74([0x6c,0x6c,0x63,0x74,0x2d])+_0x24229(_0xc3f07c(_0x572f47)),_0x188453=_0x3905e9(_0x24229(window[_0x3d2b74([0x4d,0x61,0x74,0x68])][_0x3d2b74([0x63,0x65,0x69,0x6c])](_0x92a665/_0x364739)));window[_0x3d2b74([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3d2b74([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3c85d5,_0x188453);}function _0x590da0(){const _0x5ed0ae=_0x3d2b74([0x6c,0x6c,0x63,0x74,0x2d])+_0x24229(_0xc3f07c(_0x572f47)),_0xbcd4b3=window[_0x3d2b74([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3d2b74([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x5ed0ae);return _0xbcd4b3?window[_0x3d2b74([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3905e9(_0xbcd4b3),0x10)*_0x364739:null;}function _0x3e0b06(_0x53499d){return new window[(_0x3d2b74([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x21806c,_0x5d4dc6)=>{_0x53499d[_0x3d2b74([0x74,0x68,0x65,0x6e])](_0x21806c,_0x5d4dc6),window[_0x3d2b74([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x5d4dc6,0x15fb363^_0x1bdafc);});}}_0x6fb7c4[_0x3d2b74([0x6f,0x6e])](_0x3d2b74([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x53f9cf,_0x1da9f5)=>{if(_0x1da9f5[0x0]!=_0x572f47)return _0x3211c7(_0x3d2b74([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x1da9f5[0x1]={..._0x1da9f5[0x1],[_0x3d2b74([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x1b17ef};},{[_0x3d2b74([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3d2b74([0x68,0x69,0x67,0x68])}),_0x6fb7c4[_0x3d2b74([0x6f,0x6e])](_0x3d2b74([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x3f8e68=>{_0x4d3cf7(_0x3f8e68[_0x3d2b74([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x3a5cc7=!0x0,_0x26adda(_0x3f8e68[_0x3d2b74([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x3d2b74([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3d2b74([0x6c,0x6f,0x77])}),_0x548271[_0x3d2b74([0x74,0x68,0x65,0x6e])](()=>{_0x3a5cc7||_0x3211c7(_0x3d2b74([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x1fffd7(){return _0x6fb7c4[_0x3d2b74([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3d2b74([0x76,0x69,0x65,0x77])][_0x3d2b74([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x3d2b74([0x61,0x75,0x74,0x6f]);}function _0x59a439(){_0x6fb7c4[_0x3d2b74([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3d2b74([0x76,0x69,0x65,0x77])][_0x3d2b74([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x3d2b74([0x61,0x75,0x74,0x6f]);}}function _0x1354b0(_0x1f16d0){const _0x6118f1=[new window[(_0x3d2b74([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xef5de0=>setTimeout(_0xef5de0,0x157596f^_0x1bdafc)),_0x548271[_0x3d2b74([0x74,0x68,0x65,0x6e])](()=>new window[(_0x3d2b74([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2ed7aa=>{let _0x4852ec=0x0;_0x6fb7c4[_0x3d2b74([0x6d,0x6f,0x64,0x65,0x6c])][_0x3d2b74([0x6f,0x6e])](_0x3d2b74([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x480163,_0x3f7861)=>{_0x3f7861[0x0][_0x3d2b74([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x4852ec++,_0x4852ec==(0x15e665b^_0x1bdafc)&&(_0x2ed7aa(),_0x480163[_0x3d2b74([0x6f,0x66,0x66])]());});}))];return window[_0x3d2b74([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x3d2b74([0x72,0x61,0x63,0x65])](_0x6118f1)[_0x3d2b74([0x74,0x68,0x65,0x6e])](()=>_0x1f16d0);}async function _0x59f776(){await _0x548271,_0x6fb7c4[_0x3d2b74([0x6d,0x6f,0x64,0x65,0x6c])][_0x3d2b74([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x567636,_0x6fb7c4[_0x3d2b74([0x6d,0x6f,0x64,0x65,0x6c])][_0x3d2b74([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x567636,_0x6fb7c4[_0x3d2b74([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x3d2b74([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x56bc0b(_0x3aa072){const _0x14d963=_0x383aea();_0x6fb7c4[_0x14d963]=_0x3d2b74([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x3aa072,_0x3aa072!=_0x3d2b74([0x56,0x61,0x6c,0x69,0x64])&&_0x59f776();}function _0x383aea(){const _0x44cce6=window[_0x3d2b74([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x3d2b74([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x3d2b74([0x6e,0x6f,0x77])]())[_0x3d2b74([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x3d2b74([0x2e]),'');let _0x476c40=_0x3d2b74([0x52]);for(let _0x1ff807=0x0;_0x1ff807<_0x44cce6[_0x3d2b74([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1ff807+=0x2){let _0x349e97=window[_0x3d2b74([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x44cce6[_0x3d2b74([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x1ff807,_0x1ff807+0x2));_0x349e97>=_0x56c81e[_0x3d2b74([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x349e97-=_0x56c81e[_0x3d2b74([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x476c40+=_0x56c81e[_0x349e97];}return _0x476c40;}function _0x487398(){const _0x39a1dc=_0x467d55[_0x3d2b74([0x73,0x70,0x6c,0x69,0x74])](_0x3d2b74([0x2e]));if(0x3!=_0x39a1dc[_0x3d2b74([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x4213a1(_0x39a1dc[0x1]);function _0x4213a1(_0x25232f){const _0x2ecede=_0xeefa2a(_0x25232f);return _0x2ecede&&_0x4c8628()?_0x2ecede:null;function _0x4c8628(){const _0x51fb0e=_0x2ecede[_0x3d2b74([0x6a,0x74,0x69])],_0x3921dc=window[_0x3d2b74([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x51fb0e[_0x3d2b74([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x51fb0e[_0x3d2b74([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x2a296d={..._0x2ecede,[_0x3d2b74([0x6a,0x74,0x69])]:_0x51fb0e[_0x3d2b74([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x51fb0e[_0x3d2b74([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x2a296d[_0x3d2b74([0x76,0x63])],_0xc3f07c(_0x2a296d)==_0x3921dc;}}}async function _0x2ae02e(){let _0x42ec39=!0x0;try{const _0x2414ca=_0x467d55[_0x3d2b74([0x73,0x70,0x6c,0x69,0x74])](_0x3d2b74([0x2e])),[_0x32b55a,_0x3a8287,_0x4da571]=_0x2414ca;return _0x2db586(_0x32b55a),await _0x4c42cc(_0x32b55a,_0x3a8287,_0x4da571),_0x42ec39;}catch(_0x2126ae){return!0x1;}function _0x2db586(_0x1aac28){const _0x43b6a7=_0xeefa2a(_0x1aac28);_0x43b6a7&&_0x43b6a7[_0x3d2b74([0x61,0x6c,0x67])]==_0x3d2b74([0x45,0x53,0x32,0x35,0x36])||(_0x42ec39=!0x1);}async function _0x4c42cc(_0x5da6da,_0x180339,_0x66fdd2){const _0x52e4ce=window[_0x3d2b74([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x3d2b74([0x66,0x72,0x6f,0x6d])](_0x395db0(_0x66fdd2),_0x3806b9=>_0x3806b9[_0x3d2b74([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x2ea8ec=new window[(_0x3d2b74([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x3d2b74([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x5da6da+_0x3d2b74([0x2e])+_0x180339),_0x244756=window[_0x3d2b74([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x3d2b74([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x244756)return;const _0x2ba585=await _0x244756[_0x3d2b74([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x3d2b74([0x6a,0x77,0x6b]),_0x3a06fa,{[_0x3d2b74([0x6e,0x61,0x6d,0x65])]:_0x3d2b74([0x45,0x43,0x44,0x53,0x41]),[_0x3d2b74([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x3d2b74([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x3d2b74([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x244756[_0x3d2b74([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x3d2b74([0x6e,0x61,0x6d,0x65])]:_0x3d2b74([0x45,0x43,0x44,0x53,0x41]),[_0x3d2b74([0x68,0x61,0x73,0x68])]:{[_0x3d2b74([0x6e,0x61,0x6d,0x65])]:_0x3d2b74([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x2ba585,_0x52e4ce,_0x2ea8ec)||(_0x42ec39=!0x1);}}function _0xeefa2a(_0x1f23a2){return _0x1f23a2[_0x3d2b74([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x3d2b74([0x65,0x79]))?JSON[_0x3d2b74([0x70,0x61,0x72,0x73,0x65])](_0x395db0(_0x1f23a2)):null;}function _0x395db0(_0x35642b){return window[_0x3d2b74([0x61,0x74,0x6f,0x62])](_0x35642b[_0x3d2b74([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x3d2b74([0x2b]))[_0x3d2b74([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x3d2b74([0x2f])));}function _0xc3f07c(_0x2ef8a3){let _0x37e001=0x1505;function _0x38da23(_0x1e38c6){for(let _0x40cf26=0x0;_0x40cf26<_0x1e38c6[_0x3d2b74([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x40cf26++){const _0x39c943=_0x1e38c6[_0x3d2b74([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x40cf26);_0x37e001=(_0x37e001<<0x5)+_0x37e001+_0x39c943,_0x37e001&=_0x37e001;}}function _0x4378a3(_0x4b890b){Array[_0x3d2b74([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x4b890b)?_0x4b890b[_0x3d2b74([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x4378a3):_0x4b890b&&typeof _0x4b890b==_0x3d2b74([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x3d2b74([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x4b890b)[_0x3d2b74([0x73,0x6f,0x72,0x74])]()[_0x3d2b74([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x291fba,_0x5f1163])=>{_0x38da23(_0x291fba),_0x4378a3(_0x5f1163);}):_0x38da23(window[_0x3d2b74([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x4b890b));}return _0x4378a3(_0x2ef8a3),_0x37e001>>>0x0;}function _0x24229(_0x4a028a){return _0x4a028a[_0x3d2b74([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x3d2b74([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x3d2b74([0x30]));}function _0x3905e9(_0x145310){return _0x145310[_0x3d2b74([0x73,0x70,0x6c,0x69,0x74])]('')[_0x3d2b74([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x3d2b74([0x6a,0x6f,0x69,0x6e])]('');}function _0x567636(){}function _0x3d2b74(_0x246691){return _0x246691['map'](_0x8dffaa=>String['fromCharCode'](_0x8dffaa))['join']('');}_0x56bc0b(await _0x13c899());}(this);}['showFakeVisualSelection'](){const _0x2864a9=this['editor']['model'];_0x2864a9['change'](_0x4cea8c=>{const _0x104c31=_0x2864a9['document']['selection']['getRanges']();let _0x5ac025=0x0;for(const _0x50ca14 of _0x104c31){const _0x1d297e=f+':'+_0x5ac025;if(_0x2864a9['markers']['has'](_0x1d297e))_0x4cea8c['updateMarker'](_0x1d297e,{'range':_0x50ca14});else{if(_0x50ca14['start']['isAtEnd']){const _0x1cc10d=_0x50ca14['start']['getLastMatchingPosition'](({item:_0x335636})=>!_0x2864a9['schema']['isContent'](_0x335636),{'boundaries':_0x50ca14});_0x4cea8c['addMarker'](_0x1d297e,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4cea8c['createRange'](_0x1cc10d,_0x50ca14['end'])});}else _0x4cea8c['addMarker'](_0x1d297e,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x50ca14});}_0x5ac025++;}});}['hideFakeVisualSelection'](){const _0x1b981a=this['editor']['model'],_0xea57a6=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0xea57a6['length']&&_0x1b981a['change'](_0x5f249d=>{_0xea57a6['forEach'](_0x2ae990=>{_0x5f249d['removeMarker'](_0x2ae990);});});}['insertContent'](_0x1b9952,_0xbe55d9){const _0x5ab9f3=this['_getAISelection'](),_0x2a243a=_0xbe55d9||_0x5ab9f3['getFirstRange']();this['editor']['model']['canEditAt'](_0x2a243a)&&this['editor']['model']['change'](_0x181e84=>{this['hideFakeVisualSelection'](),_0xbe55d9||this['_resetContentOfSelectedTableCells'](_0x181e84,_0x5ab9f3),this['_pasteHTMLUsingClipboard']({'insertAt':_0x2a243a,'writer':_0x181e84,'html':_0x1b9952});});}['insertContentBelow'](_0x57a3e4){const {model:_0x44ff62}=this['editor'],_0x319ee5=this['_getAISelection']();_0x44ff62['change'](()=>{const _0xceb817=this['_prepareTableInsertBelowPosition'](_0x57a3e4,_0x319ee5)||this['_getDefaultInsertBelowPosition'](_0x319ee5);this['insertContent'](_0x57a3e4,_0xceb817);});}['_getAISelection'](){const _0xa14cbf=this['editor']['model'],_0xca0ff7=Array['from'](_0xa14cbf['markers']['getMarkersGroup'](f))['map'](_0xd90aad=>_0xd90aad['getRange']());return _0xa14cbf['createSelection'](_0xca0ff7);}['_pasteHTMLUsingClipboard']({writer:_0x1b53b0,html:_0x5cd46b,insertAt:_0x5c88c2}){const {view:_0x4397b3}=this['editor']['editing'],_0x40028b=this['editor']['plugins']['get'](_0x49f537),_0x77be72=new dt();_0x77be72['setData']('text/html',_0x5cd46b);const _0x1fb885=new ClipboardEvent('paste',{'clipboardData':_0x77be72}),_0x53802d=new _0x1fc58a(_0x4397b3,_0x1fb885,{'dataTransfer':new _0x52b384(_0x77be72)});_0x1b53b0['setSelection'](_0x5c88c2);const _0x4858e6=(_0x175e75,_0x2e0930)=>{_0x2e0930['resultRange']&&_0x1b53b0['setSelection'](_0x2e0930['resultRange']);};_0x40028b['once']('contentInsertion',_0x4858e6,{'priority':'lowest'}),_0x4397b3['document']['fire']('paste',_0x53802d),_0x40028b['off']('contentInsertion',_0x4858e6);}['_getDefaultInsertBelowPosition'](_0x271372){const {model:_0x44ac9b}=this['editor'],_0x2b243f=Array['from'](_0x271372['getSelectedBlocks']());return _0x2b243f['length']?_0x44ac9b['createPositionAfter'](_0x2b243f['pop']()):_0x271372['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x44ae4f,_0x441dc1){const {model:_0x214ccd,plugins:_0x5a031d}=this['editor'];if(_0x5a031d['has']('TableUtils')){const _0x19059b=_0x5a031d['get']('TableUtils')['getSelectedTableCells'](_0x441dc1);if(_0x19059b['length']){const _0x3774a3=this['_getTableRowCountFromContent'](_0x44ae4f),_0x5e8573=this['_createEmptyTableRows'](_0x19059b,_0x3774a3);return _0x214ccd['createPositionAt'](_0x5e8573,0x0);}}return null;}['_getTableRowCountFromContent'](_0x16890f){const _0x421dcf=this['editor']['plugins']['get']('TableUtils'),_0x478b76=this['editor']['data']['parse'](_0x16890f),_0x4bda3e=Array['from'](_0x478b76['getChildren']())['filter'](_0x85a8b9=>_0x85a8b9['is']('element','table'));let _0x386055=0x0;return _0x4bda3e['forEach'](_0x55fb2c=>{_0x386055+=_0x421dcf['getRows'](_0x55fb2c);}),_0x386055;}['_createEmptyTableRows'](_0x280ac2,_0x4cad74){const _0x405616=this['editor']['plugins']['get']('TableUtils'),_0x7266d8=_0x405616['getRowIndexes'](_0x280ac2),_0x121d06=_0x405616['getColumnIndexes'](_0x280ac2),_0x1a72d0=_0x7266d8['last']+0x1,_0x5481c9=_0x121d06['first'],_0x45f707=_0x280ac2[0x0]['findAncestor']('table');for(let _0x5ade8d=0x0;_0x5ade8d<_0x4cad74;_0x5ade8d++)_0x405616['insertRows'](_0x45f707,{'at':_0x1a72d0});return _0x45f707['getChild'](_0x1a72d0)['getChild'](_0x5481c9);}['_resetContentOfSelectedTableCells'](_0x3b5cf0,_0x8933c4){const {plugins:_0x200230}=this['editor'],{model:_0x4818c5}=_0x3b5cf0;if(!_0x200230['has']('TableUtils'))return;_0x200230['get']('TableUtils')['getSelectedTableCells'](_0x8933c4)['length']&&_0x4818c5['deleteContent'](_0x8933c4);}}class K extends _0x46adca{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x5b5d42('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x3df8dc){super(_0x3df8dc),this['name']='AIRequestError';}}function i(_0x57ed41,_0x4f171b,_0x2cb6bc){const t=_0x57ed41['t'];switch(_0x4f171b){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',_0x2cb6bc);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2cb6bc);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'},_0x2cb6bc);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x4f171b;}}class E extends _0x2ee0a9{['_commandDefinitions'];constructor(_0x30d286,_0x55f076){super(_0x30d286),this['_commandDefinitions']=_0x55f076,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x441323,_0x1d7d83,_0x123a28)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x123a28));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x5d50bd,_0x31e7b6,_0xdcc964)=>{this['enabledCommandsIds']=_0xdcc964?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x163b3f=this['editor']['model'];this['_hasContext']=function(_0x44cc3d){const _0x357bd5=_0x44cc3d['document']['selection'];return _0x357bd5['isCollapsed']?0x0!==[..._0x357bd5['getSelectedBlocks']()]['length']&&![..._0x357bd5['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x44cc3d['hasContent'](_0x357bd5['getFirstRange']());}(_0x163b3f);const _0x22c088=_0x163b3f['document']['selection'],_0x5b2640=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x121048 of _0x22c088['getRanges']())for(const _0x2e96f8 of _0x121048['getItems']())if(_0x2e96f8['is']('element')&&_0x5b2640['includes'](_0x2e96f8['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x342a33='',_0x390047='',_0x4c018e='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x342a33,_0x390047,_0x4c018e);}}function G(_0x2bc7de,_0x5dccc2){const _0x112dba=new Set();for(const _0x4b8708 of _0x2bc7de['values']())(_0x5dccc2||!0x1===_0x4b8708['requiresContent'])&&_0x112dba['add'](_0x4b8708['id']);return Array['from'](_0x112dba);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x568565(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x4fab29,_0x116e7d,_0x42b655){super(),this['editor']=_0x4fab29,this['textAdapter']=_0x116e7d,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x42b655,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x49ea44,_0x858dbf,_0x49c7ff)=>{this['view']['value']=this['_sanitizeHTML'](_0x49c7ff);}),this['listenTo'](this['view'],'submitPrompt',(_0x11ebfe,_0x25871c)=>{const _0x461920=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x25871c,_0x461920,'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:_0x713afd,query:_0x6da1d2,htmlContent:_0x25208f,label:_0x46173e,mainActionLabel:_0x33ffcb}){this['view']['prompt']=_0x46173e,this['view']['mainAction']=_0x33ffcb,this['initialContext']=_0x25208f,_0x6da1d2&&(this['view']['isRendered']?this['_handleQuery'](_0x6da1d2,_0x25208f,_0x713afd,_0x46173e):this['view']['once']('render',()=>{this['_handleQuery'](_0x6da1d2,_0x25208f,_0x713afd,_0x46173e);}));}['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'](_0x1b0aa6,_0x3a1510,_0x4b4b42,_0x4dd4a8){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x3a1510,this['previousQuery']=_0x1b0aa6,this['previousLabel']=_0x4dd4a8||_0x1b0aa6,this['previousActionId']=_0x4b4b42,new Promise(_0x5103c3=>{this['textAdapter']['makeRequest']({'query':_0x1b0aa6,'context':_0x3a1510,'onData':_0xaf2c1e=>{this['currentResponse']=_0xaf2c1e,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x4b4b42})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x4e43a5=>{_0x4e43a5 instanceof R?this['view']['handleError'](_0x4e43a5['message']):this['view']['handleError'](),_0x5103c3();})['finally'](()=>{this['stopProcessing'](),_0x5103c3();});});}['_parseAndNormalizeContent'](_0x17319f,_0x3d6602=!0x1){const _0x578161=Z['exec'](_0x17319f);_0x17319f=_0x578161?_0x17319f['substring'](_0x578161[0x1]['length']):_0x17319f['length']<0x64&&!_0x3d6602?'':this['_stripMarkdownSyntax'](_0x17319f);const _0xc42c5c=this['_domParser']['parseFromString'](_0x17319f,'text/html');if(_0x578161){const _0x256bac=Array['from'](_0xc42c5c['body']['childNodes']);_0x256bac['reverse']();for(const _0x1620a5 of _0x256bac){if(_0x1620a5['nodeType']==Node['ELEMENT_NODE'])break;_0x1620a5['remove']();}}const _0x39f8d1=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0xc42c5c['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x39f8d1);const _0x2dfdb4=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x158926=this['editor']['data']['toModel'](_0x39f8d1);return _0x2dfdb4||_0x158926['markers']['clear'](),this['editor']['data']['stringify'](_0x158926);}['_normalizeResponseHeadings'](_0x6fd5a6){const _0x4c143b=new _0x33b186(this['editor']['editing']['view']['document']),_0x74fa3f=new _0xcc0195({'name':/^h[1-5]$/}),_0x33e477=[];let _0x10c2ee=!0x1;for(const _0x2f9367 of _0x6fd5a6)_0x2f9367['is']('element')&&_0x74fa3f['match'](_0x2f9367)&&(_0x33e477['push'](_0x2f9367),'h1'==_0x2f9367['name']&&(_0x10c2ee=!0x0));if(_0x10c2ee){for(const _0x1c92a0 of _0x33e477)_0x4c143b['rename']('h'+(parseInt(_0x1c92a0['name'][0x1])+0x1),_0x1c92a0);}}['_isH1TagSupportEnabled'](){const {data:_0x47de64,editing:_0x11e0c8}=this['editor'],_0x538fd6=_0x47de64['htmlProcessor']['toView']('<h1></h1>'),_0x5a4b2a=_0x47de64['toView'](_0x47de64['toModel'](_0x538fd6));return!!_0x11e0c8['view']['domConverter']['viewToDom'](_0x5a4b2a)['querySelector']('h1');}['_sanitizeHTML'](_0x1a7dd9){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x1a7dd9),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x646282){const _0x2f24ce=_0x646282['trim']();return _0x2f24ce['startsWith']('```html')?_0x2f24ce['endsWith']('```')?_0x2f24ce['substring'](0x7,_0x2f24ce['length']-0x3):_0x2f24ce['substring'](0x7):_0x646282;}}const M={'REPLACE':'replace','INSERT':'insert'};class at extends nt{constructor(_0x14ad43){super(_0x14ad43),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x341c67=>i(_0x14ad43,'AI_'+_0x341c67['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x14ad43,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x14ad43,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x14ad43,'Stop'));const _0x58a107=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x58a107['if']('isVisible','ck-hidden',_0xe2bc39=>!_0xe2bc39)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x412f02,_0x455f9b){const _0x202545=new _0x40189f(this['locale']);return _0x202545['set']({'label':_0x412f02,'class':_0x455f9b||'','isVisible':!0x0,'withText':!0x0}),_0x202545;}}var W='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M5\x202.801a.7.7\x200\x200\x200-.7.7v11.5a.8.8\x200\x200\x201-1.6\x200v-11.5a2.3\x202.3\x200\x200\x201\x202.3-2.3h6.5a.8.8\x200\x200\x201\x200\x201.6H5Zm.7\x203.7a2.3\x202.3\x200\x200\x201\x202.3-2.3h7a2.3\x202.3\x200\x200\x201\x202.3\x202.3v10a2.3\x202.3\x200\x200\x201-2.3\x202.3H8a2.3\x202.3\x200\x200\x201-2.3-2.3v-10Zm2.3-.7a.7.7\x200\x200\x200-.7.7v10a.7.7\x200\x200\x200\x20.7.7h7a.7.7\x200\x200\x200\x20.7-.7v-10a.7.7\x200\x200\x200-.7-.7H8Z\x22/></svg>';class X extends _0x739eb1{['contentFieldView'];['copyButtonView'];constructor(_0x408b79,_0x1f6e18=''){super(_0x408b79),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x30706f=this['bindTemplate'];this['contentFieldView']=new mt(_0x408b79,_0x1f6e18),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x30706f['if']('isVisible','ck-hidden',_0x1a847c=>!_0x1a847c)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x30706f['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 _0x236f85=!0x1;this['on']('change:value',(_0x2ad358,_0x196ace,_0x5840f1)=>{const _0x723142=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x5840f1),this['isProcessing']&&_0x723142&&!_0x236f85&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x258c0d,_0x3602a8,_0x1d4b86)=>{_0x236f85=!0x1,_0x1d4b86?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x236f85=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x236f85=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x4ac41d=this['locale'],_0x36632b=new _0x40189f(this['locale']),_0x372191='ck-ai-form__copy-button';return _0x36632b['set']({'label':i(_0x4ac41d,'Copy'),'icon':W,'class':_0x372191,'tooltip':!0x0}),_0x36632b['bind']('isVisible')['to'](this,'value',_0x5bc038=>!!_0x5bc038),_0x36632b['bind']('isEnabled')['to'](this,'isProcessing',_0x38bd1b=>!_0x38bd1b),_0x36632b['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x36632b['icon']=_0x3fc795['check'],_0x36632b['class']=_0x372191+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x36632b['icon']=W,_0x36632b['class']=_0x372191;},0x3e8);}),_0x36632b;}['_copyHTMLToClipboard'](_0x436c3f){const {window:_0x2f0ebe,document:_0x1bc392}=_0x101cc5;if(_0x2f0ebe['ClipboardItem']){const {Blob:_0x3dcf3e,ClipboardItem:_0x19c453}=_0x2f0ebe,_0x4a9ad5=[new _0x19c453({'text/html':new _0x3dcf3e([_0x436c3f['innerHTML']],{'type':'text/html'}),'text/plain':new _0x3dcf3e([_0x436c3f['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x4a9ad5);}else{const _0x4b90d2=_0x1bc392['createElement']('div');_0x4b90d2['style']['position']='absolute',_0x4b90d2['style']['left']='-9999px',_0x4b90d2['innerHTML']='<span>[</span>'+_0x436c3f['innerHTML']+'<span>]</span>',_0x1bc392['body']['appendChild'](_0x4b90d2);const _0xcf84ef=_0x1bc392['createRange']();_0xcf84ef['setStartAfter'](_0x4b90d2['firstElementChild']),_0xcf84ef['setEndBefore'](_0x4b90d2['lastElementChild']);const _0x4ea586=_0x2f0ebe['getSelection']();_0x4ea586['removeAllRanges'](),_0x4ea586['addRange'](_0xcf84ef),_0x1bc392['execCommand']('copy'),_0x4b90d2['remove']();}}}class mt extends _0x739eb1{constructor(_0x4437ad,_0x2e5845=''){super(_0x4437ad),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x2e5845,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x1cbf1c){this['element']['innerHTML']=_0x1cbf1c;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x1cdef7=new _0x739eb1(),_0x37f922=this['locale'],_0x53cf81=new _0x3d8baa();return _0x53cf81['isVisible']=!0x0,_0x1cdef7['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x53cf81,{'text':i(_0x37f922,'AI\x20is\x20writing...')}]}),_0x1cdef7['render'](),_0x1cdef7;}}class rt extends _0x739eb1{constructor(_0x16007f,_0x960331=''){super(_0x16007f);const _0xc5696a=new _0x474673(),_0x295332=this['bindTemplate'];this['set']('text',_0x960331),_0xc5696a['content']='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M9.9\x204.385a1.2\x201.2\x200\x200\x200-.44.44h.002l-5.284\x209.15a1.2\x201.2\x200\x200\x200\x201.04\x201.8h10.564a1.2\x201.2\x200\x200\x200\x201.04-1.8l-5.282-9.15a1.2\x201.2\x200\x200\x200-1.64-.44Zm.05\x208.363a.301.301\x200\x200\x201\x20.115-.023h.9a.301.301\x200\x200\x201\x20.3.3v.9a.3.3\x200\x200\x201-.3.3h-.9a.3.3\x200\x200\x201-.3-.3v-.9a.3.3\x200\x200\x201\x20.185-.277Zm-.185-4.723a.3.3\x200\x200\x201\x20.3-.3h.9a.3.3\x200\x200\x201\x20.3.3v3.4a.3.3\x200\x200\x201-.3.3h-.9a.301.301\x200\x200\x201-.3-.3v-3.4Z\x22/></svg>\x0a',this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0xc5696a,{'text':_0x295332['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x456c14,_0x4a0153){super(_0x456c14,_0x4a0153),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',(_0x3d6316,_0x5a0a4a)=>{_0x3d6316['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x5a0a4a());});}['_createSubmitButton'](){const _0x4bff10=new _0x40189f(this['locale']),_0x26b4ee=this['locale'];return _0x4bff10['set']({'icon':'<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.875\x204.419a.75.75\x200\x200\x200-1.5\x200v7.25H6.818l2.33-1.955a.75.75\x200\x200\x200-.963-1.15l-3.792\x203.182a.75.75\x200\x200\x200-.17.945c.046.11.118.208.21.284l3.788\x203.18a.75.75\x200\x201\x200\x20.965-1.149l-2.19-1.837h7.629c.69\x200\x201.25-.56\x201.25-1.25v-7.5Z\x22/></svg>','label':i(_0x26b4ee,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x4bff10['on']('execute',()=>{this['submit']();}),_0x4bff10['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x6be23d,_0x1df429)=>!_0x6be23d&&_0x1df429),_0x4bff10;}['_createShowHistoryButton'](){const _0x47a785=new _0x40189f(this['locale']),_0x4b6465=this['resultsView'],_0x2f53d0=this['locale'];_0x47a785['set']({'label':i(_0x2f53d0,'History'),'withText':!0x1,'icon':_0x3fc795['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x47a785['bind']('isOn')['to'](_0x4b6465,'isVisible'),_0x47a785['bind']('isEnabled')['to'](this,'isEnabled'),_0x47a785['on']('execute',()=>{_0x4b6465['isVisible']=!_0x4b6465['isVisible'],_0x4b6465['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x2181ce=()=>{_0x101cc5['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x1e2154=new st(this['queryView']['fieldView']['element']),_0x41fcbc=_0x1e2154['width'],_0x4acaae='rtl'===_0x2f53d0['uiLanguageDirection']?'left':'right';_0x1e2154['excludeScrollbarsAndBorders'](),_0x47a785['element']['style'][_0x4acaae]=_0x41fcbc-_0x1e2154['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x2181ce),this['on']('render',_0x2181ce),_0x47a785;}['submit'](){const _0x1425f3=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x1425f3);}['focus'](_0x62d33e){-0x1===_0x62d33e?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x18b3cc){super(_0x18b3cc),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x18b3cc,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x4999b1=0x0;for(const _0x63875 of this['items'])_0x4999b1+=_0x63875['items']['length'];return{'resultsCount':_0x4999b1,'totalItemsCount':_0x4999b1};}['_createClearHistoryButton'](){const _0x325db0=this['locale'],_0x555fc3=new _0x40189f(this['locale']);return _0x555fc3['set']({'label':'('+i(_0x325db0,'Clear')+')','withText':!0x0}),_0x555fc3['on']('execute',()=>this['fire']('clearHistory')),_0x555fc3;}}class hs extends _0x4f312e{constructor(_0x47c7d7){super();const _0x4437e7=new te(),_0x4efc53=new _0x40189f(this['locale'],_0x4437e7);this['children']['add'](_0x4efc53),_0x4efc53['set']({'label':_0x47c7d7['prompt'],'withText':!0x0}),_0x4efc53['on']('execute',()=>{this['fire']('execute',{'value':_0x17cf55(_0x47c7d7['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x548f2a{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x7d4a67,_0x4e491f)=>{const _0x2a0846=Ss(_0x4e491f['prompt']);for(const _0x4ebd0c of this)if(_0x4ebd0c!=_0x4e491f&&Ss(_0x4ebd0c['prompt'])===_0x2a0846){this['remove'](_0x4ebd0c);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x12084b=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x12084b));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x1dbf65=>_0x1dbf65)));}}function Ss(_0x10b882){return _0x10b882['toLowerCase']()['trim']();}class k extends _0x739eb1{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0xe0d32a,_0xc0fd85,_0xca11f3=''){super(_0xe0d32a),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',M['REPLACE']),this['_promptHistory']=new os(),this['errorView']=new rt(_0xe0d32a),this['contentArea']=new X(_0xe0d32a,_0xca11f3),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 _0x1deb4b(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x7061df({'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 _0x36e74f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0xc0fd85],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x36e74f['if']('isError','ck-hidden',_0x16ef5e=>!_0x16ef5e)]},'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'](_0x1e7c37=0x1){-0x1===_0x1e7c37?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 _0x48c517=this['locale'],_0x1cb8a7=new ht(_0x48c517,{'queryView':{'label':i(_0x48c517,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x116c15,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x48c517,'Empty\x20history'),'secondary':i(_0x48c517,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x1cb8a7['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x363722,_0x3d100e)=>_0x363722&&!_0x3d100e),this['listenTo'](_0x1cb8a7,'submit',(_0x51bd02,_0x506c60)=>{this['prompt']=_0x506c60;const _0x354bde=_0x29b8a8(_0x506c60);this['fire']('submitPrompt',_0x354bde),_0x506c60['trim']()&&this['_promptHistory']['add']({'prompt':_0x354bde},0x0);},{'priority':'high'}),_0x1cb8a7;}['_createHistoryView'](){const _0x57bb0d=new rs(this['locale']);return _0x57bb0d['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x57bb0d['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x57bb0d;}['_createToolbar'](){const _0x148874=new at(this['locale']);return _0x148874['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5ec81c,_0x482e9f,_0x4526be)=>_0x5ec81c&&!_0x482e9f&&!!_0x4526be),_0x148874['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x148874['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x3f7769,_0x151915,_0x405c2e)=>_0x3f7769&&!_0x151915&&!!_0x405c2e),_0x148874['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x148874['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x363fda,_0x5a54ae)=>_0x363fda&&!_0x5a54ae),_0x148874['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x148874['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x148874['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x148874;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x3503e6=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x3503e6,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x52a710){const _0x2a96a4=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x52a710||i(_0x2a96a4,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}var T='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.346\x209.422a.151.151\x200\x200\x201\x20.284\x200l.548\x201.484a.152.152\x200\x200\x200\x20.09.089l1.483.549a.151.151\x200\x200\x201\x200\x20.284l-1.483.548a.151.151\x200\x200\x200-.09.09l-.548\x201.483a.152.152\x200\x200\x201-.142.1.151.151\x200\x200\x201-.142-.1l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.15.15\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.089-.09l.549-1.483Z\x22/><path\x20d=\x22M16.306\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.15.15\x200\x200\x200\x20.089.09l1.483.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.15.15\x200\x200\x200-.09.09l-.548\x201.482a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.09-.089l.548-1.483Z\x22/><path\x20d=\x22M7.665\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.151.151\x200\x200\x200\x20.09.09l1.482.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.151.151\x200\x200\x200-.09.09L7.95\x206.267a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.151.151\x200\x200\x200-.089-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.483-.549a.151.151\x200\x200\x200\x20.09-.089l.548-1.483-.001.001Z\x22/><path\x20d=\x22M14.72\x207.946a.848.848\x200\x200\x200\x20.25-.591.824.824\x200\x200\x200-.241-.588l-1.943-1.938a.812.812\x200\x200\x200-.588-.241.838.838\x200\x200\x200-.591.25l-1.545\x201.539\x203.115\x203.115\x201.542-1.546h.001Z\x22/><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M1.19\x2015.636a.96.96\x200\x200\x201\x20.281-.679l7.835-7.834\x203.121\x203.12-7.834\x207.835a.959.959\x200\x200\x201-1.358\x200l-1.764-1.764a.96.96\x200\x200\x201-.28-.678Zm9.22-5.391-1.121-1.12-6.479\x206.478\x201.121\x201.121\x206.479-6.479Z\x22/></svg>';const w=globalThis['DataTransfer'];class n extends _0x46adca{['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[_0x4ae5bd,a,K,_0x3de10b];}constructor(_0x1b1d53){super(_0x1b1d53),_0x1b1d53['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x1b1d53['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x1b1d53['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x1b1d53['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x29ce4f}=this;this['_aiAdapter']=_0x29ce4f['plugins']['get'](K),this['_dialog']=_0x29ce4f['plugins']['get'](_0x3de10b),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x32e184=new E(_0x29ce4f,Array['from'](this['_commandDefinitions']['values']()));_0x29ce4f['commands']['add']('showAIAssistant',_0x32e184),_0x29ce4f['ui']['componentFactory']['add']('aiCommands',_0x3e0957=>{const _0x1c984d=_0x242bb0(_0x3e0957);return _0x1c984d['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x1c984d['buttonView']['set']({'label':i(_0x3e0957,'AI\x20Commands'),'icon':T,'tooltip':!0x0}),_0x1c984d['on']('execute',_0x6c58ce=>this['_onExecute'](_0x6c58ce['source']['id'])),_0x760a67(_0x1c984d,_0x29ce4f['ui']['view']['body'],function(_0x5ab4df){const _0x15471d=o(_0x5ab4df['config']['get']('ai.aiAssistant.commands'),_0x5ab4df['locale']),_0x26a93b=U(_0x5ab4df,_0x15471d)['filter'](_0x1cef71=>_0x1cef71['commands']['length']);if(0x1===_0x26a93b['length'])return U(_0x5ab4df,_0x26a93b[0x0]['commands'])['map'](_0x808399=>({'id':_0x808399['id'],'label':_0x808399['label']}));return _0x26a93b['map'](_0x31a3ca=>{const {groupId:_0x23b2c9,groupLabel:_0x2e43cf,commands:_0x177b55}=_0x31a3ca,_0xc8757e=U(_0x5ab4df,_0x177b55)['map'](_0xcac11b=>({'id':_0xcac11b['id'],'label':_0xcac11b['label']}));return{'id':_0x23b2c9,'menu':_0x2e43cf||_0x23b2c9,'children':_0xc8757e};});}(_0x29ce4f),{'ariaLabel':i(_0x3e0957,'AI\x20Commands')}),_0x1c984d['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x32e184['on']('change:enabledCommandsIds',_0x2e288b),_0x1c984d['menuView']['once']('render',_0x2e288b),_0x1c984d;function _0x2e288b(){_0x1c984d['isEnabled']=_0x32e184['enabledCommandsIds']['length']>0x0;for(const _0x7a5941 of _0x1c984d['menuView']['buttons'])_0x7a5941['isEnabled']=_0x32e184['enabledCommandsIds']['includes'](_0x7a5941['id']);}}),_0x29ce4f['ui']['componentFactory']['add']('menuBar:aiCommands',_0x3b4ad1=>{const _0x2b464f=new _0x58ac85(_0x3b4ad1);_0x2b464f['buttonView']['set']({'label':i(_0x3b4ad1,'AI\x20Commands'),'icon':T}),_0x2b464f['bind']('isEnabled')['to'](_0x32e184,'enabledCommandsIds',_0xdab5=>_0xdab5['length']>0x0);const _0xc75357=o(_0x29ce4f['config']['get']('ai.aiAssistant.commands'),_0x3b4ad1);return this['_populateMenuBarMenu'](_0x32e184,_0x2b464f,_0xc75357,_0x2ffe65=>this['_onExecute'](_0x2ffe65)),_0x2b464f;}),_0x29ce4f['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x4448a9=this['_createAIAssistantUIButton'](_0x40189f);return _0x4448a9['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x4448a9;}),_0x29ce4f['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x1ec21d=this['_createAIAssistantUIButton'](_0xecfb79);return _0x1ec21d['set']({'role':'menuitemcheckbox'}),_0x1ec21d;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x402f73=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x26c0d9;for(const _0x15d241 in _0x402f73){const _0x56693e=_0x15d241,_0x5833f8=_0x402f73[_0x56693e];if('aiLicenseKeyValid'==_0x5833f8||'aiLicenseKeyInvalid'==_0x5833f8||'aiLicenseKeyExpired'==_0x5833f8||'aiLicenseKeyDomainLimit'==_0x5833f8||'aiLicenseKeyNotAllowed'==_0x5833f8||'aiLicenseKeyEvaluationLimit'==_0x5833f8||'aiLicenseKeyTrialLimit'==_0x5833f8||'aiLicenseKeyUsageLimit'==_0x5833f8){delete _0x402f73[_0x56693e],_0x26c0d9=_0x5833f8,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x26c0d9&&_0x402f73['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x26c0d9&&_0x402f73['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x26c0d9&&_0x402f73['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x26c0d9&&_0x402f73['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x26c0d9&&_0x402f73['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x26c0d9&&_0x402f73['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x26c0d9&&_0x402f73['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x3513c2='',_0x537373='',_0xe5c912='custom'){const _0x4dc500=this['editor'],_0x552dc0=_0x4dc500['editing']['view'],_0x127272=_0x4dc500['plugins']['get'](a),_0x51c38d=_0x4dc500['plugins']['get'](_0x4ae5bd);_0x127272['showFakeVisualSelection']();const _0x418cb1=new w(),_0xbf1166=new ClipboardEvent('copy',{'clipboardData':_0x418cb1}),_0x4c79c8=new _0x52b384(_0x418cb1),_0x55bf3c=new _0x1fc58a(_0x552dc0,_0xbf1166,{'dataTransfer':_0x4c79c8});_0x51c38d['_forceMarkersCopy']('comment',()=>{_0x552dc0['document']['fire']('copy',_0x55bf3c);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x4dc500,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x2e426b=_0x4c79c8['getData']('text/html');const _0x43f1c9=_0x4dc500['model']['document']['selection'],_0xcb907f=Array['from'](_0x43f1c9['getRanges']());0x1===_0xcb907f['length']&&_0xcb907f[0x0]['isFlat']&&!_0x43f1c9['getSelectedElement']()&&''!==_0x2e426b['replace'](/ /g,'')['trim']()&&(_0x2e426b='<p>'+_0x2e426b+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0xe5c912,'query':_0x3513c2,'htmlContent':_0x2e426b,'label':_0x537373,'mainActionLabel':M[_0x4dc500['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':ct['robotPencil'],'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x13600b['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x127272['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0xc7913e=new Map(),_0x41d58=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x53f9f0 of _0x41d58)for(const _0x556d0e of _0x53f9f0['commands'])_0xc7913e['set'](_0x556d0e['id'],{..._0x556d0e,'groupId':_0x53f9f0['groupId'],'groupLabel':_0x53f9f0['groupLabel']||_0x53f9f0['groupId']});return _0xc7913e;}['_createAIAssistantUIButton'](_0x5c348b){const _0xf3033a=this['editor'],_0x21c780=_0xf3033a['commands']['get']('showAIAssistant'),_0x363e06=new _0x5c348b(_0xf3033a['locale']);return _0x363e06['set']({'label':i(_0xf3033a['locale'],'AI\x20Assistant'),'icon':ct['robotPencil'],'isToggleable':!0x0}),_0x363e06['bind']('isEnabled')['to'](_0x21c780),_0x363e06['bind']('isOn')['to'](this['_dialog'],'id',_0x37c5e0=>'aiAssistant'===_0x37c5e0),this['listenTo'](_0x363e06,'execute',()=>{_0x363e06['isOn']?this['hideUI']():_0x21c780['execute']();}),_0x363e06;}['_initView'](){const _0x444c8a=this['editor']['plugins']['get'](a);this['_formView']=new k(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.aiAssistant.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',()=>{_0x444c8a['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x444c8a['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x2d3686,ui:{ariaLiveAnnouncer:_0x4d9db1}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x4cd171,_0x1e6c33,_0x48ebd2)=>{const _0x162611=this['_aiAssistantController']['currentContext'];_0x48ebd2?_0x4d9db1['announce'](i(_0x2d3686,'AI\x20is\x20writing')):_0x162611&&_0x4d9db1['announce'](i(_0x2d3686,'Generated\x20content:\x20%0',_0x162611),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x18e54f,_0x499016,_0x487301)=>{if(_0x487301){const _0x4515d8=this['_formView']['errorView']['text'];_0x4d9db1['announce'](i(_0x2d3686,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x4515d8));}});}['_onExecute'](_0xe28de0){const _0x2c9380=this['_commandDefinitions']['get'](_0xe28de0),_0x43eaba=this['editor'],_0x59307e=_0x43eaba['model']['document']['selection'],_0x3998e1=_0x43eaba['commands']['get']('showAIAssistant'),_0x444fe0=_0x43eaba['plugins']['get'](a),_0x472bee=''+(_0x2c9380['groupId']!==x?_0x2c9380['groupLabel']+':\x20':'')+_0x2c9380['label'];if(!0x1!==_0x2c9380['requiresContent']&&_0x59307e['isCollapsed']){const _0x43cf96=_0x283771(_0x59307e['getSelectedBlocks']())||_0x43eaba['model']['schema']['getLimitElement'](_0x59307e);_0x43eaba['model']['change'](_0x59637b=>{_0x59637b['setSelection'](_0x43cf96,'in');});}_0x444fe0['showFakeVisualSelection'](),_0x3998e1['execute'](_0x2c9380['prompt'],_0x472bee,'command:'+_0xe28de0);}['_populateMenuBarMenu'](_0x3aa454,_0x571bd3,_0x549779,_0x2b9d59){const _0xc0777c=this['editor'],_0x5b78b8=_0xc0777c['locale'],_0x5b805f=new _0x48d9e1(_0x5b78b8),_0x28339c=U(_0xc0777c,_0x549779)['filter'](_0x3d4310=>_0x3d4310['commands']['length']);0x1===_0x28339c['length']?this['_getMenuBarGroupButtons']({'command':_0x3aa454,'commands':_0x28339c[0x0]['commands'],'parentMenuView':_0x571bd3,'onExecute':_0x2b9d59})['forEach'](_0x292219=>_0x5b805f['items']['add'](_0x292219)):_0x28339c['forEach'](({groupId:_0x264a0a,groupLabel:_0x2119d7,commands:_0x561c52})=>{const _0x424506=new _0x398191(_0x5b78b8,_0x571bd3),_0x507320=new _0x58ac85(_0x5b78b8),_0x560e0c=new _0x48d9e1(_0x5b78b8),_0x554d2d=this['_getMenuBarGroupButtons']({'command':_0x3aa454,'commands':_0x561c52,'parentMenuView':_0x507320,'onExecute':_0x2b9d59});_0x507320['buttonView']['set']({'label':_0x2119d7||_0x264a0a}),_0x507320['delegate']('execute')['to'](_0x571bd3),_0x560e0c['items']['addMany'](_0x554d2d),_0x507320['panelView']['children']['add'](_0x560e0c),_0x424506['children']['add'](_0x507320),_0x5b805f['items']['add'](_0x424506);}),_0x571bd3['panelView']['children']['add'](_0x5b805f);}['_getMenuBarGroupButtons']({command:_0x22b6f8,commands:_0x4e74bb,parentMenuView:_0x25fe41,onExecute:_0x56f95c}){const _0x2a8d92=this['editor'],_0xde3185=_0x2a8d92['locale'];return U(_0x2a8d92,_0x4e74bb)['map'](_0xd17d07=>{const _0x478c55=new _0x398191(_0xde3185,_0x25fe41),_0x45d3a0=new _0xecfb79(_0xde3185);return _0x45d3a0['set']({'label':_0xd17d07['label']}),_0x45d3a0['delegate']('execute')['to'](_0x25fe41),_0x45d3a0['on']('execute',()=>_0x56f95c(_0xd17d07['id'])),_0x45d3a0['bind']('isEnabled')['to'](_0x22b6f8,'enabledCommandsIds',_0x5a1c8e=>_0x5a1c8e['includes'](_0xd17d07['id'])),_0x478c55['children']['add'](_0x45d3a0),_0x478c55;});}}function B(_0x1b3cf2,_0x1df4ba){return void 0x0!==_0x1b3cf2['order']&&void 0x0===_0x1df4ba['order']?0x1:void 0x0===_0x1b3cf2['order']&&void 0x0!==_0x1df4ba['order']?-0x1:void 0x0!==_0x1b3cf2['order']&&void 0x0!==_0x1df4ba['order']?_0x1b3cf2['order']-_0x1df4ba['order']:0x0;}function U(_0x59a14e,_0x1dffd8){_0x1dffd8['sort'](B);const _0x511941={},_0x322705=[];for(const _0x4b3d17 of _0x1dffd8)if(void 0x0!==_0x4b3d17['order']){if(_0x4b3d17['order']in _0x511941)throw new _0x5b5d42('ai-commands-config-order-collision',_0x59a14e,{'conflictingDefinitions':[_0x4b3d17,_0x511941[_0x4b3d17['order']]]});_0x511941[_0x4b3d17['order']]=_0x4b3d17,_0x322705['splice'](_0x4b3d17['order'],0x0,_0x4b3d17);}else _0x322705['push'](_0x4b3d17);return _0x322705;}class r extends _0x46adca{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3566b9){super(_0x3566b9);const _0x2fbf81=_0x3566b9['config'],_0x47c0d0=_0x3566b9['locale'];_0x2fbf81['define']('ai.aiAssistant.preserveComments',!0x0),_0x2fbf81['define']('ai.aiAssistant.commands',function(_0x29ad89){return[{'groupId':'editOrReview','groupLabel':i(_0x29ad89,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x29ad89,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x29ad89,'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':i(_0x29ad89,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x29ad89,'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':i(_0x29ad89,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x29ad89,'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':i(_0x29ad89,'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':i(_0x29ad89,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x29ad89,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x29ad89,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x29ad89,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x29ad89,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x29ad89,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x29ad89,'Change\x20style'),'commands':[{'id':'business','label':i(_0x29ad89,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x29ad89,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x29ad89,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x29ad89,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x29ad89,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x29ad89,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x29ad89,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x29ad89,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x29ad89,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x29ad89,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x29ad89,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x29ad89,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x29ad89,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x47c0d0)),_0x2fbf81['define']('ai.aiAssistant.extraCommandGroups',[]),_0x2fbf81['define']('ai.aiAssistant.removeCommands',[]);let _0x598e21=o(_0x2fbf81['get']('ai.aiAssistant.commands'),_0x47c0d0);const _0x3a27f4=_0x2fbf81['get']('ai.aiAssistant.extraCommandGroups'),_0x4ad4c8=_0x2fbf81['get']('ai.aiAssistant.removeCommands');_0x3a27f4['forEach'](_0x15ccd7=>{const _0xc8480a=_0x598e21['find'](_0x27fb21=>_0x27fb21['groupId']===_0x15ccd7['groupId']);_0xc8480a?_0xc8480a['commands']=_0xc8480a['commands']['concat'](_0x15ccd7['commands']):_0x598e21['push'](_0x15ccd7);}),_0x598e21=_0x598e21['filter'](_0x2ac4ff=>!_0x4ad4c8['includes'](_0x2ac4ff['groupId'])),_0x598e21['forEach'](_0x2c97da=>{_0x2c97da['commands']=_0x2c97da['commands']['filter'](_0x25ad09=>!_0x4ad4c8['includes'](_0x25ad09['id']));}),_0x2fbf81['set']('ai.aiAssistant.commands',_0x598e21);}}class P extends _0x46adca{['abortController'];static get['requires'](){return[K];}constructor(_0x4d8a75){super(_0x4d8a75),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](K)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x34efea){return this['sendRequest'](_0x34efea)['catch'](_0x9eacaa=>{if(_0x9eacaa instanceof R)return Promise['reject'](_0x9eacaa);if('AbortError'==_0x9eacaa['name'])return Promise['resolve']();throw console['error'](_0x9eacaa),new _0x5b5d42('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x29765,_0x25cc47){const _0x1a7063=this['editor']['locale'],_0x4c7cac={'Content-Type':'application/json'};if('object'==typeof _0x29765)Object['assign'](_0x4c7cac,_0x29765);else{if(_0x29765)try{const _0x28d92a=await _0x29765(_0x25cc47);Object['assign'](_0x4c7cac,_0x28d92a);}catch(_0x43dedc){return Promise['reject'](new R(i(_0x1a7063,'AI_ERROR_GET_HEADERS')));}}return _0x4c7cac;}async['_prepareRequestParameters'](_0x3beabf,_0xb264df){const _0x25fdcd=this['editor']['locale'];if('object'==typeof _0x3beabf)return _0x3beabf;try{return await _0x3beabf(_0xb264df);}catch(_0x4415e3){return Promise['reject'](new R(i(_0x25fdcd,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x308178){super(_0x308178),_0x308178['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x308178['config']['get']('ai.openAI.requestParameters')||_0x308178['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x308178['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x308178['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x308178['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x42b00a,context:_0x3c77a9,onData:_0x41f95e,actionId:_0x4efebc}){const _0x1c0354=this['editor']['locale'],_0x101083=await this['prepareMessages'](_0x42b00a,_0x3c77a9,_0x4efebc),_0x4e6cfb=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4efebc),_0x5a5c0c=await this['_prepareRequestParameters'](this['_requestParameters'],_0x4efebc),_0xba8cc9={'messages':_0x101083,..._0x5a5c0c},_0x3649e6={'method':'POST','headers':_0x4e6cfb,'body':JSON['stringify'](_0xba8cc9),'signal':this['abortController']['signal']},_0x2cad65=await fetch(this['_apiUrl'],_0x3649e6);if(_0x2cad65['ok'])return _0x5a5c0c['stream']?await this['_readStreamableResponse'](_0x2cad65,_0x41f95e):await this['_readStaticResponse'](_0x2cad65,_0x41f95e),Promise['resolve']();{const _0x270b40=await _0x2cad65['text']();return _0x270b40['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x1c0354,'AI_ERROR_CONTEXT_LENGTH'))):_0x270b40['includes']('Moderation')?Promise['reject'](new R(i(_0x1c0354,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x270b40));}}async['prepareMessages'](_0x45c052,_0x7bf5,_0x13b8d1){let _0x5c9972,_0xdc8159;return _0x7bf5?(_0x5c9972='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.',_0xdc8159='Instruction:\x0a'+_0x45c052+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x7bf5):(_0x5c9972='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.',_0xdc8159=_0x45c052),[{'role':'system','content':_0x5c9972},{'role':'user','content':_0xdc8159}];}async['_readStreamableResponse'](_0x294d8b,_0x179774){const _0x1d0868=_0x294d8b['body']['getReader'](),_0x1027c3=new TextDecoder();let _0x5df3d1='',_0x426d44='',_0x1557f3='',_0xfe594d=!0x1;for(;!_0xfe594d;){const {done:_0x24ae06,value:_0x5276dc}=await _0x1d0868['read'](),_0xa4cd68=_0x5df3d1+_0x1027c3['decode'](_0x5276dc);let _0x80d32a='';_0xfe594d=_0x24ae06;try{_0x80d32a=this['_cleanUpData'](_0xa4cd68),_0x5df3d1='';}catch(_0x1cc10f){_0x5df3d1=_0xa4cd68;continue;}_0x426d44+=_0x80d32a,!_0xfe594d&&this['_isBufferIncomplete'](_0x426d44)||_0x426d44&&(_0x1557f3+=_0x426d44,_0x426d44='',_0x179774(_0x1557f3));}return Promise['resolve']();}async['_readStaticResponse'](_0x2bb200,_0x4806b6){return _0x4806b6((await _0x2bb200['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x136e60){const _0x2452a2=_0x136e60['split']('<')['length']!==_0x136e60['split']('>')['length'],_0x5c23ef=_0x136e60['length']<0x1e;return _0x2452a2&&_0x5c23ef;}['_cleanUpData'](_0x3d0bdc){return _0x3d0bdc['split'](/\n(?![^{]*\})/g)['map'](_0x1e04b3=>_0x1e04b3['replace']('data:\x20',''))['filter'](_0x2bc86a=>_0x2bc86a&&_0x2bc86a['length']>0x0&&'[DONE]'!==_0x2bc86a)['map'](_0x4b1e78=>{const {choices:_0x1eb865}=JSON['parse'](_0x4b1e78);if(_0x1eb865[0x0]&&_0x1eb865[0x0]['delta']&&_0x1eb865[0x0]['delta']['content'])return _0x1eb865[0x0]['delta']['content'];})['filter'](_0x2c1412=>_0x2c1412)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x4173e2){super(_0x4173e2),_0x4173e2['config']['get']('ai.aws.requestParameters')||_0x4173e2['config']['define']('ai.aws.requestParameters',{'model':'anthropic.claude-v2','max_tokens_to_sample':0x7d0,'temperature':0x1,'top_p':0x1,'top_k':0xfa,'anthropic_version':'bedrock-2023-05-31','stream':!0x0}),this['_apiUrl']=_0x4173e2['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x4173e2['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x4173e2['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x4173e2['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x182d91,context:_0x56e40c,onData:_0x433f98,actionId:_0x383f37}){const {model:_0x150ff8,stream:_0x39255f,..._0x4b612a}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x383f37),_0x4fe121={'prompt':await this['preparePrompt'](_0x182d91,_0x56e40c,_0x150ff8,_0x383f37),..._0x4b612a};this['_apiUrl']?await this['_processProxyRequest'](_0x4fe121,_0x150ff8,_0x39255f,_0x433f98,_0x383f37):await this['_processAWSRequest'](_0x4fe121,_0x150ff8,_0x39255f,_0x433f98);}async['preparePrompt'](_0x44bb8c,_0xfa2d20,_0x2f9d43,_0x40987f){let _0x5f10d,_0x3eef2f;return _0xfa2d20?(_0x5f10d='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.',_0x3eef2f='Instruction:\x0a'+_0x44bb8c+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0xfa2d20):(_0x5f10d='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.',_0x3eef2f=_0x44bb8c),'meta.llama'==this['getModelFamily'](_0x2f9d43)?'<<SYS>>\x0a'+_0x5f10d+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x3eef2f+'\x0a[/INST]':'Human:\x0a'+_0x5f10d+'\x0a'+_0x3eef2f+'\x0a\x0aAssistant:';}['getModelFamily'](_0x3bd0ae){if(/^anthropic\.claude/['test'](_0x3bd0ae))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x3bd0ae))return'ai21.j2';if(/^cohere\.command/['test'](_0x3bd0ae))return'cohere.command';if(/^meta\.llama/['test'](_0x3bd0ae))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x3bd0ae));}async['_processProxyRequest'](_0x5c345e,_0x34b5df,_0x3e3739,_0x1e189f,_0x1c3a99){const _0x51c658={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x1c3a99),'body':JSON['stringify']({..._0x5c345e,'model':_0x34b5df,'stream':_0x3e3739}),'signal':this['abortController']['signal']},_0x3e43b7=await fetch(this['_apiUrl'],_0x51c658);_0x3e3739?await this['_readStreamableResponse'](_0x3e43b7,_0x34b5df,_0x1e189f):await this['_readStaticResponse'](_0x3e43b7,_0x34b5df,_0x1e189f);}async['_processAWSRequest'](_0x338604,_0x5ef051,_0x177f57,_0x44b08a){const _0x339988=new _0x2b981f(this['_bedrockClientConfig']),_0x335e83={'body':JSON['stringify'](_0x338604),'contentType':'application/json','accept':'application/json','modelId':_0x5ef051};let _0x2db856;if(_0x177f57){const _0x58766f=new _0x512fea(_0x335e83);_0x2db856=await _0x339988['send'](_0x58766f,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x2db856,_0x5ef051,_0x44b08a);}else{const _0x1124b1=new _0x34df9a(_0x335e83);_0x2db856=await _0x339988['send'](_0x1124b1,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x2db856,_0x5ef051,_0x44b08a);}}async['_readAsyncIterableResponse'](_0x5a8b5e,_0x525933,_0x46248e){const _0x373843=_0x5a8b5e['body'],_0x1dc249=new TextDecoder('utf-8');let _0x27d3c2='';for await(const _0x35cb08 of _0x373843)if(_0x35cb08['chunk']){const _0x760c6=_0x1dc249['decode'](_0x35cb08['chunk']['bytes']),_0x40e31c=JSON['parse'](_0x760c6);_0x27d3c2+=this['_getGeneratedText'](_0x40e31c,_0x525933),_0x46248e(_0x27d3c2);}return Promise['resolve']();}async['_readStreamableResponse'](_0x462d97,_0x2ab071,_0x25eac5){const _0x55e0c2=_0x462d97['body'],_0x252116=new TextDecoder('utf-8'),_0xb4d90f=_0x55e0c2['getReader']();let _0x25f320='',_0x43fcb9='',_0x2271c5=!0x1;for(;!_0x2271c5;){const {done:_0x2cf2d8,value:_0x53bd88}=await _0xb4d90f['read']();if(_0x2271c5=_0x2cf2d8,_0x2271c5)break;const _0x4154d3=(_0x25f320+_0x252116['decode'](_0x53bd88))['split']('\x0a')['map'](_0x5d49f8=>{try{return _0x25f320='',JSON['parse'](_0x5d49f8);}catch(_0x4eacd1){return _0x25f320=_0x5d49f8,null;}})['filter'](_0x417cc5=>null!==_0x417cc5);_0x4154d3['length']&&(_0x43fcb9+=_0x4154d3['map'](_0x57f64d=>this['_getGeneratedText'](_0x57f64d,_0x2ab071))['join'](''),_0x25eac5(_0x43fcb9));}return Promise['resolve']();}async['_readStaticResponse'](_0x477c8d,_0xe4b995,_0x20564d){let _0x1161cd;return _0x1161cd=_0x477c8d instanceof Response?await _0x477c8d['json']():JSON['parse'](Buffer['from'](_0x477c8d['body'])['toString']('utf8')),(_0x20564d(this['_getGeneratedText'](_0x1161cd,_0xe4b995)),Promise['resolve']());}['_getGeneratedText'](_0x563608,_0x2f6463){switch(this['getModelFamily'](_0x2f6463)){case'anthropic.claude':return _0x563608['completion'];case'ai21.j2':return _0x563608['completions'][0x0]['data']['text'];case'cohere.command':return _0x563608['generations'][0x0]['text'];case'meta.llama':return _0x563608['generation'];}}}export{K as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,O as AWSTextAdapter,H as OpenAITextAdapter};
|