@ckeditor/ckeditor5-comments 48.5.1 → 48.5.2-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +11 -11
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.umd.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/package.json +16 -16
package/dist/index.js
CHANGED
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Command as
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
((()=>Ot)());constructor(_0x3f9762={}){(_0x3f9762=Object['assign']({},_0x3f9762))['plugins']||(_0x3f9762['plugins']=CommentEditor['defaultPlugins']),super(_0x3f9762),this['ui']=new Nt(this),this['set']('placeholder',''),this['model']['document']['on']('change',()=>this['_updatePlaceholder'](),{'priority':'low'}),this['on']('change:placeholder',()=>this['_updatePlaceholder']()),this['model']['document']['createRoot'](),this['editing']['view']['_overlayModeHint']='auto',this['_sendUsageRequest']=()=>window['Promise']['resolve']({'status':'ok'});}create(){const _0xca07a3=this['config']['get']('initialData')||'';return this['initPlugins']()['then'](()=>this['ui']['init']())['then'](()=>this['data']['init'](_0xca07a3))['then'](()=>this['fire']('ready'));}destroy(){return super['destroy']()['then'](()=>this['ui']['destroy']());}['focus'](){this['model']['change'](_0x4a2d4c=>{const _0x5ad4c3=this['model']['document']['getRoot'](),_0x1ea0e3=_0x5ad4c3&&_0x5ad4c3['getChild'](_0x5ad4c3['childCount']-0x1);_0x4a2d4c['setSelection'](_0x1ea0e3,'end'),this['editing']['view']['focus']();});}_updatePlaceholder(){const _0x55ff9c=this['editing']['view'],_0x46fc8c=_0x55ff9c['document']['getRoot'](),_0x43c9c5=_0x46fc8c['getChild'](0x0);_0x46fc8c['childCount']>0x1||!_0x43c9c5||'p'!=_0x43c9c5['name']?this['placeholderElement']&&this['placeholderElement']['placeholder']&&(mt(_0x55ff9c,this['placeholderElement']),this['placeholderElement']=void 0x0):(this['placeholder']&&(_0x43c9c5['placeholder']=this['placeholder']),ut({'view':_0x55ff9c,'element':_0x43c9c5,'keepOnFocus':!0x0}),this['placeholderElement']=_0x43c9c5);}},St=class extends ht{keystrokes;['focusTracker'];['focusables'];['focusCycler'];submitButtonView;cancelButtonView;_editorConfig;constructor(_0x2d72d5,_0x3007a1={}){super(_0x2d72d5),this['editor']=null,this['_editorConfig']=_0x3007a1,this['set']('value',_0x3007a1['initialData']||''),this['set']('disabledSubmit',!0x1),this['set']('showButtons',!0x0),this['set']('placeholder',Et(_0x2d72d5,'Reply...')),this['set']('submitLabel',Et(_0x2d72d5,'Reply')),this['submitButtonView']=this['_createSubmitButton'](),this['cancelButtonView']=this['_createCancelButton'](),this['focusables']=this['createCollection']([this['submitButtonView'],this['cancelButtonView']]),this['keystrokes']=new _0x2a604e(),this['focusTracker']=new _0x91f952(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x153a2a=>!_0x153a2a['defaultPrevented']},'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['setTemplate']({'tag':'div','attributes':{'class':['ck-comment__input-wrapper']},'children':[{'tag':'div','attributes':{'class':['ck-comment__input-actions',this['bindTemplate']['if']('showButtons','ck-comment__input-actions--active')]},'children':[this['submitButtonView'],this['cancelButtonView']]}]}),this['keystrokes']['set']('Esc',(_0x546aeb,_0x5172a1)=>{this['cancelButtonView']['fire']('execute'),_0x5172a1();}),this['keystrokes']['set']('Ctrl+Enter',(_0x99bf97,_0x18fdf2)=>{this['submitButtonView']['isEnabled']&&(this['submitButtonView']['fire']('execute'),_0x18fdf2());}),this['on']('submit',(_0x3a9934,_0x172000)=>{_0x172000['length']>0xfde8?(alert(Et(_0x2d72d5,'TOO_LONG_COMMENT_ALERT',[_0x172000['length'],0xfde8])),_0x3a9934['stop']()):this['editor']['setData']('');},{'priority':'high'});}['render'](){super['render'](),this['_setupKeyboardNavigation']();}createEditor(){return this['editor']||(this['editor']=new Rt(this['_editorConfig']),this['_editorCreationPromise']=this['editor']['create']()['then'](()=>{if(this['_isDestroyed'])return;const _0x749eef=this['editor'];this['element']['insertBefore'](_0x749eef['ui']['element'],this['element']['firstChild']),_0x749eef['model']['document']['on']('change',()=>this['value']=_0x749eef['getData']()),_0x749eef['bind']('placeholder')['to'](this),this['focusables']['add'](_0x749eef['ui']['view'],0x0),this['fire']('editorReady',this['editor']);})),this['_editorCreationPromise'];}['focus'](_0x196de0){-0x1===_0x196de0?(this['focusCycler']['focusFirst'](),this['focusCycler']['focusLast']()):this['focusCycler']['focusFirst']();}async destroy(){this['_isDestroyed']||(this['_isDestroyed']=!0x0,this['editor']&&(await this['_editorCreationPromise'],await this['editor']['destroy'](),this['fire']('editorDestroyed',this['editor'])),await super['destroy']());}_createSubmitButton(){const {locale:_0x16ae9c}=this,_0x203adb=new _0x3e41ef(_0x16ae9c);return _0x203adb['extendTemplate']({'attributes':{'class':['ck-comment__input-actions--submit']}}),_0x203adb['withText']=!0x0,_0x203adb['bind']('label')['to'](this,'submitLabel'),_0x203adb['on']('execute',()=>{this['fire']('submit',this['value']);}),_0x203adb['bind']('isEnabled')['to'](this,'value',this,'disabledSubmit',(_0x153271,_0x1de541)=>!_0x1de541&&!!_0x153271['trim']()),_0x203adb;}_createCancelButton(){const {locale:_0x48b8f6}=this,_0x375bfe=new _0x3e41ef(_0x48b8f6);return _0x375bfe['extendTemplate']({'attributes':{'class':['ck-comment__input-actions--cancel']}}),_0x375bfe['label']=Et(_0x48b8f6,'Cancel'),_0x375bfe['withText']=!0x0,_0x375bfe['on']('execute',()=>{this['editor']['setData'](''),this['fire']('cancel');}),_0x375bfe;}_setupKeyboardNavigation(){this['keystrokes']['listenTo'](this['element']),this['focusables']['forEach'](_0x3e7dfe=>{this['focusTracker']['add'](_0x3e7dfe['element']);}),this['focusables']['on']('change',(_0x57f57d,_0x11618c)=>{for(const _0x3b04f7 of Array['from'](_0x11618c['added'])['reverse']())this['focusTracker']['add'](_0x3b04f7['element']);});}},xt=class extends ht{constructor(_0x1052fc,_0x692cd,_0x534080){super(_0x1052fc),this['commentInputView']=new St(_0x1052fc,_0x534080),this['focusCycler']=this['commentInputView']['focusCycler'],this['commentInputView']['bind']('showButtons')['to'](this['commentInputView']['focusTracker'],'isFocused',this['commentInputView'],'value',(_0x2f100a,_0x101017)=>_0x2f100a||!!_0x101017),this['set']('showInput',!0x1),this['on']('change:showInput',()=>{this['showInput']&&!this['commentInputView']['editor']&&this['commentInputView']['createEditor']();}),this['commentInputView']['delegate']('editorReady')['to'](this),this['commentInputView']['delegate']('editorDestroyed')['to'](this),this['userView']=new _0x562d15(_0x1052fc,_0x692cd),this['userView']['extendTemplate']({'attributes':{'class':'ck-thread__user','aria-hidden':!0x0}}),this['commentInputView']['extendTemplate']({'attributes':{'class':'ck-thread__input'}}),this['setTemplate']({'tag':'div','attributes':{'class':['ck-comment__input-container',this['bindTemplate']['if']('showInput','ck-comment__input-container--active')]},'children':[this['userView'],this['commentInputView']]});}['render'](){super['render'](),this['_focusOnNonInteractiveMouseDown']();}destroy(){return this['commentInputView']['destroy']()['then'](()=>super['destroy']());}['focus'](_0x30bddd){this['commentInputView']['focus'](_0x30bddd);}_focusOnNonInteractiveMouseDown(){this['listenTo'](this['element'],'mousedown',(_0x3afc73,_0x12f419)=>{const {submitButtonView:_0xa304ef,cancelButtonView:_0x34e453,editor:_0x212345}=this['commentInputView'];[_0xa304ef['element'],_0x34e453['element'],_0x212345?_0x212345['editing']['view']['getDomRoot']():null]['filter'](_0x24216d=>_0x24216d)['some'](_0x20b55f=>_0x20b55f['contains'](_0x12f419['target']))||(this['focus'](),_0x12f419['preventDefault']());});}},Pt=class extends ht{constructor(_0x1963b1){super(_0x1963b1);const _0x125b8a=this['bindTemplate'];this['set']('count',void 0x0),this['setTemplate']({'tag':'li','attributes':{'class':'ck-thread__comment-count'},'children':[{'text':_0x125b8a['to']('count',_0x4abe3e=>Et(_0x1963b1,'NUMBER_OF_COMMENTS',_0x4abe3e))}]});}},Lt=class extends ht{commentViews;resolvedCommentView;['focusTracker'];keystrokes;['focusCycler'];['_model'];['_config'];_collapsedCommentsView;constructor(_0x898874,_0x1f48ba,_0x55b8e3){super(_0x898874);const _0xb8bbc4=this['bindTemplate'];this['set']('hasDirtyComment',!0x1),this['set']('length',_0x1f48ba['comments']['length']),this['set']('isActive',!0x1),this['_model']=_0x1f48ba,this['_config']=_0x55b8e3,this['commentViews']=this['createCollection'](),this['visibleViews']=this['createCollection'](),this['resolvedCommentView']=null,this['focusTracker']=new _0x91f952(),this['keystrokes']=new _0x2a604e(),this['focusCycler']=new et({'focusables':this['commentViews'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x389df7=>this['commentViews']['map'](_0x5cb720=>_0x5cb720['element'])['includes'](_0x389df7['target'])},'actions':{'focusPrevious':'arrowup','focusNext':'arrowdown'}}),this['_collapsedCommentsView']=new Pt(_0x898874),this['_collapsedCommentsView']['bind']('count')['to'](this,'length',_0x436de3=>_0x436de3-this['_config']['maxCommentsWhenCollapsed']);for(const _0x7eb70a of _0x1f48ba['comments'])this['_handleNewCommentModel'](_0x7eb70a);this['_handleInfoComment'](),this['listenTo'](_0x1f48ba['comments'],'add',(_0x356e21,_0x530294)=>{const _0x5ce98c=this['_calculatePosition'](_0x530294);this['length']++,this['_handleNewCommentModel'](_0x530294,_0x5ce98c),this['refreshVisibleViews']();}),this['listenTo'](_0x1f48ba['comments'],'remove',(_0x2eff40,_0x1094c9)=>{this['length']--,this['_handleRemoveCommentModel'](_0x1094c9),this['refreshVisibleViews']();}),this['listenTo'](_0x1f48ba,'commentUpdated',()=>this['refreshVisibleViews']()),this['listenTo'](_0x1f48ba,'change:isResolved',()=>this['_handleInfoComment']()),this['on']('change:isActive',()=>this['refreshVisibleViews']()),this['on']('change:hasDirtyComment',()=>this['refreshVisibleViews']()),this['setTemplate']({'tag':'ul','attributes':{'class':['ck-thread__comments',_0xb8bbc4['if']('length','ck-hidden',_0x49031e=>!_0x49031e)],'aria-label':Et(_0x898874,'Thread\x20comments')},'children':this['visibleViews']});}get['_shouldCollapse'](){return this['_model']['weight']>this['_config']['maxThreadTotalWeight']&&!this['isActive']&&!this['hasDirtyComment'];}['render'](){super['render'](),this['refreshVisibleViews'](),this['_setupKeyboardNavigation']();}['focus'](_0x2901f6){-0x1===_0x2901f6?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}destroy(){this['_collapsedCommentsView']['destroy']();for(const _0x2fc333 of this['commentViews'])_0x2fc333['destroy']();super['destroy']();}['refreshVisibleViews'](){this['_shouldCollapse']?this['_rearrangeCollapse']():this['_rearrangeExpand']();}_handleNewCommentModel(_0x5edafc,_0x3196da){const _0x124aca=new this['_config']['CommentView'](this['locale'],_0x5edafc,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig']});_0x124aca['viewUid']=_0x5edafc['id'],_0x124aca['delegate']('removeComment')['to'](this),_0x124aca['delegate']('updateComment')['to'](this),_0x124aca['delegate']('resolveCommentThread')['to'](this),_0x124aca['delegate']('editorReady')['to'](this),_0x124aca['delegate']('editorDestroyed')['to'](this),this['listenTo'](_0x124aca,'change:isEditMode',()=>this['_updateHasDirtyComment']()),this['commentViews']['add'](_0x124aca,_0x3196da);}_calculatePosition(_0x229a3c){const _0x5bfe4a=this['_model']['_findOptimalIndex'](_0x229a3c);return this['resolvedCommentView']?this['resolvedCommentView']['authoredAt']>_0x229a3c['authoredAt']?_0x5bfe4a-0x1:_0x5bfe4a:_0x5bfe4a-0x1;}_handleInfoComment(){if(this['_model']['resolvedBy']&&this['_model']['resolvedAt']){const _0xcc09ec={'id':'resolved','author':this['_model']['resolvedBy'],'authoredAt':this['_model']['resolvedAt'],'content':Et(this['locale'],'Marked\x20as\x20resolved'),'attributes':{}};this['resolvedCommentView']=new this['_config']['CommentView'](this['locale'],_0xcc09ec,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig'],'isSystemComment':!0x0}),this['commentViews']['add'](this['resolvedCommentView'],this['_model']['_findOptimalIndex'](_0xcc09ec));}else this['resolvedCommentView']&&(this['commentViews']['remove'](this['resolvedCommentView']),this['resolvedCommentView']['destroy'](),this['resolvedCommentView']=null);this['refreshVisibleViews']();}_handleRemoveCommentModel(_0x24f1a3){const _0x4fa21a=this['commentViews']['remove'](_0x24f1a3['id']);this['stopListening'](_0x4fa21a),_0x4fa21a['isEditMode']&&this['_updateHasDirtyComment'](),_0x4fa21a['destroy']();}_updateHasDirtyComment(){this['hasDirtyComment']=Array['from'](this['commentViews'])['some'](_0x1fda24=>_0x1fda24['isEditMode']);}['_rearrangeCollapse'](){const _0x2c67fe=function(_0x6cf861){const _0x4874f5=new _0x40e5e7();for(const _0x1f88b5 of _0x6cf861)_0x4874f5['add'](_0x1f88b5);return _0x4874f5;}(this['commentViews']),_0x59d547=this['_collapsedCommentsView']['count'];for(let _0x49bca4=0x1;_0x49bca4<=_0x59d547;_0x49bca4++)_0x2c67fe['remove'](0x1);for(const _0x55ad3e of _0x2c67fe)_0x55ad3e['collapse']();_0x59d547>0x0&&_0x2c67fe['add'](this['_collapsedCommentsView'],0x1),Dt(_0x48b9c2(Array['from'](this['visibleViews']),Array['from'](_0x2c67fe)),this['visibleViews'],_0x2c67fe);}['_rearrangeExpand'](){Dt(_0x48b9c2(Array['from'](this['visibleViews']),Array['from'](this['commentViews'])),this['visibleViews'],this['commentViews']);for(const _0x43da66 of this['visibleViews'])_0x43da66['expand']();}_setupKeyboardNavigation(){this['commentViews']['forEach'](_0x468744=>{this['focusTracker']['add'](_0x468744['element']),this['keystrokes']['listenTo'](_0x468744['element']);}),this['commentViews']['on']('change',(_0x206e4a,_0x1d3a28)=>{for(const _0x357c5d of _0x1d3a28['removed'])this['focusTracker']['remove'](_0x357c5d['element']),this['keystrokes']['stopListening'](_0x357c5d['element']);for(const _0x7ddb26 of Array['from'](_0x1d3a28['added'])['reverse']())this['focusTracker']['add'](_0x7ddb26['element']),this['keystrokes']['listenTo'](_0x7ddb26['element']);});}};function Dt(_0x1f40c7,_0x337a1d,_0x4cd15b){let _0x3e30e9=0x0;for(const _0x105aa8 of _0x1f40c7)switch(_0x105aa8){case'insert':_0x337a1d['add'](_0x4cd15b['get'](_0x3e30e9),_0x3e30e9),_0x3e30e9++;break;case'delete':_0x337a1d['remove'](_0x3e30e9);break;case'equal':_0x3e30e9++;}}var Vt=class extends ht{constructor(_0x1f0764){super(_0x1f0764);const _0x5c5a1d=this['bindTemplate'];this['set']('contextValue',''),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-context__value'],'aria-label':_0x5c5a1d['to']('contextValue',_0x75794=>Et(_0x1f0764,'THREAD_CONTEXT_LABEL',_0x75794)),'tabindex':-0x1},'children':[{'text':_0x5c5a1d['to']('contextValue')}]});}['focus'](){this['element']['focus']();}},Bt=class extends ht{['_model'];reopenButtonView;contextView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];constructor(_0x49d89f,_0x98fa93){super(_0x49d89f);const _0x5428a2=this['bindTemplate'];this['_model']=_0x98fa93,this['reopenButtonView']=this['_createReopenButton'](),this['contextView']=this['_createContextView'](),this['focusables']=this['createCollection']([this['contextView'],this['reopenButtonView']]),this['focusTracker']=new _0x91f952(),this['keystrokes']=new _0x2a604e(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['bind']('hasContext')['to'](this['_model'],'context',_0x5abc28=>!!_0x5abc28),this['bind']('contextValue')['to'](this['_model'],'context',_0x52255c=>_0x52255c&&_0x52255c['value']?this['_trimContextValue'](_0x52255c['value']):Et(this['locale'],'Comment\x20was\x20made\x20on\x20an\x20element')),this['setTemplate']({'tag':'div','attributes':{'class':['ck-thread__header']},'children':[{'tag':'div','attributes':{'class':['ck-context-wrapper']},'children':[{'tag':'div','attributes':{'class':['ck-context',_0x5428a2['if']('hasContext','ck-context--quotes')]},'children':[this['contextView']]}]},{'tag':'div','attributes':{'class':['ck-annotation__actions']},'children':[this['reopenButtonView']]}]});}['render'](){super['render'](),this['_attachContextActions'](),this['_setupKeyboardNavigation']();}['focus'](){this['focusCycler']['focusFirst']();}_createReopenButton(){const _0x111a6b=new _0x3e41ef(this['locale']);return _0x111a6b['label']=Et(this['locale'],'Reopen'),_0x111a6b['tooltip']=Et(this['locale'],'Reopen'),_0x111a6b['icon']=_0x852169,_0x111a6b['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x114f9e=>!_0x114f9e),_0x111a6b['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x4220b1,_0x3b86c4)=>_0x4220b1&&_0x3b86c4),_0x111a6b['on']('execute',()=>{this['fire']('reopenCommentThread',this['_model']['id']);}),_0x111a6b;}_trimContextValue(_0x230b51){if(_0x230b51['length']<0x96)return _0x230b51;const _0x5c6343=_0x230b51['lastIndexOf']('\x20',0x93);return _0x230b51['substring'](0x0,_0x5c6343>-0x1?_0x5c6343:0x93)+'...';}_attachContextActions(){const _0x487e7f=this['element']['querySelector']('.ck-context'),_0x3f8cd7=_0x487e7f['querySelector']('.ck-context__value');this['listenTo'](_0x487e7f,'mouseenter',()=>{_0x3f8cd7['offsetWidth']<_0x3f8cd7['scrollWidth']&&_0x487e7f['classList']['add']('overlay');}),this['listenTo'](_0x487e7f,'mouseleave',()=>{_0x487e7f['classList']['remove']('overlay');});}_setupKeyboardNavigation(){this['keystrokes']['listenTo'](this['element']);for(const _0x27927d of this['focusables'])this['focusTracker']['add'](_0x27927d['element']),this['keystrokes']['listenTo'](_0x27927d['element']);}_createContextView(){const _0x5920f2=new Vt(this['locale']);return _0x5920f2['bind']('contextValue')['to'](this),_0x5920f2;}},Ht=class extends ht{['_model'];['_config'];commentThreadHeaderView;commentThreadInputView;ariaDescriptionView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];constructor(_0x5ec459,_0x129a7b,_0x169f78,_0x26e485){super(_0x5ec459),this['set']('isActive',!0x1),this['set']('isDirty',!0x1),this['_model']=_0x129a7b,this['_localUser']=_0x169f78,this['_config']=_0x26e485,this['commentThreadHeaderView']=new Bt(_0x5ec459,_0x129a7b),this['commentThreadHeaderView']['delegate']('reopenCommentThread')['to'](this),this['ariaDescriptionView']=new _0x48d34a(_0x5ec459,Et(_0x5ec459,'COMMENT_THREAD_DESCRIPTION')),this['listenTo'](this,'reopenCommentThread',()=>{this['focus']();}),this['commentsListView']=new Lt(_0x5ec459,_0x129a7b,Object['assign']({'CommentView':this['_config']['CommentView']},_0x26e485)),this['commentsListView']['delegate']('removeComment')['to'](this),this['commentsListView']['delegate']('updateComment')['to'](this),this['commentsListView']['delegate']('resolveCommentThread')['to'](this),this['commentsListView']['delegate']('editorReady')['to'](this),this['commentsListView']['delegate']('editorDestroyed')['to'](this),this['commentsListView']['bind']('isActive')['to'](this),this['listenTo'](this,'resolveCommentThread',()=>{this['focus']();}),this['set']('length',this['commentsListView']['length']),this['bind']('length')['to'](this['commentsListView'],'length'),this['commentThreadInputView']=this['_createCommentThreadInputView'](),this['commentThreadInputView']['delegate']('editorReady')['to'](this),this['commentThreadInputView']['delegate']('editorDestroyed')['to'](this),this['on']('removeComment',()=>this['focus']()),this['bind']('isDirty')['to'](this['commentsListView'],'hasDirtyComment',this['commentThreadInputView']['commentInputView'],'value',(_0x33c970,_0x5702c4)=>_0x33c970||!!_0x5702c4),this['bind']('isUnlinked')['to'](_0x129a7b,'unlinkedAt',_0x22e9d3=>!!_0x22e9d3);let _0xc4eeb9=null;const _0x422f77=()=>{const _0x5e2b69=this['_model']['comments']['first']||null;_0x5e2b69!==_0xc4eeb9&&(_0xc4eeb9&&this['stopListening'](_0xc4eeb9,'change:content'),_0xc4eeb9=_0x5e2b69,_0x5e2b69&&this['listenTo'](_0x5e2b69,'change:content',_0x422f77));const _0x7b9fc4=_0x5e2b69?_0x5e2b69['author']['name']:this['_localUser']['name'],_0x45837b=_0x5e2b69?new DOMParser()['parseFromString'](_0x344d90(_0x5e2b69['content'],{'limit':this['_config']['maxCommentCharsWhenCollapsed']}),'text/html')['body']['textContent']:'',_0x3be9ae=Et(this['locale'],'COMMENT_THREAD_LABEL',[this['length'],_0x7b9fc4]);this['set']('ariaLabel',_0x45837b?_0x3be9ae+'\x20'+_0x45837b:_0x3be9ae);};this['listenTo'](this['_model']['comments'],'change',_0x422f77),_0x422f77(),this['focusables']=this['createCollection']([this['commentsListView'],this['commentThreadInputView']]),this['focusTracker']=new _0x91f952(),this['keystrokes']=new _0x2a604e(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x2778a1=>_0x2778a1['target']!==this['element']},'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}});}['focus'](){this['element']['focus']();}['render'](){super['render'](),_0x131846(this,this['focusables']);}async destroy(){this['isDirty']=!0x1,this['commentsListView']['destroy'](),await this['commentThreadInputView']['destroy'](),super['destroy']();}_createCommentThreadInputView(){const _0x1d951a=new xt(this['locale'],this['_localUser'],this['_config']['editorConfig']),_0xe5e31c=_0x1d951a['commentInputView'];return _0x1d951a['bind']('showInput')['to'](this,'isActive',this['_model'],'isReadOnly',this['_model'],'canComment',this['_model'],'archivedAt',_0xe5e31c,'value',(_0x36192a,_0x23d111,_0x7b615b,_0x47cff9,_0x1ce769)=>!!_0x1ce769||!!_0x47cff9&&_0x7b615b&&!_0x23d111||_0x36192a&&_0x7b615b&&!_0x23d111),_0xe5e31c['bind']('placeholder')['to'](this,'length',this['_model'],'isResolvable',this['_model'],'isResolved',(_0x5bb4f9,_0x492eb0,_0x5b2490)=>{let _0x1b437a;return _0x1b437a=_0x5b2490&&_0x492eb0?'Reply\x20to\x20reopen\x20discussion...':_0x5bb4f9?'Reply...':'Write\x20a\x20comment...',Et(this['locale'],_0x1b437a);}),_0xe5e31c['bind']('submitLabel')['to'](this,'length',_0x1e5dc1=>Et(this['locale'],_0x1e5dc1?'Reply':'Comment')),_0xe5e31c['on']('submit',(_0x4ac237,_0x13bd12)=>{this['fire']('addComment',_0x13bd12),this['_model']['isResolved']&&this['_model']['isResolvable']&&this['fire']('reopenCommentThread',this['_model']['id']),this['_model']['isSubmitted']||this['fire']('submitCommentThread');}),_0xe5e31c['on']('cancel',()=>{this['focus']();}),_0xe5e31c['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0xe5e31c['on']('cancel',_0x177cc8=>{0x0==this['length']&&(this['fire']('removeCommentThread'),_0x177cc8['stop']());}),this['on']('change:isActive',(_0x565be0,_0x1abcac,_0xbea486)=>{_0xbea486||this['length']||_0xe5e31c['value']||this['fire']('removeCommentThread');}),_0x1d951a;}};const Ft=/* #__PURE__ -- @preserve */
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
_0x3b50a4();var $t=class Annotation extends jt{['view'];focusableElements;_type;_target;constructor({view:_0x386c0a,target:_0x25ca35,type:_0x53675d,isVisible:_0x2e66ce=!0x0}){super(),this['view']=_0x386c0a,this['view']['element']||this['view']['render'](),this['_type']=_0x53675d,this['_target']=_0x25ca35,Annotation['_assertCorrectTarget'](this['_getNormalizedTarget']()),this['focusableElements']=new _0x40e5e7([this['view']['element']],{'idProperty':'_id'}),this['focusableElements']['on']('add',(_0x5f5850,_0x259dae)=>{this['view']['focusTracker']['add'](_0x259dae);}),this['focusableElements']['on']('remove',(_0xcaded2,_0x280a45)=>{this['view']['focusTracker']['remove'](_0x280a45);}),this['set']('isVisible',_0x2e66ce);}get type(){return'function'==typeof this['_type']?this['_type']():this['_type'];}get['innerView'](){return this['view']['mainView'];}get target(){const _0x3c4dd5=this['_getNormalizedTarget']();return Annotation['_assertCorrectTarget'](_0x3c4dd5),_0x3c4dd5;}get targetRect(){const _0xb20ab4=this['target'];if(null===_0xb20ab4)return null;if(_0xb20ab4 instanceof _0x3a8ad1)return _0xb20ab4;const _0x268747=_0xb20ab4['filter'](_0x2aef6f=>function(_0x8299e0){return!!_0x8299e0['offsetParent']||!!_0x8299e0['getClientRects']()['item'](0x0);}(_0x2aef6f));return 0x0===_0x268747['length']?null:_0x3a8ad1['getDomElementRects'](_0x268747[0x0])[0x0];}get isActive(){return this['view']['isActive'];}set isActive(_0x9a57bb){this['view']['isActive']=_0x9a57bb,this['view']['mainView']['isActive']=_0x9a57bb;}updateTargetRect(){this['view']['targetRect']=this['targetRect'];}destroy(){this['focusableElements']['stopListening'](),this['focusableElements']['clear'](),this['stopListening']();}refreshVisibility(){this['isVisible']=!!this['targetRect'];}static _assertCorrectTarget(_0x169c57){if(!(null===_0x169c57||_0x169c57 instanceof _0x3a8ad1||Array['isArray'](_0x169c57)&&_0x169c57['every'](_0x40efe1=>zt(_0x40efe1))))throw new _0x48784c('annotation-invalid-target',null,{'target':_0x169c57});}_getNormalizedTarget(){const _0x50926b='function'==typeof this['_target']?this['_target']():this['_target'];return zt(_0x50926b)?[_0x50926b]:_0x50926b;}};function zt(_0x3aec5f){return null!==_0x3aec5f&&'object'==typeof _0x3aec5f&&'nodeType'in _0x3aec5f&&0x1===_0x3aec5f['nodeType'];}var Jt=class extends _0x40e5e7{_innerViewToAnnotation;_viewToAnnotation;['_focusTracker'];constructor(_0x3b8d47=[]){super(),this['_innerViewToAnnotation']=new Map(),this['_viewToAnnotation']=new Map(),this['_focusTracker']=new _0x91f952(),this['_focusTracker']['on']('change:isFocused',(_0x15347f,_0x49fb13,_0xdb7036)=>{_0xdb7036||this['fire']('blur');});for(const _0x3ba78e of _0x3b8d47)this['add'](_0x3ba78e);}get['isFocused'](){return this['_focusTracker']['isFocused'];}['add'](_0x1db311){if(this['has'](_0x1db311))throw new _0x48784c('annotationcollection-duplicated-item',null);this['_innerViewToAnnotation']['set'](_0x1db311['innerView'],_0x1db311),this['_viewToAnnotation']['set'](_0x1db311['view'],_0x1db311);for(const _0x2fe7db of _0x1db311['focusableElements'])this['_focusTracker']['add'](_0x2fe7db);if(this['listenTo'](_0x1db311['focusableElements'],'add',(_0x260225,_0x5e736f)=>{this['_focusTracker']['add'](_0x5e736f);}),this['listenTo'](_0x1db311['focusableElements'],'remove',(_0x431839,_0xb13938)=>{this['_focusTracker']['remove'](_0xb13938);}),this['listenTo'](_0x1db311['view']['focusTracker'],'change:isFocused',(_0x173a37,_0x3a60c6,_0x51a30a)=>{_0x51a30a&&this['fire']('focus',_0x1db311);}),_0x1db311['updateTargetRect'](),this['_areCachedRectsStale']()){for(const _0x54c1eb of this)_0x54c1eb['updateTargetRect']();}const _0x38d357=this['_getOrderInContent'](_0x1db311['view']['targetRect']);return super['add'](_0x1db311,_0x38d357);}['remove'](_0x4aefa9){if(!this['has'](_0x4aefa9))throw new _0x48784c('annotationcollection-not-existing-item',null);this['stopListening'](_0x4aefa9['view']['focusTracker']),this['stopListening'](_0x4aefa9['focusableElements']);for(const _0x42b371 of _0x4aefa9['focusableElements'])this['_focusTracker']['remove'](_0x42b371);return this['_viewToAnnotation']['delete'](_0x4aefa9['view']),this['_innerViewToAnnotation']['delete'](_0x4aefa9['innerView']),super['remove'](_0x4aefa9);}getByInnerView(_0x332703){return this['_innerViewToAnnotation']['get'](_0x332703);}getByView(_0x281699){return this['_viewToAnnotation']['get'](_0x281699);}destroy(){super['clear'](),this['stopListening'](),this['_innerViewToAnnotation']['clear'](),this['_viewToAnnotation']['clear'](),this['_focusTracker']['destroy']();}refreshPositioning(){for(const _0x1963e6 of this)_0x1963e6['updateTargetRect']();this['_sort']();}_sort(){const _0x54bceb=Array['from'](this)['sort']((_0x1dc79d,_0x583efe)=>Zt(_0x1dc79d['view']['targetRect'],_0x583efe['view']['targetRect']));for(let _0x24b4f9=_0x54bceb['length']-0x1;_0x24b4f9>0x0;_0x24b4f9--){const _0x2dea93=_0x54bceb[_0x24b4f9];_0x24b4f9!==this['getIndex'](_0x2dea93)&&(this['remove'](_0x2dea93),this['add'](_0x2dea93));}}_getOrderInContent(_0x40a1b6){let _0xe4397e=0x0;if(!_0x40a1b6)return this['length'];for(const _0x446e37 of this){const _0xa3056c=_0x446e37['view']['targetRect'];if(_0xa3056c){if(Zt(_0x40a1b6,_0xa3056c)<0x0)return _0xe4397e;_0xe4397e++;}}return _0xe4397e;}_areCachedRectsStale(){const _0x3ce09b=this['get'](0x0);if(!_0x3ce09b)return!0x1;const _0x113506=_0x3ce09b['view']['targetRect'],_0x2b988f=_0x3ce09b['targetRect'];return!(!_0x113506||!_0x2b988f)&&(_0x113506['top']!==_0x2b988f['top']||_0x113506['left']!==_0x2b988f['left']);}};function Qt({source:_0x4cac61,target:_0x45d4ae,filter:_0x41c56a}){for(const _0x1dae87 of _0x4cac61)_0x41c56a(_0x1dae87)&&_0x45d4ae['add'](_0x1dae87);_0x45d4ae['listenTo'](_0x4cac61,'add',(_0x4f53bd,_0x356d8a)=>{_0x41c56a(_0x356d8a)&&_0x45d4ae['add'](_0x356d8a);}),_0x45d4ae['listenTo'](_0x4cac61,'remove',(_0x12df36,_0x97c64)=>{_0x45d4ae['has'](_0x97c64)&&_0x45d4ae['remove'](_0x97c64);});}function Zt(_0x4ed680,_0x36c658){if(null===_0x4ed680&&null===_0x36c658)return 0x0;if(null===_0x4ed680)return-0x1;if(null===_0x36c658)return 0x1;const _0x3fae84=_0x4ed680['top']-_0x36c658['top'];return 0x0==_0x3fae84?_0x4ed680['left']-_0x36c658['left']:_0x3fae84;}var ti=class extends _0xa2dbe{collection;_visibleAnnotations;static get['pluginName'](){return'Annotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x127992){if(super(_0x127992),this['collection']=new Jt(),this['_visibleAnnotations']=new Jt(),this['set']('activeAnnotations',new Set()),this['_bindAnnotationsToVisibleAnnotations'](),_0x127992 instanceof _0x651c85){const _0x232145=_0x127992['locale'];_0x127992['accessibility']['addKeystrokeInfoGroup']({'id':'annotations','label':Et(_0x232145,'ACCESSIBILITY_HELP_ANNOTATIONS_GROUP'),'keystrokes':[{'label':Et(_0x232145,'ACCESSIBILITY_HELP_ANNOTATIONS_MOVE_TO'),'keystroke':'Ctrl+Shift+E'},{'label':Et(_0x232145,'ACCESSIBILITY_HELP_ANNOTATIONS_EXIT'),'keystroke':'Esc'},{'label':Et(_0x232145,'ACCESSIBILITY_HELP_ANNOTATIONS_ENTER'),'keystroke':'Enter'},{'label':Et(_0x232145,'ACCESSIBILITY_HELP_ANNOTATIONS_BROWSE_GROUPS'),'keystroke':[['Tab'],['Shift+Tab']]},{'label':Et(_0x232145,'ACCESSIBILITY_HELP_ANNOTATIONS_SUBMIT_COMMENT'),'keystroke':['Ctrl+Enter']},{'label':Et(_0x232145,'ACCESSIBILITY_HELP_ANNOTATIONS_NAVIGATE_THREADS'),'keystroke':[['Arrowup'],['Arrowdown']]}]});}this['_setupEnterAnnotationKeystroke'](),this['_setupEscapeAnnotationHandling']();}['add'](_0x5f28ef){this['collection']['add'](_0x5f28ef);}['remove'](_0x2a3504){this['collection']['remove'](_0x2a3504),_0x2a3504['destroy']();}refreshVisibility(){for(const _0x1daf37 of this['collection'])_0x1daf37['refreshVisibility']();}refreshPositioning(){this['_visibleAnnotations']['refreshPositioning']();}getByInnerView(_0x4c260f){return this['collection']['getByInnerView'](_0x4c260f);}deactivateAll(){this['fire']('_deactivateAllAnnotations');}destroy(){for(const _0xef8dd2 of this['collection'])_0xef8dd2['destroy']();this['_visibleAnnotations']['destroy'](),this['collection']['destroy'](),super['destroy']();}activate(_0xa9cb57){this['fire']('_activateAnnotation',_0xa9cb57);}createAnnotation(_0x5b8a85){return new $t(_0x5b8a85);}createAnnotationView(_0x116956,_0x48c42a){return new qt(_0x116956,_0x48c42a);}_addActiveAnnotation(_0xbfc37a){const _0x405246=new Set(this['activeAnnotations']);_0x405246['add'](_0xbfc37a),this['activeAnnotations']=_0x405246;}_removeActiveAnnotation(_0x19b557){const _0x1fd531=new Set(this['activeAnnotations']);_0x1fd531['delete'](_0x19b557),this['activeAnnotations']=_0x1fd531;}_bindAnnotationsToVisibleAnnotations(){const _0x236c4c=this['collection'],_0x143174=this['_visibleAnnotations'];function _0x494376(_0x1f318d){const _0x47b7b2=_0x1f318d['source'];_0x47b7b2['isVisible']&&!_0x143174['has'](_0x47b7b2)?_0x143174['add'](_0x47b7b2):!_0x47b7b2['isVisible']&&_0x143174['has'](_0x47b7b2)&&_0x143174['remove'](_0x47b7b2),_0x47b7b2['view']['focusTracker']['remove'](_0x47b7b2['view']['element']),_0x47b7b2['view']['focusTracker']['add'](_0x47b7b2['view']['element']);}this['listenTo'](_0x236c4c,'add',(_0x2ff0de,_0x17bfd9)=>{_0x17bfd9['isVisible']&&_0x143174['add'](_0x17bfd9),this['listenTo'](_0x17bfd9,'change:isVisible',_0x494376);}),this['listenTo'](_0x236c4c,'remove',(_0x4d40c5,_0x52bbd4)=>{_0x143174['has'](_0x52bbd4)&&_0x143174['remove'](_0x52bbd4),this['stopListening'](_0x52bbd4,'change:isVisible',_0x494376);});}_setupEnterAnnotationKeystroke(){const _0x483d32=_0x337400=>{_0x337400['on']('ready',()=>{_0x337400['keystrokes']['set'](_0x4ef251,(_0x119ca8,_0x540487)=>{const _0x1934b1=_0x59466b(this['activeAnnotations']['values']());_0x1934b1&&(_0x1934b1['view']['focus'](),_0x540487());});});};this['context']instanceof _0x651c85?_0x483d32(this['context']):this['context']['editors']&&this['context']['editors']['on']('add',(_0x429305,_0x4584ef)=>{_0x483d32(_0x4584ef);});}_setupEscapeAnnotationHandling(){const _0x5ea9df=_0x468711=>{const _0x8d50b=_0x468711['source'],_0x60cdd3=[];let _0x592f08;if(Array['isArray'](_0x8d50b['target'])){_0x592f08=_0x8d50b['target'][0x0],this['context']instanceof _0x651c85?_0x60cdd3['push'](this['context']):this['context']['editors']&&_0x60cdd3['push'](...this['context']['editors']);for(const _0x377dcf of _0x60cdd3)for(const _0x2c7596 of _0x377dcf['editing']['view']['domRoots']['values']())if(_0x2c7596['contains'](_0x592f08))return void _0x377dcf['editing']['view']['focus']();_0x592f08['focus']();}};this['listenTo'](this['collection'],'add',(_0x2593d1,_0x1be17d)=>{this['listenTo'](_0x1be17d,'escape',_0x5ea9df,{'priority':'low'});}),this['listenTo'](this['collection'],'remove',(_0x407cc2,_0x4d9694)=>{this['stopListening'](_0x4d9694,'escape',_0x5ea9df);});}};const ii=Symbol('noChannel'),ei={'admin':!0x0,'modifyAll':!0x1,'write':!0x0,'resolve':!0x0},si=/* #__PURE__ -- @preserve */
|
|
30
|
-
|
|
31
|
-
_0x3b50a4();var oi=class extends _0xa2dbe{_threads;_threadToController;_viewToController;static get requires(){return[ti,_0x2fc7c7,_0x89d66a];}static get['pluginName'](){return'CommentsRepository';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2eccc0){super(_0x2eccc0),this['_threads']=new Map(),this['_threadToController']=new Map(),this['_viewToController']=new Map(),this['set']('_readOnlyChannels',new Set()),this['set']('_permissions',new Map());const _0x3e3e07=this['context']['config'];_0x3e3e07['define']('comments.maxCommentsWhenCollapsed',0x2),_0x3e3e07['define']('comments.maxThreadTotalWeight',0x1f4),_0x3e3e07['define']('comments.maxCommentCharsWhenCollapsed',0x8c),_0x3e3e07['define']('comments.CommentThreadView',Ut),_0x3e3e07['define']('comments.CommentView',Yt),_0x3e3e07['get']('comments.editorConfig')||console['warn']('Missing\x20comments\x20editor\x20configuration\x20(`comments.editorConfig`).\x20Default\x20configuration\x20will\x20be\x20used\x20instead.');}init(){const _0x5949e5=this['context']['plugins']['get'](ti);this['set']('activeCommentThread',null),this['on']('addCommentThread',(_0x370805,_0x5b3b0a)=>this['_addCommentThread'](_0x5b3b0a)),this['on']('submitCommentThread',(_0x564780,_0x24f0dc)=>this['_submitCommentThread'](_0x24f0dc)),this['on']('resolveCommentThread',(_0x259d3b,_0x1f603f)=>this['_resolveCommentThread'](_0x1f603f)),this['on']('resolveCommentThread',(_0x43b901,_0x5f49eb)=>this['_updateActiveAnnotation'](_0x5f49eb),{'priority':'lowest'}),this['on']('reopenCommentThread',(_0x22fff9,_0x4c72c8)=>this['_reopenCommentThread'](_0x4c72c8)),this['on']('reopenCommentThread',(_0x3561c0,_0x211e94)=>this['_updateActiveAnnotation'](_0x211e94),{'priority':'lowest'}),this['on']('removeCommentThread',(_0x1d363e,_0x2f446f)=>this['_removeCommentThread'](_0x2f446f)),this['on']('updateCommentThread',(_0x378776,_0x37c317)=>this['_updateCommentThread'](_0x37c317)),this['on']('updateCommentThread',(_0x2d404c,_0x3ab506)=>this['_updateActiveAnnotation'](_0x3ab506),{'priority':'lowest'}),this['on']('addComment',(_0x1573d1,_0x27f29a)=>this['_addComment'](_0x27f29a)),this['on']('updateComment',(_0x1910f9,_0x2c2424)=>this['_updateComment'](_0x2c2424)),this['on']('removeComment',(_0x1d41b8,_0x28cce2)=>this['_removeComment'](_0x28cce2)),this['on']('addComment',(_0x473171,{threadId:_0x147bef,isFromAdapter:_0x3a81a2})=>{if(_0x3a81a2)return;const _0xd2b8ab=this['getCommentThread'](_0x147bef),_0x40b91b=_0xd2b8ab&&this['_threadToController']['get'](_0xd2b8ab);_0x40b91b&&_0x40b91b['view']['commentsListView']['focus'](-0x1);},{'priority':'lowest'}),this['listenTo'](_0x5949e5,'change:activeAnnotations',(_0x28e20e,_0x37b240,_0x4ba95f)=>{const _0x48aff0=Array['from'](_0x4ba95f)['map'](_0x4f03b8=>this['_viewToController']['get'](_0x4f03b8['innerView']))['filter'](Boolean)[0x0];this['activeCommentThread']=_0x48aff0?_0x48aff0['model']:null;});}set adapter(_0x4010cf){if(this['_adapter'])throw new _0x48784c('commentsrepository-adapter-already-set');this['_adapter']=_0x4010cf;}get adapter(){return this['_adapter'];}addCommentThread({channelId:_0x3a53e5=ii,threadId:_0x5d2a52=_0x3fd960(),comments:_0x29aa02=[],unlinkedAt:_0x52db65=null,resolvedAt:_0x12238f=null,resolvedBy:_0x17a512=null,target:_0x41c6d9=null,context:_0x4ceb5a=null,attributes:_0x20672e={},isResolvable:_0x5eeede=!0x0,isSubmitted:_0x3d703f=!0x1,isFromAdapter:_0x796e6a=!0x1}={}){return this['fire'](ai('addCommentThread',_0x3a53e5),{'channelId':_0x3a53e5,'threadId':_0x5d2a52,'comments':_0x29aa02,'unlinkedAt':_0x52db65,'resolvedAt':_0x12238f,'resolvedBy':_0x17a512,'target':_0x41c6d9,'context':_0x4ceb5a,'attributes':_0x20672e,'isFromAdapter':_0x796e6a,'isResolvable':_0x5eeede,'isSubmitted':_0x3d703f}),this['getCommentThread'](_0x5d2a52);}openNewCommentThread({channelId:_0x1e1f77=ii,threadId:_0x3f0508=_0x3fd960(),target:_0x2c1a96,context:_0x26957f=null,isResolvable:_0x48e68f=!0x0}){if(this['_readOnlyChannels']['has'](_0x1e1f77)||this['_readOnlyChannels']['has'](void 0x0))return null;if(!_0x2c1a96)throw new _0x48784c('commentsrepository-missing-target');const _0x47d2fa=this['addCommentThread']({'channelId':_0x1e1f77,'threadId':_0x3f0508,'target':_0x2c1a96,'context':_0x26957f,'isResolvable':_0x48e68f});if(!_0x47d2fa)return null;const _0xfa5733=this['_threadToController']['get'](_0x47d2fa),_0x425880=_0xfa5733['view']['commentThreadInputView']['commentInputView'],_0x32d53f=this['context']['plugins']['get'](ti),_0x2384bd=_0x32d53f['getByInnerView'](_0xfa5733['view']);return _0x32d53f['activate'](_0x2384bd),_0x425880['once']('editorReady',()=>_0x425880['focus']()),_0x47d2fa;}hasCommentThread(_0x344796){if('string'!=typeof _0x344796)throw new _0x48784c('commentsrepository-invalid-comment-thread-id');return this['_threads']['has'](_0x344796);}updateCommentThread({channelId:_0x1b7b4d=ii,threadId:_0x3e19dd,context:_0x1fb169,unlinkedAt:_0x4cdc0a,attributes:_0x253182,isFromAdapter:_0x52a228=!0x1}){return this['fire'](ai('updateCommentThread',_0x1b7b4d),{'channelId':_0x1b7b4d,'threadId':_0x3e19dd,'context':_0x1fb169,'unlinkedAt':_0x4cdc0a,'attributes':_0x253182,'isFromAdapter':_0x52a228}),this['getCommentThread'](_0x3e19dd);}getCommentThread(_0x174c62){if('string'!=typeof _0x174c62)throw new _0x48784c('commentsrepository-invalid-comment-thread-id');return this['_threads']['get'](_0x174c62);}fetchCommentThread({channelId:_0x40010e,threadId:_0xd81370}={}){const _0x56a8e8=this['getCommentThread'](_0xd81370);if(_0x56a8e8)return Promise['resolve'](_0x56a8e8);if(!this['adapter'])return Promise['resolve'](void 0x0);if('function'!=typeof this['adapter']['getCommentThread'])throw new _0x48784c('commentsrepository-missing-thread-and-adapter-method',this['context']);return this['adapter']['getCommentThread']({'channelId':_0x40010e,'threadId':_0xd81370})['then'](_0x221c92=>this['hasCommentThread'](_0xd81370)?this['getCommentThread'](_0xd81370):_0x221c92?this['addCommentThread'](Object['assign']({'isFromAdapter':!0x0,'channelId':_0x40010e},_0x221c92)):void 0x0)['catch'](_0x46bdec=>{throw console['error'](_0x46bdec),new _0x48784c('commentsrepository-fetch-comment-thread',this['context']);});}getCommentThreads({channelId:_0x20333b,skipNotAttached:_0x4a657b=!0x1,skipEmpty:_0x4026cb=!0x1,toJSON:_0x53fdc4=!0x1}={}){const _0x43fe1c=[];for(const _0x2f9379 of this['_threads']['values']())_0x20333b&&_0x2f9379['channelId']!==_0x20333b||_0x4a657b&&!_0x2f9379['isAttached']||_0x4026cb&&0x0===_0x2f9379['length']||_0x43fe1c['push'](_0x2f9379);return _0x53fdc4?_0x43fe1c['map'](_0x4730d1=>_0x4730d1['toJSON']()):_0x43fe1c;}getAnnotationForCommentThread(_0x5294f8){const _0x4cc574=this['_threadToController']['get'](_0x5294f8);return _0x4cc574&&this['context']['plugins']['get'](ti)['getByInnerView'](_0x4cc574['view'])||null;}getCommentThreadForAnnotation(_0x13cb5d){const _0x138960=this['_viewToController']['get'](_0x13cb5d['innerView']);return _0x138960?_0x138960['model']:null;}setActiveCommentThread(_0x19961a){const _0x1cd93c=this['context']['plugins']['get'](ti);if(!_0x19961a)return void(this['activeCommentThread']&&_0x1cd93c['deactivateAll']());const _0x2e2994=this['getCommentThread'](_0x19961a);if(!_0x2e2994)throw new _0x48784c('commentsrepository-active-missing-comment-thread',null,{'threadId':_0x19961a});if(!this['_threadToController']['has'](_0x2e2994))throw new _0x48784c('commentsrepository-active-not-attached',null,{'threadId':_0x19961a});const _0x181bcd=_0x1cd93c['getByInnerView'](this['_threadToController']['get'](_0x2e2994)['view']);_0x1cd93c['activate'](_0x181bcd);}switchReadOnly(_0x3287a7,_0xcd3b65){_0x3287a7?this['_readOnlyChannels']['add'](_0xcd3b65):this['_readOnlyChannels']['delete'](_0xcd3b65),this['fire']('change:_readOnlyChannels','_readOnlyChannels',this['_readOnlyChannels'],this['_readOnlyChannels']);}['isReadOnly'](_0x5a9b09){return this['_readOnlyChannels']['has'](_0x5a9b09)||this['_readOnlyChannels']['has'](void 0x0);}createCommentThreadController(_0x25cdce,_0x17940e){return new bt(_0x25cdce,_0x17940e);}setPermissions(_0x716944,_0x446019=ii){this['_permissions']['set'](_0x446019,_0x716944),this['fire']('change:_permissions','_permissions',this['_permissions'],this['_permissions']);}getPermissions(_0x5c810b=ii){return this['_permissions']['has'](_0x5c810b)?this['_permissions']['get'](_0x5c810b):ei;}_addCommentThread({channelId:_0x500879,threadId:_0x23b202,comments:_0xcf3145,unlinkedAt:_0x52956b,resolvedAt:_0x30918b,resolvedBy:_0x3f1438,target:_0x10c3f1,context:_0x584532,attributes:_0x2ac2a3,isFromAdapter:_0x31dcbc,isResolvable:_0x18372b,isSubmitted:_0x4d103e}){if('string'!=typeof _0x23b202)throw new _0x48784c('commentsrepository-invalid-comment-thread-id',null,{'threadId':_0x23b202});if(this['hasCommentThread'](_0x23b202))throw new _0x48784c('commentsrepository-duplicated-comment-thread-id',null,{'threadId':_0x23b202});const _0xc8187f=new ri(this,{'channelId':_0x500879,'id':_0x23b202,'context':_0x584532,'attributes':_0x2ac2a3,'unlinkedAt':_0x52956b,'resolvedAt':_0x30918b,'resolvedBy':_0x3f1438?this['context']['plugins']['get'](_0x89d66a)['getUser'](_0x3f1438):null,'isResolvable':_0x18372b,'isSubmitted':_0x4d103e||_0x31dcbc});this['_threads']['set'](_0x23b202,_0xc8187f);for(const _0x170dbb of _0xcf3145)_0xc8187f['_add'](this['_createNewComment']({'threadId':_0x23b202,..._0x170dbb}));return _0x10c3f1&&_0xc8187f['attachTo'](_0x10c3f1),_0x31dcbc||!_0xc8187f['length']?Promise['resolve']():this['_submitCommentThread']({'channelId':_0x500879,'threadId':_0x23b202});}_submitCommentThread({channelId:_0x5d560b,threadId:_0x43ff13}){if(!this['hasCommentThread'](_0x43ff13))throw new _0x48784c('commentsrepository-missing-comment-thread',this);const _0x4866b1=this['getCommentThread'](_0x43ff13);if(_0x4866b1['_isSubmitted']=!0x0,!this['adapter']||'function'!=typeof this['adapter']['addCommentThread'])return Promise['resolve']();const {id:_0x3aec35,comments:_0x528e87,resolvedAt:_0x9a6815,resolvedBy:_0x52ba1b,context:_0xb96d03,attributes:_0x53de15}=_0x4866b1,_0x202a96=this['context']['plugins']['get']('PendingActions'),_0x3e5810=_0x202a96['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['addCommentThread']({'channelId':_0x5d560b,'threadId':_0x3aec35,'comments':_0x528e87['map'](_0x1b0c7b=>_0x1b0c7b['toJSON']()),'resolvedAt':_0x9a6815,'resolvedBy':_0x52ba1b?_0x52ba1b['id']:_0x52ba1b,'context':_0xb96d03,'attributes':_0x53de15})['then'](({comments:_0x5f3a07})=>{_0x202a96['remove'](_0x3e5810);for(const _0x4ca145 of _0x5f3a07)this['_updateComment']({'channelId':_0x5d560b,'threadId':_0x43ff13,'commentId':_0x4ca145['commentId'],'createdAt':_0x4ca145['createdAt'],'isFromAdapter':!0x0});})['catch'](_0x41e0c1=>{throw console['error'](_0x41e0c1),new _0x48784c('commentsrepository-add-comment-thread-internal-error',this);});}_attachCommentThread({threadId:_0x4f2bdb,target:_0x55acb5}){const _0x3542b3=this['getCommentThread'](_0x4f2bdb);if(!_0x3542b3)throw new _0x48784c('commentsrepository-attach-missing-comment-thread',this);const _0x50922d=this['context']['plugins']['get']('PendingActions'),_0x29c925=this['context']['plugins']['get'](ti),_0x3a7dd3=this['_createCommentThreadView'](_0x3542b3),_0x4b5e7b=new bt(_0x3542b3,_0x3a7dd3);let _0x358016=null;_0x3a7dd3['on']('change:isDirty',(_0x5c32b5,_0x494d3c,_0x39b5f2)=>{_0x39b5f2?_0x358016=_0x50922d['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD')):_0x358016&&(_0x50922d['remove'](_0x358016),_0x358016=null);}),this['_threadToController']['set'](_0x3542b3,_0x4b5e7b),this['_viewToController']['set'](_0x3a7dd3,_0x4b5e7b);const _0x148241=new qt(this['context']['locale'],_0x3a7dd3);_0x148241['bind']('length')['to'](_0x3a7dd3),_0x148241['bind']('isDirty')['to'](_0x3a7dd3,'isDirty',_0x3a7dd3,'length',(_0x2fad70,_0x10888d)=>_0x2fad70||!_0x10888d),_0x148241['bind']('isActive')['to'](_0x3a7dd3),_0x148241['type']='comment';const _0x4aa455=new $t({'view':_0x148241,'target':_0x55acb5,'type':'comment','isVisible':!_0x3542b3['archivedAt']&&!!('function'==typeof _0x55acb5?_0x55acb5():_0x55acb5)});return _0x3a7dd3['on']('escape',()=>{_0x4aa455['fire']('escape');}),this['_bindAnnotationToEditors'](_0x3a7dd3,_0x4aa455),_0x29c925['add'](_0x4aa455),_0x4aa455;}_bindAnnotationToEditors(_0x2416e1,_0x9532db){this['listenTo'](_0x2416e1,'editorReady',(_0x12f858,_0xfee052)=>{const _0x3a2570=_0xfee052['ui']['view']['body']['bodyCollectionContainer'];_0x9532db['focusableElements']['add'](_0x3a2570),this['context']instanceof _0x651c85&&this['context']['ui']['focusTracker']['add'](_0x3a2570);},{'priority':'highest'}),this['listenTo'](_0x2416e1,'editorDestroyed',(_0x3a7b11,_0x17d439)=>{const _0x3e9c75=_0x17d439['ui']['view']['body']['bodyCollectionContainer'];_0x9532db['focusableElements']['has'](_0x3e9c75)&&_0x9532db['focusableElements']['remove'](_0x3e9c75),this['context']instanceof _0x651c85&&this['context']['ui']['focusTracker']['remove'](_0x3e9c75);});}_unbindEditors(_0x44e387){this['stopListening'](_0x44e387,'editorReady'),this['stopListening'](_0x44e387,'editorDestroyed');}_createCommentThreadView(_0x422bd2){const _0x2f6335=this['context']['plugins']['get'](_0x89d66a),{config:_0x23d6b5,locale:_0x7441d9}=this['context'],_0x3182c7=_0x51bb95(_0x23d6b5['get']('locale'),_0x7441d9);return new(0x0,(_0x23d6b5['get']('comments'))['CommentThreadView'])(_0x7441d9,_0x422bd2,_0x2f6335['me'],{'editorConfig':{..._0x23d6b5['get']('comments.editorConfig'),'licenseKey':this['context']['config']['get']('licenseKey')},'copyMarkers':_0x23d6b5['get']('comments.copyMarkers'),'maxCommentsWhenCollapsed':_0x23d6b5['get']('comments.maxCommentsWhenCollapsed'),'maxThreadTotalWeight':_0x23d6b5['get']('comments.maxThreadTotalWeight'),'maxCommentCharsWhenCollapsed':_0x23d6b5['get']('comments.maxCommentCharsWhenCollapsed'),'formatDateTime':_0x3182c7,'CommentView':_0x23d6b5['get']('comments')['CommentView']});}_resolveCommentThread({threadId:_0x2aae01,channelId:_0x239e52,resolvedAt:_0x81dd7c,resolvedBy:_0x44db8b,isFromAdapter:_0x5ca046}){if(!this['hasCommentThread'](_0x2aae01))throw new _0x48784c('commentsrepository-missing-comment-thread',null,{'threadId':_0x2aae01});const _0x4272f7=this['getCommentThread'](_0x2aae01);if(_0x4272f7['isResolved'])throw new _0x48784c('commentsrepository-resolved-comment-thread',null,{'threadId':_0x2aae01});const _0x7a3bf9=this['context']['plugins']['get'](_0x89d66a);if(_0x4272f7['resolvedBy']=_0x7a3bf9['getUser'](_0x44db8b),_0x4272f7['resolvedAt']=_0x81dd7c,_0x5ca046||!this['adapter']||'function'!=typeof this['adapter']['resolveCommentThread'])return Promise['resolve']();const _0x58c03b=this['context']['plugins']['get']('PendingActions'),_0x31a522=_0x58c03b['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['resolveCommentThread']({'channelId':_0x239e52,'threadId':_0x2aae01})['then'](({resolvedAt:_0x1e8e9a,resolvedBy:_0x185748})=>{_0x58c03b['remove'](_0x31a522),_0x4272f7['resolvedBy']['id']!==_0x185748&&(_0x4272f7['resolvedBy']=_0x7a3bf9['getUser'](_0x185748)),_0x4272f7['resolvedAt']=_0x1e8e9a;})['catch'](_0x1ec815=>{throw console['error'](_0x1ec815),new _0x48784c('commentsrepository-resolve-comment-thread-internal-error',this);});}_reopenCommentThread({threadId:_0x38ea90,channelId:_0x2a31f6,isFromAdapter:_0x5183b2}){if(!this['hasCommentThread'](_0x38ea90))throw new _0x48784c('commentsrepository-missing-comment-thread',null,{'threadId':_0x38ea90});const _0x225022=this['getCommentThread'](_0x38ea90);if(!_0x225022['isResolved'])throw new _0x48784c('commentsrepository-reopen-comment-thread',null,{'threadId':_0x38ea90});if(_0x225022['resolvedBy']=null,_0x225022['resolvedAt']=null,_0x5183b2||!this['adapter']||'function'!=typeof this['adapter']['reopenCommentThread'])return Promise['resolve']();const _0x209371=this['context']['plugins']['get']('PendingActions'),_0x588f23=_0x209371['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['reopenCommentThread']({'channelId':_0x2a31f6,'threadId':_0x38ea90})['then'](()=>_0x209371['remove'](_0x588f23))['catch'](_0x135160=>{throw console['error'](_0x135160),new _0x48784c('commentsrepository-reopen-comment-thread-internal-error',this);});}_removeCommentThread({threadId:_0x5f0656,isFromAdapter:_0x35f95f}){const _0x32b318=this['getCommentThread'](_0x5f0656);if(!_0x32b318)throw new _0x48784c('commentsrepository-remove-missing-comment-thread',this);if(this['_detachCommentThread'](_0x5f0656),this['_threads']['delete'](_0x5f0656),!_0x32b318['isSubmitted']||_0x35f95f||!this['adapter']||'function'!=typeof this['adapter']['removeCommentThread'])return Promise['resolve']();const _0x222aaa=this['context']['plugins']['get']('PendingActions'),{channelId:_0x55dd50}=_0x32b318,_0x3884fd=_0x222aaa['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['removeCommentThread']({'channelId':_0x55dd50,'threadId':_0x5f0656})['then'](()=>_0x222aaa['remove'](_0x3884fd))['catch'](_0x5d9feb=>{throw console['error'](_0x5d9feb),new _0x48784c('commentsrepository-remove-comment-thread-internal-error',this);});}_updateCommentThread({threadId:_0x170ee5,unlinkedAt:_0x358eb3,context:_0x351639,attributes:_0x30c831,isFromAdapter:_0x81a903}){if('string'!=typeof _0x170ee5)throw new _0x48784c('commentsrepository-invalid-comment-thread-id',null,{'threadId':_0x170ee5});if(!this['hasCommentThread'](_0x170ee5))throw new _0x48784c('commentsrepository-missing-comment-thread',null,{'threadId':_0x170ee5});const _0x5594a6=this['getCommentThread'](_0x170ee5);let _0x3a28f2=!0x1;if(void 0x0!==_0x351639&&_0x5594a6['context']!==_0x351639&&(_0x5594a6['context']=_0x351639,_0x3a28f2=!0x0),void 0x0!==_0x358eb3&&_0x5594a6['unlinkedAt']!==_0x358eb3&&(_0x5594a6['unlinkedAt']=_0x358eb3,_0x3a28f2=!0x0),_0x30c831&&!_0x51876e(_0x30c831,_0x5594a6['attributes'])&&(_0x5594a6['attributes']=_0x30c831,_0x3a28f2=!0x0),!_0x3a28f2)return Promise['resolve']();if(!_0x5594a6['isSubmitted']||_0x81a903||!this['adapter']||'function'!=typeof this['adapter']['updateCommentThread'])return Promise['resolve']();const _0x2e2782=this['context']['plugins']['get']('PendingActions'),{channelId:_0x5308f8}=_0x5594a6,_0x4d6470=_0x2e2782['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['updateCommentThread']({'channelId':_0x5308f8,'threadId':_0x170ee5,'context':_0x351639,'unlinkedAt':_0x358eb3,'attributes':_0x30c831})['then'](()=>_0x2e2782['remove'](_0x4d6470))['catch'](_0x4043e2=>{throw console['error'](_0x4043e2),new _0x48784c('commentsrepository-update-comment-thread-internal-error',this);});}_detachCommentThread(_0x407277){const _0x5c54d3=this['context']['plugins']['get'](ti),_0x29668c=this['getCommentThread'](_0x407277);if(_0x29668c['_isAttached']=!0x1,this['_threadToController']['has'](_0x29668c)){const _0x18dcd6=this['_threadToController']['get'](_0x29668c),_0x16c363=_0x18dcd6['view'],_0x69c0ec=_0x5c54d3['getByInnerView'](_0x16c363);this['_threadToController']['delete'](_0x29668c),this['_viewToController']['delete'](_0x16c363),_0x69c0ec&&_0x5c54d3['remove'](_0x69c0ec),_0x18dcd6['destroy'](),_0x16c363['destroy']()['then'](()=>{this['_unbindEditors'](_0x16c363);});}}_updateActiveAnnotation({threadId:_0x3356ec,resolvedAt:_0x15eaed,unlinkedAt:_0x165eed}){const _0x3abdf1=!!_0x15eaed,_0x457360=this['context']['plugins']['get'](ti),_0xc40686=this['getCommentThread'](_0x3356ec);if(this['_threadToController']['has'](_0xc40686)){const _0xd1f958=this['_threadToController']['get'](_0xc40686)['view'],_0x3f8d06=_0x457360['getByInnerView'](_0xd1f958);_0x3f8d06&&(_0x3abdf1&&_0x457360['_removeActiveAnnotation'](_0x3f8d06),_0x165eed?_0x3f8d06['isVisible']=!0x1:_0x3f8d06['refreshVisibility']());}}_getExternalAuthor(_0x358e9a){const _0x53e614=this['context']['plugins']['get'](_0x89d66a),_0x3884bd=_0x362dd1('external:'+_0x358e9a),_0x2b531b=_0x53e614['getUser'](_0x3884bd);return _0x2b531b||_0x53e614['addUser']({'id':_0x3884bd,'name':_0x358e9a});}_createNewComment({threadId:_0x153084,commentId:_0x77164d=_0x3fd960(),content:_0x3f9dc0,authorId:_0x33102f,createdAt:_0x5b9cb0,attributes:_0x2b7e4d}){if('string'!=typeof _0x77164d)throw new _0x48784c('commentsrepository-invalid-commentid');if('string'!=typeof _0x33102f)throw new _0x48784c('commentsrepository-invalid-comment-authorid');if('string'!=typeof _0x3f9dc0||!_0x3f9dc0['trim']())throw new _0x48784c('commentsrepository-invalid-comment-content');const _0x54b564=this['context']['plugins']['get'](_0x89d66a)['getUser'](_0x33102f);if(!_0x54b564)throw new _0x48784c('commentsrepository-add-comment-user-not-exists',null,{'authorId':_0x33102f});let _0x11571e=null,_0x5d611f=_0x5b9cb0;return _0x2b7e4d?.['@external']&&(_0x11571e=this['_getExternalAuthor'](_0x2b7e4d['@external']['authorName']),_0x5d611f=new Date(_0x2b7e4d['@external']['createdAt'])),new hi(this,{'threadId':_0x153084,'id':_0x77164d,'author':_0x11571e||_0x54b564,'creator':_0x54b564,'content':_0x3f9dc0,'createdAt':_0x5b9cb0,'authoredAt':_0x5d611f,'attributes':_0x2b7e4d});}_addComment(_0x44ae93){let {threadId:_0x37fcd8,content:_0x1bb0b6,attributes:_0x4dda7a,isFromAdapter:_0x272c11}=_0x44ae93;const _0x38be4b=this['getCommentThread'](_0x44ae93['threadId']);if(!_0x38be4b)throw new _0x48784c('commentsrepository-add-comment-to-missing-comment-thread',this);const _0xcdf385=this['_createNewComment'](_0x44ae93),{id:_0xa4733b}=_0xcdf385;if(_0x38be4b['_add'](_0xcdf385),_0x272c11||!this['adapter']||'function'!=typeof this['adapter']['addComment']||!_0x38be4b['isSubmitted'])return Promise['resolve']();const _0x271804=this['context']['plugins']['get']('PendingActions'),{channelId:_0x4762f4}=_0x38be4b,_0x1dd302=_0x271804['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return _0x4dda7a||(_0x4dda7a={}),this['adapter']['addComment']({'channelId':_0x4762f4,'threadId':_0x37fcd8,'commentId':_0xa4733b,'content':_0x1bb0b6,'attributes':_0x4dda7a})['then'](_0x151ffe=>{_0x271804['remove'](_0x1dd302),_0x151ffe&&this['_updateComment']({'channelId':_0x4762f4,'threadId':_0x37fcd8,'commentId':_0xa4733b,'createdAt':_0x151ffe['createdAt'],'isFromAdapter':!0x0});})['catch'](_0x1960a1=>{throw console['error'](_0x1960a1),new _0x48784c('commentsrepository-add-comment-internal-error',this);});}_updateComment({threadId:_0x46ff30,commentId:_0xf48166,content:_0x1c17f1,createdAt:_0x2df4b0,attributes:_0xda8dfb,isFromAdapter:_0x1a5f33}){if(void 0x0!==_0x1c17f1&&('string'!=typeof _0x1c17f1||!_0x1c17f1['trim']()['length']))throw new _0x48784c('commentsrepository-update-comment-invalid-content');const _0x104929=this['getCommentThread'](_0x46ff30),_0x412037=_0x104929['getComment'](_0xf48166);if(!_0x412037)throw new _0x48784c('commentsrepository-update-missing-comment',this);let _0x318536=!0x1;if(_0x1c17f1&&_0x1c17f1!==_0x412037['content']&&(_0x412037['isEditable']||_0x1a5f33)&&(_0x412037['content']=_0x1c17f1,_0x318536=!0x0),_0x2df4b0&&_0x2df4b0!==_0x412037['createdAt']&&(_0x412037['createdAt']=_0x2df4b0,_0x412037['isExternal']||(_0x412037['authoredAt']=_0x2df4b0),_0x318536=!0x0),_0xda8dfb&&!_0x51876e(_0xda8dfb,_0x412037['attributes'])&&(_0x412037['attributes']=_0xda8dfb,_0x318536=!0x0),!_0x318536)return Promise['resolve']();if(_0x104929['fire']('commentUpdated'),_0x1a5f33||!this['adapter']||'function'!=typeof this['adapter']['updateComment'])return Promise['resolve']();const _0x268cfc=this['context']['plugins']['get']('PendingActions'),{channelId:_0x3020a4}=this['getCommentThread'](_0x412037['threadId']),_0x58a8b6=_0x268cfc['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['updateComment']({'channelId':_0x3020a4,'threadId':_0x46ff30,'commentId':_0xf48166,'content':_0x1c17f1,'attributes':_0xda8dfb})['then'](()=>_0x268cfc['remove'](_0x58a8b6))['catch'](_0x322466=>{throw console['error'](_0x322466),new _0x48784c('commentsrepository-update-comment-internal-error',this);});}_removeComment({threadId:_0x52a19d,commentId:_0x217c01,isFromAdapter:_0x2d88ee}){const _0x28c10e=this['getCommentThread'](_0x52a19d),_0x48a395=_0x28c10e['getComment'](_0x217c01);if(!_0x48a395)throw new _0x48784c('commentsrepository-remove-missing-comment',this);if(_0x28c10e['_remove'](_0x48a395),_0x2d88ee||!this['adapter']||'function'!=typeof this['adapter']['removeComment'])return Promise['resolve']();const _0x238fcf=this['context']['plugins']['get']('PendingActions'),{channelId:_0x133c0d}=_0x28c10e,_0x16f49b=_0x238fcf['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['removeComment']({'channelId':_0x133c0d,'threadId':_0x52a19d,'commentId':_0x217c01})['then'](()=>_0x238fcf['remove'](_0x16f49b))['catch'](_0x43411f=>{throw console['error'](_0x43411f),new _0x48784c('commentsrepository-remove-comment-internal-error',this);});}},ri=class extends si{['channelId'];['id'];_isAttached;_isSubmitted;comments;_repository;constructor(_0x52be01,_0x1bf6ab){super();const _0x5491a8=_0x1bf6ab['isResolvable'];this['channelId']=_0x1bf6ab['channelId'],this['id']=_0x1bf6ab['id'],this['comments']=new _0x40e5e7(),this['_repository']=_0x52be01,this['_isAttached']=!0x1,this['_isSubmitted']=_0x1bf6ab['isSubmitted'],this['set']('_hasTargetInContent',!0x0),this['bind']('isReadOnly')['to'](_0x52be01,'_permissions',_0x52be01,'_readOnlyChannels',()=>_0x52be01['isReadOnly'](this['channelId'])),this['bind']('isRemovable')['to'](_0x52be01,'_permissions',()=>_0x52be01['getPermissions'](this['channelId'])['admin']),this['bind']('canComment')['to'](_0x52be01,'_permissions',()=>{const _0x371e7a=_0x52be01['getPermissions'](this['channelId']);return _0x371e7a['write']||_0x371e7a['admin'];}),this['bind']('isResolvable')['to'](_0x52be01,'_permissions',()=>_0x5491a8&&_0x52be01['getPermissions'](this['channelId'])['resolve']),this['set']('context',_0x1bf6ab['context']),this['bind']('archivedAt')['to'](this,'resolvedAt',this,'unlinkedAt',(_0x555b38,_0x3c2df1)=>_0x555b38?_0x3c2df1?_0x555b38<_0x3c2df1?_0x555b38:_0x3c2df1:_0x555b38:_0x3c2df1),this['set']('unlinkedAt',_0x1bf6ab['unlinkedAt']||null),this['set']('resolvedAt',_0x1bf6ab['resolvedAt']||null),this['set']('resolvedBy',_0x1bf6ab['resolvedBy']||null),this['bind']('isResolved')['to'](this,'resolvedAt',_0x280eeb=>!!_0x280eeb),this['set']('attributes',_0x1bf6ab['attributes']||{});}get weight(){return Array['from'](this['comments'])['reduce']((_0x53f329,_0x13b0f9)=>_0x53f329+_0x13b0f9['weight'],0x0);}get length(){return this['comments']['length'];}get isAttached(){return this['_isAttached'];}get isSubmitted(){return this['_isSubmitted'];}submit(){const {channelId:_0x18c53c,id:_0x347865}=this;this['_repository']['fire'](ai('submitCommentThread',_0x18c53c),{'channelId':_0x18c53c,'threadId':_0x347865});}setUnlinkedAt(_0x1ec33d){this['_update']({'unlinkedAt':_0x1ec33d});}['resolve']({resolvedAt:_0x2e9b7d=new Date(),resolvedBy:_0x299954='',isFromAdapter:_0x309533=!0x1}={}){const _0x35e205=this['_repository']['context']['plugins']['get'](_0x89d66a)['me'],{channelId:_0x44f1a8,id:_0x4cdaea}=this;this['_repository']['fire'](ai('resolveCommentThread',_0x44f1a8),{'channelId':_0x44f1a8,'threadId':_0x4cdaea,'resolvedAt':_0x2e9b7d,'resolvedBy':_0x299954||_0x35e205['id'],'isFromAdapter':_0x309533});}['reopen']({isFromAdapter:_0x120fed=!0x1}={}){const {channelId:_0x52f647,id:_0x7a842b}=this;this['_repository']['fire'](ai('reopenCommentThread',_0x52f647),{'channelId':_0x52f647,'threadId':_0x7a842b,'isFromAdapter':_0x120fed});}setContext(_0x19eec0){this['context']||this['_update']({'context':_0x19eec0});}setAttribute(_0x5f0cc,_0x7a595d){const _0x271f22=_0x180e09(this['attributes']);_0x579040(_0x271f22,_0x5f0cc,_0x7a595d),this['_update']({'attributes':_0x271f22});}removeAttribute(_0x362606){const _0x26d1e1=_0x180e09(this['attributes']);_0x4bbee6(_0x26d1e1,_0x362606),this['_update']({'attributes':_0x26d1e1});}['remove']({isFromAdapter:_0x365ce8=!0x1}={}){const {channelId:_0x5c935a,id:_0x16e891}=this;this['_repository']['fire'](ai('removeCommentThread',_0x5c935a),{'channelId':_0x5c935a,'threadId':_0x16e891,'isFromAdapter':_0x365ce8});}attachTo(_0x14d4cb){return this['_repository']['_attachCommentThread']({'threadId':this['id'],'target':_0x14d4cb});}addComment(_0x29d609){const {channelId:_0x3b9752,id:_0x246d58}=this;this['_repository']['fire'](ai('addComment',_0x3b9752,_0x246d58),Object['assign']({'channelId':_0x3b9752,'threadId':_0x246d58},_0x29d609));}getComment(_0x594fbe){if('string'!=typeof _0x594fbe)throw new _0x48784c('commentsrepository-get-comment-invalid-id',null,{'commentId':_0x594fbe});return this['comments']['get'](_0x594fbe);}toJSON(){return{'threadId':this['id'],'context':this['context'],'unlinkedAt':this['unlinkedAt'],'resolvedAt':this['resolvedAt'],'resolvedBy':this['resolvedBy']?this['resolvedBy']['id']:null,'archivedAt':this['archivedAt'],'comments':this['comments']['map'](_0x2611cb=>_0x2611cb['toJSON']()),'attributes':this['attributes']};}['_add'](_0x202971){return this['listenTo'](_0x202971,'change:authoredAt',()=>{const _0x2af453=this['_findOptimalIndex'](_0x202971),_0x401c44=this['comments'];_0x2af453-0x1!=_0x401c44['getIndex'](_0x202971)&&_0x2af453+0x1!=_0x401c44['getIndex'](_0x202971)&&(this['_remove'](_0x202971),this['_add'](_0x202971));}),this['comments']['add'](_0x202971,this['_findOptimalIndex'](_0x202971));}_update(_0x6e05d1){const {channelId:_0x3c687c,id:_0x555934}=this;this['_repository']['fire'](ai('updateCommentThread',_0x3c687c),{..._0x6e05d1,'channelId':_0x3c687c,'threadId':_0x555934});}['_remove'](_0x4f44ba){return this['stopListening'](_0x4f44ba),_0x4f44ba['destroy'](),this['comments']['remove'](_0x4f44ba);}_findOptimalIndex(_0x174117){const _0x256cdf=this['comments']['find'](_0x184ed0=>new Date(_0x184ed0['authoredAt'])['getTime']()>new Date(_0x174117['authoredAt'])['getTime']());return _0x256cdf?this['comments']['getIndex'](_0x256cdf):this['length'];}},hi=class extends ni{['id'];threadId;author;creator;createdAt;_repository;constructor(_0x5c4b59,_0x2266a1){super();const _0x2eb698=_0x5c4b59['context']['plugins']['get'](_0x89d66a)['me'],_0xa8255f=_0x5c4b59['getCommentThread'](_0x2266a1['threadId']),_0x2a23f2=0x0===_0xa8255f['comments']['length'],_0x3d4686=_0x2eb698===_0x2266a1['author'];this['id']=_0x2266a1['id'],this['threadId']=_0x2266a1['threadId'],this['author']=_0x2266a1['author'],this['creator']=_0x2266a1['creator'],this['set']('content',_0x2266a1['content']),this['createdAt']=_0x2266a1['createdAt']||new Date(),this['set']('authoredAt',_0x2266a1['authoredAt']||new Date()),this['bind']('resolvedAt')['to'](_0xa8255f,'resolvedAt'),this['set']('attributes',_0x2266a1['attributes']||{}),this['bind']('isEditable')['to'](_0x5c4b59,'_permissions',()=>{const _0x3c937a=_0x5c4b59['getPermissions'](_0xa8255f['channelId'])['write'],_0x2d7103=_0x5c4b59['getPermissions'](_0xa8255f['channelId'])['modifyAll'];return _0x3d4686&&_0x3c937a||!_0x3d4686&&_0x2d7103;}),this['bind']('isRemovable')['to'](_0xa8255f,'isRemovable',_0x5c4b59,'_permissions',_0x41ac6e=>{const _0x198f33=_0x5c4b59['getPermissions'](_0xa8255f['channelId'])['write'],_0x451a01=_0x5c4b59['getPermissions'](_0xa8255f['channelId'])['modifyAll'];return _0x3d4686&&_0x198f33||_0x41ac6e&&_0x2a23f2||!_0x3d4686&&_0x451a01&&!_0x2a23f2;}),this['bind']('isReadOnly')['to'](_0xa8255f,'isReadOnly'),this['_repository']=_0x5c4b59;}get isExternal(){return Boolean(this['attributes']&&this['attributes']['@external']);}get weight(){return Math['max'](function(_0x3ba449){const _0x1c558a=document['createElement']('div');return _0x1c558a['innerHTML']=_0x3ba449,_0x1c558a['textContent']['length'];}(this['content']),0xc8);}update(_0xed8af4){const {threadId:_0x12d9b9,id:_0x30d817}=this;if(!this['_repository']['hasCommentThread'](_0x12d9b9))throw new _0x48784c('commentsrepository-update-comment-missing-comment-thread',this);const {channelId:_0x140270}=this['_repository']['getCommentThread'](_0x12d9b9);this['_repository']['fire'](ai('updateComment',_0x140270,_0x12d9b9),{'channelId':_0x140270,'threadId':_0x12d9b9,'commentId':_0x30d817,..._0xed8af4});}setAttribute(_0x33ad17,_0x5088dd){const _0x31f29a=_0x180e09(this['attributes']);_0x579040(_0x31f29a,_0x33ad17,_0x5088dd),this['update']({'attributes':_0x31f29a});}removeAttribute(_0x51bf64){const _0xe82df8=_0x180e09(this['attributes']);_0x4bbee6(_0xe82df8,_0x51bf64),this['update']({'attributes':_0xe82df8});}['remove'](_0x33b1d9={}){if(!_0x33b1d9['isFromAdapter']&&!this['isRemovable'])return;const {threadId:_0x2cc18e,id:_0x4e4005}=this;if(!this['_repository']['hasCommentThread'](_0x2cc18e))throw new _0x48784c('commentsrepository-remove-comment-missing-comment-thread',this);const {channelId:_0x36d244}=this['_repository']['getCommentThread'](_0x2cc18e);this['_repository']['fire'](ai('removeComment',_0x36d244,_0x2cc18e),{'channelId':_0x36d244,'threadId':_0x2cc18e,'commentId':_0x4e4005,..._0x33b1d9});}toJSON(){return{'commentId':this['id'],'content':this['content'],'createdAt':this['createdAt'],'authorId':this['creator']['id'],'attributes':this['attributes']};}destroy(){this['stopListening']();}};function ai(_0x5cc65d,..._0x460bb1){for(const _0x32e969 of _0x460bb1)void 0x0!==_0x32e969&&(_0x5cc65d+=':'+String(_0x32e969));return _0x5cc65d;}var ci=class extends _0x1efa30{constructor(_0x5d0732){super(_0x5d0732),this['set']('hasContent',!0x1);}['refresh'](){const _0x28480a=this['editor']['model']['document']['selection'];this['isEnabled']=!0x0,this['hasContent']=!0x1;for(const _0xcc2f35 of _0x28480a['getRanges']())if(this['_hasContent'](_0xcc2f35))return void(this['hasContent']=!0x0);}execute({threadId:_0x1dcaa4=_0x3fd960(),ranges:_0x409318,comment:_0x510f12}={}){const _0x591a41=this['editor']['model'],_0x5114a0=_0x409318??Array['from'](_0x591a41['document']['selection']['getRanges']()),_0x19935d=[];for(const _0x437a4f of _0x5114a0)this['_hasContent'](_0x437a4f)&&_0x19935d['push'](this['_trimToContent'](_0x437a4f));if(!_0x19935d['length'])throw new _0x48784c('addcommentthreadcommand-incorrect-ranges',null);_0x510f12&&this['_createCommentThread'](_0x1dcaa4,_0x510f12),this['_createMarkersFromRanges'](_0x1dcaa4,_0x19935d,!!_0x510f12);}_createMarkersFromRanges(_0x2f6dfe,_0x2c3d2e,_0x16888){this['editor']['model']['change'](_0x355b5b=>{for(const _0x27e45b of _0x2c3d2e){const _0x325d17='comment:'+_0x2f6dfe+':'+_0x3fd960()['substr'](0x1,0x5);_0x355b5b['addMarker'](_0x325d17,{'range':_0x27e45b,'usingOperation':_0x16888,'affectsData':_0x16888});}});}_createCommentThread(_0x2f21a6,_0x4325e0){const _0xe933f3=this['editor']['plugins']['get']('CommentsRepository'),_0x105e29=this['editor']['config']['get']('collaboration.channelId'),_0x304647=this['editor']['plugins']['get']('Users')['me'];if(!_0x304647)throw new _0x48784c('addcommentthreadcommand-user-not-found',null);_0xe933f3['addCommentThread']({'threadId':_0x2f21a6,'channelId':_0x105e29,'comments':[{'authorId':_0x304647['id'],'content':_0x4325e0,'createdAt':new Date(),'attributes':{}}]});}_hasContent(_0x510c27){for(const _0x42d47d of _0x510c27['getItems']())if(this['_itemIsContent'](_0x42d47d))return!0x0;return!0x1;}_itemIsContent(_0xd0aa8d){return _0xd0aa8d['is']('$textProxy')||this['editor']['model']['schema']['isObject'](_0xd0aa8d)&&!_0xd0aa8d['is']('element','tableCell');}_trimToContent(_0x76a43f){const _0x1366af=_0x4532dd=>!this['_itemIsContent'](_0x4532dd['item']),_0x16ec09=_0x76a43f['start']['getLastMatchingPosition'](_0x1366af),_0x2ae6e0=_0x76a43f['end']['getLastMatchingPosition'](_0x1366af,{'direction':'backward'});return this['editor']['model']['createRange'](_0x16ec09,_0x2ae6e0);}},di=class extends _0x53a0a0{_dataCollectors;_editorAnnotations;static get requires(){return[ti];}static get['pluginName'](){return'EditorAnnotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x39daf7){super(_0x39daf7),this['_dataCollectors']=new Set(),this['_editorAnnotations']=new Set();}init(){const _0x41697a=this['editor'],_0x1dbb0c=_0x41697a['model']['document']['selection'],_0x17e467=_0x121a24(()=>this['refreshSelectedViews'](),0xa);_0x1dbb0c['on']('change:range',(_0x50faad,_0x4dc8ee)=>{_0x4dc8ee['directChange']&&(_0x17e467['cancel'](),this['refreshSelectedViews']());}),this['listenTo'](_0x41697a['editing']['view']['document'],'change:isFocused',(_0xe0e3e9,_0x52b1cf,_0xec10f)=>{_0xec10f&&_0x17e467();}),this['listenTo'](_0x41697a['ui']['focusTracker'],'change:isFocused',(_0x18471e,_0x2b1e8c,_0x2b50f1)=>{_0x2b50f1||this['fire']('blur',{'isAnnotationTracked':_0x11b065=>this['_editorAnnotationsData']['has'](_0x11b065['innerView'])});}),this['listenTo'](this['editor']['ui'],'update',()=>this['fire']('uiUpdate'));}registerAnnotation(_0xafbfaf){if(this['_editorAnnotations']['has'](_0xafbfaf['view']))return;this['_editorAnnotations']['add'](_0xafbfaf['view']),this['editor']['ui']['focusTracker']['add'](_0xafbfaf['view']['element']);const _0x6fcc84=this['editor']['plugins']['get'](ti);this['listenTo'](_0x6fcc84['collection'],'remove',(_0x15301d,_0xc837ca)=>{this['editor']['ui']['focusTracker']['remove'](_0xc837ca['view']['element']),this['_editorAnnotations']['delete'](_0xc837ca['view']);});}hasDomSelection(){return this['editor']['editing']['view']['hasDomSelection'];}addSourceCollector(_0xecfc12){if('function'!=typeof _0xecfc12)throw new _0x48784c('editorannotations-invalid-source-callback');this['_dataCollectors']['add'](_0xecfc12);}refreshSelectedViews(){this['fire']('refresh');}getOrderedSelectedAnnotations({activeAnnotation:_0x224b17,annotations:_0x4ecc59}){const _0x142719=[],_0x19378d=this['editor']['model']['document']['selection'],_0x28d5dc=Array['from'](_0x19378d['getRanges']());for(const [_0x2472c7,_0x633865]of this['_editorAnnotationsData']){const _0x43636d=_0x3e6647(_0x633865),_0x3f94e0=_0x4ecc59['getByInnerView'](_0x2472c7);_0x43636d&&_0x3f94e0&&_0x142719['push']({'annotation':_0x3f94e0,'range':_0x43636d});}function _0x3e6647(_0x31fed6){for(const _0x3906a8 of _0x31fed6)for(const _0x54f6bf of _0x28d5dc)if(_0x3906a8['containsRange'](_0x54f6bf,!_0x19378d['isCollapsed']))return _0x3906a8;return null;}const _0x7f17f4=new Map(Array['from'](_0x4ecc59,(_0xc1dc7e,_0x4d1f34)=>[_0xc1dc7e,_0x4d1f34]));return _0x142719['sort']((_0x40fa3f,_0x35bcef)=>{const _0x392856=_0x40fa3f['range'],_0x254033=_0x35bcef['range'];if(!_0x392856['isEqual'](_0x254033)){if(_0x392856['containsRange'](_0x254033,!0x0))return 0x1;if(_0x254033['containsRange'](_0x392856,!0x0))return-0x1;}return _0x40fa3f['annotation']==_0x224b17?-0x1:_0x35bcef['annotation']==_0x224b17?0x1:(_0x7f17f4['get'](_0x40fa3f['annotation'])??0x0)-(_0x7f17f4['get'](_0x35bcef['annotation'])??0x0);})['map'](_0x2d7d76=>_0x2d7d76['annotation']);}get _editorAnnotationsData(){const _0x2d9c84=new Map();for(const _0x2156ca of Array['from'](this['_dataCollectors']))for(const [_0x57d675,_0x403cb7]of _0x2156ca())_0x2d9c84['set'](_0x57d675,_0x403cb7);return _0x2d9c84;}},li=class extends _0x53a0a0{afterInit(){const _0x1ebaf1=this['editor'];_0x1ebaf1['plugins']['has']('RestrictedEditingModeEditing')&&_0x1ebaf1['plugins']['get']('RestrictedEditingModeEditing')['enableCommand']('addCommentThread');}},mi=class extends _0x53a0a0{constructor(_0x1d819f){super(_0x1d819f),this['editor']['config']['define']('importWord.formatting.comments','basic');}afterInit(){const _0x1c9d53=this['editor'],_0x84392e=_0x1c9d53['commands']['get']('importWord'),_0x454079=_0x1c9d53['plugins']['get'](_0x89d66a);_0x84392e&&(_0x84392e['on']('execute',(_0x67f9a5,[,_0x539559])=>{_0x539559['collaboration_features']={'comments':!0x0,'user_id':_0x454079['me']['id']};},{'priority':_0x4890d3['high']+0xa}),this['listenTo'](_0x84392e,'dataInsert',this['_handleImportedData']));}_handleImportedData(_0x4aeaee,_0x28107e){const {comment_threads:_0x30447a}=_0x28107e;_0x30447a&&_0x30447a['forEach'](({thread_id:_0x1fdffe,comments:_0x278dcb,is_resolved:_0x55aa4e})=>{const _0x58f740=new Date(),_0x60f5ec=_0x278dcb['map'](({author:_0x5c9fb2,content:_0x2921ce,created_at:_0x2389f0})=>({'content':_0x2921ce,'authorId':this['editor']['plugins']['get'](_0x89d66a)['me']['id'],'createdAt':_0x58f740,'attributes':{'@external':{'authorName':_0x5c9fb2,'createdAt':_0x2389f0?new Date(_0x2389f0):new Date(),'source':'importWord'}}})),_0x3602fc=this['editor']['config']['get']('collaboration.channelId');this['editor']['plugins']['get'](oi)['addCommentThread']({'channelId':_0x3602fc,'threadId':_0x1fdffe,'comments':_0x60f5ec,'resolvedAt':_0x55aa4e?_0x58f740:null});});}},ui=class extends _0x53a0a0{constructor(_0x5ed3dc){super(_0x5ed3dc),this['editor']['config']['define']('comments.copyMarkers','default');}static get requires(){return[pt,wt];}afterInit(){const _0x329d4a=this['editor']['plugins']['get']('ClipboardPipeline');this['_registerMarkerInClipboardPipeline'](),this['listenTo'](_0x329d4a,'contentInsertion',(_0x12e909,_0x2e9f50)=>this['_removeMarkersWithoutThreads'](_0x2e9f50['content']['markers']),{'priority':'highest'});}_removeMarkersWithoutThreads(_0x19802d){if(!this['editor']['plugins']['has']('CommentsRepository'))return _0x19802d;const _0x47a143=this['editor']['plugins']['get']('CommentsRepository');for(const _0x1efd21 of _0x19802d['keys']()){const [_0x413515,_0x12c066]=_0x1efd21['split'](':');'comment'!=_0x413515||_0x47a143['hasCommentThread'](_0x12c066)||_0x19802d['delete'](_0x1efd21);}return _0x19802d;}_registerMarkerInClipboardPipeline(){const _0x22930f=this['editor']['plugins']['get']('ClipboardMarkersUtils'),_0x467d1a=this['_mapCommentsCopyConfigToRegisterConfiguration'](this['editor']['config']['get']('comments.copyMarkers'));_0x467d1a&&_0x22930f['_registerMarkerToCopy']('comment',_0x467d1a);}_mapCommentsCopyConfigToRegisterConfiguration(_0xe70399){switch(_0xe70399){case'always':return{'allowedActions':'all','copyPartiallySelected':!0x1,'duplicateOnPaste':!0x0};case'default':return{'allowedActions':['cut','dragstart'],'copyPartiallySelected':!0x1,'duplicateOnPaste':!0x1};default:return null;}}};function fi(_0x3bb22c){const _0xea9002=_0x3bb22c['split'](':');return{'group':_0xea9002[0x0],'id':_0xea9002[0x1],'part':_0xea9002[0x2]};}var pi=class extends _0x53a0a0{init(){this['overrideMarkerConverters'](),this['overrideHorizontalRuleConverter'](),this['overrideImageInlineConverter'](),this['overrideMediaEmbedConverter']();}overrideMarkerConverters(){this['editor']['conversion']['for']('dataDowncast')['markerToHighlight']({'model':'comment','view':(_0x3f2ec3,_0x1f6d3b)=>{if(!_0x1f6d3b['options']['showCommentHighlights'])return null;if(_0x1f6d3b['options']['ignoreResolvedComments']){const {id:_0xc1985a}=fi(_0x3f2ec3['markerName']);if(this['editor']['plugins']['get'](oi)['getCommentThread'](_0xc1985a)?.['isResolved']&&_0x3f2ec3['item'])return _0x1f6d3b['consumable']['consume'](_0x3f2ec3['item'],'addMarker:'+_0x3f2ec3['markerName']),_0x1f6d3b['consumable']['consume'](_0x3f2ec3['item'],'removeMarker:'+_0x3f2ec3['markerName']),null;}return{'classes':['ck-comment-marker']};}}),this['editor']['conversion']['for']('dataDowncast')['add'](_0x2ec4d3=>{_0x2ec4d3['on']('addMarker:comment',(_0x15ab5a,_0x2e7bc7,_0x53a4f0)=>{if(!_0x53a4f0['options']['showCommentHighlights'])return;const _0x20bc99=_0x2e7bc7['item'];if(!_0x20bc99)return;const _0x115a62=_0x53a4f0['mapper']['toViewElement'](_0x20bc99);this['editor']['model']['schema']['isObject'](_0x20bc99)&&_0x115a62&&!_0x115a62['getCustomProperty']('widget')&&_0x115a62['is']('containerElement')&&Ct(_0x115a62,_0x53a4f0['writer']);},{'priority':'high'});});}overrideHorizontalRuleConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToStructure']({'model':'horizontalLine','view':(_0x10a7a6,{writer:_0x27adb3,options:_0x2a7ca4})=>{if(!_0x2a7ca4['showCommentHighlights'])return null;const _0x3de39a=_0x27adb3['createContainerElement']('div'),_0x4b7cc1=_0x27adb3['createEmptyElement']('hr');return _0x27adb3['addClass']('ck-horizontal-line',_0x3de39a),_0x27adb3['insert'](_0x27adb3['createPositionAt'](_0x3de39a,0x0),_0x4b7cc1),_0x3de39a;},'converterPriority':'high'});}overrideImageInlineConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToStructure']({'model':'imageInline','view':(_0x293fd2,{writer:_0x41b599,options:_0x59a816})=>{if(!_0x59a816['showCommentHighlights'])return null;const _0x2ff38e=_0x41b599['createContainerElement']('span'),_0x57663e=_0x41b599['createEmptyElement']('img');return _0x41b599['addClass']('image-inline',_0x2ff38e),_0x41b599['insert'](_0x41b599['createPositionAt'](_0x2ff38e,0x0),_0x57663e),_0x2ff38e;},'converterPriority':'high'});}overrideMediaEmbedConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToElement']({'model':'media','view':(_0x3ec5fd,{writer:_0x42eed3,options:_0x3d3554})=>{if(_0x3d3554['showCommentHighlights'])return _0x42eed3['createEmptyElement']('div');},'converterPriority':'high'}),this['editor']['data']['downcastDispatcher']['on']('attribute:url:media',(_0x3bc17d,_0x370cf8,_0x3bff92)=>{_0x3bff92['options']['showCommentHighlights']&&_0x3bc17d['stop']();},{'priority':'high'});}},wi=class extends _0x53a0a0{static get requires(){return[oi,di,_0x89d66a,li,mi,ui,pi];}static get['pluginName'](){return'CommentsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5d507b){super(_0x5d507b),this['set']('isThreadsLoadingPaused',!0x0),_0x5d507b['data']['once']('ready',()=>this['isThreadsLoadingPaused']=!0x1),this['set']('activeMarker',null),this['on']('change:activeMarker',(_0x1b3886,_0xd74a54,_0x55e31c,_0x24b5d9)=>{const _0x1cbbd7=_0x5d507b['plugins']['get'](oi),_0x558891=_0x55e31c?fi(_0x55e31c)['id']:null;_0x5d507b['model']['change'](()=>{if(_0x558891){const _0x2c1f6b=this['getAllMarkersForId'](_0x558891);for(const _0x243226 of _0x2c1f6b)_0x5d507b['editing']['reconvertMarker'](_0x243226);}if(_0x24b5d9){const {id:_0x33a460}=fi(_0x24b5d9),_0x2ce54f=_0x1cbbd7['getCommentThread'](_0x33a460);if(_0x2ce54f&&_0x2ce54f['unlinkedAt'])return;if(_0x2ce54f&&!_0x2ce54f['isAttached'])return;const _0x111b3f=this['getAllMarkersForId'](_0x33a460);for(const _0x28af67 of _0x111b3f)_0x5d507b['editing']['reconvertMarker'](_0x28af67);}}),_0x558891&&this['scrollToThreadMarker'](_0x558891);}),this['_initAriaMarkerChangeAnnouncements']();}init(){const _0x4d6cfc=this['editor'],_0x3ac4a0=_0x4d6cfc['plugins']['get'](oi),_0x9526b6=_0x4d6cfc['config']['get']('collaboration.channelId'),_0x26522a=_0x3ac4a0['getCommentThreads']()['filter'](_0x5552b6=>_0x5552b6['channelId']!==_0x9526b6);_0x4d6cfc['commands']['add']('addCommentThread',new ci(_0x4d6cfc)),this['listenTo'](_0x4d6cfc,'change:isReadOnly',(_0x57903a,_0x41e148,_0x4c85c6)=>{_0x3ac4a0['switchReadOnly'](_0x4c85c6,_0x4d6cfc['config']['get']('collaboration.channelId'));}),this['listenTo'](_0x3ac4a0,gi('addCommentThread',_0x9526b6),(_0x1f7cad,{threadId:_0x529b16})=>{this['editor']['plugins']['get'](oi)['getCommentThread'](_0x529b16)?.['unlinkedAt']&&this['_attachArchivedThread'](_0x529b16);}),this['listenTo'](_0x3ac4a0,gi('removeCommentThread',_0x9526b6),(_0x1ca34a,{threadId:_0x5e008f})=>{_0x4d6cfc['model']['enqueueChange']({'isUndoable':!0x1},_0x62f127=>{const _0xb8c6a8=this['getAllMarkersForId'](_0x5e008f);for(const _0x1e9de1 of _0xb8c6a8)_0x62f127['removeMarker'](_0x1e9de1);});}),this['listenTo'](_0x3ac4a0,gi('resolveCommentThread',_0x9526b6),(_0x2f80cb,{threadId:_0x2c9005})=>{this['_reconvertMarkers'](_0x2c9005);const _0x18267d=this['editor']['plugins']['get'](ti);(this['editor']['editing']['view']['hasDomSelection']||_0x18267d['collection']['isFocused'])&&(this['editor']['plugins']['get'](oi)['getCommentThread'](_0x2c9005)['unlinkedAt']||this['editor']['editing']['view']['focus']());},{'priority':'low'}),this['listenTo'](_0x3ac4a0,gi('reopenCommentThread',_0x9526b6),(_0x51413a,{threadId:_0x2b3b35})=>{this['_reconvertMarkers'](_0x2b3b35);},{'priority':'low'}),this['listenTo'](_0x3ac4a0,gi('addComment',_0x9526b6),(_0x4f2d1c,{threadId:_0x5aad17,isFromAdapter:_0x4e5228})=>{const _0x3728e6=this['getAllMarkersForId'](_0x5aad17);!_0x4e5228&&0x0!=_0x3728e6['length']&&_0x3ac4a0['hasCommentThread'](_0x5aad17)&&0x1===_0x3ac4a0['getCommentThread'](_0x5aad17)['length']&&_0x4d6cfc['model']['enqueueChange']({'isUndoable':!0x1},_0x5f3bb4=>{for(const _0x1a7675 of _0x3728e6)_0x5f3bb4['updateMarker'](_0x1a7675,{'usingOperation':!0x0,'affectsData':!0x0});});},{'priority':'low'}),this['_initializeMarkerConverters'](),this['_handleMarkerAddAndRemove'](),this['_handleInitialThreads'](_0x26522a);}afterInit(){!async function(_0x9311e2){const _0x26bb6f='mr4z2yakM3x0phtD7jBw1T6qRfeUuZcOLNKVgQSPE9iGIHoXlJW8YsCb5AndFv',_0x1a9838=0x795c0,_0x1a9a28={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x37b9df(_0x2fb8de){const _0x1efe06=new window['Promise'](_0x3223e9=>{_0x2fb8de['once']('ready',_0x3223e9);}),_0x492d89=window['Date']['now'](),_0x41e910=_0x2fb8de['config']['get']('licenseKey');async function _0x2a0def(){let _0x1278a0,_0x1a01c1=null,_0x52b196=null;try{return'GPL'==_0x41e910?'NotAllowed':(_0x1278a0=_0x8bd18c(),_0x1278a0?(_0x1278a0['usageEndpoint']&&(_0x52b196=_0x51abee(_0x1278a0['usageEndpoint'],_0x1278a0['jti'])),await _0x40e51f()?_0x2d9c79()?_0x1b5222()?'Expired':_0x4c9403()?('evaluation'==_0x1278a0['licenseType']&&(_0x1a01c1=_0x1f8d52('EvaluationLimit')),await _0x2e4232()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x1b5222(){const _0x4ea283=['evaluation','trial']['includes'](_0x1278a0['licenseType'])?_0x492d89/0x3e8:0xe10*_0x1a9838;return _0x1278a0['exp']<_0x4ea283;}function _0x2d9c79(){const _0x2d3804=_0x1278a0['features'];if(!_0x2d3804)return!0x1;if(_0x2d3804['includes']('*'))return!0x0;if(_0x2d3804['includes']('CMT'))return!0x0;if(_0x2d3804['includes']('TRILIUM')&&_0x15d9a1())return!0x0;if(_0x2d3804['includes']('RCMT')){if(_0x5bdc3a())return!0x0;if(_0x30df47()||_0x262a3e())return!0x0;}return!0x1;}function _0x4c9403(){const _0x587bf0=_0x1278a0['licensedHosts'];if(!_0x587bf0||0x0==_0x587bf0['length'])return!0x0;const {hostname:_0x40b5dc}=new URL(window['location']['href']);if(_0x587bf0['includes'](_0x40b5dc))return!0x0;const _0xb07655=_0x40b5dc['split']('.');return _0x587bf0['filter'](_0x1bf697=>_0x1bf697['includes']('*'))['map'](_0x1b8d44=>_0x1b8d44['split']('.'))['filter'](_0x24c660=>_0x24c660['length']<=_0xb07655['length'])['map'](_0x2a7f01=>Array(_0xb07655['length']-_0x2a7f01['length'])['fill']('*'===_0x2a7f01[0x0]?'*':'')['concat'](_0x2a7f01))['some'](_0x4011a1=>_0xb07655['every']((_0x546737,_0x46fe8b)=>_0x4011a1[_0x46fe8b]===_0x546737||'*'===_0x4011a1[_0x46fe8b]));}function _0x2e4232(){return _0x1a01c1&&_0x52b196?new window['Promise']((_0x513ada,_0x30457f)=>{_0x1a01c1['then'](_0x513ada,_0x30457f),_0x52b196['then'](_0x124734=>{'Valid'!=_0x124734&&_0x513ada(_0x124734);},_0x30457f);}):_0x1a01c1||_0x52b196||'Valid';}}function _0x51abee(_0x20ce4e,_0x2b7730){return new window['Promise'](_0x4d0430=>{if(_0x531a28())return _0x4d0430('Valid');_0x24b6a7(),_0x2fb8de['decorate']('_sendUsageRequest');let _0x5d4ffe=!0x1;const _0x31dbfa=_0x3fd960();function _0x1b829a(_0x3c89b5){return!!_0x3c89b5&&('object'==typeof _0x3c89b5||'function'==typeof _0x3c89b5)&&'function'==typeof _0x3c89b5['then']&&'function'==typeof _0x3c89b5['catch'];}function _0x147222(_0x2b27f8){_0x36c9eb(_0x2b27f8)['then'](_0x508c5d=>_0x508c5d&&'ok'==_0x508c5d['status']?_0x4628bf(_0x2c8e7f(_0x31dbfa+_0x2b7730))!=_0x508c5d['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x10ffbd=>(_0x9235be(),_0x10ffbd),()=>{const _0x1ea91c=_0x185a30();return null==_0x1ea91c?(_0x9235be(),'Valid'):_0x492d89-_0x1ea91c>0x240c8400?'UsageLimit':'Valid';})['then'](_0x4d0430)['catch'](()=>{_0x4d0430('UsageLimit');});const _0x1397a4=0x36ee80;function _0x9235be(){const _0x5d08da='llct-'+_0x4628bf(_0x2c8e7f(_0x20ce4e)),_0x2ac0dc=_0x4af367(_0x4628bf(window['Math']['ceil'](_0x492d89/_0x1397a4)));window['localStorage']['setItem'](_0x5d08da,_0x2ac0dc);}function _0x185a30(){const _0xd8638a='llct-'+_0x4628bf(_0x2c8e7f(_0x20ce4e)),_0x199737=window['localStorage']['getItem'](_0xd8638a);return _0x199737?window['parseInt'](_0x4af367(_0x199737),0x10)*_0x1397a4:null;}function _0x36c9eb(_0x3d87c1){return new window['Promise']((_0x17d7e9,_0xa4670f)=>{_0x3d87c1['then'](_0x17d7e9,_0xa4670f),window['setTimeout'](_0xa4670f,0x1d4c0);});}}_0x2fb8de['on']('_sendUsageRequest',(_0x1a5549,_0x17d498)=>{if(_0x17d498[0x0]!=_0x20ce4e)return _0x4d0430('UsageLimit');_0x17d498[0x1]={..._0x17d498[0x1],'requestId':_0x31dbfa};},{'priority':'high'}),_0x2fb8de['on']('_sendUsageRequest',_0x12abaa=>{_0x1b829a(_0x12abaa['return'])&&(_0x5d4ffe=!0x0,_0x147222(_0x12abaa['return']));},{'priority':'low'}),_0x1efe06['then'](()=>{_0x5d4ffe||_0x4d0430('UsageLimit');});});function _0x531a28(){return'auto'==_0x2fb8de['editing']['view']['_overlayModeHint'];}function _0x24b6a7(){_0x2fb8de['editing']['view']['_overlayModeHint']='auto';}}function _0x1f8d52(_0x1b6d6a){const _0xa253e2=[new window['Promise'](_0x17990b=>setTimeout(_0x17990b,0x93ecc)),_0x1efe06['then'](()=>new window['Promise'](_0x220e6a=>{let _0x46f2f0=0x0;_0x2fb8de['model']['on']('applyOperation',(_0x4c64cd,_0x401695)=>{_0x401695[0x0]['isDocumentOperation']&&_0x46f2f0++,0x5e8==_0x46f2f0&&(_0x220e6a(),_0x4c64cd['off']());});}))];return window['Promise']['race'](_0xa253e2)['then'](()=>_0x1b6d6a);}async function _0x413ddb(){await _0x1efe06,_0x2fb8de['model']['change']=_0x22400e,_0x2fb8de['model']['enqueueChange']=_0x22400e,_0x2fb8de['enableReadOnlyMode']('model');}function _0x15d9a1(){return window['glob']&&window['glob']['triliumVersion'];}function _0x5bdc3a(){return _0x12aa6e('WebSocketGateway')&&'connected'==_0x231ee6('WebSocketGateway')['state'];}function _0x30df47(){return _0x12aa6e('RevisionViewerIntegration');}function _0x262a3e(){return _0x12aa6e('TrackChangesDataGetter');}function _0xd29132(_0x59e14a){const _0x2b7579=_0x58954f();_0x2fb8de[_0x2b7579]='commentsLicenseKey'+_0x59e14a,'Valid'!=_0x59e14a&&_0x413ddb();}function _0x58954f(){const _0x593b03=window['String'](window['performance']['now']())['replace']('.','');let _0x570be0='m';for(let _0x85e94d=0x0;_0x85e94d<_0x593b03['length'];_0x85e94d+=0x2){let _0x54e724=window['parseInt'](_0x593b03['substring'](_0x85e94d,_0x85e94d+0x2));_0x54e724>=0x3e&&(_0x54e724-=0x3e),_0x570be0+=_0x26bb6f[_0x54e724];}return _0x570be0;}function _0x8bd18c(){const _0x8311b7=_0x41e910['split']('.');if(0x3!=_0x8311b7['length'])return null;return _0x1be1a8(_0x8311b7[0x1]);function _0x1be1a8(_0x5b137a){const _0xff9f8e=_0x211e87(_0x5b137a);return _0xff9f8e&&_0x2f4bd8()?_0xff9f8e:null;function _0x2f4bd8(){const _0x4ef85f=_0xff9f8e['jti'],_0x266aca=window['parseInt'](_0x4ef85f['substring'](_0x4ef85f['length']-0x8),0x10),_0x4149e6={..._0xff9f8e,'jti':_0x4ef85f['substring'](0x0,_0x4ef85f['length']-0x8)};return delete _0x4149e6['vc'],_0x2c8e7f(_0x4149e6)==_0x266aca;}}}async function _0x40e51f(){let _0x4eb51b=!0x0;try{const [_0x46e63a,_0x40432f,_0x546004]=_0x41e910['split']('.');return _0x44476e(_0x46e63a),await _0x757e28(_0x46e63a,_0x40432f,_0x546004),_0x4eb51b;}catch{return!0x1;}function _0x44476e(_0x66bbab){const _0x4f2dec=_0x211e87(_0x66bbab);_0x4f2dec&&'ES256'==_0x4f2dec['alg']||(_0x4eb51b=!0x1);}async function _0x757e28(_0x423380,_0x3b679d,_0x1eab39){const _0x1c03cd=window['Uint8Array']['from'](_0x4350a0(_0x1eab39),_0x13d345=>_0x13d345['charCodeAt'](0x0)),_0x4c0ddb=new window['TextEncoder']()['encode'](_0x423380+'.'+_0x3b679d),_0x584a07=window['crypto']['subtle'];if(!_0x584a07)return;const _0x32e934=await _0x584a07['importKey']('jwk',_0x1a9a28,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x584a07['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x32e934,_0x1c03cd,_0x4c0ddb)||(_0x4eb51b=!0x1);}}function _0x211e87(_0x2a89f2){return _0x2a89f2['startsWith']('ey')?JSON['parse'](_0x4350a0(_0x2a89f2)):null;}function _0x4350a0(_0x8253c6){return window['atob'](_0x8253c6['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x2c8e7f(_0x43951a){let _0x59fc78=0x1505;function _0x30c52a(_0x29aabd){for(let _0x5cb261=0x0;_0x5cb261<_0x29aabd['length'];_0x5cb261++){const _0x5d8454=_0x29aabd['charCodeAt'](_0x5cb261);_0x59fc78=(_0x59fc78<<0x5)+_0x59fc78+_0x5d8454,_0x59fc78&=_0x59fc78;}}function _0x359c0a(_0x129888){Array['isArray'](_0x129888)?_0x129888['forEach'](_0x359c0a):_0x129888&&'object'==typeof _0x129888?Object['entries'](_0x129888)['sort']()['forEach'](([_0x30e19f,_0x19eecd])=>{_0x30c52a(_0x30e19f),_0x359c0a(_0x19eecd);}):_0x30c52a(window['String'](_0x129888));}return _0x359c0a(_0x43951a),_0x59fc78>>>0x0;}function _0x4628bf(_0x49cca6){return _0x49cca6['toString'](0x10)['padStart'](0x8,'0');}function _0x4af367(_0x2a5018){return _0x2a5018['split']('')['reverse']()['join']('');}function _0x12aa6e(_0xca1493){return _0x2fb8de['plugins']['has'](_0xca1493);}function _0x231ee6(_0xcc393){return _0x2fb8de['plugins']['get'](_0xcc393);}function _0x22400e(){}_0xd29132(await _0x2a0def());}_0x37b9df(_0x9311e2['editor']);}(this);}destroy(){const _0x211950=this['editor']['plugins']['get'](oi),_0xb7342c=this['editor']['config']['get']('collaboration.channelId');for(const _0x20822d of _0x211950['getCommentThreads']({'channelId':_0xb7342c}))_0x211950['_detachCommentThread'](_0x20822d['id']),_0x211950['_threads']['delete'](_0x20822d['id']);super['destroy']();}['hasMarkerForId'](_0x1a7108){return this['getAllMarkersForId'](_0x1a7108)['length']>0x0;}getAllMarkersForId(_0x3c21f9){const _0xe9c50b=[];for(const _0x2d484b of this['editor']['model']['markers'])_0x2d484b['name']['startsWith']('comment:'+_0x3c21f9)&&_0xe9c50b['push'](_0x2d484b);return _0xe9c50b;}['scrollToThreadMarker'](_0x19cb6b){setTimeout(()=>{const _0x4c55e2=this['_getTargetForId'](_0x19cb6b);_0x4c55e2&&this['activeMarker']&&fi(this['activeMarker'])['id']===_0x19cb6b&&_0x363ecf({'target':_0x4c55e2[0x0],'viewportOffset':0x64,'alignToTop':!0x0});},0x32);}_reconvertMarkers(_0x19a321){this['editor']['model']['change'](()=>{for(const _0xd7bcb3 of this['getAllMarkersForId'](_0x19a321))this['editor']['editing']['reconvertMarker'](_0xd7bcb3);});}_attachArchivedThread(_0x44bb31){const _0x2c128a=this['editor']['plugins']['get'](oi),_0x3f7c16=this['editor']['plugins']['get'](di),_0x5f3fcd=_0x2c128a['getCommentThread'](_0x44bb31);if(!_0x5f3fcd['isAttached']){const _0xc3184=_0x5f3fcd['attachTo'](()=>this['_getTargetForId'](_0x5f3fcd['id']));_0x3f7c16['registerAnnotation'](_0xc3184),_0x5f3fcd['_hasTargetInContent']=!0x1;}}_initializeMarkerConverters(){const _0x26b79d=this['editor'],_0x2ccf65=_0x26b79d['plugins']['get'](_0x89d66a);_0x26b79d['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'comment','view':(_0x53d195,_0x2d12b6)=>{const {id:_0x393c1b}=fi(_0x53d195['markerName']),_0x4b6ba8=_0x26b79d['plugins']['get'](oi)['getCommentThread'](_0x393c1b),_0x15f901=this['activeMarker']&&fi(this['activeMarker'])['id']===_0x393c1b;let _0x32a567;if(_0x4b6ba8&&_0x4b6ba8['isResolved']&&!_0x15f901&&_0x53d195['item'])return _0x2d12b6['consumable']['consume'](_0x53d195['item'],'addMarker:'+_0x53d195['markerName']),_0x2d12b6['consumable']['consume'](_0x53d195['item'],'removeMarker:'+_0x53d195['markerName']),null;const _0x15c163=['ck-comment-marker'];return _0x15f901&&_0x15c163['push']('ck-comment-marker--active'),_0x32a567=_0x4b6ba8?.['length']?_0x4b6ba8['comments']['first']['author']['id']:_0x2ccf65['me']['id'],{'classes':_0x15c163,'attributes':{'data-comment':_0x393c1b,'data-author-id':_0x32a567}};}}),_0x26b79d['conversion']['for']('dataDowncast')['markerToData']({'model':'comment','view':(_0x147f7c,{options:_0x5b4b19})=>{if(_0x5b4b19['showCommentHighlights'])return null;const _0x1df10b=_0x26b79d['plugins']['get'](oi),_0x2a7dab=_0x26b79d['model']['markers']['get'](_0x147f7c),{id:_0x31a618,part:_0x54e198}=fi(_0x147f7c);return _0x2a7dab&&!_0x2a7dab['affectsData']||_0x5b4b19['ignoreResolvedComments']&&_0x1df10b['getCommentThread'](_0x31a618)?.['isResolved']?null:{'group':'comment','name':_0x54e198?_0x31a618+':'+_0x54e198:_0x31a618};}}),_0x26b79d['conversion']['for']('upcast')['elementToElement']({'view':{'name':'comment','attributes':{'id':/^\w/}},'model':(_0x35826f,{writer:_0x25a765})=>_0x25a765['createElement']('$marker',{'data-name':'comment:'+_0x35826f['getAttribute']('id')})}),_0x26b79d['conversion']['for']('upcast')['dataToMarker']({'view':'comment'});}['_handleMarkerAddAndRemove'](){const _0x29230e=this['editor'],_0x333820=_0x29230e['plugins']['get'](oi),_0x3476b5=new Set(),_0x5b0113=new Set();_0x29230e['model']['document']['registerPostFixer'](_0x244dc8=>{let _0x5e6651=!0x1;for(const {name:_0x33db5d,data:_0x190c79}of _0x29230e['model']['document']['differ']['getChangedMarkers']()){const {group:_0x3a9017,id:_0x243854}=fi(_0x33db5d);let _0x561ff5=_0x190c79['newRange'];if('comment'!==_0x3a9017||!_0x561ff5)continue;const _0x21de0a='$graveyard'===_0x561ff5['root']['rootName'];_0x21de0a||(_0x561ff5=_i(_0x561ff5,_0x29230e['model']),!_0x561ff5||_0x561ff5['isCollapsed']||!_0x190c79['newRange']||_0x561ff5['isEqual'](_0x190c79['newRange']))?_0x29230e['model']['hasContent'](_0x561ff5)&&!_0x21de0a?this['isThreadsLoadingPaused']?_0x3476b5['add'](_0x33db5d):this['_handleThreadMarker'](_0x33db5d,_0x243854):(_0x5b0113['add'](_0x33db5d),_0x3476b5['delete'](_0x33db5d),_0x244dc8['removeMarker'](_0x33db5d),_0x5e6651=!0x0):(_0x244dc8['updateMarker'](_0x33db5d,{'range':_0x561ff5}),_0x5e6651=!0x0);}return _0x5e6651;}),this['on']('change:isThreadsLoadingPaused',(_0x81239,_0x490efb,_0x2e38fb)=>{if(!_0x2e38fb&&_0x3476b5['size'])for(const _0x3e1195 of _0x3476b5){const {id:_0x27677f}=fi(_0x3e1195);_0x3476b5['delete'](_0x3e1195),_0x29230e['model']['markers']['get'](_0x3e1195)&&this['_handleThreadMarker'](_0x3e1195,_0x27677f);}}),this['listenTo'](_0x29230e['model']['document'],'change',()=>{for(const {name:_0x488903,data:{newRange:_0x11c9cc}}of _0x29230e['model']['document']['differ']['getChangedMarkers']()){const {group:_0x31643b,id:_0x95f97a}=fi(_0x488903);if('comment'!==_0x31643b)continue;const _0x51e853=_0x333820['getCommentThread'](_0x95f97a),_0x335b6c=this['hasMarkerForId'](_0x95f97a);_0x51e853&&(!_0x51e853['_hasTargetInContent']&&_0x11c9cc&&_0x29230e['editing']['view']['once']('render',()=>{const _0x35e071=_0x29230e['plugins']['get'](ti),_0x59ed70=_0x333820['_threadToController']['get'](_0x51e853)['view'];_0x35e071['getByInnerView'](_0x59ed70)['refreshVisibility']();},{'priority':'low'}),_0x51e853['_hasTargetInContent']=_0x335b6c||!!_0x11c9cc),_0x11c9cc||(_0x5b0113['add'](_0x488903),_0x3476b5['delete'](_0x488903));}for(const _0x5e7aa2 of _0x5b0113){const {id:_0x1fafa9}=fi(_0x5e7aa2),_0x430110=_0x333820['getCommentThread'](_0x1fafa9);if(_0x3476b5['delete'](_0x5e7aa2),!_0x430110)continue;const _0x30c08e=this['hasMarkerForId'](_0x1fafa9);_0x30c08e||_0x430110['isSubmitted']?_0x30c08e||_0x430110['unlinkedAt']||_0x430110['setUnlinkedAt'](new Date()):_0x430110['remove']();}_0x5b0113['clear']();});}_handleInitialThreads(_0xd5039d){_0xd5039d['forEach'](_0x223780=>{_0x223780['unlinkedAt']&&this['_attachArchivedThread'](_0x223780['id']);});}_getTargetForId(_0x510aaa){const _0x126005=this['editor'],_0x430e=this['getAllMarkersForId'](_0x510aaa);return _0x5f336f(_0x126005['editing'],_0x430e);}_getTextContext(_0x84be15){const _0x1194d6=this['getAllMarkersForId'](_0x84be15);let _0x30c602='',_0x42e71f=!0x1;for(const _0x3b23be of _0x1194d6){const _0x2041df=_0x3b23be['getRange']();for(const _0x167bfb of Array['from'](_0x2041df['getItems']()))_0x167bfb['is']('$textProxy')?(_0x30c602&&_0x42e71f&&(_0x30c602+='\x20',_0x42e71f=!0x1),_0x30c602+=_0x167bfb['data']):_0x42e71f=!0x0;_0x42e71f=!0x0;}return _0x30c602['substring'](0x0,0x96);}_attachMarkerToThread(_0x4ac407,_0x5a019c){const _0x5628cb=this['editor'],_0x528883=_0x5628cb['plugins']['get'](oi);let _0x5d5bdf=_0x528883['getCommentThread'](_0x5a019c);const _0x41113a=_0x5628cb['config']['get']('collaboration.channelId'),_0x559321=_0x5628cb['plugins']['get'](di);return _0x5d5bdf&&(_0x5d5bdf['unlinkedAt']&&_0x5d5bdf['setUnlinkedAt'](null),_0x5d5bdf['isAttached'])||(this['getAllMarkersForId'](_0x5a019c)[0x0]['managedUsingOperations']?_0x528883['fetchCommentThread']({'channelId':_0x41113a,'threadId':_0x5a019c})['then'](_0x641a2a=>{if('destroyed'!==_0x5628cb['state']){if(_0x5d5bdf=_0x641a2a,_0x5d5bdf&&!_0x5d5bdf['isAttached']){const _0x20af6d=_0x5d5bdf['attachTo'](()=>this['_getTargetForId'](_0x5a019c));_0x559321['registerAnnotation'](_0x20af6d),_0x5d5bdf['isResolved']&&this['_reconvertMarkers'](_0x5a019c);}else{if(!_0x5d5bdf){const _0x823f26=this['getAllMarkersForId'](_0x5a019c);_0x5628cb['model']['change'](_0x3db86b=>{for(const _0x13fd33 of _0x823f26)_0x3db86b['removeMarker'](_0x13fd33);});}}}}):_0x5628cb['editing']['view']['once']('render',()=>{if(_0x528883['getCommentThread'](_0x5a019c))return;const _0x363bfc=_0x5628cb['plugins']['get'](ti);_0x5d5bdf=_0x528883['openNewCommentThread']({'channelId':_0x41113a,'threadId':_0x5a019c,'target':()=>this['_getTargetForId'](_0x5a019c),'context':{'type':'text','value':this['_getTextContext'](_0x5a019c)}});const _0x56696d=_0x528883['_threadToController']['get'](_0x5d5bdf)['view'],_0x4d81f7=_0x363bfc['getByInnerView'](_0x56696d);_0x4d81f7&&_0x559321['registerAnnotation'](_0x4d81f7);},{'priority':'low'})),_0x5d5bdf;}['_handleThreadMarker'](_0x37e240,_0x4f29da){const _0x31d110=this['_attachMarkerToThread'](_0x37e240,_0x4f29da);_0x31d110&&!_0x31d110['context']&&_0x31d110['setContext']({'type':'text','value':this['_getTextContext'](_0x4f29da)});}_initAriaMarkerChangeAnnouncements(){const _0x818bb6=this['editor'];_0x3101b7(_0x818bb6['model'],({left:_0x23fb83,entered:_0x3fbf3a})=>{for(const _0x21a5f6 of _0x23fb83)if(Ai(_0x21a5f6)){_0x818bb6['ui']['ariaLiveAnnouncer']['announce'](Et(_0x818bb6['locale'],'LEAVE_COMMENT_ANNOUNCEMENT'));break;}for(const _0x13a63e of _0x3fbf3a)if(Ai(_0x13a63e)){_0x818bb6['ui']['ariaLiveAnnouncer']['announce'](Et(_0x818bb6['locale'],'ENTER_COMMENT_ANNOUNCEMENT',_0x1692a3(_0x4ef251)));break;}});}};function gi(_0x3e42fe,_0xede33){return _0xede33?_0x3e42fe+':'+_0xede33:_0x3e42fe;}function _i(_0x3100dc,_0x10f3eb){const _0x48abb8=_0x10f3eb['schema'],_0x2ea2ed=_0x10f3eb['createRange'](_0x3100dc['start']);for(const _0x502d47 of _0x3100dc['getWalker']()){const {type:_0x571b04,item:_0x3bc0cb,nextPosition:_0x4c0131}=_0x502d47;if('text'===_0x571b04||_0x48abb8['isObject'](_0x3bc0cb)){const _0x30c4f1=_0x10f3eb['createPositionBefore'](_0x3bc0cb);_0x2ea2ed['isCollapsed']&&(_0x2ea2ed['start']=_0x30c4f1),_0x2ea2ed['end']=_0x4c0131;}}return _0x2ea2ed;}function Ai(_0x1b6912){return'comment'===fi(_0x1b6912['name'])['group'];}var vi=class extends _0x53a0a0{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'CommentsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[oi,wi,di,ti];}get CommentsListView(){return Lt;}get CommentThreadInputView(){return xt;}init(){const _0x8823f3=this['editor'],_0x5c5dc4=_0x8823f3['plugins']['get'](oi),_0x585e41=_0x8823f3['plugins']['get'](wi),_0x3570b0=_0x8823f3['plugins']['get'](ti),_0x19378c=_0x8823f3['plugins']['get'](di);_0x8823f3['ui']['componentFactory']['add']('comment',()=>{const _0x8034fd=this['_createUIButton'](_0x3e41ef);return _0x8034fd['tooltip']=!0x0,_0x8034fd;}),_0x8823f3['ui']['componentFactory']['add']('menuBar:comment',()=>this['_createUIButton'](rt)),_0x19378c['addSourceCollector'](()=>{const _0x94adf8=[];for(const [_0x18d926,_0x498abf]of _0x5c5dc4['_threadToController']){const _0x1e9611=_0x585e41['getAllMarkersForId'](_0x18d926['id']),_0x4edc5d=_0x1e9611['map'](_0x3c0177=>_0x3c0177['getRange']());_0x1e9611['length']>0x0&&_0x94adf8['push']([_0x498abf['view'],_0x4edc5d]);}return _0x94adf8;}),this['listenTo'](_0x3570b0,'change:activeAnnotations',(_0x68088b,_0x51b67b,_0x29c504)=>{const _0x301c32=Array['from'](_0x29c504)['map'](_0x2fd1f0=>_0x2fd1f0['innerView'])['find'](_0xd4ad9c=>_0x5c5dc4['_viewToController']['has'](_0xd4ad9c));if(!_0x301c32)return void(_0x585e41['activeMarker']=null);const _0x59fe2e=_0x5c5dc4['_viewToController']['get'](_0x301c32)['model']['id'],_0x1d6bbe='comment:'+_0x59fe2e;_0x59fe2e&&_0x585e41['hasMarkerForId'](_0x59fe2e)?_0x585e41['activeMarker']=_0x1d6bbe:_0x585e41['activeMarker']&&(_0x585e41['activeMarker']=null);}),this['listenTo'](_0x5c5dc4,'removeCommentThread',(_0x16cab2,{threadId:_0x46c99e,isFromAdapter:_0x1acf68})=>{!_0x1acf68&&_0x8823f3['ui']['focusTracker']['isFocused']&&_0x585e41['hasMarkerForId'](_0x46c99e)&&_0x8823f3['editing']['view']['focus']();},{'priority':'highest'}),this['listenTo'](_0x5c5dc4,'addComment',(_0x2b5536,{threadId:_0x3ca78d,isFromAdapter:_0x2b8488})=>{!_0x2b8488&&_0x585e41['hasMarkerForId'](_0x3ca78d)&&_0x5c5dc4['hasCommentThread'](_0x3ca78d)&&0x1===_0x5c5dc4['getCommentThread'](_0x3ca78d)['length']&&(_0x8823f3['editing']['view']['focus'](),_0x2b5536['stop']());},{'priority':'low'}),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x439861=[this['editor']];for(const _0x47f042 of _0x439861){let _0x116e1f;for(const _0x37cd6c in _0x47f042){const _0x841039=_0x37cd6c,_0x5d61bd=_0x47f042[_0x841039];if('commentsLicenseKeyValid'==_0x5d61bd||'commentsLicenseKeyInvalid'==_0x5d61bd||'commentsLicenseKeyExpired'==_0x5d61bd||'commentsLicenseKeyDomainLimit'==_0x5d61bd||'commentsLicenseKeyNotAllowed'==_0x5d61bd||'commentsLicenseKeyEvaluationLimit'==_0x5d61bd||'commentsLicenseKeyUsageLimit'==_0x5d61bd){delete _0x47f042[_0x841039],_0x116e1f=_0x5d61bd,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'commentsLicenseKeyInvalid'==_0x116e1f&&_0x47f042['_showLicenseError']('invalid'),'commentsLicenseKeyExpired'==_0x116e1f&&_0x47f042['_showLicenseError']('expired'),'commentsLicenseKeyDomainLimit'==_0x116e1f&&_0x47f042['_showLicenseError']('domainLimit'),'commentsLicenseKeyNotAllowed'==_0x116e1f&&_0x47f042['_showLicenseError']('featureNotAllowed','Comments'),'commentsLicenseKeyEvaluationLimit'==_0x116e1f&&_0x47f042['_showLicenseError']('evaluationLimit'),'commentsLicenseKeyUsageLimit'==_0x116e1f&&_0x47f042['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_createUIButton(_0x43876a){const _0x57e19e=this['editor'],_0x243acd=new _0x43876a(_0x57e19e['locale']),_0x403895=_0x57e19e['commands']['get']('addCommentThread');return _0x243acd['set']({'label':Et(_0x57e19e['locale'],'Comment'),'icon':_0x413d95}),_0x243acd['bind']('isEnabled')['to'](_0x403895,'isEnabled',_0x403895,'hasContent',(_0x434df9,_0x5b6f83)=>_0x434df9&&_0x5b6f83),this['listenTo'](_0x243acd,'execute',()=>{_0x403895['execute']();}),_0x243acd;}},yi=class extends _0x53a0a0{static get['pluginName'](){return'CommentsOnly';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[wi];}constructor(_0x287461){super(_0x287461),this['set']('isEnabled',!0x1),this['on']('change:isEnabled',(_0x2f10f2,_0x7f8dbd,_0x4780c6)=>{_0x4780c6?this['_enableCommentsOnlyMode']():this['_disableCommentsOnlyMode']();});}afterInit(){!this['isEnabled']&&this['editor']['config']['get']('commentsOnly')&&(this['isEnabled']=!0x0);}_enableCommentsOnlyMode(){for(const [_0x42aa00,_0x4498c6]of this['editor']['commands'])_0x4498c6['affectsData']&&'addCommentThread'!==_0x42aa00&&_0x4498c6['forceDisabled']('commentsOnlyMode');this['editor']['plugins']['has']('DragDrop')&&this['editor']['plugins']['get']('DragDrop')['forceDisabled']('commentsOnlyMode'),this['editor']['plugins']['has']('RevisionTracker')&&this['editor']['plugins']['get']('RevisionTracker')['forceDisabled']('commentsOnlyMode'),this['editor']['plugins']['has']('SourceEditing')&&this['editor']['plugins']['get']('SourceEditing')['forceDisabled']('commentsOnlyMode'),this['editor']['commands']['get']('editSource')?.['forceDisabled']('commentsOnlyMode');const _0x3e9c5d=this['editor']['editing']['view']['document'];this['listenTo'](_0x3e9c5d,'cut',_0x51c225=>_0x51c225['stop'](),{'priority':'highest'}),this['listenTo'](_0x3e9c5d,'clipboardInput',_0x7716f2=>_0x7716f2['stop'](),{'priority':'highest'}),this['listenTo'](_0x3e9c5d,'delete',_0x339814=>_0x339814['stop'](),{'priority':'highest'});}_disableCommentsOnlyMode(){for(const [_0xbefdc3,_0x30b8f2]of this['editor']['commands'])_0x30b8f2['affectsData']&&'addCommentThread'!==_0xbefdc3&&_0x30b8f2['clearForceDisabled']('commentsOnlyMode');this['editor']['plugins']['has']('RevisionTracker')&&this['editor']['plugins']['get']('RevisionTracker')['clearForceDisabled']('commentsOnlyMode'),this['editor']['plugins']['has']('SourceEditing')&&this['editor']['plugins']['get']('SourceEditing')['clearForceDisabled']('commentsOnlyMode'),this['editor']['commands']['get']('editSource')?.['clearForceDisabled']('commentsOnlyMode'),this['stopListening'](this['editor']['editing']['view']['document']);}},Ti=class extends _0xa2dbe{activeUIs;uisData;['_uis'];static get requires(){return[ti];}static get['pluginName'](){return'AnnotationsUIs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x984921){super(_0x984921),this['activeUIs']=new Set(),this['_uis']=new Map(),this['uisData']=new Map();}init(){const _0x59d47b=this['context']['plugins']['get'](ti);this['listenTo'](_0x59d47b,'_activateAnnotation',(_0x5daedc,_0x548cdd)=>{for(const _0x5633cb of this['activeUIs']){const _0x51fe6b=this['_uis']['get'](_0x5633cb);(0x0,this['uisData']['get'](_0x5633cb)['filter'])(_0x548cdd)&&_0x51fe6b['setActiveAnnotation'](_0x548cdd);}}),this['listenTo'](_0x59d47b,'_deactivateAllAnnotations',()=>{for(const _0x3eea6a of this['activeUIs'])this['_uis']['get'](_0x3eea6a)['setActiveAnnotation'](null);}),this['listenTo'](_0x59d47b['_visibleAnnotations'],'add',(_0x3ce6c3,_0x506d8e)=>{this['_assertAnnotationDoesNotBelongToMultipleUIs'](_0x506d8e);});}hasActive(){return this['activeUIs']['size']>0x0;}isActive(_0x45378e){return this['activeUIs']['has'](_0x45378e);}activate(_0x3b43ba,_0x52c7d5=this['defaultFilter']){const _0x135581=this['context']['plugins']['get'](ti);if(!this['_uis']['has'](_0x3b43ba))throw new _0x48784c('annotationsuis-missing-ui',this,{'uiName':_0x3b43ba});this['isActive'](_0x3b43ba)&&this['deactivate'](_0x3b43ba),this['activeUIs']['add'](_0x3b43ba);const _0x552338=new Jt();Qt({'source':_0x135581['_visibleAnnotations'],'target':_0x552338,'filter':_0x52c7d5}),this['uisData']['set'](_0x3b43ba,{'collection':_0x552338,'filter':_0x52c7d5});const _0x4e583f=this['_uis']['get'](_0x3b43ba);_0x4e583f['attach'](_0x552338),this['listenTo'](_0x4e583f,'change:activeAnnotation',(_0x43aecf,_0x521573,_0x15a045,_0x3bde35)=>{_0x3bde35&&_0x135581['_removeActiveAnnotation'](_0x3bde35),_0x15a045&&_0x135581['_addActiveAnnotation'](_0x15a045);});}deactivate(_0x17b3f3){if(this['activeUIs']['delete'](_0x17b3f3),!this['_uis']['has'](_0x17b3f3))throw new _0x48784c('annotationsuis-missing-ui',this,{'uiName':_0x17b3f3});const _0x499511=this['_uis']['get'](_0x17b3f3);_0x499511['detach'](),this['stopListening'](_0x499511),this['uisData']['get'](_0x17b3f3)['collection']['destroy'](),this['uisData']['delete'](_0x17b3f3);}switchTo(_0xa1b6ae){if(!this['_uis']['has'](_0xa1b6ae))throw new _0x48784c('annotationsuis-missing-ui',this,{'uiName':_0xa1b6ae});const _0x3d13af=this['context']['plugins']['get'](ti),_0x149b10=Array['from'](_0x3d13af['activeAnnotations'])[0x0]||null;this['deactivateAll'](),this['activate'](_0xa1b6ae);const _0x5d602a=this['_uis']['get'](_0xa1b6ae);_0x5d602a['setActiveAnnotation'](_0x149b10),_0x5d602a['_setSelectedAnnotations']&&_0x149b10&&_0x5d602a['_setSelectedAnnotations']([_0x149b10]);}deactivateAll(){for(const _0x51e047 of this['activeUIs'])this['deactivate'](_0x51e047);}register(_0x30e281,_0x5b6929){if(this['_uis']['has'](_0x30e281))throw new _0x48784c('annotationsuis-register-already-registered');if('function'!=typeof _0x5b6929['attach']||'function'!=typeof _0x5b6929['detach']||'function'!=typeof _0x5b6929['setActiveAnnotation'])throw new _0x48784c('annotationsuis-register-invalid-interface',null);this['_uis']['set'](_0x30e281,_0x5b6929);}refilterAnnotations(){const _0x42bf06=this['context']['plugins']['get'](ti)['collection'],_0x25e9fa=new Map(),_0x3d96b7=Array['from'](this['activeUIs']);for(const _0x40327e of this['activeUIs']){const _0x5a802b=this['uisData']['get'](_0x40327e)['collection'];for(const _0x2de38a of _0x5a802b)_0x25e9fa['set'](_0x2de38a,_0x40327e);}for(const _0x39e9f1 of _0x42bf06){const _0x57bd94=_0x25e9fa['get'](_0x39e9f1);this['_assertAnnotationDoesNotBelongToMultipleUIs'](_0x39e9f1);const _0x382fb1=_0x3d96b7['find'](_0x4a07ea=>this['uisData']['get'](_0x4a07ea)['filter'](_0x39e9f1));_0x57bd94!==_0x382fb1&&(_0x57bd94&&this['uisData']['get'](_0x57bd94)['collection']['remove'](_0x39e9f1),_0x382fb1&&this['uisData']['get'](_0x382fb1)['collection']['add'](_0x39e9f1));}}destroy(){this['deactivateAll'](),super['destroy']();}defaultFilter(){return!0x0;}_assertAnnotationDoesNotBelongToMultipleUIs(_0x1a6049){const _0x2aad85=[];for(const _0xefe8d4 of this['activeUIs']){(0x0,this['uisData']['get'](_0xefe8d4)['filter'])(_0x1a6049)&&_0x2aad85['push'](_0xefe8d4);}if(_0x2aad85['length']>0x1)throw new _0x48784c('annotationsuis-annotation-mismatch',null,{'matchedUIs':_0x2aad85,'annotationType':_0x1a6049['type']});}};const Ci=/* #__PURE__ -- @preserve */
|
|
32
|
-
|
|
33
|
-
_0x372316('px');var Ei=class extends ht{content;_targetTop;_mutationObserver;constructor(_0x2c913c){super(_0x2c913c),this['set']('top',0x0),this['set']('height',0x0),this['bind']('bottom')['to'](this,'top',this,'height',(_0x39a13a,_0x290d7f)=>_0x39a13a+_0x290d7f),this['set']('isAnimationDisabled',!0x1),this['_mutationObserver']=Xt(()=>this['updateHeight']()),this['_targetTop']=null,this['content']=this['createCollection'](),this['content']['delegate']('arrowup','arrowdown')['to'](this);const _0x3393f4=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-sidebar-item',_0x3393f4['to']('isAnimationDisabled',_0x4a435f=>_0x4a435f?'ck-sidebar-item--no-animation':'')],'style':{'top':_0x3393f4['to']('top',_0xa47ecd=>bi(_0xa47ecd))},'role':'presentation'},'children':this['content']});}['render'](){super['render'](),this['_mutationObserver']['attach'](this['element']);}['focus'](){this['content']['first']&&this['content']['first']['focus']();}updateHeight(){const _0x8c1eed=this['element']['clientHeight'];_0x8c1eed&&(this['height']=_0x8c1eed);}destroy(){this['content']['clear'](),this['_mutationObserver']['detach'](),super['destroy']();}},ki=class extends _0xa2dbe{['view'];_activeAnnotation;_annotations;_spaceBetweenItems;_sidebarItemViewToAnnotation;_annotationToSidebarItemView;_recalculateBuffer;static get['pluginName'](){return'Sidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1a8735){super(_0x1a8735),this['set']('_lastItem',void 0x0),this['view']=this['_createSidebarView'](),this['set']('container',null),this['_spaceBetweenItems']=0x19,this['_sidebarItemViewToAnnotation']=new Map(),this['_annotationToSidebarItemView']=new Map(),this['context']['config']['define']('sidebar.preventScrollOutOfView',!0x1),this['_annotations']=null,this['_activeAnnotation']=null,this['_recalculateBuffer']=[];}init(){const _0x41b098=this['context']['config']['get']('sidebar.container');_0x41b098&&this['setContainer'](_0x41b098);}setContainer(_0x56286a){if(!Oi(_0x56286a))throw new _0x48784c('sidebar-setcontainer-invalid-element');this['container']=_0x56286a;}_attachToContainer({viewClass:_0x31e5be='',spaceBetweenItems:_0xe6bf5c=0x19}={}){if(!Oi(this['container']))throw new _0x48784c('sidebar-attachtocontainer-missing-container',this);this['container']['appendChild'](this['view']['element']),this['view']['class']=_0x31e5be,this['_spaceBetweenItems']=_0xe6bf5c;}['rearrange']({removedAnnotation:_0x1610f5,previousAnnotation:_0xc315ed,nextAnnotation:_0x3a09ee}){const _0x1d1cfe=this['getSidebarItemView'](_0x1610f5);this['view']['list']['remove'](_0x1d1cfe),this['_destroySidebarItemView'](_0x1610f5),_0xc315ed&&this['_alignToTargetRect'](this['getSidebarItemView'](_0xc315ed)),_0x3a09ee&&this['_alignToTargetRect'](this['getSidebarItemView'](_0x3a09ee)),this['_updateLastItem']();}['refresh']({blurredAnnotation:_0x359a5e,activatedAnnotation:_0x2dccc3,disableAnimationOnActivatedAnnotation:_0x2163be}){if(this['_activeAnnotation']=_0x2dccc3,_0x359a5e){_0x359a5e['isActive']=!0x1;const _0x53e15f=this['getSidebarItemView'](_0x359a5e);_0x53e15f&&_0x2163be&&(_0x53e15f['isAnimationDisabled']=!0x1);}if(_0x2dccc3){const _0x273690=this['getSidebarItemView'](_0x2dccc3);_0x273690&&(_0x2dccc3['isActive']=!0x0,_0x2163be&&(_0x273690['isAnimationDisabled']=!0x0,_0x273690['top']+=0x1),this['_alignToTargetRect'](_0x273690));}}_detachFromContainer(_0x30262b){if(this['view']['element']['remove'](),_0x30262b){for(const _0x460727 of _0x30262b)this['_destroySidebarItemView'](_0x460727);}this['view']['list']['clear'](),this['view']['class']='',this['_lastItem']=null;}addAnnotation(_0x11b27c,_0x23b3cf){_0x23b3cf||(_0x23b3cf=_0x11b27c['view']);const _0x27484c=new Ei(this['context']['locale']);this['_sidebarItemViewToAnnotation']['set'](_0x27484c,_0x11b27c),this['_annotationToSidebarItemView']['set'](_0x11b27c,_0x27484c),_0x27484c['content']['add'](_0x23b3cf),this['listenTo'](_0x11b27c['view'],'change:targetRect',(_0x1ee5f8,_0x1e8162,_0x5be9b2)=>{const _0x3e868e=this['_getTargetTop'](_0x11b27c,_0x5be9b2);_0x27484c['_targetTop']!=_0x3e868e&&(_0x27484c['_targetTop']=_0x3e868e,this['_setItemTop'](_0x27484c,_0x3e868e));}),this['listenTo'](_0x27484c,'change:top',()=>{this['_recalculate'](_0x27484c,'top');}),this['listenTo'](_0x27484c,'change:bottom',()=>{this['_recalculate'](_0x27484c,'bottom');}),this['_alignToTargetRect'](_0x27484c);const _0x10eeab=this['_getItemBefore'](_0x27484c);return _0x10eeab&&this['_alignAfterItem'](_0x10eeab,_0x27484c)||this['_alignToTargetRect'](_0x27484c),this['_updateLastItem'](),this['view']['list']['add'](_0x27484c),_0x27484c;}['_alignForTopChange'](_0x27f636){if(!_0x27f636['content']['length'])return;const _0x3af2ce=this['_getItemBefore'](_0x27f636);if(!_0x3af2ce)return;const _0x22a437=this['_sidebarItemViewToAnnotation']['get'](_0x3af2ce),_0x48ede5=this['_activeAnnotation'];_0x48ede5&&_0x48ede5===_0x22a437?this['_alignAfterItem'](_0x3af2ce,_0x27f636):this['_alignBeforeItem'](_0x27f636,_0x3af2ce);}_alignForBottomChange(_0x18bc1c){if(!_0x18bc1c['content']['length'])return;const _0xc56860=this['_getItemAfter'](_0x18bc1c);if(!_0xc56860)return;const _0x7bc674=this['_sidebarItemViewToAnnotation']['get'](_0xc56860),_0xc9aa0d=this['context']['config']['get']('sidebar.preventScrollOutOfView'),_0xf54ef2=this['_activeAnnotation'];_0xf54ef2&&_0xf54ef2===_0x7bc674&&_0xc9aa0d?(this['_alignBeforeItem'](_0xc56860,_0x18bc1c),this['_alignAfterItem'](_0x18bc1c,_0xc56860)):_0xf54ef2&&_0xf54ef2===_0x7bc674?this['_alignBeforeItem'](_0xc56860,_0x18bc1c):this['_alignAfterItem'](_0x18bc1c,_0xc56860);}_recalculate(_0xf263b4,_0x305306){0x0===this['_recalculateBuffer']['length']&&setTimeout(()=>{for(const {sidebarItemView:_0x2761b4,changedProp:_0x59cf7b}of this['_recalculateBuffer'])'top'===_0x59cf7b?this['_alignForTopChange'](_0x2761b4):this['_alignForBottomChange'](_0x2761b4);this['_recalculateBuffer']=[];},0xa),this['_recalculateBuffer']['push']({'sidebarItemView':_0xf263b4,'changedProp':_0x305306});}getSidebarItemView(_0x5a00e4){return this['_annotationToSidebarItemView']['get'](_0x5a00e4);}destroy(){this['stopListening'](),this['view']['destroy']();}_destroySidebarItemView(_0x236418){const _0x425246=this['getSidebarItemView'](_0x236418);this['stopListening'](_0x425246),this['stopListening'](_0x236418['view']),_0x425246['destroy'](),this['_annotationToSidebarItemView']['delete'](_0x236418),this['_sidebarItemViewToAnnotation']['delete'](_0x425246);}_createSidebarView(){const _0xc5a179=new Ii(this['context']['locale']);return _0xc5a179['render'](),this['on']('change:_lastItem',(_0xb16de8,_0x290afb,_0xe13321,_0x5d015a)=>{_0x5d015a&&_0xc5a179['unbind']('minHeight'),_0xe13321?_0xc5a179['bind']('minHeight')['to'](_0xe13321,'bottom'):_0xc5a179['minHeight']=null;}),_0xc5a179;}_updateLastItem(){this['_lastItem']=this['_annotations']?.['last']?this['getSidebarItemView'](this['_annotations']['last']):null;}_getItemBefore(_0x37a437){const _0x9954df=this['_sidebarItemViewToAnnotation']['get'](_0x37a437),_0x8886b=_0x9954df&&this['_annotations']?.['get'](this['_annotations']['getIndex'](_0x9954df)-0x1);return _0x8886b&&this['getSidebarItemView'](_0x8886b)||null;}_getItemAfter(_0x460aa5){const _0x30a48b=this['_sidebarItemViewToAnnotation']['get'](_0x460aa5),_0x5951d2=_0x30a48b&&this['_annotations']?.['get'](this['_annotations']['getIndex'](_0x30a48b)+0x1);return _0x5951d2&&this['getSidebarItemView'](_0x5951d2)||null;}_alignBeforeItem(_0x37811b,_0x3a2bdd){_0x37811b['updateHeight']();const _0x53abe5=Ni(_0x3a2bdd['bottom']+this['_spaceBetweenItems'],_0x37811b['top']);return!!_0x53abe5&&(this['_setItemTop'](_0x3a2bdd,_0x3a2bdd['top']-_0x53abe5),!0x0);}_alignAfterItem(_0x418c19,_0x1ac82e){_0x418c19['updateHeight']();const _0x13bca2=Ni(_0x418c19['bottom']+this['_spaceBetweenItems'],_0x1ac82e['top']);return!!_0x13bca2&&(this['_setItemTop'](_0x1ac82e,_0x1ac82e['top']+_0x13bca2,!0x1),!0x0);}_alignToTargetRect(_0x27c941){const _0x17fc02=this['_sidebarItemViewToAnnotation']['get'](_0x27c941);if(!_0x17fc02||!_0x17fc02['target']||!_0x17fc02['targetRect'])return;const _0x5eac68=this['_getTargetTop'](_0x17fc02,_0x17fc02['targetRect']);this['_setItemTop'](_0x27c941,_0x5eac68);}_getTargetTop(_0x25697f,_0x4c2758){if(null===_0x4c2758)return 0x0;if(_0x25697f['target']instanceof _0x3a8ad1)return _0x4c2758['top'];{const _0x36c5f0=new _0x3a8ad1(this['view']['element'])['top'];return _0x4c2758['top']-_0x36c5f0;}}_setItemTop(_0x3a4c51,_0x24220d,_0x35e5ea=this['context']['config']['get']('sidebar.preventScrollOutOfView')){_0x35e5ea&&(_0x24220d=Math['max'](_0x24220d,this['_getMaxAvailableTop'](_0x3a4c51))),_0x3a4c51['top']=_0x24220d;}_getMaxAvailableTop(_0x42e56b){let _0x4620bd=this['_getItemBefore'](_0x42e56b),_0x50e29d=0x0;for(;_0x4620bd;)_0x4620bd['updateHeight'](),_0x50e29d+=this['_spaceBetweenItems']+_0x4620bd['height'],_0x4620bd=this['_getItemBefore'](_0x4620bd);return _0x50e29d;}};function Ni(_0xe37f71,_0x615a73){return Math['max'](_0xe37f71-_0x615a73,0x0);}function Oi(_0x51dd89){return null!==_0x51dd89&&'object'==typeof _0x51dd89&&0x1===_0x51dd89['nodeType'];}var Mi=class extends _0xa2dbe{isAttached;annotations;_editorAnnotations;_refreshPositioningDebounced;static get requires(){return[ki,Ti];}static get['pluginName'](){return'WideSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xbe8b88){super(_0xbe8b88),this['isAttached']=!0x1,this['set']('activeAnnotation',null),this['annotations']=null,this['_editorAnnotations']=new _0x40e5e7(),this['_refreshPositioningDebounced']=_0x121a24(()=>{_0xbe8b88['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning']();},0xfa,{'leading':!0x1});}init(){const _0x516472=this['context']['plugins']['get'](Ti),_0x3ff7e2=this['context']['plugins']['get'](ki);_0x516472['register']('wideSidebar',this),_0x3ff7e2['container']&&_0x516472['switchTo']('wideSidebar');}setActiveAnnotation(_0xf9322){if(_0xf9322===this['activeAnnotation'])return;const _0x358ecf=this['context']['plugins']['get'](ki);_0x358ecf['_activeAnnotation']=_0xf9322;const _0x1f6277=this['activeAnnotation'];_0x358ecf['refresh']({'blurredAnnotation':_0x1f6277,'activatedAnnotation':_0xf9322}),this['activeAnnotation']=_0xf9322;}attach(_0x370c5c){this['annotations']=_0x370c5c;const _0x477ccf=this['context']['plugins']['get'](ki);if(_0x477ccf['_annotations']=_0x370c5c,this['isAttached'])throw new _0x48784c('widesidebar-attach-already-attached',this);this['isAttached']=!0x0,this['listenTo'](_0x477ccf,'set:container',()=>{this['detach'](),this['listenTo'](_0x477ccf,'change:container',_0x1be67d=>{_0x1be67d['off'](),this['attach'](_0x370c5c);});}),_0x477ccf['_attachToContainer']({'viewClass':'ck-sidebar--wide'});const _0x3d3c0e=_0x32ad4a=>{_0x32ad4a['updateTargetRect'](),_0x477ccf['addAnnotation'](_0x32ad4a);};for(const _0xf08bf7 of _0x370c5c)_0x3d3c0e(_0xf08bf7);this['listenTo'](_0x370c5c,'add',(_0x49c049,_0x3eef93)=>{_0x3d3c0e(_0x3eef93);}),this['listenTo'](_0x370c5c,'remove',(_0x293603,_0x3a536c,_0x33c902)=>{_0x477ccf['rearrange']({'removedAnnotation':_0x3a536c,'previousAnnotation':_0x370c5c['get'](_0x33c902-0x1),'nextAnnotation':_0x370c5c['get'](_0x33c902+0x1)}),_0x3a536c===this['activeAnnotation']&&this['setActiveAnnotation'](null);},{'priority':'high'}),this['listenTo'](_0x370c5c,'focus',(_0x435245,_0x451572)=>{this['setActiveAnnotation'](_0x451572);}),this['listenTo'](_0x370c5c,'blur',()=>{this['setActiveAnnotation'](null);});const _0x161d1d=this['context']instanceof _0x3e496a?this['context']['editors']:new _0x40e5e7([this['context']]);for(const _0x399f41 of _0x161d1d)this['_integrateWithEditorAnnotations'](_0x399f41);this['listenTo'](_0x161d1d,'add',(_0x3567d2,_0x212483)=>{this['listenTo'](_0x212483,'ready',()=>{this['_integrateWithEditorAnnotations'](_0x212483);});}),this['listenTo'](_0x161d1d,'remove',(_0x1a8cd0,_0x40cecb)=>{_0x40cecb['plugins']['has']('EditorAnnotations')&&this['_destroyEditorAnnotationsIntegration'](_0x40cecb['plugins']['get']('EditorAnnotations'));}),window['addEventListener']('resize',this['_refreshPositioningDebounced']),this['context']['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning']();}detach(){if(!this['isAttached'])throw new _0x48784c('widesidebar-detach-not-attached',this);this['setActiveAnnotation'](null);const _0x437075=this['context']['plugins']['get'](ki);_0x437075['_detachFromContainer'](this['annotations']),this['stopListening'](_0x437075),this['stopListening'](this['annotations']),this['context']instanceof _0x3e496a&&this['stopListening'](this['context']['editors']);for(const _0x257047 of Array['from'](this['_editorAnnotations']))this['_destroyEditorAnnotationsIntegration'](_0x257047);window['removeEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioningDebounced']['cancel'](),this['activeAnnotation']=null,this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach']();}_integrateWithEditorAnnotations(_0x17b6ae){if(!_0x17b6ae['plugins']['has']('EditorAnnotations'))return;const _0x1be021=_0x17b6ae['plugins']['get']('EditorAnnotations'),_0x26d0e2=()=>{const _0x20c508=_0x1be021['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});this['setActiveAnnotation'](_0x20c508[0x0]||null);};this['listenTo'](_0x1be021,'refresh',_0x26d0e2),this['listenTo'](_0x1be021,'blur',(_0x21e98d,{isAnnotationTracked:_0x481cc2})=>{this['activeAnnotation']&&_0x481cc2(this['activeAnnotation'])&&this['setActiveAnnotation'](null);}),this['listenTo'](_0x1be021,'uiUpdate',()=>{this['_refreshPositioningDebounced']();}),this['listenTo'](this['annotations'],'blur',_0x1e4303=>{_0x1be021['hasDomSelection']()&&(_0x26d0e2(),_0x1e4303['stop']());},{'priority':'high'}),this['_editorAnnotations']['add'](_0x1be021);}_destroyEditorAnnotationsIntegration(_0x5dc256){this['stopListening'](_0x5dc256),this['_editorAnnotations']['remove'](_0x5dc256);}},Ri=class extends _0x3e41ef{counterView;constructor(_0x5a30e9){super(_0x5a30e9);const _0xa622b5=this['bindTemplate'];this['set']('isDirty',!0x1),this['set']('number',0x0),this['bind']('_badge')['to'](this,'isDirty',this,'number',(_0x4b8d7f,_0x5b17de)=>_0x4b8d7f?'...':_0x5b17de['toString']()),this['set']('annotationType',''),this['icon']=_0x413d95,this['extendTemplate']({'attributes':{'class':['ck-annotation-counter']}}),this['counterView']=new ht(),this['counterView']['setTemplate']({'tag':'span','attributes':{'class':['ck-annotation-counter__badge',_0xa622b5['to']('annotationType',_0x9efd7c=>'ck-annotation-counter__badge--'+_0x9efd7c),_0xa622b5['if']('isDirty','ck-annotation-counter__badge--edit-mode')]},'children':[{'text':_0xa622b5['to']('_badge')}]}),this['children']['add'](this['counterView']);}},Si=class extends _0xa2dbe{isAttached;annotations;_manuallyClosedAnnotationViews;_domEmitter;_annotationToNarrowView;_selectedAnnotations;_editorAnnotations;_refreshPositioningDebounced;static get requires(){return[ki,Ti];}static get['pluginName'](){return'NarrowSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x50fd36){super(_0x50fd36),this['isAttached']=!0x1,this['_manuallyClosedAnnotationViews']=new Set(),this['_domEmitter']=new(_0x4f6b20())(),this['_annotationToNarrowView']=new Map(),this['set']('activeAnnotation',null),this['annotations']=null,this['_selectedAnnotations']=[],this['_editorAnnotations']=new _0x40e5e7(),this['_refreshPositioningDebounced']=_0x121a24(()=>{this['_refreshPositioning']();},0xfa,{'leading':!0x1});}init(){this['context']['plugins']['get'](Ti)['register']('narrowSidebar',this),this['bodyCollection']=new _0x3127b0(this['context']['locale']),this['balloonPanelView']=new _0x1ab0fb(this['context']['locale']),this['bodyCollection']['attachToDom'](),this['bodyCollection']['add'](this['balloonPanelView']);}attach(_0x4f5cdc){this['annotations']=_0x4f5cdc;const _0x46bf1e=this['context']['plugins']['get'](ki),_0x25da39=this['balloonPanelView'];if(_0x46bf1e['_annotations']=_0x4f5cdc,this['isAttached'])throw new _0x48784c('narrowsidebar-attach-already-attached',this);this['isAttached']=!0x0,this['listenTo'](_0x46bf1e,'set:container',()=>{this['detach'](),this['listenTo'](_0x46bf1e,'change:container',_0x5d614a=>{_0x5d614a['off'](),this['attach'](_0x4f5cdc);});}),_0x46bf1e['_attachToContainer']({'viewClass':'ck-sidebar--narrow','spaceBetweenItems':0x5});const _0x3efe85=_0x110558=>{const _0x12685b=new Ri(this['context']['locale']);_0x46bf1e['addAnnotation'](_0x110558,_0x12685b),this['_annotationToNarrowView']['set'](_0x110558,_0x12685b),_0x12685b['bind']('isDirty','annotationType','number')['to'](_0x110558['view'],'isDirty','type','length'),_0x12685b['on']('execute',()=>{this['_manuallyClosedAnnotationViews']['clear'](),_0x25da39['content']['first']!==_0x110558['view']?(this['_showBalloon'](_0x110558),_0x110558['view']['element']['focus'](),this['setActiveAnnotation'](_0x110558)):this['setActiveAnnotation'](null);});};for(const _0xefca1a of _0x4f5cdc)_0x3efe85(_0xefca1a);this['listenTo'](_0x4f5cdc,'add',(_0x3a4d13,_0x417fda)=>{_0x3efe85(_0x417fda);}),this['listenTo'](_0x4f5cdc,'remove',(_0x46e6a2,_0x3c8e8d,_0x4d7fe5)=>{this['_annotationToNarrowView']['get'](_0x3c8e8d)['destroy'](),this['_annotationToNarrowView']['delete'](_0x3c8e8d),_0x46bf1e['rearrange']({'removedAnnotation':_0x3c8e8d,'previousAnnotation':_0x4f5cdc['get'](_0x4d7fe5-0x1),'nextAnnotation':_0x4f5cdc['get'](_0x4d7fe5+0x1)}),_0x3c8e8d===this['activeAnnotation']&&this['setActiveAnnotation'](null);},{'priority':'low'}),this['listenTo'](_0x4f5cdc,'focus',(_0x3b146f,_0x179ddc)=>{this['setActiveAnnotation'](_0x179ddc);}),this['listenTo'](_0x4f5cdc,'blur',()=>{this['setActiveAnnotation'](null);}),this['_domEmitter']['listenTo'](document,'keydown',(_0x400c94,_0x16a605)=>{_0x16a605['keyCode']===_0x1dece6['esc']&&_0x25da39['isVisible']&&(this['_manuallyClosedAnnotationViews']['add'](_0x25da39['content']['first']),this['_hideBalloon'](),_0x16a605['stopPropagation'](),_0x16a605['preventDefault']());}),this['_domEmitter']['listenTo'](document,'mousedown',(_0x57957e,_0x2a16b9)=>{const _0x27b1d2=_0x2a16b9['target'];_0x25da39['isVisible']&&_0x25da39['element']['contains'](_0x27b1d2)||_0x46bf1e['view']['element']['contains'](_0x27b1d2)||_0x57957e['preventClosingBalloon']||this['activeAnnotation']&&this['activeAnnotation']['focusableElements']['find'](_0x3629f1=>_0x3629f1['contains'](_0x27b1d2))||(this['_manuallyClosedAnnotationViews']['clear'](),this['_hideBalloon'](),this['setActiveAnnotation'](null));});const _0xe92252=this['context']instanceof _0x3e496a?this['context']['editors']:new _0x40e5e7([this['context']]);for(const _0x3c880a of _0xe92252)this['_integrateWithEditorAnnotations'](_0x3c880a);this['listenTo'](_0xe92252,'add',(_0x372ccc,_0x14284e)=>{this['listenTo'](_0x14284e,'ready',()=>{this['_integrateWithEditorAnnotations'](_0x14284e);});}),this['listenTo'](_0xe92252,'remove',(_0x1696d3,_0x926c20)=>{_0x926c20['plugins']['has']('EditorAnnotations')&&this['_destroyEditorAnnotationsIntegration'](_0x926c20['plugins']['get']('EditorAnnotations'));}),window['addEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioning']();}setActiveAnnotation(_0x12c8d1){if(_0x12c8d1===this['activeAnnotation'])return;const _0x19597e=this['context']['plugins']['get'](ki);_0x19597e['refresh']({'blurredAnnotation':this['activeAnnotation'],'activatedAnnotation':_0x12c8d1,'disableAnimationOnActivatedAnnotation':!0x0}),_0x12c8d1&&_0x19597e['getSidebarItemView'](_0x12c8d1)?this['_showBalloon'](_0x12c8d1):this['_hideBalloon'](),this['activeAnnotation']=_0x12c8d1;}detach(){if(!this['isAttached'])throw new _0x48784c('narrowsidebar-detach-not-attached',this);this['setActiveAnnotation'](null);const _0x2c2f00=this['context']['plugins']['get'](ki);this['_hideBalloon'](),Array['from'](this['_annotationToNarrowView']['values'](),_0x3d8f07=>_0x3d8f07['destroy']()),this['_annotationToNarrowView']['clear'](),_0x2c2f00['_detachFromContainer'](this['annotations']),this['stopListening'](),this['_domEmitter']['stopListening'](),this['context']instanceof _0x3e496a&&this['stopListening'](this['context']['editors']);for(const _0x515b53 of Array['from'](this['_editorAnnotations']))this['_destroyEditorAnnotationsIntegration'](_0x515b53);window['removeEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioningDebounced']['cancel'](),this['_selectedAnnotations']=[],this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach'](),this['bodyCollection']['detachFromDom']();}_integrateWithEditorAnnotations(_0x163a94){if(!_0x163a94['plugins']['has']('EditorAnnotations'))return;const _0x230ed4=_0x163a94['plugins']['get']('EditorAnnotations'),_0x56aea5=this['context']['plugins']['get'](ki),_0x1af457=this['annotations'],_0x5d1313=this['balloonPanelView'],_0x58d766=()=>{const _0x7c20f6=_0x230ed4['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});this['_setSelectedAnnotations'](_0x7c20f6),this['setActiveAnnotation'](_0x7c20f6[0x0]||null);};this['listenTo'](_0x230ed4,'refresh',_0x58d766),this['listenTo'](_0x230ed4,'blur',(_0x18909e,{isAnnotationTracked:_0x4f7aeb})=>{this['activeAnnotation']&&_0x4f7aeb(this['activeAnnotation'])&&(this['_setSelectedAnnotations']([]),this['setActiveAnnotation'](null));}),this['listenTo'](_0x230ed4,'uiUpdate',()=>{this['_refreshPositioningDebounced']();}),this['listenTo'](_0x1af457,'blur',_0x242b0d=>{_0x230ed4['hasDomSelection']()&&_0x242b0d['stop']();},{'priority':'high'}),this['listenTo'](this['_domEmitter'],'mousedown',(_0x5a6ec2,_0x4d6efc)=>{const _0x29c277=_0x4d6efc['target'];_0x5d1313['isVisible']&&_0x5d1313['element']['contains'](_0x29c277)||_0x56aea5['view']['element']['contains'](_0x29c277)||this['activeAnnotation']&&_0x230ed4['hasDomSelection']()&&(_0x58d766(),_0x5a6ec2['preventClosingBalloon']=!0x0);},{'priority':'high'}),this['_editorAnnotations']['add'](_0x230ed4);}_destroyEditorAnnotationsIntegration(_0x47156a){_0x47156a&&(this['stopListening'](_0x47156a),this['_editorAnnotations']['remove'](_0x47156a));}_setSelectedAnnotations(_0x326c75){for(const _0x2be106 of this['_selectedAnnotations'])_0x326c75['includes'](_0x2be106)||this['_manuallyClosedAnnotationViews']['delete'](_0x2be106['view']);this['_selectedAnnotations']=_0x326c75;}_refreshPositioning(){const _0x3ac269=this['balloonPanelView'];this['context']['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning'](),_0x3ac269['isVisible']&&this['_updateBalloonPosition']();}['_showBalloon'](_0x1e73b7){if(this['_manuallyClosedAnnotationViews']['has'](_0x1e73b7['view']))return;const _0x56eb48=this['balloonPanelView']['content']['first'];_0x56eb48!==_0x1e73b7['view']?(_0x56eb48&&this['_detachListeners'](_0x56eb48),this['_attachListeners'](_0x1e73b7['view']),this['balloonPanelView']['content']['clear'](),this['balloonPanelView']['content']['add'](_0x1e73b7['view']),this['_updateBalloonPosition']()):this['_updateBalloonPosition']();}_updateBalloonPosition(){const _0x2ee430=this['balloonPanelView']['content']['first'],_0x4577f2=_0x2ee430&&this['annotations']['getByView'](_0x2ee430);if(!_0x4577f2||!this['_annotationToNarrowView']['has'](_0x4577f2))return;const _0x4afe7b=this['_annotationToNarrowView']['get'](_0x4577f2)['element'],_0x350fc5=(function(){const _0x55efe9=_0x1ab0fb['defaultPositions'];return[_0x55efe9['southArrowNorthEast'],_0x55efe9['northArrowSouthEast'],_0x55efe9['southArrowNorth'],_0x55efe9['northArrowSouth'],_0x55efe9['southArrowNorthWest'],_0x55efe9['northArrowSouthWest']];}());this['balloonPanelView']['pin']({'target':_0x4afe7b,'positions':_0x350fc5});}['_hideBalloon'](){const _0x2d3015=this['balloonPanelView'],_0x4f3952=_0x2d3015['content']['first'];_0x4f3952&&(this['_detachListeners'](_0x4f3952),_0x2d3015['unpin'](),_0x2d3015['content']['clear']());}_attachListeners(_0x2acc92){this['listenTo'](_0x2acc92,'change:height',()=>this['_updateBalloonPosition']()),this['listenTo'](_0x2acc92,'Esc',(_0x3de777,_0x386bed)=>{this['_manuallyClosedAnnotationViews']['add'](_0x2acc92),this['_hideBalloon'](),_0x386bed();});}_detachListeners(_0x39a63f){this['stopListening'](_0x39a63f);}},xi=class extends _0x53a0a0{isAttached;annotations;['_manuallyClosed'];['_balloon'];_addedAnnotations;_selectedAnnotations;['_forceRefresh'];_refreshVisibilityDebounced;static get requires(){return[di,_0x4f3387,Ti];}static get['pluginName'](){return'InlineAnnotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x53e66a){super(_0x53e66a),_0x53e66a['editing']['view']['addObserver'](lt),this['isAttached']=!0x1,this['set']('activeAnnotation',null),this['annotations']=null,this['_manuallyClosed']=new Set(),this['_balloon']=_0x53e66a['plugins']['get'](_0x4f3387),this['_addedAnnotations']=new Set(),this['_selectedAnnotations']=[],this['_forceRefresh']=!0x1,this['_refreshVisibilityDebounced']=_0x121a24(()=>{this['editor']['plugins']['get']('Annotations')['refreshVisibility']();},0xfa,{'leading':!0x1});}init(){const _0x2ecf28=this['editor']['plugins']['get'](Ti);_0x2ecf28['context']===this['editor']&&(_0x2ecf28['register']('inline',this),this['editor']['keystrokes']['set']('Esc',(_0x295f62,_0x40620b)=>{const _0x559a52=this['_balloon'];if(this['isAttached']&&_0x559a52['visibleView']){const _0x38691e=this['annotations']['getByView'](_0x559a52['visibleView']);_0x38691e&&this['_closeAnnotation'](_0x38691e),_0x40620b();}}));}afterInit(){const _0x170b08=this['editor']['plugins']['get'](Ti);_0x170b08['context']===this['editor']&&(_0x170b08['hasActive']()||_0x170b08['switchTo']('inline'));}setActiveAnnotation(_0x2d1b4d){_0x2d1b4d!==this['activeAnnotation']&&(this['activeAnnotation']&&(this['activeAnnotation']['isActive']=!0x1),_0x2d1b4d&&this['editor']['ui']['focusTracker']['isFocused']&&(this['annotations']['has'](_0x2d1b4d)&&this['_addAnnotationToBalloon'](_0x2d1b4d,!0x0),_0x2d1b4d['isActive']=!0x0),_0x2d1b4d||this['_setSelectedAnnotations']([]),this['activeAnnotation']=_0x2d1b4d);}attach(_0x726179){this['annotations']=_0x726179;const _0x166e28=this['editor']['plugins']['get'](Ti),_0x284c7a=this['_balloon'];if(this['isAttached'])throw new _0x48784c('inlineannotations-attach-already-attached',this);if(_0x166e28['context']!==this['editor'])throw new _0x48784c('inlineannotations-not-allowed-with-context',this);const _0x4ab483=this['editor']['plugins']['get'](di);this['listenTo'](_0x4ab483,'refresh',()=>{const _0x528438=_0x4ab483['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});var _0x3c52bc,_0x5ccc5d;!this['_forceRefresh']&&(_0x3c52bc=_0x528438,_0x5ccc5d=this['_selectedAnnotations'],_0x3c52bc['length']===_0x5ccc5d['length']&&_0x3c52bc['every'](_0x250b27=>_0x5ccc5d['includes'](_0x250b27)))||(this['_forceRefresh']=!0x1,this['_setSelectedAnnotations'](_0x528438),this['setActiveAnnotation'](_0x528438[0x0]||null));}),this['listenTo'](_0x4ab483,'blur',(_0x31869b,{isAnnotationTracked:_0x2425f6})=>{this['activeAnnotation']&&_0x2425f6(this['activeAnnotation'])&&(this['_setSelectedAnnotations']([]),this['setActiveAnnotation'](null));}),this['listenTo'](_0x4ab483,'uiUpdate',()=>{this['_refreshVisibilityDebounced']();}),this['listenTo'](this['editor']['ui']['focusTracker'],'change:isFocused',(_0x5c0b73,_0x180576,_0x50beba)=>{_0x50beba||this['setActiveAnnotation'](null);}),this['listenTo'](_0x726179,'remove',(_0x13fecf,_0x2731ec)=>{this['_removeAnnotationFromBalloon'](_0x2731ec),_0x2731ec===this['activeAnnotation']&&this['setActiveAnnotation'](null);}),this['listenTo'](_0x284c7a,'change:visibleView',(_0x20d8cc,_0x17f3e9,_0x14cd07,_0x3f1520)=>{_0x3f1520&&this['stopListening'](_0x3f1520);const _0x4fce88=_0x726179['getByView'](_0x14cd07);_0x14cd07&&_0x4fce88&&(this['listenTo'](_0x14cd07,'change:height',()=>{_0x284c7a['updatePosition']();}),this['listenTo'](_0x14cd07,'Esc',()=>{this['_closeAnnotation'](_0x4fce88),this['editor']['editing']['view']['focus']();}),this['activeAnnotation']!==_0x4fce88&&this['setActiveAnnotation'](_0x4fce88));}),this['listenTo'](this['editor']['ui'],'update',()=>{_0x284c7a['visibleView']&&_0x726179['getByView'](_0x284c7a['visibleView'])&&_0x284c7a['updatePosition']();}),this['listenTo'](this['editor']['editing']['view']['document'],'mousedown',()=>{this['_forceRefresh']=!0x0,this['_manuallyClosed']['clear']();}),this['editor']['editing']['view']['document']['selection']['editableElement']&&this['editor']['editing']['view']['focus'](),this['isAttached']=!0x0;}detach(){if(!this['isAttached'])throw new _0x48784c('inlineannotations-detach-not-attached',this);this['setActiveAnnotation'](null);for(const _0x4293d6 of this['_addedAnnotations'])this['_removeAnnotationFromBalloon'](_0x4293d6);this['_refreshVisibilityDebounced']['cancel'](),this['stopListening'](),this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach'](),this['_refreshVisibilityDebounced']['cancel']();}_setSelectedAnnotations(_0x40ce23){for(const _0x5626db of this['_selectedAnnotations'])_0x40ce23['includes'](_0x5626db)||this['_manuallyClosed']['delete'](_0x5626db);for(const _0x8dedd7 of this['annotations'])_0x40ce23['includes'](_0x8dedd7)||this['_removeAnnotationFromBalloon'](_0x8dedd7);if(this['editor']['ui']['focusTracker']['isFocused']){for(const _0x1acb4c of _0x40ce23)this['_addAnnotationToBalloon'](_0x1acb4c);}this['_selectedAnnotations']=_0x40ce23;}_addAnnotationToBalloon(_0x3d5fb3,_0xfd297a=!0x1){this['_manuallyClosed']['has'](_0x3d5fb3)||(this['_addedAnnotations']['has'](_0x3d5fb3)||this['_balloon']['hasView'](_0x3d5fb3['view'])||(this['_addedAnnotations']['add'](_0x3d5fb3),this['_balloon']['add']({'stackId':_0x3d5fb3['view']['id'],'view':_0x3d5fb3['view'],'position':{'target':()=>this['_getBalloonTargetForAnnotation'](_0x3d5fb3)}})),_0xfd297a&&this['_balloon']['showStack'](_0x3d5fb3['view']['id']));}_getBalloonTargetForAnnotation(_0x2fa575){const _0x443f14=_0x2fa575['target'],_0x2bed5a=this['editor']['editing']['view'],_0x368688=_0x2bed5a['document']['selection']['getFirstRange'](),_0x3f908e=_0x2bed5a['domConverter']['viewRangeToDom'](_0x368688);if(_0x3f908e['collapse'](!0x0),_0x443f14){if(_0x443f14 instanceof _0x3a8ad1)return _0x443f14;let _0x20f6e7=[];for(const _0x3f5e5b of _0x443f14)_0x20f6e7['push'](..._0x3a8ad1['getDomElementRects'](_0x3f5e5b));_0x20f6e7=function(_0x266155){const _0x4eeb10=[];let _0x2eb0b5=_0x266155[0x0];for(let _0x4c380d=0x1;_0x4c380d<_0x266155['length'];_0x4c380d++)if(Pi(_0x2eb0b5,_0x266155[_0x4c380d])){const _0x284a48=_0x266155[_0x4c380d]['width'];_0x2eb0b5['width']+=_0x284a48,_0x2eb0b5['right']+=_0x284a48;}else _0x4eeb10['push'](_0x2eb0b5),_0x2eb0b5=_0x266155[_0x4c380d];return _0x4eeb10['push'](_0x2eb0b5),_0x4eeb10;}(_0x20f6e7);const _0x769af0=_0x3f908e['getBoundingClientRect']();return _0x20f6e7['find'](_0x557ab3=>_0x557ab3['top']<=_0x769af0['top']&&_0x557ab3['bottom']>=_0x769af0['bottom']&&_0x557ab3['left']<=_0x769af0['left']&&_0x557ab3['right']>=_0x769af0['right'])||_0x20f6e7[0x0];}return _0x2fa575['targetRect']||_0x3f908e;}_removeAnnotationFromBalloon(_0x1f7723){this['_addedAnnotations']['has'](_0x1f7723)&&this['_balloon']['hasView'](_0x1f7723['view'])&&(this['_addedAnnotations']['delete'](_0x1f7723),this['_balloon']['remove'](_0x1f7723['view']));}_closeAnnotation(_0x2f8fae){this['_manuallyClosed']['add'](_0x2f8fae),this['_removeAnnotationFromBalloon'](_0x2f8fae);}};function Pi(_0x19efd6,_0xb71d41){return _0x19efd6['top']===_0xb71d41['top']&&_0x19efd6['bottom']===_0xb71d41['bottom']&&_0x19efd6['right']===_0xb71d41['left'];}var Li=class extends ht{['focusTracker'];['focusCycler'];_annotationViews;constructor(_0x501777,_0x29789c){super(_0x501777),this['set']('isEmpty',!_0x29789c['length']),this['focusTracker']=new _0x91f952(),this['_annotationViews']=_0x29789c,this['_annotationViews']['delegate']('arrowup','arrowdown')['to'](this),this['on']('arrowup',()=>{this['focusCycler']['focusPrevious']();}),this['on']('arrowdown',()=>{this['focusCycler']['focusNext']();}),this['focusCycler']=new et({'focusables':_0x29789c,'focusTracker':this['focusTracker']}),this['listenTo'](_0x29789c,'add',()=>{this['isEmpty']=!0x1;}),this['listenTo'](_0x29789c,'remove',(_0x375ea2,_0x23bd33)=>{_0x23bd33['isActive']&&this['focus'](),_0x29789c['length']||(this['isEmpty']=!0x0);});const _0x1ead3c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'dir':'auto','class':['ck','ck-comments-archive'],'tabindex':-0x1,'role':'list','aria-label':Et(_0x501777,'COMMENTS_ARCHIVE_LIST_LABEL')},'children':[{'tag':'div','attributes':{'class':['ck-comments-archive__content'],'role':'presentation'},'children':[{'tag':'div','attributes':{'role':'presentation'},'children':_0x29789c},{'tag':'p','attributes':{'class':['ck-comments-archive__info',_0x1ead3c['if']('isEmpty','ck-hidden',_0x4fa982=>!_0x4fa982)]},'children':[{'text':Et(_0x501777,'EMPTY_COMMENTS_ARCHIVE')}]}]}]});}['render'](){super['render'](),this['_setupKeyboardNavigation']();}destroy(){super['destroy'](),this['focusTracker']['destroy']();}['focus'](){this['focusCycler']['first']?this['focusCycler']['focusFirst']():this['element']['focus']();}_setupKeyboardNavigation(){for(const _0x5d4d6e of this['_annotationViews'])this['focusTracker']['add'](_0x5d4d6e['element']);this['_annotationViews']['on']('change',(_0x2f7bb3,{added:_0x5680ba,removed:_0x556d0e})=>{for(const _0x5134e1 of _0x5680ba)this['focusTracker']['add'](_0x5134e1['element']);for(const _0x3b5d66 of _0x556d0e)this['focusTracker']['remove'](_0x3b5d66['element']);});}},Di=class extends _0xa2dbe{static get['pluginName'](){return'CommentsArchive';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[oi,ti];}constructor(_0x554124){super(_0x554124),this['archivedThreads']=new _0x40e5e7();}init(){const _0x542acc=this['context'],_0x3ab306=_0x542acc['plugins']['get'](oi),_0x1e7ffd=_0x542acc['plugins']['get'](ti);this['listenTo'](_0x3ab306,'addCommentThread',(_0x30398a,{threadId:_0x4cb519})=>{const _0x3d64bc=_0x3ab306['getCommentThread'](_0x4cb519);_0x3d64bc['archivedAt']&&this['archivedThreads']['add'](_0x3d64bc,this['_calculatePosition'](_0x3d64bc['archivedAt'])),this['listenTo'](_0x3d64bc,'change:archivedAt',(_0x1b4257,_0x1f2932,_0x1b8cc7)=>{_0x1b8cc7?this['archivedThreads']['has'](_0x3d64bc)||this['archivedThreads']['add'](_0x3d64bc,this['_calculatePosition'](_0x3d64bc['archivedAt'])):this['archivedThreads']['has'](_0x3d64bc)&&this['archivedThreads']['remove'](_0x3d64bc);});}),this['listenTo'](_0x3ab306,'removeCommentThread',(_0x12bcd9,{threadId:_0x5e01ec})=>{const _0x172b3a=_0x3ab306['getCommentThread'](_0x5e01ec);this['stopListening'](_0x172b3a),this['archivedThreads']['has'](_0x172b3a)&&this['archivedThreads']['remove'](_0x172b3a);},{'priority':'highest'}),this['listenTo'](_0x1e7ffd['collection'],'focus',(_0x31e5bf,_0x3ea5c5)=>{_0x3ea5c5['isVisible']||(_0x3ea5c5['isActive']=!0x0,_0x1e7ffd['activate'](_0x3ea5c5));});}_calculatePosition(_0x8b6fd3){const _0x2dfdb8=[...this['archivedThreads']]['findIndex'](_0x7c1bb8=>_0x7c1bb8['archivedAt']<_0x8b6fd3);return _0x2dfdb8>-0x1?_0x2dfdb8:this['archivedThreads']['length'];}},Vi=class extends _0x53a0a0{commentsArchiveView;annotationViews;['_pendingThreads'];static get['pluginName'](){return'CommentsArchiveUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Di,_0x5c93bc];}constructor(_0x11e175){super(_0x11e175),this['annotationViews']=new at(),this['_pendingThreads']=[];}init(){const _0x50ce3a=this['editor'],_0x23d45c=this['_hideDialogOnAnnotationEscape']['bind'](this);_0x50ce3a['ui']['componentFactory']['add']('commentsArchive',()=>this['_createCommentsArchiveButton'](_0x3e41ef,!0x0)),_0x50ce3a['ui']['componentFactory']['add']('menuBar:commentsArchive',()=>{const _0xbfcfe7=this['_createCommentsArchiveButton'](rt);return _0xbfcfe7['set']({'role':'menuitemcheckbox'}),_0xbfcfe7;});const _0x55ebb0=_0x50ce3a['plugins']['get'](Di),_0x303111=_0x50ce3a['plugins']['get']('Annotations'),_0x151495=_0x50ce3a['plugins']['get']('CommentsRepository');_0x55ebb0['archivedThreads']['forEach'](_0x2b81c4=>{this['_handleNewThread'](_0x2b81c4);}),this['listenTo'](_0x55ebb0['archivedThreads'],'add',(_0xb37673,_0x60ec2a)=>{this['_handleNewThread'](_0x60ec2a);}),this['listenTo'](_0x303111['collection'],'add',(_0x2c0f1b,_0x286d10)=>{const _0x4c3d62=this['_pendingThreads']['find'](_0x349872=>{const _0x99d85a=_0x151495['_threadToController']['get'](_0x349872);return _0x99d85a&&_0x286d10['innerView']===_0x99d85a['view'];});if(_0x4c3d62){const _0x10ae7a=this['_calculatePosition'](_0x4c3d62['archivedAt']);this['_addAnnotationToArchive'](_0x286d10,_0x10ae7a),this['_pendingThreads']['splice'](this['_pendingThreads']['indexOf'](_0x4c3d62),0x1);}}),this['listenTo'](_0x55ebb0['archivedThreads'],'remove',(_0x2539b9,_0x2f901c)=>{const _0x230b49=_0x50ce3a['config']['get']('collaboration.channelId');if(!_0x230b49||_0x2f901c['channelId']===_0x230b49){if(this['_pendingThreads']['includes'](_0x2f901c))this['_pendingThreads']['splice'](this['_pendingThreads']['indexOf'](_0x2f901c),0x1);else{const _0x3363c8=_0x151495['_threadToController']['get'](_0x2f901c),_0x5b41bd=_0x303111['getByInnerView'](_0x3363c8['view']);this['annotationViews']['remove'](_0x5b41bd['view']),this['stopListening'](_0x5b41bd),this['stopListening'](_0x5b41bd['focusableElements']);}}}),this['listenTo'](_0x303111['collection'],'add',(_0x4f6579,_0x3a4318)=>{this['listenTo'](_0x3a4318,'escape',_0x23d45c);}),this['listenTo'](_0x303111['collection'],'remove',(_0x5d5628,_0x44e044)=>{this['stopListening'](_0x44e044,'escape',_0x23d45c);});}_addAnnotationToArchive(_0x1792e1,_0x531d8f){this['listenTo'](_0x1792e1,'set:isVisible',_0x2da97f=>{_0x2da97f['return']=!0x1,_0x2da97f['stop']();}),this['annotationViews']['add'](_0x1792e1['view'],_0x531d8f);}['_handleNewThread'](_0x63410f){const _0x594943=this['editor']['plugins']['get']('CommentsRepository'),_0x159293=this['editor']['plugins']['get']('Annotations'),_0x420bf7=this['editor']['config']['get']('collaboration.channelId');if(!_0x420bf7||_0x63410f['channelId']===_0x420bf7){const _0x57f954=_0x594943['_threadToController']['get'](_0x63410f);if(!_0x57f954)return void this['_pendingThreads']['push'](_0x63410f);const _0x187528=this['_calculatePosition'](_0x63410f['archivedAt']),_0x447259=_0x159293['getByInnerView'](_0x57f954['view']);_0x447259['isVisible']&&_0x159293['_visibleAnnotations']['remove'](_0x447259),this['_addAnnotationToArchive'](_0x447259,_0x187528);}}_calculatePosition(_0x88ecdf){const _0x3f37b8=this['editor']['config']['get']('collaboration.channelId'),_0x3862b4=[...this['editor']['plugins']['get'](Di)['archivedThreads']]['filter'](_0xdb950c=>_0xdb950c['channelId']===_0x3f37b8)['findIndex'](_0xc75bec=>_0xc75bec['archivedAt']<_0x88ecdf);return _0x3862b4<0x0||_0x3862b4>this['annotationViews']['length']?this['annotationViews']['length']:_0x3862b4-0x1;}_toggleDialog(){const _0x154bf2=this['editor'],_0x21e817=_0x154bf2['plugins']['get']('Dialog');this['commentsArchiveView']||(this['commentsArchiveView']=new Li(_0x154bf2['locale'],this['annotationViews'])),'commentsArchive'===_0x21e817['id']?_0x21e817['hide']():_0x21e817['show']({'id':'commentsArchive','title':Et(_0x154bf2['locale'],'COMMENTS_ARCHIVE'),'icon':_0x32a812,'hasCloseButton':!0x0,'content':this['commentsArchiveView'],'position':_0x5c8bae['EDITOR_TOP_SIDE']});}_createCommentsArchiveButton(_0x2f3b0b,_0x4569a1=!0x1){const _0x36e458=this['editor']['locale'],_0x22a906=this['editor']['plugins']['get']('Dialog'),_0x184ff6=new _0x2f3b0b(_0x36e458);return _0x184ff6['bind']('isEnabled')['to'](this,'isEnabled'),_0x184ff6['bind']('isOn')['to'](_0x22a906,'id',_0x16140c=>'commentsArchive'===_0x16140c),_0x184ff6['set']({'label':Et(_0x36e458,'COMMENTS_ARCHIVE'),'icon':_0x32a812,'isToggleable':!0x0}),_0x4569a1&&(_0x184ff6['tooltip']=!0x0),this['listenTo'](_0x184ff6,'execute',()=>this['_toggleDialog']()),_0x184ff6;}_hideDialogOnAnnotationEscape=_0x5ebbd6=>{const _0x2e8179=_0x5ebbd6['source'];if(!this['annotationViews']['has'](_0x2e8179['view']))return;const _0x341d54=this['editor']['plugins']['get']('Dialog');_0x341d54['isOpen']&&'commentsArchive'===_0x341d54['id']&&(_0x341d54['hide'](),_0x5ebbd6['stop']());};},Bi=class extends _0x53a0a0{static get requires(){return[oi,wi,vi,Di,Vi,yi,Mi,Si,xi];}static get['pluginName'](){return'Comments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{ci as AddCommentThreadCommand,$t as Annotation,Jt as AnnotationCollection,Ri as AnnotationCounterButtonView,qt as AnnotationView,ti as Annotations,Ei as AnnotationsSidebarItemView,Ii as AnnotationsSidebarView,Ti as AnnotationsUIs,Ht as BaseCommentThreadView,Kt as BaseCommentView,hi as Comment,ri as CommentThread,bt as CommentThreadController,xt as CommentThreadInputView,Ut as CommentThreadView,Yt as CommentView,Bi as Comments,Di as CommentsArchive,Vi as CommentsArchiveUI,wi as CommentsEditing,Lt as CommentsListView,yi as CommentsOnly,oi as CommentsRepository,vi as CommentsUI,di as EditorAnnotations,xi as InlineAnnotations,Si as NarrowSidebar,ki as Sidebar,Mi as WideSidebar,Qt as bindAnnotationCollections};
|
|
23
|
+
import{Command as _0x9c035e,Context as _0x238a82,ContextPlugin as _0x183782,Editor as _0x1b6981,PendingActions as _0x429095,Plugin as _0x433bd5}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x4dbbfc,Collection as _0x1e0fc8,DomEmitterMixin as _0x1cdcc3,FocusTracker as _0x51fffd,KeystrokeHandler as _0x5b688d,ObservableMixin as _0x2f2e78,Rect as _0x563bd7,diff as _0x46b151,first as _0x17e6fa,getEnvKeystrokeText as _0x36233f,keyCodes as _0x21e74e,priorities as _0x8f380b,scrollViewportToShowTarget as _0x569cd1,toUnit as _0x48a7e8,uid as _0x3a3689}from'@ckeditor/ckeditor5-utils';import{AriaDescriptionView as _0x4a4e8c,ConfirmMixin as _0x2d0946,FOCUS_ANNOTATION_KEYSTROKE as _0x50afb7,LateFocusButtonView as _0x5082db,LateFocusDropdownButtonView as _0x17c11b,UserView as _0x13828e,Users as _0x27e007,getAllMarkersDomElementsSorted as _0x5f3d7a,getDateTimeFormatter as _0x7e6a23,hashObject as _0x5bfccb,setupThreadKeyboardNavigation as _0x33b12e,surroundingMarkersDetector as _0x28d14d,trimHtml as _0x241cf3}from'@ckeditor/ckeditor5-collaboration-core';import{cloneDeep as _0x344106,debounce as _0x5b7667,isEqual as _0x3173ce,set as _0x25b52c,throttle as _0x4de755,unset as _0xe3924b}from'es-toolkit/compat';import{IconAddComment as _0x1e8488,IconCheck as _0x24dd71,IconCommentsArchive as _0x33ec4f,IconPencil as _0x2890c8,IconRemoveComment as _0x32311a,IconThreeVerticalDots as _0x1e2275,IconUndo as _0x5278f0}from'@ckeditor/ckeditor5-icons';import{BalloonPanelView as _0x1cf306,BodyCollection as _0x2a9375,ButtonView as _0x11e898,ContextualBalloon as _0x1380da,Dialog as _0x308302,DialogViewPosition as _0x388c97,EditorUI as tt,EditorUIView as it,FocusCycler as et,InlineEditableUIView as st,ListItemView as nt,ListView as ot,MenuBarMenuListItemButtonView as rt,View as ht,ViewCollection as at,createDropdown as ct,focusChildOnDropdownOpen as dt}from'@ckeditor/ckeditor5-ui';import{MouseObserver as lt,disableViewPlaceholder as mt,enableViewPlaceholder as ut}from'@ckeditor/ckeditor5-engine';import{Clipboard as ft,ClipboardMarkersUtils as pt,ClipboardPipeline as wt}from'@ckeditor/ckeditor5-clipboard';import{Enter as gt,ShiftEnter as _t}from'@ckeditor/ckeditor5-enter';import{SelectAll as At}from'@ckeditor/ckeditor5-select-all';import{Typing as vt}from'@ckeditor/ckeditor5-typing';import{Undo as yt}from'@ckeditor/ckeditor5-undo';import{Paragraph as Tt}from'@ckeditor/ckeditor5-paragraph';import{toWidget as Ct}from'@ckeditor/ckeditor5-widget';const It=/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x2f2e78();var bt=class extends It{['model'];['view'];constructor(_0x5a0664,_0x550edd){super(),this['model']=_0x5a0664,this['model']['_isAttached']=!0x0,this['view']=_0x550edd,this['listenTo'](_0x550edd,'submitCommentThread',()=>this['submit']()),this['listenTo'](_0x550edd,'removeCommentThread',()=>this['remove']()),this['listenTo'](_0x550edd,'resolveCommentThread',()=>this['resolve']()),this['listenTo'](_0x550edd,'reopenCommentThread',()=>this['reopen']()),this['listenTo'](_0x550edd,'addComment',(_0x18ccc5,_0x152eef)=>this['addComment'](_0x152eef)),this['listenTo'](_0x550edd,'updateComment',(_0x3c82e0,_0x3fcd9c,_0x23bf37)=>this['updateComment'](_0x3fcd9c,_0x23bf37)),this['listenTo'](_0x550edd,'removeComment',(_0x292306,_0x340195)=>this['removeComment'](_0x340195));}submit(){this['model']['submit']();}['remove'](){this['model']['remove']();}['resolve'](){this['model']['isResolved']||this['model']['resolve']();}['reopen'](){this['model']['isResolved']&&this['model']['reopen']();}addComment(_0x3045c4){this['model']['addComment']({'content':_0x3045c4,'authorId':this['view']['_localUser']['id']});}updateComment(_0x33c8c6,_0xa166b4){this['model']['getComment'](_0x33c8c6)['update']({'content':_0xa166b4});}removeComment(_0x5b7415){this['model']['getComment'](_0x5b7415)['remove']();}destroy(){this['stopListening'](),this['model']['_isAttached']=!0x1;}};function Et(_0x2fa30f,_0x5e8c18,_0x47f586){const t=_0x2fa30f['t'];switch(_0x5e8c18){case'PENDING_ACTION_COMMENT_THREAD':return t({'string':'Unsaved\x20change\x20in\x20comment\x20thread.','id':'PENDING_ACTION_COMMENT_THREAD'});case'Comment':return t('Comment');case'Reply...':return t('Reply...');case'Reply\x20to\x20reopen\x20discussion...':return t('Reply\x20to\x20reopen\x20discussion...');case'Write\x20a\x20comment...':return t('Write\x20a\x20comment...');case'Comment\x20was\x20made\x20on\x20an\x20element':return t('Comment\x20was\x20made\x20on\x20an\x20element');case'Comment\x20editor':return t('Comment\x20editor');case'Delete\x20comment\x20thread?':return t('Delete\x20comment\x20thread?');case'Delete\x20comment?':return t('Delete\x20comment?');case'Marked\x20as\x20resolved':return t('Marked\x20as\x20resolved');case'Show\x20more\x20items':return t('Show\x20more\x20items');case'Cancel':return t('Cancel');case'Edit':return t('Edit');case'Resolve':return t('Resolve');case'Reopen':return t('Reopen');case'Remove':return t('Remove');case'Reply':return t('Reply');case'Save':return t('Save');case'Annotations\x20sidebar':return t('Annotations\x20sidebar');case'Annotations\x20list':return t('Annotations\x20list');case'Thread\x20comments':return t('Thread\x20comments');case'THREAD_CONTEXT_LABEL':return t({'string':'Thread\x20context:\x20%0','id':'THREAD_CONTEXT_LABEL'},_0x47f586);case'COMMENT_THREAD_LABEL':return t({'string':'Comment\x20thread\x20by\x20%1.\x20%0\x20reply.','plural':'Comment\x20thread\x20by\x20%1.\x20%0\x20replies.','id':'COMMENT_THREAD_LABEL'},_0x47f586);case'COMMENT_THREAD_DESCRIPTION':return t({'string':'Press\x20Enter\x20for\x20more\x20options.\x20Press\x20Escape\x20to\x20exit.','id':'COMMENT_THREAD_DESCRIPTION'});case'COMMENT_ARIA_LABEL':return t({'string':'Comment\x20by\x20%0.\x20Created\x20on\x20%1.\x20%2.\x20%3','id':'COMMENT_ARIA_LABEL'},_0x47f586);case'LEAVE_COMMENT_ANNOUNCEMENT':return t({'string':'Leaving\x20a\x20content\x20with\x20comments.','id':'LEAVE_COMMENT_ANNOUNCEMENT'});case'ENTER_COMMENT_ANNOUNCEMENT':return t({'string':'Entering\x20a\x20content\x20with\x20comments.\x20Press\x20%0\x20to\x20go\x20to\x20the\x20discussion.','id':'ENTER_COMMENT_ANNOUNCEMENT'},_0x47f586);case'NUMBER_OF_COMMENTS':return t({'string':'%0\x20Comment','plural':'%0\x20Comments','id':'NUMBER_OF_COMMENTS'},_0x47f586);case'TOO_LONG_COMMENT_ALERT':return t({'string':'Comment\x20content\x20is\x20too\x20long.\x20Your\x20comment\x20has\x20%0\x20characters\x20but\x20the\x20limit\x20is\x20%1\x20characters.','id':'TOO_LONG_COMMENT_ALERT'},_0x47f586);case'EXTERNAL_COMMENT':return t({'string':'This\x20comment\x20comes\x20from\x20an\x20external\x20source.','id':'EXTERNAL_COMMENT'});case'EXTERNAL_IMPORT_WORD_COMMENT':return t({'string':'This\x20comment\x20comes\x20from\x20an\x20imported\x20Word\x20file.','id':'EXTERNAL_IMPORT_WORD_COMMENT'});case'EXTERNAL_AVATAR':return t({'string':'Displayed\x20author\x20name\x20comes\x20from\x20external\x20source\x20(added\x20by\x20%0)','id':'EXTERNAL_AVATAR'},_0x47f586);case'EXTERNAL_IMPORT_WORD_AVATAR':return t({'string':'Displayed\x20author\x20name\x20comes\x20from\x20a\x20Word\x20document\x20imported\x20by\x20%0','id':'EXTERNAL_IMPORT_WORD_AVATAR'},_0x47f586);case'COMMENTS_ARCHIVE':return t({'string':'Comments\x20archive','id':'COMMENTS_ARCHIVE'});case'EMPTY_COMMENTS_ARCHIVE':return t({'string':'There\x20are\x20no\x20archived\x20comment\x20threads.','id':'EMPTY_COMMENTS_ARCHIVE'});case'COMMENTS_ARCHIVE_LIST_LABEL':return t({'string':'List\x20of\x20comments','id':'COMMENTS_ARCHIVE_LIST_LABEL'});case'ACCESSIBILITY_HELP_ANNOTATIONS_GROUP':return t({'string':'Keystrokes\x20for\x20interacting\x20with\x20annotation\x20threads\x20(e.g.\x20comments,\x20track\x20changes\x20suggestions)','id':'ACCESSIBILITY_HELP_ANNOTATIONS_GROUP'});case'ACCESSIBILITY_HELP_ANNOTATIONS_MOVE_TO':return t({'string':'Move\x20focus\x20to\x20the\x20thread\x20when\x20the\x20selection\x20is\x20anchored\x20in\x20its\x20marker','id':'ACCESSIBILITY_HELP_ANNOTATIONS_MOVE_TO'});case'ACCESSIBILITY_HELP_ANNOTATIONS_EXIT':return t({'string':'Exit\x20the\x20annotation\x20and\x20move\x20focus\x20back\x20to\x20the\x20edited\x20content','id':'ACCESSIBILITY_HELP_ANNOTATIONS_EXIT'});case'ACCESSIBILITY_HELP_ANNOTATIONS_ENTER':return t({'string':'Browse\x20the\x20focused\x20annotation\x20thread\x20or\x20thread\x20comment','id':'ACCESSIBILITY_HELP_ANNOTATIONS_ENTER'});case'ACCESSIBILITY_HELP_ANNOTATIONS_BROWSE_GROUPS':return t({'string':'Move\x20across\x20internals\x20of\x20the\x20annotation\x20thread','id':'ACCESSIBILITY_HELP_ANNOTATIONS_BROWSE_GROUPS'});case'ACCESSIBILITY_HELP_ANNOTATIONS_SUBMIT_COMMENT':return t({'string':'Submit\x20the\x20reply\x20while\x20writing\x20a\x20comment','id':'ACCESSIBILITY_HELP_ANNOTATIONS_SUBMIT_COMMENT'});case'ACCESSIBILITY_HELP_ANNOTATIONS_NAVIGATE_THREADS':return t({'string':'Move\x20to\x20the\x20previous\x20or\x20next\x20thread\x20in\x20the\x20annotations\x20sidebar\x20or\x20comments\x20archive','id':'ACCESSIBILITY_HELP_ANNOTATIONS_NAVIGATE_THREADS'});default:return'';}}var kt=class extends it{['main'];editable;constructor(_0x25adab,_0x59eebb){super(_0x25adab);const _0x2c1475=_0x3a3689();this['main']=this['createCollection'](),this['editable']=new st(_0x25adab,_0x59eebb,void 0x0,{'label':()=>Et(_0x25adab,'Comment\x20editor')}),this['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-editor','ck-rounded-corners','ck-comment__input'],'dir':_0x25adab['uiLanguageDirection'],'lang':_0x25adab['uiLanguage'],'aria-labelledby':'cke-editor__aria-label_'+_0x2c1475},'children':[{'tag':'div','attributes':{'class':'ck-editor__main','role':'presentation'},'children':this['main']}]});}['render'](){super['render'](),this['main']['add'](this['editable']);}['focus'](){this['editable']['element']['focus']();}},Nt=class extends tt{['view'];constructor(_0x463cbf){super(_0x463cbf),this['view']=new kt(_0x463cbf['locale'],_0x463cbf['editing']['view']);}get element(){return this['view']['element'];}init(){const _0x54cd6d=this['editor']['editing']['view'],_0x288efa=this['view']['editable'];_0x288efa['name']=_0x54cd6d['document']['getRoot']()['rootName'],this['view']['render']();const _0x13bbba=_0x288efa['element'];this['setEditableElement'](_0x288efa['name'],_0x13bbba),this['view']['editable']['bind']('isFocused')['to'](this['focusTracker']),_0x54cd6d['attachDomRoot'](_0x13bbba),this['fire']('ready');}destroy(){super['destroy'](),this['view']['destroy']();}};const Ot=[ft,gt,_t,At,vt,yt,Tt],Mt=/* #__PURE__ -- @preserve */
|
|
25
|
+
_0x2f2e78(_0x1b6981);var Rt=class CommentEditor extends Mt{static defaultPlugins=/* #__PURE__ -- @preserve */
|
|
26
|
+
((()=>Ot)());constructor(_0x4f68e1={}){(_0x4f68e1=Object['assign']({},_0x4f68e1))['plugins']||(_0x4f68e1['plugins']=CommentEditor['defaultPlugins']),super(_0x4f68e1),this['ui']=new Nt(this),this['set']('placeholder',''),this['model']['document']['on']('change',()=>this['_updatePlaceholder'](),{'priority':'low'}),this['on']('change:placeholder',()=>this['_updatePlaceholder']()),this['model']['document']['createRoot'](),this['editing']['view']['_overlayModeHint']='auto',this['_sendUsageRequest']=()=>window['Promise']['resolve']({'status':'ok'});}create(){const _0x2618e6=this['config']['get']('initialData')||'';return this['initPlugins']()['then'](()=>this['ui']['init']())['then'](()=>this['data']['init'](_0x2618e6))['then'](()=>this['fire']('ready'));}destroy(){return super['destroy']()['then'](()=>this['ui']['destroy']());}['focus'](){this['model']['change'](_0x240242=>{const _0x5e7896=this['model']['document']['getRoot'](),_0xfcde65=_0x5e7896&&_0x5e7896['getChild'](_0x5e7896['childCount']-0x1);_0x240242['setSelection'](_0xfcde65,'end'),this['editing']['view']['focus']();});}_updatePlaceholder(){const _0x165517=this['editing']['view'],_0x165be2=_0x165517['document']['getRoot'](),_0x2a7bce=_0x165be2['getChild'](0x0);_0x165be2['childCount']>0x1||!_0x2a7bce||'p'!=_0x2a7bce['name']?this['placeholderElement']&&this['placeholderElement']['placeholder']&&(mt(_0x165517,this['placeholderElement']),this['placeholderElement']=void 0x0):(this['placeholder']&&(_0x2a7bce['placeholder']=this['placeholder']),ut({'view':_0x165517,'element':_0x2a7bce,'keepOnFocus':!0x0}),this['placeholderElement']=_0x2a7bce);}},St=class extends ht{keystrokes;['focusTracker'];['focusables'];['focusCycler'];submitButtonView;cancelButtonView;_editorConfig;constructor(_0x4a100a,_0x18a522={}){super(_0x4a100a),this['editor']=null,this['_editorConfig']=_0x18a522,this['set']('value',_0x18a522['initialData']||''),this['set']('disabledSubmit',!0x1),this['set']('showButtons',!0x0),this['set']('placeholder',Et(_0x4a100a,'Reply...')),this['set']('submitLabel',Et(_0x4a100a,'Reply')),this['submitButtonView']=this['_createSubmitButton'](),this['cancelButtonView']=this['_createCancelButton'](),this['focusables']=this['createCollection']([this['submitButtonView'],this['cancelButtonView']]),this['keystrokes']=new _0x5b688d(),this['focusTracker']=new _0x51fffd(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x4a3424=>!_0x4a3424['defaultPrevented']},'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['setTemplate']({'tag':'div','attributes':{'class':['ck-comment__input-wrapper']},'children':[{'tag':'div','attributes':{'class':['ck-comment__input-actions',this['bindTemplate']['if']('showButtons','ck-comment__input-actions--active')]},'children':[this['submitButtonView'],this['cancelButtonView']]}]}),this['keystrokes']['set']('Esc',(_0x5f2fd1,_0x446860)=>{this['cancelButtonView']['fire']('execute'),_0x446860();}),this['keystrokes']['set']('Ctrl+Enter',(_0x4316df,_0x5867f8)=>{this['submitButtonView']['isEnabled']&&(this['submitButtonView']['fire']('execute'),_0x5867f8());}),this['on']('submit',(_0x41f34b,_0x5add59)=>{_0x5add59['length']>0xfde8?(alert(Et(_0x4a100a,'TOO_LONG_COMMENT_ALERT',[_0x5add59['length'],0xfde8])),_0x41f34b['stop']()):this['editor']['setData']('');},{'priority':'high'});}['render'](){super['render'](),this['_setupKeyboardNavigation']();}createEditor(){return this['editor']||(this['editor']=new Rt(this['_editorConfig']),this['_editorCreationPromise']=this['editor']['create']()['then'](()=>{if(this['_isDestroyed'])return;const _0x5a4f4e=this['editor'];this['element']['insertBefore'](_0x5a4f4e['ui']['element'],this['element']['firstChild']),_0x5a4f4e['model']['document']['on']('change',()=>this['value']=_0x5a4f4e['getData']()),_0x5a4f4e['bind']('placeholder')['to'](this),this['focusables']['add'](_0x5a4f4e['ui']['view'],0x0),this['fire']('editorReady',this['editor']);})),this['_editorCreationPromise'];}['focus'](_0x5b0c39){-0x1===_0x5b0c39?(this['focusCycler']['focusFirst'](),this['focusCycler']['focusLast']()):this['focusCycler']['focusFirst']();}async destroy(){this['_isDestroyed']||(this['_isDestroyed']=!0x0,this['editor']&&(await this['_editorCreationPromise'],await this['editor']['destroy'](),this['fire']('editorDestroyed',this['editor'])),await super['destroy']());}_createSubmitButton(){const {locale:_0x245631}=this,_0xc9895c=new _0x11e898(_0x245631);return _0xc9895c['extendTemplate']({'attributes':{'class':['ck-comment__input-actions--submit']}}),_0xc9895c['withText']=!0x0,_0xc9895c['bind']('label')['to'](this,'submitLabel'),_0xc9895c['on']('execute',()=>{this['fire']('submit',this['value']);}),_0xc9895c['bind']('isEnabled')['to'](this,'value',this,'disabledSubmit',(_0x4fc6f0,_0xc82d2d)=>!_0xc82d2d&&!!_0x4fc6f0['trim']()),_0xc9895c;}_createCancelButton(){const {locale:_0x5ca8bd}=this,_0x4a9360=new _0x11e898(_0x5ca8bd);return _0x4a9360['extendTemplate']({'attributes':{'class':['ck-comment__input-actions--cancel']}}),_0x4a9360['label']=Et(_0x5ca8bd,'Cancel'),_0x4a9360['withText']=!0x0,_0x4a9360['on']('execute',()=>{this['editor']['setData'](''),this['fire']('cancel');}),_0x4a9360;}_setupKeyboardNavigation(){this['keystrokes']['listenTo'](this['element']),this['focusables']['forEach'](_0x1637ab=>{this['focusTracker']['add'](_0x1637ab['element']);}),this['focusables']['on']('change',(_0x291f92,_0x37e886)=>{for(const _0x258b62 of Array['from'](_0x37e886['added'])['reverse']())this['focusTracker']['add'](_0x258b62['element']);});}},xt=class extends ht{constructor(_0x14007f,_0x42d309,_0x5ac3b9){super(_0x14007f),this['commentInputView']=new St(_0x14007f,_0x5ac3b9),this['focusCycler']=this['commentInputView']['focusCycler'],this['commentInputView']['bind']('showButtons')['to'](this['commentInputView']['focusTracker'],'isFocused',this['commentInputView'],'value',(_0x3f581c,_0x4cbb14)=>_0x3f581c||!!_0x4cbb14),this['set']('showInput',!0x1),this['on']('change:showInput',()=>{this['showInput']&&!this['commentInputView']['editor']&&this['commentInputView']['createEditor']();}),this['commentInputView']['delegate']('editorReady')['to'](this),this['commentInputView']['delegate']('editorDestroyed')['to'](this),this['userView']=new _0x13828e(_0x14007f,_0x42d309),this['userView']['extendTemplate']({'attributes':{'class':'ck-thread__user','aria-hidden':!0x0}}),this['commentInputView']['extendTemplate']({'attributes':{'class':'ck-thread__input'}}),this['setTemplate']({'tag':'div','attributes':{'class':['ck-comment__input-container',this['bindTemplate']['if']('showInput','ck-comment__input-container--active')]},'children':[this['userView'],this['commentInputView']]});}['render'](){super['render'](),this['_focusOnNonInteractiveMouseDown']();}destroy(){return this['commentInputView']['destroy']()['then'](()=>super['destroy']());}['focus'](_0x47327){this['commentInputView']['focus'](_0x47327);}_focusOnNonInteractiveMouseDown(){this['listenTo'](this['element'],'mousedown',(_0x8ebe09,_0x5efd4d)=>{const {submitButtonView:_0xcffffd,cancelButtonView:_0x916123,editor:_0x5d40e0}=this['commentInputView'];[_0xcffffd['element'],_0x916123['element'],_0x5d40e0?_0x5d40e0['editing']['view']['getDomRoot']():null]['filter'](_0x30df65=>_0x30df65)['some'](_0x21d3b2=>_0x21d3b2['contains'](_0x5efd4d['target']))||(this['focus'](),_0x5efd4d['preventDefault']());});}},Pt=class extends ht{constructor(_0x5bb79d){super(_0x5bb79d);const _0x22e548=this['bindTemplate'];this['set']('count',void 0x0),this['setTemplate']({'tag':'li','attributes':{'class':'ck-thread__comment-count'},'children':[{'text':_0x22e548['to']('count',_0x121285=>Et(_0x5bb79d,'NUMBER_OF_COMMENTS',_0x121285))}]});}},Lt=class extends ht{commentViews;resolvedCommentView;['focusTracker'];keystrokes;['focusCycler'];['_model'];['_config'];_collapsedCommentsView;constructor(_0xdb5ad,_0x5dc33b,_0x19cd35){super(_0xdb5ad);const _0x5eb0c0=this['bindTemplate'];this['set']('hasDirtyComment',!0x1),this['set']('length',_0x5dc33b['comments']['length']),this['set']('isActive',!0x1),this['_model']=_0x5dc33b,this['_config']=_0x19cd35,this['commentViews']=this['createCollection'](),this['visibleViews']=this['createCollection'](),this['resolvedCommentView']=null,this['focusTracker']=new _0x51fffd(),this['keystrokes']=new _0x5b688d(),this['focusCycler']=new et({'focusables':this['commentViews'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x447740=>this['commentViews']['map'](_0x539244=>_0x539244['element'])['includes'](_0x447740['target'])},'actions':{'focusPrevious':'arrowup','focusNext':'arrowdown'}}),this['_collapsedCommentsView']=new Pt(_0xdb5ad),this['_collapsedCommentsView']['bind']('count')['to'](this,'length',_0x6f670b=>_0x6f670b-this['_config']['maxCommentsWhenCollapsed']);for(const _0x35135a of _0x5dc33b['comments'])this['_handleNewCommentModel'](_0x35135a);this['_handleInfoComment'](),this['listenTo'](_0x5dc33b['comments'],'add',(_0x5ea1c6,_0x32113c)=>{const _0x27b27a=this['_calculatePosition'](_0x32113c);this['length']++,this['_handleNewCommentModel'](_0x32113c,_0x27b27a),this['refreshVisibleViews']();}),this['listenTo'](_0x5dc33b['comments'],'remove',(_0x34c7bb,_0x2c4451)=>{this['length']--,this['_handleRemoveCommentModel'](_0x2c4451),this['refreshVisibleViews']();}),this['listenTo'](_0x5dc33b,'commentUpdated',()=>this['refreshVisibleViews']()),this['listenTo'](_0x5dc33b,'change:isResolved',()=>this['_handleInfoComment']()),this['on']('change:isActive',()=>this['refreshVisibleViews']()),this['on']('change:hasDirtyComment',()=>this['refreshVisibleViews']()),this['setTemplate']({'tag':'ul','attributes':{'class':['ck-thread__comments',_0x5eb0c0['if']('length','ck-hidden',_0x477126=>!_0x477126)],'aria-label':Et(_0xdb5ad,'Thread\x20comments')},'children':this['visibleViews']});}get['_shouldCollapse'](){return this['_model']['weight']>this['_config']['maxThreadTotalWeight']&&!this['isActive']&&!this['hasDirtyComment'];}['render'](){super['render'](),this['refreshVisibleViews'](),this['_setupKeyboardNavigation']();}['focus'](_0x1c3981){-0x1===_0x1c3981?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}destroy(){this['_collapsedCommentsView']['destroy']();for(const _0x563e85 of this['commentViews'])_0x563e85['destroy']();super['destroy']();}['refreshVisibleViews'](){this['_shouldCollapse']?this['_rearrangeCollapse']():this['_rearrangeExpand']();}_handleNewCommentModel(_0x5f5e36,_0x4314c5){const _0x110886=new this['_config']['CommentView'](this['locale'],_0x5f5e36,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig']});_0x110886['viewUid']=_0x5f5e36['id'],_0x110886['delegate']('removeComment')['to'](this),_0x110886['delegate']('updateComment')['to'](this),_0x110886['delegate']('resolveCommentThread')['to'](this),_0x110886['delegate']('editorReady')['to'](this),_0x110886['delegate']('editorDestroyed')['to'](this),this['listenTo'](_0x110886,'change:isEditMode',()=>this['_updateHasDirtyComment']()),this['commentViews']['add'](_0x110886,_0x4314c5);}_calculatePosition(_0x4d49ea){const _0x109a5e=this['_model']['_findOptimalIndex'](_0x4d49ea);return this['resolvedCommentView']?this['resolvedCommentView']['authoredAt']>_0x4d49ea['authoredAt']?_0x109a5e-0x1:_0x109a5e:_0x109a5e-0x1;}_handleInfoComment(){if(this['_model']['resolvedBy']&&this['_model']['resolvedAt']){const _0x28a644={'id':'resolved','author':this['_model']['resolvedBy'],'authoredAt':this['_model']['resolvedAt'],'content':Et(this['locale'],'Marked\x20as\x20resolved'),'attributes':{}};this['resolvedCommentView']=new this['_config']['CommentView'](this['locale'],_0x28a644,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig'],'isSystemComment':!0x0}),this['commentViews']['add'](this['resolvedCommentView'],this['_model']['_findOptimalIndex'](_0x28a644));}else this['resolvedCommentView']&&(this['commentViews']['remove'](this['resolvedCommentView']),this['resolvedCommentView']['destroy'](),this['resolvedCommentView']=null);this['refreshVisibleViews']();}_handleRemoveCommentModel(_0x179143){const _0x21d4d9=this['commentViews']['remove'](_0x179143['id']);this['stopListening'](_0x21d4d9),_0x21d4d9['isEditMode']&&this['_updateHasDirtyComment'](),_0x21d4d9['destroy']();}_updateHasDirtyComment(){this['hasDirtyComment']=Array['from'](this['commentViews'])['some'](_0x252acc=>_0x252acc['isEditMode']);}['_rearrangeCollapse'](){const _0x4a1671=function(_0xa0a3f5){const _0x33dac8=new _0x1e0fc8();for(const _0x230337 of _0xa0a3f5)_0x33dac8['add'](_0x230337);return _0x33dac8;}(this['commentViews']),_0x2dbf7a=this['_collapsedCommentsView']['count'];for(let _0xd13679=0x1;_0xd13679<=_0x2dbf7a;_0xd13679++)_0x4a1671['remove'](0x1);for(const _0x1ceb0e of _0x4a1671)_0x1ceb0e['collapse']();_0x2dbf7a>0x0&&_0x4a1671['add'](this['_collapsedCommentsView'],0x1),Dt(_0x46b151(Array['from'](this['visibleViews']),Array['from'](_0x4a1671)),this['visibleViews'],_0x4a1671);}['_rearrangeExpand'](){Dt(_0x46b151(Array['from'](this['visibleViews']),Array['from'](this['commentViews'])),this['visibleViews'],this['commentViews']);for(const _0x4a1b5b of this['visibleViews'])_0x4a1b5b['expand']();}_setupKeyboardNavigation(){this['commentViews']['forEach'](_0x190a77=>{this['focusTracker']['add'](_0x190a77['element']),this['keystrokes']['listenTo'](_0x190a77['element']);}),this['commentViews']['on']('change',(_0x2cfc64,_0x7cb371)=>{for(const _0x2cd4e3 of _0x7cb371['removed'])this['focusTracker']['remove'](_0x2cd4e3['element']),this['keystrokes']['stopListening'](_0x2cd4e3['element']);for(const _0x2ec20d of Array['from'](_0x7cb371['added'])['reverse']())this['focusTracker']['add'](_0x2ec20d['element']),this['keystrokes']['listenTo'](_0x2ec20d['element']);});}};function Dt(_0x26df4b,_0x5f13e3,_0xc66d70){let _0x520c3c=0x0;for(const _0x4d9ce9 of _0x26df4b)switch(_0x4d9ce9){case'insert':_0x5f13e3['add'](_0xc66d70['get'](_0x520c3c),_0x520c3c),_0x520c3c++;break;case'delete':_0x5f13e3['remove'](_0x520c3c);break;case'equal':_0x520c3c++;}}var Vt=class extends ht{constructor(_0x39526f){super(_0x39526f);const _0x13590c=this['bindTemplate'];this['set']('contextValue',''),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-context__value'],'aria-label':_0x13590c['to']('contextValue',_0x5a1213=>Et(_0x39526f,'THREAD_CONTEXT_LABEL',_0x5a1213)),'tabindex':-0x1},'children':[{'text':_0x13590c['to']('contextValue')}]});}['focus'](){this['element']['focus']();}},Bt=class extends ht{['_model'];reopenButtonView;contextView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];constructor(_0x30f915,_0x2b2b81){super(_0x30f915);const _0x2c222a=this['bindTemplate'];this['_model']=_0x2b2b81,this['reopenButtonView']=this['_createReopenButton'](),this['contextView']=this['_createContextView'](),this['focusables']=this['createCollection']([this['contextView'],this['reopenButtonView']]),this['focusTracker']=new _0x51fffd(),this['keystrokes']=new _0x5b688d(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['bind']('hasContext')['to'](this['_model'],'context',_0x3a76ff=>!!_0x3a76ff),this['bind']('contextValue')['to'](this['_model'],'context',_0x36ebd8=>_0x36ebd8&&_0x36ebd8['value']?this['_trimContextValue'](_0x36ebd8['value']):Et(this['locale'],'Comment\x20was\x20made\x20on\x20an\x20element')),this['setTemplate']({'tag':'div','attributes':{'class':['ck-thread__header']},'children':[{'tag':'div','attributes':{'class':['ck-context-wrapper']},'children':[{'tag':'div','attributes':{'class':['ck-context',_0x2c222a['if']('hasContext','ck-context--quotes')]},'children':[this['contextView']]}]},{'tag':'div','attributes':{'class':['ck-annotation__actions']},'children':[this['reopenButtonView']]}]});}['render'](){super['render'](),this['_attachContextActions'](),this['_setupKeyboardNavigation']();}['focus'](){this['focusCycler']['focusFirst']();}_createReopenButton(){const _0x210c8d=new _0x11e898(this['locale']);return _0x210c8d['label']=Et(this['locale'],'Reopen'),_0x210c8d['tooltip']=Et(this['locale'],'Reopen'),_0x210c8d['icon']=_0x5278f0,_0x210c8d['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x2417a1=>!_0x2417a1),_0x210c8d['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x3ba1c8,_0x523ebc)=>_0x3ba1c8&&_0x523ebc),_0x210c8d['on']('execute',()=>{this['fire']('reopenCommentThread',this['_model']['id']);}),_0x210c8d;}_trimContextValue(_0x18cd29){if(_0x18cd29['length']<0x96)return _0x18cd29;const _0x1b34c2=_0x18cd29['lastIndexOf']('\x20',0x93);return _0x18cd29['substring'](0x0,_0x1b34c2>-0x1?_0x1b34c2:0x93)+'...';}_attachContextActions(){const _0x3a22af=this['element']['querySelector']('.ck-context'),_0x19dbfe=_0x3a22af['querySelector']('.ck-context__value');this['listenTo'](_0x3a22af,'mouseenter',()=>{_0x19dbfe['offsetWidth']<_0x19dbfe['scrollWidth']&&_0x3a22af['classList']['add']('overlay');}),this['listenTo'](_0x3a22af,'mouseleave',()=>{_0x3a22af['classList']['remove']('overlay');});}_setupKeyboardNavigation(){this['keystrokes']['listenTo'](this['element']);for(const _0x2df745 of this['focusables'])this['focusTracker']['add'](_0x2df745['element']),this['keystrokes']['listenTo'](_0x2df745['element']);}_createContextView(){const _0x1c6b62=new Vt(this['locale']);return _0x1c6b62['bind']('contextValue')['to'](this),_0x1c6b62;}},Ht=class extends ht{['_model'];['_config'];commentThreadHeaderView;commentThreadInputView;ariaDescriptionView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];constructor(_0x4bcee1,_0x2e70e2,_0x39df44,_0x2e708e){super(_0x4bcee1),this['set']('isActive',!0x1),this['set']('isDirty',!0x1),this['_model']=_0x2e70e2,this['_localUser']=_0x39df44,this['_config']=_0x2e708e,this['commentThreadHeaderView']=new Bt(_0x4bcee1,_0x2e70e2),this['commentThreadHeaderView']['delegate']('reopenCommentThread')['to'](this),this['ariaDescriptionView']=new _0x4a4e8c(_0x4bcee1,Et(_0x4bcee1,'COMMENT_THREAD_DESCRIPTION')),this['listenTo'](this,'reopenCommentThread',()=>{this['focus']();}),this['commentsListView']=new Lt(_0x4bcee1,_0x2e70e2,Object['assign']({'CommentView':this['_config']['CommentView']},_0x2e708e)),this['commentsListView']['delegate']('removeComment')['to'](this),this['commentsListView']['delegate']('updateComment')['to'](this),this['commentsListView']['delegate']('resolveCommentThread')['to'](this),this['commentsListView']['delegate']('editorReady')['to'](this),this['commentsListView']['delegate']('editorDestroyed')['to'](this),this['commentsListView']['bind']('isActive')['to'](this),this['listenTo'](this,'resolveCommentThread',()=>{this['focus']();}),this['set']('length',this['commentsListView']['length']),this['bind']('length')['to'](this['commentsListView'],'length'),this['commentThreadInputView']=this['_createCommentThreadInputView'](),this['commentThreadInputView']['delegate']('editorReady')['to'](this),this['commentThreadInputView']['delegate']('editorDestroyed')['to'](this),this['on']('removeComment',()=>this['focus']()),this['bind']('isDirty')['to'](this['commentsListView'],'hasDirtyComment',this['commentThreadInputView']['commentInputView'],'value',(_0xc38e22,_0x50ad21)=>_0xc38e22||!!_0x50ad21),this['bind']('isUnlinked')['to'](_0x2e70e2,'unlinkedAt',_0x13856a=>!!_0x13856a);let _0x35237f=null;const _0x43fb98=()=>{const _0x1c7e6f=this['_model']['comments']['first']||null;_0x1c7e6f!==_0x35237f&&(_0x35237f&&this['stopListening'](_0x35237f,'change:content'),_0x35237f=_0x1c7e6f,_0x1c7e6f&&this['listenTo'](_0x1c7e6f,'change:content',_0x43fb98));const _0x2179ed=_0x1c7e6f?_0x1c7e6f['author']['name']:this['_localUser']['name'],_0x565371=_0x1c7e6f?new DOMParser()['parseFromString'](_0x241cf3(_0x1c7e6f['content'],{'limit':this['_config']['maxCommentCharsWhenCollapsed']}),'text/html')['body']['textContent']:'',_0x3c2a7f=Et(this['locale'],'COMMENT_THREAD_LABEL',[this['length'],_0x2179ed]);this['set']('ariaLabel',_0x565371?_0x3c2a7f+'\x20'+_0x565371:_0x3c2a7f);};this['listenTo'](this['_model']['comments'],'change',_0x43fb98),_0x43fb98(),this['focusables']=this['createCollection']([this['commentsListView'],this['commentThreadInputView']]),this['focusTracker']=new _0x51fffd(),this['keystrokes']=new _0x5b688d(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0xf9da25=>_0xf9da25['target']!==this['element']},'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}});}['focus'](){this['element']['focus']();}['render'](){super['render'](),_0x33b12e(this,this['focusables']);}async destroy(){this['isDirty']=!0x1,this['commentsListView']['destroy'](),await this['commentThreadInputView']['destroy'](),super['destroy']();}_createCommentThreadInputView(){const _0x2119da=new xt(this['locale'],this['_localUser'],this['_config']['editorConfig']),_0x408c17=_0x2119da['commentInputView'];return _0x2119da['bind']('showInput')['to'](this,'isActive',this['_model'],'isReadOnly',this['_model'],'canComment',this['_model'],'archivedAt',_0x408c17,'value',(_0x2f0b61,_0x1338d6,_0x2691d8,_0x15d440,_0x656672)=>!!_0x656672||!!_0x15d440&&_0x2691d8&&!_0x1338d6||_0x2f0b61&&_0x2691d8&&!_0x1338d6),_0x408c17['bind']('placeholder')['to'](this,'length',this['_model'],'isResolvable',this['_model'],'isResolved',(_0xec8934,_0x14c67f,_0x3b5fbf)=>{let _0x27e617;return _0x27e617=_0x3b5fbf&&_0x14c67f?'Reply\x20to\x20reopen\x20discussion...':_0xec8934?'Reply...':'Write\x20a\x20comment...',Et(this['locale'],_0x27e617);}),_0x408c17['bind']('submitLabel')['to'](this,'length',_0x2cdb2a=>Et(this['locale'],_0x2cdb2a?'Reply':'Comment')),_0x408c17['on']('submit',(_0x15cfb1,_0x6820d)=>{this['fire']('addComment',_0x6820d),this['_model']['isResolved']&&this['_model']['isResolvable']&&this['fire']('reopenCommentThread',this['_model']['id']),this['_model']['isSubmitted']||this['fire']('submitCommentThread');}),_0x408c17['on']('cancel',()=>{this['focus']();}),_0x408c17['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0x408c17['on']('cancel',_0x343e53=>{0x0==this['length']&&(this['fire']('removeCommentThread'),_0x343e53['stop']());}),this['on']('change:isActive',(_0x434215,_0x52487a,_0x480c1a)=>{_0x480c1a||this['length']||_0x408c17['value']||this['fire']('removeCommentThread');}),_0x2119da;}};const Ft=/* #__PURE__ -- @preserve */
|
|
27
|
+
_0x2d0946(Ht);var Ut=class extends Ft{commentThreadChildren;containerElement;resolveButton;_boundFirstCommentView;constructor(_0x2cbff9,_0x716abe,_0xbe432e,_0x56dc60){super(_0x2cbff9,_0x716abe,_0xbe432e,_0x56dc60),this['commentThreadChildren']=this['createCollection']([this['commentsListView'],this['commentThreadInputView'],this['ariaDescriptionView']]),this['set']('actionIndicator',null),this['containerElement']=null,this['_boundFirstCommentView']=null,this['locale']=_0x2cbff9,this['resolveButton']=this['_createResolveButton'](),this['setTemplate'](this['getTemplate']()),this['on']('change:isActive',(_0x3649b1,_0x1eb2bd,_0x29e4af)=>{_0x29e4af||this['_cancelAllConfirms']();}),this['listenTo'](this['_model'],'change:isReadOnly',(_0x393187,_0x480be4,_0x184cba)=>{_0x184cba&&this['_cancelAllConfirms']();}),this['length']>0x0&&this['_bindFirstCommentView'](),this['listenTo'](this['commentsListView']['commentViews'],'add',()=>{this['_bindFirstCommentView']();});}getTemplate(){const _0x1643d7=this['bindTemplate'];return{'tag':'div','attributes':{'class':['ck','ck-thread','ck-reset_all-excluded','ck-rounded-corners',_0x1643d7['if']('isActive','ck-thread--active'),_0x1643d7['if']('isUnlinked','ck-thread--unlinked'),_0x1643d7['to']('actionIndicator',_0x2a10a6=>_0x2a10a6?'ck-thread--'+_0x2a10a6:'')],'data-thread-id':this['_model']['id'],'tabindex':0x0,'role':'listitem','aria-label':_0x1643d7['to']('ariaLabel'),'aria-describedby':this['ariaDescriptionView']['id']},'children':[{'tag':'div','attributes':{'class':'ck-thread__container'},'children':this['commentThreadChildren']}]};}['render'](){super['render'](),this['containerElement']=this['element']['querySelector']('.ck-thread__container'),this['_model']['on']('change:archivedAt',()=>{this['_updateArchivedThreadHeader']();}),this['_updateArchivedThreadHeader']();}['_cancelAllConfirms'](){this['cancelConfirm']();for(const _0x2d07ed of this['commentsListView']['commentViews'])_0x2d07ed['cancelConfirm']();}_bindFirstCommentView(){const {locale:_0x5565d9}=this,_0x2d55eb=this['commentsListView']['commentViews']['get'](0x0);_0x2d55eb===this['_boundFirstCommentView']||_0x2d55eb['isSystemComment']||(this['_boundFirstCommentView']=_0x2d55eb,this['unbind']('actionIndicator'),this['bind']('actionIndicator')['to'](_0x2d55eb,'actionIndicator',_0x49a246=>'remove'===_0x49a246?'remove':null),_0x2d55eb['placeholder']=Et(_0x5565d9,'Write\x20a\x20comment...'),_0x2d55eb['removeButton']['on']('execute',_0x530fa4=>{_0x530fa4['stop'](),this['showConfirm'](Et(_0x5565d9,'Delete\x20comment\x20thread?'),this['containerElement'])['then'](()=>{this['fire']('removeCommentThread');});},{'priority':'high'}),this['on']('removeConfirm',()=>{_0x2d55eb['focus']();}),_0x2d55eb['actionBar']['add'](this['resolveButton'],0x0),_0x2d55eb['focusables']['add'](this['resolveButton'],0x0));}_createResolveButton(){const _0x4ab8eb=new _0x5082db(this['locale']);return _0x4ab8eb['label']=Et(this['locale'],'Resolve'),_0x4ab8eb['tooltip']=Et(this['locale'],'Resolve'),_0x4ab8eb['icon']=_0x24dd71,_0x4ab8eb['extendTemplate']({'attributes':{'class':'ck-comment--resolve'}}),_0x4ab8eb['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x28cc89=>!_0x28cc89),_0x4ab8eb['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x58407a,_0x51251e)=>_0x58407a&&!_0x51251e),_0x4ab8eb['on']('execute',()=>{this['fire']('resolveCommentThread',this['_model']['id']);}),_0x4ab8eb;}_updateArchivedThreadHeader(){this['_model']['archivedAt']?this['commentThreadChildren']['has'](this['commentThreadHeaderView'])||(this['commentThreadChildren']['add'](this['commentThreadHeaderView'],0x0),this['focusables']['add'](this['commentThreadHeaderView'],0x0)):this['commentThreadChildren']['has'](this['commentThreadHeaderView'])&&(this['commentThreadChildren']['remove'](this['commentThreadHeaderView']),this['focusables']['remove'](this['commentThreadHeaderView']));}},Wt=class extends ht{constructor(_0x3a0201){super(_0x3a0201),this['set']('content',''),this['setTemplate']({'tag':'div','attributes':{'class':['ck-content','ck-comment__content','ck-annotation__content']}});}['render'](){super['render'](),this['on']('change:content',(_0x4b6d34,_0x5d623e,_0x5a558d)=>{this['element']['innerHTML']=_0x5a558d;}),this['element']['innerHTML']=this['content'];}},Kt=class extends ht{['visibleView'];ariaDescriptionView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];['_model'];['_config'];constructor(_0x48391c,_0x3418da,_0x47b82d){super(_0x48391c),this['_model']=_0x3418da,this['_config']=_0x47b82d,this['isSystemComment']=!!this['_config']['isSystemComment'],this['set']('isEditMode',!0x1),this['set']('isCollapsed',!0x0),this['bind']('ariaLabel')['to'](_0x3418da,'content',_0x3418da,'authoredAt',(_0x171f6d,_0x368852)=>Et(_0x48391c,'COMMENT_ARIA_LABEL',[_0x3418da['author']['name'],_0x47b82d['formatDateTime'](_0x368852),new DOMParser()['parseFromString'](_0x171f6d,'text/html')['body']['textContent'],_0x3418da['isExternal']?this['getExternalCommentNote']():''])),this['ariaDescriptionView']=new _0x4a4e8c(_0x48391c,Et(_0x48391c,'COMMENT_THREAD_DESCRIPTION')),this['visibleView']=this['createCollection'](),this['visibleView']['add'](this['_createCommentContentView']()),this['focusables']=new at(),this['focusTracker']=new _0x51fffd(),this['keystrokes']=new _0x5b688d(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x23fbe9=>_0x23fbe9['target']!==this['element']},'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}});}['expand'](){this['isCollapsed']=!0x1;}['collapse'](){this['isEditMode']||(this['isCollapsed']=!0x0);}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['_setupKeyboardNavigation']();}async destroy(){await this['visibleView']['get'](0x0)['destroy'](),super['destroy']();}switchToEditMode(){this['isEditMode']||(this['isEditMode']=!0x0,this['visibleView']['remove'](0x0)['destroy'](),this['visibleView']['add'](this['_createCommentInputView']()));}switchToDisplayMode(){this['isEditMode']&&(this['isEditMode']=!0x1,this['visibleView']['remove'](0x0)['destroy'](),this['visibleView']['add'](this['_createCommentContentView']()));}getExternalCommentNote(){return'importWord'===this['_model']['attributes']['@external']['source']?Et(this['locale'],'EXTERNAL_IMPORT_WORD_COMMENT'):Et(this['locale'],'EXTERNAL_COMMENT');}getUserViewNotificationText(){return this['_model']['isExternal']?'importWord'===this['_model']['attributes']['@external']['source']?Et(this['locale'],'EXTERNAL_IMPORT_WORD_AVATAR',this['_model']['creator']['name']):Et(this['locale'],'EXTERNAL_AVATAR',this['_model']['creator']['name']):null;}_createCommentContentView(){const _0x20038e=new Wt(this['locale']);return _0x20038e['bind']('content')['to'](this['_model'],'content',this,'isCollapsed',(_0x12f9ba,_0x3dd46b)=>_0x3dd46b?_0x241cf3(_0x12f9ba,{'limit':this['_config']['maxCommentCharsWhenCollapsed']}):_0x12f9ba),_0x20038e;}_createCommentInputView(){this['_config']['editorConfig']||(this['_config']['editorConfig']={}),this['_config']['editorConfig']['initialData']=this['_model']['content'];const _0xebaee3=new St(this['locale'],this['_config']['editorConfig']);return _0xebaee3['value']=this['_model']['content'],_0xebaee3['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0xebaee3['submitLabel']=Et(this['locale'],'Save'),_0xebaee3['on']('submit',(_0x1bb248,_0x4a3d1d)=>{this['fire']('updateComment',this['_model']['id'],_0x4a3d1d),this['switchToDisplayMode'](),this['focus']();}),_0xebaee3['on']('cancel',()=>{this['switchToDisplayMode'](),this['focus']();}),_0xebaee3['once']('editorReady',()=>{_0xebaee3['focus']();}),_0xebaee3['createEditor'](),_0xebaee3['delegate']('editorReady')['to'](this),_0xebaee3['delegate']('editorDestroyed')['to'](this),_0xebaee3;}_setupKeyboardNavigation(){const _0x3aa5c4=this['element'];this['keystrokes']['listenTo'](_0x3aa5c4);for(const _0x1210c3 of this['focusables'])this['focusTracker']['add'](_0x1210c3['element']),this['keystrokes']['listenTo'](_0x1210c3['element']);this['focusables']['on']('change',(_0x3f1a71,_0x11824f)=>{for(const _0x25bbad of _0x11824f['removed'])this['focusTracker']['remove'](_0x25bbad['element']),this['keystrokes']['stopListening'](_0x25bbad['element']);for(const _0x33e84d of _0x11824f['added'])this['focusTracker']['add'](_0x33e84d['element']),this['keystrokes']['listenTo'](_0x33e84d['element']);}),this['keystrokes']['set']('enter',(_0x2ce98e,_0x202d80)=>{_0x3aa5c4===_0x2ce98e['target']&&(this['focusCycler']['focusFirst'](),_0x202d80());}),this['keystrokes']['set']('esc',(_0x2deeb7,_0x26c7da)=>{_0x3aa5c4!==_0x2deeb7['target']&&(this['focus'](),_0x26c7da());});}};const Gt=/* #__PURE__ -- @preserve */
|
|
28
|
+
_0x2d0946(Kt);var Yt=class extends Gt{actionBar;['userView'];constructor(_0x1c928c,_0x531b39,_0x1999e1){super(_0x1c928c,_0x531b39,_0x1999e1),this['set']('actionIndicator',null),this['set']('placeholder',Et(_0x1c928c,'Reply...')),this['bind']('authoredAt')['to'](_0x531b39),this['bind']('resolvedAt')['to'](_0x531b39),this['actionBar']=this['createCollection'](),this['isSystemComment']||(this['editButton']=this['_createEditButton'](),this['removeButton']=this['_createRemoveButton'](),this['items']=this['createCollection'](),this['items']['addMany']([this['editButton'],this['removeButton']]),this['dropdown']=this['_createDropdown'](),this['actionBar']['add'](this['dropdown']),this['focusables']['add'](this['dropdown'])),this['userView']=new _0x13828e(_0x1c928c,_0x531b39['author'],this['getUserViewNotificationText']()),this['userView']['extendTemplate']({'attributes':{'class':['ck-comment__user','ck-annotation__user'],'aria-hidden':!0x0}}),this['listenTo'](_0x531b39,'change:isRemovable',()=>this['cancelConfirm']()),this['setTemplate'](this['getTemplate']());}getTemplate(){const _0x51fe17=this['bindTemplate'],_0x54dc88=[{'tag':'div','attributes':{'class':['ck-comment__info','ck-annotation__info']},'children':[{'tag':'span','children':[{'text':this['userView']['name']}],'attributes':{'class':['ck-comment__info-name','ck-annotation__info-name'],'data-cke-tooltip-text':this['userView']['name']}},{'tag':'time','attributes':{'datetime':_0x51fe17['to']('authoredAt'),'class':['ck-comment__info-time','ck-annotation__info-time']},'children':[{'text':_0x51fe17['to']('authoredAt',_0x5e76be=>this['_config']['formatDateTime'](_0x5e76be))}]}]},{'tag':'div','attributes':{'class':['ck-comment__actions','ck-annotation__actions',_0x51fe17['if']('isEditMode','ck-comment__actions--hidden'),_0x51fe17['if']('isEditMode','ck-annotation__actions--hidden')]},'children':this['actionBar']},{'tag':'div','attributes':{'class':['ck-annotation__content-wrapper']},'children':this['visibleView']},this['ariaDescriptionView']];return this['_model']['isExternal']&&_0x54dc88['push']({'tag':'div','attributes':{'class':['ck-comment__external']},'children':[{'text':this['getExternalCommentNote']()}]}),{'tag':'li','attributes':{'class':['ck-comment__wrapper'],'tabindex':-0x1,'aria-label':_0x51fe17['to']('ariaLabel'),'aria-describedby':this['ariaDescriptionView']['id'],'role':'listitem'},'children':[{'tag':'div','attributes':{'class':['ck-comment','ck-annotation',_0x51fe17['if']('isEditMode','ck-comment--edit'),_0x51fe17['if']('isSystemComment','ck-comment--info'),_0x51fe17['to']('actionIndicator',_0x49a06b=>_0x49a06b?'ck-comment--'+_0x49a06b:'')],'data-author-id':this['_model']['author']['id'],'data-comment-id':this['_model']['id'],'role':'group'},'children':[this['userView'],{'tag':'div','attributes':{'class':['ck-comment__main','ck-annotation__main']},'children':_0x54dc88}]}]};}_createEditButton(){const _0x524ad1=new _0x11e898(this['locale']);return _0x524ad1['label']=Et(this['locale'],'Edit'),_0x524ad1['icon']=_0x2890c8,_0x524ad1['withText']=!0x0,_0x524ad1['extendTemplate']({'attributes':{'class':'ck-comment--edit'}}),_0x524ad1['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x1ecc98=>!_0x1ecc98),_0x524ad1['bind']('isVisible')['to'](this['_model'],'isEditable'),_0x524ad1['on']('execute',()=>this['switchToEditMode']()),_0x524ad1;}_createRemoveButton(){const _0x5c2e74=new _0x11e898(this['locale']);return _0x5c2e74['label']=Et(this['locale'],'Remove'),_0x5c2e74['icon']=_0x32311a,_0x5c2e74['withText']=!0x0,_0x5c2e74['extendTemplate']({'attributes':{'class':'ck-comment--remove'}}),_0x5c2e74['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x1fb8a6=>!_0x1fb8a6),_0x5c2e74['bind']('isVisible')['to'](this['_model'],'isRemovable'),_0x5c2e74['on']('execute',()=>{this['showConfirm'](Et(this['locale'],'Delete\x20comment?'),this['element'])['then'](()=>{this['fire']('removeComment',this['_model']['id']);});}),_0x5c2e74;}_createDropdown(){const _0x20cab2=ct(this['locale'],_0x17c11b),_0x62f30e=_0x20cab2['panelView']['children'],_0x211da0=new ot(this['locale']),_0x27dd0c=_0x20cab2['bindTemplate'];dt(_0x20cab2,()=>this['items']['find'](_0x3f1c55=>_0x3f1c55['isVisible'])),_0x20cab2['extendTemplate']({'attributes':{'class':[_0x27dd0c['if']('isVisible','ck-hidden',_0x5efc8c=>!_0x5efc8c)]}});const _0x492b90=(_0x5340c0,_0x172dee=-0x1)=>{const _0x450b3b=new nt(this['locale']);_0x450b3b['children']['add'](_0x5340c0);const _0x48431a=_0x172dee>-0x1?_0x172dee:_0x211da0['items']['length'];_0x211da0['items']['add'](_0x450b3b,_0x48431a);const _0x2f7d49=Array['from'](this['items']);_0x20cab2['unbind']('isEnabled','isVisible'),_0x20cab2['bind']('isEnabled')['toMany'](_0x2f7d49,'isEnabled',(..._0x484bb0)=>_0x484bb0['some'](_0x536396=>_0x536396)),_0x20cab2['bind']('isVisible')['toMany'](_0x2f7d49,'isVisible',(..._0x4bf40b)=>_0x4bf40b['some'](_0x13b0fe=>_0x13b0fe));};_0x20cab2['panelPosition']='sw',_0x20cab2['buttonView']['set']({'label':Et(this['locale'],'Show\x20more\x20items'),'icon':_0x1e2275});for(const _0x1ca16b of this['items'])_0x492b90(_0x1ca16b);return _0x62f30e['add'](_0x211da0),_0x20cab2['listenTo'](this['items'],'add',(_0x31c019,_0x521400,_0x3ac3c3)=>{_0x492b90(_0x521400,_0x3ac3c3);}),_0x20cab2['listenTo'](this['items'],'remove',(_0x2d58bd,_0x3fd140,_0x2bbbfa)=>{_0x211da0['items']['remove'](_0x2bbbfa);}),_0x20cab2;}_attachActions(_0x206ff6,_0x4ed7ae){const _0x4b9ad6=_0x206ff6&&_0x206ff6['element'];_0x4b9ad6&&(this['listenTo'](_0x4b9ad6,'mouseenter',()=>this['actionIndicator']=_0x4ed7ae),this['listenTo'](_0x4b9ad6,'focus',()=>this['actionIndicator']=_0x4ed7ae),this['listenTo'](_0x4b9ad6,'mouseleave',()=>this['actionIndicator']=null),this['listenTo'](_0x4b9ad6,'blur',()=>this['actionIndicator']=null));}_createCommentInputView(){const _0xa52d31=super['_createCommentInputView']();return _0xa52d31['bind']('placeholder')['to'](this),_0xa52d31;}['render'](){super['render'](),this['_attachActions'](this['editButton'],'edit'),this['_attachActions'](this['removeButton'],'remove');}};function Xt(_0x1f02fc){const _0x6b37c6=_0x4de755(_0x1f02fc,0x1e),_0x3e1945=new MutationObserver(_0x581dfa=>{for(const _0x1d0b49 of _0x581dfa)('attributes'==_0x1d0b49['type']&&'class'==_0x1d0b49['attributeName']||'childList'==_0x1d0b49['type']||'characterData'==_0x1d0b49['type'])&&_0x6b37c6();});return{'attach'(_0x18ed38){_0x3e1945['observe'](_0x18ed38,{'attributes':!0x0,'childList':!0x0,'subtree':!0x0,'characterData':!0x0});},'detach'(){_0x3e1945['disconnect'](),_0x6b37c6['cancel']();}};}var qt=class extends ht{['focusTracker'];['id'];keystrokes;content;['mainView'];_mutationObserver;constructor(_0x2fcf7b,_0x40825f){super(_0x2fcf7b),this['id']=_0x3a3689(),this['focusTracker']=new _0x51fffd(),this['keystrokes']=new _0x5b688d(),this['keystrokes']['set']('Esc',(_0x29f33c,_0x30fd3e)=>this['fire']('Esc',_0x30fd3e)),this['set']('targetRect',{'top':0x0,'right':0x0,'bottom':0x0,'left':0x0}),this['set']('height',0x0),this['set']('isActive',!0x1),this['set']('isDirty',!0x1),this['set']('length',0x0),this['set']('type',''),this['_mutationObserver']=Xt(()=>this['_updateHeight']()),this['content']=this['createCollection'](),this['content']['delegate']('arrowup','arrowdown')['to'](this),this['content']['add'](_0x40825f),this['mainView']=_0x40825f;const _0x4e499e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-annotation-wrapper','ck-rounded-corners',_0x4e499e['if']('isActive','ck-annotation-wrapper--active')],'role':'presentation'},'children':this['content']});}['render'](){super['render'](),this['focusTracker']['add'](this['element']),this['keystrokes']['listenTo'](this['element']),this['_mutationObserver']['attach'](this['element']);}destroy(){this['content']['clear'](),this['keystrokes']['destroy'](),this['focusTracker']['destroy'](),this['_mutationObserver']['detach'](),super['destroy']();}['focus'](){this['content']['first']&&this['content']['first']['focus']();}_updateHeight(){const _0x1e1a91=this['element']['clientHeight'];_0x1e1a91&&(this['height']=_0x1e1a91);}};const jt=/* #__PURE__ -- @preserve */
|
|
29
|
+
_0x2f2e78();var $t=class Annotation extends jt{['view'];focusableElements;_type;_target;constructor({view:_0x1c86d8,target:_0x3993e1,type:_0x5cdd67,isVisible:_0x644b63=!0x0}){super(),this['view']=_0x1c86d8,this['view']['element']||this['view']['render'](),this['_type']=_0x5cdd67,this['_target']=_0x3993e1,Annotation['_assertCorrectTarget'](this['_getNormalizedTarget']()),this['focusableElements']=new _0x1e0fc8([this['view']['element']],{'idProperty':'_id'}),this['focusableElements']['on']('add',(_0x342a34,_0x3baf58)=>{this['view']['focusTracker']['add'](_0x3baf58);}),this['focusableElements']['on']('remove',(_0x1448d9,_0x3bbc8e)=>{this['view']['focusTracker']['remove'](_0x3bbc8e);}),this['set']('isVisible',_0x644b63);}get type(){return'function'==typeof this['_type']?this['_type']():this['_type'];}get['innerView'](){return this['view']['mainView'];}get target(){const _0x40f338=this['_getNormalizedTarget']();return Annotation['_assertCorrectTarget'](_0x40f338),_0x40f338;}get targetRect(){const _0x221fb8=this['target'];if(null===_0x221fb8)return null;if(_0x221fb8 instanceof _0x563bd7)return _0x221fb8;const _0x39fb0c=_0x221fb8['filter'](_0x573588=>function(_0xa07862){return!!_0xa07862['offsetParent']||!!_0xa07862['getClientRects']()['item'](0x0);}(_0x573588));return 0x0===_0x39fb0c['length']?null:_0x563bd7['getDomElementRects'](_0x39fb0c[0x0])[0x0];}get isActive(){return this['view']['isActive'];}set isActive(_0x58ffd8){this['view']['isActive']=_0x58ffd8,this['view']['mainView']['isActive']=_0x58ffd8;}updateTargetRect(){this['view']['targetRect']=this['targetRect'];}destroy(){this['focusableElements']['stopListening'](),this['focusableElements']['clear'](),this['stopListening']();}refreshVisibility(){this['isVisible']=!!this['targetRect'];}static _assertCorrectTarget(_0x56c16f){if(!(null===_0x56c16f||_0x56c16f instanceof _0x563bd7||Array['isArray'](_0x56c16f)&&_0x56c16f['every'](_0x50ae89=>zt(_0x50ae89))))throw new _0x4dbbfc('annotation-invalid-target',null,{'target':_0x56c16f});}_getNormalizedTarget(){const _0xbd7d9a='function'==typeof this['_target']?this['_target']():this['_target'];return zt(_0xbd7d9a)?[_0xbd7d9a]:_0xbd7d9a;}};function zt(_0x497e34){return null!==_0x497e34&&'object'==typeof _0x497e34&&'nodeType'in _0x497e34&&0x1===_0x497e34['nodeType'];}var Jt=class extends _0x1e0fc8{_innerViewToAnnotation;_viewToAnnotation;['_focusTracker'];constructor(_0x5ad179=[]){super(),this['_innerViewToAnnotation']=new Map(),this['_viewToAnnotation']=new Map(),this['_focusTracker']=new _0x51fffd(),this['_focusTracker']['on']('change:isFocused',(_0xa29dce,_0x55c067,_0x5d2d36)=>{_0x5d2d36||this['fire']('blur');});for(const _0xad3e8a of _0x5ad179)this['add'](_0xad3e8a);}get['isFocused'](){return this['_focusTracker']['isFocused'];}['add'](_0x1cba36){if(this['has'](_0x1cba36))throw new _0x4dbbfc('annotationcollection-duplicated-item',null);this['_innerViewToAnnotation']['set'](_0x1cba36['innerView'],_0x1cba36),this['_viewToAnnotation']['set'](_0x1cba36['view'],_0x1cba36);for(const _0x286e29 of _0x1cba36['focusableElements'])this['_focusTracker']['add'](_0x286e29);if(this['listenTo'](_0x1cba36['focusableElements'],'add',(_0x4f0088,_0xda5dac)=>{this['_focusTracker']['add'](_0xda5dac);}),this['listenTo'](_0x1cba36['focusableElements'],'remove',(_0x8a0397,_0x4f3640)=>{this['_focusTracker']['remove'](_0x4f3640);}),this['listenTo'](_0x1cba36['view']['focusTracker'],'change:isFocused',(_0x30007d,_0x17f8b9,_0x4ef2f0)=>{_0x4ef2f0&&this['fire']('focus',_0x1cba36);}),_0x1cba36['updateTargetRect'](),this['_areCachedRectsStale']()){for(const _0x456627 of this)_0x456627['updateTargetRect']();}const _0x235c52=this['_getOrderInContent'](_0x1cba36['view']['targetRect']);return super['add'](_0x1cba36,_0x235c52);}['remove'](_0x3975e7){if(!this['has'](_0x3975e7))throw new _0x4dbbfc('annotationcollection-not-existing-item',null);this['stopListening'](_0x3975e7['view']['focusTracker']),this['stopListening'](_0x3975e7['focusableElements']);for(const _0x136eed of _0x3975e7['focusableElements'])this['_focusTracker']['remove'](_0x136eed);return this['_viewToAnnotation']['delete'](_0x3975e7['view']),this['_innerViewToAnnotation']['delete'](_0x3975e7['innerView']),super['remove'](_0x3975e7);}getByInnerView(_0x27cb3e){return this['_innerViewToAnnotation']['get'](_0x27cb3e);}getByView(_0x3edd1f){return this['_viewToAnnotation']['get'](_0x3edd1f);}destroy(){super['clear'](),this['stopListening'](),this['_innerViewToAnnotation']['clear'](),this['_viewToAnnotation']['clear'](),this['_focusTracker']['destroy']();}refreshPositioning(){for(const _0x4a2ffa of this)_0x4a2ffa['updateTargetRect']();this['_sort']();}_sort(){const _0x306263=Array['from'](this)['sort']((_0x197fd8,_0x1f9f72)=>Zt(_0x197fd8['view']['targetRect'],_0x1f9f72['view']['targetRect']));for(let _0x3148b1=_0x306263['length']-0x1;_0x3148b1>0x0;_0x3148b1--){const _0x2c62a1=_0x306263[_0x3148b1];_0x3148b1!==this['getIndex'](_0x2c62a1)&&(this['remove'](_0x2c62a1),this['add'](_0x2c62a1));}}_getOrderInContent(_0x178c0a){let _0x19eddb=0x0;if(!_0x178c0a)return this['length'];for(const _0xa681d5 of this){const _0x504f13=_0xa681d5['view']['targetRect'];if(_0x504f13){if(Zt(_0x178c0a,_0x504f13)<0x0)return _0x19eddb;_0x19eddb++;}}return _0x19eddb;}_areCachedRectsStale(){const _0x57dcea=this['get'](0x0);if(!_0x57dcea)return!0x1;const _0x409a19=_0x57dcea['view']['targetRect'],_0x5bf21a=_0x57dcea['targetRect'];return!(!_0x409a19||!_0x5bf21a)&&(_0x409a19['top']!==_0x5bf21a['top']||_0x409a19['left']!==_0x5bf21a['left']);}};function Qt({source:_0x1d0faf,target:_0x5c4f8e,filter:_0xe16536}){for(const _0x4be856 of _0x1d0faf)_0xe16536(_0x4be856)&&_0x5c4f8e['add'](_0x4be856);_0x5c4f8e['listenTo'](_0x1d0faf,'add',(_0x504921,_0x317a31)=>{_0xe16536(_0x317a31)&&_0x5c4f8e['add'](_0x317a31);}),_0x5c4f8e['listenTo'](_0x1d0faf,'remove',(_0x395b31,_0x3d3493)=>{_0x5c4f8e['has'](_0x3d3493)&&_0x5c4f8e['remove'](_0x3d3493);});}function Zt(_0x3d1346,_0x53f877){if(null===_0x3d1346&&null===_0x53f877)return 0x0;if(null===_0x3d1346)return-0x1;if(null===_0x53f877)return 0x1;const _0x37d4db=_0x3d1346['top']-_0x53f877['top'];return 0x0==_0x37d4db?_0x3d1346['left']-_0x53f877['left']:_0x37d4db;}var ti=class extends _0x183782{collection;_visibleAnnotations;static get['pluginName'](){return'Annotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4ad7b3){if(super(_0x4ad7b3),this['collection']=new Jt(),this['_visibleAnnotations']=new Jt(),this['set']('activeAnnotations',new Set()),this['_bindAnnotationsToVisibleAnnotations'](),_0x4ad7b3 instanceof _0x1b6981){const _0x435971=_0x4ad7b3['locale'];_0x4ad7b3['accessibility']['addKeystrokeInfoGroup']({'id':'annotations','label':Et(_0x435971,'ACCESSIBILITY_HELP_ANNOTATIONS_GROUP'),'keystrokes':[{'label':Et(_0x435971,'ACCESSIBILITY_HELP_ANNOTATIONS_MOVE_TO'),'keystroke':'Ctrl+Shift+E'},{'label':Et(_0x435971,'ACCESSIBILITY_HELP_ANNOTATIONS_EXIT'),'keystroke':'Esc'},{'label':Et(_0x435971,'ACCESSIBILITY_HELP_ANNOTATIONS_ENTER'),'keystroke':'Enter'},{'label':Et(_0x435971,'ACCESSIBILITY_HELP_ANNOTATIONS_BROWSE_GROUPS'),'keystroke':[['Tab'],['Shift+Tab']]},{'label':Et(_0x435971,'ACCESSIBILITY_HELP_ANNOTATIONS_SUBMIT_COMMENT'),'keystroke':['Ctrl+Enter']},{'label':Et(_0x435971,'ACCESSIBILITY_HELP_ANNOTATIONS_NAVIGATE_THREADS'),'keystroke':[['Arrowup'],['Arrowdown']]}]});}this['_setupEnterAnnotationKeystroke'](),this['_setupEscapeAnnotationHandling']();}['add'](_0x36747c){this['collection']['add'](_0x36747c);}['remove'](_0x5839c1){this['collection']['remove'](_0x5839c1),_0x5839c1['destroy']();}refreshVisibility(){for(const _0x599bd7 of this['collection'])_0x599bd7['refreshVisibility']();}refreshPositioning(){this['_visibleAnnotations']['refreshPositioning']();}getByInnerView(_0x3cb8c8){return this['collection']['getByInnerView'](_0x3cb8c8);}deactivateAll(){this['fire']('_deactivateAllAnnotations');}destroy(){for(const _0x44752e of this['collection'])_0x44752e['destroy']();this['_visibleAnnotations']['destroy'](),this['collection']['destroy'](),super['destroy']();}activate(_0x2545fa){this['fire']('_activateAnnotation',_0x2545fa);}createAnnotation(_0x425868){return new $t(_0x425868);}createAnnotationView(_0x18cec7,_0x4f7791){return new qt(_0x18cec7,_0x4f7791);}_addActiveAnnotation(_0x11f687){const _0x443035=new Set(this['activeAnnotations']);_0x443035['add'](_0x11f687),this['activeAnnotations']=_0x443035;}_removeActiveAnnotation(_0x5c0894){const _0x399074=new Set(this['activeAnnotations']);_0x399074['delete'](_0x5c0894),this['activeAnnotations']=_0x399074;}_bindAnnotationsToVisibleAnnotations(){const _0x2e02c7=this['collection'],_0x40e7e7=this['_visibleAnnotations'];function _0x4c5603(_0x26aabc){const _0x1cd29e=_0x26aabc['source'];_0x1cd29e['isVisible']&&!_0x40e7e7['has'](_0x1cd29e)?_0x40e7e7['add'](_0x1cd29e):!_0x1cd29e['isVisible']&&_0x40e7e7['has'](_0x1cd29e)&&_0x40e7e7['remove'](_0x1cd29e),_0x1cd29e['view']['focusTracker']['remove'](_0x1cd29e['view']['element']),_0x1cd29e['view']['focusTracker']['add'](_0x1cd29e['view']['element']);}this['listenTo'](_0x2e02c7,'add',(_0xefa92b,_0x145fad)=>{_0x145fad['isVisible']&&_0x40e7e7['add'](_0x145fad),this['listenTo'](_0x145fad,'change:isVisible',_0x4c5603);}),this['listenTo'](_0x2e02c7,'remove',(_0x32ecef,_0x148091)=>{_0x40e7e7['has'](_0x148091)&&_0x40e7e7['remove'](_0x148091),this['stopListening'](_0x148091,'change:isVisible',_0x4c5603);});}_setupEnterAnnotationKeystroke(){const _0x5383bc=_0x444efb=>{_0x444efb['on']('ready',()=>{_0x444efb['keystrokes']['set'](_0x50afb7,(_0x2d1f4b,_0x26e5b8)=>{const _0x2df64c=_0x17e6fa(this['activeAnnotations']['values']());_0x2df64c&&(_0x2df64c['view']['focus'](),_0x26e5b8());});});};this['context']instanceof _0x1b6981?_0x5383bc(this['context']):this['context']['editors']&&this['context']['editors']['on']('add',(_0xeb861,_0x5f1a90)=>{_0x5383bc(_0x5f1a90);});}_setupEscapeAnnotationHandling(){const _0x2c74cf=_0x187f92=>{const _0x3bc434=_0x187f92['source'],_0x5c45d3=[];let _0x19e0e0;if(Array['isArray'](_0x3bc434['target'])){_0x19e0e0=_0x3bc434['target'][0x0],this['context']instanceof _0x1b6981?_0x5c45d3['push'](this['context']):this['context']['editors']&&_0x5c45d3['push'](...this['context']['editors']);for(const _0x1b3036 of _0x5c45d3)for(const _0x4b77a8 of _0x1b3036['editing']['view']['domRoots']['values']())if(_0x4b77a8['contains'](_0x19e0e0))return void _0x1b3036['editing']['view']['focus']();_0x19e0e0['focus']();}};this['listenTo'](this['collection'],'add',(_0x3edc60,_0x779adb)=>{this['listenTo'](_0x779adb,'escape',_0x2c74cf,{'priority':'low'});}),this['listenTo'](this['collection'],'remove',(_0x2ea5af,_0x39bef3)=>{this['stopListening'](_0x39bef3,'escape',_0x2c74cf);});}};const ii=Symbol('noChannel'),ei={'admin':!0x0,'modifyAll':!0x1,'write':!0x0,'resolve':!0x0},si=/* #__PURE__ -- @preserve */
|
|
30
|
+
_0x2f2e78(),ni=/* #__PURE__ -- @preserve */
|
|
31
|
+
_0x2f2e78();var oi=class extends _0x183782{_threads;_threadToController;_viewToController;static get requires(){return[ti,_0x429095,_0x27e007];}static get['pluginName'](){return'CommentsRepository';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3d3628){super(_0x3d3628),this['_threads']=new Map(),this['_threadToController']=new Map(),this['_viewToController']=new Map(),this['set']('_readOnlyChannels',new Set()),this['set']('_permissions',new Map());const _0x1b54cc=this['context']['config'];_0x1b54cc['define']('comments.maxCommentsWhenCollapsed',0x2),_0x1b54cc['define']('comments.maxThreadTotalWeight',0x1f4),_0x1b54cc['define']('comments.maxCommentCharsWhenCollapsed',0x8c),_0x1b54cc['define']('comments.CommentThreadView',Ut),_0x1b54cc['define']('comments.CommentView',Yt),_0x1b54cc['get']('comments.editorConfig')||console['warn']('Missing\x20comments\x20editor\x20configuration\x20(`comments.editorConfig`).\x20Default\x20configuration\x20will\x20be\x20used\x20instead.');}init(){const _0x2d3b57=this['context']['plugins']['get'](ti);this['set']('activeCommentThread',null),this['on']('addCommentThread',(_0x39398a,_0x10dbab)=>this['_addCommentThread'](_0x10dbab)),this['on']('submitCommentThread',(_0x3596f1,_0xeb80f4)=>this['_submitCommentThread'](_0xeb80f4)),this['on']('resolveCommentThread',(_0x3198ca,_0xb4dd2c)=>this['_resolveCommentThread'](_0xb4dd2c)),this['on']('resolveCommentThread',(_0xae2d8f,_0x7d28fd)=>this['_updateActiveAnnotation'](_0x7d28fd),{'priority':'lowest'}),this['on']('reopenCommentThread',(_0x4c75bf,_0x55c40f)=>this['_reopenCommentThread'](_0x55c40f)),this['on']('reopenCommentThread',(_0x498233,_0x54e6cd)=>this['_updateActiveAnnotation'](_0x54e6cd),{'priority':'lowest'}),this['on']('removeCommentThread',(_0x31c77f,_0x34ca31)=>this['_removeCommentThread'](_0x34ca31)),this['on']('updateCommentThread',(_0xe22f62,_0xe344e5)=>this['_updateCommentThread'](_0xe344e5)),this['on']('updateCommentThread',(_0x1c9ff1,_0x4f36df)=>this['_updateActiveAnnotation'](_0x4f36df),{'priority':'lowest'}),this['on']('addComment',(_0x54634e,_0x5105e4)=>this['_addComment'](_0x5105e4)),this['on']('updateComment',(_0x479bb6,_0x11600d)=>this['_updateComment'](_0x11600d)),this['on']('removeComment',(_0x340bdb,_0x3e4403)=>this['_removeComment'](_0x3e4403)),this['on']('addComment',(_0xc421ec,{threadId:_0x1dcb56,isFromAdapter:_0x21fbcf})=>{if(_0x21fbcf)return;const _0x283aa4=this['getCommentThread'](_0x1dcb56),_0x3fa732=_0x283aa4&&this['_threadToController']['get'](_0x283aa4);_0x3fa732&&_0x3fa732['view']['commentsListView']['focus'](-0x1);},{'priority':'lowest'}),this['listenTo'](_0x2d3b57,'change:activeAnnotations',(_0x262e2e,_0x4ea59b,_0x40c6f7)=>{const _0x4b884a=Array['from'](_0x40c6f7)['map'](_0x4d6311=>this['_viewToController']['get'](_0x4d6311['innerView']))['filter'](Boolean)[0x0];this['activeCommentThread']=_0x4b884a?_0x4b884a['model']:null;});}set adapter(_0x469135){if(this['_adapter'])throw new _0x4dbbfc('commentsrepository-adapter-already-set');this['_adapter']=_0x469135;}get adapter(){return this['_adapter'];}addCommentThread({channelId:_0x491b94=ii,threadId:_0x54a047=_0x3a3689(),comments:_0x125cb6=[],unlinkedAt:_0x2335ba=null,resolvedAt:_0x5d7b07=null,resolvedBy:_0x44948d=null,target:_0x1c379f=null,context:_0xeca590=null,attributes:_0x25cdc1={},isResolvable:_0x577a3b=!0x0,isSubmitted:_0x3dd902=!0x1,isFromAdapter:_0x3c2bca=!0x1}={}){return this['fire'](ai('addCommentThread',_0x491b94),{'channelId':_0x491b94,'threadId':_0x54a047,'comments':_0x125cb6,'unlinkedAt':_0x2335ba,'resolvedAt':_0x5d7b07,'resolvedBy':_0x44948d,'target':_0x1c379f,'context':_0xeca590,'attributes':_0x25cdc1,'isFromAdapter':_0x3c2bca,'isResolvable':_0x577a3b,'isSubmitted':_0x3dd902}),this['getCommentThread'](_0x54a047);}openNewCommentThread({channelId:_0x201059=ii,threadId:_0x3be382=_0x3a3689(),target:_0x4ebe39,context:_0x56b263=null,isResolvable:_0xfa0083=!0x0}){if(this['_readOnlyChannels']['has'](_0x201059)||this['_readOnlyChannels']['has'](void 0x0))return null;if(!_0x4ebe39)throw new _0x4dbbfc('commentsrepository-missing-target');const _0x11a2b2=this['addCommentThread']({'channelId':_0x201059,'threadId':_0x3be382,'target':_0x4ebe39,'context':_0x56b263,'isResolvable':_0xfa0083});if(!_0x11a2b2)return null;const _0x536361=this['_threadToController']['get'](_0x11a2b2),_0x2dfd1f=_0x536361['view']['commentThreadInputView']['commentInputView'],_0x1f0a57=this['context']['plugins']['get'](ti),_0x3608c1=_0x1f0a57['getByInnerView'](_0x536361['view']);return _0x1f0a57['activate'](_0x3608c1),_0x2dfd1f['once']('editorReady',()=>_0x2dfd1f['focus']()),_0x11a2b2;}hasCommentThread(_0xd70436){if('string'!=typeof _0xd70436)throw new _0x4dbbfc('commentsrepository-invalid-comment-thread-id');return this['_threads']['has'](_0xd70436);}updateCommentThread({channelId:_0x183a13=ii,threadId:_0x5ddea3,context:_0x153162,unlinkedAt:_0x4eaad7,attributes:_0x1f6897,isFromAdapter:_0x1c0625=!0x1}){return this['fire'](ai('updateCommentThread',_0x183a13),{'channelId':_0x183a13,'threadId':_0x5ddea3,'context':_0x153162,'unlinkedAt':_0x4eaad7,'attributes':_0x1f6897,'isFromAdapter':_0x1c0625}),this['getCommentThread'](_0x5ddea3);}getCommentThread(_0x113208){if('string'!=typeof _0x113208)throw new _0x4dbbfc('commentsrepository-invalid-comment-thread-id');return this['_threads']['get'](_0x113208);}fetchCommentThread({channelId:_0x498a37,threadId:_0x501377}={}){const _0x1cb8e1=this['getCommentThread'](_0x501377);if(_0x1cb8e1)return Promise['resolve'](_0x1cb8e1);if(!this['adapter'])return Promise['resolve'](void 0x0);if('function'!=typeof this['adapter']['getCommentThread'])throw new _0x4dbbfc('commentsrepository-missing-thread-and-adapter-method',this['context']);return this['adapter']['getCommentThread']({'channelId':_0x498a37,'threadId':_0x501377})['then'](_0x1a2a4b=>this['hasCommentThread'](_0x501377)?this['getCommentThread'](_0x501377):_0x1a2a4b?this['addCommentThread'](Object['assign']({'isFromAdapter':!0x0,'channelId':_0x498a37},_0x1a2a4b)):void 0x0)['catch'](_0x29eb4f=>{throw console['error'](_0x29eb4f),new _0x4dbbfc('commentsrepository-fetch-comment-thread',this['context']);});}getCommentThreads({channelId:_0x1953ac,skipNotAttached:_0x3998a7=!0x1,skipEmpty:_0x452470=!0x1,toJSON:_0x26c99c=!0x1}={}){const _0x4ad901=[];for(const _0xf9a0a7 of this['_threads']['values']())_0x1953ac&&_0xf9a0a7['channelId']!==_0x1953ac||_0x3998a7&&!_0xf9a0a7['isAttached']||_0x452470&&0x0===_0xf9a0a7['length']||_0x4ad901['push'](_0xf9a0a7);return _0x26c99c?_0x4ad901['map'](_0x4426f1=>_0x4426f1['toJSON']()):_0x4ad901;}getAnnotationForCommentThread(_0x5225f9){const _0x266612=this['_threadToController']['get'](_0x5225f9);return _0x266612&&this['context']['plugins']['get'](ti)['getByInnerView'](_0x266612['view'])||null;}getCommentThreadForAnnotation(_0x366ab8){const _0xfaa9e7=this['_viewToController']['get'](_0x366ab8['innerView']);return _0xfaa9e7?_0xfaa9e7['model']:null;}setActiveCommentThread(_0x402371){const _0xc63f57=this['context']['plugins']['get'](ti);if(!_0x402371)return void(this['activeCommentThread']&&_0xc63f57['deactivateAll']());const _0x29fcbc=this['getCommentThread'](_0x402371);if(!_0x29fcbc)throw new _0x4dbbfc('commentsrepository-active-missing-comment-thread',null,{'threadId':_0x402371});if(!this['_threadToController']['has'](_0x29fcbc))throw new _0x4dbbfc('commentsrepository-active-not-attached',null,{'threadId':_0x402371});const _0x5f36fe=_0xc63f57['getByInnerView'](this['_threadToController']['get'](_0x29fcbc)['view']);_0xc63f57['activate'](_0x5f36fe);}switchReadOnly(_0x58dfab,_0x5b43a2){_0x58dfab?this['_readOnlyChannels']['add'](_0x5b43a2):this['_readOnlyChannels']['delete'](_0x5b43a2),this['fire']('change:_readOnlyChannels','_readOnlyChannels',this['_readOnlyChannels'],this['_readOnlyChannels']);}['isReadOnly'](_0x5d08d5){return this['_readOnlyChannels']['has'](_0x5d08d5)||this['_readOnlyChannels']['has'](void 0x0);}createCommentThreadController(_0x1cd933,_0x444aa5){return new bt(_0x1cd933,_0x444aa5);}setPermissions(_0x43f10f,_0x199f3e=ii){this['_permissions']['set'](_0x199f3e,_0x43f10f),this['fire']('change:_permissions','_permissions',this['_permissions'],this['_permissions']);}getPermissions(_0x15c8b1=ii){return this['_permissions']['has'](_0x15c8b1)?this['_permissions']['get'](_0x15c8b1):ei;}_addCommentThread({channelId:_0x391432,threadId:_0x57188f,comments:_0xe984ab,unlinkedAt:_0x1e7045,resolvedAt:_0xd04dd4,resolvedBy:_0x52669d,target:_0x738ae,context:_0x40940b,attributes:_0x447ca6,isFromAdapter:_0x541bf3,isResolvable:_0x51cc7a,isSubmitted:_0x31da9e}){if('string'!=typeof _0x57188f)throw new _0x4dbbfc('commentsrepository-invalid-comment-thread-id',null,{'threadId':_0x57188f});if(this['hasCommentThread'](_0x57188f))throw new _0x4dbbfc('commentsrepository-duplicated-comment-thread-id',null,{'threadId':_0x57188f});const _0x461aed=new ri(this,{'channelId':_0x391432,'id':_0x57188f,'context':_0x40940b,'attributes':_0x447ca6,'unlinkedAt':_0x1e7045,'resolvedAt':_0xd04dd4,'resolvedBy':_0x52669d?this['context']['plugins']['get'](_0x27e007)['getUser'](_0x52669d):null,'isResolvable':_0x51cc7a,'isSubmitted':_0x31da9e||_0x541bf3});this['_threads']['set'](_0x57188f,_0x461aed);for(const _0x4badad of _0xe984ab)_0x461aed['_add'](this['_createNewComment']({'threadId':_0x57188f,..._0x4badad}));return _0x738ae&&_0x461aed['attachTo'](_0x738ae),_0x541bf3||!_0x461aed['length']?Promise['resolve']():this['_submitCommentThread']({'channelId':_0x391432,'threadId':_0x57188f});}_submitCommentThread({channelId:_0x3a72e4,threadId:_0x39bc2c}){if(!this['hasCommentThread'](_0x39bc2c))throw new _0x4dbbfc('commentsrepository-missing-comment-thread',this);const _0x105f28=this['getCommentThread'](_0x39bc2c);if(_0x105f28['_isSubmitted']=!0x0,!this['adapter']||'function'!=typeof this['adapter']['addCommentThread'])return Promise['resolve']();const {id:_0x3c6c3f,comments:_0x5c5386,resolvedAt:_0x2adacb,resolvedBy:_0x95136b,context:_0xc46e1c,attributes:_0xb68668}=_0x105f28,_0x1dc783=this['context']['plugins']['get']('PendingActions'),_0x1fca4d=_0x1dc783['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['addCommentThread']({'channelId':_0x3a72e4,'threadId':_0x3c6c3f,'comments':_0x5c5386['map'](_0x195624=>_0x195624['toJSON']()),'resolvedAt':_0x2adacb,'resolvedBy':_0x95136b?_0x95136b['id']:_0x95136b,'context':_0xc46e1c,'attributes':_0xb68668})['then'](({comments:_0x535749})=>{_0x1dc783['remove'](_0x1fca4d);for(const _0x23a385 of _0x535749)this['_updateComment']({'channelId':_0x3a72e4,'threadId':_0x39bc2c,'commentId':_0x23a385['commentId'],'createdAt':_0x23a385['createdAt'],'isFromAdapter':!0x0});})['catch'](_0x2fb430=>{throw console['error'](_0x2fb430),new _0x4dbbfc('commentsrepository-add-comment-thread-internal-error',this);});}_attachCommentThread({threadId:_0xb0e76f,target:_0x5541c9}){const _0xcd2dc0=this['getCommentThread'](_0xb0e76f);if(!_0xcd2dc0)throw new _0x4dbbfc('commentsrepository-attach-missing-comment-thread',this);const _0x4f4a15=this['context']['plugins']['get']('PendingActions'),_0x300174=this['context']['plugins']['get'](ti),_0x112ec1=this['_createCommentThreadView'](_0xcd2dc0),_0x4f4cc0=new bt(_0xcd2dc0,_0x112ec1);let _0x114fe6=null;_0x112ec1['on']('change:isDirty',(_0x4f3cd3,_0x363602,_0x3d384b)=>{_0x3d384b?_0x114fe6=_0x4f4a15['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD')):_0x114fe6&&(_0x4f4a15['remove'](_0x114fe6),_0x114fe6=null);}),this['_threadToController']['set'](_0xcd2dc0,_0x4f4cc0),this['_viewToController']['set'](_0x112ec1,_0x4f4cc0);const _0x5a5d23=new qt(this['context']['locale'],_0x112ec1);_0x5a5d23['bind']('length')['to'](_0x112ec1),_0x5a5d23['bind']('isDirty')['to'](_0x112ec1,'isDirty',_0x112ec1,'length',(_0x186197,_0x515ec3)=>_0x186197||!_0x515ec3),_0x5a5d23['bind']('isActive')['to'](_0x112ec1),_0x5a5d23['type']='comment';const _0x652fe3=new $t({'view':_0x5a5d23,'target':_0x5541c9,'type':'comment','isVisible':!_0xcd2dc0['archivedAt']&&!!('function'==typeof _0x5541c9?_0x5541c9():_0x5541c9)});return _0x112ec1['on']('escape',()=>{_0x652fe3['fire']('escape');}),this['_bindAnnotationToEditors'](_0x112ec1,_0x652fe3),_0x300174['add'](_0x652fe3),_0x652fe3;}_bindAnnotationToEditors(_0x512a1f,_0x1b5088){this['listenTo'](_0x512a1f,'editorReady',(_0x3c67da,_0x126b58)=>{const _0x42d330=_0x126b58['ui']['view']['body']['bodyCollectionContainer'];_0x1b5088['focusableElements']['add'](_0x42d330),this['context']instanceof _0x1b6981&&this['context']['ui']['focusTracker']['add'](_0x42d330);},{'priority':'highest'}),this['listenTo'](_0x512a1f,'editorDestroyed',(_0x15ac90,_0x1d5cbe)=>{const _0x11ed33=_0x1d5cbe['ui']['view']['body']['bodyCollectionContainer'];_0x1b5088['focusableElements']['has'](_0x11ed33)&&_0x1b5088['focusableElements']['remove'](_0x11ed33),this['context']instanceof _0x1b6981&&this['context']['ui']['focusTracker']['remove'](_0x11ed33);});}_unbindEditors(_0x99acb1){this['stopListening'](_0x99acb1,'editorReady'),this['stopListening'](_0x99acb1,'editorDestroyed');}_createCommentThreadView(_0x5b1a23){const _0x25c8cd=this['context']['plugins']['get'](_0x27e007),{config:_0x41f4bb,locale:_0x5eebe0}=this['context'],_0x5e950f=_0x7e6a23(_0x41f4bb['get']('locale'),_0x5eebe0);return new(0x0,(_0x41f4bb['get']('comments'))['CommentThreadView'])(_0x5eebe0,_0x5b1a23,_0x25c8cd['me'],{'editorConfig':{..._0x41f4bb['get']('comments.editorConfig'),'licenseKey':this['context']['config']['get']('licenseKey')},'copyMarkers':_0x41f4bb['get']('comments.copyMarkers'),'maxCommentsWhenCollapsed':_0x41f4bb['get']('comments.maxCommentsWhenCollapsed'),'maxThreadTotalWeight':_0x41f4bb['get']('comments.maxThreadTotalWeight'),'maxCommentCharsWhenCollapsed':_0x41f4bb['get']('comments.maxCommentCharsWhenCollapsed'),'formatDateTime':_0x5e950f,'CommentView':_0x41f4bb['get']('comments')['CommentView']});}_resolveCommentThread({threadId:_0x21bd62,channelId:_0x30dec0,resolvedAt:_0x50d3ff,resolvedBy:_0x4e9c8b,isFromAdapter:_0xd5e07}){if(!this['hasCommentThread'](_0x21bd62))throw new _0x4dbbfc('commentsrepository-missing-comment-thread',null,{'threadId':_0x21bd62});const _0x50d80d=this['getCommentThread'](_0x21bd62);if(_0x50d80d['isResolved'])throw new _0x4dbbfc('commentsrepository-resolved-comment-thread',null,{'threadId':_0x21bd62});const _0x24fc0d=this['context']['plugins']['get'](_0x27e007);if(_0x50d80d['resolvedBy']=_0x24fc0d['getUser'](_0x4e9c8b),_0x50d80d['resolvedAt']=_0x50d3ff,_0xd5e07||!this['adapter']||'function'!=typeof this['adapter']['resolveCommentThread'])return Promise['resolve']();const _0x2a5f43=this['context']['plugins']['get']('PendingActions'),_0x2e8ace=_0x2a5f43['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['resolveCommentThread']({'channelId':_0x30dec0,'threadId':_0x21bd62})['then'](({resolvedAt:_0x3293c7,resolvedBy:_0x21ecbe})=>{_0x2a5f43['remove'](_0x2e8ace),_0x50d80d['resolvedBy']['id']!==_0x21ecbe&&(_0x50d80d['resolvedBy']=_0x24fc0d['getUser'](_0x21ecbe)),_0x50d80d['resolvedAt']=_0x3293c7;})['catch'](_0x495db8=>{throw console['error'](_0x495db8),new _0x4dbbfc('commentsrepository-resolve-comment-thread-internal-error',this);});}_reopenCommentThread({threadId:_0x1cb884,channelId:_0x73024a,isFromAdapter:_0x4a0a8c}){if(!this['hasCommentThread'](_0x1cb884))throw new _0x4dbbfc('commentsrepository-missing-comment-thread',null,{'threadId':_0x1cb884});const _0x4b7c00=this['getCommentThread'](_0x1cb884);if(!_0x4b7c00['isResolved'])throw new _0x4dbbfc('commentsrepository-reopen-comment-thread',null,{'threadId':_0x1cb884});if(_0x4b7c00['resolvedBy']=null,_0x4b7c00['resolvedAt']=null,_0x4a0a8c||!this['adapter']||'function'!=typeof this['adapter']['reopenCommentThread'])return Promise['resolve']();const _0x30e5f4=this['context']['plugins']['get']('PendingActions'),_0x37ac96=_0x30e5f4['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['reopenCommentThread']({'channelId':_0x73024a,'threadId':_0x1cb884})['then'](()=>_0x30e5f4['remove'](_0x37ac96))['catch'](_0xca1258=>{throw console['error'](_0xca1258),new _0x4dbbfc('commentsrepository-reopen-comment-thread-internal-error',this);});}_removeCommentThread({threadId:_0x10c2be,isFromAdapter:_0x3d654c}){const _0x5d6c84=this['getCommentThread'](_0x10c2be);if(!_0x5d6c84)throw new _0x4dbbfc('commentsrepository-remove-missing-comment-thread',this);if(this['_detachCommentThread'](_0x10c2be),this['_threads']['delete'](_0x10c2be),!_0x5d6c84['isSubmitted']||_0x3d654c||!this['adapter']||'function'!=typeof this['adapter']['removeCommentThread'])return Promise['resolve']();const _0x4bfbdc=this['context']['plugins']['get']('PendingActions'),{channelId:_0x130093}=_0x5d6c84,_0x198ab3=_0x4bfbdc['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['removeCommentThread']({'channelId':_0x130093,'threadId':_0x10c2be})['then'](()=>_0x4bfbdc['remove'](_0x198ab3))['catch'](_0x314fb9=>{throw console['error'](_0x314fb9),new _0x4dbbfc('commentsrepository-remove-comment-thread-internal-error',this);});}_updateCommentThread({threadId:_0x56567c,unlinkedAt:_0x59b215,context:_0x4531e1,attributes:_0x51d50a,isFromAdapter:_0x4b381b}){if('string'!=typeof _0x56567c)throw new _0x4dbbfc('commentsrepository-invalid-comment-thread-id',null,{'threadId':_0x56567c});if(!this['hasCommentThread'](_0x56567c))throw new _0x4dbbfc('commentsrepository-missing-comment-thread',null,{'threadId':_0x56567c});const _0x1e9129=this['getCommentThread'](_0x56567c);let _0x4272cf=!0x1;if(void 0x0!==_0x4531e1&&_0x1e9129['context']!==_0x4531e1&&(_0x1e9129['context']=_0x4531e1,_0x4272cf=!0x0),void 0x0!==_0x59b215&&_0x1e9129['unlinkedAt']!==_0x59b215&&(_0x1e9129['unlinkedAt']=_0x59b215,_0x4272cf=!0x0),_0x51d50a&&!_0x3173ce(_0x51d50a,_0x1e9129['attributes'])&&(_0x1e9129['attributes']=_0x51d50a,_0x4272cf=!0x0),!_0x4272cf)return Promise['resolve']();if(!_0x1e9129['isSubmitted']||_0x4b381b||!this['adapter']||'function'!=typeof this['adapter']['updateCommentThread'])return Promise['resolve']();const _0x2e3295=this['context']['plugins']['get']('PendingActions'),{channelId:_0x575463}=_0x1e9129,_0xf26de7=_0x2e3295['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['updateCommentThread']({'channelId':_0x575463,'threadId':_0x56567c,'context':_0x4531e1,'unlinkedAt':_0x59b215,'attributes':_0x51d50a})['then'](()=>_0x2e3295['remove'](_0xf26de7))['catch'](_0x38db31=>{throw console['error'](_0x38db31),new _0x4dbbfc('commentsrepository-update-comment-thread-internal-error',this);});}_detachCommentThread(_0x4a88eb){const _0xc0612d=this['context']['plugins']['get'](ti),_0x216b28=this['getCommentThread'](_0x4a88eb);if(_0x216b28['_isAttached']=!0x1,this['_threadToController']['has'](_0x216b28)){const _0x1a4707=this['_threadToController']['get'](_0x216b28),_0xdf1e08=_0x1a4707['view'],_0x1b91ea=_0xc0612d['getByInnerView'](_0xdf1e08);this['_threadToController']['delete'](_0x216b28),this['_viewToController']['delete'](_0xdf1e08),_0x1b91ea&&_0xc0612d['remove'](_0x1b91ea),_0x1a4707['destroy'](),_0xdf1e08['destroy']()['then'](()=>{this['_unbindEditors'](_0xdf1e08);});}}_updateActiveAnnotation({threadId:_0x9137de,resolvedAt:_0x1183d0,unlinkedAt:_0x5a1fb9}){const _0x1a1c20=!!_0x1183d0,_0x586a01=this['context']['plugins']['get'](ti),_0x18dfdd=this['getCommentThread'](_0x9137de);if(this['_threadToController']['has'](_0x18dfdd)){const _0x29ed53=this['_threadToController']['get'](_0x18dfdd)['view'],_0x3a6555=_0x586a01['getByInnerView'](_0x29ed53);_0x3a6555&&(_0x1a1c20&&_0x586a01['_removeActiveAnnotation'](_0x3a6555),_0x5a1fb9?_0x3a6555['isVisible']=!0x1:_0x3a6555['refreshVisibility']());}}_getExternalAuthor(_0x4c776c){const _0x54acab=this['context']['plugins']['get'](_0x27e007),_0x1a9465=_0x5bfccb('external:'+_0x4c776c),_0xf3c73a=_0x54acab['getUser'](_0x1a9465);return _0xf3c73a||_0x54acab['addUser']({'id':_0x1a9465,'name':_0x4c776c});}_createNewComment({threadId:_0x35b546,commentId:_0x3c855a=_0x3a3689(),content:_0x30730b,authorId:_0x2ba534,createdAt:_0x25cea0,attributes:_0x55a9c3}){if('string'!=typeof _0x3c855a)throw new _0x4dbbfc('commentsrepository-invalid-commentid');if('string'!=typeof _0x2ba534)throw new _0x4dbbfc('commentsrepository-invalid-comment-authorid');if('string'!=typeof _0x30730b||!_0x30730b['trim']())throw new _0x4dbbfc('commentsrepository-invalid-comment-content');const _0x568b13=this['context']['plugins']['get'](_0x27e007)['getUser'](_0x2ba534);if(!_0x568b13)throw new _0x4dbbfc('commentsrepository-add-comment-user-not-exists',null,{'authorId':_0x2ba534});let _0x379ee1=null,_0x5dbc18=_0x25cea0;return _0x55a9c3?.['@external']&&(_0x379ee1=this['_getExternalAuthor'](_0x55a9c3['@external']['authorName']),_0x5dbc18=new Date(_0x55a9c3['@external']['createdAt'])),new hi(this,{'threadId':_0x35b546,'id':_0x3c855a,'author':_0x379ee1||_0x568b13,'creator':_0x568b13,'content':_0x30730b,'createdAt':_0x25cea0,'authoredAt':_0x5dbc18,'attributes':_0x55a9c3});}_addComment(_0x1686ef){let {threadId:_0xdeb566,content:_0x2bc1b9,attributes:_0x4f916e,isFromAdapter:_0xd26ad8}=_0x1686ef;const _0x5d94de=this['getCommentThread'](_0x1686ef['threadId']);if(!_0x5d94de)throw new _0x4dbbfc('commentsrepository-add-comment-to-missing-comment-thread',this);const _0x9c4093=this['_createNewComment'](_0x1686ef),{id:_0x290b0e}=_0x9c4093;if(_0x5d94de['_add'](_0x9c4093),_0xd26ad8||!this['adapter']||'function'!=typeof this['adapter']['addComment']||!_0x5d94de['isSubmitted'])return Promise['resolve']();const _0x3f1cb3=this['context']['plugins']['get']('PendingActions'),{channelId:_0x1d6c49}=_0x5d94de,_0x24dadc=_0x3f1cb3['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return _0x4f916e||(_0x4f916e={}),this['adapter']['addComment']({'channelId':_0x1d6c49,'threadId':_0xdeb566,'commentId':_0x290b0e,'content':_0x2bc1b9,'attributes':_0x4f916e})['then'](_0x5d410b=>{_0x3f1cb3['remove'](_0x24dadc),_0x5d410b&&this['_updateComment']({'channelId':_0x1d6c49,'threadId':_0xdeb566,'commentId':_0x290b0e,'createdAt':_0x5d410b['createdAt'],'isFromAdapter':!0x0});})['catch'](_0x21094a=>{throw console['error'](_0x21094a),new _0x4dbbfc('commentsrepository-add-comment-internal-error',this);});}_updateComment({threadId:_0x32d34b,commentId:_0x56f4a7,content:_0x5eeef5,createdAt:_0x9b6b42,attributes:_0x36583e,isFromAdapter:_0xb3a8d3}){if(void 0x0!==_0x5eeef5&&('string'!=typeof _0x5eeef5||!_0x5eeef5['trim']()['length']))throw new _0x4dbbfc('commentsrepository-update-comment-invalid-content');const _0x514b90=this['getCommentThread'](_0x32d34b),_0xb9c7b4=_0x514b90['getComment'](_0x56f4a7);if(!_0xb9c7b4)throw new _0x4dbbfc('commentsrepository-update-missing-comment',this);let _0x52d5dd=!0x1;if(_0x5eeef5&&_0x5eeef5!==_0xb9c7b4['content']&&(_0xb9c7b4['isEditable']||_0xb3a8d3)&&(_0xb9c7b4['content']=_0x5eeef5,_0x52d5dd=!0x0),_0x9b6b42&&_0x9b6b42!==_0xb9c7b4['createdAt']&&(_0xb9c7b4['createdAt']=_0x9b6b42,_0xb9c7b4['isExternal']||(_0xb9c7b4['authoredAt']=_0x9b6b42),_0x52d5dd=!0x0),_0x36583e&&!_0x3173ce(_0x36583e,_0xb9c7b4['attributes'])&&(_0xb9c7b4['attributes']=_0x36583e,_0x52d5dd=!0x0),!_0x52d5dd)return Promise['resolve']();if(_0x514b90['fire']('commentUpdated'),_0xb3a8d3||!this['adapter']||'function'!=typeof this['adapter']['updateComment'])return Promise['resolve']();const _0xf45743=this['context']['plugins']['get']('PendingActions'),{channelId:_0x1c475e}=this['getCommentThread'](_0xb9c7b4['threadId']),_0x2b44ef=_0xf45743['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['updateComment']({'channelId':_0x1c475e,'threadId':_0x32d34b,'commentId':_0x56f4a7,'content':_0x5eeef5,'attributes':_0x36583e})['then'](()=>_0xf45743['remove'](_0x2b44ef))['catch'](_0x1c9e07=>{throw console['error'](_0x1c9e07),new _0x4dbbfc('commentsrepository-update-comment-internal-error',this);});}_removeComment({threadId:_0x37da90,commentId:_0x23db2d,isFromAdapter:_0x3c60cf}){const _0x876f46=this['getCommentThread'](_0x37da90),_0x2243d7=_0x876f46['getComment'](_0x23db2d);if(!_0x2243d7)throw new _0x4dbbfc('commentsrepository-remove-missing-comment',this);if(_0x876f46['_remove'](_0x2243d7),_0x3c60cf||!this['adapter']||'function'!=typeof this['adapter']['removeComment'])return Promise['resolve']();const _0x5a5ab2=this['context']['plugins']['get']('PendingActions'),{channelId:_0x45c039}=_0x876f46,_0x4ed088=_0x5a5ab2['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['removeComment']({'channelId':_0x45c039,'threadId':_0x37da90,'commentId':_0x23db2d})['then'](()=>_0x5a5ab2['remove'](_0x4ed088))['catch'](_0x1e758e=>{throw console['error'](_0x1e758e),new _0x4dbbfc('commentsrepository-remove-comment-internal-error',this);});}},ri=class extends si{['channelId'];['id'];_isAttached;_isSubmitted;comments;_repository;constructor(_0x459e5d,_0x2b2bbd){super();const _0x403669=_0x2b2bbd['isResolvable'];this['channelId']=_0x2b2bbd['channelId'],this['id']=_0x2b2bbd['id'],this['comments']=new _0x1e0fc8(),this['_repository']=_0x459e5d,this['_isAttached']=!0x1,this['_isSubmitted']=_0x2b2bbd['isSubmitted'],this['set']('_hasTargetInContent',!0x0),this['bind']('isReadOnly')['to'](_0x459e5d,'_permissions',_0x459e5d,'_readOnlyChannels',()=>_0x459e5d['isReadOnly'](this['channelId'])),this['bind']('isRemovable')['to'](_0x459e5d,'_permissions',()=>_0x459e5d['getPermissions'](this['channelId'])['admin']),this['bind']('canComment')['to'](_0x459e5d,'_permissions',()=>{const _0x2ee780=_0x459e5d['getPermissions'](this['channelId']);return _0x2ee780['write']||_0x2ee780['admin'];}),this['bind']('isResolvable')['to'](_0x459e5d,'_permissions',()=>_0x403669&&_0x459e5d['getPermissions'](this['channelId'])['resolve']),this['set']('context',_0x2b2bbd['context']),this['bind']('archivedAt')['to'](this,'resolvedAt',this,'unlinkedAt',(_0x840ad7,_0x36e623)=>_0x840ad7?_0x36e623?_0x840ad7<_0x36e623?_0x840ad7:_0x36e623:_0x840ad7:_0x36e623),this['set']('unlinkedAt',_0x2b2bbd['unlinkedAt']||null),this['set']('resolvedAt',_0x2b2bbd['resolvedAt']||null),this['set']('resolvedBy',_0x2b2bbd['resolvedBy']||null),this['bind']('isResolved')['to'](this,'resolvedAt',_0x1f5375=>!!_0x1f5375),this['set']('attributes',_0x2b2bbd['attributes']||{});}get weight(){return Array['from'](this['comments'])['reduce']((_0x5c07c5,_0x3f81a9)=>_0x5c07c5+_0x3f81a9['weight'],0x0);}get length(){return this['comments']['length'];}get isAttached(){return this['_isAttached'];}get isSubmitted(){return this['_isSubmitted'];}submit(){const {channelId:_0x7f860d,id:_0x4aae8e}=this;this['_repository']['fire'](ai('submitCommentThread',_0x7f860d),{'channelId':_0x7f860d,'threadId':_0x4aae8e});}setUnlinkedAt(_0x11dc45){this['_update']({'unlinkedAt':_0x11dc45});}['resolve']({resolvedAt:_0x1be1fe=new Date(),resolvedBy:_0x562c19='',isFromAdapter:_0x75e5ea=!0x1}={}){const _0x665bf8=this['_repository']['context']['plugins']['get'](_0x27e007)['me'],{channelId:_0x1ff64f,id:_0x59caba}=this;this['_repository']['fire'](ai('resolveCommentThread',_0x1ff64f),{'channelId':_0x1ff64f,'threadId':_0x59caba,'resolvedAt':_0x1be1fe,'resolvedBy':_0x562c19||_0x665bf8['id'],'isFromAdapter':_0x75e5ea});}['reopen']({isFromAdapter:_0xfceab7=!0x1}={}){const {channelId:_0x4f79fb,id:_0x40d547}=this;this['_repository']['fire'](ai('reopenCommentThread',_0x4f79fb),{'channelId':_0x4f79fb,'threadId':_0x40d547,'isFromAdapter':_0xfceab7});}setContext(_0x58a8f5){this['context']||this['_update']({'context':_0x58a8f5});}setAttribute(_0x5ae534,_0x2d76e9){const _0x3396a1=_0x344106(this['attributes']);_0x25b52c(_0x3396a1,_0x5ae534,_0x2d76e9),this['_update']({'attributes':_0x3396a1});}removeAttribute(_0x13693c){const _0x3c23fe=_0x344106(this['attributes']);_0xe3924b(_0x3c23fe,_0x13693c),this['_update']({'attributes':_0x3c23fe});}['remove']({isFromAdapter:_0x2648f0=!0x1}={}){const {channelId:_0x27a59d,id:_0x1e28d5}=this;this['_repository']['fire'](ai('removeCommentThread',_0x27a59d),{'channelId':_0x27a59d,'threadId':_0x1e28d5,'isFromAdapter':_0x2648f0});}attachTo(_0x1a7992){return this['_repository']['_attachCommentThread']({'threadId':this['id'],'target':_0x1a7992});}addComment(_0x3614f){const {channelId:_0x339d18,id:_0x285827}=this;this['_repository']['fire'](ai('addComment',_0x339d18,_0x285827),Object['assign']({'channelId':_0x339d18,'threadId':_0x285827},_0x3614f));}getComment(_0x200fe4){if('string'!=typeof _0x200fe4)throw new _0x4dbbfc('commentsrepository-get-comment-invalid-id',null,{'commentId':_0x200fe4});return this['comments']['get'](_0x200fe4);}toJSON(){return{'threadId':this['id'],'context':this['context'],'unlinkedAt':this['unlinkedAt'],'resolvedAt':this['resolvedAt'],'resolvedBy':this['resolvedBy']?this['resolvedBy']['id']:null,'archivedAt':this['archivedAt'],'comments':this['comments']['map'](_0x5b2f4f=>_0x5b2f4f['toJSON']()),'attributes':this['attributes']};}['_add'](_0x30ef85){return this['listenTo'](_0x30ef85,'change:authoredAt',()=>{const _0x49d08e=this['_findOptimalIndex'](_0x30ef85),_0x47fa63=this['comments'];_0x49d08e-0x1!=_0x47fa63['getIndex'](_0x30ef85)&&_0x49d08e+0x1!=_0x47fa63['getIndex'](_0x30ef85)&&(this['_remove'](_0x30ef85),this['_add'](_0x30ef85));}),this['comments']['add'](_0x30ef85,this['_findOptimalIndex'](_0x30ef85));}_update(_0x29545e){const {channelId:_0x2c06d5,id:_0x1984c4}=this;this['_repository']['fire'](ai('updateCommentThread',_0x2c06d5),{..._0x29545e,'channelId':_0x2c06d5,'threadId':_0x1984c4});}['_remove'](_0x34ef7a){return this['stopListening'](_0x34ef7a),_0x34ef7a['destroy'](),this['comments']['remove'](_0x34ef7a);}_findOptimalIndex(_0x442d49){const _0x1729bd=this['comments']['find'](_0x2caa99=>new Date(_0x2caa99['authoredAt'])['getTime']()>new Date(_0x442d49['authoredAt'])['getTime']());return _0x1729bd?this['comments']['getIndex'](_0x1729bd):this['length'];}},hi=class extends ni{['id'];threadId;author;creator;createdAt;_repository;constructor(_0x45c25b,_0x5d67c5){super();const _0x3f07c9=_0x45c25b['context']['plugins']['get'](_0x27e007)['me'],_0xe6efb3=_0x45c25b['getCommentThread'](_0x5d67c5['threadId']),_0x4d738d=0x0===_0xe6efb3['comments']['length'],_0x5b9ee5=_0x3f07c9===_0x5d67c5['author'];this['id']=_0x5d67c5['id'],this['threadId']=_0x5d67c5['threadId'],this['author']=_0x5d67c5['author'],this['creator']=_0x5d67c5['creator'],this['set']('content',_0x5d67c5['content']),this['createdAt']=_0x5d67c5['createdAt']||new Date(),this['set']('authoredAt',_0x5d67c5['authoredAt']||new Date()),this['bind']('resolvedAt')['to'](_0xe6efb3,'resolvedAt'),this['set']('attributes',_0x5d67c5['attributes']||{}),this['bind']('isEditable')['to'](_0x45c25b,'_permissions',()=>{const _0x49039f=_0x45c25b['getPermissions'](_0xe6efb3['channelId'])['write'],_0x5e674f=_0x45c25b['getPermissions'](_0xe6efb3['channelId'])['modifyAll'];return _0x5b9ee5&&_0x49039f||!_0x5b9ee5&&_0x5e674f;}),this['bind']('isRemovable')['to'](_0xe6efb3,'isRemovable',_0x45c25b,'_permissions',_0x2db372=>{const _0x45e200=_0x45c25b['getPermissions'](_0xe6efb3['channelId'])['write'],_0x45a0ee=_0x45c25b['getPermissions'](_0xe6efb3['channelId'])['modifyAll'];return _0x5b9ee5&&_0x45e200||_0x2db372&&_0x4d738d||!_0x5b9ee5&&_0x45a0ee&&!_0x4d738d;}),this['bind']('isReadOnly')['to'](_0xe6efb3,'isReadOnly'),this['_repository']=_0x45c25b;}get isExternal(){return Boolean(this['attributes']&&this['attributes']['@external']);}get weight(){return Math['max'](function(_0x323eaf){const _0x2cd999=document['createElement']('div');return _0x2cd999['innerHTML']=_0x323eaf,_0x2cd999['textContent']['length'];}(this['content']),0xc8);}update(_0x56357a){const {threadId:_0x5f191e,id:_0x515a53}=this;if(!this['_repository']['hasCommentThread'](_0x5f191e))throw new _0x4dbbfc('commentsrepository-update-comment-missing-comment-thread',this);const {channelId:_0x4a76d2}=this['_repository']['getCommentThread'](_0x5f191e);this['_repository']['fire'](ai('updateComment',_0x4a76d2,_0x5f191e),{'channelId':_0x4a76d2,'threadId':_0x5f191e,'commentId':_0x515a53,..._0x56357a});}setAttribute(_0x1f95d5,_0x11243c){const _0x210293=_0x344106(this['attributes']);_0x25b52c(_0x210293,_0x1f95d5,_0x11243c),this['update']({'attributes':_0x210293});}removeAttribute(_0x1b9614){const _0x24c90a=_0x344106(this['attributes']);_0xe3924b(_0x24c90a,_0x1b9614),this['update']({'attributes':_0x24c90a});}['remove'](_0x3edf66={}){if(!_0x3edf66['isFromAdapter']&&!this['isRemovable'])return;const {threadId:_0x3ad209,id:_0x355bb8}=this;if(!this['_repository']['hasCommentThread'](_0x3ad209))throw new _0x4dbbfc('commentsrepository-remove-comment-missing-comment-thread',this);const {channelId:_0xa21d9d}=this['_repository']['getCommentThread'](_0x3ad209);this['_repository']['fire'](ai('removeComment',_0xa21d9d,_0x3ad209),{'channelId':_0xa21d9d,'threadId':_0x3ad209,'commentId':_0x355bb8,..._0x3edf66});}toJSON(){return{'commentId':this['id'],'content':this['content'],'createdAt':this['createdAt'],'authorId':this['creator']['id'],'attributes':this['attributes']};}destroy(){this['stopListening']();}};function ai(_0x168081,..._0xa9f1a4){for(const _0x4cd7ba of _0xa9f1a4)void 0x0!==_0x4cd7ba&&(_0x168081+=':'+String(_0x4cd7ba));return _0x168081;}var ci=class extends _0x9c035e{constructor(_0x32db82){super(_0x32db82),this['set']('hasContent',!0x1);}['refresh'](){const _0x46c95d=this['editor']['model']['document']['selection'];this['isEnabled']=!0x0,this['hasContent']=!0x1;for(const _0x1c3452 of _0x46c95d['getRanges']())if(this['_hasContent'](_0x1c3452))return void(this['hasContent']=!0x0);}execute({threadId:_0x38274d=_0x3a3689(),ranges:_0x5c99aa,comment:_0xa2537d}={}){const _0x3b6f9b=this['editor']['model'],_0x240797=_0x5c99aa??Array['from'](_0x3b6f9b['document']['selection']['getRanges']()),_0x3da835=[];for(const _0x242ce4 of _0x240797)this['_hasContent'](_0x242ce4)&&_0x3da835['push'](this['_trimToContent'](_0x242ce4));if(!_0x3da835['length'])throw new _0x4dbbfc('addcommentthreadcommand-incorrect-ranges',null);_0xa2537d&&this['_createCommentThread'](_0x38274d,_0xa2537d),this['_createMarkersFromRanges'](_0x38274d,_0x3da835,!!_0xa2537d);}_createMarkersFromRanges(_0x126a50,_0x5eb5f5,_0x25ac2d){this['editor']['model']['change'](_0x33c1ad=>{for(const _0x190e06 of _0x5eb5f5){const _0x408c7b='comment:'+_0x126a50+':'+_0x3a3689()['substr'](0x1,0x5);_0x33c1ad['addMarker'](_0x408c7b,{'range':_0x190e06,'usingOperation':_0x25ac2d,'affectsData':_0x25ac2d});}});}_createCommentThread(_0x148e2d,_0x1a3be4){const _0x2236f3=this['editor']['plugins']['get']('CommentsRepository'),_0xdcbdbe=this['editor']['config']['get']('collaboration.channelId'),_0x2fcc99=this['editor']['plugins']['get']('Users')['me'];if(!_0x2fcc99)throw new _0x4dbbfc('addcommentthreadcommand-user-not-found',null);_0x2236f3['addCommentThread']({'threadId':_0x148e2d,'channelId':_0xdcbdbe,'comments':[{'authorId':_0x2fcc99['id'],'content':_0x1a3be4,'createdAt':new Date(),'attributes':{}}]});}_hasContent(_0x455bf1){for(const _0x521372 of _0x455bf1['getItems']())if(this['_itemIsContent'](_0x521372))return!0x0;return!0x1;}_itemIsContent(_0x5590b7){return _0x5590b7['is']('$textProxy')||this['editor']['model']['schema']['isObject'](_0x5590b7)&&!_0x5590b7['is']('element','tableCell');}_trimToContent(_0x1457bd){const _0x2748ed=_0x24c65e=>!this['_itemIsContent'](_0x24c65e['item']),_0x143497=_0x1457bd['start']['getLastMatchingPosition'](_0x2748ed),_0x390a11=_0x1457bd['end']['getLastMatchingPosition'](_0x2748ed,{'direction':'backward'});return this['editor']['model']['createRange'](_0x143497,_0x390a11);}},di=class extends _0x433bd5{_dataCollectors;_editorAnnotations;static get requires(){return[ti];}static get['pluginName'](){return'EditorAnnotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4698be){super(_0x4698be),this['_dataCollectors']=new Set(),this['_editorAnnotations']=new Set();}init(){const _0x56a94f=this['editor'],_0x333152=_0x56a94f['model']['document']['selection'],_0x361a4f=_0x5b7667(()=>this['refreshSelectedViews'](),0xa);_0x333152['on']('change:range',(_0x489c88,_0x2deffb)=>{_0x2deffb['directChange']&&(_0x361a4f['cancel'](),this['refreshSelectedViews']());}),this['listenTo'](_0x56a94f['editing']['view']['document'],'change:isFocused',(_0x1b4a81,_0x242353,_0x19229b)=>{_0x19229b&&_0x361a4f();}),this['listenTo'](_0x56a94f['ui']['focusTracker'],'change:isFocused',(_0x2593fa,_0x38aa80,_0x572554)=>{_0x572554||this['fire']('blur',{'isAnnotationTracked':_0x3695e5=>this['_editorAnnotationsData']['has'](_0x3695e5['innerView'])});}),this['listenTo'](this['editor']['ui'],'update',()=>this['fire']('uiUpdate'));}registerAnnotation(_0x3f1418){if(this['_editorAnnotations']['has'](_0x3f1418['view']))return;this['_editorAnnotations']['add'](_0x3f1418['view']),this['editor']['ui']['focusTracker']['add'](_0x3f1418['view']['element']);const _0x13dafa=this['editor']['plugins']['get'](ti);this['listenTo'](_0x13dafa['collection'],'remove',(_0x7338b9,_0x251154)=>{this['editor']['ui']['focusTracker']['remove'](_0x251154['view']['element']),this['_editorAnnotations']['delete'](_0x251154['view']);});}hasDomSelection(){return this['editor']['editing']['view']['hasDomSelection'];}addSourceCollector(_0x5cee33){if('function'!=typeof _0x5cee33)throw new _0x4dbbfc('editorannotations-invalid-source-callback');this['_dataCollectors']['add'](_0x5cee33);}refreshSelectedViews(){this['fire']('refresh');}getOrderedSelectedAnnotations({activeAnnotation:_0x5eadd0,annotations:_0x483a3f}){const _0x2210a9=[],_0x49ffa5=this['editor']['model']['document']['selection'],_0x541816=Array['from'](_0x49ffa5['getRanges']());for(const [_0x452914,_0x1571ab]of this['_editorAnnotationsData']){const _0x5274e4=_0x1fdcd9(_0x1571ab),_0x55fdeb=_0x483a3f['getByInnerView'](_0x452914);_0x5274e4&&_0x55fdeb&&_0x2210a9['push']({'annotation':_0x55fdeb,'range':_0x5274e4});}function _0x1fdcd9(_0x52c31f){for(const _0x7bf225 of _0x52c31f)for(const _0x1ff78f of _0x541816)if(_0x7bf225['containsRange'](_0x1ff78f,!_0x49ffa5['isCollapsed']))return _0x7bf225;return null;}const _0x338f5d=new Map(Array['from'](_0x483a3f,(_0xb8faa1,_0x1df08e)=>[_0xb8faa1,_0x1df08e]));return _0x2210a9['sort']((_0x312d82,_0x3f9820)=>{const _0x667720=_0x312d82['range'],_0x1109fa=_0x3f9820['range'];if(!_0x667720['isEqual'](_0x1109fa)){if(_0x667720['containsRange'](_0x1109fa,!0x0))return 0x1;if(_0x1109fa['containsRange'](_0x667720,!0x0))return-0x1;}return _0x312d82['annotation']==_0x5eadd0?-0x1:_0x3f9820['annotation']==_0x5eadd0?0x1:(_0x338f5d['get'](_0x312d82['annotation'])??0x0)-(_0x338f5d['get'](_0x3f9820['annotation'])??0x0);})['map'](_0x166768=>_0x166768['annotation']);}get _editorAnnotationsData(){const _0x4409eb=new Map();for(const _0x2e3709 of Array['from'](this['_dataCollectors']))for(const [_0x5f26e0,_0x63a2e4]of _0x2e3709())_0x4409eb['set'](_0x5f26e0,_0x63a2e4);return _0x4409eb;}},li=class extends _0x433bd5{afterInit(){const _0x39049c=this['editor'];_0x39049c['plugins']['has']('RestrictedEditingModeEditing')&&_0x39049c['plugins']['get']('RestrictedEditingModeEditing')['enableCommand']('addCommentThread');}},mi=class extends _0x433bd5{constructor(_0x2f1807){super(_0x2f1807),this['editor']['config']['define']('importWord.formatting.comments','basic');}afterInit(){const _0x393202=this['editor'],_0x491350=_0x393202['commands']['get']('importWord'),_0x1e9580=_0x393202['plugins']['get'](_0x27e007);_0x491350&&(_0x491350['on']('execute',(_0x580299,[,_0x1f2150])=>{_0x1f2150['collaboration_features']={'comments':!0x0,'user_id':_0x1e9580['me']['id']};},{'priority':_0x8f380b['high']+0xa}),this['listenTo'](_0x491350,'dataInsert',this['_handleImportedData']));}_handleImportedData(_0x200d2a,_0x2aa7e5){const {comment_threads:_0x3700f6}=_0x2aa7e5;_0x3700f6&&_0x3700f6['forEach'](({thread_id:_0x4dd3fb,comments:_0x437927,is_resolved:_0x432e04})=>{const _0x2a396c=new Date(),_0x1cd7ae=_0x437927['map'](({author:_0x2b74f5,content:_0x5c6c09,created_at:_0x57e243})=>({'content':_0x5c6c09,'authorId':this['editor']['plugins']['get'](_0x27e007)['me']['id'],'createdAt':_0x2a396c,'attributes':{'@external':{'authorName':_0x2b74f5,'createdAt':_0x57e243?new Date(_0x57e243):new Date(),'source':'importWord'}}})),_0x566101=this['editor']['config']['get']('collaboration.channelId');this['editor']['plugins']['get'](oi)['addCommentThread']({'channelId':_0x566101,'threadId':_0x4dd3fb,'comments':_0x1cd7ae,'resolvedAt':_0x432e04?_0x2a396c:null});});}},ui=class extends _0x433bd5{constructor(_0x231dae){super(_0x231dae),this['editor']['config']['define']('comments.copyMarkers','default');}static get requires(){return[pt,wt];}afterInit(){const _0x2ee62e=this['editor']['plugins']['get']('ClipboardPipeline');this['_registerMarkerInClipboardPipeline'](),this['listenTo'](_0x2ee62e,'contentInsertion',(_0x39cd11,_0x4b0be6)=>this['_removeMarkersWithoutThreads'](_0x4b0be6['content']['markers']),{'priority':'highest'});}_removeMarkersWithoutThreads(_0x3da751){if(!this['editor']['plugins']['has']('CommentsRepository'))return _0x3da751;const _0x4a2d36=this['editor']['plugins']['get']('CommentsRepository');for(const _0x246c64 of _0x3da751['keys']()){const [_0x4fe5e4,_0xc270b1]=_0x246c64['split'](':');'comment'!=_0x4fe5e4||_0x4a2d36['hasCommentThread'](_0xc270b1)||_0x3da751['delete'](_0x246c64);}return _0x3da751;}_registerMarkerInClipboardPipeline(){const _0x2bdb3a=this['editor']['plugins']['get']('ClipboardMarkersUtils'),_0x29674a=this['_mapCommentsCopyConfigToRegisterConfiguration'](this['editor']['config']['get']('comments.copyMarkers'));_0x29674a&&_0x2bdb3a['_registerMarkerToCopy']('comment',_0x29674a);}_mapCommentsCopyConfigToRegisterConfiguration(_0x3d0e8f){switch(_0x3d0e8f){case'always':return{'allowedActions':'all','copyPartiallySelected':!0x1,'duplicateOnPaste':!0x0};case'default':return{'allowedActions':['cut','dragstart'],'copyPartiallySelected':!0x1,'duplicateOnPaste':!0x1};default:return null;}}};function fi(_0x3d767a){const _0x3122e5=_0x3d767a['split'](':');return{'group':_0x3122e5[0x0],'id':_0x3122e5[0x1],'part':_0x3122e5[0x2]};}var pi=class extends _0x433bd5{init(){this['overrideMarkerConverters'](),this['overrideHorizontalRuleConverter'](),this['overrideImageInlineConverter'](),this['overrideMediaEmbedConverter']();}overrideMarkerConverters(){this['editor']['conversion']['for']('dataDowncast')['markerToHighlight']({'model':'comment','view':(_0x41ad88,_0x490f67)=>{if(!_0x490f67['options']['showCommentHighlights'])return null;if(_0x490f67['options']['ignoreResolvedComments']){const {id:_0x4f62d4}=fi(_0x41ad88['markerName']);if(this['editor']['plugins']['get'](oi)['getCommentThread'](_0x4f62d4)?.['isResolved']&&_0x41ad88['item'])return _0x490f67['consumable']['consume'](_0x41ad88['item'],'addMarker:'+_0x41ad88['markerName']),_0x490f67['consumable']['consume'](_0x41ad88['item'],'removeMarker:'+_0x41ad88['markerName']),null;}return{'classes':['ck-comment-marker']};}}),this['editor']['conversion']['for']('dataDowncast')['add'](_0x61785e=>{_0x61785e['on']('addMarker:comment',(_0x767f70,_0x5df35e,_0xa272f8)=>{if(!_0xa272f8['options']['showCommentHighlights'])return;const _0x534fc2=_0x5df35e['item'];if(!_0x534fc2)return;const _0x306b05=_0xa272f8['mapper']['toViewElement'](_0x534fc2);this['editor']['model']['schema']['isObject'](_0x534fc2)&&_0x306b05&&!_0x306b05['getCustomProperty']('widget')&&_0x306b05['is']('containerElement')&&Ct(_0x306b05,_0xa272f8['writer']);},{'priority':'high'});});}overrideHorizontalRuleConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToStructure']({'model':'horizontalLine','view':(_0x11d90c,{writer:_0x4342a5,options:_0x2716b3})=>{if(!_0x2716b3['showCommentHighlights'])return null;const _0x8cb6e4=_0x4342a5['createContainerElement']('div'),_0xb1d551=_0x4342a5['createEmptyElement']('hr');return _0x4342a5['addClass']('ck-horizontal-line',_0x8cb6e4),_0x4342a5['insert'](_0x4342a5['createPositionAt'](_0x8cb6e4,0x0),_0xb1d551),_0x8cb6e4;},'converterPriority':'high'});}overrideImageInlineConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToStructure']({'model':'imageInline','view':(_0x2da289,{writer:_0x30bc69,options:_0x1cab8d})=>{if(!_0x1cab8d['showCommentHighlights'])return null;const _0x3eabbb=_0x30bc69['createContainerElement']('span'),_0x3d5790=_0x30bc69['createEmptyElement']('img');return _0x30bc69['addClass']('image-inline',_0x3eabbb),_0x30bc69['insert'](_0x30bc69['createPositionAt'](_0x3eabbb,0x0),_0x3d5790),_0x3eabbb;},'converterPriority':'high'});}overrideMediaEmbedConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToElement']({'model':'media','view':(_0x321fcf,{writer:_0x26798e,options:_0x1c6662})=>{if(_0x1c6662['showCommentHighlights'])return _0x26798e['createEmptyElement']('div');},'converterPriority':'high'}),this['editor']['data']['downcastDispatcher']['on']('attribute:url:media',(_0x911e17,_0x208517,_0x3a39bf)=>{_0x3a39bf['options']['showCommentHighlights']&&_0x911e17['stop']();},{'priority':'high'});}},wi=class extends _0x433bd5{static get requires(){return[oi,di,_0x27e007,li,mi,ui,pi];}static get['pluginName'](){return'CommentsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2e9a1a){super(_0x2e9a1a),this['set']('isThreadsLoadingPaused',!0x0),_0x2e9a1a['data']['once']('ready',()=>this['isThreadsLoadingPaused']=!0x1),this['set']('activeMarker',null),this['on']('change:activeMarker',(_0x5ddb44,_0x3dc24c,_0x5f33dd,_0x3fff64)=>{const _0x29de8a=_0x2e9a1a['plugins']['get'](oi),_0xa3441c=_0x5f33dd?fi(_0x5f33dd)['id']:null;_0x2e9a1a['model']['change'](()=>{if(_0xa3441c){const _0x77b47a=this['getAllMarkersForId'](_0xa3441c);for(const _0x1c8c16 of _0x77b47a)_0x2e9a1a['editing']['reconvertMarker'](_0x1c8c16);}if(_0x3fff64){const {id:_0x1cb2aa}=fi(_0x3fff64),_0x14c4fc=_0x29de8a['getCommentThread'](_0x1cb2aa);if(_0x14c4fc&&_0x14c4fc['unlinkedAt'])return;if(_0x14c4fc&&!_0x14c4fc['isAttached'])return;const _0x934951=this['getAllMarkersForId'](_0x1cb2aa);for(const _0x2f72a6 of _0x934951)_0x2e9a1a['editing']['reconvertMarker'](_0x2f72a6);}}),_0xa3441c&&this['scrollToThreadMarker'](_0xa3441c);}),this['_initAriaMarkerChangeAnnouncements']();}init(){const _0x46057f=this['editor'],_0x57d0bc=_0x46057f['plugins']['get'](oi),_0x16a9d9=_0x46057f['config']['get']('collaboration.channelId'),_0x4068cd=_0x57d0bc['getCommentThreads']()['filter'](_0x312571=>_0x312571['channelId']!==_0x16a9d9);_0x46057f['commands']['add']('addCommentThread',new ci(_0x46057f)),this['listenTo'](_0x46057f,'change:isReadOnly',(_0x2a2b60,_0x188493,_0x1f1213)=>{_0x57d0bc['switchReadOnly'](_0x1f1213,_0x46057f['config']['get']('collaboration.channelId'));}),this['listenTo'](_0x57d0bc,gi('addCommentThread',_0x16a9d9),(_0x3dbb89,{threadId:_0xfb3fbd})=>{this['editor']['plugins']['get'](oi)['getCommentThread'](_0xfb3fbd)?.['unlinkedAt']&&this['_attachArchivedThread'](_0xfb3fbd);}),this['listenTo'](_0x57d0bc,gi('removeCommentThread',_0x16a9d9),(_0xdc9b42,{threadId:_0x11cf7c})=>{_0x46057f['model']['enqueueChange']({'isUndoable':!0x1},_0x454149=>{const _0x1ac0b7=this['getAllMarkersForId'](_0x11cf7c);for(const _0x4d0524 of _0x1ac0b7)_0x454149['removeMarker'](_0x4d0524);});}),this['listenTo'](_0x57d0bc,gi('resolveCommentThread',_0x16a9d9),(_0x88476,{threadId:_0x30f7e8})=>{this['_reconvertMarkers'](_0x30f7e8);const _0x65b4e8=this['editor']['plugins']['get'](ti);(this['editor']['editing']['view']['hasDomSelection']||_0x65b4e8['collection']['isFocused'])&&(this['editor']['plugins']['get'](oi)['getCommentThread'](_0x30f7e8)['unlinkedAt']||this['editor']['editing']['view']['focus']());},{'priority':'low'}),this['listenTo'](_0x57d0bc,gi('reopenCommentThread',_0x16a9d9),(_0x3e8520,{threadId:_0x579865})=>{this['_reconvertMarkers'](_0x579865);},{'priority':'low'}),this['listenTo'](_0x57d0bc,gi('addComment',_0x16a9d9),(_0x27a57e,{threadId:_0x14bff3,isFromAdapter:_0x305fbd})=>{const _0x452727=this['getAllMarkersForId'](_0x14bff3);!_0x305fbd&&0x0!=_0x452727['length']&&_0x57d0bc['hasCommentThread'](_0x14bff3)&&0x1===_0x57d0bc['getCommentThread'](_0x14bff3)['length']&&_0x46057f['model']['enqueueChange']({'isUndoable':!0x1},_0x173c66=>{for(const _0x13693d of _0x452727)_0x173c66['updateMarker'](_0x13693d,{'usingOperation':!0x0,'affectsData':!0x0});});},{'priority':'low'}),this['_initializeMarkerConverters'](),this['_handleMarkerAddAndRemove'](),this['_handleInitialThreads'](_0x4068cd);}afterInit(){!async function(_0x4d75c9){const _0x17ab37='mr4z2yakM3x0phtD7jBw1T6qRfeUuZcOLNKVgQSPE9iGIHoXlJW8YsCb5AndFv',_0x30026a=0x79650,_0x5e2f51={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x5a1634(_0x21e8bb){const _0xa37afd=new window['Promise'](_0x487699=>{_0x21e8bb['once']('ready',_0x487699);}),_0x59533f=window['Date']['now'](),_0x33301a=_0x21e8bb['config']['get']('licenseKey');async function _0x4ce7ec(){let _0x3dcc80,_0x3d85db=null,_0x2db2db=null;try{return'GPL'==_0x33301a?'NotAllowed':(_0x3dcc80=_0x42b756(),_0x3dcc80?(_0x3dcc80['usageEndpoint']&&(_0x2db2db=_0x48c57b(_0x3dcc80['usageEndpoint'],_0x3dcc80['jti'])),await _0xc55a54()?_0x22024b()?_0xa1cd83()?'Expired':_0xe3a609()?('evaluation'==_0x3dcc80['licenseType']&&(_0x3d85db=_0x456cfa('EvaluationLimit')),await _0x449922()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0xa1cd83(){const _0x3e03dd=['evaluation','trial']['includes'](_0x3dcc80['licenseType'])?_0x59533f/0x3e8:0xe10*_0x30026a;return _0x3dcc80['exp']<_0x3e03dd;}function _0x22024b(){const _0x2c9c40=_0x3dcc80['features'];if(!_0x2c9c40)return!0x1;if(_0x2c9c40['includes']('*'))return!0x0;if(_0x2c9c40['includes']('CMT'))return!0x0;if(_0x2c9c40['includes']('TRILIUM')&&_0x58a0ea())return!0x0;if(_0x2c9c40['includes']('RCMT')){if(_0x364078())return!0x0;if(_0x7c4c87()||_0x102f02())return!0x0;}return!0x1;}function _0xe3a609(){const _0x4b83a0=_0x3dcc80['licensedHosts'];if(!_0x4b83a0||0x0==_0x4b83a0['length'])return!0x0;const {hostname:_0x4e71e4}=new URL(window['location']['href']);if(_0x4b83a0['includes'](_0x4e71e4))return!0x0;const _0x4e6315=_0x4e71e4['split']('.');return _0x4b83a0['filter'](_0x12f7cf=>_0x12f7cf['includes']('*'))['map'](_0x263dda=>_0x263dda['split']('.'))['filter'](_0x3db7cc=>_0x3db7cc['length']<=_0x4e6315['length'])['map'](_0xe6e951=>Array(_0x4e6315['length']-_0xe6e951['length'])['fill']('*'===_0xe6e951[0x0]?'*':'')['concat'](_0xe6e951))['some'](_0x537657=>_0x4e6315['every']((_0x541a11,_0x4c749f)=>_0x537657[_0x4c749f]===_0x541a11||'*'===_0x537657[_0x4c749f]));}function _0x449922(){return _0x3d85db&&_0x2db2db?new window['Promise']((_0x4f9def,_0x50e723)=>{_0x3d85db['then'](_0x4f9def,_0x50e723),_0x2db2db['then'](_0x407969=>{'Valid'!=_0x407969&&_0x4f9def(_0x407969);},_0x50e723);}):_0x3d85db||_0x2db2db||'Valid';}}function _0x48c57b(_0x603b81,_0x9d670d){return new window['Promise'](_0x2fbfb4=>{if(_0xad410())return _0x2fbfb4('Valid');_0x22fad2(),_0x21e8bb['decorate']('_sendUsageRequest');let _0x4235ab=!0x1;const _0x50e586=_0x3a3689();function _0x3b410a(_0x4bb618){return!!_0x4bb618&&('object'==typeof _0x4bb618||'function'==typeof _0x4bb618)&&'function'==typeof _0x4bb618['then']&&'function'==typeof _0x4bb618['catch'];}function _0x38030c(_0x36eade){_0x39adc2(_0x36eade)['then'](_0x38b3ed=>_0x38b3ed&&'ok'==_0x38b3ed['status']?_0xe5fd98(_0xe1abbf(_0x50e586+_0x9d670d))!=_0x38b3ed['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x283150=>(_0x52cf47(),_0x283150),()=>{const _0x73f2c0=_0xaf8a07();return null==_0x73f2c0?(_0x52cf47(),'Valid'):_0x59533f-_0x73f2c0>0x240c8400?'UsageLimit':'Valid';})['then'](_0x2fbfb4)['catch'](()=>{_0x2fbfb4('UsageLimit');});const _0x2f8161=0x36ee80;function _0x52cf47(){const _0x5b2ef9='llct-'+_0xe5fd98(_0xe1abbf(_0x603b81)),_0x2c0bca=_0x432c41(_0xe5fd98(window['Math']['ceil'](_0x59533f/_0x2f8161)));window['localStorage']['setItem'](_0x5b2ef9,_0x2c0bca);}function _0xaf8a07(){const _0x549f7a='llct-'+_0xe5fd98(_0xe1abbf(_0x603b81)),_0x1757ca=window['localStorage']['getItem'](_0x549f7a);return _0x1757ca?window['parseInt'](_0x432c41(_0x1757ca),0x10)*_0x2f8161:null;}function _0x39adc2(_0x3a9217){return new window['Promise']((_0x4fe936,_0x2655af)=>{_0x3a9217['then'](_0x4fe936,_0x2655af),window['setTimeout'](_0x2655af,0x1d4c0);});}}_0x21e8bb['on']('_sendUsageRequest',(_0x5bc9be,_0x218e22)=>{if(_0x218e22[0x0]!=_0x603b81)return _0x2fbfb4('UsageLimit');_0x218e22[0x1]={..._0x218e22[0x1],'requestId':_0x50e586};},{'priority':'high'}),_0x21e8bb['on']('_sendUsageRequest',_0x1168be=>{_0x3b410a(_0x1168be['return'])&&(_0x4235ab=!0x0,_0x38030c(_0x1168be['return']));},{'priority':'low'}),_0xa37afd['then'](()=>{_0x4235ab||_0x2fbfb4('UsageLimit');});});function _0xad410(){return'auto'==_0x21e8bb['editing']['view']['_overlayModeHint'];}function _0x22fad2(){_0x21e8bb['editing']['view']['_overlayModeHint']='auto';}}function _0x456cfa(_0x224a8d){const _0x94bf1e=[new window['Promise'](_0x49a163=>setTimeout(_0x49a163,0x93ecc)),_0xa37afd['then'](()=>new window['Promise'](_0x4dfd1d=>{let _0x4b906b=0x0;_0x21e8bb['model']['on']('applyOperation',(_0x33cede,_0x3c3d4e)=>{_0x3c3d4e[0x0]['isDocumentOperation']&&_0x4b906b++,0x5e8==_0x4b906b&&(_0x4dfd1d(),_0x33cede['off']());});}))];return window['Promise']['race'](_0x94bf1e)['then'](()=>_0x224a8d);}async function _0x5a2f3d(){await _0xa37afd,_0x21e8bb['model']['change']=_0x49bfe7,_0x21e8bb['model']['enqueueChange']=_0x49bfe7,_0x21e8bb['enableReadOnlyMode']('model');}function _0x58a0ea(){return window['glob']&&window['glob']['triliumVersion'];}function _0x364078(){return _0x5d4cb2('WebSocketGateway')&&'connected'==_0x55b7a8('WebSocketGateway')['state'];}function _0x7c4c87(){return _0x5d4cb2('RevisionViewerIntegration');}function _0x102f02(){return _0x5d4cb2('TrackChangesDataGetter');}function _0x521b43(_0x2a701b){const _0x3e227a=_0x1cec6a();_0x21e8bb[_0x3e227a]='commentsLicenseKey'+_0x2a701b,'Valid'!=_0x2a701b&&_0x5a2f3d();}function _0x1cec6a(){const _0x1d34cd=window['String'](window['performance']['now']())['replace']('.','');let _0xd654f6='m';for(let _0x1e607f=0x0;_0x1e607f<_0x1d34cd['length'];_0x1e607f+=0x2){let _0x6bdc1d=window['parseInt'](_0x1d34cd['substring'](_0x1e607f,_0x1e607f+0x2));_0x6bdc1d>=0x3e&&(_0x6bdc1d-=0x3e),_0xd654f6+=_0x17ab37[_0x6bdc1d];}return _0xd654f6;}function _0x42b756(){const _0x1d6df0=_0x33301a['split']('.');if(0x3!=_0x1d6df0['length'])return null;return _0x439b89(_0x1d6df0[0x1]);function _0x439b89(_0x286bdf){const _0x393d95=_0x3638c7(_0x286bdf);return _0x393d95&&_0x4c63f9()?_0x393d95:null;function _0x4c63f9(){const _0x626d5b=_0x393d95['jti'],_0x208db8=window['parseInt'](_0x626d5b['substring'](_0x626d5b['length']-0x8),0x10),_0x411f1a={..._0x393d95,'jti':_0x626d5b['substring'](0x0,_0x626d5b['length']-0x8)};return delete _0x411f1a['vc'],_0xe1abbf(_0x411f1a)==_0x208db8;}}}async function _0xc55a54(){let _0x4bbece=!0x0;try{const [_0x151057,_0x52110b,_0x2e3ca1]=_0x33301a['split']('.');return _0x3e3e10(_0x151057),await _0x550e84(_0x151057,_0x52110b,_0x2e3ca1),_0x4bbece;}catch{return!0x1;}function _0x3e3e10(_0x2807ad){const _0x176ee4=_0x3638c7(_0x2807ad);_0x176ee4&&'ES256'==_0x176ee4['alg']||(_0x4bbece=!0x1);}async function _0x550e84(_0x4afb43,_0xa67b3e,_0x347588){const _0x5f0f9c=window['Uint8Array']['from'](_0x57c199(_0x347588),_0x5776d7=>_0x5776d7['charCodeAt'](0x0)),_0x739aab=new window['TextEncoder']()['encode'](_0x4afb43+'.'+_0xa67b3e),_0x342593=window['crypto']['subtle'];if(!_0x342593)return;const _0x25958e=await _0x342593['importKey']('jwk',_0x5e2f51,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x342593['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x25958e,_0x5f0f9c,_0x739aab)||(_0x4bbece=!0x1);}}function _0x3638c7(_0x5e4db0){return _0x5e4db0['startsWith']('ey')?JSON['parse'](_0x57c199(_0x5e4db0)):null;}function _0x57c199(_0x535c07){return window['atob'](_0x535c07['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0xe1abbf(_0x2b8801){let _0x4cba6f=0x1505;function _0x61ea2a(_0x27acff){for(let _0x5b6342=0x0;_0x5b6342<_0x27acff['length'];_0x5b6342++){const _0x4c1cf3=_0x27acff['charCodeAt'](_0x5b6342);_0x4cba6f=(_0x4cba6f<<0x5)+_0x4cba6f+_0x4c1cf3,_0x4cba6f&=_0x4cba6f;}}function _0x5ddcb1(_0x45982e){Array['isArray'](_0x45982e)?_0x45982e['forEach'](_0x5ddcb1):_0x45982e&&'object'==typeof _0x45982e?Object['entries'](_0x45982e)['sort']()['forEach'](([_0x1dfd5c,_0x1876cc])=>{_0x61ea2a(_0x1dfd5c),_0x5ddcb1(_0x1876cc);}):_0x61ea2a(window['String'](_0x45982e));}return _0x5ddcb1(_0x2b8801),_0x4cba6f>>>0x0;}function _0xe5fd98(_0x4c3f40){return _0x4c3f40['toString'](0x10)['padStart'](0x8,'0');}function _0x432c41(_0x598733){return _0x598733['split']('')['reverse']()['join']('');}function _0x5d4cb2(_0x9bb076){return _0x21e8bb['plugins']['has'](_0x9bb076);}function _0x55b7a8(_0x440a45){return _0x21e8bb['plugins']['get'](_0x440a45);}function _0x49bfe7(){}_0x521b43(await _0x4ce7ec());}_0x5a1634(_0x4d75c9['editor']);}(this);}destroy(){const _0x1530aa=this['editor']['plugins']['get'](oi),_0x45b436=this['editor']['config']['get']('collaboration.channelId');for(const _0x38bce6 of _0x1530aa['getCommentThreads']({'channelId':_0x45b436}))_0x1530aa['_detachCommentThread'](_0x38bce6['id']),_0x1530aa['_threads']['delete'](_0x38bce6['id']);super['destroy']();}['hasMarkerForId'](_0xeafc98){return this['getAllMarkersForId'](_0xeafc98)['length']>0x0;}getAllMarkersForId(_0x48814f){const _0x2d530f=[];for(const _0xdc1303 of this['editor']['model']['markers'])_0xdc1303['name']['startsWith']('comment:'+_0x48814f)&&_0x2d530f['push'](_0xdc1303);return _0x2d530f;}['scrollToThreadMarker'](_0x43e089){setTimeout(()=>{const _0x12d86d=this['_getTargetForId'](_0x43e089);_0x12d86d&&this['activeMarker']&&fi(this['activeMarker'])['id']===_0x43e089&&_0x569cd1({'target':_0x12d86d[0x0],'viewportOffset':0x64,'alignToTop':!0x0});},0x32);}_reconvertMarkers(_0x421ad8){this['editor']['model']['change'](()=>{for(const _0x2b5048 of this['getAllMarkersForId'](_0x421ad8))this['editor']['editing']['reconvertMarker'](_0x2b5048);});}_attachArchivedThread(_0x486263){const _0x19bb8c=this['editor']['plugins']['get'](oi),_0x531222=this['editor']['plugins']['get'](di),_0x38ff51=_0x19bb8c['getCommentThread'](_0x486263);if(!_0x38ff51['isAttached']){const _0x4bfc5e=_0x38ff51['attachTo'](()=>this['_getTargetForId'](_0x38ff51['id']));_0x531222['registerAnnotation'](_0x4bfc5e),_0x38ff51['_hasTargetInContent']=!0x1;}}_initializeMarkerConverters(){const _0x582377=this['editor'],_0x51bf98=_0x582377['plugins']['get'](_0x27e007);_0x582377['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'comment','view':(_0x104b8b,_0x3c66dd)=>{const {id:_0x20acd8}=fi(_0x104b8b['markerName']),_0x360016=_0x582377['plugins']['get'](oi)['getCommentThread'](_0x20acd8),_0x2b63fd=this['activeMarker']&&fi(this['activeMarker'])['id']===_0x20acd8;let _0x14fbae;if(_0x360016&&_0x360016['isResolved']&&!_0x2b63fd&&_0x104b8b['item'])return _0x3c66dd['consumable']['consume'](_0x104b8b['item'],'addMarker:'+_0x104b8b['markerName']),_0x3c66dd['consumable']['consume'](_0x104b8b['item'],'removeMarker:'+_0x104b8b['markerName']),null;const _0x49ae92=['ck-comment-marker'];return _0x2b63fd&&_0x49ae92['push']('ck-comment-marker--active'),_0x14fbae=_0x360016?.['length']?_0x360016['comments']['first']['author']['id']:_0x51bf98['me']['id'],{'classes':_0x49ae92,'attributes':{'data-comment':_0x20acd8,'data-author-id':_0x14fbae}};}}),_0x582377['conversion']['for']('dataDowncast')['markerToData']({'model':'comment','view':(_0x5916c3,{options:_0x4bd3d8})=>{if(_0x4bd3d8['showCommentHighlights'])return null;const _0x317611=_0x582377['plugins']['get'](oi),_0x3fd82c=_0x582377['model']['markers']['get'](_0x5916c3),{id:_0x3cf342,part:_0x483eef}=fi(_0x5916c3);return _0x3fd82c&&!_0x3fd82c['affectsData']||_0x4bd3d8['ignoreResolvedComments']&&_0x317611['getCommentThread'](_0x3cf342)?.['isResolved']?null:{'group':'comment','name':_0x483eef?_0x3cf342+':'+_0x483eef:_0x3cf342};}}),_0x582377['conversion']['for']('upcast')['elementToElement']({'view':{'name':'comment','attributes':{'id':/^\w/}},'model':(_0x192f5a,{writer:_0x50e27c})=>_0x50e27c['createElement']('$marker',{'data-name':'comment:'+_0x192f5a['getAttribute']('id')})}),_0x582377['conversion']['for']('upcast')['dataToMarker']({'view':'comment'});}['_handleMarkerAddAndRemove'](){const _0x1524d7=this['editor'],_0x3a7ac0=_0x1524d7['plugins']['get'](oi),_0x496f9a=new Set(),_0x204576=new Set();_0x1524d7['model']['document']['registerPostFixer'](_0x276dbc=>{let _0xf8bfb5=!0x1;for(const {name:_0x3ff8b6,data:_0x22cfcc}of _0x1524d7['model']['document']['differ']['getChangedMarkers']()){const {group:_0x51bb2d,id:_0x42b70b}=fi(_0x3ff8b6);let _0x5dfc6e=_0x22cfcc['newRange'];if('comment'!==_0x51bb2d||!_0x5dfc6e)continue;const _0xf126cf='$graveyard'===_0x5dfc6e['root']['rootName'];_0xf126cf||(_0x5dfc6e=_i(_0x5dfc6e,_0x1524d7['model']),!_0x5dfc6e||_0x5dfc6e['isCollapsed']||!_0x22cfcc['newRange']||_0x5dfc6e['isEqual'](_0x22cfcc['newRange']))?_0x1524d7['model']['hasContent'](_0x5dfc6e)&&!_0xf126cf?this['isThreadsLoadingPaused']?_0x496f9a['add'](_0x3ff8b6):this['_handleThreadMarker'](_0x3ff8b6,_0x42b70b):(_0x204576['add'](_0x3ff8b6),_0x496f9a['delete'](_0x3ff8b6),_0x276dbc['removeMarker'](_0x3ff8b6),_0xf8bfb5=!0x0):(_0x276dbc['updateMarker'](_0x3ff8b6,{'range':_0x5dfc6e}),_0xf8bfb5=!0x0);}return _0xf8bfb5;}),this['on']('change:isThreadsLoadingPaused',(_0x13968b,_0x1f348b,_0x5315eb)=>{if(!_0x5315eb&&_0x496f9a['size'])for(const _0x51182e of _0x496f9a){const {id:_0x3bbfed}=fi(_0x51182e);_0x496f9a['delete'](_0x51182e),_0x1524d7['model']['markers']['get'](_0x51182e)&&this['_handleThreadMarker'](_0x51182e,_0x3bbfed);}}),this['listenTo'](_0x1524d7['model']['document'],'change',()=>{for(const {name:_0x5093b3,data:{newRange:_0x183f66}}of _0x1524d7['model']['document']['differ']['getChangedMarkers']()){const {group:_0x5ab002,id:_0x5e38b5}=fi(_0x5093b3);if('comment'!==_0x5ab002)continue;const _0x15c989=_0x3a7ac0['getCommentThread'](_0x5e38b5),_0x5b9c35=this['hasMarkerForId'](_0x5e38b5);_0x15c989&&(!_0x15c989['_hasTargetInContent']&&_0x183f66&&_0x1524d7['editing']['view']['once']('render',()=>{const _0x11a025=_0x1524d7['plugins']['get'](ti),_0x4e2c7c=_0x3a7ac0['_threadToController']['get'](_0x15c989)['view'];_0x11a025['getByInnerView'](_0x4e2c7c)['refreshVisibility']();},{'priority':'low'}),_0x15c989['_hasTargetInContent']=_0x5b9c35||!!_0x183f66),_0x183f66||(_0x204576['add'](_0x5093b3),_0x496f9a['delete'](_0x5093b3));}for(const _0x460419 of _0x204576){const {id:_0x33d0e1}=fi(_0x460419),_0x54507d=_0x3a7ac0['getCommentThread'](_0x33d0e1);if(_0x496f9a['delete'](_0x460419),!_0x54507d)continue;const _0x12eef2=this['hasMarkerForId'](_0x33d0e1);_0x12eef2||_0x54507d['isSubmitted']?_0x12eef2||_0x54507d['unlinkedAt']||_0x54507d['setUnlinkedAt'](new Date()):_0x54507d['remove']();}_0x204576['clear']();});}_handleInitialThreads(_0x1bcee6){_0x1bcee6['forEach'](_0x5beeea=>{_0x5beeea['unlinkedAt']&&this['_attachArchivedThread'](_0x5beeea['id']);});}_getTargetForId(_0x23d9db){const _0x20837f=this['editor'],_0x4aa087=this['getAllMarkersForId'](_0x23d9db);return _0x5f3d7a(_0x20837f['editing'],_0x4aa087);}_getTextContext(_0x56c9bd){const _0x5df637=this['getAllMarkersForId'](_0x56c9bd);let _0x5edb07='',_0x3ec2ed=!0x1;for(const _0x1fb442 of _0x5df637){const _0x21d7e2=_0x1fb442['getRange']();for(const _0x3357ec of Array['from'](_0x21d7e2['getItems']()))_0x3357ec['is']('$textProxy')?(_0x5edb07&&_0x3ec2ed&&(_0x5edb07+='\x20',_0x3ec2ed=!0x1),_0x5edb07+=_0x3357ec['data']):_0x3ec2ed=!0x0;_0x3ec2ed=!0x0;}return _0x5edb07['substring'](0x0,0x96);}_attachMarkerToThread(_0x41ee3a,_0x84121){const _0x5d5ae4=this['editor'],_0x29757e=_0x5d5ae4['plugins']['get'](oi);let _0x1e9b4d=_0x29757e['getCommentThread'](_0x84121);const _0x52edaa=_0x5d5ae4['config']['get']('collaboration.channelId'),_0x2e58b1=_0x5d5ae4['plugins']['get'](di);return _0x1e9b4d&&(_0x1e9b4d['unlinkedAt']&&_0x1e9b4d['setUnlinkedAt'](null),_0x1e9b4d['isAttached'])||(this['getAllMarkersForId'](_0x84121)[0x0]['managedUsingOperations']?_0x29757e['fetchCommentThread']({'channelId':_0x52edaa,'threadId':_0x84121})['then'](_0x39cd0a=>{if('destroyed'!==_0x5d5ae4['state']){if(_0x1e9b4d=_0x39cd0a,_0x1e9b4d&&!_0x1e9b4d['isAttached']){const _0x414f3d=_0x1e9b4d['attachTo'](()=>this['_getTargetForId'](_0x84121));_0x2e58b1['registerAnnotation'](_0x414f3d),_0x1e9b4d['isResolved']&&this['_reconvertMarkers'](_0x84121);}else{if(!_0x1e9b4d){const _0xae2c5f=this['getAllMarkersForId'](_0x84121);_0x5d5ae4['model']['change'](_0x3b7d6f=>{for(const _0x2f8b13 of _0xae2c5f)_0x3b7d6f['removeMarker'](_0x2f8b13);});}}}}):_0x5d5ae4['editing']['view']['once']('render',()=>{if(_0x29757e['getCommentThread'](_0x84121))return;const _0x316d8d=_0x5d5ae4['plugins']['get'](ti);_0x1e9b4d=_0x29757e['openNewCommentThread']({'channelId':_0x52edaa,'threadId':_0x84121,'target':()=>this['_getTargetForId'](_0x84121),'context':{'type':'text','value':this['_getTextContext'](_0x84121)}});const _0x2e35c8=_0x29757e['_threadToController']['get'](_0x1e9b4d)['view'],_0x4c9fe4=_0x316d8d['getByInnerView'](_0x2e35c8);_0x4c9fe4&&_0x2e58b1['registerAnnotation'](_0x4c9fe4);},{'priority':'low'})),_0x1e9b4d;}['_handleThreadMarker'](_0x2b5ae2,_0x26d4f0){const _0xf979eb=this['_attachMarkerToThread'](_0x2b5ae2,_0x26d4f0);_0xf979eb&&!_0xf979eb['context']&&_0xf979eb['setContext']({'type':'text','value':this['_getTextContext'](_0x26d4f0)});}_initAriaMarkerChangeAnnouncements(){const _0x3a929f=this['editor'];_0x28d14d(_0x3a929f['model'],({left:_0x45742e,entered:_0x322883})=>{for(const _0x1d23c0 of _0x45742e)if(Ai(_0x1d23c0)){_0x3a929f['ui']['ariaLiveAnnouncer']['announce'](Et(_0x3a929f['locale'],'LEAVE_COMMENT_ANNOUNCEMENT'));break;}for(const _0x2b82d7 of _0x322883)if(Ai(_0x2b82d7)){_0x3a929f['ui']['ariaLiveAnnouncer']['announce'](Et(_0x3a929f['locale'],'ENTER_COMMENT_ANNOUNCEMENT',_0x36233f(_0x50afb7)));break;}});}};function gi(_0x40f0b4,_0x2ae6e5){return _0x2ae6e5?_0x40f0b4+':'+_0x2ae6e5:_0x40f0b4;}function _i(_0x3b76f5,_0x544ca6){const _0x3f6c2a=_0x544ca6['schema'],_0x153cca=_0x544ca6['createRange'](_0x3b76f5['start']);for(const _0x16c750 of _0x3b76f5['getWalker']()){const {type:_0x48f2d3,item:_0x1ebabf,nextPosition:_0x13458c}=_0x16c750;if('text'===_0x48f2d3||_0x3f6c2a['isObject'](_0x1ebabf)){const _0x40c87b=_0x544ca6['createPositionBefore'](_0x1ebabf);_0x153cca['isCollapsed']&&(_0x153cca['start']=_0x40c87b),_0x153cca['end']=_0x13458c;}}return _0x153cca;}function Ai(_0x205bf5){return'comment'===fi(_0x205bf5['name'])['group'];}var vi=class extends _0x433bd5{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'CommentsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[oi,wi,di,ti];}get CommentsListView(){return Lt;}get CommentThreadInputView(){return xt;}init(){const _0x3365aa=this['editor'],_0x3095c3=_0x3365aa['plugins']['get'](oi),_0x469bab=_0x3365aa['plugins']['get'](wi),_0x381887=_0x3365aa['plugins']['get'](ti),_0x1364da=_0x3365aa['plugins']['get'](di);_0x3365aa['ui']['componentFactory']['add']('comment',()=>{const _0x226a9f=this['_createUIButton'](_0x11e898);return _0x226a9f['tooltip']=!0x0,_0x226a9f;}),_0x3365aa['ui']['componentFactory']['add']('menuBar:comment',()=>this['_createUIButton'](rt)),_0x1364da['addSourceCollector'](()=>{const _0xcc104b=[];for(const [_0x239040,_0x2f93f6]of _0x3095c3['_threadToController']){const _0x23e4f6=_0x469bab['getAllMarkersForId'](_0x239040['id']),_0x484b97=_0x23e4f6['map'](_0x2911e0=>_0x2911e0['getRange']());_0x23e4f6['length']>0x0&&_0xcc104b['push']([_0x2f93f6['view'],_0x484b97]);}return _0xcc104b;}),this['listenTo'](_0x381887,'change:activeAnnotations',(_0x874b5f,_0x5708f4,_0x4c60fa)=>{const _0x56b517=Array['from'](_0x4c60fa)['map'](_0x5eef91=>_0x5eef91['innerView'])['find'](_0x31bec6=>_0x3095c3['_viewToController']['has'](_0x31bec6));if(!_0x56b517)return void(_0x469bab['activeMarker']=null);const _0x3a8167=_0x3095c3['_viewToController']['get'](_0x56b517)['model']['id'],_0x391f80='comment:'+_0x3a8167;_0x3a8167&&_0x469bab['hasMarkerForId'](_0x3a8167)?_0x469bab['activeMarker']=_0x391f80:_0x469bab['activeMarker']&&(_0x469bab['activeMarker']=null);}),this['listenTo'](_0x3095c3,'removeCommentThread',(_0x3bb65a,{threadId:_0x36ba55,isFromAdapter:_0x12cb5f})=>{!_0x12cb5f&&_0x3365aa['ui']['focusTracker']['isFocused']&&_0x469bab['hasMarkerForId'](_0x36ba55)&&_0x3365aa['editing']['view']['focus']();},{'priority':'highest'}),this['listenTo'](_0x3095c3,'addComment',(_0x15dfde,{threadId:_0x2fd057,isFromAdapter:_0x93957c})=>{!_0x93957c&&_0x469bab['hasMarkerForId'](_0x2fd057)&&_0x3095c3['hasCommentThread'](_0x2fd057)&&0x1===_0x3095c3['getCommentThread'](_0x2fd057)['length']&&(_0x3365aa['editing']['view']['focus'](),_0x15dfde['stop']());},{'priority':'low'}),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0xb9dedc=[this['editor']];for(const _0x576f94 of _0xb9dedc){let _0x26e4a1;for(const _0x1e2bdd in _0x576f94){const _0x358629=_0x1e2bdd,_0x288301=_0x576f94[_0x358629];if('commentsLicenseKeyValid'==_0x288301||'commentsLicenseKeyInvalid'==_0x288301||'commentsLicenseKeyExpired'==_0x288301||'commentsLicenseKeyDomainLimit'==_0x288301||'commentsLicenseKeyNotAllowed'==_0x288301||'commentsLicenseKeyEvaluationLimit'==_0x288301||'commentsLicenseKeyUsageLimit'==_0x288301){delete _0x576f94[_0x358629],_0x26e4a1=_0x288301,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'commentsLicenseKeyInvalid'==_0x26e4a1&&_0x576f94['_showLicenseError']('invalid'),'commentsLicenseKeyExpired'==_0x26e4a1&&_0x576f94['_showLicenseError']('expired'),'commentsLicenseKeyDomainLimit'==_0x26e4a1&&_0x576f94['_showLicenseError']('domainLimit'),'commentsLicenseKeyNotAllowed'==_0x26e4a1&&_0x576f94['_showLicenseError']('featureNotAllowed','Comments'),'commentsLicenseKeyEvaluationLimit'==_0x26e4a1&&_0x576f94['_showLicenseError']('evaluationLimit'),'commentsLicenseKeyUsageLimit'==_0x26e4a1&&_0x576f94['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_createUIButton(_0x33034f){const _0x3744c2=this['editor'],_0xdd2d08=new _0x33034f(_0x3744c2['locale']),_0x459b4b=_0x3744c2['commands']['get']('addCommentThread');return _0xdd2d08['set']({'label':Et(_0x3744c2['locale'],'Comment'),'icon':_0x1e8488}),_0xdd2d08['bind']('isEnabled')['to'](_0x459b4b,'isEnabled',_0x459b4b,'hasContent',(_0x12039a,_0x47563d)=>_0x12039a&&_0x47563d),this['listenTo'](_0xdd2d08,'execute',()=>{_0x459b4b['execute']();}),_0xdd2d08;}},yi=class extends _0x433bd5{static get['pluginName'](){return'CommentsOnly';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[wi];}constructor(_0x317b49){super(_0x317b49),this['set']('isEnabled',!0x1),this['on']('change:isEnabled',(_0x336ac7,_0x2414bf,_0x35b0a6)=>{_0x35b0a6?this['_enableCommentsOnlyMode']():this['_disableCommentsOnlyMode']();});}afterInit(){!this['isEnabled']&&this['editor']['config']['get']('commentsOnly')&&(this['isEnabled']=!0x0);}_enableCommentsOnlyMode(){for(const [_0x2699cd,_0x42ecab]of this['editor']['commands'])_0x42ecab['affectsData']&&'addCommentThread'!==_0x2699cd&&_0x42ecab['forceDisabled']('commentsOnlyMode');this['editor']['plugins']['has']('DragDrop')&&this['editor']['plugins']['get']('DragDrop')['forceDisabled']('commentsOnlyMode'),this['editor']['plugins']['has']('RevisionTracker')&&this['editor']['plugins']['get']('RevisionTracker')['forceDisabled']('commentsOnlyMode'),this['editor']['plugins']['has']('SourceEditing')&&this['editor']['plugins']['get']('SourceEditing')['forceDisabled']('commentsOnlyMode'),this['editor']['commands']['get']('editSource')?.['forceDisabled']('commentsOnlyMode');const _0x3beea2=this['editor']['editing']['view']['document'];this['listenTo'](_0x3beea2,'cut',_0x4101b1=>_0x4101b1['stop'](),{'priority':'highest'}),this['listenTo'](_0x3beea2,'clipboardInput',_0x5d336f=>_0x5d336f['stop'](),{'priority':'highest'}),this['listenTo'](_0x3beea2,'delete',_0x562c6f=>_0x562c6f['stop'](),{'priority':'highest'});}_disableCommentsOnlyMode(){for(const [_0x22bb2e,_0x365dc5]of this['editor']['commands'])_0x365dc5['affectsData']&&'addCommentThread'!==_0x22bb2e&&_0x365dc5['clearForceDisabled']('commentsOnlyMode');this['editor']['plugins']['has']('RevisionTracker')&&this['editor']['plugins']['get']('RevisionTracker')['clearForceDisabled']('commentsOnlyMode'),this['editor']['plugins']['has']('SourceEditing')&&this['editor']['plugins']['get']('SourceEditing')['clearForceDisabled']('commentsOnlyMode'),this['editor']['commands']['get']('editSource')?.['clearForceDisabled']('commentsOnlyMode'),this['stopListening'](this['editor']['editing']['view']['document']);}},Ti=class extends _0x183782{activeUIs;uisData;['_uis'];static get requires(){return[ti];}static get['pluginName'](){return'AnnotationsUIs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2db769){super(_0x2db769),this['activeUIs']=new Set(),this['_uis']=new Map(),this['uisData']=new Map();}init(){const _0x5a514d=this['context']['plugins']['get'](ti);this['listenTo'](_0x5a514d,'_activateAnnotation',(_0x4ac3dd,_0x71f7a9)=>{for(const _0x309a46 of this['activeUIs']){const _0x32cc33=this['_uis']['get'](_0x309a46);(0x0,this['uisData']['get'](_0x309a46)['filter'])(_0x71f7a9)&&_0x32cc33['setActiveAnnotation'](_0x71f7a9);}}),this['listenTo'](_0x5a514d,'_deactivateAllAnnotations',()=>{for(const _0x34ce7b of this['activeUIs'])this['_uis']['get'](_0x34ce7b)['setActiveAnnotation'](null);}),this['listenTo'](_0x5a514d['_visibleAnnotations'],'add',(_0x1b21d7,_0x3e0282)=>{this['_assertAnnotationDoesNotBelongToMultipleUIs'](_0x3e0282);});}hasActive(){return this['activeUIs']['size']>0x0;}isActive(_0x3a0a9d){return this['activeUIs']['has'](_0x3a0a9d);}activate(_0x5de4a8,_0x3d8d42=this['defaultFilter']){const _0x47676d=this['context']['plugins']['get'](ti);if(!this['_uis']['has'](_0x5de4a8))throw new _0x4dbbfc('annotationsuis-missing-ui',this,{'uiName':_0x5de4a8});this['isActive'](_0x5de4a8)&&this['deactivate'](_0x5de4a8),this['activeUIs']['add'](_0x5de4a8);const _0x12bd76=new Jt();Qt({'source':_0x47676d['_visibleAnnotations'],'target':_0x12bd76,'filter':_0x3d8d42}),this['uisData']['set'](_0x5de4a8,{'collection':_0x12bd76,'filter':_0x3d8d42});const _0x9f96d1=this['_uis']['get'](_0x5de4a8);_0x9f96d1['attach'](_0x12bd76),this['listenTo'](_0x9f96d1,'change:activeAnnotation',(_0x3dcc3c,_0x439827,_0x59ef2e,_0x5166a6)=>{_0x5166a6&&_0x47676d['_removeActiveAnnotation'](_0x5166a6),_0x59ef2e&&_0x47676d['_addActiveAnnotation'](_0x59ef2e);});}deactivate(_0x50ef37){if(this['activeUIs']['delete'](_0x50ef37),!this['_uis']['has'](_0x50ef37))throw new _0x4dbbfc('annotationsuis-missing-ui',this,{'uiName':_0x50ef37});const _0x69ed41=this['_uis']['get'](_0x50ef37);_0x69ed41['detach'](),this['stopListening'](_0x69ed41),this['uisData']['get'](_0x50ef37)['collection']['destroy'](),this['uisData']['delete'](_0x50ef37);}switchTo(_0x1505cf){if(!this['_uis']['has'](_0x1505cf))throw new _0x4dbbfc('annotationsuis-missing-ui',this,{'uiName':_0x1505cf});const _0x32d7a7=this['context']['plugins']['get'](ti),_0x3a93b8=Array['from'](_0x32d7a7['activeAnnotations'])[0x0]||null;this['deactivateAll'](),this['activate'](_0x1505cf);const _0x5571bd=this['_uis']['get'](_0x1505cf);_0x5571bd['setActiveAnnotation'](_0x3a93b8),_0x5571bd['_setSelectedAnnotations']&&_0x3a93b8&&_0x5571bd['_setSelectedAnnotations']([_0x3a93b8]);}deactivateAll(){for(const _0x3067ee of this['activeUIs'])this['deactivate'](_0x3067ee);}register(_0x180046,_0x1dcbd5){if(this['_uis']['has'](_0x180046))throw new _0x4dbbfc('annotationsuis-register-already-registered');if('function'!=typeof _0x1dcbd5['attach']||'function'!=typeof _0x1dcbd5['detach']||'function'!=typeof _0x1dcbd5['setActiveAnnotation'])throw new _0x4dbbfc('annotationsuis-register-invalid-interface',null);this['_uis']['set'](_0x180046,_0x1dcbd5);}refilterAnnotations(){const _0x488caa=this['context']['plugins']['get'](ti)['collection'],_0x543a2a=new Map(),_0x270890=Array['from'](this['activeUIs']);for(const _0x9a2183 of this['activeUIs']){const _0x2dc42d=this['uisData']['get'](_0x9a2183)['collection'];for(const _0x3b8146 of _0x2dc42d)_0x543a2a['set'](_0x3b8146,_0x9a2183);}for(const _0xf92c7 of _0x488caa){const _0x39c398=_0x543a2a['get'](_0xf92c7);this['_assertAnnotationDoesNotBelongToMultipleUIs'](_0xf92c7);const _0x1bfc17=_0x270890['find'](_0x4fe346=>this['uisData']['get'](_0x4fe346)['filter'](_0xf92c7));_0x39c398!==_0x1bfc17&&(_0x39c398&&this['uisData']['get'](_0x39c398)['collection']['remove'](_0xf92c7),_0x1bfc17&&this['uisData']['get'](_0x1bfc17)['collection']['add'](_0xf92c7));}}destroy(){this['deactivateAll'](),super['destroy']();}defaultFilter(){return!0x0;}_assertAnnotationDoesNotBelongToMultipleUIs(_0x5e82f0){const _0x2aeb40=[];for(const _0x509d5f of this['activeUIs']){(0x0,this['uisData']['get'](_0x509d5f)['filter'])(_0x5e82f0)&&_0x2aeb40['push'](_0x509d5f);}if(_0x2aeb40['length']>0x1)throw new _0x4dbbfc('annotationsuis-annotation-mismatch',null,{'matchedUIs':_0x2aeb40,'annotationType':_0x5e82f0['type']});}};const Ci=/* #__PURE__ -- @preserve */
|
|
32
|
+
_0x48a7e8('px');var Ii=class extends ht{list;['focusables'];['focusTracker'];['focusCycler'];constructor(_0x24bd8f){super(_0x24bd8f);const _0x408239=this['bindTemplate'];this['set']('minHeight',0x0),this['set']('class',''),this['list']=this['createCollection'](),this['focusables']=this['createCollection'](),this['list']['delegate']('arrowup','arrowdown')['to'](this),this['focusTracker']=new _0x51fffd(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker']}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-sidebar','ck-reset',_0x408239['to']('class')],'style':{'minHeight':_0x408239['to']('minHeight',_0x4ad507=>'number'==typeof _0x4ad507?Ci(_0x4ad507+0xa):null)},'dir':_0x24bd8f['uiLanguageDirection'],'role':'application','aria-label':Et(_0x24bd8f,'Annotations\x20sidebar'),'tabindex':0x0},'children':[{'tag':'div','attributes':{'role':'list','aria-label':Et(_0x24bd8f,'Annotations\x20list')},'children':this['list']}]});}['render'](){super['render'](),this['_setupKeyboardNavigation']();}['focus'](){this['focusCycler']['focusFirst']();}_setupKeyboardNavigation(){this['list']['delegate']('change:top')['to'](this),this['on']('change:top',_0x3a5ae5=>{this['_updateItemPositionInFocusables'](_0x3a5ae5['source']);}),this['list']['forEach'](_0x2e0c0d=>{this['focusTracker']['add'](_0x2e0c0d['element']),this['_updateItemPositionInFocusables'](_0x2e0c0d);}),this['list']['on']('change',(_0x4f8c4f,_0x38cedf)=>{for(const _0x42704f of _0x38cedf['removed'])this['focusTracker']['remove'](_0x42704f['element']),this['focusables']['remove'](_0x42704f);for(const _0x355983 of _0x38cedf['added'])this['focusTracker']['add'](_0x355983['element']),this['_updateItemPositionInFocusables'](_0x355983);}),this['on']('arrowup',()=>{this['focusCycler']['focusPrevious']();}),this['on']('arrowdown',()=>{this['focusCycler']['focusNext']();}),this['listenTo'](this['element'],'focus',()=>{this['focus']();});}_updateItemPositionInFocusables(_0x5f0bf6){const _0x3e29f7=this['focusables']['getIndex'](_0x5f0bf6);let _0x3c4a28,_0x31e714;for(const _0x2a397d of this['focusables'])if(_0x5f0bf6['top']<_0x2a397d['top']){_0x3c4a28=_0x2a397d;break;}if(_0x31e714=_0x3c4a28?this['focusables']['getIndex'](_0x3c4a28):this['focusables']['length'],-0x1!==_0x3e29f7){if(_0x3e29f7===_0x31e714-0x1)return;this['focusables']['remove'](_0x5f0bf6),_0x31e714=_0x3c4a28?this['focusables']['getIndex'](_0x3c4a28):this['focusables']['length'];}this['focusables']['add'](_0x5f0bf6,_0x31e714);}};const bi=/* #__PURE__ -- @preserve */
|
|
33
|
+
_0x48a7e8('px');var Ei=class extends ht{content;_targetTop;_mutationObserver;constructor(_0x5bc53f){super(_0x5bc53f),this['set']('top',0x0),this['set']('height',0x0),this['bind']('bottom')['to'](this,'top',this,'height',(_0x316cda,_0x44e8b1)=>_0x316cda+_0x44e8b1),this['set']('isAnimationDisabled',!0x1),this['_mutationObserver']=Xt(()=>this['updateHeight']()),this['_targetTop']=null,this['content']=this['createCollection'](),this['content']['delegate']('arrowup','arrowdown')['to'](this);const _0x232e22=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-sidebar-item',_0x232e22['to']('isAnimationDisabled',_0x4cc756=>_0x4cc756?'ck-sidebar-item--no-animation':'')],'style':{'top':_0x232e22['to']('top',_0x390e37=>bi(_0x390e37))},'role':'presentation'},'children':this['content']});}['render'](){super['render'](),this['_mutationObserver']['attach'](this['element']);}['focus'](){this['content']['first']&&this['content']['first']['focus']();}updateHeight(){const _0x1989ba=this['element']['clientHeight'];_0x1989ba&&(this['height']=_0x1989ba);}destroy(){this['content']['clear'](),this['_mutationObserver']['detach'](),super['destroy']();}},ki=class extends _0x183782{['view'];_activeAnnotation;_annotations;_spaceBetweenItems;_sidebarItemViewToAnnotation;_annotationToSidebarItemView;_recalculateBuffer;static get['pluginName'](){return'Sidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xf913bd){super(_0xf913bd),this['set']('_lastItem',void 0x0),this['view']=this['_createSidebarView'](),this['set']('container',null),this['_spaceBetweenItems']=0x19,this['_sidebarItemViewToAnnotation']=new Map(),this['_annotationToSidebarItemView']=new Map(),this['context']['config']['define']('sidebar.preventScrollOutOfView',!0x1),this['_annotations']=null,this['_activeAnnotation']=null,this['_recalculateBuffer']=[];}init(){const _0x16fc61=this['context']['config']['get']('sidebar.container');_0x16fc61&&this['setContainer'](_0x16fc61);}setContainer(_0x50982f){if(!Oi(_0x50982f))throw new _0x4dbbfc('sidebar-setcontainer-invalid-element');this['container']=_0x50982f;}_attachToContainer({viewClass:_0x565319='',spaceBetweenItems:_0x27819e=0x19}={}){if(!Oi(this['container']))throw new _0x4dbbfc('sidebar-attachtocontainer-missing-container',this);this['container']['appendChild'](this['view']['element']),this['view']['class']=_0x565319,this['_spaceBetweenItems']=_0x27819e;}['rearrange']({removedAnnotation:_0xa6af1e,previousAnnotation:_0x366eba,nextAnnotation:_0x132583}){const _0x2b1dfe=this['getSidebarItemView'](_0xa6af1e);this['view']['list']['remove'](_0x2b1dfe),this['_destroySidebarItemView'](_0xa6af1e),_0x366eba&&this['_alignToTargetRect'](this['getSidebarItemView'](_0x366eba)),_0x132583&&this['_alignToTargetRect'](this['getSidebarItemView'](_0x132583)),this['_updateLastItem']();}['refresh']({blurredAnnotation:_0x969984,activatedAnnotation:_0x4f3ead,disableAnimationOnActivatedAnnotation:_0x2ca564}){if(this['_activeAnnotation']=_0x4f3ead,_0x969984){_0x969984['isActive']=!0x1;const _0x505e52=this['getSidebarItemView'](_0x969984);_0x505e52&&_0x2ca564&&(_0x505e52['isAnimationDisabled']=!0x1);}if(_0x4f3ead){const _0xdd281b=this['getSidebarItemView'](_0x4f3ead);_0xdd281b&&(_0x4f3ead['isActive']=!0x0,_0x2ca564&&(_0xdd281b['isAnimationDisabled']=!0x0,_0xdd281b['top']+=0x1),this['_alignToTargetRect'](_0xdd281b));}}_detachFromContainer(_0x510a1a){if(this['view']['element']['remove'](),_0x510a1a){for(const _0x29edc6 of _0x510a1a)this['_destroySidebarItemView'](_0x29edc6);}this['view']['list']['clear'](),this['view']['class']='',this['_lastItem']=null;}addAnnotation(_0x401497,_0x2e95ad){_0x2e95ad||(_0x2e95ad=_0x401497['view']);const _0x389dbf=new Ei(this['context']['locale']);this['_sidebarItemViewToAnnotation']['set'](_0x389dbf,_0x401497),this['_annotationToSidebarItemView']['set'](_0x401497,_0x389dbf),_0x389dbf['content']['add'](_0x2e95ad),this['listenTo'](_0x401497['view'],'change:targetRect',(_0x1147ac,_0x485202,_0x5a1c7e)=>{const _0x14a3fe=this['_getTargetTop'](_0x401497,_0x5a1c7e);_0x389dbf['_targetTop']!=_0x14a3fe&&(_0x389dbf['_targetTop']=_0x14a3fe,this['_setItemTop'](_0x389dbf,_0x14a3fe));}),this['listenTo'](_0x389dbf,'change:top',()=>{this['_recalculate'](_0x389dbf,'top');}),this['listenTo'](_0x389dbf,'change:bottom',()=>{this['_recalculate'](_0x389dbf,'bottom');}),this['_alignToTargetRect'](_0x389dbf);const _0x553584=this['_getItemBefore'](_0x389dbf);return _0x553584&&this['_alignAfterItem'](_0x553584,_0x389dbf)||this['_alignToTargetRect'](_0x389dbf),this['_updateLastItem'](),this['view']['list']['add'](_0x389dbf),_0x389dbf;}['_alignForTopChange'](_0x204677){if(!_0x204677['content']['length'])return;const _0x1e3012=this['_getItemBefore'](_0x204677);if(!_0x1e3012)return;const _0x1952c1=this['_sidebarItemViewToAnnotation']['get'](_0x1e3012),_0x5760e9=this['_activeAnnotation'];_0x5760e9&&_0x5760e9===_0x1952c1?this['_alignAfterItem'](_0x1e3012,_0x204677):this['_alignBeforeItem'](_0x204677,_0x1e3012);}_alignForBottomChange(_0x5d0b21){if(!_0x5d0b21['content']['length'])return;const _0x2e2ff2=this['_getItemAfter'](_0x5d0b21);if(!_0x2e2ff2)return;const _0x1bf972=this['_sidebarItemViewToAnnotation']['get'](_0x2e2ff2),_0x42af38=this['context']['config']['get']('sidebar.preventScrollOutOfView'),_0x3a381c=this['_activeAnnotation'];_0x3a381c&&_0x3a381c===_0x1bf972&&_0x42af38?(this['_alignBeforeItem'](_0x2e2ff2,_0x5d0b21),this['_alignAfterItem'](_0x5d0b21,_0x2e2ff2)):_0x3a381c&&_0x3a381c===_0x1bf972?this['_alignBeforeItem'](_0x2e2ff2,_0x5d0b21):this['_alignAfterItem'](_0x5d0b21,_0x2e2ff2);}_recalculate(_0x53fe7d,_0x4e70f1){0x0===this['_recalculateBuffer']['length']&&setTimeout(()=>{for(const {sidebarItemView:_0x5d8792,changedProp:_0x11903c}of this['_recalculateBuffer'])'top'===_0x11903c?this['_alignForTopChange'](_0x5d8792):this['_alignForBottomChange'](_0x5d8792);this['_recalculateBuffer']=[];},0xa),this['_recalculateBuffer']['push']({'sidebarItemView':_0x53fe7d,'changedProp':_0x4e70f1});}getSidebarItemView(_0x3f1514){return this['_annotationToSidebarItemView']['get'](_0x3f1514);}destroy(){this['stopListening'](),this['view']['destroy']();}_destroySidebarItemView(_0x334d19){const _0x27b204=this['getSidebarItemView'](_0x334d19);this['stopListening'](_0x27b204),this['stopListening'](_0x334d19['view']),_0x27b204['destroy'](),this['_annotationToSidebarItemView']['delete'](_0x334d19),this['_sidebarItemViewToAnnotation']['delete'](_0x27b204);}_createSidebarView(){const _0x2d1c12=new Ii(this['context']['locale']);return _0x2d1c12['render'](),this['on']('change:_lastItem',(_0x315e0e,_0xd01da1,_0x24de00,_0x1dd555)=>{_0x1dd555&&_0x2d1c12['unbind']('minHeight'),_0x24de00?_0x2d1c12['bind']('minHeight')['to'](_0x24de00,'bottom'):_0x2d1c12['minHeight']=null;}),_0x2d1c12;}_updateLastItem(){this['_lastItem']=this['_annotations']?.['last']?this['getSidebarItemView'](this['_annotations']['last']):null;}_getItemBefore(_0x1b3a7a){const _0x1b6728=this['_sidebarItemViewToAnnotation']['get'](_0x1b3a7a),_0x2f7d04=_0x1b6728&&this['_annotations']?.['get'](this['_annotations']['getIndex'](_0x1b6728)-0x1);return _0x2f7d04&&this['getSidebarItemView'](_0x2f7d04)||null;}_getItemAfter(_0x5807a1){const _0x12b589=this['_sidebarItemViewToAnnotation']['get'](_0x5807a1),_0x41e348=_0x12b589&&this['_annotations']?.['get'](this['_annotations']['getIndex'](_0x12b589)+0x1);return _0x41e348&&this['getSidebarItemView'](_0x41e348)||null;}_alignBeforeItem(_0x219a3f,_0x5c8076){_0x219a3f['updateHeight']();const _0xa12f4a=Ni(_0x5c8076['bottom']+this['_spaceBetweenItems'],_0x219a3f['top']);return!!_0xa12f4a&&(this['_setItemTop'](_0x5c8076,_0x5c8076['top']-_0xa12f4a),!0x0);}_alignAfterItem(_0x2f1a5d,_0x58f5bc){_0x2f1a5d['updateHeight']();const _0x28b7a6=Ni(_0x2f1a5d['bottom']+this['_spaceBetweenItems'],_0x58f5bc['top']);return!!_0x28b7a6&&(this['_setItemTop'](_0x58f5bc,_0x58f5bc['top']+_0x28b7a6,!0x1),!0x0);}_alignToTargetRect(_0x793752){const _0x572c77=this['_sidebarItemViewToAnnotation']['get'](_0x793752);if(!_0x572c77||!_0x572c77['target']||!_0x572c77['targetRect'])return;const _0xe1c33=this['_getTargetTop'](_0x572c77,_0x572c77['targetRect']);this['_setItemTop'](_0x793752,_0xe1c33);}_getTargetTop(_0x5e8e50,_0x5087c9){if(null===_0x5087c9)return 0x0;if(_0x5e8e50['target']instanceof _0x563bd7)return _0x5087c9['top'];{const _0x7694ee=new _0x563bd7(this['view']['element'])['top'];return _0x5087c9['top']-_0x7694ee;}}_setItemTop(_0x202277,_0xc7926f,_0x5b4852=this['context']['config']['get']('sidebar.preventScrollOutOfView')){_0x5b4852&&(_0xc7926f=Math['max'](_0xc7926f,this['_getMaxAvailableTop'](_0x202277))),_0x202277['top']=_0xc7926f;}_getMaxAvailableTop(_0x4883c1){let _0x35ecda=this['_getItemBefore'](_0x4883c1),_0x3d31cf=0x0;for(;_0x35ecda;)_0x35ecda['updateHeight'](),_0x3d31cf+=this['_spaceBetweenItems']+_0x35ecda['height'],_0x35ecda=this['_getItemBefore'](_0x35ecda);return _0x3d31cf;}};function Ni(_0x18b7d2,_0x3484d2){return Math['max'](_0x18b7d2-_0x3484d2,0x0);}function Oi(_0x17dc30){return null!==_0x17dc30&&'object'==typeof _0x17dc30&&0x1===_0x17dc30['nodeType'];}var Mi=class extends _0x183782{isAttached;annotations;_editorAnnotations;_refreshPositioningDebounced;static get requires(){return[ki,Ti];}static get['pluginName'](){return'WideSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xd901a2){super(_0xd901a2),this['isAttached']=!0x1,this['set']('activeAnnotation',null),this['annotations']=null,this['_editorAnnotations']=new _0x1e0fc8(),this['_refreshPositioningDebounced']=_0x5b7667(()=>{_0xd901a2['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning']();},0xfa,{'leading':!0x1});}init(){const _0x45c5d7=this['context']['plugins']['get'](Ti),_0x4f3d57=this['context']['plugins']['get'](ki);_0x45c5d7['register']('wideSidebar',this),_0x4f3d57['container']&&_0x45c5d7['switchTo']('wideSidebar');}setActiveAnnotation(_0x2815a5){if(_0x2815a5===this['activeAnnotation'])return;const _0x3590dc=this['context']['plugins']['get'](ki);_0x3590dc['_activeAnnotation']=_0x2815a5;const _0x4b8bca=this['activeAnnotation'];_0x3590dc['refresh']({'blurredAnnotation':_0x4b8bca,'activatedAnnotation':_0x2815a5}),this['activeAnnotation']=_0x2815a5;}attach(_0x370b66){this['annotations']=_0x370b66;const _0x41d614=this['context']['plugins']['get'](ki);if(_0x41d614['_annotations']=_0x370b66,this['isAttached'])throw new _0x4dbbfc('widesidebar-attach-already-attached',this);this['isAttached']=!0x0,this['listenTo'](_0x41d614,'set:container',()=>{this['detach'](),this['listenTo'](_0x41d614,'change:container',_0x7e1c28=>{_0x7e1c28['off'](),this['attach'](_0x370b66);});}),_0x41d614['_attachToContainer']({'viewClass':'ck-sidebar--wide'});const _0x2598a8=_0x2c5595=>{_0x2c5595['updateTargetRect'](),_0x41d614['addAnnotation'](_0x2c5595);};for(const _0x249030 of _0x370b66)_0x2598a8(_0x249030);this['listenTo'](_0x370b66,'add',(_0x21e39b,_0x8861a)=>{_0x2598a8(_0x8861a);}),this['listenTo'](_0x370b66,'remove',(_0x1ff25e,_0x4f8439,_0x425298)=>{_0x41d614['rearrange']({'removedAnnotation':_0x4f8439,'previousAnnotation':_0x370b66['get'](_0x425298-0x1),'nextAnnotation':_0x370b66['get'](_0x425298+0x1)}),_0x4f8439===this['activeAnnotation']&&this['setActiveAnnotation'](null);},{'priority':'high'}),this['listenTo'](_0x370b66,'focus',(_0x351eaf,_0x14e816)=>{this['setActiveAnnotation'](_0x14e816);}),this['listenTo'](_0x370b66,'blur',()=>{this['setActiveAnnotation'](null);});const _0xdde476=this['context']instanceof _0x238a82?this['context']['editors']:new _0x1e0fc8([this['context']]);for(const _0x3e08e9 of _0xdde476)this['_integrateWithEditorAnnotations'](_0x3e08e9);this['listenTo'](_0xdde476,'add',(_0x36afb2,_0x4952cd)=>{this['listenTo'](_0x4952cd,'ready',()=>{this['_integrateWithEditorAnnotations'](_0x4952cd);});}),this['listenTo'](_0xdde476,'remove',(_0xb9e328,_0x2c6b33)=>{_0x2c6b33['plugins']['has']('EditorAnnotations')&&this['_destroyEditorAnnotationsIntegration'](_0x2c6b33['plugins']['get']('EditorAnnotations'));}),window['addEventListener']('resize',this['_refreshPositioningDebounced']),this['context']['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning']();}detach(){if(!this['isAttached'])throw new _0x4dbbfc('widesidebar-detach-not-attached',this);this['setActiveAnnotation'](null);const _0x5c467d=this['context']['plugins']['get'](ki);_0x5c467d['_detachFromContainer'](this['annotations']),this['stopListening'](_0x5c467d),this['stopListening'](this['annotations']),this['context']instanceof _0x238a82&&this['stopListening'](this['context']['editors']);for(const _0x4f318c of Array['from'](this['_editorAnnotations']))this['_destroyEditorAnnotationsIntegration'](_0x4f318c);window['removeEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioningDebounced']['cancel'](),this['activeAnnotation']=null,this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach']();}_integrateWithEditorAnnotations(_0x1b7e8e){if(!_0x1b7e8e['plugins']['has']('EditorAnnotations'))return;const _0x17dde4=_0x1b7e8e['plugins']['get']('EditorAnnotations'),_0x1ca821=()=>{const _0x163553=_0x17dde4['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});this['setActiveAnnotation'](_0x163553[0x0]||null);};this['listenTo'](_0x17dde4,'refresh',_0x1ca821),this['listenTo'](_0x17dde4,'blur',(_0x8147d5,{isAnnotationTracked:_0x12c6ac})=>{this['activeAnnotation']&&_0x12c6ac(this['activeAnnotation'])&&this['setActiveAnnotation'](null);}),this['listenTo'](_0x17dde4,'uiUpdate',()=>{this['_refreshPositioningDebounced']();}),this['listenTo'](this['annotations'],'blur',_0x1aa8a3=>{_0x17dde4['hasDomSelection']()&&(_0x1ca821(),_0x1aa8a3['stop']());},{'priority':'high'}),this['_editorAnnotations']['add'](_0x17dde4);}_destroyEditorAnnotationsIntegration(_0x45cb46){this['stopListening'](_0x45cb46),this['_editorAnnotations']['remove'](_0x45cb46);}},Ri=class extends _0x11e898{counterView;constructor(_0x5cd1de){super(_0x5cd1de);const _0x37a52b=this['bindTemplate'];this['set']('isDirty',!0x1),this['set']('number',0x0),this['bind']('_badge')['to'](this,'isDirty',this,'number',(_0x9d6305,_0x5afb5e)=>_0x9d6305?'...':_0x5afb5e['toString']()),this['set']('annotationType',''),this['icon']=_0x1e8488,this['extendTemplate']({'attributes':{'class':['ck-annotation-counter']}}),this['counterView']=new ht(),this['counterView']['setTemplate']({'tag':'span','attributes':{'class':['ck-annotation-counter__badge',_0x37a52b['to']('annotationType',_0x21695b=>'ck-annotation-counter__badge--'+_0x21695b),_0x37a52b['if']('isDirty','ck-annotation-counter__badge--edit-mode')]},'children':[{'text':_0x37a52b['to']('_badge')}]}),this['children']['add'](this['counterView']);}},Si=class extends _0x183782{isAttached;annotations;_manuallyClosedAnnotationViews;_domEmitter;_annotationToNarrowView;_selectedAnnotations;_editorAnnotations;_refreshPositioningDebounced;static get requires(){return[ki,Ti];}static get['pluginName'](){return'NarrowSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x401727){super(_0x401727),this['isAttached']=!0x1,this['_manuallyClosedAnnotationViews']=new Set(),this['_domEmitter']=new(_0x1cdcc3())(),this['_annotationToNarrowView']=new Map(),this['set']('activeAnnotation',null),this['annotations']=null,this['_selectedAnnotations']=[],this['_editorAnnotations']=new _0x1e0fc8(),this['_refreshPositioningDebounced']=_0x5b7667(()=>{this['_refreshPositioning']();},0xfa,{'leading':!0x1});}init(){this['context']['plugins']['get'](Ti)['register']('narrowSidebar',this),this['bodyCollection']=new _0x2a9375(this['context']['locale']),this['balloonPanelView']=new _0x1cf306(this['context']['locale']),this['bodyCollection']['attachToDom'](),this['bodyCollection']['add'](this['balloonPanelView']);}attach(_0x4d7079){this['annotations']=_0x4d7079;const _0x128546=this['context']['plugins']['get'](ki),_0x331ada=this['balloonPanelView'];if(_0x128546['_annotations']=_0x4d7079,this['isAttached'])throw new _0x4dbbfc('narrowsidebar-attach-already-attached',this);this['isAttached']=!0x0,this['listenTo'](_0x128546,'set:container',()=>{this['detach'](),this['listenTo'](_0x128546,'change:container',_0x45bbfd=>{_0x45bbfd['off'](),this['attach'](_0x4d7079);});}),_0x128546['_attachToContainer']({'viewClass':'ck-sidebar--narrow','spaceBetweenItems':0x5});const _0x1fdeaa=_0x44b641=>{const _0x1a677b=new Ri(this['context']['locale']);_0x128546['addAnnotation'](_0x44b641,_0x1a677b),this['_annotationToNarrowView']['set'](_0x44b641,_0x1a677b),_0x1a677b['bind']('isDirty','annotationType','number')['to'](_0x44b641['view'],'isDirty','type','length'),_0x1a677b['on']('execute',()=>{this['_manuallyClosedAnnotationViews']['clear'](),_0x331ada['content']['first']!==_0x44b641['view']?(this['_showBalloon'](_0x44b641),_0x44b641['view']['element']['focus'](),this['setActiveAnnotation'](_0x44b641)):this['setActiveAnnotation'](null);});};for(const _0x417b5f of _0x4d7079)_0x1fdeaa(_0x417b5f);this['listenTo'](_0x4d7079,'add',(_0x3bb16d,_0x2361f6)=>{_0x1fdeaa(_0x2361f6);}),this['listenTo'](_0x4d7079,'remove',(_0x4f4125,_0x39b831,_0x55dfdc)=>{this['_annotationToNarrowView']['get'](_0x39b831)['destroy'](),this['_annotationToNarrowView']['delete'](_0x39b831),_0x128546['rearrange']({'removedAnnotation':_0x39b831,'previousAnnotation':_0x4d7079['get'](_0x55dfdc-0x1),'nextAnnotation':_0x4d7079['get'](_0x55dfdc+0x1)}),_0x39b831===this['activeAnnotation']&&this['setActiveAnnotation'](null);},{'priority':'low'}),this['listenTo'](_0x4d7079,'focus',(_0x189b25,_0x347576)=>{this['setActiveAnnotation'](_0x347576);}),this['listenTo'](_0x4d7079,'blur',()=>{this['setActiveAnnotation'](null);}),this['_domEmitter']['listenTo'](document,'keydown',(_0x204b2f,_0x84fc04)=>{_0x84fc04['keyCode']===_0x21e74e['esc']&&_0x331ada['isVisible']&&(this['_manuallyClosedAnnotationViews']['add'](_0x331ada['content']['first']),this['_hideBalloon'](),_0x84fc04['stopPropagation'](),_0x84fc04['preventDefault']());}),this['_domEmitter']['listenTo'](document,'mousedown',(_0x466a8a,_0x30dd79)=>{const _0x2a354d=_0x30dd79['target'];_0x331ada['isVisible']&&_0x331ada['element']['contains'](_0x2a354d)||_0x128546['view']['element']['contains'](_0x2a354d)||_0x466a8a['preventClosingBalloon']||this['activeAnnotation']&&this['activeAnnotation']['focusableElements']['find'](_0x3fb5aa=>_0x3fb5aa['contains'](_0x2a354d))||(this['_manuallyClosedAnnotationViews']['clear'](),this['_hideBalloon'](),this['setActiveAnnotation'](null));});const _0x560cab=this['context']instanceof _0x238a82?this['context']['editors']:new _0x1e0fc8([this['context']]);for(const _0x59126a of _0x560cab)this['_integrateWithEditorAnnotations'](_0x59126a);this['listenTo'](_0x560cab,'add',(_0x4b9dd4,_0x37ee91)=>{this['listenTo'](_0x37ee91,'ready',()=>{this['_integrateWithEditorAnnotations'](_0x37ee91);});}),this['listenTo'](_0x560cab,'remove',(_0x2c8a11,_0x329a06)=>{_0x329a06['plugins']['has']('EditorAnnotations')&&this['_destroyEditorAnnotationsIntegration'](_0x329a06['plugins']['get']('EditorAnnotations'));}),window['addEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioning']();}setActiveAnnotation(_0x23dd04){if(_0x23dd04===this['activeAnnotation'])return;const _0x2f9fb7=this['context']['plugins']['get'](ki);_0x2f9fb7['refresh']({'blurredAnnotation':this['activeAnnotation'],'activatedAnnotation':_0x23dd04,'disableAnimationOnActivatedAnnotation':!0x0}),_0x23dd04&&_0x2f9fb7['getSidebarItemView'](_0x23dd04)?this['_showBalloon'](_0x23dd04):this['_hideBalloon'](),this['activeAnnotation']=_0x23dd04;}detach(){if(!this['isAttached'])throw new _0x4dbbfc('narrowsidebar-detach-not-attached',this);this['setActiveAnnotation'](null);const _0x2d41a4=this['context']['plugins']['get'](ki);this['_hideBalloon'](),Array['from'](this['_annotationToNarrowView']['values'](),_0x210c24=>_0x210c24['destroy']()),this['_annotationToNarrowView']['clear'](),_0x2d41a4['_detachFromContainer'](this['annotations']),this['stopListening'](),this['_domEmitter']['stopListening'](),this['context']instanceof _0x238a82&&this['stopListening'](this['context']['editors']);for(const _0x543d60 of Array['from'](this['_editorAnnotations']))this['_destroyEditorAnnotationsIntegration'](_0x543d60);window['removeEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioningDebounced']['cancel'](),this['_selectedAnnotations']=[],this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach'](),this['bodyCollection']['detachFromDom']();}_integrateWithEditorAnnotations(_0x812d71){if(!_0x812d71['plugins']['has']('EditorAnnotations'))return;const _0xc6ca6e=_0x812d71['plugins']['get']('EditorAnnotations'),_0x3671b4=this['context']['plugins']['get'](ki),_0x8e2172=this['annotations'],_0x4efa32=this['balloonPanelView'],_0x4b36d0=()=>{const _0x220005=_0xc6ca6e['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});this['_setSelectedAnnotations'](_0x220005),this['setActiveAnnotation'](_0x220005[0x0]||null);};this['listenTo'](_0xc6ca6e,'refresh',_0x4b36d0),this['listenTo'](_0xc6ca6e,'blur',(_0x20065e,{isAnnotationTracked:_0x197e15})=>{this['activeAnnotation']&&_0x197e15(this['activeAnnotation'])&&(this['_setSelectedAnnotations']([]),this['setActiveAnnotation'](null));}),this['listenTo'](_0xc6ca6e,'uiUpdate',()=>{this['_refreshPositioningDebounced']();}),this['listenTo'](_0x8e2172,'blur',_0x359f41=>{_0xc6ca6e['hasDomSelection']()&&_0x359f41['stop']();},{'priority':'high'}),this['listenTo'](this['_domEmitter'],'mousedown',(_0x2775d4,_0x4a333e)=>{const _0x55878c=_0x4a333e['target'];_0x4efa32['isVisible']&&_0x4efa32['element']['contains'](_0x55878c)||_0x3671b4['view']['element']['contains'](_0x55878c)||this['activeAnnotation']&&_0xc6ca6e['hasDomSelection']()&&(_0x4b36d0(),_0x2775d4['preventClosingBalloon']=!0x0);},{'priority':'high'}),this['_editorAnnotations']['add'](_0xc6ca6e);}_destroyEditorAnnotationsIntegration(_0x24d361){_0x24d361&&(this['stopListening'](_0x24d361),this['_editorAnnotations']['remove'](_0x24d361));}_setSelectedAnnotations(_0x589ea0){for(const _0x46abe8 of this['_selectedAnnotations'])_0x589ea0['includes'](_0x46abe8)||this['_manuallyClosedAnnotationViews']['delete'](_0x46abe8['view']);this['_selectedAnnotations']=_0x589ea0;}_refreshPositioning(){const _0xc69731=this['balloonPanelView'];this['context']['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning'](),_0xc69731['isVisible']&&this['_updateBalloonPosition']();}['_showBalloon'](_0x27c3ce){if(this['_manuallyClosedAnnotationViews']['has'](_0x27c3ce['view']))return;const _0x3820f4=this['balloonPanelView']['content']['first'];_0x3820f4!==_0x27c3ce['view']?(_0x3820f4&&this['_detachListeners'](_0x3820f4),this['_attachListeners'](_0x27c3ce['view']),this['balloonPanelView']['content']['clear'](),this['balloonPanelView']['content']['add'](_0x27c3ce['view']),this['_updateBalloonPosition']()):this['_updateBalloonPosition']();}_updateBalloonPosition(){const _0x502e5c=this['balloonPanelView']['content']['first'],_0x273e78=_0x502e5c&&this['annotations']['getByView'](_0x502e5c);if(!_0x273e78||!this['_annotationToNarrowView']['has'](_0x273e78))return;const _0x156ca5=this['_annotationToNarrowView']['get'](_0x273e78)['element'],_0x56c2e9=(function(){const _0x4bbf6d=_0x1cf306['defaultPositions'];return[_0x4bbf6d['southArrowNorthEast'],_0x4bbf6d['northArrowSouthEast'],_0x4bbf6d['southArrowNorth'],_0x4bbf6d['northArrowSouth'],_0x4bbf6d['southArrowNorthWest'],_0x4bbf6d['northArrowSouthWest']];}());this['balloonPanelView']['pin']({'target':_0x156ca5,'positions':_0x56c2e9});}['_hideBalloon'](){const _0x3f5535=this['balloonPanelView'],_0x5cb634=_0x3f5535['content']['first'];_0x5cb634&&(this['_detachListeners'](_0x5cb634),_0x3f5535['unpin'](),_0x3f5535['content']['clear']());}_attachListeners(_0x1a5882){this['listenTo'](_0x1a5882,'change:height',()=>this['_updateBalloonPosition']()),this['listenTo'](_0x1a5882,'Esc',(_0x36aee1,_0x1919f0)=>{this['_manuallyClosedAnnotationViews']['add'](_0x1a5882),this['_hideBalloon'](),_0x1919f0();});}_detachListeners(_0x2e17e4){this['stopListening'](_0x2e17e4);}},xi=class extends _0x433bd5{isAttached;annotations;['_manuallyClosed'];['_balloon'];_addedAnnotations;_selectedAnnotations;['_forceRefresh'];_refreshVisibilityDebounced;static get requires(){return[di,_0x1380da,Ti];}static get['pluginName'](){return'InlineAnnotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x136b07){super(_0x136b07),_0x136b07['editing']['view']['addObserver'](lt),this['isAttached']=!0x1,this['set']('activeAnnotation',null),this['annotations']=null,this['_manuallyClosed']=new Set(),this['_balloon']=_0x136b07['plugins']['get'](_0x1380da),this['_addedAnnotations']=new Set(),this['_selectedAnnotations']=[],this['_forceRefresh']=!0x1,this['_refreshVisibilityDebounced']=_0x5b7667(()=>{this['editor']['plugins']['get']('Annotations')['refreshVisibility']();},0xfa,{'leading':!0x1});}init(){const _0x1085b5=this['editor']['plugins']['get'](Ti);_0x1085b5['context']===this['editor']&&(_0x1085b5['register']('inline',this),this['editor']['keystrokes']['set']('Esc',(_0x3f853e,_0x39ad59)=>{const _0x2c8522=this['_balloon'];if(this['isAttached']&&_0x2c8522['visibleView']){const _0x135a5a=this['annotations']['getByView'](_0x2c8522['visibleView']);_0x135a5a&&this['_closeAnnotation'](_0x135a5a),_0x39ad59();}}));}afterInit(){const _0x3103d7=this['editor']['plugins']['get'](Ti);_0x3103d7['context']===this['editor']&&(_0x3103d7['hasActive']()||_0x3103d7['switchTo']('inline'));}setActiveAnnotation(_0x3372b8){_0x3372b8!==this['activeAnnotation']&&(this['activeAnnotation']&&(this['activeAnnotation']['isActive']=!0x1),_0x3372b8&&this['editor']['ui']['focusTracker']['isFocused']&&(this['annotations']['has'](_0x3372b8)&&this['_addAnnotationToBalloon'](_0x3372b8,!0x0),_0x3372b8['isActive']=!0x0),_0x3372b8||this['_setSelectedAnnotations']([]),this['activeAnnotation']=_0x3372b8);}attach(_0xf154ef){this['annotations']=_0xf154ef;const _0x225818=this['editor']['plugins']['get'](Ti),_0x1c3257=this['_balloon'];if(this['isAttached'])throw new _0x4dbbfc('inlineannotations-attach-already-attached',this);if(_0x225818['context']!==this['editor'])throw new _0x4dbbfc('inlineannotations-not-allowed-with-context',this);const _0x5aaa32=this['editor']['plugins']['get'](di);this['listenTo'](_0x5aaa32,'refresh',()=>{const _0x49d800=_0x5aaa32['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});var _0x578cb8,_0x15ba94;!this['_forceRefresh']&&(_0x578cb8=_0x49d800,_0x15ba94=this['_selectedAnnotations'],_0x578cb8['length']===_0x15ba94['length']&&_0x578cb8['every'](_0x164c90=>_0x15ba94['includes'](_0x164c90)))||(this['_forceRefresh']=!0x1,this['_setSelectedAnnotations'](_0x49d800),this['setActiveAnnotation'](_0x49d800[0x0]||null));}),this['listenTo'](_0x5aaa32,'blur',(_0x5012f9,{isAnnotationTracked:_0x2f09f5})=>{this['activeAnnotation']&&_0x2f09f5(this['activeAnnotation'])&&(this['_setSelectedAnnotations']([]),this['setActiveAnnotation'](null));}),this['listenTo'](_0x5aaa32,'uiUpdate',()=>{this['_refreshVisibilityDebounced']();}),this['listenTo'](this['editor']['ui']['focusTracker'],'change:isFocused',(_0x3d640f,_0x1c968f,_0x26c865)=>{_0x26c865||this['setActiveAnnotation'](null);}),this['listenTo'](_0xf154ef,'remove',(_0x3a2e2f,_0x3ab7fa)=>{this['_removeAnnotationFromBalloon'](_0x3ab7fa),_0x3ab7fa===this['activeAnnotation']&&this['setActiveAnnotation'](null);}),this['listenTo'](_0x1c3257,'change:visibleView',(_0x3018d8,_0x52ac09,_0x2e390a,_0x30438e)=>{_0x30438e&&this['stopListening'](_0x30438e);const _0x22669e=_0xf154ef['getByView'](_0x2e390a);_0x2e390a&&_0x22669e&&(this['listenTo'](_0x2e390a,'change:height',()=>{_0x1c3257['updatePosition']();}),this['listenTo'](_0x2e390a,'Esc',()=>{this['_closeAnnotation'](_0x22669e),this['editor']['editing']['view']['focus']();}),this['activeAnnotation']!==_0x22669e&&this['setActiveAnnotation'](_0x22669e));}),this['listenTo'](this['editor']['ui'],'update',()=>{_0x1c3257['visibleView']&&_0xf154ef['getByView'](_0x1c3257['visibleView'])&&_0x1c3257['updatePosition']();}),this['listenTo'](this['editor']['editing']['view']['document'],'mousedown',()=>{this['_forceRefresh']=!0x0,this['_manuallyClosed']['clear']();}),this['editor']['editing']['view']['document']['selection']['editableElement']&&this['editor']['editing']['view']['focus'](),this['isAttached']=!0x0;}detach(){if(!this['isAttached'])throw new _0x4dbbfc('inlineannotations-detach-not-attached',this);this['setActiveAnnotation'](null);for(const _0x45b6a0 of this['_addedAnnotations'])this['_removeAnnotationFromBalloon'](_0x45b6a0);this['_refreshVisibilityDebounced']['cancel'](),this['stopListening'](),this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach'](),this['_refreshVisibilityDebounced']['cancel']();}_setSelectedAnnotations(_0x560e61){for(const _0x3e3a64 of this['_selectedAnnotations'])_0x560e61['includes'](_0x3e3a64)||this['_manuallyClosed']['delete'](_0x3e3a64);for(const _0x4a51b5 of this['annotations'])_0x560e61['includes'](_0x4a51b5)||this['_removeAnnotationFromBalloon'](_0x4a51b5);if(this['editor']['ui']['focusTracker']['isFocused']){for(const _0x5295f8 of _0x560e61)this['_addAnnotationToBalloon'](_0x5295f8);}this['_selectedAnnotations']=_0x560e61;}_addAnnotationToBalloon(_0x3eab4a,_0x3bf50d=!0x1){this['_manuallyClosed']['has'](_0x3eab4a)||(this['_addedAnnotations']['has'](_0x3eab4a)||this['_balloon']['hasView'](_0x3eab4a['view'])||(this['_addedAnnotations']['add'](_0x3eab4a),this['_balloon']['add']({'stackId':_0x3eab4a['view']['id'],'view':_0x3eab4a['view'],'position':{'target':()=>this['_getBalloonTargetForAnnotation'](_0x3eab4a)}})),_0x3bf50d&&this['_balloon']['showStack'](_0x3eab4a['view']['id']));}_getBalloonTargetForAnnotation(_0x5600b6){const _0x21434e=_0x5600b6['target'],_0x1d3ca0=this['editor']['editing']['view'],_0x5403cb=_0x1d3ca0['document']['selection']['getFirstRange'](),_0x282ec2=_0x1d3ca0['domConverter']['viewRangeToDom'](_0x5403cb);if(_0x282ec2['collapse'](!0x0),_0x21434e){if(_0x21434e instanceof _0x563bd7)return _0x21434e;let _0x54f759=[];for(const _0x570288 of _0x21434e)_0x54f759['push'](..._0x563bd7['getDomElementRects'](_0x570288));_0x54f759=function(_0x3ffef3){const _0x4a06f8=[];let _0x14000f=_0x3ffef3[0x0];for(let _0x244c75=0x1;_0x244c75<_0x3ffef3['length'];_0x244c75++)if(Pi(_0x14000f,_0x3ffef3[_0x244c75])){const _0x88ed31=_0x3ffef3[_0x244c75]['width'];_0x14000f['width']+=_0x88ed31,_0x14000f['right']+=_0x88ed31;}else _0x4a06f8['push'](_0x14000f),_0x14000f=_0x3ffef3[_0x244c75];return _0x4a06f8['push'](_0x14000f),_0x4a06f8;}(_0x54f759);const _0x1f0d91=_0x282ec2['getBoundingClientRect']();return _0x54f759['find'](_0x45786b=>_0x45786b['top']<=_0x1f0d91['top']&&_0x45786b['bottom']>=_0x1f0d91['bottom']&&_0x45786b['left']<=_0x1f0d91['left']&&_0x45786b['right']>=_0x1f0d91['right'])||_0x54f759[0x0];}return _0x5600b6['targetRect']||_0x282ec2;}_removeAnnotationFromBalloon(_0x1c4005){this['_addedAnnotations']['has'](_0x1c4005)&&this['_balloon']['hasView'](_0x1c4005['view'])&&(this['_addedAnnotations']['delete'](_0x1c4005),this['_balloon']['remove'](_0x1c4005['view']));}_closeAnnotation(_0x57501c){this['_manuallyClosed']['add'](_0x57501c),this['_removeAnnotationFromBalloon'](_0x57501c);}};function Pi(_0x23a8d7,_0x3c3919){return _0x23a8d7['top']===_0x3c3919['top']&&_0x23a8d7['bottom']===_0x3c3919['bottom']&&_0x23a8d7['right']===_0x3c3919['left'];}var Li=class extends ht{['focusTracker'];['focusCycler'];_annotationViews;constructor(_0x5f576c,_0x1f6d45){super(_0x5f576c),this['set']('isEmpty',!_0x1f6d45['length']),this['focusTracker']=new _0x51fffd(),this['_annotationViews']=_0x1f6d45,this['_annotationViews']['delegate']('arrowup','arrowdown')['to'](this),this['on']('arrowup',()=>{this['focusCycler']['focusPrevious']();}),this['on']('arrowdown',()=>{this['focusCycler']['focusNext']();}),this['focusCycler']=new et({'focusables':_0x1f6d45,'focusTracker':this['focusTracker']}),this['listenTo'](_0x1f6d45,'add',()=>{this['isEmpty']=!0x1;}),this['listenTo'](_0x1f6d45,'remove',(_0x59a5df,_0x1a9516)=>{_0x1a9516['isActive']&&this['focus'](),_0x1f6d45['length']||(this['isEmpty']=!0x0);});const _0x5bebbb=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'dir':'auto','class':['ck','ck-comments-archive'],'tabindex':-0x1,'role':'list','aria-label':Et(_0x5f576c,'COMMENTS_ARCHIVE_LIST_LABEL')},'children':[{'tag':'div','attributes':{'class':['ck-comments-archive__content'],'role':'presentation'},'children':[{'tag':'div','attributes':{'role':'presentation'},'children':_0x1f6d45},{'tag':'p','attributes':{'class':['ck-comments-archive__info',_0x5bebbb['if']('isEmpty','ck-hidden',_0x32d048=>!_0x32d048)]},'children':[{'text':Et(_0x5f576c,'EMPTY_COMMENTS_ARCHIVE')}]}]}]});}['render'](){super['render'](),this['_setupKeyboardNavigation']();}destroy(){super['destroy'](),this['focusTracker']['destroy']();}['focus'](){this['focusCycler']['first']?this['focusCycler']['focusFirst']():this['element']['focus']();}_setupKeyboardNavigation(){for(const _0x154cff of this['_annotationViews'])this['focusTracker']['add'](_0x154cff['element']);this['_annotationViews']['on']('change',(_0x582344,{added:_0x6b827e,removed:_0x2bca57})=>{for(const _0x59b5dd of _0x6b827e)this['focusTracker']['add'](_0x59b5dd['element']);for(const _0x1e97c7 of _0x2bca57)this['focusTracker']['remove'](_0x1e97c7['element']);});}},Di=class extends _0x183782{static get['pluginName'](){return'CommentsArchive';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[oi,ti];}constructor(_0x1f3576){super(_0x1f3576),this['archivedThreads']=new _0x1e0fc8();}init(){const _0x4fb8da=this['context'],_0x1646e1=_0x4fb8da['plugins']['get'](oi),_0x5800ac=_0x4fb8da['plugins']['get'](ti);this['listenTo'](_0x1646e1,'addCommentThread',(_0x4702f9,{threadId:_0x413a13})=>{const _0x420f84=_0x1646e1['getCommentThread'](_0x413a13);_0x420f84['archivedAt']&&this['archivedThreads']['add'](_0x420f84,this['_calculatePosition'](_0x420f84['archivedAt'])),this['listenTo'](_0x420f84,'change:archivedAt',(_0x70c1c2,_0x55a66b,_0x106dd6)=>{_0x106dd6?this['archivedThreads']['has'](_0x420f84)||this['archivedThreads']['add'](_0x420f84,this['_calculatePosition'](_0x420f84['archivedAt'])):this['archivedThreads']['has'](_0x420f84)&&this['archivedThreads']['remove'](_0x420f84);});}),this['listenTo'](_0x1646e1,'removeCommentThread',(_0x584e0a,{threadId:_0x3a05fa})=>{const _0x1eee15=_0x1646e1['getCommentThread'](_0x3a05fa);this['stopListening'](_0x1eee15),this['archivedThreads']['has'](_0x1eee15)&&this['archivedThreads']['remove'](_0x1eee15);},{'priority':'highest'}),this['listenTo'](_0x5800ac['collection'],'focus',(_0xa1e8dd,_0x4e1e05)=>{_0x4e1e05['isVisible']||(_0x4e1e05['isActive']=!0x0,_0x5800ac['activate'](_0x4e1e05));});}_calculatePosition(_0x25386f){const _0x120546=[...this['archivedThreads']]['findIndex'](_0x203828=>_0x203828['archivedAt']<_0x25386f);return _0x120546>-0x1?_0x120546:this['archivedThreads']['length'];}},Vi=class extends _0x433bd5{commentsArchiveView;annotationViews;['_pendingThreads'];static get['pluginName'](){return'CommentsArchiveUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Di,_0x308302];}constructor(_0x4d1a1b){super(_0x4d1a1b),this['annotationViews']=new at(),this['_pendingThreads']=[];}init(){const _0x401816=this['editor'],_0x27751d=this['_hideDialogOnAnnotationEscape']['bind'](this);_0x401816['ui']['componentFactory']['add']('commentsArchive',()=>this['_createCommentsArchiveButton'](_0x11e898,!0x0)),_0x401816['ui']['componentFactory']['add']('menuBar:commentsArchive',()=>{const _0x284dae=this['_createCommentsArchiveButton'](rt);return _0x284dae['set']({'role':'menuitemcheckbox'}),_0x284dae;});const _0x11f814=_0x401816['plugins']['get'](Di),_0x759036=_0x401816['plugins']['get']('Annotations'),_0xd6a56f=_0x401816['plugins']['get']('CommentsRepository');_0x11f814['archivedThreads']['forEach'](_0x4138ac=>{this['_handleNewThread'](_0x4138ac);}),this['listenTo'](_0x11f814['archivedThreads'],'add',(_0x4247b6,_0x352105)=>{this['_handleNewThread'](_0x352105);}),this['listenTo'](_0x759036['collection'],'add',(_0x2b63e3,_0x1863bc)=>{const _0x96486f=this['_pendingThreads']['find'](_0x5629fa=>{const _0x234537=_0xd6a56f['_threadToController']['get'](_0x5629fa);return _0x234537&&_0x1863bc['innerView']===_0x234537['view'];});if(_0x96486f){const _0x570f15=this['_calculatePosition'](_0x96486f['archivedAt']);this['_addAnnotationToArchive'](_0x1863bc,_0x570f15),this['_pendingThreads']['splice'](this['_pendingThreads']['indexOf'](_0x96486f),0x1);}}),this['listenTo'](_0x11f814['archivedThreads'],'remove',(_0xc71283,_0x40e2b9)=>{const _0x17c4ca=_0x401816['config']['get']('collaboration.channelId');if(!_0x17c4ca||_0x40e2b9['channelId']===_0x17c4ca){if(this['_pendingThreads']['includes'](_0x40e2b9))this['_pendingThreads']['splice'](this['_pendingThreads']['indexOf'](_0x40e2b9),0x1);else{const _0x309d48=_0xd6a56f['_threadToController']['get'](_0x40e2b9),_0x39f77d=_0x759036['getByInnerView'](_0x309d48['view']);this['annotationViews']['remove'](_0x39f77d['view']),this['stopListening'](_0x39f77d),this['stopListening'](_0x39f77d['focusableElements']);}}}),this['listenTo'](_0x759036['collection'],'add',(_0x131724,_0x395657)=>{this['listenTo'](_0x395657,'escape',_0x27751d);}),this['listenTo'](_0x759036['collection'],'remove',(_0x3a3d4e,_0x318a51)=>{this['stopListening'](_0x318a51,'escape',_0x27751d);});}_addAnnotationToArchive(_0x2c0113,_0xf05d12){this['listenTo'](_0x2c0113,'set:isVisible',_0x4bd9aa=>{_0x4bd9aa['return']=!0x1,_0x4bd9aa['stop']();}),this['annotationViews']['add'](_0x2c0113['view'],_0xf05d12);}['_handleNewThread'](_0x4dbe08){const _0x34763e=this['editor']['plugins']['get']('CommentsRepository'),_0x535e53=this['editor']['plugins']['get']('Annotations'),_0x3cd882=this['editor']['config']['get']('collaboration.channelId');if(!_0x3cd882||_0x4dbe08['channelId']===_0x3cd882){const _0x5289b5=_0x34763e['_threadToController']['get'](_0x4dbe08);if(!_0x5289b5)return void this['_pendingThreads']['push'](_0x4dbe08);const _0x3ec2b9=this['_calculatePosition'](_0x4dbe08['archivedAt']),_0x2f7ddf=_0x535e53['getByInnerView'](_0x5289b5['view']);_0x2f7ddf['isVisible']&&_0x535e53['_visibleAnnotations']['remove'](_0x2f7ddf),this['_addAnnotationToArchive'](_0x2f7ddf,_0x3ec2b9);}}_calculatePosition(_0x2be248){const _0x1cdf47=this['editor']['config']['get']('collaboration.channelId'),_0x54145c=[...this['editor']['plugins']['get'](Di)['archivedThreads']]['filter'](_0x5ac0c0=>_0x5ac0c0['channelId']===_0x1cdf47)['findIndex'](_0x34a745=>_0x34a745['archivedAt']<_0x2be248);return _0x54145c<0x0||_0x54145c>this['annotationViews']['length']?this['annotationViews']['length']:_0x54145c-0x1;}_toggleDialog(){const _0x357978=this['editor'],_0x341dcb=_0x357978['plugins']['get']('Dialog');this['commentsArchiveView']||(this['commentsArchiveView']=new Li(_0x357978['locale'],this['annotationViews'])),'commentsArchive'===_0x341dcb['id']?_0x341dcb['hide']():_0x341dcb['show']({'id':'commentsArchive','title':Et(_0x357978['locale'],'COMMENTS_ARCHIVE'),'icon':_0x33ec4f,'hasCloseButton':!0x0,'content':this['commentsArchiveView'],'position':_0x388c97['EDITOR_TOP_SIDE']});}_createCommentsArchiveButton(_0x68d266,_0x461463=!0x1){const _0x596731=this['editor']['locale'],_0x469422=this['editor']['plugins']['get']('Dialog'),_0xc81259=new _0x68d266(_0x596731);return _0xc81259['bind']('isEnabled')['to'](this,'isEnabled'),_0xc81259['bind']('isOn')['to'](_0x469422,'id',_0x48eb5=>'commentsArchive'===_0x48eb5),_0xc81259['set']({'label':Et(_0x596731,'COMMENTS_ARCHIVE'),'icon':_0x33ec4f,'isToggleable':!0x0}),_0x461463&&(_0xc81259['tooltip']=!0x0),this['listenTo'](_0xc81259,'execute',()=>this['_toggleDialog']()),_0xc81259;}_hideDialogOnAnnotationEscape=_0x4f654d=>{const _0x22beb5=_0x4f654d['source'];if(!this['annotationViews']['has'](_0x22beb5['view']))return;const _0x4be828=this['editor']['plugins']['get']('Dialog');_0x4be828['isOpen']&&'commentsArchive'===_0x4be828['id']&&(_0x4be828['hide'](),_0x4f654d['stop']());};},Bi=class extends _0x433bd5{static get requires(){return[oi,wi,vi,Di,Vi,yi,Mi,Si,xi];}static get['pluginName'](){return'Comments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{ci as AddCommentThreadCommand,$t as Annotation,Jt as AnnotationCollection,Ri as AnnotationCounterButtonView,qt as AnnotationView,ti as Annotations,Ei as AnnotationsSidebarItemView,Ii as AnnotationsSidebarView,Ti as AnnotationsUIs,Ht as BaseCommentThreadView,Kt as BaseCommentView,hi as Comment,ri as CommentThread,bt as CommentThreadController,xt as CommentThreadInputView,Ut as CommentThreadView,Yt as CommentView,Bi as Comments,Di as CommentsArchive,Vi as CommentsArchiveUI,wi as CommentsEditing,Lt as CommentsListView,yi as CommentsOnly,oi as CommentsRepository,vi as CommentsUI,di as EditorAnnotations,xi as InlineAnnotations,Si as NarrowSidebar,ki as Sidebar,Mi as WideSidebar,Qt as bindAnnotationCollections};
|