@ckeditor/ckeditor5-ai 45.2.0 → 45.2.1-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) 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/be.js +1 -1
  12. package/dist/translations/be.umd.js +1 -1
  13. package/dist/translations/bg.js +1 -1
  14. package/dist/translations/bg.umd.js +1 -1
  15. package/dist/translations/bn.js +1 -1
  16. package/dist/translations/bn.umd.js +1 -1
  17. package/dist/translations/bs.js +1 -1
  18. package/dist/translations/bs.umd.js +1 -1
  19. package/dist/translations/ca.js +1 -1
  20. package/dist/translations/ca.umd.js +1 -1
  21. package/dist/translations/cs.js +1 -1
  22. package/dist/translations/cs.umd.js +1 -1
  23. package/dist/translations/da.js +1 -1
  24. package/dist/translations/da.umd.js +1 -1
  25. package/dist/translations/de-ch.js +1 -1
  26. package/dist/translations/de-ch.umd.js +1 -1
  27. package/dist/translations/de.js +1 -1
  28. package/dist/translations/de.umd.js +1 -1
  29. package/dist/translations/el.js +1 -1
  30. package/dist/translations/el.umd.js +1 -1
  31. package/dist/translations/en-au.js +1 -1
  32. package/dist/translations/en-au.umd.js +1 -1
  33. package/dist/translations/en-gb.js +1 -1
  34. package/dist/translations/en-gb.umd.js +1 -1
  35. package/dist/translations/en.js +1 -1
  36. package/dist/translations/en.umd.js +1 -1
  37. package/dist/translations/eo.js +1 -1
  38. package/dist/translations/eo.umd.js +1 -1
  39. package/dist/translations/es-co.js +1 -1
  40. package/dist/translations/es-co.umd.js +1 -1
  41. package/dist/translations/es.js +1 -1
  42. package/dist/translations/es.umd.js +1 -1
  43. package/dist/translations/et.js +1 -1
  44. package/dist/translations/et.umd.js +1 -1
  45. package/dist/translations/eu.js +1 -1
  46. package/dist/translations/eu.umd.js +1 -1
  47. package/dist/translations/fa.js +1 -1
  48. package/dist/translations/fa.umd.js +1 -1
  49. package/dist/translations/fi.js +1 -1
  50. package/dist/translations/fi.umd.js +1 -1
  51. package/dist/translations/fr.js +1 -1
  52. package/dist/translations/fr.umd.js +1 -1
  53. package/dist/translations/gl.js +1 -1
  54. package/dist/translations/gl.umd.js +1 -1
  55. package/dist/translations/gu.js +1 -1
  56. package/dist/translations/gu.umd.js +1 -1
  57. package/dist/translations/he.js +1 -1
  58. package/dist/translations/he.umd.js +1 -1
  59. package/dist/translations/hi.js +1 -1
  60. package/dist/translations/hi.umd.js +1 -1
  61. package/dist/translations/hr.js +1 -1
  62. package/dist/translations/hr.umd.js +1 -1
  63. package/dist/translations/hu.js +1 -1
  64. package/dist/translations/hu.umd.js +1 -1
  65. package/dist/translations/hy.js +1 -1
  66. package/dist/translations/hy.umd.js +1 -1
  67. package/dist/translations/id.js +1 -1
  68. package/dist/translations/id.umd.js +1 -1
  69. package/dist/translations/it.js +1 -1
  70. package/dist/translations/it.umd.js +1 -1
  71. package/dist/translations/ja.js +1 -1
  72. package/dist/translations/ja.umd.js +1 -1
  73. package/dist/translations/jv.js +1 -1
  74. package/dist/translations/jv.umd.js +1 -1
  75. package/dist/translations/kk.js +1 -1
  76. package/dist/translations/kk.umd.js +1 -1
  77. package/dist/translations/km.js +1 -1
  78. package/dist/translations/km.umd.js +1 -1
  79. package/dist/translations/kn.js +1 -1
  80. package/dist/translations/kn.umd.js +1 -1
  81. package/dist/translations/ko.js +1 -1
  82. package/dist/translations/ko.umd.js +1 -1
  83. package/dist/translations/ku.js +1 -1
  84. package/dist/translations/ku.umd.js +1 -1
  85. package/dist/translations/lt.js +1 -1
  86. package/dist/translations/lt.umd.js +1 -1
  87. package/dist/translations/lv.js +1 -1
  88. package/dist/translations/lv.umd.js +1 -1
  89. package/dist/translations/ms.js +1 -1
  90. package/dist/translations/ms.umd.js +1 -1
  91. package/dist/translations/nb.js +1 -1
  92. package/dist/translations/nb.umd.js +1 -1
  93. package/dist/translations/ne.js +1 -1
  94. package/dist/translations/ne.umd.js +1 -1
  95. package/dist/translations/nl.js +1 -1
  96. package/dist/translations/nl.umd.js +1 -1
  97. package/dist/translations/no.js +1 -1
  98. package/dist/translations/no.umd.js +1 -1
  99. package/dist/translations/oc.js +1 -1
  100. package/dist/translations/oc.umd.js +1 -1
  101. package/dist/translations/pl.js +1 -1
  102. package/dist/translations/pl.umd.js +1 -1
  103. package/dist/translations/pt-br.js +1 -1
  104. package/dist/translations/pt-br.umd.js +1 -1
  105. package/dist/translations/pt.js +1 -1
  106. package/dist/translations/pt.umd.js +1 -1
  107. package/dist/translations/ro.js +1 -1
  108. package/dist/translations/ro.umd.js +1 -1
  109. package/dist/translations/ru.js +1 -1
  110. package/dist/translations/ru.umd.js +1 -1
  111. package/dist/translations/si.js +1 -1
  112. package/dist/translations/si.umd.js +1 -1
  113. package/dist/translations/sk.js +1 -1
  114. package/dist/translations/sk.umd.js +1 -1
  115. package/dist/translations/sl.js +1 -1
  116. package/dist/translations/sl.umd.js +1 -1
  117. package/dist/translations/sq.js +1 -1
  118. package/dist/translations/sq.umd.js +1 -1
  119. package/dist/translations/sr-latn.js +1 -1
  120. package/dist/translations/sr-latn.umd.js +1 -1
  121. package/dist/translations/sr.js +1 -1
  122. package/dist/translations/sr.umd.js +1 -1
  123. package/dist/translations/sv.js +1 -1
  124. package/dist/translations/sv.umd.js +1 -1
  125. package/dist/translations/th.js +1 -1
  126. package/dist/translations/th.umd.js +1 -1
  127. package/dist/translations/ti.js +1 -1
  128. package/dist/translations/ti.umd.js +1 -1
  129. package/dist/translations/tk.js +1 -1
  130. package/dist/translations/tk.umd.js +1 -1
  131. package/dist/translations/tr.js +1 -1
  132. package/dist/translations/tr.umd.js +1 -1
  133. package/dist/translations/tt.js +1 -1
  134. package/dist/translations/tt.umd.js +1 -1
  135. package/dist/translations/ug.js +1 -1
  136. package/dist/translations/ug.umd.js +1 -1
  137. package/dist/translations/uk.js +1 -1
  138. package/dist/translations/uk.umd.js +1 -1
  139. package/dist/translations/ur.js +1 -1
  140. package/dist/translations/ur.umd.js +1 -1
  141. package/dist/translations/uz.js +1 -1
  142. package/dist/translations/uz.umd.js +1 -1
  143. package/dist/translations/vi.js +1 -1
  144. package/dist/translations/vi.umd.js +1 -1
  145. package/dist/translations/zh-cn.js +1 -1
  146. package/dist/translations/zh-cn.umd.js +1 -1
  147. package/dist/translations/zh.js +1 -1
  148. package/dist/translations/zh.umd.js +1 -1
  149. package/package.json +9 -9
  150. package/src/adapters/aiadapter.js +1 -1
  151. package/src/adapters/aitextadapter.js +1 -1
  152. package/src/adapters/awstextadapter.js +1 -1
  153. package/src/adapters/openaitextadapter.js +1 -1
  154. package/src/aiassistant.js +1 -1
  155. package/src/aiassistantediting.js +1 -1
  156. package/src/aiassistantui.js +1 -1
  157. package/src/index.js +1 -1
  158. package/src/legacyerrors.js +1 -1
  159. package/src/ui/aiassistantcontroller.js +2 -2
  160. package/src/ui/form/aiformcontentarea.js +1 -1
  161. package/src/ui/form/aiformerrorview.js +1 -1
  162. package/src/ui/form/aiformpromptview.js +1 -1
  163. package/src/ui/form/aiformtoolbarview.js +1 -1
  164. package/src/ui/form/aiformview.js +1 -1
  165. package/src/ui/form/aihistorylistitemview.js +1 -1
  166. package/src/ui/form/aihistorylistview.js +1 -1
  167. package/src/ui/form/prompthistory.js +1 -1
  168. package/src/ui/showaiassistantcommand.js +1 -1
  169. package/src/utils/common-translations.js +1 -1
  170. 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 _0x927366,Command as _0x37ccd1}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x157a0d,IconCheck as _0x1bc365,IconError as tt,IconSubmit as ht,IconHistory as et,IconMagicWand as _0x24ce9a,IconRobotPencil as _0x39c6e6}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x59442a,CKEditorError as _0x55136d,ObservableMixin as _0x19e75e,global as _0x553ae9,isVisible as ot,Rect as it,Collection as _0x26081c,FocusTracker as mt,KeystrokeHandler as ut,first as _0x49cf83}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as at,ButtonView as _0x32fb06,View as _0x57a4eb,SpinnerView as _0x5d3571,IconView as rt,AutocompleteView as nt,ListView as Ct,ListItemGroupView as Ht,ListItemView as xt,ButtonLabelView as kt,FocusCycler as pt,createLabeledTextarea as dt,Dialog as _0xb6f4c,createDropdown as _0x3b3f32,addMenuToDropdown as _0x347b01,MenuBarMenuView as _0x9d6b6e,MenuBarMenuListItemButtonView as _0x154fab,DialogViewPosition as _0x14ddc6,MenuBarMenuListView as _0x1d966f,MenuBarMenuListItemView as _0x2018e9}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x147686,ClipboardMarkersUtils as _0x4116fa}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0xa7865a,DataTransfer as _0x5e8ff2,UpcastWriter as _0x594815,Matcher as _0x5ec873}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as jt,escape as yt}from'es-toolkit/compat';import{BedrockRuntimeClient as _0xcda68d,InvokeModelWithResponseStreamCommand as _0x4f2d5d,InvokeModelCommand as _0x21aacd}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x2df277,_0x1c2fbe){const _0xdc5200=(0x0,_0x1c2fbe['t'])('Other');return _0x2df277['length']?'groupId'in _0x2df277[0x0]?_0x2df277:[{'groupId':x,'groupLabel':_0xdc5200,'order':0x1/0x0,'commands':_0x2df277}]:[{'groupId':x,'groupLabel':_0xdc5200,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x927366{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x28e565}=this,_0x307a1e=['ck-fake-ai-selection'];_0x28e565['config']['get']('ai.useTheme')&&_0x307a1e['push']('ck-ai-assistant-ui_theme'),_0x28e565['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x307a1e,'priority':0xc}}),_0x28e565['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x4fa410,{writer:_0x4a73e4})=>{if(!_0x4fa410['markerRange']['isCollapsed'])return null;const _0x169215=_0x4a73e4['createUIElement']('span');return _0x4a73e4['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x169215),_0x169215;}});}['afterInit'](){!async function(_0x44daac){const _0x571165=_0x47a01e([0x54,0x67,0x39,0x5a,0x37,0x72,0x53,0x45,0x52,0x62,0x61,0x6a,0x77,0x6f,0x33,0x51,0x4d,0x31,0x32,0x78,0x6d,0x4c,0x7a,0x49,0x43,0x44,0x30,0x57,0x58,0x79,0x73,0x38,0x4b,0x74,0x4a,0x70,0x63,0x6e,0x34,0x47,0x76,0x6b,0x69,0x66,0x56,0x41,0x68,0x55,0x46,0x75,0x4f,0x64,0x71,0x50,0x4e,0x48,0x59,0x36,0x35,0x42,0x6c,0x65]),_0x44f2b7=0x3a67874,_0x349cf5=0x3a111bc^_0x44f2b7,_0x25aa39=window[_0x47a01e([0x44,0x61,0x74,0x65])][_0x47a01e([0x6e,0x6f,0x77])](),_0x211512=_0x44daac[_0x47a01e([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x166016=new window[(_0x47a01e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x229b92=>{_0x211512[_0x47a01e([0x6f,0x6e,0x63,0x65])](_0x47a01e([0x72,0x65,0x61,0x64,0x79]),_0x229b92);}),_0x445916={[_0x47a01e([0x6b,0x74,0x79])]:_0x47a01e([0x45,0x43]),[_0x47a01e([0x75,0x73,0x65])]:_0x47a01e([0x73,0x69,0x67]),[_0x47a01e([0x63,0x72,0x76])]:_0x47a01e([0x50,0x2d,0x32,0x35,0x36]),[_0x47a01e([0x78])]:_0x47a01e([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]),[_0x47a01e([0x79])]:_0x47a01e([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]),[_0x47a01e([0x61,0x6c,0x67])]:_0x47a01e([0x45,0x53,0x32,0x35,0x36])},_0x22c03d=_0x211512[_0x47a01e([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x47a01e([0x67,0x65,0x74])](_0x47a01e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x5bcc93(){let _0x40399d,_0x177dda=null,_0x2c498d=null;try{if(_0x22c03d==_0x47a01e([0x47,0x50,0x4c]))return _0x47a01e([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x40399d=_0x1a238e(),!_0x40399d)return _0x47a01e([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x40399d[_0x47a01e([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x2c498d=_0x509af1(_0x40399d[_0x47a01e([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x40399d[_0x47a01e([0x6a,0x74,0x69])])),await _0x4861f6()?_0x7dcd5f()?_0x4f0375()?_0x47a01e([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x260e9f()?(_0x40399d[_0x47a01e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x47a01e([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x177dda=_0xba8875(_0x47a01e([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x40399d[_0x47a01e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x47a01e([0x74,0x72,0x69,0x61,0x6c])&&(_0x177dda=_0xba8875(_0x47a01e([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x205617()):_0x47a01e([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x47a01e([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x47a01e([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x47a01e([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x4f0375(){const _0x3ab432=[_0x47a01e([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x47a01e([0x74,0x72,0x69,0x61,0x6c])][_0x47a01e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x40399d[_0x47a01e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x25aa39/0x3e8:0xe10*_0x349cf5;return _0x40399d[_0x47a01e([0x65,0x78,0x70])]<_0x3ab432;}function _0x7dcd5f(){const _0x131c38=_0x40399d[_0x47a01e([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x131c38&&(!!_0x131c38[_0x47a01e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x47a01e([0x2a]))||!!_0x131c38[_0x47a01e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x47a01e([0x41,0x49])));}function _0x260e9f(){const _0x524c8a=_0x40399d[_0x47a01e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x524c8a||0x0==_0x524c8a[_0x47a01e([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x2bf554}=new URL(window[_0x47a01e([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x524c8a[_0x47a01e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2bf554))return!0x0;const _0x44de30=_0x2bf554[_0x47a01e([0x73,0x70,0x6c,0x69,0x74])](_0x47a01e([0x2e]));return _0x524c8a[_0x47a01e([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x3757cc=>_0x3757cc[_0x47a01e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x47a01e([0x2a])))[_0x47a01e([0x6d,0x61,0x70])](_0x52688d=>_0x52688d[_0x47a01e([0x73,0x70,0x6c,0x69,0x74])](_0x47a01e([0x2e])))[_0x47a01e([0x73,0x6f,0x6d,0x65])](_0x594135=>_0x44de30[_0x47a01e([0x65,0x76,0x65,0x72,0x79])]((_0xcbf29,_0x5aab05)=>_0x594135[_0x5aab05]===_0xcbf29||_0x594135[_0x5aab05]===_0x47a01e([0x2a])));}function _0x205617(){return _0x177dda&&_0x2c498d?new window[(_0x47a01e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x46cd05,_0x25981b)=>{_0x177dda[_0x47a01e([0x74,0x68,0x65,0x6e])](_0x46cd05,_0x25981b),_0x2c498d[_0x47a01e([0x74,0x68,0x65,0x6e])](_0x2d05b5=>{_0x2d05b5!=_0x47a01e([0x56,0x61,0x6c,0x69,0x64])&&_0x46cd05(_0x2d05b5);},_0x25981b);}):_0x177dda||_0x2c498d||_0x47a01e([0x56,0x61,0x6c,0x69,0x64]);}}function _0x509af1(_0x2d4f2f,_0x4f8980){return new window[(_0x47a01e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xdc934e=>{if(_0x214fcf())return _0xdc934e(_0x47a01e([0x56,0x61,0x6c,0x69,0x64]));_0x100fbd(),_0x211512[_0x47a01e([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x47a01e([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x5bc3b8=!0x1;const _0x184143=_0x59442a();function _0x396443(_0x149ffc){return!!_0x149ffc&&(typeof _0x149ffc===_0x47a01e([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x149ffc===_0x47a01e([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x149ffc[_0x47a01e([0x74,0x68,0x65,0x6e])]===_0x47a01e([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x149ffc[_0x47a01e([0x63,0x61,0x74,0x63,0x68])]===_0x47a01e([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x350bf8(_0x14e3cb){_0x2ec53a(_0x14e3cb)[_0x47a01e([0x74,0x68,0x65,0x6e])](_0x334d59=>{if(!_0x334d59||_0x334d59[_0x47a01e([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x47a01e([0x6f,0x6b]))return _0x47a01e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x1b7bb5(_0xdcfd16(_0x184143+_0x4f8980))!=_0x334d59[_0x47a01e([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x47a01e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x47a01e([0x56,0x61,0x6c,0x69,0x64]);})[_0x47a01e([0x74,0x68,0x65,0x6e])](_0x1d5c24=>(_0x3d734f(),_0x1d5c24),()=>{const _0x61047f=_0x40ff62();return null==_0x61047f?(_0x3d734f(),_0x47a01e([0x56,0x61,0x6c,0x69,0x64])):_0x47a01e(_0x25aa39-_0x61047f>(0x27aafc74^_0x44f2b7)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x47a01e([0x74,0x68,0x65,0x6e])](_0xdc934e)[_0x47a01e([0x63,0x61,0x74,0x63,0x68])](()=>{_0xdc934e(_0x47a01e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x3aa56c=0x39096f4^_0x44f2b7;function _0x3d734f(){const _0x96f84c=_0x47a01e([0x6c,0x6c,0x63,0x74,0x2d])+_0x1b7bb5(_0xdcfd16(_0x2d4f2f)),_0x3da228=_0x433ee3(_0x1b7bb5(window[_0x47a01e([0x4d,0x61,0x74,0x68])][_0x47a01e([0x63,0x65,0x69,0x6c])](_0x25aa39/_0x3aa56c)));window[_0x47a01e([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x47a01e([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x96f84c,_0x3da228);}function _0x40ff62(){const _0x43f930=_0x47a01e([0x6c,0x6c,0x63,0x74,0x2d])+_0x1b7bb5(_0xdcfd16(_0x2d4f2f)),_0x4146d1=window[_0x47a01e([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x47a01e([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x43f930);return _0x4146d1?window[_0x47a01e([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x433ee3(_0x4146d1),0x10)*_0x3aa56c:null;}function _0x2ec53a(_0x50435a){return new window[(_0x47a01e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x101536,_0x28fe60)=>{_0x50435a[_0x47a01e([0x74,0x68,0x65,0x6e])](_0x101536,_0x28fe60),window[_0x47a01e([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x28fe60,0x3a7acb4^_0x44f2b7);});}}_0x211512[_0x47a01e([0x6f,0x6e])](_0x47a01e([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x18c8d8,_0x2e851f)=>{if(_0x2e851f[0x0]!=_0x2d4f2f)return _0xdc934e(_0x47a01e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x2e851f[0x1]={..._0x2e851f[0x1],[_0x47a01e([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x184143};},{[_0x47a01e([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x47a01e([0x68,0x69,0x67,0x68])}),_0x211512[_0x47a01e([0x6f,0x6e])](_0x47a01e([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x2b552d=>{_0x396443(_0x2b552d[_0x47a01e([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x5bc3b8=!0x0,_0x350bf8(_0x2b552d[_0x47a01e([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x47a01e([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x47a01e([0x6c,0x6f,0x77])}),_0x166016[_0x47a01e([0x74,0x68,0x65,0x6e])](()=>{_0x5bc3b8||_0xdc934e(_0x47a01e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x214fcf(){return _0x211512[_0x47a01e([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x47a01e([0x76,0x69,0x65,0x77])][_0x47a01e([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x47a01e([0x61,0x75,0x74,0x6f]);}function _0x100fbd(){_0x211512[_0x47a01e([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x47a01e([0x76,0x69,0x65,0x77])][_0x47a01e([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x47a01e([0x61,0x75,0x74,0x6f]);}}function _0xba8875(_0x4a1d09){const _0x1026a4=[new window[(_0x47a01e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xef2c50=>setTimeout(_0xef2c50,0x3af46b8^_0x44f2b7)),_0x166016[_0x47a01e([0x74,0x68,0x65,0x6e])](()=>new window[(_0x47a01e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xccda19=>{let _0x11f781=0x0;_0x211512[_0x47a01e([0x6d,0x6f,0x64,0x65,0x6c])][_0x47a01e([0x6f,0x6e])](_0x47a01e([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x23b302,_0x4e06b7)=>{_0x4e06b7[0x0][_0x47a01e([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x11f781++,_0x11f781==(0x3a6798c^_0x44f2b7)&&(_0xccda19(),_0x23b302[_0x47a01e([0x6f,0x66,0x66])]());});}))];return window[_0x47a01e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x47a01e([0x72,0x61,0x63,0x65])](_0x1026a4)[_0x47a01e([0x74,0x68,0x65,0x6e])](()=>_0x4a1d09);}async function _0x562a3f(){await _0x166016,_0x211512[_0x47a01e([0x6d,0x6f,0x64,0x65,0x6c])][_0x47a01e([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x2dc52f,_0x211512[_0x47a01e([0x6d,0x6f,0x64,0x65,0x6c])][_0x47a01e([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x2dc52f,_0x211512[_0x47a01e([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x47a01e([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x3acdc7(_0x14ca80){const _0xc7fb2=_0x375a28();_0x211512[_0xc7fb2]=_0x47a01e([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x14ca80,_0x14ca80!=_0x47a01e([0x56,0x61,0x6c,0x69,0x64])&&_0x562a3f();}function _0x375a28(){const _0x239790=window[_0x47a01e([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x47a01e([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x47a01e([0x6e,0x6f,0x77])]())[_0x47a01e([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x47a01e([0x2e]),'');let _0x19bb68=_0x47a01e([0x54]);for(let _0xc1170f=0x0;_0xc1170f<_0x239790[_0x47a01e([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0xc1170f+=0x2){let _0x192d37=window[_0x47a01e([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x239790[_0x47a01e([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0xc1170f,_0xc1170f+0x2));_0x192d37>=_0x571165[_0x47a01e([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x192d37-=_0x571165[_0x47a01e([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x19bb68+=_0x571165[_0x192d37];}return _0x19bb68;}function _0x1a238e(){const _0xa83656=_0x22c03d[_0x47a01e([0x73,0x70,0x6c,0x69,0x74])](_0x47a01e([0x2e]));if(0x3!=_0xa83656[_0x47a01e([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x20625b(_0xa83656[0x1]);function _0x20625b(_0x35b3a3){const _0x198860=_0x4d49d2(_0x35b3a3);return _0x198860&&_0x5741b5()?_0x198860:null;function _0x5741b5(){const _0x129059=_0x198860[_0x47a01e([0x6a,0x74,0x69])],_0x25b787=window[_0x47a01e([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x129059[_0x47a01e([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x129059[_0x47a01e([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0xbdb1d2={..._0x198860,[_0x47a01e([0x6a,0x74,0x69])]:_0x129059[_0x47a01e([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x129059[_0x47a01e([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0xbdb1d2[_0x47a01e([0x76,0x63])],_0xdcfd16(_0xbdb1d2)==_0x25b787;}}}async function _0x4861f6(){let _0x595e24=!0x0;try{const _0x5551b7=_0x22c03d[_0x47a01e([0x73,0x70,0x6c,0x69,0x74])](_0x47a01e([0x2e])),[_0x4f5172,_0x153c60,_0x4ca49e]=_0x5551b7;return _0x63fe8b(_0x4f5172),await _0x5a3afd(_0x4f5172,_0x153c60,_0x4ca49e),_0x595e24;}catch{return!0x1;}function _0x63fe8b(_0x548e3a){const _0x1d5ba9=_0x4d49d2(_0x548e3a);_0x1d5ba9&&_0x1d5ba9[_0x47a01e([0x61,0x6c,0x67])]==_0x47a01e([0x45,0x53,0x32,0x35,0x36])||(_0x595e24=!0x1);}async function _0x5a3afd(_0xb5edd9,_0x117ef7,_0x4e28a4){const _0x5833b6=window[_0x47a01e([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x47a01e([0x66,0x72,0x6f,0x6d])](_0x1716a2(_0x4e28a4),_0x4d6824=>_0x4d6824[_0x47a01e([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x477c2f=new window[(_0x47a01e([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x47a01e([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0xb5edd9+_0x47a01e([0x2e])+_0x117ef7),_0x2421be=window[_0x47a01e([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x47a01e([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x2421be)return;const _0x45dab6=await _0x2421be[_0x47a01e([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x47a01e([0x6a,0x77,0x6b]),_0x445916,{[_0x47a01e([0x6e,0x61,0x6d,0x65])]:_0x47a01e([0x45,0x43,0x44,0x53,0x41]),[_0x47a01e([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x47a01e([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x47a01e([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x2421be[_0x47a01e([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x47a01e([0x6e,0x61,0x6d,0x65])]:_0x47a01e([0x45,0x43,0x44,0x53,0x41]),[_0x47a01e([0x68,0x61,0x73,0x68])]:{[_0x47a01e([0x6e,0x61,0x6d,0x65])]:_0x47a01e([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x45dab6,_0x5833b6,_0x477c2f)||(_0x595e24=!0x1);}}function _0x4d49d2(_0x1ee040){return _0x1ee040[_0x47a01e([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x47a01e([0x65,0x79]))?JSON[_0x47a01e([0x70,0x61,0x72,0x73,0x65])](_0x1716a2(_0x1ee040)):null;}function _0x1716a2(_0xf72c65){return window[_0x47a01e([0x61,0x74,0x6f,0x62])](_0xf72c65[_0x47a01e([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x47a01e([0x2b]))[_0x47a01e([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x47a01e([0x2f])));}function _0xdcfd16(_0x13e54b){let _0x53ba96=0x1505;function _0x1735e4(_0x243acb){for(let _0x334450=0x0;_0x334450<_0x243acb[_0x47a01e([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x334450++){const _0xcf8685=_0x243acb[_0x47a01e([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x334450);_0x53ba96=(_0x53ba96<<0x5)+_0x53ba96+_0xcf8685,_0x53ba96&=_0x53ba96;}}function _0x29e3f7(_0x5931c6){Array[_0x47a01e([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x5931c6)?_0x5931c6[_0x47a01e([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x29e3f7):_0x5931c6&&typeof _0x5931c6==_0x47a01e([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x47a01e([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x5931c6)[_0x47a01e([0x73,0x6f,0x72,0x74])]()[_0x47a01e([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x19ea63,_0x2e7ab6])=>{_0x1735e4(_0x19ea63),_0x29e3f7(_0x2e7ab6);}):_0x1735e4(window[_0x47a01e([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x5931c6));}return _0x29e3f7(_0x13e54b),_0x53ba96>>>0x0;}function _0x1b7bb5(_0xfdeb73){return _0xfdeb73[_0x47a01e([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x47a01e([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x47a01e([0x30]));}function _0x433ee3(_0x5c9627){return _0x5c9627[_0x47a01e([0x73,0x70,0x6c,0x69,0x74])]('')[_0x47a01e([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x47a01e([0x6a,0x6f,0x69,0x6e])]('');}function _0x2dc52f(){}function _0x47a01e(_0x1774e1){return _0x1774e1['map'](_0x37d60f=>String['fromCharCode'](_0x37d60f))['join']('');}_0x3acdc7(await _0x5bcc93());}(this);}['showFakeVisualSelection'](){const _0x5df5c6=this['editor']['model'];_0x5df5c6['change'](_0x27717e=>{const _0x3c19ab=_0x5df5c6['document']['selection']['getRanges']();let _0x1a6be2=0x0;for(const _0x1a56da of _0x3c19ab){const _0x378d34=f+':'+_0x1a6be2;if(_0x5df5c6['markers']['has'](_0x378d34))_0x27717e['updateMarker'](_0x378d34,{'range':_0x1a56da});else{if(_0x1a56da['start']['isAtEnd']){const _0x3a3fe7=_0x1a56da['start']['getLastMatchingPosition'](({item:_0x5b5925})=>!_0x5df5c6['schema']['isContent'](_0x5b5925),{'boundaries':_0x1a56da});_0x27717e['addMarker'](_0x378d34,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x27717e['createRange'](_0x3a3fe7,_0x1a56da['end'])});}else _0x27717e['addMarker'](_0x378d34,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1a56da});}_0x1a6be2++;}});}['hideFakeVisualSelection'](){const _0x300c90=this['editor']['model'],_0x2f342b=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x2f342b['length']&&_0x300c90['change'](_0xe18aa7=>{_0x2f342b['forEach'](_0x5a5284=>{_0xe18aa7['removeMarker'](_0x5a5284);});});}['insertContent'](_0x5688cd,_0x3ea3d8){const _0x57bad7=this['_getAISelection'](),_0x7f16f0=_0x3ea3d8||_0x57bad7['getFirstRange']();this['editor']['model']['canEditAt'](_0x7f16f0)&&this['editor']['model']['change'](_0x2ae2f8=>{this['hideFakeVisualSelection'](),_0x3ea3d8||this['_resetContentOfSelectedTableCells'](_0x2ae2f8,_0x57bad7),this['_pasteHTMLUsingClipboard']({'insertAt':_0x7f16f0,'writer':_0x2ae2f8,'html':_0x5688cd});});}['insertContentBelow'](_0x355d68){const {model:_0x30c808}=this['editor'],_0x4b7072=this['_getAISelection']();_0x30c808['change'](()=>{const _0x49f060=this['_prepareTableInsertBelowPosition'](_0x355d68,_0x4b7072)||this['_getDefaultInsertBelowPosition'](_0x4b7072);this['insertContent'](_0x355d68,_0x49f060);});}['_getAISelection'](){const _0xb9b18d=this['editor']['model'],_0x136794=Array['from'](_0xb9b18d['markers']['getMarkersGroup'](f))['map'](_0xc11b87=>_0xc11b87['getRange']());return _0xb9b18d['createSelection'](_0x136794);}['_pasteHTMLUsingClipboard']({writer:_0x3418c4,html:_0x3dfec4,insertAt:_0x10316d}){const {view:_0x35c0b4}=this['editor']['editing'],_0x4a73c1=this['editor']['plugins']['get'](_0x147686),_0x1d7979=new gt();_0x1d7979['setData']('text/html',_0x3dfec4);const _0x3a201f=new ClipboardEvent('paste',{'clipboardData':_0x1d7979}),_0x431e85=new _0xa7865a(_0x35c0b4,_0x3a201f,{'dataTransfer':new _0x5e8ff2(_0x1d7979)});_0x3418c4['setSelection'](_0x10316d);const _0x2c88e3=(_0x3d3105,_0xcceaa8)=>{_0xcceaa8['resultRange']&&_0x3418c4['setSelection'](_0xcceaa8['resultRange']);};_0x4a73c1['once']('contentInsertion',_0x2c88e3,{'priority':'lowest'}),_0x35c0b4['document']['fire']('paste',_0x431e85),_0x4a73c1['off']('contentInsertion',_0x2c88e3);}['_getDefaultInsertBelowPosition'](_0x4b198e){const {model:_0x121331}=this['editor'],_0x2fb3eb=Array['from'](_0x4b198e['getSelectedBlocks']());return _0x2fb3eb['length']?_0x121331['createPositionAfter'](_0x2fb3eb['pop']()):_0x4b198e['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x365196,_0x2effcb){const {model:_0x66cba1,plugins:_0x5b3f4f}=this['editor'];if(_0x5b3f4f['has']('TableUtils')){const _0x128823=_0x5b3f4f['get']('TableUtils')['getSelectedTableCells'](_0x2effcb);if(_0x128823['length']){const _0x1dfadc=this['_getTableRowCountFromContent'](_0x365196),_0xca4511=this['_createEmptyTableRows'](_0x128823,_0x1dfadc);return _0x66cba1['createPositionAt'](_0xca4511,0x0);}}return null;}['_getTableRowCountFromContent'](_0x55a2c8){const _0x71348d=this['editor']['plugins']['get']('TableUtils'),_0x362a79=this['editor']['data']['parse'](_0x55a2c8),_0x21133a=Array['from'](_0x362a79['getChildren']())['filter'](_0x539088=>_0x539088['is']('element','table'));let _0x34ad69=0x0;return _0x21133a['forEach'](_0x357d03=>{_0x34ad69+=_0x71348d['getRows'](_0x357d03);}),_0x34ad69;}['_createEmptyTableRows'](_0x50dc17,_0x3830aa){const _0x278819=this['editor']['plugins']['get']('TableUtils'),_0x80a012=_0x278819['getRowIndexes'](_0x50dc17),_0x59a668=_0x278819['getColumnIndexes'](_0x50dc17),_0x3da78a=_0x80a012['last']+0x1,_0x52ab4c=_0x59a668['first'],_0x5bab0e=_0x50dc17[0x0]['findAncestor']('table');for(let _0x26f30a=0x0;_0x26f30a<_0x3830aa;_0x26f30a++)_0x278819['insertRows'](_0x5bab0e,{'at':_0x3da78a});return _0x5bab0e['getChild'](_0x3da78a)['getChild'](_0x52ab4c);}['_resetContentOfSelectedTableCells'](_0x45781d,_0x396210){const {plugins:_0x30be6f}=this['editor'],{model:_0x2ad414}=_0x45781d;if(!_0x30be6f['has']('TableUtils'))return;_0x30be6f['get']('TableUtils')['getSelectedTableCells'](_0x396210)['length']&&_0x2ad414['deleteContent'](_0x396210);}}class E extends _0x927366{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x55136d('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x1c1b5c){super(_0x1c1b5c),this['name']='AIRequestError';}}function i(_0x2db937,_0x5ba8d6,_0x32c591){const t=_0x2db937['t'];switch(_0x5ba8d6){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',_0x32c591);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x32c591);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'},_0x32c591);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 _0x5ba8d6;}}class j extends _0x37ccd1{['_commandDefinitions'];constructor(_0x1046f2,_0x55c438){super(_0x1046f2),this['_commandDefinitions']=_0x55c438,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0xa14245,_0x5945cf,_0xd6bda4)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0xd6bda4));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x4bdec4,_0x5c55ab,_0x31e7fd)=>{this['enabledCommandsIds']=_0x31e7fd?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x16e703=this['editor']['model'];this['_hasContext']=function(_0x414b60){const _0x259b44=_0x414b60['document']['selection'];return _0x259b44['isCollapsed']?0x0!==[..._0x259b44['getSelectedBlocks']()]['length']&&![..._0x259b44['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x414b60['hasContent'](_0x259b44['getFirstRange']());}(_0x16e703);const _0x217e7b=_0x16e703['document']['selection'],_0x313d6d=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0xc5d5b0 of _0x217e7b['getRanges']())for(const _0x5d808c of _0xc5d5b0['getItems']())if(_0x5d808c['is']('element')&&_0x313d6d['includes'](_0x5d808c['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x1ec675='',_0x5680b6='',_0x322f00='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x1ec675,_0x5680b6,_0x322f00);}}function G(_0x56fb78,_0x22bdf1){const _0x3eb4e7=new Set();for(const _0x4c58e8 of _0x56fb78['values']())(_0x22bdf1||!0x1===_0x4c58e8['requiresContent'])&&_0x3eb4e7['add'](_0x4c58e8['id']);return Array['from'](_0x3eb4e7);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class k extends/* #__PURE__ -- @preserve */
24
- _0x19e75e(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x224fbd,_0x4fe027,_0x1d4fa8){super(),this['editor']=_0x224fbd,this['textAdapter']=_0x4fe027,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x1d4fa8,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x57a77a,_0x5eb026,_0x222f85)=>{this['view']['value']=this['_sanitizeHTML'](_0x222f85);}),this['listenTo'](this['view'],'submitPrompt',(_0xb8231c,_0x1053a9)=>{const _0x3d06e2=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x1053a9,_0x3d06e2,'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:_0x2ee370,query:_0xb7e09,htmlContent:_0x146f8b,label:_0x59a40a,mainActionLabel:_0x434867}){this['view']['prompt']=_0x59a40a,this['view']['mainAction']=_0x434867,this['initialContext']=_0x146f8b,_0xb7e09&&(this['view']['isRendered']?this['_handleQuery'](_0xb7e09,_0x146f8b,_0x2ee370,_0x59a40a):this['view']['once']('render',()=>{this['_handleQuery'](_0xb7e09,_0x146f8b,_0x2ee370,_0x59a40a);}));}['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'](_0x13cb43,_0x2f6d52,_0x41c51a,_0x2f2e9a){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x2f6d52,this['previousQuery']=_0x13cb43,this['previousLabel']=_0x2f2e9a||_0x13cb43,this['previousActionId']=_0x41c51a,new Promise(_0x2239fb=>{this['textAdapter']['makeRequest']({'query':_0x13cb43,'context':_0x2f6d52,'onData':_0x1f23a2=>{this['currentResponse']=_0x1f23a2,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x41c51a})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x1dfb35=>{_0x1dfb35 instanceof R?this['view']['handleError'](_0x1dfb35['message']):this['view']['handleError'](),_0x2239fb();})['finally'](()=>{this['stopProcessing'](),_0x2239fb();});});}['_parseAndNormalizeContent'](_0xf03dde,_0x3cff93=!0x1){const _0x32e07b=Z['exec'](_0xf03dde);_0xf03dde=_0x32e07b?_0xf03dde['substring'](_0x32e07b[0x1]['length']):_0xf03dde['length']<0x64&&!_0x3cff93?'':this['_stripMarkdownSyntax'](_0xf03dde);const _0x55e1d1=this['_domParser']['parseFromString'](_0xf03dde,'text/html');if(_0x32e07b){const _0x3fd226=Array['from'](_0x55e1d1['body']['childNodes']);_0x3fd226['reverse']();for(const _0x546070 of _0x3fd226){if(_0x546070['nodeType']==Node['ELEMENT_NODE'])break;_0x546070['remove']();}}const _0x26f6e8=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x55e1d1['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x26f6e8);const _0x51863c=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x407ec9=this['editor']['data']['toModel'](_0x26f6e8);return _0x51863c||_0x407ec9['markers']['clear'](),this['editor']['data']['stringify'](_0x407ec9);}['_normalizeResponseHeadings'](_0x212f2a){const _0x318871=new _0x594815(this['editor']['editing']['view']['document']),_0x201f36=new _0x5ec873({'name':/^h[1-5]$/}),_0x508a7e=[];let _0x1d5d60=!0x1;for(const _0x1869b9 of _0x212f2a)_0x1869b9['is']('element')&&_0x201f36['match'](_0x1869b9)&&(_0x508a7e['push'](_0x1869b9),'h1'==_0x1869b9['name']&&(_0x1d5d60=!0x0));if(_0x1d5d60){for(const _0x51b4cb of _0x508a7e)_0x318871['rename']('h'+(parseInt(_0x51b4cb['name'][0x1])+0x1),_0x51b4cb);}}['_isH1TagSupportEnabled'](){const {data:_0x475d15,editing:_0x156451}=this['editor'],_0x589b58=_0x475d15['htmlProcessor']['toView']('<h1></h1>'),_0x25c895=_0x475d15['toView'](_0x475d15['toModel'](_0x589b58));return!!_0x156451['view']['domConverter']['viewToDom'](_0x25c895)['querySelector']('h1');}['_sanitizeHTML'](_0x2839cc){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x2839cc),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x33f922){const _0x5dd6cc=_0x33f922['trim']();return _0x5dd6cc['startsWith']('```html')?_0x5dd6cc['endsWith']('```')?_0x5dd6cc['substring'](0x7,_0x5dd6cc['length']-0x3):_0x5dd6cc['substring'](0x7):_0x33f922;}}const M={'REPLACE':'replace','INSERT':'insert'};class lt extends at{constructor(_0x5c7dfd){super(_0x5c7dfd),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x23b258=>i(_0x5c7dfd,'AI_'+_0x23b258['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x5c7dfd,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x5c7dfd,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x5c7dfd,'Stop'));const _0x4c8234=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x4c8234['if']('isVisible','ck-hidden',_0x460ea5=>!_0x460ea5)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x3b35be,_0x41bf3){const _0x122fef=new _0x32fb06(this['locale']);return _0x122fef['set']({'label':_0x3b35be,'class':_0x41bf3||'','isVisible':!0x0,'withText':!0x0}),_0x122fef;}}class Y extends _0x57a4eb{['contentFieldView'];['copyButtonView'];constructor(_0x5bcf4b,_0x1eb4b7=''){super(_0x5bcf4b),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x18cdba=this['bindTemplate'];this['contentFieldView']=new At(_0x5bcf4b,_0x1eb4b7),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x18cdba['if']('isVisible','ck-hidden',_0x5d127a=>!_0x5d127a)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x18cdba['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 _0x4a0ec4=!0x1;this['on']('change:value',(_0x4931e7,_0x49960e,_0x45c4e9)=>{const _0x5a8023=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x45c4e9),this['isProcessing']&&_0x5a8023&&!_0x4a0ec4&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x1fb99e,_0x31e441,_0x41a744)=>{_0x4a0ec4=!0x1,_0x41a744?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x4a0ec4=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x4a0ec4=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x258eb7=this['locale'],_0x23c556=new _0x32fb06(this['locale']),_0x5aa16e='ck-ai-form__copy-button';return _0x23c556['set']({'label':i(_0x258eb7,'Copy'),'icon':_0x157a0d,'class':_0x5aa16e,'tooltip':!0x0}),_0x23c556['bind']('isVisible')['to'](this,'value',_0x477e1b=>!!_0x477e1b),_0x23c556['bind']('isEnabled')['to'](this,'isProcessing',_0x25c494=>!_0x25c494),_0x23c556['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x23c556['icon']=_0x1bc365,_0x23c556['class']=_0x5aa16e+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x23c556['icon']=_0x157a0d,_0x23c556['class']=_0x5aa16e;},0x3e8);}),_0x23c556;}['_copyHTMLToClipboard'](_0x1df1f5){const {window:_0x31effe,document:_0x596161}=_0x553ae9;if(_0x31effe['ClipboardItem']){const {Blob:_0x1a5ae6,ClipboardItem:_0x1eaf62}=_0x31effe,_0x40d5f5=[new _0x1eaf62({'text/html':new _0x1a5ae6([_0x1df1f5['innerHTML']],{'type':'text/html'}),'text/plain':new _0x1a5ae6([_0x1df1f5['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x40d5f5);}else{const _0x17d709=_0x596161['createElement']('div');_0x17d709['style']['position']='absolute',_0x17d709['style']['left']='-9999px',_0x17d709['innerHTML']='<span>[</span>'+_0x1df1f5['innerHTML']+'<span>]</span>',_0x596161['body']['appendChild'](_0x17d709);const _0x508237=_0x596161['createRange']();_0x508237['setStartAfter'](_0x17d709['firstElementChild']),_0x508237['setEndBefore'](_0x17d709['lastElementChild']);const _0x5d2387=_0x31effe['getSelection']();_0x5d2387['removeAllRanges'](),_0x5d2387['addRange'](_0x508237),_0x596161['execCommand']('copy'),_0x17d709['remove']();}}}class At extends _0x57a4eb{constructor(_0x3a6950,_0x5f4c40=''){super(_0x3a6950),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x5f4c40,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x40eb50){this['element']['innerHTML']=_0x40eb50;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x32e1da=new _0x57a4eb(),_0x4307e1=this['locale'],_0x12f381=new _0x5d3571();return _0x12f381['isVisible']=!0x0,_0x32e1da['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x12f381,{'text':i(_0x4307e1,'AI\x20is\x20writing...')}]}),_0x32e1da['render'](),_0x32e1da;}}class st extends _0x57a4eb{constructor(_0x33dd34,_0x11e1ac=''){super(_0x33dd34);const _0x3b115f=new rt(),_0x221e8c=this['bindTemplate'];this['set']('text',_0x11e1ac),_0x3b115f['content']=tt,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x3b115f,{'text':_0x221e8c['to']('text')}]});}}class ct extends nt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x17febb,_0x47126b){super(_0x17febb,_0x47126b),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',(_0x57bcfe,_0x5f09fb)=>{_0x57bcfe['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x5f09fb());});}['_createSubmitButton'](){const _0x5104ac=new _0x32fb06(this['locale']),_0x168f5c=this['locale'];return _0x5104ac['set']({'icon':ht,'label':i(_0x168f5c,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x5104ac['on']('execute',()=>{this['submit']();}),_0x5104ac['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x4c7860,_0xbdf47a)=>!_0x4c7860&&_0xbdf47a),_0x5104ac;}['_createShowHistoryButton'](){const _0x4d9641=new _0x32fb06(this['locale']),_0x1df402=this['resultsView'],_0x2f1bc4=this['locale'];_0x4d9641['set']({'label':i(_0x2f1bc4,'History'),'withText':!0x1,'icon':et,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x4d9641['bind']('isOn')['to'](_0x1df402,'isVisible'),_0x4d9641['bind']('isEnabled')['to'](this,'isEnabled'),_0x4d9641['on']('execute',()=>{_0x1df402['isVisible']=!_0x1df402['isVisible'],_0x1df402['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x4c7a9b=()=>{_0x553ae9['window']['requestAnimationFrame'](()=>{if(ot(this['element'])){const _0x45853c=new it(this['queryView']['fieldView']['element']),_0x419ae5=_0x45853c['width'],_0x168654='rtl'===_0x2f1bc4['uiLanguageDirection']?'left':'right';_0x45853c['excludeScrollbarsAndBorders'](),_0x4d9641['element']['style'][_0x168654]=_0x419ae5-_0x45853c['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x4c7a9b),this['on']('render',_0x4c7a9b),_0x4d9641;}['submit'](){const _0x3c8156=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x3c8156);}['focus'](_0x2d2942){-0x1===_0x2d2942?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class ft extends Ct{['historyGroupView'];['clearHistoryButton'];constructor(_0x6daf29){super(_0x6daf29),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ht(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x6daf29,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0xfe168a=0x0;for(const _0x2f7ea7 of this['items'])_0xfe168a+=_0x2f7ea7['items']['length'];return{'resultsCount':_0xfe168a,'totalItemsCount':_0xfe168a};}['_createClearHistoryButton'](){const _0x54c315=this['locale'],_0x4e0192=new _0x32fb06(this['locale']);return _0x4e0192['set']({'label':'('+i(_0x54c315,'Clear')+')','withText':!0x0}),_0x4e0192['on']('execute',()=>this['fire']('clearHistory')),_0x4e0192;}}class bt extends xt{constructor(_0x451a23){super();const _0x1fc833=new kt(),_0xac3dc8=new _0x32fb06(this['locale'],_0x1fc833);this['children']['add'](_0xac3dc8),_0xac3dc8['set']({'label':_0x451a23['prompt'],'withText':!0x0}),_0xac3dc8['on']('execute',()=>{this['fire']('execute',{'value':jt(_0x451a23['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class wt extends _0x26081c{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x452355,_0x599850)=>{const _0x3d59de=os(_0x599850['prompt']);for(const _0x2b0081 of this)if(_0x2b0081!=_0x599850&&os(_0x2b0081['prompt'])===_0x3d59de){this['remove'](_0x2b0081);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0xca47b4=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0xca47b4));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x4b86e9=>_0x4b86e9)));}}function os(_0x1bbfea){return _0x1bbfea['toLowerCase']()['trim']();}class _ extends _0x57a4eb{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x1c3de9,_0x442370,_0xeffdc3=''){super(_0x1c3de9),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 wt(),this['errorView']=new st(_0x1c3de9),this['contentArea']=new Y(_0x1c3de9,_0xeffdc3),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 mt(),this['keystrokes']=new ut(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new pt({'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 _0x3da450=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x442370],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x3da450['if']('isError','ck-hidden',_0x570972=>!_0x570972)]},'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'](_0x358dc3=0x1){-0x1===_0x358dc3?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 _0x47319f=this['locale'],_0xe1344c=new ct(_0x47319f,{'queryView':{'label':i(_0x47319f,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':dt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x47319f,'Empty\x20history'),'secondary':i(_0x47319f,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0xe1344c['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x494509,_0x31795b)=>_0x494509&&!_0x31795b),this['listenTo'](_0xe1344c,'submit',(_0x39bbf5,_0x562f21)=>{this['prompt']=_0x562f21;const _0x518b89=yt(_0x562f21);this['fire']('submitPrompt',_0x518b89),_0x562f21['trim']()&&this['_promptHistory']['add']({'prompt':_0x518b89},0x0);},{'priority':'high'}),_0xe1344c;}['_createHistoryView'](){const _0xd991a2=new ft(this['locale']);return _0xd991a2['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](bt),_0xd991a2['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0xd991a2;}['_createToolbar'](){const _0x5e66fe=new lt(this['locale']);return _0x5e66fe['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x502a67,_0x308906,_0x338578)=>_0x502a67&&!_0x308906&&!!_0x338578),_0x5e66fe['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x5e66fe['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5b71a5,_0x5ef6c9,_0x5c90a2)=>_0x5b71a5&&!_0x5ef6c9&&!!_0x5c90a2),_0x5e66fe['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x5e66fe['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0xb6a20d,_0x185397)=>_0xb6a20d&&!_0x185397),_0x5e66fe['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x5e66fe['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x5e66fe['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x5e66fe;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x5df235=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x5df235,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x244c3){const _0x3b4a83=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x244c3||i(_0x3b4a83,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x927366{['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[_0x4116fa,a,E,_0xb6f4c];}constructor(_0x52c50b){super(_0x52c50b),_0x52c50b['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x52c50b['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x52c50b['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x52c50b['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x597285}=this;this['_aiAdapter']=_0x597285['plugins']['get'](E),this['_dialog']=_0x597285['plugins']['get'](_0xb6f4c),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x52e103=new j(_0x597285,Array['from'](this['_commandDefinitions']['values']()));_0x597285['commands']['add']('showAIAssistant',_0x52e103),_0x597285['ui']['componentFactory']['add']('aiCommands',_0x4e0faf=>{const _0x2d1fdc=_0x3b3f32(_0x4e0faf);return _0x2d1fdc['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x2d1fdc['buttonView']['set']({'label':i(_0x4e0faf,'AI\x20Commands'),'icon':_0x24ce9a,'tooltip':!0x0}),_0x2d1fdc['on']('execute',_0x80cc34=>this['_onExecute'](_0x80cc34['source']['id'])),_0x347b01(_0x2d1fdc,_0x597285['ui']['view']['body'],function(_0x23d43b){const _0x344ec4=o(_0x23d43b['config']['get']('ai.aiAssistant.commands'),_0x23d43b['locale']),_0xc768fa=U(_0x23d43b,_0x344ec4)['filter'](_0x513d46=>_0x513d46['commands']['length']);if(0x1===_0xc768fa['length'])return U(_0x23d43b,_0xc768fa[0x0]['commands'])['map'](_0x2ace8c=>({'id':_0x2ace8c['id'],'label':_0x2ace8c['label']}));return _0xc768fa['map'](_0x5d3236=>{const {groupId:_0x529a21,groupLabel:_0x16646f,commands:_0x48526f}=_0x5d3236,_0x3ea1ee=U(_0x23d43b,_0x48526f)['map'](_0x4f83d9=>({'id':_0x4f83d9['id'],'label':_0x4f83d9['label']}));return{'id':_0x529a21,'menu':_0x16646f||_0x529a21,'children':_0x3ea1ee};});}(_0x597285),{'ariaLabel':i(_0x4e0faf,'AI\x20Commands')}),_0x2d1fdc['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x52e103['on']('change:enabledCommandsIds',_0x139e3c),_0x2d1fdc['menuView']['once']('render',_0x139e3c),_0x2d1fdc;function _0x139e3c(){_0x2d1fdc['isEnabled']=_0x52e103['enabledCommandsIds']['length']>0x0;for(const _0x5c7590 of _0x2d1fdc['menuView']['buttons'])_0x5c7590['isEnabled']=_0x52e103['enabledCommandsIds']['includes'](_0x5c7590['id']);}}),_0x597285['ui']['componentFactory']['add']('menuBar:aiCommands',_0x1b11ee=>{const _0x5add4b=new _0x9d6b6e(_0x1b11ee);_0x5add4b['buttonView']['set']({'label':i(_0x1b11ee,'AI\x20Commands'),'icon':_0x24ce9a}),_0x5add4b['bind']('isEnabled')['to'](_0x52e103,'enabledCommandsIds',_0x3fea07=>_0x3fea07['length']>0x0);const _0x4209c1=o(_0x597285['config']['get']('ai.aiAssistant.commands'),_0x1b11ee);return this['_populateMenuBarMenu'](_0x52e103,_0x5add4b,_0x4209c1,_0x26aa24=>this['_onExecute'](_0x26aa24)),_0x5add4b;}),_0x597285['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x5d1ccf=this['_createAIAssistantUIButton'](_0x32fb06);return _0x5d1ccf['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x5d1ccf;}),_0x597285['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x44e266=this['_createAIAssistantUIButton'](_0x154fab);return _0x44e266['set']({'role':'menuitemcheckbox'}),_0x44e266;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x1c78d8=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x358b99;for(const _0x1dbef9 in _0x1c78d8){const _0x5971cf=_0x1dbef9,_0x366044=_0x1c78d8[_0x5971cf];if('aiLicenseKeyValid'==_0x366044||'aiLicenseKeyInvalid'==_0x366044||'aiLicenseKeyExpired'==_0x366044||'aiLicenseKeyDomainLimit'==_0x366044||'aiLicenseKeyNotAllowed'==_0x366044||'aiLicenseKeyEvaluationLimit'==_0x366044||'aiLicenseKeyTrialLimit'==_0x366044||'aiLicenseKeyUsageLimit'==_0x366044){delete _0x1c78d8[_0x5971cf],_0x358b99=_0x366044,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x358b99&&_0x1c78d8['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x358b99&&_0x1c78d8['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x358b99&&_0x1c78d8['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x358b99&&_0x1c78d8['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x358b99&&_0x1c78d8['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x358b99&&_0x1c78d8['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x358b99&&_0x1c78d8['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x102bf9='',_0x5eec71='',_0x33ce9b='custom'){const _0x14f2ad=this['editor'],_0x1821e3=_0x14f2ad['editing']['view'],_0x5a9c75=_0x14f2ad['plugins']['get'](a),_0x22590a=_0x14f2ad['plugins']['get'](_0x4116fa);_0x5a9c75['showFakeVisualSelection']();const _0x39ea48=new w(),_0x388cde=new ClipboardEvent('copy',{'clipboardData':_0x39ea48}),_0x218549=new _0x5e8ff2(_0x39ea48),_0x4df855=new _0xa7865a(_0x1821e3,_0x388cde,{'dataTransfer':_0x218549});_0x22590a['_forceMarkersCopy']('comment',()=>{_0x1821e3['document']['fire']('copy',_0x4df855);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new k(_0x14f2ad,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x5197c4=_0x218549['getData']('text/html');const _0x2432cd=_0x14f2ad['model']['document']['selection'],_0x2dcd9d=Array['from'](_0x2432cd['getRanges']());0x1===_0x2dcd9d['length']&&_0x2dcd9d[0x0]['isFlat']&&!_0x2432cd['getSelectedElement']()&&''!==_0x5197c4['replace'](/&nbsp;/g,'')['trim']()&&(_0x5197c4='<p>'+_0x5197c4+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x33ce9b,'query':_0x102bf9,'htmlContent':_0x5197c4,'label':_0x5eec71,'mainActionLabel':M[_0x14f2ad['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x39c6e6,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x14ddc6['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x5a9c75['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x5c2fe7=new Map(),_0x312d81=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x3f42cb of _0x312d81)for(const _0x444037 of _0x3f42cb['commands'])_0x5c2fe7['set'](_0x444037['id'],{..._0x444037,'groupId':_0x3f42cb['groupId'],'groupLabel':_0x3f42cb['groupLabel']||_0x3f42cb['groupId']});return _0x5c2fe7;}['_createAIAssistantUIButton'](_0x174ef4){const _0x4f9acd=this['editor'],_0x2bf321=_0x4f9acd['commands']['get']('showAIAssistant'),_0x3beaac=new _0x174ef4(_0x4f9acd['locale']);return _0x3beaac['set']({'label':i(_0x4f9acd['locale'],'AI\x20Assistant'),'icon':_0x39c6e6,'isToggleable':!0x0}),_0x3beaac['bind']('isEnabled')['to'](_0x2bf321),_0x3beaac['bind']('isOn')['to'](this['_dialog'],'id',_0x522feb=>'aiAssistant'===_0x522feb),this['listenTo'](_0x3beaac,'execute',()=>{_0x3beaac['isOn']?this['hideUI']():_0x2bf321['execute']();}),_0x3beaac;}['_initView'](){const _0x142120=this['editor']['plugins']['get'](a);this['_formView']=new _(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',()=>{_0x142120['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x142120['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x4cd8e5,ui:{ariaLiveAnnouncer:_0x1c29f7}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x226af0,_0x20f682,_0x5eeb82)=>{const _0x1380c8=this['_aiAssistantController']['currentContext'];_0x5eeb82?_0x1c29f7['announce'](i(_0x4cd8e5,'AI\x20is\x20writing')):_0x1380c8&&_0x1c29f7['announce'](i(_0x4cd8e5,'Generated\x20content:\x20%0',_0x1380c8),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x10ecc4,_0x5ad95e,_0x5f2e79)=>{if(_0x5f2e79){const _0x51b442=this['_formView']['errorView']['text'];_0x1c29f7['announce'](i(_0x4cd8e5,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x51b442));}});}['_onExecute'](_0x3892e0){const _0x12f836=this['_commandDefinitions']['get'](_0x3892e0),_0xb20415=this['editor'],_0x557932=_0xb20415['model']['document']['selection'],_0x512bdc=_0xb20415['commands']['get']('showAIAssistant'),_0x4e4ea1=_0xb20415['plugins']['get'](a),_0x4d8038=''+(_0x12f836['groupId']!==x?_0x12f836['groupLabel']+':\x20':'')+_0x12f836['label'];if(!0x1!==_0x12f836['requiresContent']&&_0x557932['isCollapsed']){const _0x260cfe=_0x49cf83(_0x557932['getSelectedBlocks']())||_0xb20415['model']['schema']['getLimitElement'](_0x557932);_0xb20415['model']['change'](_0xfe7b81=>{_0xfe7b81['setSelection'](_0x260cfe,'in');});}_0x4e4ea1['showFakeVisualSelection'](),_0x512bdc['execute'](_0x12f836['prompt'],_0x4d8038,'command:'+_0x3892e0);}['_populateMenuBarMenu'](_0x6b7ba7,_0x32f4ed,_0x5ddadb,_0xce7b02){const _0x4c32ce=this['editor'],_0x17e4ce=_0x4c32ce['locale'],_0x7324de=new _0x1d966f(_0x17e4ce),_0x5b988a=U(_0x4c32ce,_0x5ddadb)['filter'](_0x4f1bed=>_0x4f1bed['commands']['length']);0x1===_0x5b988a['length']?this['_getMenuBarGroupButtons']({'command':_0x6b7ba7,'commands':_0x5b988a[0x0]['commands'],'parentMenuView':_0x32f4ed,'onExecute':_0xce7b02})['forEach'](_0x1c3fec=>_0x7324de['items']['add'](_0x1c3fec)):_0x5b988a['forEach'](({groupId:_0x491c94,groupLabel:_0x5bfc5b,commands:_0x44376c})=>{const _0x369e23=new _0x2018e9(_0x17e4ce,_0x32f4ed),_0x1d9204=new _0x9d6b6e(_0x17e4ce),_0x295886=new _0x1d966f(_0x17e4ce),_0x2021a8=this['_getMenuBarGroupButtons']({'command':_0x6b7ba7,'commands':_0x44376c,'parentMenuView':_0x1d9204,'onExecute':_0xce7b02});_0x1d9204['buttonView']['set']({'label':_0x5bfc5b||_0x491c94}),_0x1d9204['delegate']('execute')['to'](_0x32f4ed),_0x295886['items']['addMany'](_0x2021a8),_0x1d9204['panelView']['children']['add'](_0x295886),_0x369e23['children']['add'](_0x1d9204),_0x7324de['items']['add'](_0x369e23);}),_0x32f4ed['panelView']['children']['add'](_0x7324de);}['_getMenuBarGroupButtons']({command:_0x48bb97,commands:_0x3deea5,parentMenuView:_0x5839fe,onExecute:_0x576f5c}){const _0x329f08=this['editor'],_0x485c18=_0x329f08['locale'];return U(_0x329f08,_0x3deea5)['map'](_0x25f6da=>{const _0x62d1b4=new _0x2018e9(_0x485c18,_0x5839fe),_0x458c20=new _0x154fab(_0x485c18);return _0x458c20['set']({'label':_0x25f6da['label']}),_0x458c20['delegate']('execute')['to'](_0x5839fe),_0x458c20['on']('execute',()=>_0x576f5c(_0x25f6da['id'])),_0x458c20['bind']('isEnabled')['to'](_0x48bb97,'enabledCommandsIds',_0x3b9c4c=>_0x3b9c4c['includes'](_0x25f6da['id'])),_0x62d1b4['children']['add'](_0x458c20),_0x62d1b4;});}}function B(_0x263c2c,_0x187d81){return void 0x0!==_0x263c2c['order']&&void 0x0===_0x187d81['order']?0x1:void 0x0===_0x263c2c['order']&&void 0x0!==_0x187d81['order']?-0x1:void 0x0!==_0x263c2c['order']&&void 0x0!==_0x187d81['order']?_0x263c2c['order']-_0x187d81['order']:0x0;}function U(_0x552e05,_0x46e766){_0x46e766['sort'](B);const _0x54192a={},_0x476321=[];for(const _0x255f38 of _0x46e766)if(void 0x0!==_0x255f38['order']){if(_0x255f38['order']in _0x54192a)throw new _0x55136d('ai-commands-config-order-collision',_0x552e05,{'conflictingDefinitions':[_0x255f38,_0x54192a[_0x255f38['order']]]});_0x54192a[_0x255f38['order']]=_0x255f38,_0x476321['splice'](_0x255f38['order'],0x0,_0x255f38);}else _0x476321['push'](_0x255f38);return _0x476321;}class r extends _0x927366{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4108a7){super(_0x4108a7);const _0x5eb179=_0x4108a7['config'],_0x14f903=_0x4108a7['locale'];_0x5eb179['define']('ai.aiAssistant.preserveComments',!0x0),_0x5eb179['define']('ai.aiAssistant.commands',function(_0x52f6fc){return[{'groupId':'editOrReview','groupLabel':i(_0x52f6fc,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x52f6fc,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x52f6fc,'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(_0x52f6fc,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x52f6fc,'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(_0x52f6fc,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x52f6fc,'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(_0x52f6fc,'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(_0x52f6fc,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x52f6fc,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x52f6fc,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x52f6fc,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x52f6fc,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x52f6fc,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x52f6fc,'Change\x20style'),'commands':[{'id':'business','label':i(_0x52f6fc,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x52f6fc,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x52f6fc,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x52f6fc,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x52f6fc,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x52f6fc,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x52f6fc,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x52f6fc,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x52f6fc,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x52f6fc,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x52f6fc,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x52f6fc,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x52f6fc,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x14f903)),_0x5eb179['define']('ai.aiAssistant.extraCommandGroups',[]),_0x5eb179['define']('ai.aiAssistant.removeCommands',[]);let _0x38bce6=o(_0x5eb179['get']('ai.aiAssistant.commands'),_0x14f903);const _0x263532=_0x5eb179['get']('ai.aiAssistant.extraCommandGroups'),_0x510502=_0x5eb179['get']('ai.aiAssistant.removeCommands');_0x263532['forEach'](_0x46fadd=>{const _0x375257=_0x38bce6['find'](_0x39be83=>_0x39be83['groupId']===_0x46fadd['groupId']);_0x375257?_0x375257['commands']=_0x375257['commands']['concat'](_0x46fadd['commands']):_0x38bce6['push'](_0x46fadd);}),_0x38bce6=_0x38bce6['filter'](_0x3a8ac3=>!_0x510502['includes'](_0x3a8ac3['groupId'])),_0x38bce6['forEach'](_0x565f34=>{_0x565f34['commands']=_0x565f34['commands']['filter'](_0x523cd2=>!_0x510502['includes'](_0x523cd2['id']));}),_0x5eb179['set']('ai.aiAssistant.commands',_0x38bce6);}}class P extends _0x927366{['abortController'];static get['requires'](){return[E];}constructor(_0x16122d){super(_0x16122d),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](E)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x41b975){return this['sendRequest'](_0x41b975)['catch'](_0x4d47d2=>{if(_0x4d47d2 instanceof R)return Promise['reject'](_0x4d47d2);if('AbortError'==_0x4d47d2['name'])return Promise['resolve']();throw console['error'](_0x4d47d2),new _0x55136d('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x5077e7,_0x1dec9b){const _0x263411=this['editor']['locale'],_0x3f906a={'Content-Type':'application/json'};if('object'==typeof _0x5077e7)Object['assign'](_0x3f906a,_0x5077e7);else{if(_0x5077e7)try{const _0x1e82e5=await _0x5077e7(_0x1dec9b);Object['assign'](_0x3f906a,_0x1e82e5);}catch{return Promise['reject'](new R(i(_0x263411,'AI_ERROR_GET_HEADERS')));}}return _0x3f906a;}async['_prepareRequestParameters'](_0x301914,_0x42c1e6){const _0x592466=this['editor']['locale'];if('object'==typeof _0x301914)return _0x301914;try{return await _0x301914(_0x42c1e6);}catch{return Promise['reject'](new R(i(_0x592466,'AI_ERROR_GET_PARAMETERS')));}}}class O extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x43fbc6){super(_0x43fbc6),_0x43fbc6['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x43fbc6['config']['get']('ai.openAI.requestParameters')||_0x43fbc6['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x43fbc6['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x43fbc6['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x43fbc6['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x1a208c,context:_0x37b4e1,onData:_0x3dbf85,actionId:_0x387d7f}){const _0xf0271e=this['editor']['locale'],_0x575304=await this['prepareMessages'](_0x1a208c,_0x37b4e1,_0x387d7f),_0xda3eda=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x387d7f),_0xb3811a=await this['_prepareRequestParameters'](this['_requestParameters'],_0x387d7f),_0xb05cf={'messages':_0x575304,..._0xb3811a},_0x11a935={'method':'POST','headers':_0xda3eda,'body':JSON['stringify'](_0xb05cf),'signal':this['abortController']['signal']},_0x10a01a=await fetch(this['_apiUrl'],_0x11a935);if(_0x10a01a['ok'])return _0xb3811a['stream']?await this['_readStreamableResponse'](_0x10a01a,_0x3dbf85):await this['_readStaticResponse'](_0x10a01a,_0x3dbf85),Promise['resolve']();{const _0x39f773=await _0x10a01a['text']();return _0x39f773['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0xf0271e,'AI_ERROR_CONTEXT_LENGTH'))):_0x39f773['includes']('Moderation')?Promise['reject'](new R(i(_0xf0271e,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x39f773));}}async['prepareMessages'](_0x2afe14,_0x4277f3,_0x40310d){let _0x4a82c5,_0x5b5551;return _0x4277f3?(_0x4a82c5='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.',_0x5b5551='Instruction:\x0a'+_0x2afe14+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x4277f3):(_0x4a82c5='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.',_0x5b5551=_0x2afe14),[{'role':'system','content':_0x4a82c5},{'role':'user','content':_0x5b5551}];}async['_readStreamableResponse'](_0x511872,_0x28d794){const _0x4570fe=_0x511872['body']['getReader'](),_0x402ebd=new TextDecoder();let _0x52033b='',_0x13fb15='',_0x402f11='',_0x507951=!0x1;for(;!_0x507951;){const {done:_0x25d54a,value:_0x8bdf03}=await _0x4570fe['read'](),_0x24e9e1=_0x52033b+_0x402ebd['decode'](_0x8bdf03);let _0x3fd345='';_0x507951=_0x25d54a;try{_0x3fd345=this['_cleanUpData'](_0x24e9e1),_0x52033b='';}catch{_0x52033b=_0x24e9e1;continue;}_0x13fb15+=_0x3fd345,!_0x507951&&this['_isBufferIncomplete'](_0x13fb15)||_0x13fb15&&(_0x402f11+=_0x13fb15,_0x13fb15='',_0x28d794(_0x402f11));}return Promise['resolve']();}async['_readStaticResponse'](_0x5ffd0f,_0x18f93c){return _0x18f93c((await _0x5ffd0f['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x255387){const _0x5995d3=_0x255387['split']('<')['length']!==_0x255387['split']('>')['length'],_0x78fae7=_0x255387['length']<0x1e;return _0x5995d3&&_0x78fae7;}['_cleanUpData'](_0x3bdad6){return _0x3bdad6['split'](/\n(?![^{]*\})/g)['map'](_0x9c8d3d=>_0x9c8d3d['replace']('data:\x20',''))['filter'](_0x1445dc=>_0x1445dc&&_0x1445dc['length']>0x0&&'[DONE]'!==_0x1445dc)['map'](_0x50ee8b=>{const {choices:_0x465f78}=JSON['parse'](_0x50ee8b);if(_0x465f78[0x0]?.['delta']?.['content'])return _0x465f78[0x0]['delta']['content'];})['filter'](_0x4af9e2=>_0x4af9e2)['join']('');}}class D extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x4bfd89){super(_0x4bfd89),_0x4bfd89['config']['get']('ai.aws.requestParameters')||_0x4bfd89['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']=_0x4bfd89['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x4bfd89['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x4bfd89['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x4bfd89['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x316393,context:_0x5a20d8,onData:_0x5cb78b,actionId:_0x280396}){const {model:_0x5c13e9,stream:_0x3fc1f5,..._0x51f737}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x280396),_0x3ea911={'prompt':await this['preparePrompt'](_0x316393,_0x5a20d8,_0x5c13e9,_0x280396),..._0x51f737};this['_apiUrl']?await this['_processProxyRequest'](_0x3ea911,_0x5c13e9,_0x3fc1f5,_0x5cb78b,_0x280396):await this['_processAWSRequest'](_0x3ea911,_0x5c13e9,_0x3fc1f5,_0x5cb78b);}async['preparePrompt'](_0x1a3d81,_0x2a33af,_0x3cb184,_0x516ff2){let _0x39d714,_0x241ca2;return _0x2a33af?(_0x39d714='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.',_0x241ca2='Instruction:\x0a'+_0x1a3d81+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x2a33af):(_0x39d714='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.',_0x241ca2=_0x1a3d81),'meta.llama'==this['getModelFamily'](_0x3cb184)?'<<SYS>>\x0a'+_0x39d714+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x241ca2+'\x0a[/INST]':'Human:\x0a'+_0x39d714+'\x0a'+_0x241ca2+'\x0a\x0aAssistant:';}['getModelFamily'](_0x422b2d){if(/^anthropic\.claude/['test'](_0x422b2d))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x422b2d))return'ai21.j2';if(/^cohere\.command/['test'](_0x422b2d))return'cohere.command';if(/^meta\.llama/['test'](_0x422b2d))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x422b2d));}async['_processProxyRequest'](_0x3e0678,_0x598a1f,_0x4fdf41,_0x3fcd80,_0x57fb0c){const _0x3cdfec={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x57fb0c),'body':JSON['stringify']({..._0x3e0678,'model':_0x598a1f,'stream':_0x4fdf41}),'signal':this['abortController']['signal']},_0x605637=await fetch(this['_apiUrl'],_0x3cdfec);_0x4fdf41?await this['_readStreamableResponse'](_0x605637,_0x598a1f,_0x3fcd80):await this['_readStaticResponse'](_0x605637,_0x598a1f,_0x3fcd80);}async['_processAWSRequest'](_0x1b2c87,_0x3bda1b,_0x57a793,_0x2125f1){const _0x11c08e=new _0xcda68d(this['_bedrockClientConfig']),_0x1420dd={'body':JSON['stringify'](_0x1b2c87),'contentType':'application/json','accept':'application/json','modelId':_0x3bda1b};let _0x7f2606;if(_0x57a793){const _0x124f37=new _0x4f2d5d(_0x1420dd);_0x7f2606=await _0x11c08e['send'](_0x124f37,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x7f2606,_0x3bda1b,_0x2125f1);}else{const _0x553c4c=new _0x21aacd(_0x1420dd);_0x7f2606=await _0x11c08e['send'](_0x553c4c,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x7f2606,_0x3bda1b,_0x2125f1);}}async['_readAsyncIterableResponse'](_0x577417,_0xbee65d,_0x3eb3fc){const _0x20d6ea=_0x577417['body'],_0x1aa10c=new TextDecoder('utf-8');let _0x5d98f3='';for await(const _0x160a62 of _0x20d6ea)if(_0x160a62['chunk']){const _0x1cdef3=_0x1aa10c['decode'](_0x160a62['chunk']['bytes']),_0x3b4a16=JSON['parse'](_0x1cdef3);_0x5d98f3+=this['_getGeneratedText'](_0x3b4a16,_0xbee65d),_0x3eb3fc(_0x5d98f3);}return Promise['resolve']();}async['_readStreamableResponse'](_0x17f577,_0x43ca77,_0x44685f){const _0x4249a6=_0x17f577['body'],_0x25457f=new TextDecoder('utf-8'),_0x441862=_0x4249a6['getReader']();let _0x3af5b1='',_0x2fcbbc='',_0x184ad9=!0x1;for(;!_0x184ad9;){const {done:_0x1bc4a4,value:_0x1ac930}=await _0x441862['read']();if(_0x184ad9=_0x1bc4a4,_0x184ad9)break;const _0x12f57c=(_0x3af5b1+_0x25457f['decode'](_0x1ac930))['split']('\x0a')['map'](_0x27b1ba=>{try{return _0x3af5b1='',JSON['parse'](_0x27b1ba);}catch{return _0x3af5b1=_0x27b1ba,null;}})['filter'](_0xc6901=>null!==_0xc6901);_0x12f57c['length']&&(_0x2fcbbc+=_0x12f57c['map'](_0x1a1933=>this['_getGeneratedText'](_0x1a1933,_0x43ca77))['join'](''),_0x44685f(_0x2fcbbc));}return Promise['resolve']();}async['_readStaticResponse'](_0x57b6ea,_0x5cb8d7,_0x570956){let _0x327f34;return _0x327f34=_0x57b6ea instanceof Response?await _0x57b6ea['json']():JSON['parse'](Buffer['from'](_0x57b6ea['body'])['toString']('utf8')),(_0x570956(this['_getGeneratedText'](_0x327f34,_0x5cb8d7)),Promise['resolve']());}['_getGeneratedText'](_0x343d2b,_0x42c4e5){switch(this['getModelFamily'](_0x42c4e5)){case'anthropic.claude':return _0x343d2b['completion'];case'ai21.j2':return _0x343d2b['completions'][0x0]['data']['text'];case'cohere.command':return _0x343d2b['generations'][0x0]['text'];case'meta.llama':return _0x343d2b['generation'];}}}export{E as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,D as AWSTextAdapter,O as OpenAITextAdapter};
23
+ import{Plugin as _0xc864ee,Command as _0x30a3d7}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x4f9978,IconCheck as _0x32013a,IconError as tt,IconSubmit as ht,IconHistory as et,IconMagicWand as _0x298ed9,IconRobotPencil as _0x2cc26d}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x5579b3,CKEditorError as _0x281fa8,ObservableMixin as _0x3a8963,global as _0x164716,isVisible as ot,Rect as it,Collection as _0xaca819,FocusTracker as mt,KeystrokeHandler as ut,first as _0x11ebc1}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as at,ButtonView as _0x1ff820,View as _0x559cde,SpinnerView as _0x166153,IconView as rt,AutocompleteView as nt,ListView as Ct,ListItemGroupView as Ht,ListItemView as xt,ButtonLabelView as kt,FocusCycler as pt,createLabeledTextarea as dt,Dialog as _0x1c2c3e,createDropdown as _0x4068e4,addMenuToDropdown as _0x3d31b6,MenuBarMenuView as _0x3cfd0c,MenuBarMenuListItemButtonView as _0x44f383,DialogViewPosition as _0x259cb3,MenuBarMenuListView as _0x1fe226,MenuBarMenuListItemView as _0x4dbae5}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x3c3018,ClipboardMarkersUtils as _0x52cc6a}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x3d6480,DataTransfer as _0xa62118,UpcastWriter as _0x5f1aeb,Matcher as _0x2ec3f6}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as jt,escape as yt}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x453882,InvokeModelWithResponseStreamCommand as _0x2d6abb,InvokeModelCommand as _0x212135}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x42e000,_0x398ec6){const _0x5309d2=(0x0,_0x398ec6['t'])('Other');return _0x42e000['length']?'groupId'in _0x42e000[0x0]?_0x42e000:[{'groupId':x,'groupLabel':_0x5309d2,'order':0x1/0x0,'commands':_0x42e000}]:[{'groupId':x,'groupLabel':_0x5309d2,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],f='ai-ui';class a extends _0xc864ee{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x5e0dcf}=this,_0x46c578=['ck-fake-ai-selection'];_0x5e0dcf['config']['get']('ai.useTheme')&&_0x46c578['push']('ck-ai-assistant-ui_theme'),_0x5e0dcf['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x46c578,'priority':0xc}}),_0x5e0dcf['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x5e5838,{writer:_0x562bb1})=>{if(!_0x5e5838['markerRange']['isCollapsed'])return null;const _0x44fc5c=_0x562bb1['createUIElement']('span');return _0x562bb1['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x44fc5c),_0x44fc5c;}});}['afterInit'](){!async function(_0x12bd49){const _0x570a92=_0x5390ff([0x68,0x42,0x73,0x49,0x4d,0x4b,0x35,0x4e,0x31,0x37,0x52,0x4f,0x55,0x78,0x54,0x33,0x67,0x53,0x69,0x77,0x70,0x75,0x5a,0x51,0x48,0x4c,0x79,0x56,0x72,0x65,0x6f,0x58,0x39,0x59,0x32,0x38,0x6a,0x61,0x62,0x7a,0x6b,0x6d,0x6e,0x50,0x76,0x57,0x41,0x74,0x30,0x46,0x43,0x64,0x36,0x66,0x45,0x63,0x71,0x4a,0x47,0x34,0x44,0x6c]),_0x524587=0x20263107,_0x1d5de3=0x20215bbf^_0x524587,_0x2bec49=window[_0x5390ff([0x44,0x61,0x74,0x65])][_0x5390ff([0x6e,0x6f,0x77])](),_0x1a8a7d=_0x12bd49[_0x5390ff([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x443c41=new window[(_0x5390ff([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x212e2a=>{_0x1a8a7d[_0x5390ff([0x6f,0x6e,0x63,0x65])](_0x5390ff([0x72,0x65,0x61,0x64,0x79]),_0x212e2a);}),_0x2697d5={[_0x5390ff([0x6b,0x74,0x79])]:_0x5390ff([0x45,0x43]),[_0x5390ff([0x75,0x73,0x65])]:_0x5390ff([0x73,0x69,0x67]),[_0x5390ff([0x63,0x72,0x76])]:_0x5390ff([0x50,0x2d,0x32,0x35,0x36]),[_0x5390ff([0x78])]:_0x5390ff([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]),[_0x5390ff([0x79])]:_0x5390ff([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]),[_0x5390ff([0x61,0x6c,0x67])]:_0x5390ff([0x45,0x53,0x32,0x35,0x36])},_0x1fd4cc=_0x1a8a7d[_0x5390ff([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x5390ff([0x67,0x65,0x74])](_0x5390ff([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x517819(){let _0x16d3d1,_0x348dba=null,_0x6253d7=null;try{if(_0x1fd4cc==_0x5390ff([0x47,0x50,0x4c]))return _0x5390ff([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x16d3d1=_0x16b810(),!_0x16d3d1)return _0x5390ff([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x16d3d1[_0x5390ff([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x6253d7=_0x3cd614(_0x16d3d1[_0x5390ff([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x16d3d1[_0x5390ff([0x6a,0x74,0x69])])),await _0x4a998f()?_0x3d5795()?_0x3f6024()?_0x5390ff([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x492ae4()?(_0x16d3d1[_0x5390ff([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x5390ff([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x348dba=_0xf8c25b(_0x5390ff([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x16d3d1[_0x5390ff([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x5390ff([0x74,0x72,0x69,0x61,0x6c])&&(_0x348dba=_0xf8c25b(_0x5390ff([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x2bd481()):_0x5390ff([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x5390ff([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x5390ff([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x5390ff([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x3f6024(){const _0x5bed11=[_0x5390ff([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x5390ff([0x74,0x72,0x69,0x61,0x6c])][_0x5390ff([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x16d3d1[_0x5390ff([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x2bec49/0x3e8:0xe10*_0x1d5de3;return _0x16d3d1[_0x5390ff([0x65,0x78,0x70])]<_0x5bed11;}function _0x3d5795(){const _0x4679fe=_0x16d3d1[_0x5390ff([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x4679fe&&(!!_0x4679fe[_0x5390ff([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5390ff([0x2a]))||!!_0x4679fe[_0x5390ff([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5390ff([0x41,0x49])));}function _0x492ae4(){const _0x14da88=_0x16d3d1[_0x5390ff([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x14da88||0x0==_0x14da88[_0x5390ff([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x32d9fa}=new URL(window[_0x5390ff([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x14da88[_0x5390ff([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x32d9fa))return!0x0;const _0x37b6c9=_0x32d9fa[_0x5390ff([0x73,0x70,0x6c,0x69,0x74])](_0x5390ff([0x2e]));return _0x14da88[_0x5390ff([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x110998=>_0x110998[_0x5390ff([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5390ff([0x2a])))[_0x5390ff([0x6d,0x61,0x70])](_0x572ff9=>_0x572ff9[_0x5390ff([0x73,0x70,0x6c,0x69,0x74])](_0x5390ff([0x2e])))[_0x5390ff([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x23b570=>_0x23b570[_0x5390ff([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x37b6c9[_0x5390ff([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x5390ff([0x6d,0x61,0x70])](_0x551298=>Array(_0x37b6c9[_0x5390ff([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x551298[_0x5390ff([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x5390ff([0x66,0x69,0x6c,0x6c])](_0x551298[0x0]===_0x5390ff([0x2a])?_0x5390ff([0x2a]):'')[_0x5390ff([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x551298))[_0x5390ff([0x73,0x6f,0x6d,0x65])](_0x3f09e4=>_0x37b6c9[_0x5390ff([0x65,0x76,0x65,0x72,0x79])]((_0x1f2c07,_0x31bf2f)=>_0x3f09e4[_0x31bf2f]===_0x1f2c07||_0x3f09e4[_0x31bf2f]===_0x5390ff([0x2a])));}function _0x2bd481(){return _0x348dba&&_0x6253d7?new window[(_0x5390ff([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x2f701a,_0x509eeb)=>{_0x348dba[_0x5390ff([0x74,0x68,0x65,0x6e])](_0x2f701a,_0x509eeb),_0x6253d7[_0x5390ff([0x74,0x68,0x65,0x6e])](_0x2b55dd=>{_0x2b55dd!=_0x5390ff([0x56,0x61,0x6c,0x69,0x64])&&_0x2f701a(_0x2b55dd);},_0x509eeb);}):_0x348dba||_0x6253d7||_0x5390ff([0x56,0x61,0x6c,0x69,0x64]);}}function _0x3cd614(_0x18baf0,_0xaa0542){return new window[(_0x5390ff([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4b3e8a=>{if(_0x2a3316())return _0x4b3e8a(_0x5390ff([0x56,0x61,0x6c,0x69,0x64]));_0x42815c(),_0x1a8a7d[_0x5390ff([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x5390ff([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x3383c5=!0x1;const _0x13d5e0=_0x5579b3();function _0x334e75(_0x91a36a){return!!_0x91a36a&&(typeof _0x91a36a===_0x5390ff([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x91a36a===_0x5390ff([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x91a36a[_0x5390ff([0x74,0x68,0x65,0x6e])]===_0x5390ff([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x91a36a[_0x5390ff([0x63,0x61,0x74,0x63,0x68])]===_0x5390ff([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x107b9c(_0xf6d044){_0x51a26a(_0xf6d044)[_0x5390ff([0x74,0x68,0x65,0x6e])](_0x2a314f=>{if(!_0x2a314f||_0x2a314f[_0x5390ff([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x5390ff([0x6f,0x6b]))return _0x5390ff([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x5bf3c0(_0x158af6(_0x13d5e0+_0xaa0542))!=_0x2a314f[_0x5390ff([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x5390ff([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x5390ff([0x56,0x61,0x6c,0x69,0x64]);})[_0x5390ff([0x74,0x68,0x65,0x6e])](_0x24f896=>(_0x1299fd(),_0x24f896),()=>{const _0x30d2c7=_0x177033();return null==_0x30d2c7?(_0x1299fd(),_0x5390ff([0x56,0x61,0x6c,0x69,0x64])):_0x5390ff(_0x2bec49-_0x30d2c7>(0x42ab507^_0x524587)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x5390ff([0x74,0x68,0x65,0x6e])](_0x4b3e8a)[_0x5390ff([0x63,0x61,0x74,0x63,0x68])](()=>{_0x4b3e8a(_0x5390ff([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x771cb0=0x2010df87^_0x524587;function _0x1299fd(){const _0x32fdcc=_0x5390ff([0x6c,0x6c,0x63,0x74,0x2d])+_0x5bf3c0(_0x158af6(_0x18baf0)),_0x9f06f3=_0x6bb4bd(_0x5bf3c0(window[_0x5390ff([0x4d,0x61,0x74,0x68])][_0x5390ff([0x63,0x65,0x69,0x6c])](_0x2bec49/_0x771cb0)));window[_0x5390ff([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x5390ff([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x32fdcc,_0x9f06f3);}function _0x177033(){const _0x16d1c4=_0x5390ff([0x6c,0x6c,0x63,0x74,0x2d])+_0x5bf3c0(_0x158af6(_0x18baf0)),_0x528929=window[_0x5390ff([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x5390ff([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x16d1c4);return _0x528929?window[_0x5390ff([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x6bb4bd(_0x528929),0x10)*_0x771cb0:null;}function _0x51a26a(_0x1c4346){return new window[(_0x5390ff([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x212366,_0x3552ad)=>{_0x1c4346[_0x5390ff([0x74,0x68,0x65,0x6e])](_0x212366,_0x3552ad),window[_0x5390ff([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x3552ad,0x2027e5c7^_0x524587);});}}_0x1a8a7d[_0x5390ff([0x6f,0x6e])](_0x5390ff([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x4e5c0d,_0x216558)=>{if(_0x216558[0x0]!=_0x18baf0)return _0x4b3e8a(_0x5390ff([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x216558[0x1]={..._0x216558[0x1],[_0x5390ff([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x13d5e0};},{[_0x5390ff([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x5390ff([0x68,0x69,0x67,0x68])}),_0x1a8a7d[_0x5390ff([0x6f,0x6e])](_0x5390ff([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x1b3d36=>{_0x334e75(_0x1b3d36[_0x5390ff([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x3383c5=!0x0,_0x107b9c(_0x1b3d36[_0x5390ff([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x5390ff([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x5390ff([0x6c,0x6f,0x77])}),_0x443c41[_0x5390ff([0x74,0x68,0x65,0x6e])](()=>{_0x3383c5||_0x4b3e8a(_0x5390ff([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x2a3316(){return _0x1a8a7d[_0x5390ff([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x5390ff([0x76,0x69,0x65,0x77])][_0x5390ff([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x5390ff([0x61,0x75,0x74,0x6f]);}function _0x42815c(){_0x1a8a7d[_0x5390ff([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x5390ff([0x76,0x69,0x65,0x77])][_0x5390ff([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x5390ff([0x61,0x75,0x74,0x6f]);}}function _0xf8c25b(_0x33ab3c){const _0x3a8336=[new window[(_0x5390ff([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x39a585=>setTimeout(_0x39a585,0x202f0fcb^_0x524587)),_0x443c41[_0x5390ff([0x74,0x68,0x65,0x6e])](()=>new window[(_0x5390ff([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x556512=>{let _0x4c933c=0x0;_0x1a8a7d[_0x5390ff([0x6d,0x6f,0x64,0x65,0x6c])][_0x5390ff([0x6f,0x6e])](_0x5390ff([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x119727,_0x179ac8)=>{_0x179ac8[0x0][_0x5390ff([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x4c933c++,_0x4c933c==(0x202630ff^_0x524587)&&(_0x556512(),_0x119727[_0x5390ff([0x6f,0x66,0x66])]());});}))];return window[_0x5390ff([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x5390ff([0x72,0x61,0x63,0x65])](_0x3a8336)[_0x5390ff([0x74,0x68,0x65,0x6e])](()=>_0x33ab3c);}async function _0x5b8567(){await _0x443c41,_0x1a8a7d[_0x5390ff([0x6d,0x6f,0x64,0x65,0x6c])][_0x5390ff([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x37a510,_0x1a8a7d[_0x5390ff([0x6d,0x6f,0x64,0x65,0x6c])][_0x5390ff([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x37a510,_0x1a8a7d[_0x5390ff([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x5390ff([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x40ec64(_0x429d03){const _0x183f8e=_0x563ccd();_0x1a8a7d[_0x183f8e]=_0x5390ff([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x429d03,_0x429d03!=_0x5390ff([0x56,0x61,0x6c,0x69,0x64])&&_0x5b8567();}function _0x563ccd(){const _0x587424=window[_0x5390ff([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x5390ff([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x5390ff([0x6e,0x6f,0x77])]())[_0x5390ff([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x5390ff([0x2e]),'');let _0x1261ea=_0x5390ff([0x68]);for(let _0xafdf9a=0x0;_0xafdf9a<_0x587424[_0x5390ff([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0xafdf9a+=0x2){let _0x282320=window[_0x5390ff([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x587424[_0x5390ff([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0xafdf9a,_0xafdf9a+0x2));_0x282320>=_0x570a92[_0x5390ff([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x282320-=_0x570a92[_0x5390ff([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x1261ea+=_0x570a92[_0x282320];}return _0x1261ea;}function _0x16b810(){const _0x29d4d8=_0x1fd4cc[_0x5390ff([0x73,0x70,0x6c,0x69,0x74])](_0x5390ff([0x2e]));if(0x3!=_0x29d4d8[_0x5390ff([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x416467(_0x29d4d8[0x1]);function _0x416467(_0x51adf5){const _0x442446=_0x5b419e(_0x51adf5);return _0x442446&&_0x179b4d()?_0x442446:null;function _0x179b4d(){const _0x49fb19=_0x442446[_0x5390ff([0x6a,0x74,0x69])],_0x2439fe=window[_0x5390ff([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x49fb19[_0x5390ff([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x49fb19[_0x5390ff([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x24fc30={..._0x442446,[_0x5390ff([0x6a,0x74,0x69])]:_0x49fb19[_0x5390ff([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x49fb19[_0x5390ff([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x24fc30[_0x5390ff([0x76,0x63])],_0x158af6(_0x24fc30)==_0x2439fe;}}}async function _0x4a998f(){let _0x1fb7f5=!0x0;try{const _0x4e1e23=_0x1fd4cc[_0x5390ff([0x73,0x70,0x6c,0x69,0x74])](_0x5390ff([0x2e])),[_0x21588b,_0x594216,_0x5c853d]=_0x4e1e23;return _0x4d415a(_0x21588b),await _0x5aa60f(_0x21588b,_0x594216,_0x5c853d),_0x1fb7f5;}catch{return!0x1;}function _0x4d415a(_0x504e9d){const _0x23c350=_0x5b419e(_0x504e9d);_0x23c350&&_0x23c350[_0x5390ff([0x61,0x6c,0x67])]==_0x5390ff([0x45,0x53,0x32,0x35,0x36])||(_0x1fb7f5=!0x1);}async function _0x5aa60f(_0xadcfa3,_0x56b721,_0xd7f2c1){const _0xbe23e5=window[_0x5390ff([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x5390ff([0x66,0x72,0x6f,0x6d])](_0x45a7ad(_0xd7f2c1),_0x3414c1=>_0x3414c1[_0x5390ff([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x531870=new window[(_0x5390ff([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x5390ff([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0xadcfa3+_0x5390ff([0x2e])+_0x56b721),_0x27731e=window[_0x5390ff([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x5390ff([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x27731e)return;const _0x56ddc8=await _0x27731e[_0x5390ff([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x5390ff([0x6a,0x77,0x6b]),_0x2697d5,{[_0x5390ff([0x6e,0x61,0x6d,0x65])]:_0x5390ff([0x45,0x43,0x44,0x53,0x41]),[_0x5390ff([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x5390ff([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x5390ff([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x27731e[_0x5390ff([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x5390ff([0x6e,0x61,0x6d,0x65])]:_0x5390ff([0x45,0x43,0x44,0x53,0x41]),[_0x5390ff([0x68,0x61,0x73,0x68])]:{[_0x5390ff([0x6e,0x61,0x6d,0x65])]:_0x5390ff([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x56ddc8,_0xbe23e5,_0x531870)||(_0x1fb7f5=!0x1);}}function _0x5b419e(_0x16ee65){return _0x16ee65[_0x5390ff([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x5390ff([0x65,0x79]))?JSON[_0x5390ff([0x70,0x61,0x72,0x73,0x65])](_0x45a7ad(_0x16ee65)):null;}function _0x45a7ad(_0x396969){return window[_0x5390ff([0x61,0x74,0x6f,0x62])](_0x396969[_0x5390ff([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x5390ff([0x2b]))[_0x5390ff([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x5390ff([0x2f])));}function _0x158af6(_0x468fdf){let _0x2488ac=0x1505;function _0x282a7d(_0x30bea1){for(let _0x192f54=0x0;_0x192f54<_0x30bea1[_0x5390ff([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x192f54++){const _0x1037bf=_0x30bea1[_0x5390ff([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x192f54);_0x2488ac=(_0x2488ac<<0x5)+_0x2488ac+_0x1037bf,_0x2488ac&=_0x2488ac;}}function _0x4bb18a(_0x2b0e02){Array[_0x5390ff([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x2b0e02)?_0x2b0e02[_0x5390ff([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x4bb18a):_0x2b0e02&&typeof _0x2b0e02==_0x5390ff([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x5390ff([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x2b0e02)[_0x5390ff([0x73,0x6f,0x72,0x74])]()[_0x5390ff([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x13e855,_0x5ef2b4])=>{_0x282a7d(_0x13e855),_0x4bb18a(_0x5ef2b4);}):_0x282a7d(window[_0x5390ff([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x2b0e02));}return _0x4bb18a(_0x468fdf),_0x2488ac>>>0x0;}function _0x5bf3c0(_0x441db3){return _0x441db3[_0x5390ff([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x5390ff([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x5390ff([0x30]));}function _0x6bb4bd(_0x122461){return _0x122461[_0x5390ff([0x73,0x70,0x6c,0x69,0x74])]('')[_0x5390ff([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x5390ff([0x6a,0x6f,0x69,0x6e])]('');}function _0x37a510(){}function _0x5390ff(_0x28545f){return _0x28545f['map'](_0x220386=>String['fromCharCode'](_0x220386))['join']('');}_0x40ec64(await _0x517819());}(this);}['showFakeVisualSelection'](){const _0x2cbe51=this['editor']['model'];_0x2cbe51['change'](_0x1600d8=>{const _0x18c77e=_0x2cbe51['document']['selection']['getRanges']();let _0x225570=0x0;for(const _0x142aec of _0x18c77e){const _0xafcddd=f+':'+_0x225570;if(_0x2cbe51['markers']['has'](_0xafcddd))_0x1600d8['updateMarker'](_0xafcddd,{'range':_0x142aec});else{if(_0x142aec['start']['isAtEnd']){const _0x39a6f2=_0x142aec['start']['getLastMatchingPosition'](({item:_0x45a469})=>!_0x2cbe51['schema']['isContent'](_0x45a469),{'boundaries':_0x142aec});_0x1600d8['addMarker'](_0xafcddd,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1600d8['createRange'](_0x39a6f2,_0x142aec['end'])});}else _0x1600d8['addMarker'](_0xafcddd,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x142aec});}_0x225570++;}});}['hideFakeVisualSelection'](){const _0x36185f=this['editor']['model'],_0x4e8875=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x4e8875['length']&&_0x36185f['change'](_0x2d9b99=>{_0x4e8875['forEach'](_0x56f585=>{_0x2d9b99['removeMarker'](_0x56f585);});});}['insertContent'](_0x323442,_0x231ab3){const _0x418379=this['_getAISelection'](),_0x26ecae=_0x231ab3||_0x418379['getFirstRange']();this['editor']['model']['canEditAt'](_0x26ecae)&&this['editor']['model']['change'](_0x5eeaee=>{this['hideFakeVisualSelection'](),_0x231ab3||this['_resetContentOfSelectedTableCells'](_0x5eeaee,_0x418379),this['_pasteHTMLUsingClipboard']({'insertAt':_0x26ecae,'writer':_0x5eeaee,'html':_0x323442});});}['insertContentBelow'](_0x33c979){const {model:_0x58fce9}=this['editor'],_0x5367b2=this['_getAISelection']();_0x58fce9['change'](()=>{const _0x10ef64=this['_prepareTableInsertBelowPosition'](_0x33c979,_0x5367b2)||this['_getDefaultInsertBelowPosition'](_0x5367b2);this['insertContent'](_0x33c979,_0x10ef64);});}['_getAISelection'](){const _0x3b0096=this['editor']['model'],_0x3815f1=Array['from'](_0x3b0096['markers']['getMarkersGroup'](f))['map'](_0x15f513=>_0x15f513['getRange']());return _0x3b0096['createSelection'](_0x3815f1);}['_pasteHTMLUsingClipboard']({writer:_0x45c9e1,html:_0x112134,insertAt:_0x41bda4}){const {view:_0x4bf737}=this['editor']['editing'],_0x4e6e05=this['editor']['plugins']['get'](_0x3c3018),_0xbada94=new gt();_0xbada94['setData']('text/html',_0x112134);const _0x138f5e=new ClipboardEvent('paste',{'clipboardData':_0xbada94}),_0x5f29ea=new _0x3d6480(_0x4bf737,_0x138f5e,{'dataTransfer':new _0xa62118(_0xbada94)});_0x45c9e1['setSelection'](_0x41bda4);const _0x2aee3d=(_0x6c0f38,_0x4dd5a4)=>{_0x4dd5a4['resultRange']&&_0x45c9e1['setSelection'](_0x4dd5a4['resultRange']);};_0x4e6e05['once']('contentInsertion',_0x2aee3d,{'priority':'lowest'}),_0x4bf737['document']['fire']('paste',_0x5f29ea),_0x4e6e05['off']('contentInsertion',_0x2aee3d);}['_getDefaultInsertBelowPosition'](_0x1ef807){const {model:_0x5eca6b}=this['editor'],_0x17b356=Array['from'](_0x1ef807['getSelectedBlocks']());return _0x17b356['length']?_0x5eca6b['createPositionAfter'](_0x17b356['pop']()):_0x1ef807['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x3c5be1,_0x56b2ae){const {model:_0x3840e7,plugins:_0x5a66e4}=this['editor'];if(_0x5a66e4['has']('TableUtils')){const _0x4605da=_0x5a66e4['get']('TableUtils')['getSelectedTableCells'](_0x56b2ae);if(_0x4605da['length']){const _0x326e84=this['_getTableRowCountFromContent'](_0x3c5be1),_0x7b3851=this['_createEmptyTableRows'](_0x4605da,_0x326e84);return _0x3840e7['createPositionAt'](_0x7b3851,0x0);}}return null;}['_getTableRowCountFromContent'](_0x41b050){const _0x17bb29=this['editor']['plugins']['get']('TableUtils'),_0x3bf322=this['editor']['data']['parse'](_0x41b050),_0x1afe86=Array['from'](_0x3bf322['getChildren']())['filter'](_0x4d89ea=>_0x4d89ea['is']('element','table'));let _0x4af560=0x0;return _0x1afe86['forEach'](_0x3560ca=>{_0x4af560+=_0x17bb29['getRows'](_0x3560ca);}),_0x4af560;}['_createEmptyTableRows'](_0x12a138,_0x23004c){const _0x35e70e=this['editor']['plugins']['get']('TableUtils'),_0x3e9ce1=_0x35e70e['getRowIndexes'](_0x12a138),_0x412ff6=_0x35e70e['getColumnIndexes'](_0x12a138),_0x6f14ad=_0x3e9ce1['last']+0x1,_0x53b5ff=_0x412ff6['first'],_0x57658e=_0x12a138[0x0]['findAncestor']('table');for(let _0x3c6e71=0x0;_0x3c6e71<_0x23004c;_0x3c6e71++)_0x35e70e['insertRows'](_0x57658e,{'at':_0x6f14ad});return _0x57658e['getChild'](_0x6f14ad)['getChild'](_0x53b5ff);}['_resetContentOfSelectedTableCells'](_0x24cbca,_0x58ae94){const {plugins:_0x3097f3}=this['editor'],{model:_0x4b60c8}=_0x24cbca;if(!_0x3097f3['has']('TableUtils'))return;_0x3097f3['get']('TableUtils')['getSelectedTableCells'](_0x58ae94)['length']&&_0x4b60c8['deleteContent'](_0x58ae94);}}class E extends _0xc864ee{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x281fa8('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x1cd4f7){super(_0x1cd4f7),this['name']='AIRequestError';}}function i(_0x5e3e4f,_0x34da2e,_0x434087){const t=_0x5e3e4f['t'];switch(_0x34da2e){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',_0x434087);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x434087);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'},_0x434087);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 _0x34da2e;}}class j extends _0x30a3d7{['_commandDefinitions'];constructor(_0x4cd817,_0x88d809){super(_0x4cd817),this['_commandDefinitions']=_0x88d809,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x4e0a94,_0x3ff32f,_0x101d67)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x101d67));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x3c23b5,_0x218750,_0x2f8561)=>{this['enabledCommandsIds']=_0x2f8561?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x15cb78=this['editor']['model'];this['_hasContext']=function(_0x41389c){const _0x1d4eb7=_0x41389c['document']['selection'];return _0x1d4eb7['isCollapsed']?0x0!==[..._0x1d4eb7['getSelectedBlocks']()]['length']&&![..._0x1d4eb7['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x41389c['hasContent'](_0x1d4eb7['getFirstRange']());}(_0x15cb78);const _0x366c2b=_0x15cb78['document']['selection'],_0x164280=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x256392 of _0x366c2b['getRanges']())for(const _0x1aa0ae of _0x256392['getItems']())if(_0x1aa0ae['is']('element')&&_0x164280['includes'](_0x1aa0ae['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x259580='',_0x1affe7='',_0x1fc251='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x259580,_0x1affe7,_0x1fc251);}}function G(_0x4a691e,_0x2a12d7){const _0x302a48=new Set();for(const _0x103f51 of _0x4a691e['values']())(_0x2a12d7||!0x1===_0x103f51['requiresContent'])&&_0x302a48['add'](_0x103f51['id']);return Array['from'](_0x302a48);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class k extends/* #__PURE__ -- @preserve */
24
+ _0x3a8963(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x177ad4,_0x572a7c,_0x347021){super(),this['editor']=_0x177ad4,this['textAdapter']=_0x572a7c,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x347021,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x493a3d,_0x162005,_0x48f1e4)=>{this['view']['value']=this['_sanitizeHTML'](_0x48f1e4);}),this['listenTo'](this['view'],'submitPrompt',(_0x1183be,_0x1f9fdf)=>{const _0x56374f=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x1f9fdf,_0x56374f,'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:_0x1a56df,query:_0x4a2796,htmlContent:_0x1c8b51,label:_0x4623e2,mainActionLabel:_0x37ff38}){this['view']['prompt']=_0x4623e2,this['view']['mainAction']=_0x37ff38,this['initialContext']=_0x1c8b51,_0x4a2796&&(this['view']['isRendered']?this['_handleQuery'](_0x4a2796,_0x1c8b51,_0x1a56df,_0x4623e2):this['view']['once']('render',()=>{this['_handleQuery'](_0x4a2796,_0x1c8b51,_0x1a56df,_0x4623e2);}));}['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'](_0x4e7c42,_0x26d7b0,_0xa5c940,_0x2e31ee){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x26d7b0,this['previousQuery']=_0x4e7c42,this['previousLabel']=_0x2e31ee||_0x4e7c42,this['previousActionId']=_0xa5c940,new Promise(_0x41ad5c=>{this['textAdapter']['makeRequest']({'query':_0x4e7c42,'context':_0x26d7b0,'onData':_0x5a0e3d=>{this['currentResponse']=_0x5a0e3d,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0xa5c940})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x11b892=>{_0x11b892 instanceof R?this['view']['handleError'](_0x11b892['message']):this['view']['handleError'](),_0x41ad5c();})['finally'](()=>{this['stopProcessing'](),_0x41ad5c();});});}['_parseAndNormalizeContent'](_0x8a1c15,_0x59e7d1=!0x1){const _0x109282=Z['exec'](_0x8a1c15);_0x8a1c15=_0x109282?_0x8a1c15['substring'](_0x109282[0x1]['length']):_0x8a1c15['length']<0x64&&!_0x59e7d1?'':this['_stripMarkdownSyntax'](_0x8a1c15);const _0x23da34=this['_domParser']['parseFromString'](_0x8a1c15,'text/html');if(_0x109282){const _0x2b9149=Array['from'](_0x23da34['body']['childNodes']);_0x2b9149['reverse']();for(const _0x18292a of _0x2b9149){if(_0x18292a['nodeType']==Node['ELEMENT_NODE'])break;_0x18292a['remove']();}}const _0x569ea8=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x23da34['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x569ea8);const _0x1d9ecd=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x345ef5=this['editor']['data']['toModel'](_0x569ea8);return _0x1d9ecd||_0x345ef5['markers']['clear'](),this['editor']['data']['stringify'](_0x345ef5);}['_normalizeResponseHeadings'](_0x51bf62){const _0x2f6b41=new _0x5f1aeb(this['editor']['editing']['view']['document']),_0x28a601=new _0x2ec3f6({'name':/^h[1-5]$/}),_0x1878ca=[];let _0x8b0765=!0x1;for(const _0x33a508 of _0x51bf62)_0x33a508['is']('element')&&_0x28a601['match'](_0x33a508)&&(_0x1878ca['push'](_0x33a508),'h1'==_0x33a508['name']&&(_0x8b0765=!0x0));if(_0x8b0765){for(const _0x4d121f of _0x1878ca)_0x2f6b41['rename']('h'+(parseInt(_0x4d121f['name'][0x1])+0x1),_0x4d121f);}}['_isH1TagSupportEnabled'](){const {data:_0x2aac2b,editing:_0x468c6f}=this['editor'],_0x4a7cb1=_0x2aac2b['htmlProcessor']['toView']('<h1></h1>'),_0x1cf815=_0x2aac2b['toView'](_0x2aac2b['toModel'](_0x4a7cb1));return!!_0x468c6f['view']['domConverter']['viewToDom'](_0x1cf815)['querySelector']('h1');}['_sanitizeHTML'](_0x2ae68e){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x2ae68e),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x1b421e){const _0x5704dc=_0x1b421e['trim']();return _0x5704dc['startsWith']('```html')?_0x5704dc['endsWith']('```')?_0x5704dc['substring'](0x7,_0x5704dc['length']-0x3):_0x5704dc['substring'](0x7):_0x1b421e;}}const M={'REPLACE':'replace','INSERT':'insert'};class lt extends at{constructor(_0x1c517c){super(_0x1c517c),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0xe94803=>i(_0x1c517c,'AI_'+_0xe94803['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x1c517c,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x1c517c,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x1c517c,'Stop'));const _0x3fb28a=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x3fb28a['if']('isVisible','ck-hidden',_0x4482a7=>!_0x4482a7)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0xb4bad6,_0x315d13){const _0x27fa4b=new _0x1ff820(this['locale']);return _0x27fa4b['set']({'label':_0xb4bad6,'class':_0x315d13||'','isVisible':!0x0,'withText':!0x0}),_0x27fa4b;}}class Y extends _0x559cde{['contentFieldView'];['copyButtonView'];constructor(_0x3ef402,_0x24853b=''){super(_0x3ef402),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x4c7996=this['bindTemplate'];this['contentFieldView']=new At(_0x3ef402,_0x24853b),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x4c7996['if']('isVisible','ck-hidden',_0x2aaefc=>!_0x2aaefc)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x4c7996['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 _0x26698e=!0x1;this['on']('change:value',(_0xf55a87,_0x173879,_0x44cc10)=>{const _0x12e674=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x44cc10),this['isProcessing']&&_0x12e674&&!_0x26698e&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x10feaa,_0x338a82,_0x4bec3b)=>{_0x26698e=!0x1,_0x4bec3b?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x26698e=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x26698e=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x3cd572=this['locale'],_0x2af3fc=new _0x1ff820(this['locale']),_0x226e3b='ck-ai-form__copy-button';return _0x2af3fc['set']({'label':i(_0x3cd572,'Copy'),'icon':_0x4f9978,'class':_0x226e3b,'tooltip':!0x0}),_0x2af3fc['bind']('isVisible')['to'](this,'value',_0x57ca9b=>!!_0x57ca9b),_0x2af3fc['bind']('isEnabled')['to'](this,'isProcessing',_0x2b1ff7=>!_0x2b1ff7),_0x2af3fc['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x2af3fc['icon']=_0x32013a,_0x2af3fc['class']=_0x226e3b+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x2af3fc['icon']=_0x4f9978,_0x2af3fc['class']=_0x226e3b;},0x3e8);}),_0x2af3fc;}['_copyHTMLToClipboard'](_0x32f139){const {window:_0x205661,document:_0x2715c6}=_0x164716;if(_0x205661['ClipboardItem']){const {Blob:_0xc23b3d,ClipboardItem:_0x12731b}=_0x205661,_0x508216=[new _0x12731b({'text/html':new _0xc23b3d([_0x32f139['innerHTML']],{'type':'text/html'}),'text/plain':new _0xc23b3d([_0x32f139['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x508216);}else{const _0x51bac8=_0x2715c6['createElement']('div');_0x51bac8['style']['position']='absolute',_0x51bac8['style']['left']='-9999px',_0x51bac8['innerHTML']='<span>[</span>'+_0x32f139['innerHTML']+'<span>]</span>',_0x2715c6['body']['appendChild'](_0x51bac8);const _0x59a7f1=_0x2715c6['createRange']();_0x59a7f1['setStartAfter'](_0x51bac8['firstElementChild']),_0x59a7f1['setEndBefore'](_0x51bac8['lastElementChild']);const _0x533a21=_0x205661['getSelection']();_0x533a21['removeAllRanges'](),_0x533a21['addRange'](_0x59a7f1),_0x2715c6['execCommand']('copy'),_0x51bac8['remove']();}}}class At extends _0x559cde{constructor(_0x57bad9,_0x1f4bcd=''){super(_0x57bad9),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x1f4bcd,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x5cbca2){this['element']['innerHTML']=_0x5cbca2;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x3cbf8e=new _0x559cde(),_0x573b2f=this['locale'],_0x1bf18f=new _0x166153();return _0x1bf18f['isVisible']=!0x0,_0x3cbf8e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x1bf18f,{'text':i(_0x573b2f,'AI\x20is\x20writing...')}]}),_0x3cbf8e['render'](),_0x3cbf8e;}}class st extends _0x559cde{constructor(_0x1c24ef,_0xbf4251=''){super(_0x1c24ef);const _0x1c90ab=new rt(),_0x1a81c3=this['bindTemplate'];this['set']('text',_0xbf4251),_0x1c90ab['content']=tt,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x1c90ab,{'text':_0x1a81c3['to']('text')}]});}}class ct extends nt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x4abfcc,_0x1c543c){super(_0x4abfcc,_0x1c543c),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',(_0x5867fe,_0x25bf20)=>{_0x5867fe['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x25bf20());});}['_createSubmitButton'](){const _0x32ea8e=new _0x1ff820(this['locale']),_0x556c5a=this['locale'];return _0x32ea8e['set']({'icon':ht,'label':i(_0x556c5a,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x32ea8e['on']('execute',()=>{this['submit']();}),_0x32ea8e['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x2b4b0e,_0xabda98)=>!_0x2b4b0e&&_0xabda98),_0x32ea8e;}['_createShowHistoryButton'](){const _0x1744e6=new _0x1ff820(this['locale']),_0x3f6522=this['resultsView'],_0x4d034f=this['locale'];_0x1744e6['set']({'label':i(_0x4d034f,'History'),'withText':!0x1,'icon':et,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x1744e6['bind']('isOn')['to'](_0x3f6522,'isVisible'),_0x1744e6['bind']('isEnabled')['to'](this,'isEnabled'),_0x1744e6['on']('execute',()=>{_0x3f6522['isVisible']=!_0x3f6522['isVisible'],_0x3f6522['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x5b20a5=()=>{_0x164716['window']['requestAnimationFrame'](()=>{if(ot(this['element'])){const _0x399af6=new it(this['queryView']['fieldView']['element']),_0x171d29=_0x399af6['width'],_0x4a996a='rtl'===_0x4d034f['uiLanguageDirection']?'left':'right';_0x399af6['excludeScrollbarsAndBorders'](),_0x1744e6['element']['style'][_0x4a996a]=_0x171d29-_0x399af6['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x5b20a5),this['on']('render',_0x5b20a5),_0x1744e6;}['submit'](){const _0x119b4e=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x119b4e);}['focus'](_0x14da47){-0x1===_0x14da47?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class ft extends Ct{['historyGroupView'];['clearHistoryButton'];constructor(_0x12aa32){super(_0x12aa32),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ht(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x12aa32,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x5351cd=0x0;for(const _0x12f2e2 of this['items'])_0x5351cd+=_0x12f2e2['items']['length'];return{'resultsCount':_0x5351cd,'totalItemsCount':_0x5351cd};}['_createClearHistoryButton'](){const _0x434bd1=this['locale'],_0x5c326d=new _0x1ff820(this['locale']);return _0x5c326d['set']({'label':'('+i(_0x434bd1,'Clear')+')','withText':!0x0}),_0x5c326d['on']('execute',()=>this['fire']('clearHistory')),_0x5c326d;}}class bt extends xt{constructor(_0x12f4ce){super();const _0x2fe673=new kt(),_0x3d7da8=new _0x1ff820(this['locale'],_0x2fe673);this['children']['add'](_0x3d7da8),_0x3d7da8['set']({'label':_0x12f4ce['prompt'],'withText':!0x0}),_0x3d7da8['on']('execute',()=>{this['fire']('execute',{'value':jt(_0x12f4ce['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class wt extends _0xaca819{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x4a3d95,_0x17a26c)=>{const _0x258837=os(_0x17a26c['prompt']);for(const _0x13b1a4 of this)if(_0x13b1a4!=_0x17a26c&&os(_0x13b1a4['prompt'])===_0x258837){this['remove'](_0x13b1a4);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x2776db=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x2776db));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x5a21fb=>_0x5a21fb)));}}function os(_0x87cd04){return _0x87cd04['toLowerCase']()['trim']();}class _ extends _0x559cde{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x46f872,_0x451cfe,_0x346c2d=''){super(_0x46f872),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 wt(),this['errorView']=new st(_0x46f872),this['contentArea']=new Y(_0x46f872,_0x346c2d),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 mt(),this['keystrokes']=new ut(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new pt({'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 _0x4ac6bd=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x451cfe],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x4ac6bd['if']('isError','ck-hidden',_0x10dd1e=>!_0x10dd1e)]},'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'](_0x12dee5=0x1){-0x1===_0x12dee5?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 _0x2732a2=this['locale'],_0xf7bf00=new ct(_0x2732a2,{'queryView':{'label':i(_0x2732a2,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':dt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x2732a2,'Empty\x20history'),'secondary':i(_0x2732a2,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0xf7bf00['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2a8e51,_0x444e26)=>_0x2a8e51&&!_0x444e26),this['listenTo'](_0xf7bf00,'submit',(_0x17c6d8,_0x221fad)=>{this['prompt']=_0x221fad;const _0x2bbafa=yt(_0x221fad);this['fire']('submitPrompt',_0x2bbafa),_0x221fad['trim']()&&this['_promptHistory']['add']({'prompt':_0x2bbafa},0x0);},{'priority':'high'}),_0xf7bf00;}['_createHistoryView'](){const _0xb13a6=new ft(this['locale']);return _0xb13a6['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](bt),_0xb13a6['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0xb13a6;}['_createToolbar'](){const _0x12f156=new lt(this['locale']);return _0x12f156['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x17a704,_0x28ba2d,_0x23f598)=>_0x17a704&&!_0x28ba2d&&!!_0x23f598),_0x12f156['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x12f156['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x138e4b,_0x172ee3,_0x4b56bb)=>_0x138e4b&&!_0x172ee3&&!!_0x4b56bb),_0x12f156['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x12f156['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x390d55,_0x39d26f)=>_0x390d55&&!_0x39d26f),_0x12f156['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x12f156['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x12f156['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x12f156;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x3ebb45=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x3ebb45,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x140cdb){const _0x4ab6d1=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x140cdb||i(_0x4ab6d1,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0xc864ee{['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[_0x52cc6a,a,E,_0x1c2c3e];}constructor(_0x21f833){super(_0x21f833),_0x21f833['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x21f833['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x21f833['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x21f833['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x2b08ef}=this;this['_aiAdapter']=_0x2b08ef['plugins']['get'](E),this['_dialog']=_0x2b08ef['plugins']['get'](_0x1c2c3e),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x13ac8d=new j(_0x2b08ef,Array['from'](this['_commandDefinitions']['values']()));_0x2b08ef['commands']['add']('showAIAssistant',_0x13ac8d),_0x2b08ef['ui']['componentFactory']['add']('aiCommands',_0x2b0cf9=>{const _0x12bdf3=_0x4068e4(_0x2b0cf9);return _0x12bdf3['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x12bdf3['buttonView']['set']({'label':i(_0x2b0cf9,'AI\x20Commands'),'icon':_0x298ed9,'tooltip':!0x0}),_0x12bdf3['on']('execute',_0x12b443=>this['_onExecute'](_0x12b443['source']['id'])),_0x3d31b6(_0x12bdf3,_0x2b08ef['ui']['view']['body'],function(_0x5cabf3){const _0xa15615=o(_0x5cabf3['config']['get']('ai.aiAssistant.commands'),_0x5cabf3['locale']),_0x184e6a=U(_0x5cabf3,_0xa15615)['filter'](_0x51d392=>_0x51d392['commands']['length']);if(0x1===_0x184e6a['length'])return U(_0x5cabf3,_0x184e6a[0x0]['commands'])['map'](_0x39870e=>({'id':_0x39870e['id'],'label':_0x39870e['label']}));return _0x184e6a['map'](_0x5e3843=>{const {groupId:_0x573e05,groupLabel:_0x3297d4,commands:_0x4ba94a}=_0x5e3843,_0xe2f64c=U(_0x5cabf3,_0x4ba94a)['map'](_0x588d53=>({'id':_0x588d53['id'],'label':_0x588d53['label']}));return{'id':_0x573e05,'menu':_0x3297d4||_0x573e05,'children':_0xe2f64c};});}(_0x2b08ef),{'ariaLabel':i(_0x2b0cf9,'AI\x20Commands')}),_0x12bdf3['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x13ac8d['on']('change:enabledCommandsIds',_0x4816cc),_0x12bdf3['menuView']['once']('render',_0x4816cc),_0x12bdf3;function _0x4816cc(){_0x12bdf3['isEnabled']=_0x13ac8d['enabledCommandsIds']['length']>0x0;for(const _0x3ef498 of _0x12bdf3['menuView']['buttons'])_0x3ef498['isEnabled']=_0x13ac8d['enabledCommandsIds']['includes'](_0x3ef498['id']);}}),_0x2b08ef['ui']['componentFactory']['add']('menuBar:aiCommands',_0xce03cd=>{const _0xcae734=new _0x3cfd0c(_0xce03cd);_0xcae734['buttonView']['set']({'label':i(_0xce03cd,'AI\x20Commands'),'icon':_0x298ed9}),_0xcae734['bind']('isEnabled')['to'](_0x13ac8d,'enabledCommandsIds',_0xa7d91=>_0xa7d91['length']>0x0);const _0x1c90fe=o(_0x2b08ef['config']['get']('ai.aiAssistant.commands'),_0xce03cd);return this['_populateMenuBarMenu'](_0x13ac8d,_0xcae734,_0x1c90fe,_0x3e5831=>this['_onExecute'](_0x3e5831)),_0xcae734;}),_0x2b08ef['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x12b3f4=this['_createAIAssistantUIButton'](_0x1ff820);return _0x12b3f4['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x12b3f4;}),_0x2b08ef['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x3b8683=this['_createAIAssistantUIButton'](_0x44f383);return _0x3b8683['set']({'role':'menuitemcheckbox'}),_0x3b8683;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x268032=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x1f5be1;for(const _0x3de902 in _0x268032){const _0x3da1d9=_0x3de902,_0x2385cc=_0x268032[_0x3da1d9];if('aiLicenseKeyValid'==_0x2385cc||'aiLicenseKeyInvalid'==_0x2385cc||'aiLicenseKeyExpired'==_0x2385cc||'aiLicenseKeyDomainLimit'==_0x2385cc||'aiLicenseKeyNotAllowed'==_0x2385cc||'aiLicenseKeyEvaluationLimit'==_0x2385cc||'aiLicenseKeyTrialLimit'==_0x2385cc||'aiLicenseKeyUsageLimit'==_0x2385cc){delete _0x268032[_0x3da1d9],_0x1f5be1=_0x2385cc,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x1f5be1&&_0x268032['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x1f5be1&&_0x268032['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x1f5be1&&_0x268032['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x1f5be1&&_0x268032['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x1f5be1&&_0x268032['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x1f5be1&&_0x268032['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x1f5be1&&_0x268032['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x5bdfe0='',_0xcf6aeb='',_0xffb692='custom'){const _0x15c8b3=this['editor'],_0x3a7ec0=_0x15c8b3['editing']['view'],_0x317b69=_0x15c8b3['plugins']['get'](a),_0x2d0f11=_0x15c8b3['plugins']['get'](_0x52cc6a);_0x317b69['showFakeVisualSelection']();const _0x751a76=new w(),_0x206880=new ClipboardEvent('copy',{'clipboardData':_0x751a76}),_0x3a6ea4=new _0xa62118(_0x751a76),_0xae4a7=new _0x3d6480(_0x3a7ec0,_0x206880,{'dataTransfer':_0x3a6ea4});_0x2d0f11['_forceMarkersCopy']('comment',()=>{_0x3a7ec0['document']['fire']('copy',_0xae4a7);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new k(_0x15c8b3,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x1caf6c=_0x3a6ea4['getData']('text/html');const _0x168ea1=_0x15c8b3['model']['document']['selection'],_0x4f8dfa=Array['from'](_0x168ea1['getRanges']());0x1===_0x4f8dfa['length']&&_0x4f8dfa[0x0]['isFlat']&&!_0x168ea1['getSelectedElement']()&&''!==_0x1caf6c['replace'](/&nbsp;/g,'')['trim']()&&(_0x1caf6c='<p>'+_0x1caf6c+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0xffb692,'query':_0x5bdfe0,'htmlContent':_0x1caf6c,'label':_0xcf6aeb,'mainActionLabel':M[_0x15c8b3['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x2cc26d,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x259cb3['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x317b69['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x41d5da=new Map(),_0x3099b4=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x580859 of _0x3099b4)for(const _0x4876f3 of _0x580859['commands'])_0x41d5da['set'](_0x4876f3['id'],{..._0x4876f3,'groupId':_0x580859['groupId'],'groupLabel':_0x580859['groupLabel']||_0x580859['groupId']});return _0x41d5da;}['_createAIAssistantUIButton'](_0x49f503){const _0x477dc=this['editor'],_0x27eda4=_0x477dc['commands']['get']('showAIAssistant'),_0x2f3835=new _0x49f503(_0x477dc['locale']);return _0x2f3835['set']({'label':i(_0x477dc['locale'],'AI\x20Assistant'),'icon':_0x2cc26d,'isToggleable':!0x0}),_0x2f3835['bind']('isEnabled')['to'](_0x27eda4),_0x2f3835['bind']('isOn')['to'](this['_dialog'],'id',_0x515a45=>'aiAssistant'===_0x515a45),this['listenTo'](_0x2f3835,'execute',()=>{_0x2f3835['isOn']?this['hideUI']():_0x27eda4['execute']();}),_0x2f3835;}['_initView'](){const _0x17a618=this['editor']['plugins']['get'](a);this['_formView']=new _(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',()=>{_0x17a618['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x17a618['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x4c0278,ui:{ariaLiveAnnouncer:_0x315894}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x619b7d,_0x293731,_0x300b2c)=>{const _0x2d05bb=this['_aiAssistantController']['currentContext'];_0x300b2c?_0x315894['announce'](i(_0x4c0278,'AI\x20is\x20writing')):_0x2d05bb&&_0x315894['announce'](i(_0x4c0278,'Generated\x20content:\x20%0',_0x2d05bb),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x17e75d,_0x866253,_0x559ff5)=>{if(_0x559ff5){const _0x24024b=this['_formView']['errorView']['text'];_0x315894['announce'](i(_0x4c0278,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x24024b));}});}['_onExecute'](_0x1ca9c9){const _0x1b9801=this['_commandDefinitions']['get'](_0x1ca9c9),_0x21f7cc=this['editor'],_0x4bb7b6=_0x21f7cc['model']['document']['selection'],_0x3afcc6=_0x21f7cc['commands']['get']('showAIAssistant'),_0x29aa24=_0x21f7cc['plugins']['get'](a),_0x3dec69=''+(_0x1b9801['groupId']!==x?_0x1b9801['groupLabel']+':\x20':'')+_0x1b9801['label'];if(!0x1!==_0x1b9801['requiresContent']&&_0x4bb7b6['isCollapsed']){const _0xd9bfa9=_0x11ebc1(_0x4bb7b6['getSelectedBlocks']())||_0x21f7cc['model']['schema']['getLimitElement'](_0x4bb7b6);_0x21f7cc['model']['change'](_0x34e1e2=>{_0x34e1e2['setSelection'](_0xd9bfa9,'in');});}_0x29aa24['showFakeVisualSelection'](),_0x3afcc6['execute'](_0x1b9801['prompt'],_0x3dec69,'command:'+_0x1ca9c9);}['_populateMenuBarMenu'](_0x388470,_0xaf9bbb,_0x521d2f,_0x1e2d17){const _0xf70496=this['editor'],_0x2c4dad=_0xf70496['locale'],_0x240d0f=new _0x1fe226(_0x2c4dad),_0x122fdb=U(_0xf70496,_0x521d2f)['filter'](_0x419aa0=>_0x419aa0['commands']['length']);0x1===_0x122fdb['length']?this['_getMenuBarGroupButtons']({'command':_0x388470,'commands':_0x122fdb[0x0]['commands'],'parentMenuView':_0xaf9bbb,'onExecute':_0x1e2d17})['forEach'](_0x32b71e=>_0x240d0f['items']['add'](_0x32b71e)):_0x122fdb['forEach'](({groupId:_0x332ac7,groupLabel:_0x3a4554,commands:_0x19b5a8})=>{const _0x90e37f=new _0x4dbae5(_0x2c4dad,_0xaf9bbb),_0x103928=new _0x3cfd0c(_0x2c4dad),_0x4a8c5a=new _0x1fe226(_0x2c4dad),_0x19857c=this['_getMenuBarGroupButtons']({'command':_0x388470,'commands':_0x19b5a8,'parentMenuView':_0x103928,'onExecute':_0x1e2d17});_0x103928['buttonView']['set']({'label':_0x3a4554||_0x332ac7}),_0x103928['delegate']('execute')['to'](_0xaf9bbb),_0x4a8c5a['items']['addMany'](_0x19857c),_0x103928['panelView']['children']['add'](_0x4a8c5a),_0x90e37f['children']['add'](_0x103928),_0x240d0f['items']['add'](_0x90e37f);}),_0xaf9bbb['panelView']['children']['add'](_0x240d0f);}['_getMenuBarGroupButtons']({command:_0x373e5a,commands:_0x7dc326,parentMenuView:_0x30a1c5,onExecute:_0x2c1600}){const _0x202a11=this['editor'],_0x3d937b=_0x202a11['locale'];return U(_0x202a11,_0x7dc326)['map'](_0x1b4696=>{const _0x3b2017=new _0x4dbae5(_0x3d937b,_0x30a1c5),_0x41e9cf=new _0x44f383(_0x3d937b);return _0x41e9cf['set']({'label':_0x1b4696['label']}),_0x41e9cf['delegate']('execute')['to'](_0x30a1c5),_0x41e9cf['on']('execute',()=>_0x2c1600(_0x1b4696['id'])),_0x41e9cf['bind']('isEnabled')['to'](_0x373e5a,'enabledCommandsIds',_0x52235a=>_0x52235a['includes'](_0x1b4696['id'])),_0x3b2017['children']['add'](_0x41e9cf),_0x3b2017;});}}function B(_0x350d95,_0x53de00){return void 0x0!==_0x350d95['order']&&void 0x0===_0x53de00['order']?0x1:void 0x0===_0x350d95['order']&&void 0x0!==_0x53de00['order']?-0x1:void 0x0!==_0x350d95['order']&&void 0x0!==_0x53de00['order']?_0x350d95['order']-_0x53de00['order']:0x0;}function U(_0x7c87de,_0x5793cb){_0x5793cb['sort'](B);const _0x386375={},_0x14394a=[];for(const _0xe2c8bb of _0x5793cb)if(void 0x0!==_0xe2c8bb['order']){if(_0xe2c8bb['order']in _0x386375)throw new _0x281fa8('ai-commands-config-order-collision',_0x7c87de,{'conflictingDefinitions':[_0xe2c8bb,_0x386375[_0xe2c8bb['order']]]});_0x386375[_0xe2c8bb['order']]=_0xe2c8bb,_0x14394a['splice'](_0xe2c8bb['order'],0x0,_0xe2c8bb);}else _0x14394a['push'](_0xe2c8bb);return _0x14394a;}class r extends _0xc864ee{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x20fd72){super(_0x20fd72);const _0x5121f5=_0x20fd72['config'],_0x33e70f=_0x20fd72['locale'];_0x5121f5['define']('ai.aiAssistant.preserveComments',!0x0),_0x5121f5['define']('ai.aiAssistant.commands',function(_0x1d691b){return[{'groupId':'editOrReview','groupLabel':i(_0x1d691b,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x1d691b,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x1d691b,'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(_0x1d691b,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x1d691b,'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(_0x1d691b,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x1d691b,'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(_0x1d691b,'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(_0x1d691b,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x1d691b,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x1d691b,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x1d691b,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x1d691b,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x1d691b,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x1d691b,'Change\x20style'),'commands':[{'id':'business','label':i(_0x1d691b,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x1d691b,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x1d691b,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x1d691b,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x1d691b,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x1d691b,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x1d691b,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x1d691b,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x1d691b,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x1d691b,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x1d691b,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x1d691b,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x1d691b,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x33e70f)),_0x5121f5['define']('ai.aiAssistant.extraCommandGroups',[]),_0x5121f5['define']('ai.aiAssistant.removeCommands',[]);let _0x3953df=o(_0x5121f5['get']('ai.aiAssistant.commands'),_0x33e70f);const _0x500585=_0x5121f5['get']('ai.aiAssistant.extraCommandGroups'),_0x42f695=_0x5121f5['get']('ai.aiAssistant.removeCommands');_0x500585['forEach'](_0x27be71=>{const _0x577be7=_0x3953df['find'](_0x23b7cf=>_0x23b7cf['groupId']===_0x27be71['groupId']);_0x577be7?_0x577be7['commands']=_0x577be7['commands']['concat'](_0x27be71['commands']):_0x3953df['push'](_0x27be71);}),_0x3953df=_0x3953df['filter'](_0x3d5c2d=>!_0x42f695['includes'](_0x3d5c2d['groupId'])),_0x3953df['forEach'](_0x228925=>{_0x228925['commands']=_0x228925['commands']['filter'](_0x25169f=>!_0x42f695['includes'](_0x25169f['id']));}),_0x5121f5['set']('ai.aiAssistant.commands',_0x3953df);}}class P extends _0xc864ee{['abortController'];static get['requires'](){return[E];}constructor(_0x6fe4f0){super(_0x6fe4f0),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](E)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x1d31a0){return this['sendRequest'](_0x1d31a0)['catch'](_0x5702a7=>{if(_0x5702a7 instanceof R)return Promise['reject'](_0x5702a7);if('AbortError'==_0x5702a7['name'])return Promise['resolve']();throw console['error'](_0x5702a7),new _0x281fa8('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x3a000c,_0x37d410){const _0x20dcd1=this['editor']['locale'],_0x5268cd={'Content-Type':'application/json'};if('object'==typeof _0x3a000c)Object['assign'](_0x5268cd,_0x3a000c);else{if(_0x3a000c)try{const _0x1063e3=await _0x3a000c(_0x37d410);Object['assign'](_0x5268cd,_0x1063e3);}catch{return Promise['reject'](new R(i(_0x20dcd1,'AI_ERROR_GET_HEADERS')));}}return _0x5268cd;}async['_prepareRequestParameters'](_0x2fcfa9,_0x41ca09){const _0x4c349d=this['editor']['locale'];if('object'==typeof _0x2fcfa9)return _0x2fcfa9;try{return await _0x2fcfa9(_0x41ca09);}catch{return Promise['reject'](new R(i(_0x4c349d,'AI_ERROR_GET_PARAMETERS')));}}}class O extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x416ccd){super(_0x416ccd),_0x416ccd['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x416ccd['config']['get']('ai.openAI.requestParameters')||_0x416ccd['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x416ccd['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x416ccd['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x416ccd['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x439b75,context:_0xb0bd88,onData:_0x38004f,actionId:_0x2a23dc}){const _0x566754=this['editor']['locale'],_0x5a3a93=await this['prepareMessages'](_0x439b75,_0xb0bd88,_0x2a23dc),_0x3fb5f5=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2a23dc),_0x4a699e=await this['_prepareRequestParameters'](this['_requestParameters'],_0x2a23dc),_0x247c24={'messages':_0x5a3a93,..._0x4a699e},_0xd1e423={'method':'POST','headers':_0x3fb5f5,'body':JSON['stringify'](_0x247c24),'signal':this['abortController']['signal']},_0x3d88e3=await fetch(this['_apiUrl'],_0xd1e423);if(_0x3d88e3['ok'])return _0x4a699e['stream']?await this['_readStreamableResponse'](_0x3d88e3,_0x38004f):await this['_readStaticResponse'](_0x3d88e3,_0x38004f),Promise['resolve']();{const _0x1573f1=await _0x3d88e3['text']();return _0x1573f1['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x566754,'AI_ERROR_CONTEXT_LENGTH'))):_0x1573f1['includes']('Moderation')?Promise['reject'](new R(i(_0x566754,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x1573f1));}}async['prepareMessages'](_0x3205e3,_0x2caa2a,_0x15b487){let _0xa89c75,_0x39d01a;return _0x2caa2a?(_0xa89c75='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.',_0x39d01a='Instruction:\x0a'+_0x3205e3+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x2caa2a):(_0xa89c75='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.',_0x39d01a=_0x3205e3),[{'role':'system','content':_0xa89c75},{'role':'user','content':_0x39d01a}];}async['_readStreamableResponse'](_0x2f0997,_0x485657){const _0x29bf0a=_0x2f0997['body']['getReader'](),_0x2cc6af=new TextDecoder();let _0x3418d6='',_0x3a965f='',_0x4d8071='',_0x166dda=!0x1;for(;!_0x166dda;){const {done:_0xe8b05e,value:_0x3d6068}=await _0x29bf0a['read'](),_0x57261a=_0x3418d6+_0x2cc6af['decode'](_0x3d6068);let _0x937ede='';_0x166dda=_0xe8b05e;try{_0x937ede=this['_cleanUpData'](_0x57261a),_0x3418d6='';}catch{_0x3418d6=_0x57261a;continue;}_0x3a965f+=_0x937ede,!_0x166dda&&this['_isBufferIncomplete'](_0x3a965f)||_0x3a965f&&(_0x4d8071+=_0x3a965f,_0x3a965f='',_0x485657(_0x4d8071));}return Promise['resolve']();}async['_readStaticResponse'](_0x5e673b,_0x401169){return _0x401169((await _0x5e673b['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x419d5e){const _0x49419f=_0x419d5e['split']('<')['length']!==_0x419d5e['split']('>')['length'],_0x43f1cc=_0x419d5e['length']<0x1e;return _0x49419f&&_0x43f1cc;}['_cleanUpData'](_0x560d54){return _0x560d54['split'](/\n(?![^{]*\})/g)['map'](_0xca66dd=>_0xca66dd['replace']('data:\x20',''))['filter'](_0x4378ec=>_0x4378ec&&_0x4378ec['length']>0x0&&'[DONE]'!==_0x4378ec)['map'](_0x4cd221=>{const {choices:_0x29dcbd}=JSON['parse'](_0x4cd221);if(_0x29dcbd[0x0]?.['delta']?.['content'])return _0x29dcbd[0x0]['delta']['content'];})['filter'](_0x257887=>_0x257887)['join']('');}}class D extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x2b2c54){super(_0x2b2c54),_0x2b2c54['config']['get']('ai.aws.requestParameters')||_0x2b2c54['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']=_0x2b2c54['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x2b2c54['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x2b2c54['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x2b2c54['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x410168,context:_0x42738e,onData:_0x38273f,actionId:_0x234eac}){const {model:_0x4e26f4,stream:_0x8df70d,..._0x4124ba}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x234eac),_0x1639b1={'prompt':await this['preparePrompt'](_0x410168,_0x42738e,_0x4e26f4,_0x234eac),..._0x4124ba};this['_apiUrl']?await this['_processProxyRequest'](_0x1639b1,_0x4e26f4,_0x8df70d,_0x38273f,_0x234eac):await this['_processAWSRequest'](_0x1639b1,_0x4e26f4,_0x8df70d,_0x38273f);}async['preparePrompt'](_0x18e8e2,_0x4adc2d,_0x5e03ed,_0x3ce6d4){let _0x4f3362,_0x45fca6;return _0x4adc2d?(_0x4f3362='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.',_0x45fca6='Instruction:\x0a'+_0x18e8e2+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x4adc2d):(_0x4f3362='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.',_0x45fca6=_0x18e8e2),'meta.llama'==this['getModelFamily'](_0x5e03ed)?'<<SYS>>\x0a'+_0x4f3362+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x45fca6+'\x0a[/INST]':'Human:\x0a'+_0x4f3362+'\x0a'+_0x45fca6+'\x0a\x0aAssistant:';}['getModelFamily'](_0x38e5ba){if(/^anthropic\.claude/['test'](_0x38e5ba))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x38e5ba))return'ai21.j2';if(/^cohere\.command/['test'](_0x38e5ba))return'cohere.command';if(/^meta\.llama/['test'](_0x38e5ba))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x38e5ba));}async['_processProxyRequest'](_0xc848b7,_0x17ace6,_0xd07db7,_0x9870ec,_0x45e982){const _0x18cd34={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x45e982),'body':JSON['stringify']({..._0xc848b7,'model':_0x17ace6,'stream':_0xd07db7}),'signal':this['abortController']['signal']},_0x4adec9=await fetch(this['_apiUrl'],_0x18cd34);_0xd07db7?await this['_readStreamableResponse'](_0x4adec9,_0x17ace6,_0x9870ec):await this['_readStaticResponse'](_0x4adec9,_0x17ace6,_0x9870ec);}async['_processAWSRequest'](_0x6a1a5d,_0x5910d1,_0x439733,_0x3f9676){const _0x136b51=new _0x453882(this['_bedrockClientConfig']),_0x178da5={'body':JSON['stringify'](_0x6a1a5d),'contentType':'application/json','accept':'application/json','modelId':_0x5910d1};let _0x93d38a;if(_0x439733){const _0x240e0a=new _0x2d6abb(_0x178da5);_0x93d38a=await _0x136b51['send'](_0x240e0a,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x93d38a,_0x5910d1,_0x3f9676);}else{const _0x25a95c=new _0x212135(_0x178da5);_0x93d38a=await _0x136b51['send'](_0x25a95c,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x93d38a,_0x5910d1,_0x3f9676);}}async['_readAsyncIterableResponse'](_0x515709,_0x496066,_0x5c4e81){const _0x1fec85=_0x515709['body'],_0x1e74f4=new TextDecoder('utf-8');let _0x920cb2='';for await(const _0x105263 of _0x1fec85)if(_0x105263['chunk']){const _0x211039=_0x1e74f4['decode'](_0x105263['chunk']['bytes']),_0x10dcc8=JSON['parse'](_0x211039);_0x920cb2+=this['_getGeneratedText'](_0x10dcc8,_0x496066),_0x5c4e81(_0x920cb2);}return Promise['resolve']();}async['_readStreamableResponse'](_0x394a82,_0x5ad11a,_0x24b8c8){const _0x5762fc=_0x394a82['body'],_0xf5972e=new TextDecoder('utf-8'),_0x2404ed=_0x5762fc['getReader']();let _0x5b8b8e='',_0x322864='',_0x32408f=!0x1;for(;!_0x32408f;){const {done:_0x1a6fe8,value:_0x34906d}=await _0x2404ed['read']();if(_0x32408f=_0x1a6fe8,_0x32408f)break;const _0x45e592=(_0x5b8b8e+_0xf5972e['decode'](_0x34906d))['split']('\x0a')['map'](_0x138866=>{try{return _0x5b8b8e='',JSON['parse'](_0x138866);}catch{return _0x5b8b8e=_0x138866,null;}})['filter'](_0x4f2403=>null!==_0x4f2403);_0x45e592['length']&&(_0x322864+=_0x45e592['map'](_0x328df4=>this['_getGeneratedText'](_0x328df4,_0x5ad11a))['join'](''),_0x24b8c8(_0x322864));}return Promise['resolve']();}async['_readStaticResponse'](_0x1e47f8,_0x306adb,_0x3414f8){let _0x151973;return _0x151973=_0x1e47f8 instanceof Response?await _0x1e47f8['json']():JSON['parse'](Buffer['from'](_0x1e47f8['body'])['toString']('utf8')),(_0x3414f8(this['_getGeneratedText'](_0x151973,_0x306adb)),Promise['resolve']());}['_getGeneratedText'](_0x3952e8,_0xb5bad6){switch(this['getModelFamily'](_0xb5bad6)){case'anthropic.claude':return _0x3952e8['completion'];case'ai21.j2':return _0x3952e8['completions'][0x0]['data']['text'];case'cohere.command':return _0x3952e8['generations'][0x0]['text'];case'meta.llama':return _0x3952e8['generation'];}}}export{E as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,D as AWSTextAdapter,O 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':_0x1df1d1=>0x1!=_0x1df1d1}};
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':_0x478642=>0x1!=_0x478642}};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- (_0x2ed696=>{const {af:{dictionary:_0x58486e,getPluralForm:_0x403429}}={'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':_0x141425=>0x1!=_0x141425}};_0x2ed696['af']||={'dictionary':{},'getPluralForm':null},_0x2ed696['af']['dictionary']=Object['assign'](_0x2ed696['af']['dictionary'],_0x58486e),_0x2ed696['af']['getPluralForm']=_0x403429;})(window['CKEDITOR_TRANSLATIONS']||={});
23
+ (_0x14bac1=>{const {af:{dictionary:_0x57c6d7,getPluralForm:_0x2f3260}}={'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':_0x3214df=>0x1!=_0x3214df}};_0x14bac1['af']||={'dictionary':{},'getPluralForm':null},_0x14bac1['af']['dictionary']=Object['assign'](_0x14bac1['af']['dictionary'],_0x57c6d7),_0x14bac1['af']['getPluralForm']=_0x2f3260;})(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':_0x28d863=>0x0==_0x28d863?0x0:0x1==_0x28d863?0x1:0x2==_0x28d863?0x2:_0x28d863%0x64>=0x3&&_0x28d863%0x64<=0xa?0x3:_0x28d863%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':_0x264f14=>0x0==_0x264f14?0x0:0x1==_0x264f14?0x1:0x2==_0x264f14?0x2:_0x264f14%0x64>=0x3&&_0x264f14%0x64<=0xa?0x3:_0x264f14%0x64>=0xb?0x4:0x5}};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- (_0x4ae1e6=>{const {ar:{dictionary:_0x15dee3,getPluralForm:_0x11ccb9}}={'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':_0x1666cc=>0x0==_0x1666cc?0x0:0x1==_0x1666cc?0x1:0x2==_0x1666cc?0x2:_0x1666cc%0x64>=0x3&&_0x1666cc%0x64<=0xa?0x3:_0x1666cc%0x64>=0xb?0x4:0x5}};_0x4ae1e6['ar']||={'dictionary':{},'getPluralForm':null},_0x4ae1e6['ar']['dictionary']=Object['assign'](_0x4ae1e6['ar']['dictionary'],_0x15dee3),_0x4ae1e6['ar']['getPluralForm']=_0x11ccb9;})(window['CKEDITOR_TRANSLATIONS']||={});
23
+ (_0x270381=>{const {ar:{dictionary:_0x22c84e,getPluralForm:_0x52521e}}={'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':_0x33f52f=>0x0==_0x33f52f?0x0:0x1==_0x33f52f?0x1:0x2==_0x33f52f?0x2:_0x33f52f%0x64>=0x3&&_0x33f52f%0x64<=0xa?0x3:_0x33f52f%0x64>=0xb?0x4:0x5}};_0x270381['ar']||={'dictionary':{},'getPluralForm':null},_0x270381['ar']['dictionary']=Object['assign'](_0x270381['ar']['dictionary'],_0x22c84e),_0x270381['ar']['getPluralForm']=_0x52521e;})(window['CKEDITOR_TRANSLATIONS']||={});