@ckeditor/ckeditor5-ai 44.3.0-alpha.2 → 44.3.0-alpha.4

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.
Files changed (168) hide show
  1. package/build/ai.js +1 -1
  2. package/dist/index.js +2 -2
  3. package/dist/translations/af.js +1 -1
  4. package/dist/translations/af.umd.js +1 -1
  5. package/dist/translations/ar.js +1 -1
  6. package/dist/translations/ar.umd.js +1 -1
  7. package/dist/translations/ast.js +1 -1
  8. package/dist/translations/ast.umd.js +1 -1
  9. package/dist/translations/az.js +1 -1
  10. package/dist/translations/az.umd.js +1 -1
  11. package/dist/translations/bg.js +1 -1
  12. package/dist/translations/bg.umd.js +1 -1
  13. package/dist/translations/bn.js +1 -1
  14. package/dist/translations/bn.umd.js +1 -1
  15. package/dist/translations/bs.js +1 -1
  16. package/dist/translations/bs.umd.js +1 -1
  17. package/dist/translations/ca.js +1 -1
  18. package/dist/translations/ca.umd.js +1 -1
  19. package/dist/translations/cs.js +1 -1
  20. package/dist/translations/cs.umd.js +1 -1
  21. package/dist/translations/da.js +1 -1
  22. package/dist/translations/da.umd.js +1 -1
  23. package/dist/translations/de-ch.js +1 -1
  24. package/dist/translations/de-ch.umd.js +1 -1
  25. package/dist/translations/de.js +1 -1
  26. package/dist/translations/de.umd.js +1 -1
  27. package/dist/translations/el.js +1 -1
  28. package/dist/translations/el.umd.js +1 -1
  29. package/dist/translations/en-au.js +1 -1
  30. package/dist/translations/en-au.umd.js +1 -1
  31. package/dist/translations/en-gb.js +1 -1
  32. package/dist/translations/en-gb.umd.js +1 -1
  33. package/dist/translations/en.js +1 -1
  34. package/dist/translations/en.umd.js +1 -1
  35. package/dist/translations/eo.js +1 -1
  36. package/dist/translations/eo.umd.js +1 -1
  37. package/dist/translations/es-co.js +1 -1
  38. package/dist/translations/es-co.umd.js +1 -1
  39. package/dist/translations/es.js +1 -1
  40. package/dist/translations/es.umd.js +1 -1
  41. package/dist/translations/et.js +1 -1
  42. package/dist/translations/et.umd.js +1 -1
  43. package/dist/translations/eu.js +1 -1
  44. package/dist/translations/eu.umd.js +1 -1
  45. package/dist/translations/fa.js +1 -1
  46. package/dist/translations/fa.umd.js +1 -1
  47. package/dist/translations/fi.js +1 -1
  48. package/dist/translations/fi.umd.js +1 -1
  49. package/dist/translations/fr.js +1 -1
  50. package/dist/translations/fr.umd.js +1 -1
  51. package/dist/translations/gl.js +1 -1
  52. package/dist/translations/gl.umd.js +1 -1
  53. package/dist/translations/gu.js +1 -1
  54. package/dist/translations/gu.umd.js +1 -1
  55. package/dist/translations/he.js +1 -1
  56. package/dist/translations/he.umd.js +1 -1
  57. package/dist/translations/hi.js +1 -1
  58. package/dist/translations/hi.umd.js +1 -1
  59. package/dist/translations/hr.js +1 -1
  60. package/dist/translations/hr.umd.js +1 -1
  61. package/dist/translations/hu.js +1 -1
  62. package/dist/translations/hu.umd.js +1 -1
  63. package/dist/translations/hy.js +1 -1
  64. package/dist/translations/hy.umd.js +1 -1
  65. package/dist/translations/id.js +1 -1
  66. package/dist/translations/id.umd.js +1 -1
  67. package/dist/translations/it.js +1 -1
  68. package/dist/translations/it.umd.js +1 -1
  69. package/dist/translations/ja.js +1 -1
  70. package/dist/translations/ja.umd.js +1 -1
  71. package/dist/translations/jv.js +1 -1
  72. package/dist/translations/jv.umd.js +1 -1
  73. package/dist/translations/kk.js +1 -1
  74. package/dist/translations/kk.umd.js +1 -1
  75. package/dist/translations/km.js +1 -1
  76. package/dist/translations/km.umd.js +1 -1
  77. package/dist/translations/kn.js +1 -1
  78. package/dist/translations/kn.umd.js +1 -1
  79. package/dist/translations/ko.js +1 -1
  80. package/dist/translations/ko.umd.js +1 -1
  81. package/dist/translations/ku.js +1 -1
  82. package/dist/translations/ku.umd.js +1 -1
  83. package/dist/translations/lt.js +1 -1
  84. package/dist/translations/lt.umd.js +1 -1
  85. package/dist/translations/lv.js +1 -1
  86. package/dist/translations/lv.umd.js +1 -1
  87. package/dist/translations/ms.js +1 -1
  88. package/dist/translations/ms.umd.js +1 -1
  89. package/dist/translations/nb.js +1 -1
  90. package/dist/translations/nb.umd.js +1 -1
  91. package/dist/translations/ne.js +1 -1
  92. package/dist/translations/ne.umd.js +1 -1
  93. package/dist/translations/nl.js +1 -1
  94. package/dist/translations/nl.umd.js +1 -1
  95. package/dist/translations/no.js +1 -1
  96. package/dist/translations/no.umd.js +1 -1
  97. package/dist/translations/oc.js +1 -1
  98. package/dist/translations/oc.umd.js +1 -1
  99. package/dist/translations/pl.js +1 -1
  100. package/dist/translations/pl.umd.js +1 -1
  101. package/dist/translations/pt-br.js +1 -1
  102. package/dist/translations/pt-br.umd.js +1 -1
  103. package/dist/translations/pt.js +1 -1
  104. package/dist/translations/pt.umd.js +1 -1
  105. package/dist/translations/ro.js +1 -1
  106. package/dist/translations/ro.umd.js +1 -1
  107. package/dist/translations/ru.js +1 -1
  108. package/dist/translations/ru.umd.js +1 -1
  109. package/dist/translations/si.js +1 -1
  110. package/dist/translations/si.umd.js +1 -1
  111. package/dist/translations/sk.js +1 -1
  112. package/dist/translations/sk.umd.js +1 -1
  113. package/dist/translations/sl.js +1 -1
  114. package/dist/translations/sl.umd.js +1 -1
  115. package/dist/translations/sq.js +1 -1
  116. package/dist/translations/sq.umd.js +1 -1
  117. package/dist/translations/sr-latn.js +1 -1
  118. package/dist/translations/sr-latn.umd.js +1 -1
  119. package/dist/translations/sr.js +1 -1
  120. package/dist/translations/sr.umd.js +1 -1
  121. package/dist/translations/sv.js +1 -1
  122. package/dist/translations/sv.umd.js +1 -1
  123. package/dist/translations/th.js +1 -1
  124. package/dist/translations/th.umd.js +1 -1
  125. package/dist/translations/ti.js +1 -1
  126. package/dist/translations/ti.umd.js +1 -1
  127. package/dist/translations/tk.js +1 -1
  128. package/dist/translations/tk.umd.js +1 -1
  129. package/dist/translations/tr.js +1 -1
  130. package/dist/translations/tr.umd.js +1 -1
  131. package/dist/translations/tt.js +1 -1
  132. package/dist/translations/tt.umd.js +1 -1
  133. package/dist/translations/ug.js +1 -1
  134. package/dist/translations/ug.umd.js +1 -1
  135. package/dist/translations/uk.js +1 -1
  136. package/dist/translations/uk.umd.js +1 -1
  137. package/dist/translations/ur.js +1 -1
  138. package/dist/translations/ur.umd.js +1 -1
  139. package/dist/translations/uz.js +1 -1
  140. package/dist/translations/uz.umd.js +1 -1
  141. package/dist/translations/vi.js +1 -1
  142. package/dist/translations/vi.umd.js +1 -1
  143. package/dist/translations/zh-cn.js +1 -1
  144. package/dist/translations/zh-cn.umd.js +1 -1
  145. package/dist/translations/zh.js +1 -1
  146. package/dist/translations/zh.umd.js +1 -1
  147. package/package.json +9 -9
  148. package/src/adapters/aiadapter.js +1 -1
  149. package/src/adapters/aitextadapter.js +1 -1
  150. package/src/adapters/awstextadapter.js +1 -1
  151. package/src/adapters/openaitextadapter.js +1 -1
  152. package/src/aiassistant.js +1 -1
  153. package/src/aiassistantediting.js +1 -1
  154. package/src/aiassistantui.js +1 -1
  155. package/src/index.js +1 -1
  156. package/src/legacyerrors.js +1 -1
  157. package/src/ui/aiassistantcontroller.js +2 -2
  158. package/src/ui/form/aiformcontentarea.js +1 -1
  159. package/src/ui/form/aiformerrorview.js +1 -1
  160. package/src/ui/form/aiformpromptview.js +1 -1
  161. package/src/ui/form/aiformtoolbarview.js +1 -1
  162. package/src/ui/form/aiformview.js +1 -1
  163. package/src/ui/form/aihistorylistitemview.js +1 -1
  164. package/src/ui/form/aihistorylistview.js +1 -1
  165. package/src/ui/form/prompthistory.js +1 -1
  166. package/src/ui/showaiassistantcommand.js +1 -1
  167. package/src/utils/common-translations.js +1 -1
  168. package/src/utils/normalizecommandsconfig.js +1 -1
package/dist/index.js CHANGED
@@ -20,5 +20,5 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x2bfdda,Command as _0x563c24,icons as _0x59275f}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0xad9b60,CKEditorError as _0x1a9453,ObservableMixin as _0x5ab7e2,global as _0x17fc35,isVisible as it,Rect as st,Collection as _0x4a0113,FocusTracker as _0x126a18,KeystrokeHandler as ts,first as _0x3309b6}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as nt,ButtonView as _0x52be94,View as _0x368bd2,SpinnerView as _0x23a3f6,IconView as _0x2a6867,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x41563c,ButtonLabelView as te,FocusCycler as _0x16d8d6,createLabeledTextarea as _0x2db248,Dialog as _0x5bf6d6,createDropdown as _0xf1ac4e,addMenuToDropdown as _0xd77474,MenuBarMenuView as _0x41ac76,MenuBarMenuListItemButtonView as _0x45d9f4,DialogViewPosition as _0x2b3f98,MenuBarMenuListView as _0x3ba367,MenuBarMenuListItemView as _0x94d296}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as ct}from'ckeditor5-collaboration/dist/index.js';import{ClipboardPipeline as _0x69c7e9,ClipboardMarkersUtils as _0xc7e545}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x420495,DataTransfer as _0x5e0b09,UpcastWriter as _0x29e50c,Matcher as _0x5c5595}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x1f1afa,escape as _0x5e1c34}from'lodash-es';import{BedrockRuntimeClient as _0x28658d,InvokeModelWithResponseStreamCommand as _0x2e0fcc,InvokeModelCommand as _0x56d5fb}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x3469b1,_0x56814b){const _0x4dc410=(0x0,_0x56814b['t'])('Other');return _0x3469b1['length']?'groupId'in _0x3469b1[0x0]?_0x3469b1:[{'groupId':x,'groupLabel':_0x4dc410,'order':0x1/0x0,'commands':_0x3469b1}]:[{'groupId':x,'groupLabel':_0x4dc410,'order':0x1/0x0,'commands':[]}];}const dt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x2bfdda{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x13131a}=this,_0x43ea83=['ck-fake-ai-selection'];_0x13131a['config']['get']('ai.useTheme')&&_0x43ea83['push']('ck-ai-assistant-ui_theme'),_0x13131a['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x43ea83,'priority':0xc}}),_0x13131a['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x4c8e3b,{writer:_0x454d0f})=>{if(!_0x4c8e3b['markerRange']['isCollapsed'])return null;const _0xdfee93=_0x454d0f['createUIElement']('span');return _0x454d0f['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0xdfee93),_0xdfee93;}});}['afterInit'](){!async function(_0x3cb2b8){const _0x5d89c8=_0x5cba1c([0x55,0x41,0x4b,0x37,0x76,0x59,0x68,0x6d,0x79,0x70,0x72,0x69,0x53,0x48,0x6b,0x78,0x62,0x36,0x6c,0x77,0x71,0x4c,0x44,0x6e,0x51,0x4d,0x45,0x7a,0x47,0x50,0x63,0x58,0x4f,0x64,0x74,0x61,0x39,0x67,0x38,0x34,0x52,0x42,0x57,0x73,0x43,0x6a,0x49,0x31,0x66,0x33,0x5a,0x4e,0x65,0x30,0x46,0x56,0x32,0x4a,0x6f,0x35,0x75,0x54]),_0x3cd9ac=0x66b4bf66,_0x8376e8=0x66b3dfae^_0x3cd9ac,_0x255704=window[_0x5cba1c([0x44,0x61,0x74,0x65])][_0x5cba1c([0x6e,0x6f,0x77])](),_0x249a25=_0x3cb2b8[_0x5cba1c([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x35255b=new window[(_0x5cba1c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x335642=>{_0x249a25[_0x5cba1c([0x6f,0x6e,0x63,0x65])](_0x5cba1c([0x72,0x65,0x61,0x64,0x79]),_0x335642);}),_0x505afe={[_0x5cba1c([0x6b,0x74,0x79])]:_0x5cba1c([0x45,0x43]),[_0x5cba1c([0x75,0x73,0x65])]:_0x5cba1c([0x73,0x69,0x67]),[_0x5cba1c([0x63,0x72,0x76])]:_0x5cba1c([0x50,0x2d,0x32,0x35,0x36]),[_0x5cba1c([0x78])]:_0x5cba1c([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]),[_0x5cba1c([0x79])]:_0x5cba1c([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]),[_0x5cba1c([0x61,0x6c,0x67])]:_0x5cba1c([0x45,0x53,0x32,0x35,0x36])},_0x16ef81=_0x249a25[_0x5cba1c([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x5cba1c([0x67,0x65,0x74])](_0x5cba1c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x26d702(){let _0x432055,_0x2000cd=null,_0x26049d=null;try{if(_0x16ef81==_0x5cba1c([0x47,0x50,0x4c]))return _0x5cba1c([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x432055=_0x242e0d(),!_0x432055)return _0x5cba1c([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x432055[_0x5cba1c([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x26049d=_0x549abb(_0x432055[_0x5cba1c([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x432055[_0x5cba1c([0x6a,0x74,0x69])])),await _0x19cc67()?_0x58c8ca()?_0x138972()?_0x5cba1c([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x3fd079()?(_0x432055[_0x5cba1c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x5cba1c([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x2000cd=_0x1c9ccc(_0x5cba1c([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x432055[_0x5cba1c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x5cba1c([0x74,0x72,0x69,0x61,0x6c])&&(_0x2000cd=_0x1c9ccc(_0x5cba1c([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x11a929()):_0x5cba1c([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x5cba1c([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x5cba1c([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0xed1527){return _0x5cba1c([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x138972(){const _0x205d86=[_0x5cba1c([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x5cba1c([0x74,0x72,0x69,0x61,0x6c])][_0x5cba1c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x432055[_0x5cba1c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x255704/0x3e8:0xe10*_0x8376e8;return _0x432055[_0x5cba1c([0x65,0x78,0x70])]<_0x205d86;}function _0x58c8ca(){const _0x406a3b=_0x432055[_0x5cba1c([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x406a3b&&(!!_0x406a3b[_0x5cba1c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5cba1c([0x2a]))||!!_0x406a3b[_0x5cba1c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5cba1c([0x41,0x49])));}function _0x3fd079(){const _0x41deb9=_0x432055[_0x5cba1c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x41deb9||0x0==_0x41deb9[_0x5cba1c([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x331f8d}=new URL(window[_0x5cba1c([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x41deb9[_0x5cba1c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x331f8d))return!0x0;const _0xc2bf27=_0x331f8d[_0x5cba1c([0x73,0x70,0x6c,0x69,0x74])](_0x5cba1c([0x2e]));return _0x41deb9[_0x5cba1c([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x2dfeee=>_0x2dfeee[_0x5cba1c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5cba1c([0x2a])))[_0x5cba1c([0x6d,0x61,0x70])](_0x7a4349=>_0x7a4349[_0x5cba1c([0x73,0x70,0x6c,0x69,0x74])](_0x5cba1c([0x2e])))[_0x5cba1c([0x73,0x6f,0x6d,0x65])](_0x414255=>_0xc2bf27[_0x5cba1c([0x65,0x76,0x65,0x72,0x79])]((_0x293c9,_0x2ff5ad)=>_0x414255[_0x2ff5ad]===_0x293c9||_0x414255[_0x2ff5ad]===_0x5cba1c([0x2a])));}function _0x11a929(){return _0x2000cd&&_0x26049d?new window[(_0x5cba1c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x5b6941,_0x55925d)=>{_0x2000cd[_0x5cba1c([0x74,0x68,0x65,0x6e])](_0x5b6941,_0x55925d),_0x26049d[_0x5cba1c([0x74,0x68,0x65,0x6e])](_0x366762=>{_0x366762!=_0x5cba1c([0x56,0x61,0x6c,0x69,0x64])&&_0x5b6941(_0x366762);},_0x55925d);}):_0x2000cd||_0x26049d||_0x5cba1c([0x56,0x61,0x6c,0x69,0x64]);}}function _0x549abb(_0x20f917,_0x53f232){return new window[(_0x5cba1c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x180bbd=>{if(_0xf1f033())return _0x180bbd(_0x5cba1c([0x56,0x61,0x6c,0x69,0x64]));_0x2f6a1d(),_0x249a25[_0x5cba1c([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x5cba1c([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x13104d=!0x1;const _0x911bc=_0xad9b60();function _0x2d848b(_0x37d611){return!!_0x37d611&&(typeof _0x37d611===_0x5cba1c([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x37d611===_0x5cba1c([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x37d611[_0x5cba1c([0x74,0x68,0x65,0x6e])]===_0x5cba1c([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x37d611[_0x5cba1c([0x63,0x61,0x74,0x63,0x68])]===_0x5cba1c([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x43c46c(_0x527715){_0x1fca4e(_0x527715)[_0x5cba1c([0x74,0x68,0x65,0x6e])](_0x1aa3f9=>{if(!_0x1aa3f9||_0x1aa3f9[_0x5cba1c([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x5cba1c([0x6f,0x6b]))return _0x5cba1c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x1292a8(_0x4fcefc(_0x911bc+_0x53f232))!=_0x1aa3f9[_0x5cba1c([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x5cba1c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x5cba1c([0x56,0x61,0x6c,0x69,0x64]);})[_0x5cba1c([0x74,0x68,0x65,0x6e])](_0x3c1e75=>(_0x5dd217(),_0x3c1e75),()=>{const _0x37b207=_0xa49948();return null==_0x37b207?(_0x5dd217(),_0x5cba1c([0x56,0x61,0x6c,0x69,0x64])):_0x5cba1c(_0x255704-_0x37b207>(0x42b83b66^_0x3cd9ac)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x5cba1c([0x74,0x68,0x65,0x6e])](_0x180bbd)[_0x5cba1c([0x63,0x61,0x74,0x63,0x68])](()=>{_0x180bbd(_0x5cba1c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x19277b=0x668251e6^_0x3cd9ac;function _0x5dd217(){const _0x874ef3=_0x5cba1c([0x6c,0x6c,0x63,0x74,0x2d])+_0x1292a8(_0x4fcefc(_0x20f917)),_0xf3f058=_0x7f52b(_0x1292a8(window[_0x5cba1c([0x4d,0x61,0x74,0x68])][_0x5cba1c([0x63,0x65,0x69,0x6c])](_0x255704/_0x19277b)));window[_0x5cba1c([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x5cba1c([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x874ef3,_0xf3f058);}function _0xa49948(){const _0x3a4c27=_0x5cba1c([0x6c,0x6c,0x63,0x74,0x2d])+_0x1292a8(_0x4fcefc(_0x20f917)),_0x4af488=window[_0x5cba1c([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x5cba1c([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3a4c27);return _0x4af488?window[_0x5cba1c([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x7f52b(_0x4af488),0x10)*_0x19277b:null;}function _0x1fca4e(_0x478b5b){return new window[(_0x5cba1c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x453d44,_0x40b511)=>{_0x478b5b[_0x5cba1c([0x74,0x68,0x65,0x6e])](_0x453d44,_0x40b511),window[_0x5cba1c([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x40b511,0x66b56ba6^_0x3cd9ac);});}}_0x249a25[_0x5cba1c([0x6f,0x6e])](_0x5cba1c([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x270feb,_0x3ba81e)=>{if(_0x3ba81e[0x0]!=_0x20f917)return _0x180bbd(_0x5cba1c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x3ba81e[0x1]={..._0x3ba81e[0x1],[_0x5cba1c([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x911bc};},{[_0x5cba1c([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x5cba1c([0x68,0x69,0x67,0x68])}),_0x249a25[_0x5cba1c([0x6f,0x6e])](_0x5cba1c([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x27e414=>{_0x2d848b(_0x27e414[_0x5cba1c([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x13104d=!0x0,_0x43c46c(_0x27e414[_0x5cba1c([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x5cba1c([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x5cba1c([0x6c,0x6f,0x77])}),_0x35255b[_0x5cba1c([0x74,0x68,0x65,0x6e])](()=>{_0x13104d||_0x180bbd(_0x5cba1c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0xf1f033(){return _0x249a25[_0x5cba1c([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x5cba1c([0x76,0x69,0x65,0x77])][_0x5cba1c([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x5cba1c([0x61,0x75,0x74,0x6f]);}function _0x2f6a1d(){_0x249a25[_0x5cba1c([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x5cba1c([0x76,0x69,0x65,0x77])][_0x5cba1c([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x5cba1c([0x61,0x75,0x74,0x6f]);}}function _0x1c9ccc(_0x4f1abc){const _0x165a80=[new window[(_0x5cba1c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x45fb68=>setTimeout(_0x45fb68,0x66bd81aa^_0x3cd9ac)),_0x35255b[_0x5cba1c([0x74,0x68,0x65,0x6e])](()=>new window[(_0x5cba1c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x140fba=>{let _0x559509=0x0;_0x249a25[_0x5cba1c([0x6d,0x6f,0x64,0x65,0x6c])][_0x5cba1c([0x6f,0x6e])](_0x5cba1c([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x17c19c,_0x2949c2)=>{_0x2949c2[0x0][_0x5cba1c([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x559509++,_0x559509==(0x66b4be9e^_0x3cd9ac)&&(_0x140fba(),_0x17c19c[_0x5cba1c([0x6f,0x66,0x66])]());});}))];return window[_0x5cba1c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x5cba1c([0x72,0x61,0x63,0x65])](_0x165a80)[_0x5cba1c([0x74,0x68,0x65,0x6e])](()=>_0x4f1abc);}async function _0xa7fdab(){await _0x35255b,_0x249a25[_0x5cba1c([0x6d,0x6f,0x64,0x65,0x6c])][_0x5cba1c([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x2a6e11,_0x249a25[_0x5cba1c([0x6d,0x6f,0x64,0x65,0x6c])][_0x5cba1c([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x2a6e11,_0x249a25[_0x5cba1c([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x5cba1c([0x6d,0x6f,0x64,0x65,0x6c]));}function _0xfc0769(_0x23db7f){const _0x2d45a7=_0x257128();_0x249a25[_0x2d45a7]=_0x5cba1c([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x23db7f,_0x23db7f!=_0x5cba1c([0x56,0x61,0x6c,0x69,0x64])&&_0xa7fdab();}function _0x257128(){const _0x5a8326=window[_0x5cba1c([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x5cba1c([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x5cba1c([0x6e,0x6f,0x77])]())[_0x5cba1c([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x5cba1c([0x2e]),'');let _0xba7ea0=_0x5cba1c([0x55]);for(let _0x287d76=0x0;_0x287d76<_0x5a8326[_0x5cba1c([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x287d76+=0x2){let _0x1045b3=window[_0x5cba1c([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5a8326[_0x5cba1c([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x287d76,_0x287d76+0x2));_0x1045b3>=_0x5d89c8[_0x5cba1c([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x1045b3-=_0x5d89c8[_0x5cba1c([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0xba7ea0+=_0x5d89c8[_0x1045b3];}return _0xba7ea0;}function _0x242e0d(){const _0x484fb3=_0x16ef81[_0x5cba1c([0x73,0x70,0x6c,0x69,0x74])](_0x5cba1c([0x2e]));if(0x3!=_0x484fb3[_0x5cba1c([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x2e2b33(_0x484fb3[0x1]);function _0x2e2b33(_0x4388d5){const _0x5779f0=_0xfdf3c6(_0x4388d5);return _0x5779f0&&_0x5bfb16()?_0x5779f0:null;function _0x5bfb16(){const _0x3f63e5=_0x5779f0[_0x5cba1c([0x6a,0x74,0x69])],_0x7186fc=window[_0x5cba1c([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3f63e5[_0x5cba1c([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3f63e5[_0x5cba1c([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x6756fb={..._0x5779f0,[_0x5cba1c([0x6a,0x74,0x69])]:_0x3f63e5[_0x5cba1c([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x3f63e5[_0x5cba1c([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x6756fb[_0x5cba1c([0x76,0x63])],_0x4fcefc(_0x6756fb)==_0x7186fc;}}}async function _0x19cc67(){let _0x3bc54a=!0x0;try{const _0x4fe8e0=_0x16ef81[_0x5cba1c([0x73,0x70,0x6c,0x69,0x74])](_0x5cba1c([0x2e])),[_0x38d47a,_0x201126,_0x18249c]=_0x4fe8e0;return _0x419db6(_0x38d47a),await _0xbede0e(_0x38d47a,_0x201126,_0x18249c),_0x3bc54a;}catch(_0x24c7e7){return!0x1;}function _0x419db6(_0x3a733c){const _0x45e9e4=_0xfdf3c6(_0x3a733c);_0x45e9e4&&_0x45e9e4[_0x5cba1c([0x61,0x6c,0x67])]==_0x5cba1c([0x45,0x53,0x32,0x35,0x36])||(_0x3bc54a=!0x1);}async function _0xbede0e(_0x126e2b,_0x5d2dca,_0x4d9627){const _0x33f310=window[_0x5cba1c([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x5cba1c([0x66,0x72,0x6f,0x6d])](_0x4eb9f0(_0x4d9627),_0x5048b6=>_0x5048b6[_0x5cba1c([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x28138b=new window[(_0x5cba1c([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x5cba1c([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x126e2b+_0x5cba1c([0x2e])+_0x5d2dca),_0x56918a=window[_0x5cba1c([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x5cba1c([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x56918a)return;const _0x144d08=await _0x56918a[_0x5cba1c([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x5cba1c([0x6a,0x77,0x6b]),_0x505afe,{[_0x5cba1c([0x6e,0x61,0x6d,0x65])]:_0x5cba1c([0x45,0x43,0x44,0x53,0x41]),[_0x5cba1c([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x5cba1c([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x5cba1c([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x56918a[_0x5cba1c([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x5cba1c([0x6e,0x61,0x6d,0x65])]:_0x5cba1c([0x45,0x43,0x44,0x53,0x41]),[_0x5cba1c([0x68,0x61,0x73,0x68])]:{[_0x5cba1c([0x6e,0x61,0x6d,0x65])]:_0x5cba1c([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x144d08,_0x33f310,_0x28138b)||(_0x3bc54a=!0x1);}}function _0xfdf3c6(_0x9a71d5){return _0x9a71d5[_0x5cba1c([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x5cba1c([0x65,0x79]))?JSON[_0x5cba1c([0x70,0x61,0x72,0x73,0x65])](_0x4eb9f0(_0x9a71d5)):null;}function _0x4eb9f0(_0x1975e4){return window[_0x5cba1c([0x61,0x74,0x6f,0x62])](_0x1975e4[_0x5cba1c([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x5cba1c([0x2b]))[_0x5cba1c([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x5cba1c([0x2f])));}function _0x4fcefc(_0x240de1){let _0x22b926=0x1505;function _0x26e8a7(_0xaf7716){for(let _0x2c391a=0x0;_0x2c391a<_0xaf7716[_0x5cba1c([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x2c391a++){const _0x1fe044=_0xaf7716[_0x5cba1c([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x2c391a);_0x22b926=(_0x22b926<<0x5)+_0x22b926+_0x1fe044,_0x22b926&=_0x22b926;}}function _0x39ab12(_0x261709){Array[_0x5cba1c([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x261709)?_0x261709[_0x5cba1c([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x39ab12):_0x261709&&typeof _0x261709==_0x5cba1c([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x5cba1c([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x261709)[_0x5cba1c([0x73,0x6f,0x72,0x74])]()[_0x5cba1c([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x53e3f4,_0x174340])=>{_0x26e8a7(_0x53e3f4),_0x39ab12(_0x174340);}):_0x26e8a7(window[_0x5cba1c([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x261709));}return _0x39ab12(_0x240de1),_0x22b926>>>0x0;}function _0x1292a8(_0x46c836){return _0x46c836[_0x5cba1c([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x5cba1c([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x5cba1c([0x30]));}function _0x7f52b(_0x44101f){return _0x44101f[_0x5cba1c([0x73,0x70,0x6c,0x69,0x74])]('')[_0x5cba1c([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x5cba1c([0x6a,0x6f,0x69,0x6e])]('');}function _0x2a6e11(){}function _0x5cba1c(_0x33f4d9){return _0x33f4d9['map'](_0x5f568c=>String['fromCharCode'](_0x5f568c))['join']('');}_0xfc0769(await _0x26d702());}(this);}['showFakeVisualSelection'](){const _0x4f5e91=this['editor']['model'];_0x4f5e91['change'](_0x2ca0a1=>{const _0x47187d=_0x4f5e91['document']['selection']['getRanges']();let _0x5e90cb=0x0;for(const _0x3d2ba0 of _0x47187d){const _0x20227d=f+':'+_0x5e90cb;if(_0x4f5e91['markers']['has'](_0x20227d))_0x2ca0a1['updateMarker'](_0x20227d,{'range':_0x3d2ba0});else{if(_0x3d2ba0['start']['isAtEnd']){const _0x59e3e8=_0x3d2ba0['start']['getLastMatchingPosition'](({item:_0x5bcc0b})=>!_0x4f5e91['schema']['isContent'](_0x5bcc0b),{'boundaries':_0x3d2ba0});_0x2ca0a1['addMarker'](_0x20227d,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2ca0a1['createRange'](_0x59e3e8,_0x3d2ba0['end'])});}else _0x2ca0a1['addMarker'](_0x20227d,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3d2ba0});}_0x5e90cb++;}});}['hideFakeVisualSelection'](){const _0x48d936=this['editor']['model'],_0x457b24=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x457b24['length']&&_0x48d936['change'](_0x248988=>{_0x457b24['forEach'](_0x275729=>{_0x248988['removeMarker'](_0x275729);});});}['insertContent'](_0x657926,_0x224243){const _0x20f325=this['_getAISelection'](),_0x5ac7e5=_0x224243||_0x20f325['getFirstRange']();this['editor']['model']['canEditAt'](_0x5ac7e5)&&this['editor']['model']['change'](_0x15275c=>{this['hideFakeVisualSelection'](),_0x224243||this['_resetContentOfSelectedTableCells'](_0x15275c,_0x20f325),this['_pasteHTMLUsingClipboard']({'insertAt':_0x5ac7e5,'writer':_0x15275c,'html':_0x657926});});}['insertContentBelow'](_0x2235a7){const {model:_0x26a9ad}=this['editor'],_0xa85bf9=this['_getAISelection']();_0x26a9ad['change'](()=>{const _0x182058=this['_prepareTableInsertBelowPosition'](_0x2235a7,_0xa85bf9)||this['_getDefaultInsertBelowPosition'](_0xa85bf9);this['insertContent'](_0x2235a7,_0x182058);});}['_getAISelection'](){const _0x2b2aec=this['editor']['model'],_0xd6fb58=Array['from'](_0x2b2aec['markers']['getMarkersGroup'](f))['map'](_0x405899=>_0x405899['getRange']());return _0x2b2aec['createSelection'](_0xd6fb58);}['_pasteHTMLUsingClipboard']({writer:_0x2abf47,html:_0x30b823,insertAt:_0x4f9886}){const {view:_0x446bd1}=this['editor']['editing'],_0x554acb=this['editor']['plugins']['get'](_0x69c7e9),_0x47748c=new dt();_0x47748c['setData']('text/html',_0x30b823);const _0x57c930=new ClipboardEvent('paste',{'clipboardData':_0x47748c}),_0x5307b1=new _0x420495(_0x446bd1,_0x57c930,{'dataTransfer':new _0x5e0b09(_0x47748c)});_0x2abf47['setSelection'](_0x4f9886);const _0x325697=(_0xc5a60e,_0x5806f2)=>{_0x5806f2['resultRange']&&_0x2abf47['setSelection'](_0x5806f2['resultRange']);};_0x554acb['once']('contentInsertion',_0x325697,{'priority':'lowest'}),_0x446bd1['document']['fire']('paste',_0x5307b1),_0x554acb['off']('contentInsertion',_0x325697);}['_getDefaultInsertBelowPosition'](_0x2ee5cd){const {model:_0x493e8a}=this['editor'],_0x31cf7e=Array['from'](_0x2ee5cd['getSelectedBlocks']());return _0x31cf7e['length']?_0x493e8a['createPositionAfter'](_0x31cf7e['pop']()):_0x2ee5cd['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x3f32b0,_0x1515ad){const {model:_0x46de98,plugins:_0x1bb7a4}=this['editor'];if(_0x1bb7a4['has']('TableUtils')){const _0x52bb3f=_0x1bb7a4['get']('TableUtils')['getSelectedTableCells'](_0x1515ad);if(_0x52bb3f['length']){const _0x54ab8a=this['_getTableRowCountFromContent'](_0x3f32b0),_0x4672a0=this['_createEmptyTableRows'](_0x52bb3f,_0x54ab8a);return _0x46de98['createPositionAt'](_0x4672a0,0x0);}}return null;}['_getTableRowCountFromContent'](_0x1a0dd4){const _0xb86e97=this['editor']['plugins']['get']('TableUtils'),_0x32f09e=this['editor']['data']['parse'](_0x1a0dd4),_0x347c5d=Array['from'](_0x32f09e['getChildren']())['filter'](_0x20434a=>_0x20434a['is']('element','table'));let _0x567d5e=0x0;return _0x347c5d['forEach'](_0x243376=>{_0x567d5e+=_0xb86e97['getRows'](_0x243376);}),_0x567d5e;}['_createEmptyTableRows'](_0x2a3743,_0x1bb8ed){const _0x4ced33=this['editor']['plugins']['get']('TableUtils'),_0x8861d2=_0x4ced33['getRowIndexes'](_0x2a3743),_0x3f55e5=_0x4ced33['getColumnIndexes'](_0x2a3743),_0x4605e4=_0x8861d2['last']+0x1,_0x3785c2=_0x3f55e5['first'],_0x40fe29=_0x2a3743[0x0]['findAncestor']('table');for(let _0x4b7fca=0x0;_0x4b7fca<_0x1bb8ed;_0x4b7fca++)_0x4ced33['insertRows'](_0x40fe29,{'at':_0x4605e4});return _0x40fe29['getChild'](_0x4605e4)['getChild'](_0x3785c2);}['_resetContentOfSelectedTableCells'](_0x2fa051,_0x4d5b32){const {plugins:_0x5bcc08}=this['editor'],{model:_0x4c3239}=_0x2fa051;if(!_0x5bcc08['has']('TableUtils'))return;_0x5bcc08['get']('TableUtils')['getSelectedTableCells'](_0x4d5b32)['length']&&_0x4c3239['deleteContent'](_0x4d5b32);}}class K extends _0x2bfdda{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x1a9453('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x583a46){super(_0x583a46),this['name']='AIRequestError';}}function i(_0x5b837b,_0x34694,_0x4b12a5){const t=_0x5b837b['t'];switch(_0x34694){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',_0x4b12a5);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x4b12a5);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'},_0x4b12a5);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 _0x34694;}}class E extends _0x563c24{['_commandDefinitions'];constructor(_0x2ce0ac,_0x4446f5){super(_0x2ce0ac),this['_commandDefinitions']=_0x4446f5,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x5db9c9,_0x410814,_0x2b951a)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x2b951a));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x2e029c,_0xb4272b,_0x4065b4)=>{this['enabledCommandsIds']=_0x4065b4?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x158068=this['editor']['model'];this['_hasContext']=function(_0x34bc2b){const _0x471e56=_0x34bc2b['document']['selection'];return _0x471e56['isCollapsed']?0x0!==[..._0x471e56['getSelectedBlocks']()]['length']&&![..._0x471e56['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x34bc2b['hasContent'](_0x471e56['getFirstRange']());}(_0x158068);const _0x52fe4d=_0x158068['document']['selection'],_0xcec26f=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x13daa0 of _0x52fe4d['getRanges']())for(const _0x3ad9c7 of _0x13daa0['getItems']())if(_0x3ad9c7['is']('element')&&_0xcec26f['includes'](_0x3ad9c7['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x4f5cf0='',_0x51dbe0='',_0x4e8c85='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x4f5cf0,_0x51dbe0,_0x4e8c85);}}function G(_0x56ea02,_0x54955c){const _0x191052=new Set();for(const _0x5433bd of _0x56ea02['values']())(_0x54955c||!0x1===_0x5433bd['requiresContent'])&&_0x191052['add'](_0x5433bd['id']);return Array['from'](_0x191052);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
- _0x5ab7e2(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x3a61ba,_0x342191,_0x18af10){super(),this['editor']=_0x3a61ba,this['textAdapter']=_0x342191,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x18af10,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x151e46,_0x121ff8,_0x4a19cd)=>{this['view']['value']=this['_sanitizeHTML'](_0x4a19cd);}),this['listenTo'](this['view'],'submitPrompt',(_0x1405d3,_0x544652)=>{const _0x583950=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x544652,_0x583950,'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:_0x54ab66,query:_0x396d3e,htmlContent:_0x1e87c5,label:_0x264504,mainActionLabel:_0x3910ff}){this['view']['prompt']=_0x264504,this['view']['mainAction']=_0x3910ff,this['initialContext']=_0x1e87c5,_0x396d3e&&(this['view']['isRendered']?this['_handleQuery'](_0x396d3e,_0x1e87c5,_0x54ab66,_0x264504):this['view']['once']('render',()=>{this['_handleQuery'](_0x396d3e,_0x1e87c5,_0x54ab66,_0x264504);}));}['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'](_0x1991ce,_0x257ec8,_0x411b97,_0x43adbe){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x257ec8,this['previousQuery']=_0x1991ce,this['previousLabel']=_0x43adbe||_0x1991ce,this['previousActionId']=_0x411b97,new Promise(_0x3670ee=>{this['textAdapter']['makeRequest']({'query':_0x1991ce,'context':_0x257ec8,'onData':_0x2f5e2c=>{this['currentResponse']=_0x2f5e2c,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x411b97})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x3e9aaa=>{_0x3e9aaa instanceof R?this['view']['handleError'](_0x3e9aaa['message']):this['view']['handleError'](),_0x3670ee();})['finally'](()=>{this['stopProcessing'](),_0x3670ee();});});}['_parseAndNormalizeContent'](_0xac09d2,_0x36f50a=!0x1){const _0x23fb09=Z['exec'](_0xac09d2);_0xac09d2=_0x23fb09?_0xac09d2['substring'](_0x23fb09[0x1]['length']):_0xac09d2['length']<0x64&&!_0x36f50a?'':this['_stripMarkdownSyntax'](_0xac09d2);const _0x11b65f=this['_domParser']['parseFromString'](_0xac09d2,'text/html');if(_0x23fb09){const _0x2b7f7e=Array['from'](_0x11b65f['body']['childNodes']);_0x2b7f7e['reverse']();for(const _0x1f388b of _0x2b7f7e){if(_0x1f388b['nodeType']==Node['ELEMENT_NODE'])break;_0x1f388b['remove']();}}const _0x4ce373=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x11b65f['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x4ce373);const _0x167342=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x854863=this['editor']['data']['toModel'](_0x4ce373);return _0x167342||_0x854863['markers']['clear'](),this['editor']['data']['stringify'](_0x854863);}['_normalizeResponseHeadings'](_0x12d2c1){const _0x350bb6=new _0x29e50c(this['editor']['editing']['view']['document']),_0x189e0d=new _0x5c5595({'name':/^h[1-5]$/}),_0x5c7f36=[];let _0x22c973=!0x1;for(const _0x466fe6 of _0x12d2c1)_0x466fe6['is']('element')&&_0x189e0d['match'](_0x466fe6)&&(_0x5c7f36['push'](_0x466fe6),'h1'==_0x466fe6['name']&&(_0x22c973=!0x0));if(_0x22c973){for(const _0x375c79 of _0x5c7f36)_0x350bb6['rename']('h'+(parseInt(_0x375c79['name'][0x1])+0x1),_0x375c79);}}['_isH1TagSupportEnabled'](){const {data:_0x4ef133,editing:_0x311de0}=this['editor'],_0x4faf7f=_0x4ef133['htmlProcessor']['toView']('<h1></h1>'),_0x40e112=_0x4ef133['toView'](_0x4ef133['toModel'](_0x4faf7f));return!!_0x311de0['view']['domConverter']['viewToDom'](_0x40e112)['querySelector']('h1');}['_sanitizeHTML'](_0x3e1925){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x3e1925),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x57e27f){const _0x220b3a=_0x57e27f['trim']();return _0x220b3a['startsWith']('```html')?_0x220b3a['endsWith']('```')?_0x220b3a['substring'](0x7,_0x220b3a['length']-0x3):_0x220b3a['substring'](0x7):_0x57e27f;}}const M={'REPLACE':'replace','INSERT':'insert'};class at extends nt{constructor(_0x9a671d){super(_0x9a671d),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x542379=>i(_0x9a671d,'AI_'+_0x542379['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x9a671d,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x9a671d,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x9a671d,'Stop'));const _0xb6d268=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0xb6d268['if']('isVisible','ck-hidden',_0x41fd33=>!_0x41fd33)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0xa56621,_0x57167e){const _0x380964=new _0x52be94(this['locale']);return _0x380964['set']({'label':_0xa56621,'class':_0x57167e||'','isVisible':!0x0,'withText':!0x0}),_0x380964;}}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 _0x368bd2{['contentFieldView'];['copyButtonView'];constructor(_0x416066,_0x43b421=''){super(_0x416066),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x123d0f=this['bindTemplate'];this['contentFieldView']=new mt(_0x416066,_0x43b421),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x123d0f['if']('isVisible','ck-hidden',_0x5c422c=>!_0x5c422c)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x123d0f['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 _0x54667a=!0x1;this['on']('change:value',(_0x1f0390,_0x56a0ee,_0x2c532c)=>{const _0x178a12=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x2c532c),this['isProcessing']&&_0x178a12&&!_0x54667a&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x4c070c,_0x4cb78e,_0x3945c0)=>{_0x54667a=!0x1,_0x3945c0?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x54667a=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x54667a=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x1ab872=this['locale'],_0x39d32f=new _0x52be94(this['locale']),_0xdfcabc='ck-ai-form__copy-button';return _0x39d32f['set']({'label':i(_0x1ab872,'Copy'),'icon':W,'class':_0xdfcabc,'tooltip':!0x0}),_0x39d32f['bind']('isVisible')['to'](this,'value',_0x2c780c=>!!_0x2c780c),_0x39d32f['bind']('isEnabled')['to'](this,'isProcessing',_0xff24b9=>!_0xff24b9),_0x39d32f['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x39d32f['icon']=_0x59275f['check'],_0x39d32f['class']=_0xdfcabc+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x39d32f['icon']=W,_0x39d32f['class']=_0xdfcabc;},0x3e8);}),_0x39d32f;}['_copyHTMLToClipboard'](_0x380bc0){const {window:_0x592f17,document:_0x2d3bb9}=_0x17fc35;if(_0x592f17['ClipboardItem']){const {Blob:_0x35271e,ClipboardItem:_0x434ac8}=_0x592f17,_0x2a4dff=[new _0x434ac8({'text/html':new _0x35271e([_0x380bc0['innerHTML']],{'type':'text/html'}),'text/plain':new _0x35271e([_0x380bc0['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x2a4dff);}else{const _0x15b26f=_0x2d3bb9['createElement']('div');_0x15b26f['style']['position']='absolute',_0x15b26f['style']['left']='-9999px',_0x15b26f['innerHTML']='<span>[</span>'+_0x380bc0['innerHTML']+'<span>]</span>',_0x2d3bb9['body']['appendChild'](_0x15b26f);const _0x3643e7=_0x2d3bb9['createRange']();_0x3643e7['setStartAfter'](_0x15b26f['firstElementChild']),_0x3643e7['setEndBefore'](_0x15b26f['lastElementChild']);const _0x3ff47d=_0x592f17['getSelection']();_0x3ff47d['removeAllRanges'](),_0x3ff47d['addRange'](_0x3643e7),_0x2d3bb9['execCommand']('copy'),_0x15b26f['remove']();}}}class mt extends _0x368bd2{constructor(_0x49a68b,_0xcede59=''){super(_0x49a68b),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0xcede59,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x3c5f09){this['element']['innerHTML']=_0x3c5f09;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x2a0f97=new _0x368bd2(),_0x31dcaf=this['locale'],_0x28345f=new _0x23a3f6();return _0x28345f['isVisible']=!0x0,_0x2a0f97['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x28345f,{'text':i(_0x31dcaf,'AI\x20is\x20writing...')}]}),_0x2a0f97['render'](),_0x2a0f97;}}class rt extends _0x368bd2{constructor(_0x25a84c,_0x27af95=''){super(_0x25a84c);const _0x2b40cc=new _0x2a6867(),_0x265f6e=this['bindTemplate'];this['set']('text',_0x27af95),_0x2b40cc['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':[_0x2b40cc,{'text':_0x265f6e['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x7261bb,_0x13ebb3){super(_0x7261bb,_0x13ebb3),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',(_0x4bb3e9,_0xac45c2)=>{_0x4bb3e9['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0xac45c2());});}['_createSubmitButton'](){const _0x304b7a=new _0x52be94(this['locale']),_0x39935d=this['locale'];return _0x304b7a['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(_0x39935d,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x304b7a['on']('execute',()=>{this['submit']();}),_0x304b7a['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x2d2794,_0x4b3948)=>!_0x2d2794&&_0x4b3948),_0x304b7a;}['_createShowHistoryButton'](){const _0x5e0902=new _0x52be94(this['locale']),_0x2f954d=this['resultsView'],_0x542970=this['locale'];_0x5e0902['set']({'label':i(_0x542970,'History'),'withText':!0x1,'icon':_0x59275f['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x5e0902['bind']('isOn')['to'](_0x2f954d,'isVisible'),_0x5e0902['bind']('isEnabled')['to'](this,'isEnabled'),_0x5e0902['on']('execute',()=>{_0x2f954d['isVisible']=!_0x2f954d['isVisible'],_0x2f954d['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x360efd=()=>{_0x17fc35['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x4bf243=new st(this['queryView']['fieldView']['element']),_0x1d84a1=_0x4bf243['width'],_0x14cb84='rtl'===_0x542970['uiLanguageDirection']?'left':'right';_0x4bf243['excludeScrollbarsAndBorders'](),_0x5e0902['element']['style'][_0x14cb84]=_0x1d84a1-_0x4bf243['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x360efd),this['on']('render',_0x360efd),_0x5e0902;}['submit'](){const _0x2da6dc=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x2da6dc);}['focus'](_0x1948cb){-0x1===_0x1948cb?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x29efd6){super(_0x29efd6),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x29efd6,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0xc7c4=0x0;for(const _0x730d77 of this['items'])_0xc7c4+=_0x730d77['items']['length'];return{'resultsCount':_0xc7c4,'totalItemsCount':_0xc7c4};}['_createClearHistoryButton'](){const _0x48293a=this['locale'],_0x227c6e=new _0x52be94(this['locale']);return _0x227c6e['set']({'label':'('+i(_0x48293a,'Clear')+')','withText':!0x0}),_0x227c6e['on']('execute',()=>this['fire']('clearHistory')),_0x227c6e;}}class hs extends _0x41563c{constructor(_0x19bc49){super();const _0x360199=new te(),_0x98b375=new _0x52be94(this['locale'],_0x360199);this['children']['add'](_0x98b375),_0x98b375['set']({'label':_0x19bc49['prompt'],'withText':!0x0}),_0x98b375['on']('execute',()=>{this['fire']('execute',{'value':_0x1f1afa(_0x19bc49['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x4a0113{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x5e32cf,_0x4e6132)=>{const _0x3b061e=Ss(_0x4e6132['prompt']);for(const _0x5bacde of this)if(_0x5bacde!=_0x4e6132&&Ss(_0x5bacde['prompt'])===_0x3b061e){this['remove'](_0x5bacde);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x548f20=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x548f20));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x224b16=>_0x224b16)));}}function Ss(_0x399789){return _0x399789['toLowerCase']()['trim']();}class k extends _0x368bd2{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x5e0c50,_0x374e97,_0x2b65ca=''){super(_0x5e0c50),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(_0x5e0c50),this['contentArea']=new X(_0x5e0c50,_0x2b65ca),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 _0x126a18(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x16d8d6({'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 _0x202740=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x374e97],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x202740['if']('isError','ck-hidden',_0x2b3aca=>!_0x2b3aca)]},'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'](_0x1cf54b=0x1){-0x1===_0x1cf54b?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 _0x1e08cd=this['locale'],_0x5bd6eb=new ht(_0x1e08cd,{'queryView':{'label':i(_0x1e08cd,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x2db248,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x1e08cd,'Empty\x20history'),'secondary':i(_0x1e08cd,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x5bd6eb['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2c5af9,_0x5421dd)=>_0x2c5af9&&!_0x5421dd),this['listenTo'](_0x5bd6eb,'submit',(_0x5bd1ce,_0x45a73f)=>{this['prompt']=_0x45a73f;const _0x597df9=_0x5e1c34(_0x45a73f);this['fire']('submitPrompt',_0x597df9),_0x45a73f['trim']()&&this['_promptHistory']['add']({'prompt':_0x597df9},0x0);},{'priority':'high'}),_0x5bd6eb;}['_createHistoryView'](){const _0x285f1f=new rs(this['locale']);return _0x285f1f['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x285f1f['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x285f1f;}['_createToolbar'](){const _0xb2b367=new at(this['locale']);return _0xb2b367['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x3589c4,_0x3a9c7f,_0x22a886)=>_0x3589c4&&!_0x3a9c7f&&!!_0x22a886),_0xb2b367['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0xb2b367['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x3634a5,_0xf8c1b5,_0x17d50b)=>_0x3634a5&&!_0xf8c1b5&&!!_0x17d50b),_0xb2b367['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0xb2b367['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0xe1aaf0,_0x38f61a)=>_0xe1aaf0&&!_0x38f61a),_0xb2b367['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0xb2b367['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0xb2b367['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0xb2b367;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x3ea1d1=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x3ea1d1,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x4ff772){const _0x345f63=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x4ff772||i(_0x345f63,'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 _0x2bfdda{['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[_0xc7e545,a,K,_0x5bf6d6];}constructor(_0x57d248){super(_0x57d248),_0x57d248['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x57d248['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x57d248['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x57d248['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x460ca5}=this;this['_aiAdapter']=_0x460ca5['plugins']['get'](K),this['_dialog']=_0x460ca5['plugins']['get'](_0x5bf6d6),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x1810e9=new E(_0x460ca5,Array['from'](this['_commandDefinitions']['values']()));_0x460ca5['commands']['add']('showAIAssistant',_0x1810e9),_0x460ca5['ui']['componentFactory']['add']('aiCommands',_0x27661=>{const _0x132815=_0xf1ac4e(_0x27661);return _0x132815['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x132815['buttonView']['set']({'label':i(_0x27661,'AI\x20Commands'),'icon':T,'tooltip':!0x0}),_0x132815['on']('execute',_0x5791d9=>this['_onExecute'](_0x5791d9['source']['id'])),_0xd77474(_0x132815,_0x460ca5['ui']['view']['body'],function(_0x3e34eb){const _0x324414=o(_0x3e34eb['config']['get']('ai.aiAssistant.commands'),_0x3e34eb['locale']),_0x26f44b=U(_0x3e34eb,_0x324414)['filter'](_0x5284fa=>_0x5284fa['commands']['length']);if(0x1===_0x26f44b['length'])return U(_0x3e34eb,_0x26f44b[0x0]['commands'])['map'](_0x226878=>({'id':_0x226878['id'],'label':_0x226878['label']}));return _0x26f44b['map'](_0x41232a=>{const {groupId:_0x6c075f,groupLabel:_0x402899,commands:_0x213051}=_0x41232a,_0x4c3905=U(_0x3e34eb,_0x213051)['map'](_0x29745a=>({'id':_0x29745a['id'],'label':_0x29745a['label']}));return{'id':_0x6c075f,'menu':_0x402899||_0x6c075f,'children':_0x4c3905};});}(_0x460ca5),{'ariaLabel':i(_0x27661,'AI\x20Commands')}),_0x132815['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x1810e9['on']('change:enabledCommandsIds',_0x4135a6),_0x132815['menuView']['once']('render',_0x4135a6),_0x132815;function _0x4135a6(){_0x132815['isEnabled']=_0x1810e9['enabledCommandsIds']['length']>0x0;for(const _0x3c78a9 of _0x132815['menuView']['buttons'])_0x3c78a9['isEnabled']=_0x1810e9['enabledCommandsIds']['includes'](_0x3c78a9['id']);}}),_0x460ca5['ui']['componentFactory']['add']('menuBar:aiCommands',_0x4413c5=>{const _0x5ebf96=new _0x41ac76(_0x4413c5);_0x5ebf96['buttonView']['set']({'label':i(_0x4413c5,'AI\x20Commands'),'icon':T}),_0x5ebf96['bind']('isEnabled')['to'](_0x1810e9,'enabledCommandsIds',_0x23c990=>_0x23c990['length']>0x0);const _0x15ef7a=o(_0x460ca5['config']['get']('ai.aiAssistant.commands'),_0x4413c5);return this['_populateMenuBarMenu'](_0x1810e9,_0x5ebf96,_0x15ef7a,_0x500641=>this['_onExecute'](_0x500641)),_0x5ebf96;}),_0x460ca5['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x5b5220=this['_createAIAssistantUIButton'](_0x52be94);return _0x5b5220['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x5b5220;}),_0x460ca5['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x4a98cf=this['_createAIAssistantUIButton'](_0x45d9f4);return _0x4a98cf['set']({'role':'menuitemcheckbox'}),_0x4a98cf;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x323b94=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x25a9d5;for(const _0x5d4221 in _0x323b94){const _0x4dd591=_0x5d4221,_0xd1f8a0=_0x323b94[_0x4dd591];if('aiLicenseKeyValid'==_0xd1f8a0||'aiLicenseKeyInvalid'==_0xd1f8a0||'aiLicenseKeyExpired'==_0xd1f8a0||'aiLicenseKeyDomainLimit'==_0xd1f8a0||'aiLicenseKeyNotAllowed'==_0xd1f8a0||'aiLicenseKeyEvaluationLimit'==_0xd1f8a0||'aiLicenseKeyTrialLimit'==_0xd1f8a0||'aiLicenseKeyUsageLimit'==_0xd1f8a0){delete _0x323b94[_0x4dd591],_0x25a9d5=_0xd1f8a0,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x25a9d5&&_0x323b94['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x25a9d5&&_0x323b94['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x25a9d5&&_0x323b94['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x25a9d5&&_0x323b94['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x25a9d5&&_0x323b94['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x25a9d5&&_0x323b94['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x25a9d5&&_0x323b94['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x68f7ce='',_0x5e8010='',_0xc9bdad='custom'){const _0x108f91=this['editor'],_0x2078be=_0x108f91['editing']['view'],_0x7e434a=_0x108f91['plugins']['get'](a),_0x66af5b=_0x108f91['plugins']['get'](_0xc7e545);_0x7e434a['showFakeVisualSelection']();const _0x1b765d=new w(),_0x2c838e=new ClipboardEvent('copy',{'clipboardData':_0x1b765d}),_0x28fcd2=new _0x5e0b09(_0x1b765d),_0x286376=new _0x420495(_0x2078be,_0x2c838e,{'dataTransfer':_0x28fcd2});_0x66af5b['_forceMarkersCopy']('comment',()=>{_0x2078be['document']['fire']('copy',_0x286376);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x108f91,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x55ff74=_0x28fcd2['getData']('text/html');const _0x54bef7=_0x108f91['model']['document']['selection'],_0x4f6eb4=Array['from'](_0x54bef7['getRanges']());0x1===_0x4f6eb4['length']&&_0x4f6eb4[0x0]['isFlat']&&!_0x54bef7['getSelectedElement']()&&''!==_0x55ff74['replace'](/&nbsp;/g,'')['trim']()&&(_0x55ff74='<p>'+_0x55ff74+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0xc9bdad,'query':_0x68f7ce,'htmlContent':_0x55ff74,'label':_0x5e8010,'mainActionLabel':M[_0x108f91['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':_0x2b3f98['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x7e434a['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x2a5d08=new Map(),_0x54a7db=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x473546 of _0x54a7db)for(const _0x3242bb of _0x473546['commands'])_0x2a5d08['set'](_0x3242bb['id'],{..._0x3242bb,'groupId':_0x473546['groupId'],'groupLabel':_0x473546['groupLabel']||_0x473546['groupId']});return _0x2a5d08;}['_createAIAssistantUIButton'](_0x801a6e){const _0x7f07bc=this['editor'],_0x34a481=_0x7f07bc['commands']['get']('showAIAssistant'),_0x48a734=new _0x801a6e(_0x7f07bc['locale']);return _0x48a734['set']({'label':i(_0x7f07bc['locale'],'AI\x20Assistant'),'icon':ct['robotPencil'],'isToggleable':!0x0}),_0x48a734['bind']('isEnabled')['to'](_0x34a481),_0x48a734['bind']('isOn')['to'](this['_dialog'],'id',_0x395976=>'aiAssistant'===_0x395976),this['listenTo'](_0x48a734,'execute',()=>{_0x48a734['isOn']?this['hideUI']():_0x34a481['execute']();}),_0x48a734;}['_initView'](){const _0x24e890=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',()=>{_0x24e890['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x24e890['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x383fd3,ui:{ariaLiveAnnouncer:_0x4c8fe8}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x1401f8,_0x5f28ad,_0x599f65)=>{const _0x2a1b2f=this['_aiAssistantController']['currentContext'];_0x599f65?_0x4c8fe8['announce'](i(_0x383fd3,'AI\x20is\x20writing')):_0x2a1b2f&&_0x4c8fe8['announce'](i(_0x383fd3,'Generated\x20content:\x20%0',_0x2a1b2f),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0xeedce2,_0x26ec9a,_0x48d377)=>{if(_0x48d377){const _0x2f29ee=this['_formView']['errorView']['text'];_0x4c8fe8['announce'](i(_0x383fd3,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2f29ee));}});}['_onExecute'](_0x4dc5f1){const _0x17bff5=this['_commandDefinitions']['get'](_0x4dc5f1),_0x595d78=this['editor'],_0x17bdec=_0x595d78['model']['document']['selection'],_0x3fa287=_0x595d78['commands']['get']('showAIAssistant'),_0x4f86fe=_0x595d78['plugins']['get'](a),_0x33dbf7=''+(_0x17bff5['groupId']!==x?_0x17bff5['groupLabel']+':\x20':'')+_0x17bff5['label'];if(!0x1!==_0x17bff5['requiresContent']&&_0x17bdec['isCollapsed']){const _0x6d4f47=_0x3309b6(_0x17bdec['getSelectedBlocks']())||_0x595d78['model']['schema']['getLimitElement'](_0x17bdec);_0x595d78['model']['change'](_0x5dde79=>{_0x5dde79['setSelection'](_0x6d4f47,'in');});}_0x4f86fe['showFakeVisualSelection'](),_0x3fa287['execute'](_0x17bff5['prompt'],_0x33dbf7,'command:'+_0x4dc5f1);}['_populateMenuBarMenu'](_0x32b2df,_0x558d27,_0x55f4ea,_0xcf7e22){const _0x237dd4=this['editor'],_0x39d4a5=_0x237dd4['locale'],_0x4930b2=new _0x3ba367(_0x39d4a5),_0x59489b=U(_0x237dd4,_0x55f4ea)['filter'](_0x15fe0f=>_0x15fe0f['commands']['length']);0x1===_0x59489b['length']?this['_getMenuBarGroupButtons']({'command':_0x32b2df,'commands':_0x59489b[0x0]['commands'],'parentMenuView':_0x558d27,'onExecute':_0xcf7e22})['forEach'](_0x269ea1=>_0x4930b2['items']['add'](_0x269ea1)):_0x59489b['forEach'](({groupId:_0x15fe4d,groupLabel:_0x433e24,commands:_0x19d4e3})=>{const _0x3a154e=new _0x94d296(_0x39d4a5,_0x558d27),_0xcde037=new _0x41ac76(_0x39d4a5),_0x1f4b15=new _0x3ba367(_0x39d4a5),_0x1602a8=this['_getMenuBarGroupButtons']({'command':_0x32b2df,'commands':_0x19d4e3,'parentMenuView':_0xcde037,'onExecute':_0xcf7e22});_0xcde037['buttonView']['set']({'label':_0x433e24||_0x15fe4d}),_0xcde037['delegate']('execute')['to'](_0x558d27),_0x1f4b15['items']['addMany'](_0x1602a8),_0xcde037['panelView']['children']['add'](_0x1f4b15),_0x3a154e['children']['add'](_0xcde037),_0x4930b2['items']['add'](_0x3a154e);}),_0x558d27['panelView']['children']['add'](_0x4930b2);}['_getMenuBarGroupButtons']({command:_0x5786ad,commands:_0x1d3d7e,parentMenuView:_0xa93041,onExecute:_0x1e29cd}){const _0x40c453=this['editor'],_0x440a92=_0x40c453['locale'];return U(_0x40c453,_0x1d3d7e)['map'](_0x4227e7=>{const _0x5890be=new _0x94d296(_0x440a92,_0xa93041),_0x1957f4=new _0x45d9f4(_0x440a92);return _0x1957f4['set']({'label':_0x4227e7['label']}),_0x1957f4['delegate']('execute')['to'](_0xa93041),_0x1957f4['on']('execute',()=>_0x1e29cd(_0x4227e7['id'])),_0x1957f4['bind']('isEnabled')['to'](_0x5786ad,'enabledCommandsIds',_0x3201d9=>_0x3201d9['includes'](_0x4227e7['id'])),_0x5890be['children']['add'](_0x1957f4),_0x5890be;});}}function B(_0xdc0e3b,_0x494868){return void 0x0!==_0xdc0e3b['order']&&void 0x0===_0x494868['order']?0x1:void 0x0===_0xdc0e3b['order']&&void 0x0!==_0x494868['order']?-0x1:void 0x0!==_0xdc0e3b['order']&&void 0x0!==_0x494868['order']?_0xdc0e3b['order']-_0x494868['order']:0x0;}function U(_0x246d89,_0x598d23){_0x598d23['sort'](B);const _0x532b56={},_0x2abdc8=[];for(const _0x4dd4ce of _0x598d23)if(void 0x0!==_0x4dd4ce['order']){if(_0x4dd4ce['order']in _0x532b56)throw new _0x1a9453('ai-commands-config-order-collision',_0x246d89,{'conflictingDefinitions':[_0x4dd4ce,_0x532b56[_0x4dd4ce['order']]]});_0x532b56[_0x4dd4ce['order']]=_0x4dd4ce,_0x2abdc8['splice'](_0x4dd4ce['order'],0x0,_0x4dd4ce);}else _0x2abdc8['push'](_0x4dd4ce);return _0x2abdc8;}class r extends _0x2bfdda{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x427996){super(_0x427996);const _0x4f2cfc=_0x427996['config'],_0x5b0672=_0x427996['locale'];_0x4f2cfc['define']('ai.aiAssistant.preserveComments',!0x0),_0x4f2cfc['define']('ai.aiAssistant.commands',function(_0x13fb4d){return[{'groupId':'editOrReview','groupLabel':i(_0x13fb4d,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x13fb4d,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x13fb4d,'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(_0x13fb4d,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x13fb4d,'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(_0x13fb4d,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x13fb4d,'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(_0x13fb4d,'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(_0x13fb4d,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x13fb4d,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x13fb4d,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x13fb4d,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x13fb4d,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x13fb4d,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x13fb4d,'Change\x20style'),'commands':[{'id':'business','label':i(_0x13fb4d,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x13fb4d,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x13fb4d,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x13fb4d,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x13fb4d,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x13fb4d,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x13fb4d,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x13fb4d,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x13fb4d,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x13fb4d,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x13fb4d,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x13fb4d,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x13fb4d,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x5b0672)),_0x4f2cfc['define']('ai.aiAssistant.extraCommandGroups',[]),_0x4f2cfc['define']('ai.aiAssistant.removeCommands',[]);let _0x59525e=o(_0x4f2cfc['get']('ai.aiAssistant.commands'),_0x5b0672);const _0x5a12e7=_0x4f2cfc['get']('ai.aiAssistant.extraCommandGroups'),_0x414f85=_0x4f2cfc['get']('ai.aiAssistant.removeCommands');_0x5a12e7['forEach'](_0x4a8e13=>{const _0x530f0d=_0x59525e['find'](_0xac3d83=>_0xac3d83['groupId']===_0x4a8e13['groupId']);_0x530f0d?_0x530f0d['commands']=_0x530f0d['commands']['concat'](_0x4a8e13['commands']):_0x59525e['push'](_0x4a8e13);}),_0x59525e=_0x59525e['filter'](_0x1b4cba=>!_0x414f85['includes'](_0x1b4cba['groupId'])),_0x59525e['forEach'](_0x1cbf4f=>{_0x1cbf4f['commands']=_0x1cbf4f['commands']['filter'](_0x3dbfe0=>!_0x414f85['includes'](_0x3dbfe0['id']));}),_0x4f2cfc['set']('ai.aiAssistant.commands',_0x59525e);}}class P extends _0x2bfdda{['abortController'];static get['requires'](){return[K];}constructor(_0x44a3a3){super(_0x44a3a3),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'](_0x104b7b){return this['sendRequest'](_0x104b7b)['catch'](_0x1b407e=>{if(_0x1b407e instanceof R)return Promise['reject'](_0x1b407e);if('AbortError'==_0x1b407e['name'])return Promise['resolve']();throw console['error'](_0x1b407e),new _0x1a9453('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x57e0a0,_0x1b6ec7){const _0x2b3b3e=this['editor']['locale'],_0x14c88b={'Content-Type':'application/json'};if('object'==typeof _0x57e0a0)Object['assign'](_0x14c88b,_0x57e0a0);else{if(_0x57e0a0)try{const _0x3d311f=await _0x57e0a0(_0x1b6ec7);Object['assign'](_0x14c88b,_0x3d311f);}catch(_0x415bde){return Promise['reject'](new R(i(_0x2b3b3e,'AI_ERROR_GET_HEADERS')));}}return _0x14c88b;}async['_prepareRequestParameters'](_0x529dc8,_0x4c60d1){const _0x4006b6=this['editor']['locale'];if('object'==typeof _0x529dc8)return _0x529dc8;try{return await _0x529dc8(_0x4c60d1);}catch(_0x30e1b4){return Promise['reject'](new R(i(_0x4006b6,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x49e183){super(_0x49e183),_0x49e183['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x49e183['config']['get']('ai.openAI.requestParameters')||_0x49e183['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x49e183['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x49e183['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x49e183['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x5e020d,context:_0x594d31,onData:_0x4901af,actionId:_0xf025a7}){const _0x4d5329=this['editor']['locale'],_0x31b3ea=await this['prepareMessages'](_0x5e020d,_0x594d31,_0xf025a7),_0x1c97a5=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0xf025a7),_0x12ac3b=await this['_prepareRequestParameters'](this['_requestParameters'],_0xf025a7),_0x4a086a={'messages':_0x31b3ea,..._0x12ac3b},_0x3c76be={'method':'POST','headers':_0x1c97a5,'body':JSON['stringify'](_0x4a086a),'signal':this['abortController']['signal']},_0x34bc02=await fetch(this['_apiUrl'],_0x3c76be);if(_0x34bc02['ok'])return _0x12ac3b['stream']?await this['_readStreamableResponse'](_0x34bc02,_0x4901af):await this['_readStaticResponse'](_0x34bc02,_0x4901af),Promise['resolve']();{const _0x1a1068=await _0x34bc02['text']();return _0x1a1068['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x4d5329,'AI_ERROR_CONTEXT_LENGTH'))):_0x1a1068['includes']('Moderation')?Promise['reject'](new R(i(_0x4d5329,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x1a1068));}}async['prepareMessages'](_0x4c5cd2,_0x557d16,_0x5b29e1){let _0x4c3b1a,_0x52da8b;return _0x557d16?(_0x4c3b1a='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.',_0x52da8b='Instruction:\x0a'+_0x4c5cd2+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x557d16):(_0x4c3b1a='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.',_0x52da8b=_0x4c5cd2),[{'role':'system','content':_0x4c3b1a},{'role':'user','content':_0x52da8b}];}async['_readStreamableResponse'](_0x40f825,_0x3fae05){const _0x205e70=_0x40f825['body']['getReader'](),_0x46b3f7=new TextDecoder();let _0x221b5b='',_0x4b3a15='',_0x4e8c8a='',_0x4323ea=!0x1;for(;!_0x4323ea;){const {done:_0x3aa35b,value:_0x1e7ba1}=await _0x205e70['read'](),_0x172197=_0x221b5b+_0x46b3f7['decode'](_0x1e7ba1);let _0x1b623b='';_0x4323ea=_0x3aa35b;try{_0x1b623b=this['_cleanUpData'](_0x172197),_0x221b5b='';}catch(_0x33985a){_0x221b5b=_0x172197;continue;}_0x4b3a15+=_0x1b623b,!_0x4323ea&&this['_isBufferIncomplete'](_0x4b3a15)||_0x4b3a15&&(_0x4e8c8a+=_0x4b3a15,_0x4b3a15='',_0x3fae05(_0x4e8c8a));}return Promise['resolve']();}async['_readStaticResponse'](_0x534235,_0x2828a6){return _0x2828a6((await _0x534235['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x1ad960){const _0x507367=_0x1ad960['split']('<')['length']!==_0x1ad960['split']('>')['length'],_0x5871e9=_0x1ad960['length']<0x1e;return _0x507367&&_0x5871e9;}['_cleanUpData'](_0x5c1405){return _0x5c1405['split'](/\n(?![^{]*\})/g)['map'](_0x74ad60=>_0x74ad60['replace']('data:\x20',''))['filter'](_0x15be39=>_0x15be39&&_0x15be39['length']>0x0&&'[DONE]'!==_0x15be39)['map'](_0x267a95=>{const {choices:_0x26ab89}=JSON['parse'](_0x267a95);if(_0x26ab89[0x0]&&_0x26ab89[0x0]['delta']&&_0x26ab89[0x0]['delta']['content'])return _0x26ab89[0x0]['delta']['content'];})['filter'](_0x9386bd=>_0x9386bd)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x3484e5){super(_0x3484e5),_0x3484e5['config']['get']('ai.aws.requestParameters')||_0x3484e5['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']=_0x3484e5['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x3484e5['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x3484e5['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x3484e5['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x1ef7ef,context:_0x4880d0,onData:_0x3d78e,actionId:_0x269165}){const {model:_0x4a0377,stream:_0x20f29a,..._0x1ed41e}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x269165),_0xfe5477={'prompt':await this['preparePrompt'](_0x1ef7ef,_0x4880d0,_0x4a0377,_0x269165),..._0x1ed41e};this['_apiUrl']?await this['_processProxyRequest'](_0xfe5477,_0x4a0377,_0x20f29a,_0x3d78e,_0x269165):await this['_processAWSRequest'](_0xfe5477,_0x4a0377,_0x20f29a,_0x3d78e);}async['preparePrompt'](_0x2f34df,_0x329ea0,_0x157b5a,_0x34de08){let _0x40457e,_0x45959e;return _0x329ea0?(_0x40457e='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.',_0x45959e='Instruction:\x0a'+_0x2f34df+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x329ea0):(_0x40457e='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.',_0x45959e=_0x2f34df),'meta.llama'==this['getModelFamily'](_0x157b5a)?'<<SYS>>\x0a'+_0x40457e+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x45959e+'\x0a[/INST]':'Human:\x0a'+_0x40457e+'\x0a'+_0x45959e+'\x0a\x0aAssistant:';}['getModelFamily'](_0x4725d2){if(/^anthropic\.claude/['test'](_0x4725d2))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x4725d2))return'ai21.j2';if(/^cohere\.command/['test'](_0x4725d2))return'cohere.command';if(/^meta\.llama/['test'](_0x4725d2))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x4725d2));}async['_processProxyRequest'](_0x32e8fa,_0x27f442,_0x2060b8,_0x5b9bcc,_0x3aa4e8){const _0x1fc8bb={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3aa4e8),'body':JSON['stringify']({..._0x32e8fa,'model':_0x27f442,'stream':_0x2060b8}),'signal':this['abortController']['signal']},_0x314538=await fetch(this['_apiUrl'],_0x1fc8bb);_0x2060b8?await this['_readStreamableResponse'](_0x314538,_0x27f442,_0x5b9bcc):await this['_readStaticResponse'](_0x314538,_0x27f442,_0x5b9bcc);}async['_processAWSRequest'](_0x5326ee,_0x252571,_0x4a23f5,_0x247fb9){const _0x4e30c7=new _0x28658d(this['_bedrockClientConfig']),_0x43fc87={'body':JSON['stringify'](_0x5326ee),'contentType':'application/json','accept':'application/json','modelId':_0x252571};let _0x45c137;if(_0x4a23f5){const _0x19dac3=new _0x2e0fcc(_0x43fc87);_0x45c137=await _0x4e30c7['send'](_0x19dac3,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x45c137,_0x252571,_0x247fb9);}else{const _0x18a710=new _0x56d5fb(_0x43fc87);_0x45c137=await _0x4e30c7['send'](_0x18a710,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x45c137,_0x252571,_0x247fb9);}}async['_readAsyncIterableResponse'](_0x449f6c,_0x4eec4e,_0x303f8d){const _0xbccc30=_0x449f6c['body'],_0x4960f1=new TextDecoder('utf-8');let _0x50aaeb='';for await(const _0x2c74aa of _0xbccc30)if(_0x2c74aa['chunk']){const _0x305fb=_0x4960f1['decode'](_0x2c74aa['chunk']['bytes']),_0x432756=JSON['parse'](_0x305fb);_0x50aaeb+=this['_getGeneratedText'](_0x432756,_0x4eec4e),_0x303f8d(_0x50aaeb);}return Promise['resolve']();}async['_readStreamableResponse'](_0x1fbb54,_0x274d9b,_0x303282){const _0x13c638=_0x1fbb54['body'],_0x41b42b=new TextDecoder('utf-8'),_0x2eecd9=_0x13c638['getReader']();let _0x3f2347='',_0x367f46='',_0x37c5da=!0x1;for(;!_0x37c5da;){const {done:_0x1f4e0f,value:_0x3b5347}=await _0x2eecd9['read']();if(_0x37c5da=_0x1f4e0f,_0x37c5da)break;const _0x384f8e=(_0x3f2347+_0x41b42b['decode'](_0x3b5347))['split']('\x0a')['map'](_0x5cbbd1=>{try{return _0x3f2347='',JSON['parse'](_0x5cbbd1);}catch(_0x5d1847){return _0x3f2347=_0x5cbbd1,null;}})['filter'](_0x4074b1=>null!==_0x4074b1);_0x384f8e['length']&&(_0x367f46+=_0x384f8e['map'](_0x3e47cf=>this['_getGeneratedText'](_0x3e47cf,_0x274d9b))['join'](''),_0x303282(_0x367f46));}return Promise['resolve']();}async['_readStaticResponse'](_0x145b16,_0x1270a4,_0xb54fdd){let _0x28009a;return _0x28009a=_0x145b16 instanceof Response?await _0x145b16['json']():JSON['parse'](Buffer['from'](_0x145b16['body'])['toString']('utf8')),(_0xb54fdd(this['_getGeneratedText'](_0x28009a,_0x1270a4)),Promise['resolve']());}['_getGeneratedText'](_0x41cfb2,_0x1a8690){switch(this['getModelFamily'](_0x1a8690)){case'anthropic.claude':return _0x41cfb2['completion'];case'ai21.j2':return _0x41cfb2['completions'][0x0]['data']['text'];case'cohere.command':return _0x41cfb2['generations'][0x0]['text'];case'meta.llama':return _0x41cfb2['generation'];}}}export{K as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,O as AWSTextAdapter,H as OpenAITextAdapter};
23
+ import{Plugin as _0x27486c,Command as _0x44ba4f,icons as _0x25e110}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x46580a,CKEditorError as _0x1cbeec,ObservableMixin as _0x796197,global as _0x19442f,isVisible as it,Rect as st,Collection as _0x189b68,FocusTracker as _0x2d5aa1,KeystrokeHandler as ts,first as _0x5b090a}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as nt,ButtonView as _0x2db9b8,View as _0x45dbad,SpinnerView as _0x372e3d,IconView as _0x329f83,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x28ceeb,ButtonLabelView as te,FocusCycler as _0x2892fc,createLabeledTextarea as _0x337a32,Dialog as _0x4c00ef,createDropdown as _0x451c66,addMenuToDropdown as _0x2c7cf6,MenuBarMenuView as _0x254b7e,MenuBarMenuListItemButtonView as _0x5c92b9,DialogViewPosition as _0x683f5e,MenuBarMenuListView as _0x136b00,MenuBarMenuListItemView as _0x3eb7a9}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as ct}from'ckeditor5-collaboration/dist/index.js';import{ClipboardPipeline as _0x13c271,ClipboardMarkersUtils as _0x442632}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x534b5e,DataTransfer as _0x53539e,UpcastWriter as _0xf59177,Matcher as _0x5a9945}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x1504d2,escape as _0x2a55a6}from'lodash-es';import{BedrockRuntimeClient as _0x1b56c8,InvokeModelWithResponseStreamCommand as _0xf6c04c,InvokeModelCommand as _0x369233}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x19f652,_0x44da9e){const _0x294647=(0x0,_0x44da9e['t'])('Other');return _0x19f652['length']?'groupId'in _0x19f652[0x0]?_0x19f652:[{'groupId':x,'groupLabel':_0x294647,'order':0x1/0x0,'commands':_0x19f652}]:[{'groupId':x,'groupLabel':_0x294647,'order':0x1/0x0,'commands':[]}];}const dt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x27486c{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x3c316d}=this,_0x2c1b36=['ck-fake-ai-selection'];_0x3c316d['config']['get']('ai.useTheme')&&_0x2c1b36['push']('ck-ai-assistant-ui_theme'),_0x3c316d['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x2c1b36,'priority':0xc}}),_0x3c316d['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x36705f,{writer:_0x322afe})=>{if(!_0x36705f['markerRange']['isCollapsed'])return null;const _0x3f8da5=_0x322afe['createUIElement']('span');return _0x322afe['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x3f8da5),_0x3f8da5;}});}['afterInit'](){!async function(_0x326188){const _0x2b05dc=_0x28d65d([0x37,0x65,0x49,0x6c,0x7a,0x64,0x33,0x31,0x46,0x75,0x6e,0x71,0x34,0x6f,0x59,0x39,0x70,0x56,0x62,0x50,0x69,0x68,0x41,0x30,0x4a,0x4f,0x6b,0x52,0x61,0x38,0x43,0x45,0x42,0x53,0x32,0x55,0x6a,0x47,0x74,0x76,0x6d,0x4d,0x4b,0x4e,0x73,0x79,0x35,0x5a,0x4c,0x77,0x54,0x58,0x48,0x63,0x44,0x67,0x66,0x78,0x36,0x57,0x72,0x51]),_0x3a1e53=0x381ffd31,_0x305425=0x38189dc9^_0x3a1e53,_0x3d275b=window[_0x28d65d([0x44,0x61,0x74,0x65])][_0x28d65d([0x6e,0x6f,0x77])](),_0x3f162c=_0x326188[_0x28d65d([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x55d11a=new window[(_0x28d65d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xf8a50f=>{_0x3f162c[_0x28d65d([0x6f,0x6e,0x63,0x65])](_0x28d65d([0x72,0x65,0x61,0x64,0x79]),_0xf8a50f);}),_0x4b14c5={[_0x28d65d([0x6b,0x74,0x79])]:_0x28d65d([0x45,0x43]),[_0x28d65d([0x75,0x73,0x65])]:_0x28d65d([0x73,0x69,0x67]),[_0x28d65d([0x63,0x72,0x76])]:_0x28d65d([0x50,0x2d,0x32,0x35,0x36]),[_0x28d65d([0x78])]:_0x28d65d([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]),[_0x28d65d([0x79])]:_0x28d65d([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]),[_0x28d65d([0x61,0x6c,0x67])]:_0x28d65d([0x45,0x53,0x32,0x35,0x36])},_0x1e815b=_0x3f162c[_0x28d65d([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x28d65d([0x67,0x65,0x74])](_0x28d65d([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x16bed5(){let _0x873fb8,_0x49f658=null,_0x205e63=null;try{if(_0x1e815b==_0x28d65d([0x47,0x50,0x4c]))return _0x28d65d([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x873fb8=_0x32513e(),!_0x873fb8)return _0x28d65d([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x873fb8[_0x28d65d([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x205e63=_0x18528a(_0x873fb8[_0x28d65d([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x873fb8[_0x28d65d([0x6a,0x74,0x69])])),await _0x7c1f11()?_0x85db18()?_0x5b56fb()?_0x28d65d([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x39d6ea()?(_0x873fb8[_0x28d65d([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x28d65d([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x49f658=_0x4eb6ed(_0x28d65d([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x873fb8[_0x28d65d([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x28d65d([0x74,0x72,0x69,0x61,0x6c])&&(_0x49f658=_0x4eb6ed(_0x28d65d([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x1ce266()):_0x28d65d([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x28d65d([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x28d65d([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x100328){return _0x28d65d([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x5b56fb(){const _0x27e47c=[_0x28d65d([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x28d65d([0x74,0x72,0x69,0x61,0x6c])][_0x28d65d([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x873fb8[_0x28d65d([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x3d275b/0x3e8:0xe10*_0x305425;return _0x873fb8[_0x28d65d([0x65,0x78,0x70])]<_0x27e47c;}function _0x85db18(){const _0x5a5258=_0x873fb8[_0x28d65d([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x5a5258&&(!!_0x5a5258[_0x28d65d([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x28d65d([0x2a]))||!!_0x5a5258[_0x28d65d([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x28d65d([0x41,0x49])));}function _0x39d6ea(){const _0x58e1bb=_0x873fb8[_0x28d65d([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x58e1bb||0x0==_0x58e1bb[_0x28d65d([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x3eb972}=new URL(window[_0x28d65d([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x58e1bb[_0x28d65d([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3eb972))return!0x0;const _0x3ab8fe=_0x3eb972[_0x28d65d([0x73,0x70,0x6c,0x69,0x74])](_0x28d65d([0x2e]));return _0x58e1bb[_0x28d65d([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x370437=>_0x370437[_0x28d65d([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x28d65d([0x2a])))[_0x28d65d([0x6d,0x61,0x70])](_0x3d944a=>_0x3d944a[_0x28d65d([0x73,0x70,0x6c,0x69,0x74])](_0x28d65d([0x2e])))[_0x28d65d([0x73,0x6f,0x6d,0x65])](_0x29a1f3=>_0x3ab8fe[_0x28d65d([0x65,0x76,0x65,0x72,0x79])]((_0x4dedbe,_0x2a2ec7)=>_0x29a1f3[_0x2a2ec7]===_0x4dedbe||_0x29a1f3[_0x2a2ec7]===_0x28d65d([0x2a])));}function _0x1ce266(){return _0x49f658&&_0x205e63?new window[(_0x28d65d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x333342,_0x1a0316)=>{_0x49f658[_0x28d65d([0x74,0x68,0x65,0x6e])](_0x333342,_0x1a0316),_0x205e63[_0x28d65d([0x74,0x68,0x65,0x6e])](_0x57eca5=>{_0x57eca5!=_0x28d65d([0x56,0x61,0x6c,0x69,0x64])&&_0x333342(_0x57eca5);},_0x1a0316);}):_0x49f658||_0x205e63||_0x28d65d([0x56,0x61,0x6c,0x69,0x64]);}}function _0x18528a(_0x4f2f32,_0x111ae3){return new window[(_0x28d65d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3dd031=>{if(_0x42acc5())return _0x3dd031(_0x28d65d([0x56,0x61,0x6c,0x69,0x64]));_0x1fe3f6(),_0x3f162c[_0x28d65d([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x28d65d([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x59654d=!0x1;const _0x119119=_0x46580a();function _0x1c0604(_0x220ac7){return!!_0x220ac7&&(typeof _0x220ac7===_0x28d65d([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x220ac7===_0x28d65d([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x220ac7[_0x28d65d([0x74,0x68,0x65,0x6e])]===_0x28d65d([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x220ac7[_0x28d65d([0x63,0x61,0x74,0x63,0x68])]===_0x28d65d([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x53a4fa(_0x38b314){_0x5f04e8(_0x38b314)[_0x28d65d([0x74,0x68,0x65,0x6e])](_0x45d25e=>{if(!_0x45d25e||_0x45d25e[_0x28d65d([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x28d65d([0x6f,0x6b]))return _0x28d65d([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x5bf03c(_0x597768(_0x119119+_0x111ae3))!=_0x45d25e[_0x28d65d([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x28d65d([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x28d65d([0x56,0x61,0x6c,0x69,0x64]);})[_0x28d65d([0x74,0x68,0x65,0x6e])](_0x44b6eb=>(_0x56958b(),_0x44b6eb),()=>{const _0x4bc80f=_0x19bb3d();return null==_0x4bc80f?(_0x56958b(),_0x28d65d([0x56,0x61,0x6c,0x69,0x64])):_0x28d65d(_0x3d275b-_0x4bc80f>(0x1c137931^_0x3a1e53)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x28d65d([0x74,0x68,0x65,0x6e])](_0x3dd031)[_0x28d65d([0x63,0x61,0x74,0x63,0x68])](()=>{_0x3dd031(_0x28d65d([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x4d08c4=0x382913b1^_0x3a1e53;function _0x56958b(){const _0x522433=_0x28d65d([0x6c,0x6c,0x63,0x74,0x2d])+_0x5bf03c(_0x597768(_0x4f2f32)),_0x3dc920=_0xc89d6(_0x5bf03c(window[_0x28d65d([0x4d,0x61,0x74,0x68])][_0x28d65d([0x63,0x65,0x69,0x6c])](_0x3d275b/_0x4d08c4)));window[_0x28d65d([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x28d65d([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x522433,_0x3dc920);}function _0x19bb3d(){const _0x277bbf=_0x28d65d([0x6c,0x6c,0x63,0x74,0x2d])+_0x5bf03c(_0x597768(_0x4f2f32)),_0x538095=window[_0x28d65d([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x28d65d([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x277bbf);return _0x538095?window[_0x28d65d([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xc89d6(_0x538095),0x10)*_0x4d08c4:null;}function _0x5f04e8(_0x1fcf9b){return new window[(_0x28d65d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x1746ed,_0x5d22a4)=>{_0x1fcf9b[_0x28d65d([0x74,0x68,0x65,0x6e])](_0x1746ed,_0x5d22a4),window[_0x28d65d([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x5d22a4,0x381e29f1^_0x3a1e53);});}}_0x3f162c[_0x28d65d([0x6f,0x6e])](_0x28d65d([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x268f3c,_0x179f94)=>{if(_0x179f94[0x0]!=_0x4f2f32)return _0x3dd031(_0x28d65d([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x179f94[0x1]={..._0x179f94[0x1],[_0x28d65d([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x119119};},{[_0x28d65d([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x28d65d([0x68,0x69,0x67,0x68])}),_0x3f162c[_0x28d65d([0x6f,0x6e])](_0x28d65d([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x135b99=>{_0x1c0604(_0x135b99[_0x28d65d([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x59654d=!0x0,_0x53a4fa(_0x135b99[_0x28d65d([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x28d65d([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x28d65d([0x6c,0x6f,0x77])}),_0x55d11a[_0x28d65d([0x74,0x68,0x65,0x6e])](()=>{_0x59654d||_0x3dd031(_0x28d65d([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x42acc5(){return _0x3f162c[_0x28d65d([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x28d65d([0x76,0x69,0x65,0x77])][_0x28d65d([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x28d65d([0x61,0x75,0x74,0x6f]);}function _0x1fe3f6(){_0x3f162c[_0x28d65d([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x28d65d([0x76,0x69,0x65,0x77])][_0x28d65d([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x28d65d([0x61,0x75,0x74,0x6f]);}}function _0x4eb6ed(_0x4a858a){const _0x188be3=[new window[(_0x28d65d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2929db=>setTimeout(_0x2929db,0x3816c3fd^_0x3a1e53)),_0x55d11a[_0x28d65d([0x74,0x68,0x65,0x6e])](()=>new window[(_0x28d65d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3d7d38=>{let _0x33cf91=0x0;_0x3f162c[_0x28d65d([0x6d,0x6f,0x64,0x65,0x6c])][_0x28d65d([0x6f,0x6e])](_0x28d65d([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x460d3a,_0x3b5bf3)=>{_0x3b5bf3[0x0][_0x28d65d([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x33cf91++,_0x33cf91==(0x381ffcc9^_0x3a1e53)&&(_0x3d7d38(),_0x460d3a[_0x28d65d([0x6f,0x66,0x66])]());});}))];return window[_0x28d65d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x28d65d([0x72,0x61,0x63,0x65])](_0x188be3)[_0x28d65d([0x74,0x68,0x65,0x6e])](()=>_0x4a858a);}async function _0x4038ca(){await _0x55d11a,_0x3f162c[_0x28d65d([0x6d,0x6f,0x64,0x65,0x6c])][_0x28d65d([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x136ad9,_0x3f162c[_0x28d65d([0x6d,0x6f,0x64,0x65,0x6c])][_0x28d65d([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x136ad9,_0x3f162c[_0x28d65d([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x28d65d([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x3dd61d(_0x1df5dd){const _0x1ca450=_0x284b2f();_0x3f162c[_0x1ca450]=_0x28d65d([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x1df5dd,_0x1df5dd!=_0x28d65d([0x56,0x61,0x6c,0x69,0x64])&&_0x4038ca();}function _0x284b2f(){const _0x1e6af4=window[_0x28d65d([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x28d65d([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x28d65d([0x6e,0x6f,0x77])]())[_0x28d65d([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x28d65d([0x2e]),'');let _0x2df238=_0x28d65d([0x65]);for(let _0x301e06=0x0;_0x301e06<_0x1e6af4[_0x28d65d([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x301e06+=0x2){let _0x5d2942=window[_0x28d65d([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1e6af4[_0x28d65d([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x301e06,_0x301e06+0x2));_0x5d2942>=_0x2b05dc[_0x28d65d([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x5d2942-=_0x2b05dc[_0x28d65d([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x2df238+=_0x2b05dc[_0x5d2942];}return _0x2df238;}function _0x32513e(){const _0x52ba3c=_0x1e815b[_0x28d65d([0x73,0x70,0x6c,0x69,0x74])](_0x28d65d([0x2e]));if(0x3!=_0x52ba3c[_0x28d65d([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x885a7c(_0x52ba3c[0x1]);function _0x885a7c(_0x2685c2){const _0x3d023a=_0x23514c(_0x2685c2);return _0x3d023a&&_0x1daada()?_0x3d023a:null;function _0x1daada(){const _0x2135c5=_0x3d023a[_0x28d65d([0x6a,0x74,0x69])],_0x26cc51=window[_0x28d65d([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2135c5[_0x28d65d([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x2135c5[_0x28d65d([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x591ddf={..._0x3d023a,[_0x28d65d([0x6a,0x74,0x69])]:_0x2135c5[_0x28d65d([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x2135c5[_0x28d65d([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x591ddf[_0x28d65d([0x76,0x63])],_0x597768(_0x591ddf)==_0x26cc51;}}}async function _0x7c1f11(){let _0x216772=!0x0;try{const _0x48e750=_0x1e815b[_0x28d65d([0x73,0x70,0x6c,0x69,0x74])](_0x28d65d([0x2e])),[_0x115b0d,_0x2ed39d,_0x35ed32]=_0x48e750;return _0x3541df(_0x115b0d),await _0xbc7e80(_0x115b0d,_0x2ed39d,_0x35ed32),_0x216772;}catch(_0x3d19f6){return!0x1;}function _0x3541df(_0x132557){const _0x21145b=_0x23514c(_0x132557);_0x21145b&&_0x21145b[_0x28d65d([0x61,0x6c,0x67])]==_0x28d65d([0x45,0x53,0x32,0x35,0x36])||(_0x216772=!0x1);}async function _0xbc7e80(_0x4f8a79,_0x2e3f06,_0x376eb2){const _0x4c6afd=window[_0x28d65d([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x28d65d([0x66,0x72,0x6f,0x6d])](_0x20ffea(_0x376eb2),_0x16480d=>_0x16480d[_0x28d65d([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x474e37=new window[(_0x28d65d([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x28d65d([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x4f8a79+_0x28d65d([0x2e])+_0x2e3f06),_0x542a27=window[_0x28d65d([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x28d65d([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x542a27)return;const _0x294f73=await _0x542a27[_0x28d65d([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x28d65d([0x6a,0x77,0x6b]),_0x4b14c5,{[_0x28d65d([0x6e,0x61,0x6d,0x65])]:_0x28d65d([0x45,0x43,0x44,0x53,0x41]),[_0x28d65d([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x28d65d([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x28d65d([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x542a27[_0x28d65d([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x28d65d([0x6e,0x61,0x6d,0x65])]:_0x28d65d([0x45,0x43,0x44,0x53,0x41]),[_0x28d65d([0x68,0x61,0x73,0x68])]:{[_0x28d65d([0x6e,0x61,0x6d,0x65])]:_0x28d65d([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x294f73,_0x4c6afd,_0x474e37)||(_0x216772=!0x1);}}function _0x23514c(_0x24dc93){return _0x24dc93[_0x28d65d([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x28d65d([0x65,0x79]))?JSON[_0x28d65d([0x70,0x61,0x72,0x73,0x65])](_0x20ffea(_0x24dc93)):null;}function _0x20ffea(_0x203a90){return window[_0x28d65d([0x61,0x74,0x6f,0x62])](_0x203a90[_0x28d65d([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x28d65d([0x2b]))[_0x28d65d([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x28d65d([0x2f])));}function _0x597768(_0x27584d){let _0x2c4f8b=0x1505;function _0x2b4dfe(_0x55a7ba){for(let _0x1d898c=0x0;_0x1d898c<_0x55a7ba[_0x28d65d([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1d898c++){const _0x3aff9d=_0x55a7ba[_0x28d65d([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x1d898c);_0x2c4f8b=(_0x2c4f8b<<0x5)+_0x2c4f8b+_0x3aff9d,_0x2c4f8b&=_0x2c4f8b;}}function _0x1a35c5(_0x2839a1){Array[_0x28d65d([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x2839a1)?_0x2839a1[_0x28d65d([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x1a35c5):_0x2839a1&&typeof _0x2839a1==_0x28d65d([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x28d65d([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x2839a1)[_0x28d65d([0x73,0x6f,0x72,0x74])]()[_0x28d65d([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x40c895,_0x4f4903])=>{_0x2b4dfe(_0x40c895),_0x1a35c5(_0x4f4903);}):_0x2b4dfe(window[_0x28d65d([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x2839a1));}return _0x1a35c5(_0x27584d),_0x2c4f8b>>>0x0;}function _0x5bf03c(_0x3588d2){return _0x3588d2[_0x28d65d([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x28d65d([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x28d65d([0x30]));}function _0xc89d6(_0x33bc26){return _0x33bc26[_0x28d65d([0x73,0x70,0x6c,0x69,0x74])]('')[_0x28d65d([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x28d65d([0x6a,0x6f,0x69,0x6e])]('');}function _0x136ad9(){}function _0x28d65d(_0xb20498){return _0xb20498['map'](_0x5ad115=>String['fromCharCode'](_0x5ad115))['join']('');}_0x3dd61d(await _0x16bed5());}(this);}['showFakeVisualSelection'](){const _0x45498b=this['editor']['model'];_0x45498b['change'](_0x2c3d45=>{const _0x5be876=_0x45498b['document']['selection']['getRanges']();let _0x3d8207=0x0;for(const _0x473151 of _0x5be876){const _0x1b262e=f+':'+_0x3d8207;if(_0x45498b['markers']['has'](_0x1b262e))_0x2c3d45['updateMarker'](_0x1b262e,{'range':_0x473151});else{if(_0x473151['start']['isAtEnd']){const _0x49064c=_0x473151['start']['getLastMatchingPosition'](({item:_0x467177})=>!_0x45498b['schema']['isContent'](_0x467177),{'boundaries':_0x473151});_0x2c3d45['addMarker'](_0x1b262e,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2c3d45['createRange'](_0x49064c,_0x473151['end'])});}else _0x2c3d45['addMarker'](_0x1b262e,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x473151});}_0x3d8207++;}});}['hideFakeVisualSelection'](){const _0x44658f=this['editor']['model'],_0x42f915=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x42f915['length']&&_0x44658f['change'](_0x2e2d17=>{_0x42f915['forEach'](_0xebf5a4=>{_0x2e2d17['removeMarker'](_0xebf5a4);});});}['insertContent'](_0x5413d1,_0x17a1e0){const _0x5036fa=this['_getAISelection'](),_0x87b76d=_0x17a1e0||_0x5036fa['getFirstRange']();this['editor']['model']['canEditAt'](_0x87b76d)&&this['editor']['model']['change'](_0x797fd4=>{this['hideFakeVisualSelection'](),_0x17a1e0||this['_resetContentOfSelectedTableCells'](_0x797fd4,_0x5036fa),this['_pasteHTMLUsingClipboard']({'insertAt':_0x87b76d,'writer':_0x797fd4,'html':_0x5413d1});});}['insertContentBelow'](_0x2af17f){const {model:_0x15f20a}=this['editor'],_0xfa0a3d=this['_getAISelection']();_0x15f20a['change'](()=>{const _0x248ed7=this['_prepareTableInsertBelowPosition'](_0x2af17f,_0xfa0a3d)||this['_getDefaultInsertBelowPosition'](_0xfa0a3d);this['insertContent'](_0x2af17f,_0x248ed7);});}['_getAISelection'](){const _0x4db561=this['editor']['model'],_0x152db1=Array['from'](_0x4db561['markers']['getMarkersGroup'](f))['map'](_0x263c5f=>_0x263c5f['getRange']());return _0x4db561['createSelection'](_0x152db1);}['_pasteHTMLUsingClipboard']({writer:_0x43c129,html:_0x1fe170,insertAt:_0x30eaf9}){const {view:_0x169380}=this['editor']['editing'],_0x61d9d=this['editor']['plugins']['get'](_0x13c271),_0x40cc52=new dt();_0x40cc52['setData']('text/html',_0x1fe170);const _0x5a9d1c=new ClipboardEvent('paste',{'clipboardData':_0x40cc52}),_0xd2e285=new _0x534b5e(_0x169380,_0x5a9d1c,{'dataTransfer':new _0x53539e(_0x40cc52)});_0x43c129['setSelection'](_0x30eaf9);const _0x4b88c9=(_0x1c87db,_0x19e065)=>{_0x19e065['resultRange']&&_0x43c129['setSelection'](_0x19e065['resultRange']);};_0x61d9d['once']('contentInsertion',_0x4b88c9,{'priority':'lowest'}),_0x169380['document']['fire']('paste',_0xd2e285),_0x61d9d['off']('contentInsertion',_0x4b88c9);}['_getDefaultInsertBelowPosition'](_0xcd1f77){const {model:_0x59dccb}=this['editor'],_0x262495=Array['from'](_0xcd1f77['getSelectedBlocks']());return _0x262495['length']?_0x59dccb['createPositionAfter'](_0x262495['pop']()):_0xcd1f77['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x3e88ef,_0x4caf4e){const {model:_0x21bcf2,plugins:_0x22e2ea}=this['editor'];if(_0x22e2ea['has']('TableUtils')){const _0xfd319f=_0x22e2ea['get']('TableUtils')['getSelectedTableCells'](_0x4caf4e);if(_0xfd319f['length']){const _0x26fad3=this['_getTableRowCountFromContent'](_0x3e88ef),_0x23ab59=this['_createEmptyTableRows'](_0xfd319f,_0x26fad3);return _0x21bcf2['createPositionAt'](_0x23ab59,0x0);}}return null;}['_getTableRowCountFromContent'](_0x129ba8){const _0x2cda58=this['editor']['plugins']['get']('TableUtils'),_0x11480f=this['editor']['data']['parse'](_0x129ba8),_0x3171b2=Array['from'](_0x11480f['getChildren']())['filter'](_0x23a0c0=>_0x23a0c0['is']('element','table'));let _0x3233b1=0x0;return _0x3171b2['forEach'](_0xa6d51a=>{_0x3233b1+=_0x2cda58['getRows'](_0xa6d51a);}),_0x3233b1;}['_createEmptyTableRows'](_0x5f03c6,_0x89717f){const _0x1cf824=this['editor']['plugins']['get']('TableUtils'),_0x45fe04=_0x1cf824['getRowIndexes'](_0x5f03c6),_0x739400=_0x1cf824['getColumnIndexes'](_0x5f03c6),_0x40a08a=_0x45fe04['last']+0x1,_0x161a86=_0x739400['first'],_0x284119=_0x5f03c6[0x0]['findAncestor']('table');for(let _0x233209=0x0;_0x233209<_0x89717f;_0x233209++)_0x1cf824['insertRows'](_0x284119,{'at':_0x40a08a});return _0x284119['getChild'](_0x40a08a)['getChild'](_0x161a86);}['_resetContentOfSelectedTableCells'](_0x484bc6,_0x329c1b){const {plugins:_0x2dee56}=this['editor'],{model:_0x4e1b16}=_0x484bc6;if(!_0x2dee56['has']('TableUtils'))return;_0x2dee56['get']('TableUtils')['getSelectedTableCells'](_0x329c1b)['length']&&_0x4e1b16['deleteContent'](_0x329c1b);}}class K extends _0x27486c{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x1cbeec('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x1b69d1){super(_0x1b69d1),this['name']='AIRequestError';}}function i(_0x30f73f,_0x2b427e,_0x284b98){const t=_0x30f73f['t'];switch(_0x2b427e){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',_0x284b98);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x284b98);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'},_0x284b98);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 _0x2b427e;}}class E extends _0x44ba4f{['_commandDefinitions'];constructor(_0x35448d,_0x181e01){super(_0x35448d),this['_commandDefinitions']=_0x181e01,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x39be24,_0x7b5d0f,_0x25898a)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x25898a));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x30a6bf,_0x478333,_0x1d7c36)=>{this['enabledCommandsIds']=_0x1d7c36?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x496e87=this['editor']['model'];this['_hasContext']=function(_0x493768){const _0x12781c=_0x493768['document']['selection'];return _0x12781c['isCollapsed']?0x0!==[..._0x12781c['getSelectedBlocks']()]['length']&&![..._0x12781c['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x493768['hasContent'](_0x12781c['getFirstRange']());}(_0x496e87);const _0x38ac17=_0x496e87['document']['selection'],_0x322319=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x3aedff of _0x38ac17['getRanges']())for(const _0x22a4a2 of _0x3aedff['getItems']())if(_0x22a4a2['is']('element')&&_0x322319['includes'](_0x22a4a2['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x5d1bb3='',_0x3ea0fb='',_0x549e43='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x5d1bb3,_0x3ea0fb,_0x549e43);}}function G(_0x94e17,_0x4f47cd){const _0x318ebb=new Set();for(const _0x23af36 of _0x94e17['values']())(_0x4f47cd||!0x1===_0x23af36['requiresContent'])&&_0x318ebb['add'](_0x23af36['id']);return Array['from'](_0x318ebb);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
+ _0x796197(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x12b96f,_0x3dfabf,_0x18c692){super(),this['editor']=_0x12b96f,this['textAdapter']=_0x3dfabf,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x18c692,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x404d68,_0x347a8a,_0x3d1d93)=>{this['view']['value']=this['_sanitizeHTML'](_0x3d1d93);}),this['listenTo'](this['view'],'submitPrompt',(_0x10ef27,_0x9cd90d)=>{const _0x228d51=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x9cd90d,_0x228d51,'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:_0x366259,query:_0x5a88a0,htmlContent:_0x5886a2,label:_0xf92613,mainActionLabel:_0x3d990d}){this['view']['prompt']=_0xf92613,this['view']['mainAction']=_0x3d990d,this['initialContext']=_0x5886a2,_0x5a88a0&&(this['view']['isRendered']?this['_handleQuery'](_0x5a88a0,_0x5886a2,_0x366259,_0xf92613):this['view']['once']('render',()=>{this['_handleQuery'](_0x5a88a0,_0x5886a2,_0x366259,_0xf92613);}));}['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'](_0x5ef72e,_0x5c0df1,_0x2deed6,_0x31a5c6){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x5c0df1,this['previousQuery']=_0x5ef72e,this['previousLabel']=_0x31a5c6||_0x5ef72e,this['previousActionId']=_0x2deed6,new Promise(_0x440320=>{this['textAdapter']['makeRequest']({'query':_0x5ef72e,'context':_0x5c0df1,'onData':_0x5b2a6d=>{this['currentResponse']=_0x5b2a6d,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x2deed6})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x1c5e49=>{_0x1c5e49 instanceof R?this['view']['handleError'](_0x1c5e49['message']):this['view']['handleError'](),_0x440320();})['finally'](()=>{this['stopProcessing'](),_0x440320();});});}['_parseAndNormalizeContent'](_0x48c13c,_0x39b9bb=!0x1){const _0x2e75ff=Z['exec'](_0x48c13c);_0x48c13c=_0x2e75ff?_0x48c13c['substring'](_0x2e75ff[0x1]['length']):_0x48c13c['length']<0x64&&!_0x39b9bb?'':this['_stripMarkdownSyntax'](_0x48c13c);const _0x119a69=this['_domParser']['parseFromString'](_0x48c13c,'text/html');if(_0x2e75ff){const _0x52e24d=Array['from'](_0x119a69['body']['childNodes']);_0x52e24d['reverse']();for(const _0x4f43e8 of _0x52e24d){if(_0x4f43e8['nodeType']==Node['ELEMENT_NODE'])break;_0x4f43e8['remove']();}}const _0x1d60e6=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x119a69['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x1d60e6);const _0x2185a0=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x2e20e9=this['editor']['data']['toModel'](_0x1d60e6);return _0x2185a0||_0x2e20e9['markers']['clear'](),this['editor']['data']['stringify'](_0x2e20e9);}['_normalizeResponseHeadings'](_0x41b6a2){const _0x4e3db9=new _0xf59177(this['editor']['editing']['view']['document']),_0x5d23b4=new _0x5a9945({'name':/^h[1-5]$/}),_0xe8047c=[];let _0x5f4720=!0x1;for(const _0x29247d of _0x41b6a2)_0x29247d['is']('element')&&_0x5d23b4['match'](_0x29247d)&&(_0xe8047c['push'](_0x29247d),'h1'==_0x29247d['name']&&(_0x5f4720=!0x0));if(_0x5f4720){for(const _0x3750ed of _0xe8047c)_0x4e3db9['rename']('h'+(parseInt(_0x3750ed['name'][0x1])+0x1),_0x3750ed);}}['_isH1TagSupportEnabled'](){const {data:_0x4c7c98,editing:_0x56cf25}=this['editor'],_0x347dea=_0x4c7c98['htmlProcessor']['toView']('<h1></h1>'),_0x540a81=_0x4c7c98['toView'](_0x4c7c98['toModel'](_0x347dea));return!!_0x56cf25['view']['domConverter']['viewToDom'](_0x540a81)['querySelector']('h1');}['_sanitizeHTML'](_0xad6a20){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0xad6a20),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x31a5e5){const _0x36d5fa=_0x31a5e5['trim']();return _0x36d5fa['startsWith']('```html')?_0x36d5fa['endsWith']('```')?_0x36d5fa['substring'](0x7,_0x36d5fa['length']-0x3):_0x36d5fa['substring'](0x7):_0x31a5e5;}}const M={'REPLACE':'replace','INSERT':'insert'};class at extends nt{constructor(_0xd67c08){super(_0xd67c08),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x267b21=>i(_0xd67c08,'AI_'+_0x267b21['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0xd67c08,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0xd67c08,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0xd67c08,'Stop'));const _0xdbc58b=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0xdbc58b['if']('isVisible','ck-hidden',_0x3bed6f=>!_0x3bed6f)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x3f0117,_0x396b2d){const _0x3e0e7e=new _0x2db9b8(this['locale']);return _0x3e0e7e['set']({'label':_0x3f0117,'class':_0x396b2d||'','isVisible':!0x0,'withText':!0x0}),_0x3e0e7e;}}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 _0x45dbad{['contentFieldView'];['copyButtonView'];constructor(_0xf1b54b,_0x472396=''){super(_0xf1b54b),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x1f5d0b=this['bindTemplate'];this['contentFieldView']=new mt(_0xf1b54b,_0x472396),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x1f5d0b['if']('isVisible','ck-hidden',_0x18e527=>!_0x18e527)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x1f5d0b['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 _0x35665e=!0x1;this['on']('change:value',(_0x3aa3e6,_0x13ef1,_0x3a6b01)=>{const _0x55fe1e=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x3a6b01),this['isProcessing']&&_0x55fe1e&&!_0x35665e&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x156d52,_0x5c138e,_0x93cccb)=>{_0x35665e=!0x1,_0x93cccb?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x35665e=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x35665e=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x2805b1=this['locale'],_0x2487c1=new _0x2db9b8(this['locale']),_0x26bc97='ck-ai-form__copy-button';return _0x2487c1['set']({'label':i(_0x2805b1,'Copy'),'icon':W,'class':_0x26bc97,'tooltip':!0x0}),_0x2487c1['bind']('isVisible')['to'](this,'value',_0x5a8f73=>!!_0x5a8f73),_0x2487c1['bind']('isEnabled')['to'](this,'isProcessing',_0x23b7cb=>!_0x23b7cb),_0x2487c1['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x2487c1['icon']=_0x25e110['check'],_0x2487c1['class']=_0x26bc97+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x2487c1['icon']=W,_0x2487c1['class']=_0x26bc97;},0x3e8);}),_0x2487c1;}['_copyHTMLToClipboard'](_0x18004f){const {window:_0x216500,document:_0x3d0fd4}=_0x19442f;if(_0x216500['ClipboardItem']){const {Blob:_0x3da7af,ClipboardItem:_0xeef992}=_0x216500,_0x52a2a6=[new _0xeef992({'text/html':new _0x3da7af([_0x18004f['innerHTML']],{'type':'text/html'}),'text/plain':new _0x3da7af([_0x18004f['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x52a2a6);}else{const _0x267849=_0x3d0fd4['createElement']('div');_0x267849['style']['position']='absolute',_0x267849['style']['left']='-9999px',_0x267849['innerHTML']='<span>[</span>'+_0x18004f['innerHTML']+'<span>]</span>',_0x3d0fd4['body']['appendChild'](_0x267849);const _0x1ff63e=_0x3d0fd4['createRange']();_0x1ff63e['setStartAfter'](_0x267849['firstElementChild']),_0x1ff63e['setEndBefore'](_0x267849['lastElementChild']);const _0x5d4e18=_0x216500['getSelection']();_0x5d4e18['removeAllRanges'](),_0x5d4e18['addRange'](_0x1ff63e),_0x3d0fd4['execCommand']('copy'),_0x267849['remove']();}}}class mt extends _0x45dbad{constructor(_0x6b1c15,_0x57f9b2=''){super(_0x6b1c15),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x57f9b2,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x35a9f9){this['element']['innerHTML']=_0x35a9f9;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x42b2cb=new _0x45dbad(),_0x194673=this['locale'],_0x5c7eb6=new _0x372e3d();return _0x5c7eb6['isVisible']=!0x0,_0x42b2cb['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x5c7eb6,{'text':i(_0x194673,'AI\x20is\x20writing...')}]}),_0x42b2cb['render'](),_0x42b2cb;}}class rt extends _0x45dbad{constructor(_0x2dc54b,_0x3300b7=''){super(_0x2dc54b);const _0xfcb676=new _0x329f83(),_0x17acdc=this['bindTemplate'];this['set']('text',_0x3300b7),_0xfcb676['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':[_0xfcb676,{'text':_0x17acdc['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x3fe4ba,_0x46a360){super(_0x3fe4ba,_0x46a360),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',(_0x2b571c,_0x2cb306)=>{_0x2b571c['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x2cb306());});}['_createSubmitButton'](){const _0x3342d2=new _0x2db9b8(this['locale']),_0x2b16cc=this['locale'];return _0x3342d2['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(_0x2b16cc,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x3342d2['on']('execute',()=>{this['submit']();}),_0x3342d2['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0xd7fd3f,_0x17da22)=>!_0xd7fd3f&&_0x17da22),_0x3342d2;}['_createShowHistoryButton'](){const _0x5ad1d3=new _0x2db9b8(this['locale']),_0x3a23ea=this['resultsView'],_0x4dbbc3=this['locale'];_0x5ad1d3['set']({'label':i(_0x4dbbc3,'History'),'withText':!0x1,'icon':_0x25e110['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x5ad1d3['bind']('isOn')['to'](_0x3a23ea,'isVisible'),_0x5ad1d3['bind']('isEnabled')['to'](this,'isEnabled'),_0x5ad1d3['on']('execute',()=>{_0x3a23ea['isVisible']=!_0x3a23ea['isVisible'],_0x3a23ea['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x11eb46=()=>{_0x19442f['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0xdf05c8=new st(this['queryView']['fieldView']['element']),_0x2258b7=_0xdf05c8['width'],_0x71067f='rtl'===_0x4dbbc3['uiLanguageDirection']?'left':'right';_0xdf05c8['excludeScrollbarsAndBorders'](),_0x5ad1d3['element']['style'][_0x71067f]=_0x2258b7-_0xdf05c8['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x11eb46),this['on']('render',_0x11eb46),_0x5ad1d3;}['submit'](){const _0x27854b=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x27854b);}['focus'](_0x213f63){-0x1===_0x213f63?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x5ec156){super(_0x5ec156),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x5ec156,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x5e78d3=0x0;for(const _0x2abfd4 of this['items'])_0x5e78d3+=_0x2abfd4['items']['length'];return{'resultsCount':_0x5e78d3,'totalItemsCount':_0x5e78d3};}['_createClearHistoryButton'](){const _0x4dca01=this['locale'],_0x589d3a=new _0x2db9b8(this['locale']);return _0x589d3a['set']({'label':'('+i(_0x4dca01,'Clear')+')','withText':!0x0}),_0x589d3a['on']('execute',()=>this['fire']('clearHistory')),_0x589d3a;}}class hs extends _0x28ceeb{constructor(_0x1f7b86){super();const _0x513a0f=new te(),_0xcebb95=new _0x2db9b8(this['locale'],_0x513a0f);this['children']['add'](_0xcebb95),_0xcebb95['set']({'label':_0x1f7b86['prompt'],'withText':!0x0}),_0xcebb95['on']('execute',()=>{this['fire']('execute',{'value':_0x1504d2(_0x1f7b86['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x189b68{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x3344b7,_0x5c2947)=>{const _0x4a9f3c=Ss(_0x5c2947['prompt']);for(const _0x4ae4c1 of this)if(_0x4ae4c1!=_0x5c2947&&Ss(_0x4ae4c1['prompt'])===_0x4a9f3c){this['remove'](_0x4ae4c1);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x850d13=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x850d13));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x1374c5=>_0x1374c5)));}}function Ss(_0x411193){return _0x411193['toLowerCase']()['trim']();}class k extends _0x45dbad{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x13e319,_0x5aea2a,_0xfbdff1=''){super(_0x13e319),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(_0x13e319),this['contentArea']=new X(_0x13e319,_0xfbdff1),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 _0x2d5aa1(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x2892fc({'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 _0x3bca2b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x5aea2a],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x3bca2b['if']('isError','ck-hidden',_0x1974d0=>!_0x1974d0)]},'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'](_0x32ecce=0x1){-0x1===_0x32ecce?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 _0x2fb54d=this['locale'],_0x12382d=new ht(_0x2fb54d,{'queryView':{'label':i(_0x2fb54d,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x337a32,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x2fb54d,'Empty\x20history'),'secondary':i(_0x2fb54d,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x12382d['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x17fb0c,_0x386b3e)=>_0x17fb0c&&!_0x386b3e),this['listenTo'](_0x12382d,'submit',(_0x3ab4b9,_0x261184)=>{this['prompt']=_0x261184;const _0x1b4d96=_0x2a55a6(_0x261184);this['fire']('submitPrompt',_0x1b4d96),_0x261184['trim']()&&this['_promptHistory']['add']({'prompt':_0x1b4d96},0x0);},{'priority':'high'}),_0x12382d;}['_createHistoryView'](){const _0x4de5e0=new rs(this['locale']);return _0x4de5e0['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x4de5e0['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x4de5e0;}['_createToolbar'](){const _0x5e2329=new at(this['locale']);return _0x5e2329['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x20a758,_0x41fc41,_0x27c766)=>_0x20a758&&!_0x41fc41&&!!_0x27c766),_0x5e2329['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x5e2329['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x2d388e,_0x118fb0,_0x3e2f9e)=>_0x2d388e&&!_0x118fb0&&!!_0x3e2f9e),_0x5e2329['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x5e2329['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x5cda6a,_0x4aa907)=>_0x5cda6a&&!_0x4aa907),_0x5e2329['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x5e2329['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x5e2329['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x5e2329;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x549c28=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x549c28,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x6eb0f0){const _0x47f25c=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x6eb0f0||i(_0x47f25c,'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 _0x27486c{['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[_0x442632,a,K,_0x4c00ef];}constructor(_0x5b779c){super(_0x5b779c),_0x5b779c['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x5b779c['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x5b779c['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x5b779c['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x39099d}=this;this['_aiAdapter']=_0x39099d['plugins']['get'](K),this['_dialog']=_0x39099d['plugins']['get'](_0x4c00ef),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x165394=new E(_0x39099d,Array['from'](this['_commandDefinitions']['values']()));_0x39099d['commands']['add']('showAIAssistant',_0x165394),_0x39099d['ui']['componentFactory']['add']('aiCommands',_0x3f839a=>{const _0x26e5f8=_0x451c66(_0x3f839a);return _0x26e5f8['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x26e5f8['buttonView']['set']({'label':i(_0x3f839a,'AI\x20Commands'),'icon':T,'tooltip':!0x0}),_0x26e5f8['on']('execute',_0x35199b=>this['_onExecute'](_0x35199b['source']['id'])),_0x2c7cf6(_0x26e5f8,_0x39099d['ui']['view']['body'],function(_0xe47aee){const _0x19b42e=o(_0xe47aee['config']['get']('ai.aiAssistant.commands'),_0xe47aee['locale']),_0x316c43=U(_0xe47aee,_0x19b42e)['filter'](_0x2df5be=>_0x2df5be['commands']['length']);if(0x1===_0x316c43['length'])return U(_0xe47aee,_0x316c43[0x0]['commands'])['map'](_0xb052de=>({'id':_0xb052de['id'],'label':_0xb052de['label']}));return _0x316c43['map'](_0x17faff=>{const {groupId:_0x5a96e6,groupLabel:_0x5203e5,commands:_0x2b4ea0}=_0x17faff,_0x1c6956=U(_0xe47aee,_0x2b4ea0)['map'](_0x53f308=>({'id':_0x53f308['id'],'label':_0x53f308['label']}));return{'id':_0x5a96e6,'menu':_0x5203e5||_0x5a96e6,'children':_0x1c6956};});}(_0x39099d),{'ariaLabel':i(_0x3f839a,'AI\x20Commands')}),_0x26e5f8['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x165394['on']('change:enabledCommandsIds',_0x2c6d5b),_0x26e5f8['menuView']['once']('render',_0x2c6d5b),_0x26e5f8;function _0x2c6d5b(){_0x26e5f8['isEnabled']=_0x165394['enabledCommandsIds']['length']>0x0;for(const _0x1d7853 of _0x26e5f8['menuView']['buttons'])_0x1d7853['isEnabled']=_0x165394['enabledCommandsIds']['includes'](_0x1d7853['id']);}}),_0x39099d['ui']['componentFactory']['add']('menuBar:aiCommands',_0x25aa0b=>{const _0x2e142b=new _0x254b7e(_0x25aa0b);_0x2e142b['buttonView']['set']({'label':i(_0x25aa0b,'AI\x20Commands'),'icon':T}),_0x2e142b['bind']('isEnabled')['to'](_0x165394,'enabledCommandsIds',_0x3404de=>_0x3404de['length']>0x0);const _0x3825fb=o(_0x39099d['config']['get']('ai.aiAssistant.commands'),_0x25aa0b);return this['_populateMenuBarMenu'](_0x165394,_0x2e142b,_0x3825fb,_0x3047d8=>this['_onExecute'](_0x3047d8)),_0x2e142b;}),_0x39099d['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x34e873=this['_createAIAssistantUIButton'](_0x2db9b8);return _0x34e873['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x34e873;}),_0x39099d['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x3d1d05=this['_createAIAssistantUIButton'](_0x5c92b9);return _0x3d1d05['set']({'role':'menuitemcheckbox'}),_0x3d1d05;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x3d6ff4=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x39afab;for(const _0x497413 in _0x3d6ff4){const _0x364f30=_0x497413,_0x119eb3=_0x3d6ff4[_0x364f30];if('aiLicenseKeyValid'==_0x119eb3||'aiLicenseKeyInvalid'==_0x119eb3||'aiLicenseKeyExpired'==_0x119eb3||'aiLicenseKeyDomainLimit'==_0x119eb3||'aiLicenseKeyNotAllowed'==_0x119eb3||'aiLicenseKeyEvaluationLimit'==_0x119eb3||'aiLicenseKeyTrialLimit'==_0x119eb3||'aiLicenseKeyUsageLimit'==_0x119eb3){delete _0x3d6ff4[_0x364f30],_0x39afab=_0x119eb3,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x39afab&&_0x3d6ff4['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x39afab&&_0x3d6ff4['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x39afab&&_0x3d6ff4['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x39afab&&_0x3d6ff4['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x39afab&&_0x3d6ff4['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x39afab&&_0x3d6ff4['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x39afab&&_0x3d6ff4['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x2c9487='',_0x2aa02c='',_0x241144='custom'){const _0x1dfd5b=this['editor'],_0x5b9ea9=_0x1dfd5b['editing']['view'],_0x382651=_0x1dfd5b['plugins']['get'](a),_0x393fdb=_0x1dfd5b['plugins']['get'](_0x442632);_0x382651['showFakeVisualSelection']();const _0x576b61=new w(),_0x5b21b3=new ClipboardEvent('copy',{'clipboardData':_0x576b61}),_0x97bd2d=new _0x53539e(_0x576b61),_0x240f41=new _0x534b5e(_0x5b9ea9,_0x5b21b3,{'dataTransfer':_0x97bd2d});_0x393fdb['_forceMarkersCopy']('comment',()=>{_0x5b9ea9['document']['fire']('copy',_0x240f41);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x1dfd5b,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x25fc2b=_0x97bd2d['getData']('text/html');const _0x486b50=_0x1dfd5b['model']['document']['selection'],_0x575a86=Array['from'](_0x486b50['getRanges']());0x1===_0x575a86['length']&&_0x575a86[0x0]['isFlat']&&!_0x486b50['getSelectedElement']()&&''!==_0x25fc2b['replace'](/&nbsp;/g,'')['trim']()&&(_0x25fc2b='<p>'+_0x25fc2b+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x241144,'query':_0x2c9487,'htmlContent':_0x25fc2b,'label':_0x2aa02c,'mainActionLabel':M[_0x1dfd5b['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':_0x683f5e['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x382651['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x53e495=new Map(),_0x8b39ed=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x789f58 of _0x8b39ed)for(const _0x222b07 of _0x789f58['commands'])_0x53e495['set'](_0x222b07['id'],{..._0x222b07,'groupId':_0x789f58['groupId'],'groupLabel':_0x789f58['groupLabel']||_0x789f58['groupId']});return _0x53e495;}['_createAIAssistantUIButton'](_0x1513a1){const _0x16702a=this['editor'],_0x254792=_0x16702a['commands']['get']('showAIAssistant'),_0x40e034=new _0x1513a1(_0x16702a['locale']);return _0x40e034['set']({'label':i(_0x16702a['locale'],'AI\x20Assistant'),'icon':ct['robotPencil'],'isToggleable':!0x0}),_0x40e034['bind']('isEnabled')['to'](_0x254792),_0x40e034['bind']('isOn')['to'](this['_dialog'],'id',_0x31ba34=>'aiAssistant'===_0x31ba34),this['listenTo'](_0x40e034,'execute',()=>{_0x40e034['isOn']?this['hideUI']():_0x254792['execute']();}),_0x40e034;}['_initView'](){const _0x3fe60a=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',()=>{_0x3fe60a['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x3fe60a['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x24b4a5,ui:{ariaLiveAnnouncer:_0x3ae63e}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x51d1f2,_0x571811,_0x170c5f)=>{const _0x363b96=this['_aiAssistantController']['currentContext'];_0x170c5f?_0x3ae63e['announce'](i(_0x24b4a5,'AI\x20is\x20writing')):_0x363b96&&_0x3ae63e['announce'](i(_0x24b4a5,'Generated\x20content:\x20%0',_0x363b96),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x3e01c8,_0x20664e,_0x5098c6)=>{if(_0x5098c6){const _0x532bcc=this['_formView']['errorView']['text'];_0x3ae63e['announce'](i(_0x24b4a5,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x532bcc));}});}['_onExecute'](_0x8fa9fe){const _0x1839f9=this['_commandDefinitions']['get'](_0x8fa9fe),_0x177024=this['editor'],_0x39457a=_0x177024['model']['document']['selection'],_0x592c23=_0x177024['commands']['get']('showAIAssistant'),_0x2bc62b=_0x177024['plugins']['get'](a),_0x4b39c4=''+(_0x1839f9['groupId']!==x?_0x1839f9['groupLabel']+':\x20':'')+_0x1839f9['label'];if(!0x1!==_0x1839f9['requiresContent']&&_0x39457a['isCollapsed']){const _0x3f9594=_0x5b090a(_0x39457a['getSelectedBlocks']())||_0x177024['model']['schema']['getLimitElement'](_0x39457a);_0x177024['model']['change'](_0x2e3748=>{_0x2e3748['setSelection'](_0x3f9594,'in');});}_0x2bc62b['showFakeVisualSelection'](),_0x592c23['execute'](_0x1839f9['prompt'],_0x4b39c4,'command:'+_0x8fa9fe);}['_populateMenuBarMenu'](_0x3c895d,_0x581997,_0x1b01d2,_0x53ad03){const _0x2e519e=this['editor'],_0xa67302=_0x2e519e['locale'],_0x1870ea=new _0x136b00(_0xa67302),_0x213007=U(_0x2e519e,_0x1b01d2)['filter'](_0x233f27=>_0x233f27['commands']['length']);0x1===_0x213007['length']?this['_getMenuBarGroupButtons']({'command':_0x3c895d,'commands':_0x213007[0x0]['commands'],'parentMenuView':_0x581997,'onExecute':_0x53ad03})['forEach'](_0x193f45=>_0x1870ea['items']['add'](_0x193f45)):_0x213007['forEach'](({groupId:_0x3cb91b,groupLabel:_0x4ab414,commands:_0x13d546})=>{const _0x3be039=new _0x3eb7a9(_0xa67302,_0x581997),_0x50273d=new _0x254b7e(_0xa67302),_0x13b17c=new _0x136b00(_0xa67302),_0x55ac55=this['_getMenuBarGroupButtons']({'command':_0x3c895d,'commands':_0x13d546,'parentMenuView':_0x50273d,'onExecute':_0x53ad03});_0x50273d['buttonView']['set']({'label':_0x4ab414||_0x3cb91b}),_0x50273d['delegate']('execute')['to'](_0x581997),_0x13b17c['items']['addMany'](_0x55ac55),_0x50273d['panelView']['children']['add'](_0x13b17c),_0x3be039['children']['add'](_0x50273d),_0x1870ea['items']['add'](_0x3be039);}),_0x581997['panelView']['children']['add'](_0x1870ea);}['_getMenuBarGroupButtons']({command:_0x1e26ae,commands:_0x45f8f4,parentMenuView:_0x591cb4,onExecute:_0xa91cfb}){const _0x27c8d8=this['editor'],_0x6315d=_0x27c8d8['locale'];return U(_0x27c8d8,_0x45f8f4)['map'](_0x589223=>{const _0xb9a49e=new _0x3eb7a9(_0x6315d,_0x591cb4),_0xdb8ce9=new _0x5c92b9(_0x6315d);return _0xdb8ce9['set']({'label':_0x589223['label']}),_0xdb8ce9['delegate']('execute')['to'](_0x591cb4),_0xdb8ce9['on']('execute',()=>_0xa91cfb(_0x589223['id'])),_0xdb8ce9['bind']('isEnabled')['to'](_0x1e26ae,'enabledCommandsIds',_0x63406c=>_0x63406c['includes'](_0x589223['id'])),_0xb9a49e['children']['add'](_0xdb8ce9),_0xb9a49e;});}}function B(_0x3145cd,_0x2a64c9){return void 0x0!==_0x3145cd['order']&&void 0x0===_0x2a64c9['order']?0x1:void 0x0===_0x3145cd['order']&&void 0x0!==_0x2a64c9['order']?-0x1:void 0x0!==_0x3145cd['order']&&void 0x0!==_0x2a64c9['order']?_0x3145cd['order']-_0x2a64c9['order']:0x0;}function U(_0x56b88e,_0x1b60f8){_0x1b60f8['sort'](B);const _0x51a47a={},_0x4823d7=[];for(const _0xf35223 of _0x1b60f8)if(void 0x0!==_0xf35223['order']){if(_0xf35223['order']in _0x51a47a)throw new _0x1cbeec('ai-commands-config-order-collision',_0x56b88e,{'conflictingDefinitions':[_0xf35223,_0x51a47a[_0xf35223['order']]]});_0x51a47a[_0xf35223['order']]=_0xf35223,_0x4823d7['splice'](_0xf35223['order'],0x0,_0xf35223);}else _0x4823d7['push'](_0xf35223);return _0x4823d7;}class r extends _0x27486c{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xeefc69){super(_0xeefc69);const _0x1db639=_0xeefc69['config'],_0x5ea97e=_0xeefc69['locale'];_0x1db639['define']('ai.aiAssistant.preserveComments',!0x0),_0x1db639['define']('ai.aiAssistant.commands',function(_0x2f8ba5){return[{'groupId':'editOrReview','groupLabel':i(_0x2f8ba5,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x2f8ba5,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x2f8ba5,'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(_0x2f8ba5,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x2f8ba5,'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(_0x2f8ba5,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x2f8ba5,'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(_0x2f8ba5,'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(_0x2f8ba5,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x2f8ba5,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x2f8ba5,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x2f8ba5,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x2f8ba5,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x2f8ba5,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x2f8ba5,'Change\x20style'),'commands':[{'id':'business','label':i(_0x2f8ba5,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x2f8ba5,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x2f8ba5,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x2f8ba5,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x2f8ba5,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x2f8ba5,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x2f8ba5,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x2f8ba5,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x2f8ba5,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x2f8ba5,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x2f8ba5,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x2f8ba5,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x2f8ba5,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x5ea97e)),_0x1db639['define']('ai.aiAssistant.extraCommandGroups',[]),_0x1db639['define']('ai.aiAssistant.removeCommands',[]);let _0x2e266e=o(_0x1db639['get']('ai.aiAssistant.commands'),_0x5ea97e);const _0x130b56=_0x1db639['get']('ai.aiAssistant.extraCommandGroups'),_0x565a66=_0x1db639['get']('ai.aiAssistant.removeCommands');_0x130b56['forEach'](_0x205e2a=>{const _0x1ef21d=_0x2e266e['find'](_0x1207a9=>_0x1207a9['groupId']===_0x205e2a['groupId']);_0x1ef21d?_0x1ef21d['commands']=_0x1ef21d['commands']['concat'](_0x205e2a['commands']):_0x2e266e['push'](_0x205e2a);}),_0x2e266e=_0x2e266e['filter'](_0x58f9e8=>!_0x565a66['includes'](_0x58f9e8['groupId'])),_0x2e266e['forEach'](_0x50fffc=>{_0x50fffc['commands']=_0x50fffc['commands']['filter'](_0x4ab14f=>!_0x565a66['includes'](_0x4ab14f['id']));}),_0x1db639['set']('ai.aiAssistant.commands',_0x2e266e);}}class P extends _0x27486c{['abortController'];static get['requires'](){return[K];}constructor(_0x117a58){super(_0x117a58),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'](_0x552124){return this['sendRequest'](_0x552124)['catch'](_0x34b39f=>{if(_0x34b39f instanceof R)return Promise['reject'](_0x34b39f);if('AbortError'==_0x34b39f['name'])return Promise['resolve']();throw console['error'](_0x34b39f),new _0x1cbeec('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x1418da,_0x44e7c4){const _0x11e138=this['editor']['locale'],_0x16ab59={'Content-Type':'application/json'};if('object'==typeof _0x1418da)Object['assign'](_0x16ab59,_0x1418da);else{if(_0x1418da)try{const _0x4f7e36=await _0x1418da(_0x44e7c4);Object['assign'](_0x16ab59,_0x4f7e36);}catch(_0x199899){return Promise['reject'](new R(i(_0x11e138,'AI_ERROR_GET_HEADERS')));}}return _0x16ab59;}async['_prepareRequestParameters'](_0x19caa8,_0x1de81c){const _0x1d8c02=this['editor']['locale'];if('object'==typeof _0x19caa8)return _0x19caa8;try{return await _0x19caa8(_0x1de81c);}catch(_0x5bf116){return Promise['reject'](new R(i(_0x1d8c02,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x46ba33){super(_0x46ba33),_0x46ba33['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x46ba33['config']['get']('ai.openAI.requestParameters')||_0x46ba33['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x46ba33['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x46ba33['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x46ba33['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x544b18,context:_0x5644b4,onData:_0x315e78,actionId:_0x34cb01}){const _0x5a98b4=this['editor']['locale'],_0x28d375=await this['prepareMessages'](_0x544b18,_0x5644b4,_0x34cb01),_0x576cee=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x34cb01),_0x59d94a=await this['_prepareRequestParameters'](this['_requestParameters'],_0x34cb01),_0x480b47={'messages':_0x28d375,..._0x59d94a},_0x3ee534={'method':'POST','headers':_0x576cee,'body':JSON['stringify'](_0x480b47),'signal':this['abortController']['signal']},_0x5c5791=await fetch(this['_apiUrl'],_0x3ee534);if(_0x5c5791['ok'])return _0x59d94a['stream']?await this['_readStreamableResponse'](_0x5c5791,_0x315e78):await this['_readStaticResponse'](_0x5c5791,_0x315e78),Promise['resolve']();{const _0x46f4d2=await _0x5c5791['text']();return _0x46f4d2['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x5a98b4,'AI_ERROR_CONTEXT_LENGTH'))):_0x46f4d2['includes']('Moderation')?Promise['reject'](new R(i(_0x5a98b4,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x46f4d2));}}async['prepareMessages'](_0x3b901d,_0x390920,_0xc040d3){let _0x2a0591,_0x5d9251;return _0x390920?(_0x2a0591='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.',_0x5d9251='Instruction:\x0a'+_0x3b901d+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x390920):(_0x2a0591='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.',_0x5d9251=_0x3b901d),[{'role':'system','content':_0x2a0591},{'role':'user','content':_0x5d9251}];}async['_readStreamableResponse'](_0x3c8dfd,_0x342f31){const _0x3560d1=_0x3c8dfd['body']['getReader'](),_0x2f22a4=new TextDecoder();let _0x26b4b3='',_0x50c240='',_0x108391='',_0x323545=!0x1;for(;!_0x323545;){const {done:_0xe1e274,value:_0x13495a}=await _0x3560d1['read'](),_0x2f50b3=_0x26b4b3+_0x2f22a4['decode'](_0x13495a);let _0x3185dd='';_0x323545=_0xe1e274;try{_0x3185dd=this['_cleanUpData'](_0x2f50b3),_0x26b4b3='';}catch(_0x59ffa5){_0x26b4b3=_0x2f50b3;continue;}_0x50c240+=_0x3185dd,!_0x323545&&this['_isBufferIncomplete'](_0x50c240)||_0x50c240&&(_0x108391+=_0x50c240,_0x50c240='',_0x342f31(_0x108391));}return Promise['resolve']();}async['_readStaticResponse'](_0x6ba819,_0x580738){return _0x580738((await _0x6ba819['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x281ced){const _0x761bbf=_0x281ced['split']('<')['length']!==_0x281ced['split']('>')['length'],_0x4c1e93=_0x281ced['length']<0x1e;return _0x761bbf&&_0x4c1e93;}['_cleanUpData'](_0x2844bd){return _0x2844bd['split'](/\n(?![^{]*\})/g)['map'](_0x860389=>_0x860389['replace']('data:\x20',''))['filter'](_0x336d4b=>_0x336d4b&&_0x336d4b['length']>0x0&&'[DONE]'!==_0x336d4b)['map'](_0x39960f=>{const {choices:_0x35d2a1}=JSON['parse'](_0x39960f);if(_0x35d2a1[0x0]&&_0x35d2a1[0x0]['delta']&&_0x35d2a1[0x0]['delta']['content'])return _0x35d2a1[0x0]['delta']['content'];})['filter'](_0x46fca1=>_0x46fca1)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x56ad57){super(_0x56ad57),_0x56ad57['config']['get']('ai.aws.requestParameters')||_0x56ad57['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']=_0x56ad57['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x56ad57['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x56ad57['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x56ad57['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x2a5a69,context:_0x521466,onData:_0x97f464,actionId:_0x50778a}){const {model:_0x41583d,stream:_0x343d10,..._0x42f794}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x50778a),_0x3af76a={'prompt':await this['preparePrompt'](_0x2a5a69,_0x521466,_0x41583d,_0x50778a),..._0x42f794};this['_apiUrl']?await this['_processProxyRequest'](_0x3af76a,_0x41583d,_0x343d10,_0x97f464,_0x50778a):await this['_processAWSRequest'](_0x3af76a,_0x41583d,_0x343d10,_0x97f464);}async['preparePrompt'](_0x515a89,_0x49e43e,_0x5dccfb,_0x2e4092){let _0x42ce23,_0x2847d8;return _0x49e43e?(_0x42ce23='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.',_0x2847d8='Instruction:\x0a'+_0x515a89+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x49e43e):(_0x42ce23='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.',_0x2847d8=_0x515a89),'meta.llama'==this['getModelFamily'](_0x5dccfb)?'<<SYS>>\x0a'+_0x42ce23+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x2847d8+'\x0a[/INST]':'Human:\x0a'+_0x42ce23+'\x0a'+_0x2847d8+'\x0a\x0aAssistant:';}['getModelFamily'](_0x521c4b){if(/^anthropic\.claude/['test'](_0x521c4b))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x521c4b))return'ai21.j2';if(/^cohere\.command/['test'](_0x521c4b))return'cohere.command';if(/^meta\.llama/['test'](_0x521c4b))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x521c4b));}async['_processProxyRequest'](_0x201a8f,_0x1d6663,_0x36fa69,_0x316c61,_0x35a065){const _0x383b4d={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x35a065),'body':JSON['stringify']({..._0x201a8f,'model':_0x1d6663,'stream':_0x36fa69}),'signal':this['abortController']['signal']},_0x4eb9e6=await fetch(this['_apiUrl'],_0x383b4d);_0x36fa69?await this['_readStreamableResponse'](_0x4eb9e6,_0x1d6663,_0x316c61):await this['_readStaticResponse'](_0x4eb9e6,_0x1d6663,_0x316c61);}async['_processAWSRequest'](_0x4dd374,_0x40c470,_0x484bbc,_0x6713d3){const _0x579730=new _0x1b56c8(this['_bedrockClientConfig']),_0x794ea9={'body':JSON['stringify'](_0x4dd374),'contentType':'application/json','accept':'application/json','modelId':_0x40c470};let _0x4b6d65;if(_0x484bbc){const _0x12d099=new _0xf6c04c(_0x794ea9);_0x4b6d65=await _0x579730['send'](_0x12d099,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x4b6d65,_0x40c470,_0x6713d3);}else{const _0x161718=new _0x369233(_0x794ea9);_0x4b6d65=await _0x579730['send'](_0x161718,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x4b6d65,_0x40c470,_0x6713d3);}}async['_readAsyncIterableResponse'](_0x31a471,_0x1c3a61,_0xbd2c9c){const _0x301efe=_0x31a471['body'],_0x476e56=new TextDecoder('utf-8');let _0x5d2245='';for await(const _0x27d005 of _0x301efe)if(_0x27d005['chunk']){const _0x10ac91=_0x476e56['decode'](_0x27d005['chunk']['bytes']),_0x562631=JSON['parse'](_0x10ac91);_0x5d2245+=this['_getGeneratedText'](_0x562631,_0x1c3a61),_0xbd2c9c(_0x5d2245);}return Promise['resolve']();}async['_readStreamableResponse'](_0x49e88f,_0x2b7ed1,_0x5866a6){const _0x1daf21=_0x49e88f['body'],_0x158a74=new TextDecoder('utf-8'),_0x20d09e=_0x1daf21['getReader']();let _0x1448e4='',_0x45da5b='',_0x2b154b=!0x1;for(;!_0x2b154b;){const {done:_0x2623a8,value:_0x583649}=await _0x20d09e['read']();if(_0x2b154b=_0x2623a8,_0x2b154b)break;const _0x1c7c2e=(_0x1448e4+_0x158a74['decode'](_0x583649))['split']('\x0a')['map'](_0x1e587f=>{try{return _0x1448e4='',JSON['parse'](_0x1e587f);}catch(_0x4293bb){return _0x1448e4=_0x1e587f,null;}})['filter'](_0x49ce32=>null!==_0x49ce32);_0x1c7c2e['length']&&(_0x45da5b+=_0x1c7c2e['map'](_0x10c920=>this['_getGeneratedText'](_0x10c920,_0x2b7ed1))['join'](''),_0x5866a6(_0x45da5b));}return Promise['resolve']();}async['_readStaticResponse'](_0x390408,_0x1124ae,_0x3515c4){let _0x3722c4;return _0x3722c4=_0x390408 instanceof Response?await _0x390408['json']():JSON['parse'](Buffer['from'](_0x390408['body'])['toString']('utf8')),(_0x3515c4(this['_getGeneratedText'](_0x3722c4,_0x1124ae)),Promise['resolve']());}['_getGeneratedText'](_0xf3859d,_0x291cb0){switch(this['getModelFamily'](_0x291cb0)){case'anthropic.claude':return _0xf3859d['completion'];case'ai21.j2':return _0xf3859d['completions'][0x0]['data']['text'];case'cohere.command':return _0xf3859d['generations'][0x0]['text'];case'meta.llama':return _0xf3859d['generation'];}}}export{K as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,O as AWSTextAdapter,H as OpenAITextAdapter};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- export default{'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':_0x1eb449=>0x1!=_0x1eb449}};
23
+ export default{'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':_0x15a698=>0x1!=_0x15a698}};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- (_0x1118c3=>{const {af:{dictionary:_0x4df2ad,getPluralForm:_0x2e6cc1}}={'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':_0x19bb30=>0x1!=_0x19bb30}};_0x1118c3['af']||={'dictionary':{},'getPluralForm':null},_0x1118c3['af']['dictionary']=Object['assign'](_0x1118c3['af']['dictionary'],_0x4df2ad),_0x1118c3['af']['getPluralForm']=_0x2e6cc1;})(window['CKEDITOR_TRANSLATIONS']||={});
23
+ (_0x555e52=>{const {af:{dictionary:_0x393eea,getPluralForm:_0x2651d0}}={'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':_0x19a526=>0x1!=_0x19a526}};_0x555e52['af']||={'dictionary':{},'getPluralForm':null},_0x555e52['af']['dictionary']=Object['assign'](_0x555e52['af']['dictionary'],_0x393eea),_0x555e52['af']['getPluralForm']=_0x2651d0;})(window['CKEDITOR_TRANSLATIONS']||={});
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- export default{'ar':{'dictionary':{'Edit\x20or\x20review':'التحرير\x20أو\x20المراجعة','Improve\x20writing':'قم\x20بتحسين\x20الكتابة','Make\x20shorter':'اجعله\x20أقصر','Make\x20longer':'اجعله\x20أطول','Simplify\x20language':'قم\x20بتبسيط\x20اللغة','Generate\x20from\x20selection':'قم\x20بالإنشاء\x20من\x20التحديد','Summarize':'تلخيص','Continue':'متابعة','Change\x20tone':'تغيير\x20الأسلوب','Professional':'احترافي','Casual':'غير\x20رسمي','Direct':'مباشر','Confident':'لهجة\x20واثقة','Friendly':'ودي','Change\x20style':'تغيير\x20الأسلوب','Business':'تجاري','Legal':'قانوني','Journalism':'الكتابة\x20الصحفية','Poetic':'شِعري','Translate':'ترجِمْ','English':'الإنكليزية','Spanish':'الإسبانية','German':'الألمانية','Portuguese':'البرتغالية','French':'الفرنسية','Simplified\x20Chinese':'الصينية\x20المبسطة','Hindi':'الهندية','Arabic':'العربية','AI\x20Assistant':'مساعد\x20الذكاء\x20الاصطناعي','AI\x20Commands':'أوامر\x20الذكاء\x20الاصطناعي','Ask\x20AI\x20to\x20edit\x20or\x20generate':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بالتحرير\x20أو\x20الإنشاء','Ask\x20AI\x20to\x20improve\x20generated\x20text':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بتحسين\x20النص\x20الذي\x20تم\x20إنشاؤه','Copy':'نسخ','Submit':'إرسال','Insert\x20below':'أدخل\x20أدناه','Try\x20again':'حاول\x20مجددًا','Stop':'إيقاف','AI\x20is\x20writing...':'يقوم\x20الذكاء\x20الاصطناعي\x20بالكتابة...','AI\x20is\x20writing':'يكتب\x20الذكاء\x20الاصطناعي','Generated\x20content:\x20%0':'المحتوى\x20الذي\x20تم\x20إنشاؤه:\x20%0','Error\x20during\x20AI\x20content\x20generation:\x20%0':'حدث\x20خطأ\x20أثناء\x20إنشاء\x20محتوى\x20الذكاء\x20الاصطناعي:\x20%0','History':'سجل\x20المحفوظات','Empty\x20history':'السجل\x20فارغ','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'سيتم\x20إدراج\x20الطلبات\x20التي\x20طلبتها\x20من\x20الذكاء\x20الاصطناعي\x20والتوجيهات\x20الخاصة\x20بك\x20هنا\x20لكي\x20يتم\x20استخدامها\x20لاحقًا.','Prompt\x20history':'سجل\x20التوجيهات','AI_REPLACE_CONTENT':'استبدال','AI_INSERT_CONTENT':'إدراج','AI_ERROR_GET_HEADERS':'فشلت\x20عملية\x20تحضير\x20عناوين\x20الطلبات','AI_ERROR_GET_PARAMETERS':'لقد\x20فشلت\x20عملية\x20إعداد\x20معلمات\x20الطلب','AI_ERROR_UNSUPPORTED_MODEL':'إن\x20نموذج\x20AI\x20المطلوب\x20(\x22%0\x22)\x20غير\x20مدعوم','AI_ERROR_CONTEXT_LENGTH':'المحتوى\x20المحدد\x20طويل\x20جداً','AI_ERROR_MODERATION':'الاستعلام\x20المطلوب\x20لا\x20يجتاز\x20قواعد\x20الإشراف','AI_ERROR_FAILED':'لقد\x20فشل\x20التواصل\x20مع\x20خدمة\x20الذكاء\x20الاصطناعي','Other':'آخر'},'getPluralForm':_0x46819d=>0x0==_0x46819d?0x0:0x1==_0x46819d?0x1:0x2==_0x46819d?0x2:_0x46819d%0x64>=0x3&&_0x46819d%0x64<=0xa?0x3:_0x46819d%0x64>=0xb?0x4:0x5}};
23
+ export default{'ar':{'dictionary':{'Edit\x20or\x20review':'التحرير\x20أو\x20المراجعة','Improve\x20writing':'قم\x20بتحسين\x20الكتابة','Make\x20shorter':'اجعله\x20أقصر','Make\x20longer':'اجعله\x20أطول','Simplify\x20language':'قم\x20بتبسيط\x20اللغة','Generate\x20from\x20selection':'قم\x20بالإنشاء\x20من\x20التحديد','Summarize':'تلخيص','Continue':'متابعة','Change\x20tone':'تغيير\x20الأسلوب','Professional':'احترافي','Casual':'غير\x20رسمي','Direct':'مباشر','Confident':'لهجة\x20واثقة','Friendly':'ودي','Change\x20style':'تغيير\x20الأسلوب','Business':'تجاري','Legal':'قانوني','Journalism':'الكتابة\x20الصحفية','Poetic':'شِعري','Translate':'ترجِمْ','English':'الإنكليزية','Spanish':'الإسبانية','German':'الألمانية','Portuguese':'البرتغالية','French':'الفرنسية','Simplified\x20Chinese':'الصينية\x20المبسطة','Hindi':'الهندية','Arabic':'العربية','AI\x20Assistant':'مساعد\x20الذكاء\x20الاصطناعي','AI\x20Commands':'أوامر\x20الذكاء\x20الاصطناعي','Ask\x20AI\x20to\x20edit\x20or\x20generate':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بالتحرير\x20أو\x20الإنشاء','Ask\x20AI\x20to\x20improve\x20generated\x20text':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بتحسين\x20النص\x20الذي\x20تم\x20إنشاؤه','Copy':'نسخ','Submit':'إرسال','Insert\x20below':'أدخل\x20أدناه','Try\x20again':'حاول\x20مجددًا','Stop':'إيقاف','AI\x20is\x20writing...':'يقوم\x20الذكاء\x20الاصطناعي\x20بالكتابة...','AI\x20is\x20writing':'يكتب\x20الذكاء\x20الاصطناعي','Generated\x20content:\x20%0':'المحتوى\x20الذي\x20تم\x20إنشاؤه:\x20%0','Error\x20during\x20AI\x20content\x20generation:\x20%0':'حدث\x20خطأ\x20أثناء\x20إنشاء\x20محتوى\x20الذكاء\x20الاصطناعي:\x20%0','History':'سجل\x20المحفوظات','Empty\x20history':'السجل\x20فارغ','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'سيتم\x20إدراج\x20الطلبات\x20التي\x20طلبتها\x20من\x20الذكاء\x20الاصطناعي\x20والتوجيهات\x20الخاصة\x20بك\x20هنا\x20لكي\x20يتم\x20استخدامها\x20لاحقًا.','Prompt\x20history':'سجل\x20التوجيهات','AI_REPLACE_CONTENT':'استبدال','AI_INSERT_CONTENT':'إدراج','AI_ERROR_GET_HEADERS':'فشلت\x20عملية\x20تحضير\x20عناوين\x20الطلبات','AI_ERROR_GET_PARAMETERS':'لقد\x20فشلت\x20عملية\x20إعداد\x20معلمات\x20الطلب','AI_ERROR_UNSUPPORTED_MODEL':'إن\x20نموذج\x20AI\x20المطلوب\x20(\x22%0\x22)\x20غير\x20مدعوم','AI_ERROR_CONTEXT_LENGTH':'المحتوى\x20المحدد\x20طويل\x20جداً','AI_ERROR_MODERATION':'الاستعلام\x20المطلوب\x20لا\x20يجتاز\x20قواعد\x20الإشراف','AI_ERROR_FAILED':'لقد\x20فشل\x20التواصل\x20مع\x20خدمة\x20الذكاء\x20الاصطناعي','Other':'آخر'},'getPluralForm':_0x3df35b=>0x0==_0x3df35b?0x0:0x1==_0x3df35b?0x1:0x2==_0x3df35b?0x2:_0x3df35b%0x64>=0x3&&_0x3df35b%0x64<=0xa?0x3:_0x3df35b%0x64>=0xb?0x4:0x5}};