@ckeditor/ckeditor5-comments 49.0.0 → 49.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/comments/ui/view/basecommentthreadview.d.ts +16 -2
- package/dist/comments/ui/view/commentcontentview.d.ts +18 -0
- package/dist/comments/ui/view/commentthreadheaderview.d.ts +0 -10
- package/dist/comments/ui/view/commentthreadview.d.ts +6 -2
- package/dist/index-content.css +10 -4
- package/dist/index-editor.css +142 -95
- package/dist/index.css +152 -99
- package/dist/index.d.ts +1 -1
- 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/dist/utils/trimcontextvalue.d.ts +8 -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
|
-
((()=>Vt)());constructor(_0x2513c4={}){(_0x2513c4=Object['assign']({},_0x2513c4))['plugins']||(_0x2513c4['plugins']=CommentEditor['defaultPlugins']),super(_0x2513c4),this['ui']=new Dt(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 _0xfae124=this['config']['get']('initialData')||'';return this['initPlugins']()['then'](()=>this['ui']['init']())['then'](()=>this['data']['init'](_0xfae124))['then'](()=>this['fire']('ready'));}destroy(){return super['destroy']()['then'](()=>this['ui']['destroy']());}['focus'](){this['model']['change'](_0xbfa501=>{const _0x22bccc=this['model']['document']['getRoot'](),_0x3fa73e=_0x22bccc&&_0x22bccc['getChild'](_0x22bccc['childCount']-0x1);_0xbfa501['setSelection'](_0x3fa73e,'end'),this['editing']['view']['focus']();});}_updatePlaceholder(){const _0x5588e4=this['editing']['view'],_0x5b3485=_0x5588e4['document']['getRoot'](),_0x4c9044=_0x5b3485['getChild'](0x0);_0x5b3485['childCount']>0x1||!_0x4c9044||'p'!=_0x4c9044['name']?this['placeholderElement']&&this['placeholderElement']['placeholder']&&(vt(_0x5588e4,this['placeholderElement']),this['placeholderElement']=void 0x0):(this['placeholder']&&(_0x4c9044['placeholder']=this['placeholder']),yt({'view':_0x5588e4,'element':_0x4c9044,'keepOnFocus':!0x0}),this['placeholderElement']=_0x4c9044);}},Ut=class extends ft{keystrokes;['focusTracker'];['focusables'];['focusCycler'];submitButtonView;cancelButtonView;_editorConfig;constructor(_0x5c401f,_0x16c606={}){super(_0x5c401f),this['editor']=null,this['_editorConfig']=_0x16c606,this['set']('value',_0x16c606['initialData']||''),this['set']('disabledSubmit',!0x1),this['set']('showButtons',!0x0),this['set']('placeholder',Pt(_0x5c401f,'Reply...')),this['set']('submitLabel',Pt(_0x5c401f,'Reply')),this['submitButtonView']=this['_createSubmitButton'](),this['cancelButtonView']=this['_createCancelButton'](),this['focusables']=this['createCollection']([this['cancelButtonView'],this['submitButtonView']]),this['keystrokes']=new _0x481af7(),this['focusTracker']=new _0x2532f1(),this['focusCycler']=new at({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x5b5761=>!_0x5b5761['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['cancelButtonView'],this['submitButtonView']]}]}),this['keystrokes']['set']('Esc',(_0x129b1f,_0x416604)=>{this['cancelButtonView']['fire']('execute'),_0x416604();}),this['keystrokes']['set']('Ctrl+Enter',(_0x567f85,_0xd57c3d)=>{this['submitButtonView']['isEnabled']&&(this['submitButtonView']['fire']('execute'),_0xd57c3d());}),this['on']('submit',(_0x45b023,_0x5aeb64)=>{_0x5aeb64['length']>0xfde8?(alert(Pt(_0x5c401f,'TOO_LONG_COMMENT_ALERT',[_0x5aeb64['length'],0xfde8])),_0x45b023['stop']()):this['editor']['setData']('');},{'priority':'high'});}['render'](){super['render'](),this['_setupKeyboardNavigation']();}createEditor(){return this['editor']||(this['editor']=new Ht(this['_editorConfig']),this['_editorCreationPromise']=this['editor']['create']()['then'](()=>{if(this['_isDestroyed'])return;const _0x4afbe0=this['editor'];this['element']['insertBefore'](_0x4afbe0['ui']['element'],this['element']['firstChild']),_0x4afbe0['model']['document']['on']('change',()=>this['value']=_0x4afbe0['getData']()),_0x4afbe0['bind']('placeholder')['to'](this),this['focusables']['add'](_0x4afbe0['ui']['view'],0x0),this['fire']('editorReady',this['editor']);})),this['_editorCreationPromise'];}['focus'](_0x5ea18c){-0x1===_0x5ea18c?(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:_0x2f0e8a}=this,_0x445971=new it(_0x2f0e8a);return _0x445971['extendTemplate']({'attributes':{'class':['ck-button-action','ck-comment__input-actions--submit']}}),_0x445971['withText']=!0x0,_0x445971['bind']('label')['to'](this,'submitLabel'),_0x445971['on']('execute',()=>{this['fire']('submit',this['value']);}),_0x445971['bind']('isEnabled')['to'](this,'value',this,'disabledSubmit',(_0x482b87,_0x411946)=>!_0x411946&&!!_0x482b87['trim']()),_0x445971;}_createCancelButton(){const {locale:_0x1dcb7b}=this,_0xa18a2b=new it(_0x1dcb7b);return _0xa18a2b['extendTemplate']({'attributes':{'class':['ck-comment__input-actions--cancel']}}),_0xa18a2b['label']=Pt(_0x1dcb7b,'Cancel'),_0xa18a2b['withText']=!0x0,_0xa18a2b['on']('execute',()=>{this['editor']['setData'](''),this['fire']('cancel');}),_0xa18a2b;}_setupKeyboardNavigation(){this['keystrokes']['listenTo'](this['element']),this['focusables']['forEach'](_0x51a005=>{this['focusTracker']['add'](_0x51a005['element']);}),this['focusables']['on']('change',(_0x553b10,_0x149942)=>{for(const _0x4b2792 of Array['from'](_0x149942['added'])['reverse']())this['focusTracker']['add'](_0x4b2792['element']);});}},Ft=class extends ft{constructor(_0x4be674,_0x2966b4,_0x38b13c){super(_0x4be674),this['commentInputView']=new Ut(_0x4be674,_0x38b13c),this['focusCycler']=this['commentInputView']['focusCycler'],this['commentInputView']['bind']('showButtons')['to'](this['commentInputView']['focusTracker'],'isFocused',this['commentInputView'],'value',(_0x12a538,_0x17af3b)=>_0x12a538||!!_0x17af3b),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 _0x5a2f35(_0x4be674,_0x2966b4),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'](_0x135bfe){this['commentInputView']['focus'](_0x135bfe);}_focusOnNonInteractiveMouseDown(){this['listenTo'](this['element'],'mousedown',(_0x353a7e,_0x5d0402)=>{const {submitButtonView:_0x30b79a,cancelButtonView:_0x5a0584,editor:_0x113536}=this['commentInputView'];[_0x30b79a['element'],_0x5a0584['element'],_0x113536?_0x113536['editing']['view']['getDomRoot']():null]['filter'](_0x4bf0ba=>_0x4bf0ba)['some'](_0x2f46b0=>_0x3625f2(_0x2f46b0,_0x5d0402['target']))||(this['focus'](),_0x5d0402['preventDefault']());});}},Wt=class extends ft{revealButtonView;constructor(_0x5aa4ec){super(_0x5aa4ec),this['set']('count',void 0x0);const _0x11f546=this['revealButtonView']=new it(_0x5aa4ec);_0x11f546['icon']=_0x4bc42e,_0x11f546['withText']=!0x0,_0x11f546['bind']('label')['to'](this,'count',_0x53d1a1=>Pt(_0x5aa4ec,'NUMBER_OF_COMMENTS',_0x53d1a1)),_0x11f546['extendTemplate']({'attributes':{'class':'ck-button_small'}}),this['setTemplate']({'tag':'li','attributes':{'class':'ck-thread__comment-count'},'children':[_0x11f546]});}},Kt=class extends ft{commentViews;resolvedCommentView;['focusTracker'];keystrokes;['focusCycler'];['_model'];['_config'];_collapsedCommentsView;constructor(_0x425dc2,_0x483e3b,_0xfc943d){super(_0x425dc2);const _0x275d63=this['bindTemplate'];this['set']('hasDirtyComment',!0x1),this['set']('length',_0x483e3b['comments']['length']),this['set']('isActive',!0x1),this['set']('isExpandedByUser',!0x1),this['_model']=_0x483e3b,this['_config']=_0xfc943d,this['commentViews']=this['createCollection'](),this['visibleViews']=this['createCollection'](),this['resolvedCommentView']=null,this['focusTracker']=new _0x2532f1(),this['keystrokes']=new _0x481af7(),this['focusCycler']=new at({'focusables':this['commentViews'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x413e13=>this['commentViews']['map'](_0x3513f8=>_0x3513f8['element'])['includes'](_0x413e13['target'])},'actions':{'focusPrevious':'arrowup','focusNext':'arrowdown'}}),this['_collapsedCommentsView']=new Wt(_0x425dc2),this['_collapsedCommentsView']['bind']('count')['to'](this,'length',_0x2e4fc8=>_0x2e4fc8-this['_config']['maxCommentsWhenCollapsed']),this['listenTo'](this['_collapsedCommentsView']['revealButtonView'],'execute',()=>{this['isExpandedByUser']=!0x0;});for(const _0x1f7e2f of _0x483e3b['comments'])this['_handleNewCommentModel'](_0x1f7e2f);this['_handleInfoComment'](),this['listenTo'](_0x483e3b['comments'],'add',(_0xc4c288,_0x2f7efe)=>{const _0x5a84d6=this['_calculatePosition'](_0x2f7efe);this['length']++,this['_handleNewCommentModel'](_0x2f7efe,_0x5a84d6),this['refreshVisibleViews']();}),this['listenTo'](_0x483e3b['comments'],'remove',(_0x2232c6,_0x3bb454)=>{this['length']--,this['_handleRemoveCommentModel'](_0x3bb454),this['refreshVisibleViews']();}),this['listenTo'](_0x483e3b,'commentUpdated',()=>this['refreshVisibleViews']()),this['listenTo'](_0x483e3b,'change:isResolved',()=>this['_handleInfoComment']()),this['on']('change:isActive',(_0x268339,_0x30b259,_0x213951)=>{_0x213951||(this['isExpandedByUser']=!0x1),this['refreshVisibleViews']();}),this['on']('change:hasDirtyComment',()=>this['refreshVisibleViews']()),this['on']('change:isExpandedByUser',()=>this['refreshVisibleViews']()),this['setTemplate']({'tag':'ul','attributes':{'class':['ck-thread__comments',_0x275d63['if']('length','ck-hidden',_0x5ec8a6=>!_0x5ec8a6)],'aria-label':Pt(_0x425dc2,'Thread\x20comments')},'children':this['visibleViews']});}get['_shouldCollapse'](){return this['_model']['weight']>this['_config']['maxThreadTotalWeight']&&!this['isActive']&&!this['hasDirtyComment']&&!this['isExpandedByUser'];}['render'](){super['render'](),this['refreshVisibleViews'](),this['_setupKeyboardNavigation']();}['focus'](_0x5175d3){-0x1===_0x5175d3?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}destroy(){this['_collapsedCommentsView']['destroy']();for(const _0x37b6b1 of this['commentViews'])_0x37b6b1['destroy']();super['destroy']();}['refreshVisibleViews'](){this['_shouldCollapse']?this['_rearrangeCollapse']():this['_rearrangeExpand']();}_handleNewCommentModel(_0xe37027,_0x52553d){const _0x423784=new this['_config']['CommentView'](this['locale'],_0xe37027,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig']});_0x423784['viewUid']=_0xe37027['id'],_0x423784['delegate']('removeComment')['to'](this),_0x423784['delegate']('updateComment')['to'](this),_0x423784['delegate']('resolveCommentThread')['to'](this),_0x423784['delegate']('editorReady')['to'](this),_0x423784['delegate']('editorDestroyed')['to'](this),this['listenTo'](_0x423784,'change:isEditMode',()=>this['_updateHasDirtyComment']()),this['commentViews']['add'](_0x423784,_0x52553d);}_calculatePosition(_0x16b87b){const _0x5346e2=this['_model']['_findOptimalIndex'](_0x16b87b);return this['resolvedCommentView']?this['resolvedCommentView']['authoredAt']>_0x16b87b['authoredAt']?_0x5346e2-0x1:_0x5346e2:_0x5346e2-0x1;}_handleInfoComment(){if(this['_model']['resolvedBy']&&this['_model']['resolvedAt']){const _0x52c1e1={'id':'resolved','author':this['_model']['resolvedBy'],'authoredAt':this['_model']['resolvedAt'],'content':Pt(this['locale'],'Marked\x20as\x20resolved'),'attributes':{}};this['resolvedCommentView']=new this['_config']['CommentView'](this['locale'],_0x52c1e1,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig'],'isSystemComment':!0x0}),this['commentViews']['add'](this['resolvedCommentView'],this['_model']['_findOptimalIndex'](_0x52c1e1));}else this['resolvedCommentView']&&(this['commentViews']['remove'](this['resolvedCommentView']),this['resolvedCommentView']['destroy'](),this['resolvedCommentView']=null);this['refreshVisibleViews']();}_handleRemoveCommentModel(_0x199377){const _0xa5eaa7=this['commentViews']['remove'](_0x199377['id']);this['stopListening'](_0xa5eaa7),_0xa5eaa7['isEditMode']&&this['_updateHasDirtyComment'](),_0xa5eaa7['destroy']();}_updateHasDirtyComment(){this['hasDirtyComment']=Array['from'](this['commentViews'])['some'](_0x3a27cf=>_0x3a27cf['isEditMode']);}['_rearrangeCollapse'](){const _0x2e3a17=function(_0x22a9fb){const _0x17de1a=new _0x574e6b();for(const _0x55d0cb of _0x22a9fb)_0x17de1a['add'](_0x55d0cb);return _0x17de1a;}(this['commentViews']),_0x67f16f=this['_collapsedCommentsView']['count'];for(let _0x467c8b=0x1;_0x467c8b<=_0x67f16f;_0x467c8b++)_0x2e3a17['remove'](0x1);for(const _0x104da2 of _0x2e3a17)_0x104da2['collapse']();_0x67f16f>0x0&&_0x2e3a17['add'](this['_collapsedCommentsView'],0x1),Gt(_0x241e20(Array['from'](this['visibleViews']),Array['from'](_0x2e3a17)),this['visibleViews'],_0x2e3a17);}['_rearrangeExpand'](){const _0x6f0a1b=this['_collapsedCommentsView']['revealButtonView']['element'],_0x34228d=!!_0x6f0a1b&&_0x6f0a1b['contains'](_0x100375(_0x6f0a1b));Gt(_0x241e20(Array['from'](this['visibleViews']),Array['from'](this['commentViews'])),this['visibleViews'],this['commentViews']);for(const _0x2530ac of this['visibleViews'])_0x2530ac['expand']();_0x34228d&&this['commentViews']['get'](0x1)['focus']();}_setupKeyboardNavigation(){this['commentViews']['forEach'](_0x4e3ef4=>{this['focusTracker']['add'](_0x4e3ef4['element']),this['keystrokes']['listenTo'](_0x4e3ef4['element']);}),this['commentViews']['on']('change',(_0x2d63df,_0x13bbc7)=>{for(const _0x5ae089 of _0x13bbc7['removed'])this['focusTracker']['remove'](_0x5ae089['element']),this['keystrokes']['stopListening'](_0x5ae089['element']);for(const _0x5ec3bb of Array['from'](_0x13bbc7['added'])['reverse']())this['focusTracker']['add'](_0x5ec3bb['element']),this['keystrokes']['listenTo'](_0x5ec3bb['element']);});const _0x475b85=_0x3325e0=>{const _0x2f1dd4=this['_collapsedCommentsView']['revealButtonView']['element'];_0x2f1dd4&&(_0x3325e0?(this['focusTracker']['add'](_0x2f1dd4),this['keystrokes']['listenTo'](_0x2f1dd4)):(this['focusTracker']['remove'](_0x2f1dd4),this['keystrokes']['stopListening'](_0x2f1dd4)));};this['listenTo'](this['visibleViews'],'add',(_0xff52be,_0x13e530)=>{_0x13e530===this['_collapsedCommentsView']&&_0x475b85(!0x0);}),this['listenTo'](this['visibleViews'],'remove',(_0x5e7e38,_0x2a0c05)=>{_0x2a0c05===this['_collapsedCommentsView']&&_0x475b85(!0x1);}),this['visibleViews']['has'](this['_collapsedCommentsView'])&&_0x475b85(!0x0);}};function Gt(_0x422b93,_0x45d264,_0xd6fbb7){let _0x44126f=0x0;for(const _0x472a69 of _0x422b93)switch(_0x472a69){case'insert':_0x45d264['add'](_0xd6fbb7['get'](_0x44126f),_0x44126f),_0x44126f++;break;case'delete':_0x45d264['remove'](_0x44126f);break;case'equal':_0x44126f++;}}function Yt(_0x1cb10e,_0xbfe468){const _0x15d962=_0xbfe468-0x1;if(_0x1cb10e['length']<_0xbfe468)return _0x1cb10e;const _0x847147=_0x1cb10e['lastIndexOf']('\x20',_0x15d962);return _0x1cb10e['substring'](0x0,_0x847147>-0x1?_0x847147:_0x15d962)+'…';}var Xt=class extends ft{constructor(_0x44e8f9){super(_0x44e8f9);const _0x4c59e6=this['bindTemplate'];this['set']('contextValue',''),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-context__value'],'aria-label':_0x4c59e6['to']('contextValue',_0x237e74=>Pt(_0x44e8f9,'THREAD_CONTEXT_LABEL',_0x237e74)),'tabindex':-0x1},'children':[{'text':_0x4c59e6['to']('contextValue')}]});}['focus'](){this['element']['focus']();}},qt=class extends ft{['_model'];reopenButtonView;contextView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];constructor(_0x52dc3a,_0xedd8c4){super(_0x52dc3a);const _0x3f2f5f=this['bindTemplate'];this['_model']=_0xedd8c4,this['reopenButtonView']=this['_createReopenButton'](),this['contextView']=this['_createContextView'](),this['focusables']=this['createCollection']([this['contextView'],this['reopenButtonView']]),this['focusTracker']=new _0x2532f1(),this['keystrokes']=new _0x481af7(),this['focusCycler']=new at({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['bind']('hasContext')['to'](this['_model'],'context',_0x1f049e=>!!_0x1f049e),this['bind']('contextValue')['to'](this['_model'],'context',_0x5a359a=>_0x5a359a&&_0x5a359a['value']?Yt(_0x5a359a['value'],0x96):Pt(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',_0x3f2f5f['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 _0x4acabd=new it(this['locale']);return _0x4acabd['label']=Pt(this['locale'],'Reopen'),_0x4acabd['tooltip']=Pt(this['locale'],'Reopen'),_0x4acabd['icon']=tt,_0x4acabd['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x2819e0=>!_0x2819e0),_0x4acabd['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x39052b,_0x3416ca)=>_0x39052b&&_0x3416ca),_0x4acabd['on']('execute',()=>{this['fire']('reopenCommentThread',this['_model']['id']);}),_0x4acabd;}_attachContextActions(){const _0x577c41=this['element']['querySelector']('.ck-context'),_0x57ec86=_0x577c41['querySelector']('.ck-context__value');this['listenTo'](_0x577c41,'mouseenter',()=>{_0x57ec86['offsetWidth']<_0x57ec86['scrollWidth']&&_0x577c41['classList']['add']('overlay');}),this['listenTo'](_0x577c41,'mouseleave',()=>{_0x577c41['classList']['remove']('overlay');});}_setupKeyboardNavigation(){this['keystrokes']['listenTo'](this['element']);for(const _0x50ea68 of this['focusables'])this['focusTracker']['add'](_0x50ea68['element']),this['keystrokes']['listenTo'](_0x50ea68['element']);}_createContextView(){const _0x28c7ae=new Xt(this['locale']);return _0x28c7ae['bind']('contextValue')['to'](this),_0x28c7ae;}},jt=class extends ft{['_model'];['_config'];commentThreadHeaderView;commentThreadInputView;ariaDescriptionView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];constructor(_0x262136,_0x28dbcc,_0x242cc8,_0x19464a){super(_0x262136),this['set']('isActive',!0x1),this['set']('isDirty',!0x1),this['_model']=_0x28dbcc,this['_localUser']=_0x242cc8,this['_config']=_0x19464a,this['commentThreadHeaderView']=new qt(_0x262136,_0x28dbcc),this['commentThreadHeaderView']['delegate']('reopenCommentThread')['to'](this),this['ariaDescriptionView']=new _0x23cff4(_0x262136,Pt(_0x262136,'COMMENT_THREAD_DESCRIPTION')),this['listenTo'](this,'reopenCommentThread',()=>{this['focus']();}),this['commentsListView']=new Kt(_0x262136,_0x28dbcc,Object['assign']({'CommentView':this['_config']['CommentView']},_0x19464a)),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',(_0x24dd89,_0xcfb43)=>_0x24dd89||!!_0xcfb43),this['bind']('isUnlinked')['to'](_0x28dbcc,'unlinkedAt',_0x241a57=>!!_0x241a57);let _0x453622=null;const _0x12d689=()=>{const _0x5eb638=this['_model']['comments']['first']||null;_0x5eb638!==_0x453622&&(_0x453622&&this['stopListening'](_0x453622,'change:content'),_0x453622=_0x5eb638,_0x5eb638&&this['listenTo'](_0x5eb638,'change:content',_0x12d689));const _0x24021f=_0x5eb638?_0x5eb638['author']['name']:this['_localUser']['name'],_0x957399=_0x5eb638?new DOMParser()['parseFromString'](_0x4694a5(_0x3a78f6(_0x5eb638['content'],{'limit':this['_config']['maxCommentCharsWhenCollapsed']})),'text/html')['body']['textContent']:'',_0x46d8e2=Pt(this['locale'],'COMMENT_THREAD_LABEL',[this['length'],_0x24021f]);this['set']('ariaLabel',_0x957399?_0x46d8e2+'\x20'+_0x957399:_0x46d8e2);};this['listenTo'](this['_model']['comments'],'change',_0x12d689),_0x12d689(),this['focusables']=this['createCollection']([this['commentsListView'],this['commentThreadInputView']]),this['focusTracker']=new _0x2532f1(),this['keystrokes']=new _0x481af7(),this['focusCycler']=new at({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x5f4df0=>_0x5f4df0['target']!==this['element']},'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}});}['focus'](){this['element']['focus']();}['render'](){super['render'](),_0x5748e2(this,this['focusables']);}async destroy(){this['isDirty']=!0x1,this['commentsListView']['destroy'](),await this['commentThreadInputView']['destroy'](),super['destroy']();}_createCommentThreadInputView(){const _0x40741f=new Ft(this['locale'],this['_localUser'],this['_config']['editorConfig']),_0x4101d0=_0x40741f['commentInputView'];return _0x40741f['bind']('showInput')['to'](this,'isActive',this['_model'],'isReadOnly',this['_model'],'canComment',this['_model'],'archivedAt',_0x4101d0,'value',(_0x15ebc4,_0x386c7c,_0x2dc1e9,_0x594695,_0x237916)=>!!_0x237916||!!_0x594695&&_0x2dc1e9&&!_0x386c7c||_0x15ebc4&&_0x2dc1e9&&!_0x386c7c),_0x4101d0['bind']('placeholder')['to'](this,'length',this['_model'],'isResolvable',this['_model'],'isResolved',(_0x434814,_0x3a1ffc,_0x481eee)=>{let _0x176942;return _0x176942=_0x481eee&&_0x3a1ffc?'Reply\x20to\x20reopen\x20discussion...':_0x434814?'Reply...':'Write\x20a\x20comment...',Pt(this['locale'],_0x176942);}),_0x4101d0['bind']('submitLabel')['to'](this,'length',_0x11d078=>Pt(this['locale'],_0x11d078?'Reply':'Comment')),_0x4101d0['on']('submit',(_0x5d5a6f,_0x2da5b2)=>{this['fire']('addComment',_0x2da5b2),this['_model']['isResolved']&&this['_model']['isResolvable']&&this['fire']('reopenCommentThread',this['_model']['id']),this['_model']['isSubmitted']||this['fire']('submitCommentThread');}),_0x4101d0['on']('cancel',()=>{this['focus']();}),_0x4101d0['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0x4101d0['on']('cancel',_0x2a65d2=>{0x0==this['length']&&(this['fire']('removeCommentThread'),_0x2a65d2['stop']());}),this['on']('change:isActive',(_0x3aad3f,_0x4d6fad,_0xedcdf3)=>{_0xedcdf3||this['length']||_0x4101d0['value']||this['fire']('removeCommentThread');}),_0x40741f;}};const $t=/* #__PURE__ -- @preserve */
|
|
27
|
-
_0x3b081a(jt);var zt=class extends $t{commentThreadChildren;containerElement;resolveButton;_boundFirstCommentView;constructor(_0x32c45d,_0x2f9113,_0x11c38e,_0x4054cf){super(_0x32c45d,_0x2f9113,_0x11c38e,_0x4054cf),this['commentThreadChildren']=this['createCollection']([this['commentsListView'],this['commentThreadInputView'],this['ariaDescriptionView']]),this['set']('actionIndicator',null),this['containerElement']=null,this['_boundFirstCommentView']=null,this['locale']=_0x32c45d,this['resolveButton']=this['_createResolveButton'](),this['setTemplate'](this['getTemplate']()),this['on']('change:isActive',(_0x3da1fb,_0x13cf9f,_0x8d5d06)=>{_0x8d5d06||this['_cancelAllConfirms']();}),this['listenTo'](this['_model'],'change:isReadOnly',(_0x3fae5f,_0x1cef5a,_0x15a4af)=>{_0x15a4af&&this['_cancelAllConfirms']();}),this['length']>0x0&&this['_bindFirstCommentView'](),this['listenTo'](this['commentsListView']['commentViews'],'add',()=>{this['_bindFirstCommentView']();});}getTemplate(){const _0x3009f8=this['bindTemplate'];return{'tag':'div','attributes':{'class':['ck','ck-thread','ck-reset_all-excluded','ck-rounded-corners',_0x3009f8['if']('isActive','ck-thread--active'),_0x3009f8['if']('isUnlinked','ck-thread--unlinked'),_0x3009f8['to']('actionIndicator',_0x452b12=>_0x452b12?'ck-thread--'+_0x452b12:'')],'data-thread-id':this['_model']['id'],'tabindex':0x0,'role':'listitem','aria-label':_0x3009f8['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 _0x873139 of this['commentsListView']['commentViews'])_0x873139['cancelConfirm']();}_bindFirstCommentView(){const {locale:_0xc6ea83}=this,_0x1dc741=this['commentsListView']['commentViews']['get'](0x0);_0x1dc741===this['_boundFirstCommentView']||_0x1dc741['isSystemComment']||(this['_boundFirstCommentView']=_0x1dc741,this['unbind']('actionIndicator'),this['bind']('actionIndicator')['to'](_0x1dc741,'actionIndicator',_0x586c3d=>'remove'===_0x586c3d?'remove':null),_0x1dc741['placeholder']=Pt(_0xc6ea83,'Write\x20a\x20comment...'),_0x1dc741['bind']('contextValue')['to'](this['_model'],'context',this['_model'],'archivedAt',(_0x28fc35,_0x14b243)=>_0x14b243||!_0x28fc35?null:'string'==typeof _0x28fc35['value']&&_0x28fc35['value']?Yt(_0x28fc35['value'],0x2a):Pt(_0xc6ea83,'Comment\x20was\x20made\x20on\x20an\x20element')),_0x1dc741['removeButton']['on']('execute',_0x10f190=>{_0x10f190['stop'](),this['showConfirm'](Pt(_0xc6ea83,'Delete\x20comment\x20thread?'),this['containerElement'])['then'](()=>{this['fire']('removeCommentThread');});},{'priority':'high'}),this['on']('removeConfirm',()=>{_0x1dc741['focus']();}),_0x1dc741['actionBar']['add'](this['resolveButton'],0x0),_0x1dc741['focusables']['add'](this['resolveButton'],0x0));}_createResolveButton(){const _0x13f2d8=new _0x4ae583(this['locale']);return _0x13f2d8['label']=Pt(this['locale'],'Resolve'),_0x13f2d8['tooltip']=Pt(this['locale'],'Resolve'),_0x13f2d8['icon']=_0x37026c,_0x13f2d8['extendTemplate']({'attributes':{'class':['ck-comment--resolve','ck-button_small']}}),_0x13f2d8['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x57dc2f=>!_0x57dc2f),_0x13f2d8['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x379571,_0x510ccc)=>_0x379571&&!_0x510ccc),_0x13f2d8['on']('execute',()=>{this['fire']('resolveCommentThread',this['_model']['id']);}),_0x13f2d8;}_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']));}},Jt=class extends ft{constructor(_0x341c3f){super(_0x341c3f),this['set']('content',''),this['set']('contextValue',null),this['setTemplate']({'tag':'div','attributes':{'class':['ck-content','ck-comment__content','ck-annotation__content']}});}['render'](){super['render'](),this['on']('change:content',()=>this['_renderContent']()),this['on']('change:contextValue',()=>this['_renderContent']()),this['_renderContent']();}_renderContent(){const _0x17bd13=this['element'];_0x17bd13['innerHTML']=_0x4694a5(this['content']);const _0x3baef3=this['contextValue']?.['trim']();if(_0x3baef3){const _0x519938=document['createElement']('div'),_0x352820=document['createElement']('p');_0x519938['classList']['add']('ck-comment__context'),_0x352820['textContent']=_0x3baef3,_0x519938['append'](_0x352820),_0x17bd13['prepend'](_0x519938);}}},Qt=class extends ft{['visibleView'];ariaDescriptionView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];['_model'];['_config'];constructor(_0x268249,_0x36c6be,_0x17f04b){super(_0x268249),this['_model']=_0x36c6be,this['_config']=_0x17f04b,this['isSystemComment']=!!this['_config']['isSystemComment'],this['set']('isEditMode',!0x1),this['set']('isCollapsed',!0x0),this['set']('contextValue',null),this['bind']('ariaLabel')['to'](_0x36c6be,'content',_0x36c6be,'authoredAt',(_0x116379,_0x4eafc8)=>Pt(_0x268249,'COMMENT_ARIA_LABEL',[_0x36c6be['author']['name'],_0x17f04b['formatDateTime'](_0x4eafc8),new DOMParser()['parseFromString'](_0x4694a5(_0x116379),'text/html')['body']['textContent'],_0x36c6be['isExternal']?this['getExternalCommentNote']():''])),this['ariaDescriptionView']=new _0x23cff4(_0x268249,Pt(_0x268249,'COMMENT_THREAD_DESCRIPTION')),this['visibleView']=this['createCollection'](),this['visibleView']['add'](this['_createCommentContentView']()),this['focusables']=new pt(),this['focusTracker']=new _0x2532f1(),this['keystrokes']=new _0x481af7(),this['focusCycler']=new at({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x30a2b6=>_0x30a2b6['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']?Pt(this['locale'],'EXTERNAL_IMPORT_WORD_COMMENT'):Pt(this['locale'],'EXTERNAL_COMMENT');}getUserViewNotificationText(){return this['_model']['isExternal']?'importWord'===this['_model']['attributes']['@external']['source']?Pt(this['locale'],'EXTERNAL_IMPORT_WORD_AVATAR',this['_model']['creator']['name']):Pt(this['locale'],'EXTERNAL_AVATAR',this['_model']['creator']['name']):null;}_createCommentContentView(){const _0x130667=new Jt(this['locale']);return _0x130667['bind']('contextValue')['to'](this),_0x130667['bind']('content')['to'](this['_model'],'content',this,'isCollapsed',(_0x30a003,_0x4336c4)=>_0x4336c4?_0x3a78f6(_0x30a003,{'limit':this['_config']['maxCommentCharsWhenCollapsed']}):_0x30a003),_0x130667;}_createCommentInputView(){this['_config']['editorConfig']||(this['_config']['editorConfig']={}),this['_config']['editorConfig']['initialData']=this['_model']['content'];const _0xdf8ce3=new Ut(this['locale'],this['_config']['editorConfig']);return _0xdf8ce3['value']=this['_model']['content'],_0xdf8ce3['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0xdf8ce3['submitLabel']=Pt(this['locale'],'Save'),_0xdf8ce3['on']('submit',(_0x47aea3,_0x2c4fe3)=>{this['fire']('updateComment',this['_model']['id'],_0x2c4fe3),this['switchToDisplayMode'](),this['focus']();}),_0xdf8ce3['on']('cancel',()=>{this['switchToDisplayMode'](),this['focus']();}),_0xdf8ce3['once']('editorReady',()=>{_0xdf8ce3['focus']();}),_0xdf8ce3['createEditor'](),_0xdf8ce3['delegate']('editorReady')['to'](this),_0xdf8ce3['delegate']('editorDestroyed')['to'](this),_0xdf8ce3;}_setupKeyboardNavigation(){const _0x39d2b5=this['element'];this['keystrokes']['listenTo'](_0x39d2b5);for(const _0x501a2a of this['focusables'])this['focusTracker']['add'](_0x501a2a['element']),this['keystrokes']['listenTo'](_0x501a2a['element']);this['focusables']['on']('change',(_0x43b3a3,_0x56e0ca)=>{for(const _0x4022e9 of _0x56e0ca['removed'])this['focusTracker']['remove'](_0x4022e9['element']),this['keystrokes']['stopListening'](_0x4022e9['element']);for(const _0xc8fbd3 of _0x56e0ca['added'])this['focusTracker']['add'](_0xc8fbd3['element']),this['keystrokes']['listenTo'](_0xc8fbd3['element']);}),this['keystrokes']['set']('enter',(_0x24456d,_0x592975)=>{_0x39d2b5===_0x24456d['target']&&(this['focusCycler']['focusFirst'](),_0x592975());}),this['keystrokes']['set']('esc',(_0x970e03,_0x35429c)=>{_0x39d2b5!==_0x970e03['target']&&(this['focus'](),_0x35429c());});}};const Zt=/* #__PURE__ -- @preserve */
|
|
28
|
-
|
|
29
|
-
_0x3484ab();var ne=class Annotation extends se{['view'];focusableElements;_type;_target;constructor({view:_0x25bb70,target:_0x3c64f6,type:_0x241d54,isVisible:_0x13db12=!0x0}){super(),this['view']=_0x25bb70,this['view']['element']||this['view']['render'](),this['_type']=_0x241d54,this['_target']=_0x3c64f6,Annotation['_assertCorrectTarget'](this['_getNormalizedTarget']()),this['focusableElements']=new _0x574e6b([this['view']['element']],{'idProperty':'_id'}),this['focusableElements']['on']('add',(_0x48e00b,_0x2f9199)=>{this['view']['focusTracker']['add'](_0x2f9199);}),this['focusableElements']['on']('remove',(_0x554ffe,_0x3dc82c)=>{this['view']['focusTracker']['remove'](_0x3dc82c);}),this['set']('isVisible',_0x13db12);}get type(){return'function'==typeof this['_type']?this['_type']():this['_type'];}get['innerView'](){return this['view']['mainView'];}get target(){const _0x38991a=this['_getNormalizedTarget']();return Annotation['_assertCorrectTarget'](_0x38991a),_0x38991a;}get targetRect(){const _0x33e278=this['target'];if(null===_0x33e278)return null;if(_0x33e278 instanceof _0xfb6dad)return _0x33e278;const _0x2a8d8c=_0x33e278['filter'](_0x4eab6e=>function(_0x5abba4){return!!_0x5abba4['offsetParent']||!!_0x5abba4['getClientRects']()['item'](0x0);}(_0x4eab6e));return 0x0===_0x2a8d8c['length']?null:_0xfb6dad['getDomElementRects'](_0x2a8d8c[0x0])[0x0];}get isActive(){return this['view']['isActive'];}set isActive(_0x2ded2e){this['view']['isActive']=_0x2ded2e,this['view']['mainView']['isActive']=_0x2ded2e;}updateTargetRect(){this['view']['targetRect']=this['targetRect'];}destroy(){this['focusableElements']['stopListening'](),this['focusableElements']['clear'](),this['stopListening']();}refreshVisibility(){this['isVisible']=!!this['targetRect'];}static _assertCorrectTarget(_0x6ee3d9){if(!(null===_0x6ee3d9||_0x6ee3d9 instanceof _0xfb6dad||Array['isArray'](_0x6ee3d9)&&_0x6ee3d9['every'](_0x4f828f=>oe(_0x4f828f))))throw new _0x465b2f('annotation-invalid-target',null,{'target':_0x6ee3d9});}_getNormalizedTarget(){const _0x4af309='function'==typeof this['_target']?this['_target']():this['_target'];return oe(_0x4af309)?[_0x4af309]:_0x4af309;}};function oe(_0x107f39){return null!==_0x107f39&&'object'==typeof _0x107f39&&'nodeType'in _0x107f39&&0x1===_0x107f39['nodeType'];}var re=class extends _0x574e6b{_innerViewToAnnotation;_viewToAnnotation;['_focusTracker'];constructor(_0x3a4aea=[]){super(),this['_innerViewToAnnotation']=new Map(),this['_viewToAnnotation']=new Map(),this['_focusTracker']=new _0x2532f1(),this['_focusTracker']['on']('change:isFocused',(_0x2ee758,_0x462ebc,_0x260c05)=>{_0x260c05||this['fire']('blur');});for(const _0x13e845 of _0x3a4aea)this['add'](_0x13e845);}get['isFocused'](){return this['_focusTracker']['isFocused'];}['add'](_0x3e54d4){if(this['has'](_0x3e54d4))throw new _0x465b2f('annotationcollection-duplicated-item',null);this['_innerViewToAnnotation']['set'](_0x3e54d4['innerView'],_0x3e54d4),this['_viewToAnnotation']['set'](_0x3e54d4['view'],_0x3e54d4);for(const _0xbb8465 of _0x3e54d4['focusableElements'])this['_focusTracker']['add'](_0xbb8465);if(this['listenTo'](_0x3e54d4['focusableElements'],'add',(_0x41d659,_0x351d10)=>{this['_focusTracker']['add'](_0x351d10);}),this['listenTo'](_0x3e54d4['focusableElements'],'remove',(_0x5c855a,_0x32d405)=>{this['_focusTracker']['remove'](_0x32d405);}),this['listenTo'](_0x3e54d4['view']['focusTracker'],'change:isFocused',(_0x4d7d1d,_0x5ab575,_0x2cc518)=>{_0x2cc518&&this['fire']('focus',_0x3e54d4);}),_0x3e54d4['updateTargetRect'](),this['_areCachedRectsStale']()){for(const _0x58860c of this)_0x58860c['updateTargetRect']();}const _0x3b027e=this['_getOrderInContent'](_0x3e54d4['view']['targetRect']);return super['add'](_0x3e54d4,_0x3b027e);}['remove'](_0x41f447){if(!this['has'](_0x41f447))throw new _0x465b2f('annotationcollection-not-existing-item',null);this['stopListening'](_0x41f447['view']['focusTracker']),this['stopListening'](_0x41f447['focusableElements']);for(const _0x125496 of _0x41f447['focusableElements'])this['_focusTracker']['remove'](_0x125496);return this['_viewToAnnotation']['delete'](_0x41f447['view']),this['_innerViewToAnnotation']['delete'](_0x41f447['innerView']),super['remove'](_0x41f447);}getByInnerView(_0x42265f){return this['_innerViewToAnnotation']['get'](_0x42265f);}getByView(_0xc76aa6){return this['_viewToAnnotation']['get'](_0xc76aa6);}destroy(){super['clear'](),this['stopListening'](),this['_innerViewToAnnotation']['clear'](),this['_viewToAnnotation']['clear'](),this['_focusTracker']['destroy']();}refreshPositioning(){for(const _0x263356 of this)_0x263356['updateTargetRect']();this['_sort']();}_sort(){const _0xeef5f3=Array['from'](this)['sort']((_0x602fb3,_0x49175d)=>ae(_0x602fb3['view']['targetRect'],_0x49175d['view']['targetRect']));for(let _0xa35ddc=_0xeef5f3['length']-0x1;_0xa35ddc>0x0;_0xa35ddc--){const _0x26c146=_0xeef5f3[_0xa35ddc];_0xa35ddc!==this['getIndex'](_0x26c146)&&(this['remove'](_0x26c146),this['add'](_0x26c146));}}_getOrderInContent(_0x30c2e9){let _0xe046ac=0x0;if(!_0x30c2e9)return this['length'];for(const _0x4860cc of this){const _0x508090=_0x4860cc['view']['targetRect'];if(_0x508090){if(ae(_0x30c2e9,_0x508090)<0x0)return _0xe046ac;_0xe046ac++;}}return _0xe046ac;}_areCachedRectsStale(){const _0x4458d1=this['get'](0x0);if(!_0x4458d1)return!0x1;const _0x544434=_0x4458d1['view']['targetRect'],_0x3859ec=_0x4458d1['targetRect'];return!(!_0x544434||!_0x3859ec)&&(_0x544434['top']!==_0x3859ec['top']||_0x544434['left']!==_0x3859ec['left']);}};function he({source:_0x3c7bfd,target:_0x43ccd2,filter:_0x287ddd}){for(const _0x3af954 of _0x3c7bfd)_0x287ddd(_0x3af954)&&_0x43ccd2['add'](_0x3af954);_0x43ccd2['listenTo'](_0x3c7bfd,'add',(_0x5852dd,_0xc0f542)=>{_0x287ddd(_0xc0f542)&&_0x43ccd2['add'](_0xc0f542);}),_0x43ccd2['listenTo'](_0x3c7bfd,'remove',(_0x3ee39d,_0x322f3b)=>{_0x43ccd2['has'](_0x322f3b)&&_0x43ccd2['remove'](_0x322f3b);});}function ae(_0xc7df6d,_0x5111c2){if(null===_0xc7df6d&&null===_0x5111c2)return 0x0;if(null===_0xc7df6d)return-0x1;if(null===_0x5111c2)return 0x1;const _0x42fa41=_0xc7df6d['top']-_0x5111c2['top'];return 0x0==_0x42fa41?_0xc7df6d['left']-_0x5111c2['left']:_0x42fa41;}var ce=class extends _0x16df46{collection;_visibleAnnotations;static get['pluginName'](){return'Annotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x108bd4){if(super(_0x108bd4),this['collection']=new re(),this['_visibleAnnotations']=new re(),this['set']('activeAnnotations',new Set()),this['_bindAnnotationsToVisibleAnnotations'](),_0x108bd4 instanceof _0x49bdf6){const _0x1929a5=_0x108bd4['locale'];_0x108bd4['accessibility']['addKeystrokeInfoGroup']({'id':'annotations','label':Pt(_0x1929a5,'ACCESSIBILITY_HELP_ANNOTATIONS_GROUP'),'keystrokes':[{'label':Pt(_0x1929a5,'ACCESSIBILITY_HELP_ANNOTATIONS_MOVE_TO'),'keystroke':'Ctrl+Shift+E'},{'label':Pt(_0x1929a5,'ACCESSIBILITY_HELP_ANNOTATIONS_EXIT'),'keystroke':'Esc'},{'label':Pt(_0x1929a5,'ACCESSIBILITY_HELP_ANNOTATIONS_ENTER'),'keystroke':'Enter'},{'label':Pt(_0x1929a5,'ACCESSIBILITY_HELP_ANNOTATIONS_BROWSE_GROUPS'),'keystroke':[['Tab'],['Shift+Tab']]},{'label':Pt(_0x1929a5,'ACCESSIBILITY_HELP_ANNOTATIONS_SUBMIT_COMMENT'),'keystroke':['Ctrl+Enter']},{'label':Pt(_0x1929a5,'ACCESSIBILITY_HELP_ANNOTATIONS_NAVIGATE_THREADS'),'keystroke':[['Arrowup'],['Arrowdown']]}]});}this['_setupEnterAnnotationKeystroke'](),this['_setupEscapeAnnotationHandling']();}['add'](_0x1eaa3b){this['collection']['add'](_0x1eaa3b);}['remove'](_0x42e1e3){this['collection']['remove'](_0x42e1e3),_0x42e1e3['destroy']();}refreshVisibility(){for(const _0x3bf396 of this['collection'])_0x3bf396['refreshVisibility']();}refreshPositioning(){this['_visibleAnnotations']['refreshPositioning']();}getByInnerView(_0xc4262a){return this['collection']['getByInnerView'](_0xc4262a);}deactivateAll(){this['fire']('_deactivateAllAnnotations');}destroy(){for(const _0x5e5592 of this['collection'])_0x5e5592['destroy']();this['_visibleAnnotations']['destroy'](),this['collection']['destroy'](),super['destroy']();}activate(_0x4ee5e3){this['fire']('_activateAnnotation',_0x4ee5e3);}createAnnotation(_0x2f4e47){return new ne(_0x2f4e47);}createAnnotationView(_0x3f3198,_0x166b97){return new ie(_0x3f3198,_0x166b97);}_addActiveAnnotation(_0x5d8cc7){const _0x17d4e9=new Set(this['activeAnnotations']);_0x17d4e9['add'](_0x5d8cc7),this['activeAnnotations']=_0x17d4e9;}_removeActiveAnnotation(_0x17f454){const _0x205261=new Set(this['activeAnnotations']);_0x205261['delete'](_0x17f454),this['activeAnnotations']=_0x205261;}_bindAnnotationsToVisibleAnnotations(){const _0x3c340d=this['collection'],_0x57776e=this['_visibleAnnotations'];function _0x349c50(_0x5209a2){const _0x2042ce=_0x5209a2['source'];_0x2042ce['isVisible']&&!_0x57776e['has'](_0x2042ce)?_0x57776e['add'](_0x2042ce):!_0x2042ce['isVisible']&&_0x57776e['has'](_0x2042ce)&&_0x57776e['remove'](_0x2042ce),_0x2042ce['view']['focusTracker']['remove'](_0x2042ce['view']['element']),_0x2042ce['view']['focusTracker']['add'](_0x2042ce['view']['element']);}this['listenTo'](_0x3c340d,'add',(_0x38d3df,_0x6338a5)=>{_0x6338a5['isVisible']&&_0x57776e['add'](_0x6338a5),this['listenTo'](_0x6338a5,'change:isVisible',_0x349c50);}),this['listenTo'](_0x3c340d,'remove',(_0x351fc3,_0x5b8ab8)=>{_0x57776e['has'](_0x5b8ab8)&&_0x57776e['remove'](_0x5b8ab8),this['stopListening'](_0x5b8ab8,'change:isVisible',_0x349c50);});}_setupEnterAnnotationKeystroke(){const _0x501a66=_0x1202a1=>{_0x1202a1['on']('ready',()=>{_0x1202a1['keystrokes']['set'](_0x5a256f,(_0x22f4da,_0x1b2a6e)=>{const _0xa3323b=_0x26a0ae(this['activeAnnotations']['values']());_0xa3323b&&(_0xa3323b['view']['focus'](),_0x1b2a6e());});});};this['context']instanceof _0x49bdf6?_0x501a66(this['context']):this['context']['editors']&&this['context']['editors']['on']('add',(_0x2cee3d,_0x2244cf)=>{_0x501a66(_0x2244cf);});}_setupEscapeAnnotationHandling(){const _0x243484=_0x47e25b=>{const _0x12c337=_0x47e25b['source'],_0x4682fa=[];let _0x59374f;if(Array['isArray'](_0x12c337['target'])){_0x59374f=_0x12c337['target'][0x0],this['context']instanceof _0x49bdf6?_0x4682fa['push'](this['context']):this['context']['editors']&&_0x4682fa['push'](...this['context']['editors']);for(const _0x385383 of _0x4682fa)for(const _0x10f38b of _0x385383['editing']['view']['domRoots']['values']())if(_0x3625f2(_0x10f38b,_0x59374f))return void _0x385383['editing']['view']['focus']();_0x59374f['focus']();}};this['listenTo'](this['collection'],'add',(_0x613053,_0x1ad2b2)=>{this['listenTo'](_0x1ad2b2,'escape',_0x243484,{'priority':'low'});}),this['listenTo'](this['collection'],'remove',(_0x18776c,_0x5dc239)=>{this['stopListening'](_0x5dc239,'escape',_0x243484);});}};const de=Symbol('noChannel'),le={'admin':!0x0,'modifyAll':!0x1,'write':!0x0,'resolve':!0x0},me=/* #__PURE__ -- @preserve */
|
|
30
|
-
|
|
31
|
-
_0x3484ab();var fe=class extends _0x16df46{_threads;_threadToController;_viewToController;static get requires(){return[ce,_0x28db60,_0x342a1b];}static get['pluginName'](){return'CommentsRepository';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4872e1){super(_0x4872e1),this['_threads']=new Map(),this['_threadToController']=new Map(),this['_viewToController']=new Map(),this['set']('_readOnlyChannels',new Set()),this['set']('_permissions',new Map());const _0x4f8112=this['context']['config'];_0x4f8112['define']('comments.maxCommentsWhenCollapsed',0x2),_0x4f8112['define']('comments.maxThreadTotalWeight',0x1f4),_0x4f8112['define']('comments.maxCommentCharsWhenCollapsed',0x8c),_0x4f8112['define']('comments.CommentThreadView',zt),_0x4f8112['define']('comments.CommentView',te),_0x4f8112['get']('comments.editorConfig')||console['warn']('Missing\x20comments\x20editor\x20configuration\x20(`comments.editorConfig`).\x20Default\x20configuration\x20will\x20be\x20used\x20instead.');}init(){const _0x2f5d92=this['context']['plugins']['get'](ce);this['set']('activeCommentThread',null),this['on']('addCommentThread',(_0x27eaae,_0x2cc1a5)=>this['_addCommentThread'](_0x2cc1a5)),this['on']('submitCommentThread',(_0x1e05c0,_0x450cfa)=>this['_submitCommentThread'](_0x450cfa)),this['on']('resolveCommentThread',(_0x2925a5,_0x6fa088)=>this['_resolveCommentThread'](_0x6fa088)),this['on']('resolveCommentThread',(_0x11bb65,_0x10021f)=>this['_updateActiveAnnotation'](_0x10021f),{'priority':'lowest'}),this['on']('reopenCommentThread',(_0x56df01,_0x1be974)=>this['_reopenCommentThread'](_0x1be974)),this['on']('reopenCommentThread',(_0x398b53,_0x448143)=>this['_updateActiveAnnotation'](_0x448143),{'priority':'lowest'}),this['on']('removeCommentThread',(_0x11060b,_0x181fd1)=>this['_removeCommentThread'](_0x181fd1)),this['on']('updateCommentThread',(_0x3186b3,_0x38f7c4)=>this['_updateCommentThread'](_0x38f7c4)),this['on']('updateCommentThread',(_0x419b8e,_0x1830fc)=>this['_updateActiveAnnotation'](_0x1830fc),{'priority':'lowest'}),this['on']('addComment',(_0xb8c420,_0x5a77ec)=>this['_addComment'](_0x5a77ec)),this['on']('updateComment',(_0x24c74e,_0x5b60e8)=>this['_updateComment'](_0x5b60e8)),this['on']('removeComment',(_0x458a96,_0x157d25)=>this['_removeComment'](_0x157d25)),this['on']('addComment',(_0x3920ff,{threadId:_0x4cbecc,isFromAdapter:_0xdc5486})=>{if(_0xdc5486)return;const _0x3e3a0d=this['getCommentThread'](_0x4cbecc),_0x11ae5f=_0x3e3a0d&&this['_threadToController']['get'](_0x3e3a0d);_0x11ae5f&&_0x11ae5f['view']['commentsListView']['focus'](-0x1);},{'priority':'lowest'}),this['listenTo'](_0x2f5d92,'change:activeAnnotations',(_0x49798b,_0x25f346,_0x4cd0f5)=>{const _0x27a121=Array['from'](_0x4cd0f5)['map'](_0x26a7dc=>this['_viewToController']['get'](_0x26a7dc['innerView']))['filter'](Boolean)[0x0];this['activeCommentThread']=_0x27a121?_0x27a121['model']:null;});}set adapter(_0x21bad0){if(this['_adapter'])throw new _0x465b2f('commentsrepository-adapter-already-set');this['_adapter']=_0x21bad0;}get adapter(){return this['_adapter'];}addCommentThread({channelId:_0x5621d3=de,threadId:_0x3b733d=_0x4b3e41(),comments:_0x1e07aa=[],unlinkedAt:_0x13dbf4=null,resolvedAt:_0x306c5d=null,resolvedBy:_0x15c591=null,target:_0x3473f4=null,context:_0x205363=null,attributes:_0x574937={},isResolvable:_0x3d0328=!0x0,isSubmitted:_0x9187d2=!0x1,isFromAdapter:_0x2f9f86=!0x1}={}){return this['fire'](ge('addCommentThread',_0x5621d3),{'channelId':_0x5621d3,'threadId':_0x3b733d,'comments':_0x1e07aa,'unlinkedAt':_0x13dbf4,'resolvedAt':_0x306c5d,'resolvedBy':_0x15c591,'target':_0x3473f4,'context':_0x205363,'attributes':_0x574937,'isFromAdapter':_0x2f9f86,'isResolvable':_0x3d0328,'isSubmitted':_0x9187d2}),this['getCommentThread'](_0x3b733d);}openNewCommentThread({channelId:_0x5d21ae=de,threadId:_0x1759f0=_0x4b3e41(),target:_0x36fe74,context:_0x10c154=null,isResolvable:_0x2fe0b1=!0x0}){if(this['_readOnlyChannels']['has'](_0x5d21ae)||this['_readOnlyChannels']['has'](void 0x0))return null;if(!_0x36fe74)throw new _0x465b2f('commentsrepository-missing-target');const _0x1c8503=this['addCommentThread']({'channelId':_0x5d21ae,'threadId':_0x1759f0,'target':_0x36fe74,'context':_0x10c154,'isResolvable':_0x2fe0b1});if(!_0x1c8503)return null;const _0x57765c=this['_threadToController']['get'](_0x1c8503),_0x298744=_0x57765c['view']['commentThreadInputView']['commentInputView'],_0x1c46cc=this['context']['plugins']['get'](ce),_0x23e478=_0x1c46cc['getByInnerView'](_0x57765c['view']);return _0x1c46cc['activate'](_0x23e478),_0x298744['once']('editorReady',()=>_0x298744['focus']()),_0x1c8503;}hasCommentThread(_0x2d15a4){if('string'!=typeof _0x2d15a4)throw new _0x465b2f('commentsrepository-invalid-comment-thread-id');return this['_threads']['has'](_0x2d15a4);}updateCommentThread({channelId:_0x506bfe=de,threadId:_0x52464c,context:_0x5c038f,unlinkedAt:_0x75f244,attributes:_0x3d93d6,isFromAdapter:_0x1080e8=!0x1}){return this['fire'](ge('updateCommentThread',_0x506bfe),{'channelId':_0x506bfe,'threadId':_0x52464c,'context':_0x5c038f,'unlinkedAt':_0x75f244,'attributes':_0x3d93d6,'isFromAdapter':_0x1080e8}),this['getCommentThread'](_0x52464c);}getCommentThread(_0x19c19b){if('string'!=typeof _0x19c19b)throw new _0x465b2f('commentsrepository-invalid-comment-thread-id');return this['_threads']['get'](_0x19c19b);}fetchCommentThread({channelId:_0x18074c,threadId:_0x41f417}={}){const _0x42744c=this['getCommentThread'](_0x41f417);if(_0x42744c)return Promise['resolve'](_0x42744c);if(!this['adapter'])return Promise['resolve'](void 0x0);if('function'!=typeof this['adapter']['getCommentThread'])throw new _0x465b2f('commentsrepository-missing-thread-and-adapter-method',this['context']);return this['adapter']['getCommentThread']({'channelId':_0x18074c,'threadId':_0x41f417})['then'](_0x5de066=>this['hasCommentThread'](_0x41f417)?this['getCommentThread'](_0x41f417):_0x5de066?this['addCommentThread'](Object['assign']({'isFromAdapter':!0x0,'channelId':_0x18074c},_0x5de066)):void 0x0)['catch'](_0x27f636=>{throw console['error'](_0x27f636),new _0x465b2f('commentsrepository-fetch-comment-thread',this['context']);});}getCommentThreads({channelId:_0x474c96,skipNotAttached:_0x42e38c=!0x1,skipEmpty:_0x74e968=!0x1,toJSON:_0x405ae1=!0x1}={}){const _0x25073f=[];for(const _0x5a6b6e of this['_threads']['values']())_0x474c96&&_0x5a6b6e['channelId']!==_0x474c96||_0x42e38c&&!_0x5a6b6e['isAttached']||_0x74e968&&0x0===_0x5a6b6e['length']||_0x25073f['push'](_0x5a6b6e);return _0x405ae1?_0x25073f['map'](_0x7979e4=>_0x7979e4['toJSON']()):_0x25073f;}getAnnotationForCommentThread(_0x11306e){const _0x24a69c=this['_threadToController']['get'](_0x11306e);return _0x24a69c&&this['context']['plugins']['get'](ce)['getByInnerView'](_0x24a69c['view'])||null;}getCommentThreadForAnnotation(_0x5239a7){const _0x165ab2=this['_viewToController']['get'](_0x5239a7['innerView']);return _0x165ab2?_0x165ab2['model']:null;}setActiveCommentThread(_0x21f8e2){const _0x1fc6b6=this['context']['plugins']['get'](ce);if(!_0x21f8e2)return void(this['activeCommentThread']&&_0x1fc6b6['deactivateAll']());const _0x15c5de=this['getCommentThread'](_0x21f8e2);if(!_0x15c5de)throw new _0x465b2f('commentsrepository-active-missing-comment-thread',null,{'threadId':_0x21f8e2});if(!this['_threadToController']['has'](_0x15c5de))throw new _0x465b2f('commentsrepository-active-not-attached',null,{'threadId':_0x21f8e2});const _0x38f261=_0x1fc6b6['getByInnerView'](this['_threadToController']['get'](_0x15c5de)['view']);_0x1fc6b6['activate'](_0x38f261);}switchReadOnly(_0x44491e,_0x419bc6){_0x44491e?this['_readOnlyChannels']['add'](_0x419bc6):this['_readOnlyChannels']['delete'](_0x419bc6),this['fire']('change:_readOnlyChannels','_readOnlyChannels',this['_readOnlyChannels'],this['_readOnlyChannels']);}['isReadOnly'](_0x30125b){return this['_readOnlyChannels']['has'](_0x30125b)||this['_readOnlyChannels']['has'](void 0x0);}createCommentThreadController(_0x40497f,_0x287693){return new St(_0x40497f,_0x287693);}setPermissions(_0x1b0cac,_0x42342a=de){this['_permissions']['set'](_0x42342a,_0x1b0cac),this['fire']('change:_permissions','_permissions',this['_permissions'],this['_permissions']);}getPermissions(_0x5bc3f1=de){return this['_permissions']['has'](_0x5bc3f1)?this['_permissions']['get'](_0x5bc3f1):le;}_addCommentThread({channelId:_0x5b464a,threadId:_0x3c45cd,comments:_0x47662a,unlinkedAt:_0x4c521d,resolvedAt:_0x1f75e9,resolvedBy:_0x19674a,target:_0x558235,context:_0x591ab0,attributes:_0x366822,isFromAdapter:_0x374175,isResolvable:_0x3ab13d,isSubmitted:_0x3e3885}){if('string'!=typeof _0x3c45cd)throw new _0x465b2f('commentsrepository-invalid-comment-thread-id',null,{'threadId':_0x3c45cd});if(this['hasCommentThread'](_0x3c45cd))throw new _0x465b2f('commentsrepository-duplicated-comment-thread-id',null,{'threadId':_0x3c45cd});const _0x2040fc=new pe(this,{'channelId':_0x5b464a,'id':_0x3c45cd,'context':_0x591ab0,'attributes':_0x366822,'unlinkedAt':_0x4c521d,'resolvedAt':_0x1f75e9,'resolvedBy':_0x19674a?this['context']['plugins']['get'](_0x342a1b)['getUser'](_0x19674a):null,'isResolvable':_0x3ab13d,'isSubmitted':_0x3e3885||_0x374175});this['_threads']['set'](_0x3c45cd,_0x2040fc);for(const _0x2e9ff3 of _0x47662a)_0x2040fc['_add'](this['_createNewComment']({'threadId':_0x3c45cd,..._0x2e9ff3}));return _0x558235&&_0x2040fc['attachTo'](_0x558235),_0x374175||!_0x2040fc['length']?Promise['resolve']():this['_submitCommentThread']({'channelId':_0x5b464a,'threadId':_0x3c45cd});}_submitCommentThread({channelId:_0x4f2ee3,threadId:_0x4d90c8}){if(!this['hasCommentThread'](_0x4d90c8))throw new _0x465b2f('commentsrepository-missing-comment-thread',this);const _0x5a6546=this['getCommentThread'](_0x4d90c8);if(_0x5a6546['_isSubmitted']=!0x0,!this['adapter']||'function'!=typeof this['adapter']['addCommentThread'])return Promise['resolve']();const {id:_0x4dfc99,comments:_0x4fec48,resolvedAt:_0x18c41e,resolvedBy:_0xf76c52,context:_0xe326f2,attributes:_0x1a88ef}=_0x5a6546,_0x185747=this['context']['plugins']['get']('PendingActions'),_0x25a3ba=_0x185747['add'](Pt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['addCommentThread']({'channelId':_0x4f2ee3,'threadId':_0x4dfc99,'comments':_0x4fec48['map'](_0x4265c6=>_0x4265c6['toJSON']()),'resolvedAt':_0x18c41e,'resolvedBy':_0xf76c52?_0xf76c52['id']:_0xf76c52,'context':_0xe326f2,'attributes':_0x1a88ef})['then'](({comments:_0x359c90})=>{_0x185747['remove'](_0x25a3ba);for(const _0x3fbb2c of _0x359c90)this['_updateComment']({'channelId':_0x4f2ee3,'threadId':_0x4d90c8,'commentId':_0x3fbb2c['commentId'],'createdAt':_0x3fbb2c['createdAt'],'isFromAdapter':!0x0});})['catch'](_0x4a3033=>{throw console['error'](_0x4a3033),new _0x465b2f('commentsrepository-add-comment-thread-internal-error',this);});}_attachCommentThread({threadId:_0x526892,target:_0x9b197f}){const _0x2bcd69=this['getCommentThread'](_0x526892);if(!_0x2bcd69)throw new _0x465b2f('commentsrepository-attach-missing-comment-thread',this);const _0x2ee5f0=this['context']['plugins']['get']('PendingActions'),_0x5f004b=this['context']['plugins']['get'](ce),_0x5c6810=this['_createCommentThreadView'](_0x2bcd69),_0x8696e7=new St(_0x2bcd69,_0x5c6810);let _0x11f3b1=null;_0x5c6810['on']('change:isDirty',(_0x6b8fa7,_0x113339,_0xf86ad7)=>{_0xf86ad7?_0x11f3b1=_0x2ee5f0['add'](Pt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD')):_0x11f3b1&&(_0x2ee5f0['remove'](_0x11f3b1),_0x11f3b1=null);}),this['_threadToController']['set'](_0x2bcd69,_0x8696e7),this['_viewToController']['set'](_0x5c6810,_0x8696e7);const _0x123519=new ie(this['context']['locale'],_0x5c6810);_0x123519['bind']('length')['to'](_0x5c6810),_0x123519['bind']('isDirty')['to'](_0x5c6810,'isDirty',_0x5c6810,'length',(_0x2c20a4,_0x30ae7e)=>_0x2c20a4||!_0x30ae7e),_0x123519['bind']('isActive')['to'](_0x5c6810),_0x123519['type']='comment';const _0x2e148e=new ne({'view':_0x123519,'target':_0x9b197f,'type':'comment','isVisible':!_0x2bcd69['archivedAt']&&!!('function'==typeof _0x9b197f?_0x9b197f():_0x9b197f)});return _0x5c6810['on']('escape',()=>{_0x2e148e['fire']('escape');}),this['_bindAnnotationToEditors'](_0x5c6810,_0x2e148e),_0x5f004b['add'](_0x2e148e),_0x2e148e;}_bindAnnotationToEditors(_0x546518,_0x26a77c){this['listenTo'](_0x546518,'editorReady',(_0x25111b,_0x473215)=>{const _0x41c116=_0x473215['ui']['view']['body']['bodyCollectionContainer'];_0x26a77c['focusableElements']['add'](_0x41c116),this['context']instanceof _0x49bdf6&&this['context']['ui']['focusTracker']['add'](_0x41c116);},{'priority':'highest'}),this['listenTo'](_0x546518,'editorDestroyed',(_0x16781a,_0x316a7c)=>{const _0x38efbb=_0x316a7c['ui']['view']['body']['bodyCollectionContainer'];_0x26a77c['focusableElements']['has'](_0x38efbb)&&_0x26a77c['focusableElements']['remove'](_0x38efbb),this['context']instanceof _0x49bdf6&&this['context']['ui']['focusTracker']['remove'](_0x38efbb);});}_unbindEditors(_0xcb57ab){this['stopListening'](_0xcb57ab,'editorReady'),this['stopListening'](_0xcb57ab,'editorDestroyed');}_createCommentThreadView(_0x412938){const _0x33de2d=this['context']['plugins']['get'](_0x342a1b),{config:_0x364c30,locale:_0x3f58c9}=this['context'],_0x5042be=_0xc906fd(_0x364c30['get']('locale'),_0x3f58c9);return new(0x0,(_0x364c30['get']('comments'))['CommentThreadView'])(_0x3f58c9,_0x412938,_0x33de2d['me'],{'editorConfig':{..._0x364c30['get']('comments.editorConfig'),...this['_getCommentEditorOverlayConfig'](),'licenseKey':this['context']['config']['get']('licenseKey')},'copyMarkers':_0x364c30['get']('comments.copyMarkers'),'maxCommentsWhenCollapsed':_0x364c30['get']('comments.maxCommentsWhenCollapsed'),'maxThreadTotalWeight':_0x364c30['get']('comments.maxThreadTotalWeight'),'maxCommentCharsWhenCollapsed':_0x364c30['get']('comments.maxCommentCharsWhenCollapsed'),'formatDateTime':_0x5042be,'CommentView':_0x364c30['get']('comments')['CommentView']});}_getCommentEditorOverlayConfig(){const _0x1feaba=this['context']['config'],_0x19230a=_0x1feaba['get']('comments.editorConfig'),_0x1747ae=_0x19230a?.['ui']?.['overlayContainer']||_0x1feaba['get']('sidebar.overlayContainer')||_0x1feaba['get']('ui.overlayContainer');return _0x1747ae?{'ui':{..._0x19230a?.['ui'],'overlayContainer':_0x1747ae}}:{};}_resolveCommentThread({threadId:_0x477a01,channelId:_0x51f7b1,resolvedAt:_0x3aa62f,resolvedBy:_0x3fb037,isFromAdapter:_0x4a7db4}){if(!this['hasCommentThread'](_0x477a01))throw new _0x465b2f('commentsrepository-missing-comment-thread',null,{'threadId':_0x477a01});const _0x2e4c85=this['getCommentThread'](_0x477a01);if(_0x2e4c85['isResolved'])throw new _0x465b2f('commentsrepository-resolved-comment-thread',null,{'threadId':_0x477a01});const _0x27eb03=this['context']['plugins']['get'](_0x342a1b);if(_0x2e4c85['resolvedBy']=_0x27eb03['getUser'](_0x3fb037),_0x2e4c85['resolvedAt']=_0x3aa62f,_0x4a7db4||!this['adapter']||'function'!=typeof this['adapter']['resolveCommentThread'])return Promise['resolve']();const _0x9b51fe=this['context']['plugins']['get']('PendingActions'),_0x30597b=_0x9b51fe['add'](Pt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['resolveCommentThread']({'channelId':_0x51f7b1,'threadId':_0x477a01})['then'](({resolvedAt:_0x4ac42f,resolvedBy:_0x4cd979})=>{_0x9b51fe['remove'](_0x30597b),_0x2e4c85['resolvedBy']['id']!==_0x4cd979&&(_0x2e4c85['resolvedBy']=_0x27eb03['getUser'](_0x4cd979)),_0x2e4c85['resolvedAt']=_0x4ac42f;})['catch'](_0x47ee0c=>{throw console['error'](_0x47ee0c),new _0x465b2f('commentsrepository-resolve-comment-thread-internal-error',this);});}_reopenCommentThread({threadId:_0x1ef259,channelId:_0x529e57,isFromAdapter:_0x7c3319}){if(!this['hasCommentThread'](_0x1ef259))throw new _0x465b2f('commentsrepository-missing-comment-thread',null,{'threadId':_0x1ef259});const _0x1fddfa=this['getCommentThread'](_0x1ef259);if(!_0x1fddfa['isResolved'])throw new _0x465b2f('commentsrepository-reopen-comment-thread',null,{'threadId':_0x1ef259});if(_0x1fddfa['resolvedBy']=null,_0x1fddfa['resolvedAt']=null,_0x7c3319||!this['adapter']||'function'!=typeof this['adapter']['reopenCommentThread'])return Promise['resolve']();const _0x381781=this['context']['plugins']['get']('PendingActions'),_0x48a8e8=_0x381781['add'](Pt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['reopenCommentThread']({'channelId':_0x529e57,'threadId':_0x1ef259})['then'](()=>_0x381781['remove'](_0x48a8e8))['catch'](_0xff3e5b=>{throw console['error'](_0xff3e5b),new _0x465b2f('commentsrepository-reopen-comment-thread-internal-error',this);});}_removeCommentThread({threadId:_0x2dad31,isFromAdapter:_0x2a0e8d}){const _0x5ea987=this['getCommentThread'](_0x2dad31);if(!_0x5ea987)throw new _0x465b2f('commentsrepository-remove-missing-comment-thread',this);if(this['_detachCommentThread'](_0x2dad31),this['_threads']['delete'](_0x2dad31),!_0x5ea987['isSubmitted']||_0x2a0e8d||!this['adapter']||'function'!=typeof this['adapter']['removeCommentThread'])return Promise['resolve']();const _0x52ef06=this['context']['plugins']['get']('PendingActions'),{channelId:_0x1a9ec7}=_0x5ea987,_0x51abc3=_0x52ef06['add'](Pt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['removeCommentThread']({'channelId':_0x1a9ec7,'threadId':_0x2dad31})['then'](()=>_0x52ef06['remove'](_0x51abc3))['catch'](_0x204397=>{throw console['error'](_0x204397),new _0x465b2f('commentsrepository-remove-comment-thread-internal-error',this);});}_updateCommentThread({threadId:_0x5954b0,unlinkedAt:_0x1dc8a6,context:_0x48797e,attributes:_0x511314,isFromAdapter:_0x188b57}){if('string'!=typeof _0x5954b0)throw new _0x465b2f('commentsrepository-invalid-comment-thread-id',null,{'threadId':_0x5954b0});if(!this['hasCommentThread'](_0x5954b0))throw new _0x465b2f('commentsrepository-missing-comment-thread',null,{'threadId':_0x5954b0});const _0x462662=this['getCommentThread'](_0x5954b0);let _0x294fe5=!0x1;if(void 0x0!==_0x48797e&&_0x462662['context']!==_0x48797e&&(_0x462662['context']=_0x48797e,_0x294fe5=!0x0),void 0x0!==_0x1dc8a6&&_0x462662['unlinkedAt']!==_0x1dc8a6&&(_0x462662['unlinkedAt']=_0x1dc8a6,_0x294fe5=!0x0),_0x511314&&!_0x3db2b3(_0x511314,_0x462662['attributes'])&&(_0x462662['attributes']=_0x511314,_0x294fe5=!0x0),!_0x294fe5)return Promise['resolve']();if(!_0x462662['isSubmitted']||_0x188b57||!this['adapter']||'function'!=typeof this['adapter']['updateCommentThread'])return Promise['resolve']();const _0xbdb03d=this['context']['plugins']['get']('PendingActions'),{channelId:_0x5e401e}=_0x462662,_0x2dfd53=_0xbdb03d['add'](Pt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['updateCommentThread']({'channelId':_0x5e401e,'threadId':_0x5954b0,'context':_0x48797e,'unlinkedAt':_0x1dc8a6,'attributes':_0x511314})['then'](()=>_0xbdb03d['remove'](_0x2dfd53))['catch'](_0x4a715b=>{throw console['error'](_0x4a715b),new _0x465b2f('commentsrepository-update-comment-thread-internal-error',this);});}_detachCommentThread(_0x2e663e){const _0x46d621=this['context']['plugins']['get'](ce),_0x5c51fe=this['getCommentThread'](_0x2e663e);if(_0x5c51fe['_isAttached']=!0x1,this['_threadToController']['has'](_0x5c51fe)){const _0x39acea=this['_threadToController']['get'](_0x5c51fe),_0x582f4f=_0x39acea['view'],_0x245d6f=_0x46d621['getByInnerView'](_0x582f4f);this['_threadToController']['delete'](_0x5c51fe),this['_viewToController']['delete'](_0x582f4f),_0x245d6f&&_0x46d621['remove'](_0x245d6f),_0x39acea['destroy'](),_0x582f4f['destroy']()['then'](()=>{this['_unbindEditors'](_0x582f4f);});}}_updateActiveAnnotation({threadId:_0x3f334e,resolvedAt:_0xdf71a,unlinkedAt:_0x29a917}){const _0x233c04=!!_0xdf71a,_0x5aef80=this['context']['plugins']['get'](ce),_0x4a1ee2=this['getCommentThread'](_0x3f334e);if(this['_threadToController']['has'](_0x4a1ee2)){const _0x112798=this['_threadToController']['get'](_0x4a1ee2)['view'],_0x5aa52c=_0x5aef80['getByInnerView'](_0x112798);_0x5aa52c&&(_0x233c04&&_0x5aef80['_removeActiveAnnotation'](_0x5aa52c),_0x29a917?_0x5aa52c['isVisible']=!0x1:_0x5aa52c['refreshVisibility']());}}_getExternalAuthor(_0x1182a8){const _0x4ba5a5=this['context']['plugins']['get'](_0x342a1b),_0x34a3dc=_0x2af181('external:'+_0x1182a8),_0x75c5cd=_0x4ba5a5['getUser'](_0x34a3dc);return _0x75c5cd||_0x4ba5a5['addUser']({'id':_0x34a3dc,'name':_0x1182a8});}_createNewComment({threadId:_0x5db6b6,commentId:_0x480f1c=_0x4b3e41(),content:_0x2b29f3,authorId:_0x4c382f,createdAt:_0x4e287a,attributes:_0x3cbb05}){if('string'!=typeof _0x480f1c)throw new _0x465b2f('commentsrepository-invalid-commentid');if('string'!=typeof _0x4c382f)throw new _0x465b2f('commentsrepository-invalid-comment-authorid');if('string'!=typeof _0x2b29f3||!_0x2b29f3['trim']())throw new _0x465b2f('commentsrepository-invalid-comment-content');const _0x3a2766=this['context']['plugins']['get'](_0x342a1b)['getUser'](_0x4c382f);if(!_0x3a2766)throw new _0x465b2f('commentsrepository-add-comment-user-not-exists',null,{'authorId':_0x4c382f});let _0x101c84=null,_0x5900ab=_0x4e287a;return _0x3cbb05?.['@external']&&(_0x101c84=this['_getExternalAuthor'](_0x3cbb05['@external']['authorName']),_0x5900ab=new Date(_0x3cbb05['@external']['createdAt'])),new we(this,{'threadId':_0x5db6b6,'id':_0x480f1c,'author':_0x101c84||_0x3a2766,'creator':_0x3a2766,'content':_0x2b29f3,'createdAt':_0x4e287a,'authoredAt':_0x5900ab,'attributes':_0x3cbb05});}_addComment(_0x1be153){let {threadId:_0x339394,content:_0x59cbe5,attributes:_0x5da431,isFromAdapter:_0x3ffc30}=_0x1be153;const _0x5c1858=this['getCommentThread'](_0x1be153['threadId']);if(!_0x5c1858)throw new _0x465b2f('commentsrepository-add-comment-to-missing-comment-thread',this);const _0x580f9e=this['_createNewComment'](_0x1be153),{id:_0x1f7100}=_0x580f9e;if(_0x5c1858['_add'](_0x580f9e),_0x3ffc30||!this['adapter']||'function'!=typeof this['adapter']['addComment']||!_0x5c1858['isSubmitted'])return Promise['resolve']();const _0x271c17=this['context']['plugins']['get']('PendingActions'),{channelId:_0x2038aa}=_0x5c1858,_0x1506fb=_0x271c17['add'](Pt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return _0x5da431||(_0x5da431={}),this['adapter']['addComment']({'channelId':_0x2038aa,'threadId':_0x339394,'commentId':_0x1f7100,'content':_0x59cbe5,'attributes':_0x5da431})['then'](_0x197a55=>{_0x271c17['remove'](_0x1506fb),_0x197a55&&this['_updateComment']({'channelId':_0x2038aa,'threadId':_0x339394,'commentId':_0x1f7100,'createdAt':_0x197a55['createdAt'],'isFromAdapter':!0x0});})['catch'](_0x3b5280=>{throw console['error'](_0x3b5280),new _0x465b2f('commentsrepository-add-comment-internal-error',this);});}_updateComment({threadId:_0x46b7f1,commentId:_0x2dfec9,content:_0x84945b,createdAt:_0x25713f,attributes:_0x12a300,isFromAdapter:_0x114f06}){if(void 0x0!==_0x84945b&&('string'!=typeof _0x84945b||!_0x84945b['trim']()['length']))throw new _0x465b2f('commentsrepository-update-comment-invalid-content');const _0x4be99e=this['getCommentThread'](_0x46b7f1),_0x3eee5b=_0x4be99e['getComment'](_0x2dfec9);if(!_0x3eee5b)throw new _0x465b2f('commentsrepository-update-missing-comment',this);let _0x5caaf2=!0x1;if(_0x84945b&&_0x84945b!==_0x3eee5b['content']&&(_0x3eee5b['isEditable']||_0x114f06)&&(_0x3eee5b['content']=_0x84945b,_0x5caaf2=!0x0),_0x25713f&&_0x25713f!==_0x3eee5b['createdAt']&&(_0x3eee5b['createdAt']=_0x25713f,_0x3eee5b['isExternal']||(_0x3eee5b['authoredAt']=_0x25713f),_0x5caaf2=!0x0),_0x12a300&&!_0x3db2b3(_0x12a300,_0x3eee5b['attributes'])&&(_0x3eee5b['attributes']=_0x12a300,_0x5caaf2=!0x0),!_0x5caaf2)return Promise['resolve']();if(_0x4be99e['fire']('commentUpdated'),_0x114f06||!this['adapter']||'function'!=typeof this['adapter']['updateComment'])return Promise['resolve']();const _0x1c821f=this['context']['plugins']['get']('PendingActions'),{channelId:_0x5e6565}=this['getCommentThread'](_0x3eee5b['threadId']),_0x52a49f=_0x1c821f['add'](Pt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['updateComment']({'channelId':_0x5e6565,'threadId':_0x46b7f1,'commentId':_0x2dfec9,'content':_0x84945b,'attributes':_0x12a300})['then'](()=>_0x1c821f['remove'](_0x52a49f))['catch'](_0x3b4633=>{throw console['error'](_0x3b4633),new _0x465b2f('commentsrepository-update-comment-internal-error',this);});}_removeComment({threadId:_0x1996d7,commentId:_0x139902,isFromAdapter:_0x18c85a}){const _0x7521d7=this['getCommentThread'](_0x1996d7),_0x5b7078=_0x7521d7['getComment'](_0x139902);if(!_0x5b7078)throw new _0x465b2f('commentsrepository-remove-missing-comment',this);if(_0x7521d7['_remove'](_0x5b7078),_0x18c85a||!this['adapter']||'function'!=typeof this['adapter']['removeComment'])return Promise['resolve']();const _0x38e4d6=this['context']['plugins']['get']('PendingActions'),{channelId:_0x280b7c}=_0x7521d7,_0x18aed6=_0x38e4d6['add'](Pt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['removeComment']({'channelId':_0x280b7c,'threadId':_0x1996d7,'commentId':_0x139902})['then'](()=>_0x38e4d6['remove'](_0x18aed6))['catch'](_0x28ade8=>{throw console['error'](_0x28ade8),new _0x465b2f('commentsrepository-remove-comment-internal-error',this);});}},pe=class extends me{['channelId'];['id'];_isAttached;_isSubmitted;comments;_repository;constructor(_0x2ad5ff,_0x73e72e){super();const _0x2fbaca=_0x73e72e['isResolvable'];this['channelId']=_0x73e72e['channelId'],this['id']=_0x73e72e['id'],this['comments']=new _0x574e6b(),this['_repository']=_0x2ad5ff,this['_isAttached']=!0x1,this['_isSubmitted']=_0x73e72e['isSubmitted'],this['set']('_hasTargetInContent',!0x0),this['bind']('isReadOnly')['to'](_0x2ad5ff,'_permissions',_0x2ad5ff,'_readOnlyChannels',()=>_0x2ad5ff['isReadOnly'](this['channelId'])),this['bind']('isRemovable')['to'](_0x2ad5ff,'_permissions',()=>_0x2ad5ff['getPermissions'](this['channelId'])['admin']),this['bind']('canComment')['to'](_0x2ad5ff,'_permissions',()=>{const _0x54f7e1=_0x2ad5ff['getPermissions'](this['channelId']);return _0x54f7e1['write']||_0x54f7e1['admin'];}),this['bind']('isResolvable')['to'](_0x2ad5ff,'_permissions',()=>_0x2fbaca&&_0x2ad5ff['getPermissions'](this['channelId'])['resolve']),this['set']('context',_0x73e72e['context']),this['bind']('archivedAt')['to'](this,'resolvedAt',this,'unlinkedAt',(_0x353253,_0x3d44a3)=>_0x353253?_0x3d44a3?_0x353253<_0x3d44a3?_0x353253:_0x3d44a3:_0x353253:_0x3d44a3),this['set']('unlinkedAt',_0x73e72e['unlinkedAt']||null),this['set']('resolvedAt',_0x73e72e['resolvedAt']||null),this['set']('resolvedBy',_0x73e72e['resolvedBy']||null),this['bind']('isResolved')['to'](this,'resolvedAt',_0x1bf216=>!!_0x1bf216),this['set']('attributes',_0x73e72e['attributes']||{});}get weight(){return Array['from'](this['comments'])['reduce']((_0x2c2e94,_0xb76e85)=>_0x2c2e94+_0xb76e85['weight'],0x0);}get length(){return this['comments']['length'];}get isAttached(){return this['_isAttached'];}get isSubmitted(){return this['_isSubmitted'];}submit(){const {channelId:_0x2ed6bc,id:_0xec0b6a}=this;this['_repository']['fire'](ge('submitCommentThread',_0x2ed6bc),{'channelId':_0x2ed6bc,'threadId':_0xec0b6a});}setUnlinkedAt(_0x594b07){this['_update']({'unlinkedAt':_0x594b07});}['resolve']({resolvedAt:_0x52f8bf=new Date(),resolvedBy:_0x55676b='',isFromAdapter:_0x47ae40=!0x1}={}){const _0x1b76c5=this['_repository']['context']['plugins']['get'](_0x342a1b)['me'],{channelId:_0x4a0834,id:_0x673762}=this;this['_repository']['fire'](ge('resolveCommentThread',_0x4a0834),{'channelId':_0x4a0834,'threadId':_0x673762,'resolvedAt':_0x52f8bf,'resolvedBy':_0x55676b||_0x1b76c5['id'],'isFromAdapter':_0x47ae40});}['reopen']({isFromAdapter:_0x1e658f=!0x1}={}){const {channelId:_0x52ddce,id:_0x4afdb4}=this;this['_repository']['fire'](ge('reopenCommentThread',_0x52ddce),{'channelId':_0x52ddce,'threadId':_0x4afdb4,'isFromAdapter':_0x1e658f});}setContext(_0x5acd39){this['context']||this['_update']({'context':_0x5acd39});}setAttribute(_0x2a1394,_0x5c9e0e){const _0xeddf32=_0x17c962(this['attributes']);_0x42b64f(_0xeddf32,_0x2a1394,_0x5c9e0e),this['_update']({'attributes':_0xeddf32});}removeAttribute(_0x25e300){const _0x17ab8=_0x17c962(this['attributes']);_0x5f0fd7(_0x17ab8,_0x25e300),this['_update']({'attributes':_0x17ab8});}['remove']({isFromAdapter:_0x3be59c=!0x1}={}){const {channelId:_0x2bf202,id:_0x3c9201}=this;this['_repository']['fire'](ge('removeCommentThread',_0x2bf202),{'channelId':_0x2bf202,'threadId':_0x3c9201,'isFromAdapter':_0x3be59c});}attachTo(_0x53ad21){return this['_repository']['_attachCommentThread']({'threadId':this['id'],'target':_0x53ad21});}addComment(_0x25cba6){const {channelId:_0x3723fc,id:_0x5d4db2}=this;this['_repository']['fire'](ge('addComment',_0x3723fc,_0x5d4db2),Object['assign']({'channelId':_0x3723fc,'threadId':_0x5d4db2},_0x25cba6));}getComment(_0x52a327){if('string'!=typeof _0x52a327)throw new _0x465b2f('commentsrepository-get-comment-invalid-id',null,{'commentId':_0x52a327});return this['comments']['get'](_0x52a327);}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'](_0x18cb7d=>_0x18cb7d['toJSON']()),'attributes':this['attributes']};}['_add'](_0x4256b1){return this['listenTo'](_0x4256b1,'change:authoredAt',()=>{const _0x73e2a1=this['_findOptimalIndex'](_0x4256b1),_0x192003=this['comments'];_0x73e2a1-0x1!=_0x192003['getIndex'](_0x4256b1)&&_0x73e2a1+0x1!=_0x192003['getIndex'](_0x4256b1)&&(this['_remove'](_0x4256b1),this['_add'](_0x4256b1));}),this['comments']['add'](_0x4256b1,this['_findOptimalIndex'](_0x4256b1));}_update(_0x2efd5d){const {channelId:_0x597749,id:_0x108ef6}=this;this['_repository']['fire'](ge('updateCommentThread',_0x597749),{..._0x2efd5d,'channelId':_0x597749,'threadId':_0x108ef6});}['_remove'](_0x3250ba){return this['stopListening'](_0x3250ba),_0x3250ba['destroy'](),this['comments']['remove'](_0x3250ba);}_findOptimalIndex(_0x759f90){const _0x7efbd4=this['comments']['find'](_0x7991a8=>new Date(_0x7991a8['authoredAt'])['getTime']()>new Date(_0x759f90['authoredAt'])['getTime']());return _0x7efbd4?this['comments']['getIndex'](_0x7efbd4):this['length'];}},we=class extends ue{['id'];threadId;author;creator;createdAt;_repository;constructor(_0x405b30,_0x1ff6a3){super();const _0x225ed4=_0x405b30['context']['plugins']['get'](_0x342a1b)['me'],_0x4a7eaa=_0x405b30['getCommentThread'](_0x1ff6a3['threadId']),_0x23c553=0x0===_0x4a7eaa['comments']['length'],_0x2175f0=_0x225ed4===_0x1ff6a3['author'];this['id']=_0x1ff6a3['id'],this['threadId']=_0x1ff6a3['threadId'],this['author']=_0x1ff6a3['author'],this['creator']=_0x1ff6a3['creator'],this['set']('content',_0x1ff6a3['content']),this['createdAt']=_0x1ff6a3['createdAt']||new Date(),this['set']('authoredAt',_0x1ff6a3['authoredAt']||new Date()),this['bind']('resolvedAt')['to'](_0x4a7eaa,'resolvedAt'),this['set']('attributes',_0x1ff6a3['attributes']||{}),this['bind']('isEditable')['to'](_0x405b30,'_permissions',()=>{const _0x5b576d=_0x405b30['getPermissions'](_0x4a7eaa['channelId'])['write'],_0x2d205b=_0x405b30['getPermissions'](_0x4a7eaa['channelId'])['modifyAll'];return _0x2175f0&&_0x5b576d||!_0x2175f0&&_0x2d205b;}),this['bind']('isRemovable')['to'](_0x4a7eaa,'isRemovable',_0x405b30,'_permissions',_0x5a6a6d=>{const _0x27d346=_0x405b30['getPermissions'](_0x4a7eaa['channelId'])['write'],_0x2ffe68=_0x405b30['getPermissions'](_0x4a7eaa['channelId'])['modifyAll'];return _0x2175f0&&_0x27d346||_0x5a6a6d&&_0x23c553||!_0x2175f0&&_0x2ffe68&&!_0x23c553;}),this['bind']('isReadOnly')['to'](_0x4a7eaa,'isReadOnly'),this['_repository']=_0x405b30;}get isExternal(){return Boolean(this['attributes']&&this['attributes']['@external']);}get weight(){return Math['max'](function(_0x30a20a){const _0x2e2a04=document['createElement']('div');return _0x2e2a04['innerHTML']=_0x4694a5(_0x30a20a),_0x2e2a04['textContent']['length'];}(this['content']),0xc8);}update(_0x2bb133){const {threadId:_0x344ac2,id:_0xf4a6d3}=this;if(!this['_repository']['hasCommentThread'](_0x344ac2))throw new _0x465b2f('commentsrepository-update-comment-missing-comment-thread',this);const {channelId:_0x31f5b4}=this['_repository']['getCommentThread'](_0x344ac2);this['_repository']['fire'](ge('updateComment',_0x31f5b4,_0x344ac2),{'channelId':_0x31f5b4,'threadId':_0x344ac2,'commentId':_0xf4a6d3,..._0x2bb133});}setAttribute(_0x2dee97,_0x1316ff){const _0x3d9826=_0x17c962(this['attributes']);_0x42b64f(_0x3d9826,_0x2dee97,_0x1316ff),this['update']({'attributes':_0x3d9826});}removeAttribute(_0x7df6b3){const _0x12c3b1=_0x17c962(this['attributes']);_0x5f0fd7(_0x12c3b1,_0x7df6b3),this['update']({'attributes':_0x12c3b1});}['remove'](_0x4cb02c={}){if(!_0x4cb02c['isFromAdapter']&&!this['isRemovable'])return;const {threadId:_0x495222,id:_0x172237}=this;if(!this['_repository']['hasCommentThread'](_0x495222))throw new _0x465b2f('commentsrepository-remove-comment-missing-comment-thread',this);const {channelId:_0xfae0df}=this['_repository']['getCommentThread'](_0x495222);this['_repository']['fire'](ge('removeComment',_0xfae0df,_0x495222),{'channelId':_0xfae0df,'threadId':_0x495222,'commentId':_0x172237,..._0x4cb02c});}toJSON(){return{'commentId':this['id'],'content':this['content'],'createdAt':this['createdAt'],'authorId':this['creator']['id'],'attributes':this['attributes']};}destroy(){this['stopListening']();}};function ge(_0x4d45be,..._0x30e5a0){for(const _0x2964e4 of _0x30e5a0)void 0x0!==_0x2964e4&&(_0x4d45be+=':'+String(_0x2964e4));return _0x4d45be;}var _e=class extends _0x3fff5d{constructor(_0x44a47d){super(_0x44a47d),this['set']('hasContent',!0x1);}['refresh'](){const _0x4ae441=this['editor']['model']['document']['selection'];this['isEnabled']=!0x0,this['hasContent']=!0x1;for(const _0xa23e70 of _0x4ae441['getRanges']())if(this['_hasContent'](_0xa23e70))return void(this['hasContent']=!0x0);}execute({threadId:_0x49e447=_0x4b3e41(),ranges:_0x21464a,comment:_0x4b4fb3}={}){const _0x2c99cb=this['editor']['model'],_0x15997f=_0x21464a??Array['from'](_0x2c99cb['document']['selection']['getRanges']()),_0x1a5aa0=[];for(const _0x5b0d72 of _0x15997f)this['_hasContent'](_0x5b0d72)&&_0x1a5aa0['push'](this['_trimToContent'](_0x5b0d72));if(!_0x1a5aa0['length'])throw new _0x465b2f('addcommentthreadcommand-incorrect-ranges',null);_0x4b4fb3&&this['_createCommentThread'](_0x49e447,_0x4b4fb3),this['_createMarkersFromRanges'](_0x49e447,_0x1a5aa0,!!_0x4b4fb3);}_createMarkersFromRanges(_0x2775bf,_0x5cc863,_0x410318){this['editor']['model']['change'](_0x54e8b9=>{for(const _0x4b1511 of _0x5cc863){const _0x1c1cd0='comment:'+_0x2775bf+':'+_0x4b3e41()['substr'](0x1,0x5);_0x54e8b9['addMarker'](_0x1c1cd0,{'range':_0x4b1511,'usingOperation':_0x410318,'affectsData':_0x410318});}});}_createCommentThread(_0x4474e6,_0x5c18ac){const _0x2d9ac3=this['editor']['plugins']['get']('CommentsRepository'),_0x2cf65a=this['editor']['config']['get']('collaboration.channelId'),_0x1017ed=this['editor']['plugins']['get']('Users')['me'];if(!_0x1017ed)throw new _0x465b2f('addcommentthreadcommand-user-not-found',null);_0x2d9ac3['addCommentThread']({'threadId':_0x4474e6,'channelId':_0x2cf65a,'comments':[{'authorId':_0x1017ed['id'],'content':_0x5c18ac,'createdAt':new Date(),'attributes':{}}]});}_hasContent(_0x16c158){for(const _0x533a8b of _0x16c158['getItems']())if(this['_itemIsContent'](_0x533a8b))return!0x0;return!0x1;}_itemIsContent(_0xdacf7f){return _0xdacf7f['is']('$textProxy')||this['editor']['model']['schema']['isObject'](_0xdacf7f)&&!_0xdacf7f['is']('element','tableCell');}_trimToContent(_0xdb656f){const _0x3572b5=_0x51bbe3=>!this['_itemIsContent'](_0x51bbe3['item']),_0x540bb9=_0xdb656f['start']['getLastMatchingPosition'](_0x3572b5),_0x2093b6=_0xdb656f['end']['getLastMatchingPosition'](_0x3572b5,{'direction':'backward'});return this['editor']['model']['createRange'](_0x540bb9,_0x2093b6);}},Ae=class extends _0x1a85c9{_dataCollectors;_editorAnnotations;static get requires(){return[ce];}static get['pluginName'](){return'EditorAnnotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x117816){super(_0x117816),this['_dataCollectors']=new Set(),this['_editorAnnotations']=new Set();}init(){const _0x13b688=this['editor'],_0x3e3dcf=_0x13b688['model']['document']['selection'],_0x3392ae=_0x520e15(()=>this['refreshSelectedViews'](),0xa);_0x3e3dcf['on']('change:range',(_0x214eaf,_0x454769)=>{_0x454769['directChange']&&(_0x3392ae['cancel'](),this['refreshSelectedViews']());}),this['listenTo'](_0x13b688['editing']['view']['document'],'change:isFocused',(_0x12c3db,_0x2103c6,_0xcb5855)=>{_0xcb5855&&_0x3392ae();}),this['listenTo'](_0x13b688['ui']['focusTracker'],'change:isFocused',(_0x5b412c,_0xf5b8aa,_0xcd9f4c)=>{_0xcd9f4c||this['fire']('blur',{'isAnnotationTracked':_0x2331cb=>this['_editorAnnotationsData']['has'](_0x2331cb['innerView'])});}),this['listenTo'](this['editor']['ui'],'update',()=>this['fire']('uiUpdate'));}registerAnnotation(_0x1c716a){if(this['_editorAnnotations']['has'](_0x1c716a['view']))return;this['_editorAnnotations']['add'](_0x1c716a['view']),this['editor']['ui']['focusTracker']['add'](_0x1c716a['view']['element']);const _0x1848bf=this['editor']['plugins']['get'](ce);this['listenTo'](_0x1848bf['collection'],'remove',(_0x138987,_0x3dc18f)=>{this['editor']['ui']['focusTracker']['remove'](_0x3dc18f['view']['element']),this['_editorAnnotations']['delete'](_0x3dc18f['view']);});}hasDomSelection(){return this['editor']['editing']['view']['hasDomSelection'];}addSourceCollector(_0x163d1c){if('function'!=typeof _0x163d1c)throw new _0x465b2f('editorannotations-invalid-source-callback');this['_dataCollectors']['add'](_0x163d1c);}refreshSelectedViews(){this['fire']('refresh');}getOrderedSelectedAnnotations({activeAnnotation:_0x24d461,annotations:_0x24f62a}){const _0x3dfda9=[],_0x449ef9=this['editor']['model']['document']['selection'],_0x5de79e=Array['from'](_0x449ef9['getRanges']());for(const [_0x411f6f,_0x176630]of this['_editorAnnotationsData']){const _0x52b942=_0x435e7c(_0x176630),_0x562054=_0x24f62a['getByInnerView'](_0x411f6f);_0x52b942&&_0x562054&&_0x3dfda9['push']({'annotation':_0x562054,'range':_0x52b942});}function _0x435e7c(_0x3957bb){for(const _0x267b91 of _0x3957bb)for(const _0x2c2578 of _0x5de79e)if(_0x267b91['containsRange'](_0x2c2578,!_0x449ef9['isCollapsed']))return _0x267b91;return null;}const _0x3d91f8=new Map(Array['from'](_0x24f62a,(_0x20372b,_0x467f0e)=>[_0x20372b,_0x467f0e]));return _0x3dfda9['sort']((_0x1157c7,_0x211240)=>{const _0x2cd4dc=_0x1157c7['range'],_0x1e3dec=_0x211240['range'];if(!_0x2cd4dc['start']['isTouching'](_0x1e3dec['start'])||!_0x2cd4dc['end']['isTouching'](_0x1e3dec['end'])){if(_0x2cd4dc['containsRange'](_0x1e3dec,!0x0))return 0x1;if(_0x1e3dec['containsRange'](_0x2cd4dc,!0x0))return-0x1;}return _0x1157c7['annotation']==_0x24d461?-0x1:_0x211240['annotation']==_0x24d461?0x1:(_0x3d91f8['get'](_0x1157c7['annotation'])??0x0)-(_0x3d91f8['get'](_0x211240['annotation'])??0x0);})['map'](_0x5f094d=>_0x5f094d['annotation']);}get _editorAnnotationsData(){const _0x5afe26=new Map();for(const _0x16b7ca of Array['from'](this['_dataCollectors']))for(const [_0x2454fc,_0x2a9d03]of _0x16b7ca())_0x5afe26['set'](_0x2454fc,_0x2a9d03);return _0x5afe26;}},ve=class extends _0x1a85c9{afterInit(){const _0x6960b=this['editor'];_0x6960b['plugins']['has']('RestrictedEditingModeEditing')&&_0x6960b['plugins']['get']('RestrictedEditingModeEditing')['enableCommand']('addCommentThread');}},ye=class extends _0x1a85c9{constructor(_0x1ae75b){super(_0x1ae75b),this['editor']['config']['define']('importWord.formatting.comments','basic');}afterInit(){const _0x4e0d40=this['editor'],_0x11a75a=_0x4e0d40['commands']['get']('importWord'),_0x1c8962=_0x4e0d40['plugins']['get'](_0x342a1b);_0x11a75a&&(_0x11a75a['on']('execute',(_0x303315,[,_0x564080])=>{_0x564080['collaboration_features']={'comments':!0x0,'user_id':_0x1c8962['me']['id']};},{'priority':_0x18b202['high']+0xa}),this['listenTo'](_0x11a75a,'dataInsert',this['_handleImportedData']));}_handleImportedData(_0x380e8b,_0x3815d7){const {comment_threads:_0x5af2a8}=_0x3815d7;_0x5af2a8&&_0x5af2a8['forEach'](({thread_id:_0x233126,comments:_0x26c119,is_resolved:_0x29767b})=>{const _0x1fc150=new Date(),_0x1df652=_0x26c119['map'](({author:_0x3a98f3,content:_0x5e7825,created_at:_0x2373d9})=>({'content':_0x5e7825,'authorId':this['editor']['plugins']['get'](_0x342a1b)['me']['id'],'createdAt':_0x1fc150,'attributes':{'@external':{'authorName':_0x3a98f3,'createdAt':_0x2373d9?new Date(_0x2373d9):new Date(),'source':'importWord'}}})),_0x13a5ff=this['editor']['config']['get']('collaboration.channelId');this['editor']['plugins']['get'](fe)['addCommentThread']({'channelId':_0x13a5ff,'threadId':_0x233126,'comments':_0x1df652,'resolvedAt':_0x29767b?_0x1fc150:null});});}},Ce=class extends _0x1a85c9{constructor(_0x11fc5a){super(_0x11fc5a),this['editor']['config']['define']('comments.copyMarkers','default');}static get requires(){return[Tt,It];}afterInit(){const _0x349226=this['editor']['plugins']['get']('ClipboardPipeline');this['_registerMarkerInClipboardPipeline'](),this['listenTo'](_0x349226,'contentInsertion',(_0x148de5,_0x3ff3e3)=>this['_removeMarkersWithoutThreads'](_0x3ff3e3['content']['markers']),{'priority':'highest'});}_removeMarkersWithoutThreads(_0x533232){if(!this['editor']['plugins']['has']('CommentsRepository'))return _0x533232;const _0x5f889c=this['editor']['plugins']['get']('CommentsRepository');for(const _0x4cd0f9 of _0x533232['keys']()){const [_0x2c3a95,_0x368d0a]=_0x4cd0f9['split'](':');'comment'!=_0x2c3a95||_0x5f889c['hasCommentThread'](_0x368d0a)||_0x533232['delete'](_0x4cd0f9);}return _0x533232;}_registerMarkerInClipboardPipeline(){const _0x261a50=this['editor']['plugins']['get']('ClipboardMarkersUtils'),_0x3092c6=this['_mapCommentsCopyConfigToRegisterConfiguration'](this['editor']['config']['get']('comments.copyMarkers'));_0x3092c6&&_0x261a50['_registerMarkerToCopy']('comment',_0x3092c6);}_mapCommentsCopyConfigToRegisterConfiguration(_0x3993bf){switch(_0x3993bf){case'always':return{'allowedActions':'all','copyPartiallySelected':!0x1,'duplicateOnPaste':!0x0};case'default':return{'allowedActions':['cut','dragstart'],'copyPartiallySelected':!0x1,'duplicateOnPaste':!0x1};default:return null;}}};function Te(_0x18b8e9){const _0x4b749=_0x18b8e9['split'](':');return{'group':_0x4b749[0x0],'id':_0x4b749[0x1],'part':_0x4b749[0x2]};}var Ie=class extends _0x1a85c9{init(){this['overrideMarkerConverters'](),this['overrideHorizontalRuleConverter'](),this['overrideImageInlineConverter'](),this['overrideMediaEmbedConverter']();}overrideMarkerConverters(){this['editor']['conversion']['for']('dataDowncast')['markerToHighlight']({'model':'comment','view':(_0x3ed16e,_0x425231)=>{if(!_0x425231['options']['showCommentHighlights'])return null;if(_0x425231['options']['ignoreResolvedComments']){const {id:_0x5da1d5}=Te(_0x3ed16e['markerName']);if(this['editor']['plugins']['get'](fe)['getCommentThread'](_0x5da1d5)?.['isResolved']&&_0x3ed16e['item'])return _0x425231['consumable']['consume'](_0x3ed16e['item'],'addMarker:'+_0x3ed16e['markerName']),_0x425231['consumable']['consume'](_0x3ed16e['item'],'removeMarker:'+_0x3ed16e['markerName']),null;}return{'classes':['ck-comment-marker']};}}),this['editor']['conversion']['for']('dataDowncast')['add'](_0x143b60=>{_0x143b60['on']('addMarker:comment',(_0x96984d,_0x194832,_0x228359)=>{if(!_0x228359['options']['showCommentHighlights'])return;const _0x1c73bd=_0x194832['item'];if(!_0x1c73bd)return;const _0x3f492d=_0x228359['mapper']['toViewElement'](_0x1c73bd);this['editor']['model']['schema']['isObject'](_0x1c73bd)&&_0x3f492d&&!_0x3f492d['getCustomProperty']('widget')&&_0x3f492d['is']('containerElement')&&Rt(_0x3f492d,_0x228359['writer']);},{'priority':'high'});});}overrideHorizontalRuleConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToStructure']({'model':'horizontalLine','view':(_0x342434,{writer:_0x4112d1,options:_0x30bdf9})=>{if(!_0x30bdf9['showCommentHighlights'])return null;const _0x2fd777=_0x4112d1['createContainerElement']('div'),_0xdb2a0e=_0x4112d1['createEmptyElement']('hr');return _0x4112d1['addClass']('ck-horizontal-line',_0x2fd777),_0x4112d1['insert'](_0x4112d1['createPositionAt'](_0x2fd777,0x0),_0xdb2a0e),_0x2fd777;},'converterPriority':'high'});}overrideImageInlineConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToStructure']({'model':'imageInline','view':(_0xb2864c,{writer:_0x2263c8,options:_0xa731db})=>{if(!_0xa731db['showCommentHighlights'])return null;const _0x1929bd=_0x2263c8['createContainerElement']('span'),_0x216c5f=_0x2263c8['createEmptyElement']('img');return _0x2263c8['addClass']('image-inline',_0x1929bd),_0x2263c8['insert'](_0x2263c8['createPositionAt'](_0x1929bd,0x0),_0x216c5f),_0x1929bd;},'converterPriority':'high'});}overrideMediaEmbedConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToElement']({'model':'media','view':(_0x101176,{writer:_0x3fa736,options:_0x152d2d})=>{if(_0x152d2d['showCommentHighlights'])return _0x3fa736['createEmptyElement']('div');},'converterPriority':'high'}),this['editor']['data']['downcastDispatcher']['on']('attribute:url:media',(_0x38cc5e,_0xf33dcc,_0x55de74)=>{_0x55de74['options']['showCommentHighlights']&&_0x38cc5e['stop']();},{'priority':'high'});}},be=class extends _0x1a85c9{static get requires(){return[fe,Ae,_0x342a1b,ve,ye,Ce,Ie];}static get['pluginName'](){return'CommentsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5c9d28){super(_0x5c9d28),this['set']('isThreadsLoadingPaused',!0x0),_0x5c9d28['data']['once']('ready',()=>this['isThreadsLoadingPaused']=!0x1),this['set']('activeMarker',null),this['on']('change:activeMarker',(_0x429205,_0x577503,_0x950257,_0x22e09e)=>{const _0x16ad49=_0x5c9d28['plugins']['get'](fe),_0x26a6d1=_0x950257?Te(_0x950257)['id']:null;_0x5c9d28['model']['change'](()=>{if(_0x26a6d1){const _0x5a017c=this['getAllMarkersForId'](_0x26a6d1);for(const _0x4b76e1 of _0x5a017c)_0x5c9d28['editing']['reconvertMarker'](_0x4b76e1);}if(_0x22e09e){const {id:_0x50fed8}=Te(_0x22e09e),_0xdd64f6=_0x16ad49['getCommentThread'](_0x50fed8);if(_0xdd64f6&&_0xdd64f6['unlinkedAt'])return;if(_0xdd64f6&&!_0xdd64f6['isAttached'])return;const _0x42de8a=this['getAllMarkersForId'](_0x50fed8);for(const _0x292d2f of _0x42de8a)_0x5c9d28['editing']['reconvertMarker'](_0x292d2f);}}),_0x26a6d1&&this['scrollToThreadMarker'](_0x26a6d1);}),this['_initAriaMarkerChangeAnnouncements']();}init(){const _0x1d5a79=this['editor'],_0x283e3a=_0x1d5a79['plugins']['get'](fe),_0x161eef=_0x1d5a79['config']['get']('collaboration.channelId'),_0xe23d59=_0x283e3a['getCommentThreads']()['filter'](_0x14125c=>_0x14125c['channelId']!==_0x161eef);_0x1d5a79['commands']['add']('addCommentThread',new _e(_0x1d5a79)),this['listenTo'](_0x1d5a79,'change:isReadOnly',(_0x1ef6b3,_0x22eb5e,_0x28308f)=>{_0x283e3a['switchReadOnly'](_0x28308f,_0x1d5a79['config']['get']('collaboration.channelId'));}),this['listenTo'](_0x283e3a,Ee('addCommentThread',_0x161eef),(_0x9bc2b9,{threadId:_0x18a9cb})=>{this['editor']['plugins']['get'](fe)['getCommentThread'](_0x18a9cb)?.['unlinkedAt']&&this['_attachArchivedThread'](_0x18a9cb);}),this['listenTo'](_0x283e3a,Ee('removeCommentThread',_0x161eef),(_0x90736a,{threadId:_0x4667ab})=>{_0x1d5a79['model']['enqueueChange']({'isUndoable':!0x1},_0x3715bb=>{const _0x133e70=this['getAllMarkersForId'](_0x4667ab);for(const _0x5853e2 of _0x133e70)_0x3715bb['removeMarker'](_0x5853e2);});}),this['listenTo'](_0x283e3a,Ee('resolveCommentThread',_0x161eef),(_0x2bf283,{threadId:_0x1632c5})=>{this['_reconvertMarkers'](_0x1632c5);const _0x5e9f5a=this['editor']['plugins']['get'](ce);(this['editor']['editing']['view']['hasDomSelection']||_0x5e9f5a['collection']['isFocused'])&&(this['editor']['plugins']['get'](fe)['getCommentThread'](_0x1632c5)['unlinkedAt']||this['editor']['editing']['view']['focus']());},{'priority':'low'}),this['listenTo'](_0x283e3a,Ee('reopenCommentThread',_0x161eef),(_0x2b083f,{threadId:_0x2f3603})=>{this['_reconvertMarkers'](_0x2f3603);},{'priority':'low'}),this['listenTo'](_0x283e3a,Ee('addComment',_0x161eef),(_0x3e7af2,{threadId:_0x25cf04,isFromAdapter:_0x126fa9})=>{const _0x41ea7a=this['getAllMarkersForId'](_0x25cf04);!_0x126fa9&&0x0!=_0x41ea7a['length']&&_0x283e3a['hasCommentThread'](_0x25cf04)&&0x1===_0x283e3a['getCommentThread'](_0x25cf04)['length']&&_0x1d5a79['model']['enqueueChange']({'isUndoable':!0x1},_0x39c931=>{for(const _0xba7d25 of _0x41ea7a)_0x39c931['updateMarker'](_0xba7d25,{'usingOperation':!0x0,'affectsData':!0x0});});},{'priority':'low'}),this['_initializeMarkerConverters'](),this['_handleMarkerAddAndRemove'](),this['_handleInitialThreads'](_0xe23d59);}afterInit(){!async function(_0x339b66){const _0x4700c3='mr4z2yakM3x0phtD7jBw1T6qRfeUuZcOLNKVgQSPE9iGIHoXlJW8YsCb5AndFv',_0x4d81f7=0x797d0,_0x44080a={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x37bf89(_0x1283e4){const _0x4305b0=new window['Promise'](_0x593ed9=>{_0x1283e4['once']('ready',_0x593ed9);}),_0xd6affe=window['Date']['now'](),_0x36a170=_0x1283e4['config']['get']('licenseKey');async function _0x1b0d5c(){let _0x5d84e7,_0x37c40f=null,_0x13c0e2=null;try{return'GPL'==_0x36a170?'NotAllowed':(_0x5d84e7=_0xc5039f(),_0x5d84e7?(_0x5d84e7['usageEndpoint']&&(_0x13c0e2=_0x54d751(_0x5d84e7['usageEndpoint'],_0x5d84e7['jti'])),await _0x3b1693()?_0x5989ed()?_0xc043ea()?'Expired':_0x2827a7()?('evaluation'==_0x5d84e7['licenseType']&&(_0x37c40f=_0x282f10('EvaluationLimit')),await _0x5970f9()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0xc043ea(){const _0x5e2a3f=['evaluation','trial']['includes'](_0x5d84e7['licenseType'])?_0xd6affe/0x3e8:0xe10*_0x4d81f7;return _0x5d84e7['exp']<_0x5e2a3f;}function _0x5989ed(){const _0x41efd8=_0x5d84e7['features'];if(!_0x41efd8)return!0x1;if(_0x41efd8['includes']('*'))return!0x0;if(_0x41efd8['includes']('CMT'))return!0x0;if(_0x41efd8['includes']('TRILIUM')&&_0x3b0dd4())return!0x0;if(_0x41efd8['includes']('RCMT')){if(_0x4b45ff())return!0x0;if(_0x44885e()||_0x129b3a())return!0x0;}return!0x1;}function _0x2827a7(){const _0xec76de=_0x5d84e7['licensedHosts'];if(!_0xec76de||0x0==_0xec76de['length'])return!0x0;const {hostname:_0x4b6613}=new URL(window['location']['href']);if(_0xec76de['includes'](_0x4b6613))return!0x0;const _0x1f0ab0=_0x4b6613['split']('.');return _0xec76de['filter'](_0xe742e7=>_0xe742e7['includes']('*'))['map'](_0x444e71=>_0x444e71['split']('.'))['filter'](_0xd5b61d=>_0xd5b61d['length']<=_0x1f0ab0['length'])['map'](_0x487edc=>Array(_0x1f0ab0['length']-_0x487edc['length'])['fill']('*'===_0x487edc[0x0]?'*':'')['concat'](_0x487edc))['some'](_0x5b7ba8=>_0x1f0ab0['every']((_0x36484c,_0x2231c2)=>_0x5b7ba8[_0x2231c2]===_0x36484c||'*'===_0x5b7ba8[_0x2231c2]));}function _0x5970f9(){return _0x37c40f&&_0x13c0e2?new window['Promise']((_0x28954d,_0x331816)=>{_0x37c40f['then'](_0x28954d,_0x331816),_0x13c0e2['then'](_0x205ee7=>{'Valid'!=_0x205ee7&&_0x28954d(_0x205ee7);},_0x331816);}):_0x37c40f||_0x13c0e2||'Valid';}}function _0x54d751(_0x2955e2,_0x301549){return new window['Promise'](_0x5db853=>{if(_0x4845fd())return _0x5db853('Valid');_0x3a9406(),_0x1283e4['decorate']('_sendUsageRequest');let _0x566007=!0x1;const _0x2c90cb=_0x4b3e41();function _0x13270c(_0x404ee4){return!!_0x404ee4&&('object'==typeof _0x404ee4||'function'==typeof _0x404ee4)&&'function'==typeof _0x404ee4['then']&&'function'==typeof _0x404ee4['catch'];}function _0x5780cd(_0x5b9ae7){_0x29b127(_0x5b9ae7)['then'](_0x2ce026=>_0x2ce026&&'ok'==_0x2ce026['status']?_0x300455(_0x1d9e6a(_0x2c90cb+_0x301549))!=_0x2ce026['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x4b182e=>(_0x3b878c(),_0x4b182e),()=>{const _0x26a96b=_0x12762b();return null==_0x26a96b?(_0x3b878c(),'Valid'):_0xd6affe-_0x26a96b>0x240c8400?'UsageLimit':'Valid';})['then'](_0x5db853)['catch'](()=>{_0x5db853('UsageLimit');});const _0x558fa3=0x36ee80;function _0x3b878c(){const _0x14c609='llct-'+_0x300455(_0x1d9e6a(_0x2955e2)),_0x138ec2=_0x2bafe9(_0x300455(window['Math']['ceil'](_0xd6affe/_0x558fa3)));window['localStorage']['setItem'](_0x14c609,_0x138ec2);}function _0x12762b(){const _0xdea8c6='llct-'+_0x300455(_0x1d9e6a(_0x2955e2)),_0x355591=window['localStorage']['getItem'](_0xdea8c6);return _0x355591?window['parseInt'](_0x2bafe9(_0x355591),0x10)*_0x558fa3:null;}function _0x29b127(_0x1ff45d){return new window['Promise']((_0x28048d,_0x21f82d)=>{_0x1ff45d['then'](_0x28048d,_0x21f82d),window['setTimeout'](_0x21f82d,0x1d4c0);});}}_0x1283e4['on']('_sendUsageRequest',(_0x4bb40a,_0x55688c)=>{if(_0x55688c[0x0]!=_0x2955e2)return _0x5db853('UsageLimit');_0x55688c[0x1]={..._0x55688c[0x1],'requestId':_0x2c90cb};},{'priority':'high'}),_0x1283e4['on']('_sendUsageRequest',_0x2cf377=>{_0x13270c(_0x2cf377['return'])&&(_0x566007=!0x0,_0x5780cd(_0x2cf377['return']));},{'priority':'low'}),_0x4305b0['then'](()=>{_0x566007||_0x5db853('UsageLimit');});});function _0x4845fd(){return'auto'==_0x1283e4['editing']['view']['_overlayModeHint'];}function _0x3a9406(){_0x1283e4['editing']['view']['_overlayModeHint']='auto';}}function _0x282f10(_0x1c0877){const _0x2989cf=[new window['Promise'](_0x53e721=>setTimeout(_0x53e721,0x93ecc)),_0x4305b0['then'](()=>new window['Promise'](_0x155044=>{let _0x1a8858=0x0;_0x1283e4['model']['on']('applyOperation',(_0x3005d0,_0x4c62e4)=>{_0x4c62e4[0x0]['isDocumentOperation']&&_0x1a8858++,0x5e8==_0x1a8858&&(_0x155044(),_0x3005d0['off']());});}))];return window['Promise']['race'](_0x2989cf)['then'](()=>_0x1c0877);}async function _0x561220(){await _0x4305b0,_0x1283e4['model']['change']=_0x2db5d8,_0x1283e4['model']['enqueueChange']=_0x2db5d8,_0x1283e4['enableReadOnlyMode']('model');}function _0x3b0dd4(){return window['glob']&&window['glob']['triliumVersion'];}function _0x4b45ff(){return _0x2bf169('WebSocketGateway')&&'connected'==_0x4de6c8('WebSocketGateway')['state'];}function _0x44885e(){return _0x2bf169('RevisionViewerIntegration');}function _0x129b3a(){return _0x2bf169('TrackChangesDataGetter');}function _0x154cea(_0x2c11c5){const _0x31f069=_0x162bc7();_0x1283e4[_0x31f069]='commentsLicenseKey'+_0x2c11c5,'Valid'!=_0x2c11c5&&_0x561220();}function _0x162bc7(){const _0x33d1ac=window['String'](window['performance']['now']())['replace']('.','');let _0xcd1fb4='m';for(let _0x2f2678=0x0;_0x2f2678<_0x33d1ac['length'];_0x2f2678+=0x2){let _0x145d18=window['parseInt'](_0x33d1ac['substring'](_0x2f2678,_0x2f2678+0x2));_0x145d18>=0x3e&&(_0x145d18-=0x3e),_0xcd1fb4+=_0x4700c3[_0x145d18];}return _0xcd1fb4;}function _0xc5039f(){const _0x10789e=_0x36a170['split']('.');if(0x3!=_0x10789e['length'])return null;return _0x2df1f6(_0x10789e[0x1]);function _0x2df1f6(_0x4c727d){const _0xa6a68f=_0x1591ea(_0x4c727d);return _0xa6a68f&&_0x2cbf06()?_0xa6a68f:null;function _0x2cbf06(){const _0x4df0d3=_0xa6a68f['jti'],_0x1b0071=window['parseInt'](_0x4df0d3['substring'](_0x4df0d3['length']-0x8),0x10),_0x4e1130={..._0xa6a68f,'jti':_0x4df0d3['substring'](0x0,_0x4df0d3['length']-0x8)};return delete _0x4e1130['vc'],_0x1d9e6a(_0x4e1130)==_0x1b0071;}}}async function _0x3b1693(){let _0xbfd33d=!0x0;try{const [_0x69db0,_0x3200d7,_0x562a6b]=_0x36a170['split']('.');return _0x12f510(_0x69db0),await _0xad3c20(_0x69db0,_0x3200d7,_0x562a6b),_0xbfd33d;}catch{return!0x1;}function _0x12f510(_0x211fc9){const _0x37f0b0=_0x1591ea(_0x211fc9);_0x37f0b0&&'ES256'==_0x37f0b0['alg']||(_0xbfd33d=!0x1);}async function _0xad3c20(_0x34dcab,_0x25e8b2,_0x37d97d){const _0x566688=window['Uint8Array']['from'](_0x464bdb(_0x37d97d),_0x5347d2=>_0x5347d2['charCodeAt'](0x0)),_0x51cbb2=new window['TextEncoder']()['encode'](_0x34dcab+'.'+_0x25e8b2),_0x2205fb=window['crypto']['subtle'];if(!_0x2205fb)return;const _0x123ba5=await _0x2205fb['importKey']('jwk',_0x44080a,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x2205fb['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x123ba5,_0x566688,_0x51cbb2)||(_0xbfd33d=!0x1);}}function _0x1591ea(_0x5f673b){return _0x5f673b['startsWith']('ey')?JSON['parse'](_0x464bdb(_0x5f673b)):null;}function _0x464bdb(_0x5065d3){return window['atob'](_0x5065d3['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x1d9e6a(_0x10439b){let _0x44dddb=0x1505;function _0x46819d(_0x4e7a0d){for(let _0x28d414=0x0;_0x28d414<_0x4e7a0d['length'];_0x28d414++){const _0x3fb4b6=_0x4e7a0d['charCodeAt'](_0x28d414);_0x44dddb=(_0x44dddb<<0x5)+_0x44dddb+_0x3fb4b6,_0x44dddb&=_0x44dddb;}}function _0x4dacb4(_0x26e02d){Array['isArray'](_0x26e02d)?_0x26e02d['forEach'](_0x4dacb4):_0x26e02d&&'object'==typeof _0x26e02d?Object['entries'](_0x26e02d)['sort']()['forEach'](([_0x183f35,_0x534756])=>{_0x46819d(_0x183f35),_0x4dacb4(_0x534756);}):_0x46819d(window['String'](_0x26e02d));}return _0x4dacb4(_0x10439b),_0x44dddb>>>0x0;}function _0x300455(_0x84eeb4){return _0x84eeb4['toString'](0x10)['padStart'](0x8,'0');}function _0x2bafe9(_0x1d5402){return _0x1d5402['split']('')['reverse']()['join']('');}function _0x2bf169(_0x4b86b2){return _0x1283e4['plugins']['has'](_0x4b86b2);}function _0x4de6c8(_0x5e908c){return _0x1283e4['plugins']['get'](_0x5e908c);}function _0x2db5d8(){}_0x154cea(await _0x1b0d5c());}_0x37bf89(_0x339b66['editor']);}(this);}destroy(){const _0x38df5a=this['editor']['plugins']['get'](fe),_0x160631=this['editor']['config']['get']('collaboration.channelId');for(const _0x1cff89 of _0x38df5a['getCommentThreads']({'channelId':_0x160631}))_0x38df5a['_detachCommentThread'](_0x1cff89['id']),_0x38df5a['_threads']['delete'](_0x1cff89['id']);super['destroy']();}['hasMarkerForId'](_0xbf032a){return this['getAllMarkersForId'](_0xbf032a)['length']>0x0;}getAllMarkersForId(_0x3f539d){const _0x1c04f0=[];for(const _0x53eb1b of this['editor']['model']['markers'])_0x53eb1b['name']['startsWith']('comment:'+_0x3f539d)&&_0x1c04f0['push'](_0x53eb1b);return _0x1c04f0;}['scrollToThreadMarker'](_0x1c7a68){setTimeout(()=>{const _0x4b29e0=this['_getTargetForId'](_0x1c7a68);_0x4b29e0&&this['activeMarker']&&Te(this['activeMarker'])['id']===_0x1c7a68&&_0x1bbfa6({'target':_0x4b29e0[0x0],'viewportOffset':0x64,'alignToTop':!0x0});},0x32);}_reconvertMarkers(_0x1ebf8b){this['editor']['model']['change'](()=>{for(const _0x303f0b of this['getAllMarkersForId'](_0x1ebf8b))this['editor']['editing']['reconvertMarker'](_0x303f0b);});}_attachArchivedThread(_0x52ea50){const _0x62c902=this['editor']['plugins']['get'](fe),_0x680cbd=this['editor']['plugins']['get'](Ae),_0x42430d=_0x62c902['getCommentThread'](_0x52ea50);if(!_0x42430d['isAttached']){const _0x5696db=_0x42430d['attachTo'](()=>this['_getTargetForId'](_0x42430d['id']));_0x680cbd['registerAnnotation'](_0x5696db),_0x42430d['_hasTargetInContent']=!0x1;}}_initializeMarkerConverters(){const _0x2c39f5=this['editor'],_0xe41401=_0x2c39f5['plugins']['get'](_0x342a1b);_0x2c39f5['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'comment','view':(_0x553b2b,_0x174785)=>{const {id:_0x3f3d76}=Te(_0x553b2b['markerName']),_0x40a7ef=_0x2c39f5['plugins']['get'](fe)['getCommentThread'](_0x3f3d76),_0x595cb1=this['activeMarker']&&Te(this['activeMarker'])['id']===_0x3f3d76;let _0x1b6071;if(_0x40a7ef&&_0x40a7ef['isResolved']&&!_0x595cb1&&_0x553b2b['item'])return _0x174785['consumable']['consume'](_0x553b2b['item'],'addMarker:'+_0x553b2b['markerName']),_0x174785['consumable']['consume'](_0x553b2b['item'],'removeMarker:'+_0x553b2b['markerName']),null;const _0x16472b=['ck-comment-marker'];return _0x595cb1&&_0x16472b['push']('ck-comment-marker--active'),_0x1b6071=_0x40a7ef?.['length']?_0x40a7ef['comments']['first']['author']['id']:_0xe41401['me']['id'],{'classes':_0x16472b,'attributes':{'data-comment':_0x3f3d76,'data-author-id':_0x1b6071}};}}),_0x2c39f5['conversion']['for']('dataDowncast')['markerToData']({'model':'comment','view':(_0x39771d,{options:_0xfe02a1})=>{if(_0xfe02a1['showCommentHighlights'])return null;const _0x334e74=_0x2c39f5['plugins']['get'](fe),_0xdb292b=_0x2c39f5['model']['markers']['get'](_0x39771d),{id:_0x120968,part:_0x74dd79}=Te(_0x39771d);return _0xdb292b&&!_0xdb292b['affectsData']||_0xfe02a1['ignoreResolvedComments']&&_0x334e74['getCommentThread'](_0x120968)?.['isResolved']?null:{'group':'comment','name':_0x74dd79?_0x120968+':'+_0x74dd79:_0x120968};}}),_0x2c39f5['conversion']['for']('upcast')['elementToElement']({'view':{'name':'comment','attributes':{'id':/^\w/}},'model':(_0x2f6f15,{writer:_0x30b353})=>_0x30b353['createElement']('$marker',{'data-name':'comment:'+_0x2f6f15['getAttribute']('id')})}),_0x2c39f5['conversion']['for']('upcast')['dataToMarker']({'view':'comment'});}['_handleMarkerAddAndRemove'](){const _0x57019b=this['editor'],_0x362e5c=_0x57019b['plugins']['get'](fe),_0x116c0d=new Set(),_0x194c2f=new Set();_0x57019b['model']['document']['registerPostFixer'](_0x41c8cf=>{let _0x25bc8a=!0x1;for(const {name:_0x4b2aa6,data:_0x3e94a7}of _0x57019b['model']['document']['differ']['getChangedMarkers']()){const {group:_0x57eb57,id:_0x6eb1c2}=Te(_0x4b2aa6);let _0x318c13=_0x3e94a7['newRange'];if('comment'!==_0x57eb57||!_0x318c13)continue;const _0x2a5b2c='$graveyard'===_0x318c13['root']['rootName'];_0x2a5b2c||(_0x318c13=ke(_0x318c13,_0x57019b['model']),!_0x318c13||_0x318c13['isCollapsed']||!_0x3e94a7['newRange']||_0x318c13['isEqual'](_0x3e94a7['newRange']))?_0x57019b['model']['hasContent'](_0x318c13)&&!_0x2a5b2c?this['isThreadsLoadingPaused']?_0x116c0d['add'](_0x4b2aa6):this['_handleThreadMarker'](_0x4b2aa6,_0x6eb1c2):(_0x194c2f['add'](_0x4b2aa6),_0x116c0d['delete'](_0x4b2aa6),_0x41c8cf['removeMarker'](_0x4b2aa6),_0x25bc8a=!0x0):(_0x41c8cf['updateMarker'](_0x4b2aa6,{'range':_0x318c13}),_0x25bc8a=!0x0);}return _0x25bc8a;}),this['on']('change:isThreadsLoadingPaused',(_0x464738,_0x4812a5,_0x3a3854)=>{if(!_0x3a3854&&_0x116c0d['size'])for(const _0x536723 of _0x116c0d){const {id:_0x455597}=Te(_0x536723);_0x116c0d['delete'](_0x536723),_0x57019b['model']['markers']['get'](_0x536723)&&this['_handleThreadMarker'](_0x536723,_0x455597);}}),this['listenTo'](_0x57019b['model']['document'],'change',()=>{for(const {name:_0x262ff0,data:{newRange:_0x28b50e}}of _0x57019b['model']['document']['differ']['getChangedMarkers']()){const {group:_0x26fe80,id:_0x272f9b}=Te(_0x262ff0);if('comment'!==_0x26fe80)continue;const _0x1f83d9=_0x362e5c['getCommentThread'](_0x272f9b),_0x5a24ae=this['hasMarkerForId'](_0x272f9b);_0x1f83d9&&(!_0x1f83d9['_hasTargetInContent']&&_0x28b50e&&_0x57019b['editing']['view']['once']('render',()=>{const _0x41dda2=_0x57019b['plugins']['get'](ce),_0x45056f=_0x362e5c['_threadToController']['get'](_0x1f83d9)['view'];_0x41dda2['getByInnerView'](_0x45056f)['refreshVisibility']();},{'priority':'low'}),_0x1f83d9['_hasTargetInContent']=_0x5a24ae||!!_0x28b50e),_0x28b50e||(_0x194c2f['add'](_0x262ff0),_0x116c0d['delete'](_0x262ff0));}for(const _0x5310d4 of _0x194c2f){const {id:_0x334940}=Te(_0x5310d4),_0x40628d=_0x362e5c['getCommentThread'](_0x334940);if(_0x116c0d['delete'](_0x5310d4),!_0x40628d)continue;const _0x280ab5=this['hasMarkerForId'](_0x334940);_0x280ab5||_0x40628d['isSubmitted']?_0x280ab5||_0x40628d['unlinkedAt']||_0x40628d['setUnlinkedAt'](new Date()):_0x40628d['remove']();}_0x194c2f['clear']();});}_handleInitialThreads(_0x369c69){_0x369c69['forEach'](_0x500c2d=>{_0x500c2d['unlinkedAt']&&this['_attachArchivedThread'](_0x500c2d['id']);});}_getTargetForId(_0x14f002){const _0x169858=this['editor'],_0x298655=this['getAllMarkersForId'](_0x14f002);return _0x1111f5(_0x169858['editing'],_0x298655);}_getTextContext(_0x31d23e){const _0x46b2b0=this['getAllMarkersForId'](_0x31d23e);let _0xc151f='',_0x1f0c66=!0x1;for(const _0x1a7df3 of _0x46b2b0){const _0x55e94a=_0x1a7df3['getRange']();for(const _0x4faeb3 of Array['from'](_0x55e94a['getItems']()))_0x4faeb3['is']('$textProxy')?(_0xc151f&&_0x1f0c66&&(_0xc151f+='\x20',_0x1f0c66=!0x1),_0xc151f+=_0x4faeb3['data']):_0x1f0c66=!0x0;_0x1f0c66=!0x0;}return _0xc151f['substring'](0x0,0x96);}_attachMarkerToThread(_0x4eef28,_0x3c1405){const _0x30ce43=this['editor'],_0x5ced78=_0x30ce43['plugins']['get'](fe);let _0x3be93b=_0x5ced78['getCommentThread'](_0x3c1405);const _0x59ae77=_0x30ce43['config']['get']('collaboration.channelId'),_0x520e3f=_0x30ce43['plugins']['get'](Ae);return _0x3be93b&&(_0x3be93b['unlinkedAt']&&_0x3be93b['setUnlinkedAt'](null),_0x3be93b['isAttached'])||(this['getAllMarkersForId'](_0x3c1405)[0x0]['managedUsingOperations']?_0x5ced78['fetchCommentThread']({'channelId':_0x59ae77,'threadId':_0x3c1405})['then'](_0x18158f=>{if('destroyed'!==_0x30ce43['state']){if(_0x3be93b=_0x18158f,_0x3be93b&&!_0x3be93b['isAttached']){const _0x30707a=_0x3be93b['attachTo'](()=>this['_getTargetForId'](_0x3c1405));_0x520e3f['registerAnnotation'](_0x30707a),_0x3be93b['isResolved']&&this['_reconvertMarkers'](_0x3c1405);}else{if(!_0x3be93b){const _0x5a63c3=this['getAllMarkersForId'](_0x3c1405);_0x30ce43['model']['change'](_0x181742=>{for(const _0x3082cb of _0x5a63c3)_0x181742['removeMarker'](_0x3082cb);});}}}}):_0x30ce43['editing']['view']['once']('render',()=>{if(_0x5ced78['getCommentThread'](_0x3c1405))return;const _0x25eb9c=_0x30ce43['plugins']['get'](ce);_0x3be93b=_0x5ced78['openNewCommentThread']({'channelId':_0x59ae77,'threadId':_0x3c1405,'target':()=>this['_getTargetForId'](_0x3c1405),'context':{'type':'text','value':this['_getTextContext'](_0x3c1405)}});const _0x559394=_0x5ced78['_threadToController']['get'](_0x3be93b)['view'],_0x4f273c=_0x25eb9c['getByInnerView'](_0x559394);_0x4f273c&&_0x520e3f['registerAnnotation'](_0x4f273c);},{'priority':'low'})),_0x3be93b;}['_handleThreadMarker'](_0x384601,_0x3703d7){const _0x482529=this['_attachMarkerToThread'](_0x384601,_0x3703d7);_0x482529&&!_0x482529['context']&&_0x482529['setContext']({'type':'text','value':this['_getTextContext'](_0x3703d7)});}_initAriaMarkerChangeAnnouncements(){const _0x4d6bf3=this['editor'];_0x5dcaf6(_0x4d6bf3['model'],({left:_0x5d419d,entered:_0x47fce0})=>{for(const _0x5818aa of _0x5d419d)if(Ne(_0x5818aa)){_0x4d6bf3['ui']['ariaLiveAnnouncer']['announce'](Pt(_0x4d6bf3['locale'],'LEAVE_COMMENT_ANNOUNCEMENT'));break;}for(const _0x536992 of _0x47fce0)if(Ne(_0x536992)){_0x4d6bf3['ui']['ariaLiveAnnouncer']['announce'](Pt(_0x4d6bf3['locale'],'ENTER_COMMENT_ANNOUNCEMENT',_0x5880ba(_0x5a256f)));break;}});}};function Ee(_0x164839,_0xc91816){return _0xc91816?_0x164839+':'+_0xc91816:_0x164839;}function ke(_0x28a8ea,_0x151a49){const _0x30b77c=_0x151a49['schema'],_0x1b275e=_0x151a49['createRange'](_0x28a8ea['start']);for(const _0x57fac2 of _0x28a8ea['getWalker']()){const {type:_0x172673,item:_0x359288,nextPosition:_0x2b9115}=_0x57fac2;if('text'===_0x172673||_0x30b77c['isObject'](_0x359288)){const _0x31790=_0x151a49['createPositionBefore'](_0x359288);_0x1b275e['isCollapsed']&&(_0x1b275e['start']=_0x31790),_0x1b275e['end']=_0x2b9115;}}return _0x1b275e;}function Ne(_0x585e1e){return'comment'===Te(_0x585e1e['name'])['group'];}var Oe=class extends _0x1a85c9{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'CommentsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[fe,be,Ae,ce];}get CommentsListView(){return Kt;}get CommentThreadInputView(){return Ft;}init(){const _0x5edafc=this['editor'],_0x2efeb7=_0x5edafc['plugins']['get'](fe),_0x394d5f=_0x5edafc['plugins']['get'](be),_0x448d4b=_0x5edafc['plugins']['get'](ce),_0x2e6602=_0x5edafc['plugins']['get'](Ae);_0x5edafc['ui']['componentFactory']['add']('comment',()=>{const _0xca0b18=this['_createUIButton'](it);return _0xca0b18['tooltip']=!0x0,_0xca0b18;}),_0x5edafc['ui']['componentFactory']['add']('menuBar:comment',()=>this['_createUIButton'](mt)),_0x2e6602['addSourceCollector'](()=>{const _0x401a5a=[];for(const [_0x42a062,_0x3536de]of _0x2efeb7['_threadToController']){const _0x2a8cee=_0x394d5f['getAllMarkersForId'](_0x42a062['id']),_0x5e4db1=_0x2a8cee['map'](_0x4c220e=>_0x4c220e['getRange']());_0x2a8cee['length']>0x0&&_0x401a5a['push']([_0x3536de['view'],_0x5e4db1]);}return _0x401a5a;}),this['listenTo'](_0x448d4b,'change:activeAnnotations',(_0x2bd4ea,_0x2497f0,_0x4ea723)=>{const _0x3cfc78=Array['from'](_0x4ea723)['map'](_0x49a34c=>_0x49a34c['innerView'])['find'](_0x2b4337=>_0x2efeb7['_viewToController']['has'](_0x2b4337));if(!_0x3cfc78)return void(_0x394d5f['activeMarker']=null);const _0x16f3cf=_0x2efeb7['_viewToController']['get'](_0x3cfc78)['model']['id'],_0x3890e1='comment:'+_0x16f3cf;_0x16f3cf&&_0x394d5f['hasMarkerForId'](_0x16f3cf)?_0x394d5f['activeMarker']=_0x3890e1:_0x394d5f['activeMarker']&&(_0x394d5f['activeMarker']=null);}),this['listenTo'](_0x2efeb7,'removeCommentThread',(_0x254e28,{threadId:_0x5636fd,isFromAdapter:_0x267465})=>{!_0x267465&&_0x5edafc['ui']['focusTracker']['isFocused']&&_0x394d5f['hasMarkerForId'](_0x5636fd)&&_0x5edafc['editing']['view']['focus']();},{'priority':'highest'}),this['listenTo'](_0x2efeb7,'addComment',(_0x218f8a,{threadId:_0x5bb232,isFromAdapter:_0x380005})=>{!_0x380005&&_0x394d5f['hasMarkerForId'](_0x5bb232)&&_0x2efeb7['hasCommentThread'](_0x5bb232)&&0x1===_0x2efeb7['getCommentThread'](_0x5bb232)['length']&&(_0x5edafc['editing']['view']['focus'](),_0x218f8a['stop']());},{'priority':'low'}),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x3f9adf=[this['editor']];for(const _0x47c3ad of _0x3f9adf){let _0x1a192c;for(const _0x5bf60f in _0x47c3ad){const _0x439a9b=_0x5bf60f,_0x31efd3=_0x47c3ad[_0x439a9b];if('commentsLicenseKeyValid'==_0x31efd3||'commentsLicenseKeyInvalid'==_0x31efd3||'commentsLicenseKeyExpired'==_0x31efd3||'commentsLicenseKeyDomainLimit'==_0x31efd3||'commentsLicenseKeyNotAllowed'==_0x31efd3||'commentsLicenseKeyEvaluationLimit'==_0x31efd3||'commentsLicenseKeyUsageLimit'==_0x31efd3){delete _0x47c3ad[_0x439a9b],_0x1a192c=_0x31efd3,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'commentsLicenseKeyInvalid'==_0x1a192c&&_0x47c3ad['_showLicenseError']('invalid'),'commentsLicenseKeyExpired'==_0x1a192c&&_0x47c3ad['_showLicenseError']('expired'),'commentsLicenseKeyDomainLimit'==_0x1a192c&&_0x47c3ad['_showLicenseError']('domainLimit'),'commentsLicenseKeyNotAllowed'==_0x1a192c&&_0x47c3ad['_showLicenseError']('featureNotAllowed','Comments'),'commentsLicenseKeyEvaluationLimit'==_0x1a192c&&_0x47c3ad['_showLicenseError']('evaluationLimit'),'commentsLicenseKeyUsageLimit'==_0x1a192c&&_0x47c3ad['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_createUIButton(_0x27ea6c){const _0x2e20a5=this['editor'],_0x3bc746=new _0x27ea6c(_0x2e20a5['locale']),_0x5cb6ff=_0x2e20a5['commands']['get']('addCommentThread');return _0x3bc746['set']({'label':Pt(_0x2e20a5['locale'],'Comment'),'icon':_0x8aed27}),_0x3bc746['bind']('isEnabled')['to'](_0x5cb6ff,'isEnabled',_0x5cb6ff,'hasContent',(_0x334d1f,_0x46ce7e)=>_0x334d1f&&_0x46ce7e),this['listenTo'](_0x3bc746,'execute',()=>{_0x5cb6ff['execute']();}),_0x3bc746;}},Me=class extends _0x1a85c9{static get['pluginName'](){return'CommentsOnly';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[be];}constructor(_0x2d78cf){super(_0x2d78cf),this['set']('isEnabled',!0x1),this['on']('change:isEnabled',(_0x1af37c,_0x3800f9,_0xa0fd7a)=>{_0xa0fd7a?this['_enableCommentsOnlyMode']():this['_disableCommentsOnlyMode']();});}afterInit(){!this['isEnabled']&&this['editor']['config']['get']('commentsOnly')&&(this['isEnabled']=!0x0);}_enableCommentsOnlyMode(){for(const [_0xbf9315,_0x478b79]of this['editor']['commands'])_0x478b79['affectsData']&&'addCommentThread'!==_0xbf9315&&_0x478b79['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 _0x53e4c8=this['editor']['editing']['view']['document'];this['listenTo'](_0x53e4c8,'cut',_0x328a52=>_0x328a52['stop'](),{'priority':'highest'}),this['listenTo'](_0x53e4c8,'clipboardInput',_0x5340cc=>_0x5340cc['stop'](),{'priority':'highest'}),this['listenTo'](_0x53e4c8,'delete',_0x5f68ec=>_0x5f68ec['stop'](),{'priority':'highest'});}_disableCommentsOnlyMode(){for(const [_0x52dce,_0x2a1643]of this['editor']['commands'])_0x2a1643['affectsData']&&'addCommentThread'!==_0x52dce&&_0x2a1643['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']);}},Re=class extends _0x16df46{activeUIs;uisData;['_uis'];static get requires(){return[ce];}static get['pluginName'](){return'AnnotationsUIs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2556a1){super(_0x2556a1),this['activeUIs']=new Set(),this['_uis']=new Map(),this['uisData']=new Map();}init(){const _0x108524=this['context']['plugins']['get'](ce);this['listenTo'](_0x108524,'_activateAnnotation',(_0x6f7bdb,_0x2f3ebf)=>{for(const _0x13a0e3 of this['activeUIs']){const _0x58a7e5=this['_uis']['get'](_0x13a0e3);(0x0,this['uisData']['get'](_0x13a0e3)['filter'])(_0x2f3ebf)&&_0x58a7e5['setActiveAnnotation'](_0x2f3ebf);}}),this['listenTo'](_0x108524,'_deactivateAllAnnotations',()=>{for(const _0x20ca71 of this['activeUIs'])this['_uis']['get'](_0x20ca71)['setActiveAnnotation'](null);}),this['listenTo'](_0x108524['_visibleAnnotations'],'add',(_0x3b8a03,_0x3ccf98)=>{this['_assertAnnotationDoesNotBelongToMultipleUIs'](_0x3ccf98);});}hasActive(){return this['activeUIs']['size']>0x0;}isActive(_0x40f7fc){return this['activeUIs']['has'](_0x40f7fc);}activate(_0x2704f2,_0x80195a=this['defaultFilter']){const _0xfdfdc1=this['context']['plugins']['get'](ce);if(!this['_uis']['has'](_0x2704f2))throw new _0x465b2f('annotationsuis-missing-ui',this,{'uiName':_0x2704f2});this['isActive'](_0x2704f2)&&this['deactivate'](_0x2704f2),this['activeUIs']['add'](_0x2704f2);const _0x59b8f8=new re();he({'source':_0xfdfdc1['_visibleAnnotations'],'target':_0x59b8f8,'filter':_0x80195a}),this['uisData']['set'](_0x2704f2,{'collection':_0x59b8f8,'filter':_0x80195a});const _0x1a24a=this['_uis']['get'](_0x2704f2);_0x1a24a['attach'](_0x59b8f8),this['listenTo'](_0x1a24a,'change:activeAnnotation',(_0x4997c2,_0x5d2a5f,_0x31928f,_0x1f412e)=>{_0x1f412e&&_0xfdfdc1['_removeActiveAnnotation'](_0x1f412e),_0x31928f&&_0xfdfdc1['_addActiveAnnotation'](_0x31928f);});}deactivate(_0x1020ae){if(this['activeUIs']['delete'](_0x1020ae),!this['_uis']['has'](_0x1020ae))throw new _0x465b2f('annotationsuis-missing-ui',this,{'uiName':_0x1020ae});const _0x2a9e07=this['_uis']['get'](_0x1020ae);_0x2a9e07['detach'](),this['stopListening'](_0x2a9e07),this['uisData']['get'](_0x1020ae)['collection']['destroy'](),this['uisData']['delete'](_0x1020ae);}switchTo(_0x5494a1){if(!this['_uis']['has'](_0x5494a1))throw new _0x465b2f('annotationsuis-missing-ui',this,{'uiName':_0x5494a1});const _0x295f89=this['context']['plugins']['get'](ce),_0x3addbe=Array['from'](_0x295f89['activeAnnotations'])[0x0]||null;this['deactivateAll'](),this['activate'](_0x5494a1);const _0xc9e640=this['_uis']['get'](_0x5494a1);_0xc9e640['setActiveAnnotation'](_0x3addbe),_0xc9e640['_setSelectedAnnotations']&&_0x3addbe&&_0xc9e640['_setSelectedAnnotations']([_0x3addbe]);}deactivateAll(){for(const _0x39019f of this['activeUIs'])this['deactivate'](_0x39019f);}register(_0xfe9896,_0x4dddd7){if(this['_uis']['has'](_0xfe9896))throw new _0x465b2f('annotationsuis-register-already-registered');if('function'!=typeof _0x4dddd7['attach']||'function'!=typeof _0x4dddd7['detach']||'function'!=typeof _0x4dddd7['setActiveAnnotation'])throw new _0x465b2f('annotationsuis-register-invalid-interface',null);this['_uis']['set'](_0xfe9896,_0x4dddd7);}refilterAnnotations(){const _0x455225=this['context']['plugins']['get'](ce)['collection'],_0x1f78b7=new Map(),_0x56a441=Array['from'](this['activeUIs']);for(const _0x222b23 of this['activeUIs']){const _0x5b15ca=this['uisData']['get'](_0x222b23)['collection'];for(const _0x883ec5 of _0x5b15ca)_0x1f78b7['set'](_0x883ec5,_0x222b23);}for(const _0x32f563 of _0x455225){const _0x409606=_0x1f78b7['get'](_0x32f563);this['_assertAnnotationDoesNotBelongToMultipleUIs'](_0x32f563);const _0x22c1e9=_0x56a441['find'](_0x23ce51=>this['uisData']['get'](_0x23ce51)['filter'](_0x32f563));_0x409606!==_0x22c1e9&&(_0x409606&&this['uisData']['get'](_0x409606)['collection']['remove'](_0x32f563),_0x22c1e9&&this['uisData']['get'](_0x22c1e9)['collection']['add'](_0x32f563));}}destroy(){this['deactivateAll'](),super['destroy']();}defaultFilter(){return!0x0;}_assertAnnotationDoesNotBelongToMultipleUIs(_0x1158d3){const _0x249420=[];for(const _0x109555 of this['activeUIs']){(0x0,this['uisData']['get'](_0x109555)['filter'])(_0x1158d3)&&_0x249420['push'](_0x109555);}if(_0x249420['length']>0x1)throw new _0x465b2f('annotationsuis-annotation-mismatch',null,{'matchedUIs':_0x249420,'annotationType':_0x1158d3['type']});}};const xe=/* #__PURE__ -- @preserve */
|
|
32
|
-
|
|
33
|
-
_0x2fdd67('px');var Le=class extends ft{content;_targetTop;_mutationObserver;constructor(_0x2dcb95){super(_0x2dcb95),this['set']('top',0x0),this['set']('height',0x0),this['bind']('bottom')['to'](this,'top',this,'height',(_0x21312c,_0x4790b5)=>_0x21312c+_0x4790b5),this['set']('isAnimationDisabled',!0x1),this['_mutationObserver']=ee(()=>this['updateHeight']()),this['_targetTop']=null,this['content']=this['createCollection'](),this['content']['delegate']('arrowup','arrowdown')['to'](this);const _0x10d04d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-sidebar-item',_0x10d04d['to']('isAnimationDisabled',_0x2910c8=>_0x2910c8?'ck-sidebar-item--no-animation':'')],'style':{'top':_0x10d04d['to']('top',_0xaf33e0=>Pe(_0xaf33e0))},'role':'presentation'},'children':this['content']});}['render'](){super['render'](),this['_mutationObserver']['attach'](this['element']);}['focus'](){this['content']['first']&&this['content']['first']['focus']();}updateHeight(){const _0x105875=this['element']['clientHeight'];_0x105875&&(this['height']=_0x105875);}destroy(){this['content']['clear'](),this['_mutationObserver']['detach'](),super['destroy']();}},De=class extends _0x16df46{['view'];_activeAnnotation;_annotations;_spaceBetweenItems;_sidebarItemViewToAnnotation;_annotationToSidebarItemView;_recalculateBuffer;static get['pluginName'](){return'Sidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2ff4cc){super(_0x2ff4cc),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 _0x15ce47=this['context']['config']['get']('sidebar.container');_0x15ce47&&this['setContainer'](_0x15ce47);}setContainer(_0x5eb46d){if(!Be(_0x5eb46d))throw new _0x465b2f('sidebar-setcontainer-invalid-element');this['container']=_0x5eb46d;}_attachToContainer({viewClass:_0x40ba34='',spaceBetweenItems:_0x2d95ec=0x19}={}){if(!Be(this['container']))throw new _0x465b2f('sidebar-attachtocontainer-missing-container',this);this['container']['appendChild'](this['view']['element']),this['view']['class']=_0x40ba34,this['_spaceBetweenItems']=_0x2d95ec;}['rearrange']({removedAnnotation:_0x4c2e9c,previousAnnotation:_0x3a21e2,nextAnnotation:_0x1ff4cc}){const _0x27f812=this['getSidebarItemView'](_0x4c2e9c);this['view']['list']['remove'](_0x27f812),this['_destroySidebarItemView'](_0x4c2e9c),_0x3a21e2&&this['_alignToTargetRect'](this['getSidebarItemView'](_0x3a21e2)),_0x1ff4cc&&this['_alignToTargetRect'](this['getSidebarItemView'](_0x1ff4cc)),this['_updateLastItem']();}['refresh']({blurredAnnotation:_0x2ba5f9,activatedAnnotation:_0x4edcb5,disableAnimationOnActivatedAnnotation:_0x45d415}){if(this['_activeAnnotation']=_0x4edcb5,_0x2ba5f9){_0x2ba5f9['isActive']=!0x1;const _0x3ae046=this['getSidebarItemView'](_0x2ba5f9);_0x3ae046&&_0x45d415&&(_0x3ae046['isAnimationDisabled']=!0x1);}if(_0x4edcb5){const _0x5908b6=this['getSidebarItemView'](_0x4edcb5);_0x5908b6&&(_0x4edcb5['isActive']=!0x0,_0x45d415&&(_0x5908b6['isAnimationDisabled']=!0x0,_0x5908b6['top']+=0x1),this['_alignToTargetRect'](_0x5908b6));}}_detachFromContainer(_0x2e4856){if(this['view']['element']['remove'](),_0x2e4856){for(const _0x4b7816 of _0x2e4856)this['_destroySidebarItemView'](_0x4b7816);}this['view']['list']['clear'](),this['view']['class']='',this['_lastItem']=null;}addAnnotation(_0x26101d,_0x5bdd15){_0x5bdd15||(_0x5bdd15=_0x26101d['view']);const _0x30aab5=new Le(this['context']['locale']);this['_sidebarItemViewToAnnotation']['set'](_0x30aab5,_0x26101d),this['_annotationToSidebarItemView']['set'](_0x26101d,_0x30aab5),_0x30aab5['content']['add'](_0x5bdd15),this['listenTo'](_0x26101d['view'],'change:targetRect',(_0x5e54c3,_0x1b401b,_0x413c82)=>{const _0x567c9f=this['_getTargetTop'](_0x26101d,_0x413c82);_0x30aab5['_targetTop']!=_0x567c9f&&(_0x30aab5['_targetTop']=_0x567c9f,this['_setItemTop'](_0x30aab5,_0x567c9f));}),this['listenTo'](_0x30aab5,'change:top',()=>{this['_recalculate'](_0x30aab5,'top');}),this['listenTo'](_0x30aab5,'change:bottom',()=>{this['_recalculate'](_0x30aab5,'bottom');}),this['_alignToTargetRect'](_0x30aab5);const _0x4dacc1=this['_getItemBefore'](_0x30aab5);return _0x4dacc1&&this['_alignAfterItem'](_0x4dacc1,_0x30aab5)||this['_alignToTargetRect'](_0x30aab5),this['_updateLastItem'](),this['view']['list']['add'](_0x30aab5),_0x30aab5;}['_alignForTopChange'](_0x307395){if(!_0x307395['content']['length'])return;const _0x3658f6=this['_getItemBefore'](_0x307395);if(!_0x3658f6)return;const _0x3fc76e=this['_sidebarItemViewToAnnotation']['get'](_0x3658f6),_0x302d5b=this['_activeAnnotation'];_0x302d5b&&_0x302d5b===_0x3fc76e?this['_alignAfterItem'](_0x3658f6,_0x307395):this['_alignBeforeItem'](_0x307395,_0x3658f6);}_alignForBottomChange(_0xe5006a){if(!_0xe5006a['content']['length'])return;const _0x3f921a=this['_getItemAfter'](_0xe5006a);if(!_0x3f921a)return;const _0x4c9a38=this['_sidebarItemViewToAnnotation']['get'](_0x3f921a),_0x135384=this['context']['config']['get']('sidebar.preventScrollOutOfView'),_0x5e41aa=this['_activeAnnotation'];_0x5e41aa&&_0x5e41aa===_0x4c9a38&&_0x135384?(this['_alignBeforeItem'](_0x3f921a,_0xe5006a),this['_alignAfterItem'](_0xe5006a,_0x3f921a)):_0x5e41aa&&_0x5e41aa===_0x4c9a38?this['_alignBeforeItem'](_0x3f921a,_0xe5006a):this['_alignAfterItem'](_0xe5006a,_0x3f921a);}_recalculate(_0x2db3fd,_0x308c32){0x0===this['_recalculateBuffer']['length']&&setTimeout(()=>{for(const {sidebarItemView:_0x28efa7,changedProp:_0xf92c7f}of this['_recalculateBuffer'])'top'===_0xf92c7f?this['_alignForTopChange'](_0x28efa7):this['_alignForBottomChange'](_0x28efa7);this['_recalculateBuffer']=[];},0xa),this['_recalculateBuffer']['push']({'sidebarItemView':_0x2db3fd,'changedProp':_0x308c32});}getSidebarItemView(_0x35c445){return this['_annotationToSidebarItemView']['get'](_0x35c445);}destroy(){this['stopListening'](),this['view']['destroy']();}_destroySidebarItemView(_0xc83456){const _0x158478=this['getSidebarItemView'](_0xc83456);this['stopListening'](_0x158478),this['stopListening'](_0xc83456['view']),_0x158478['destroy'](),this['_annotationToSidebarItemView']['delete'](_0xc83456),this['_sidebarItemViewToAnnotation']['delete'](_0x158478);}_createSidebarView(){const _0x4df6eb=new Se(this['context']['locale']);return _0x4df6eb['render'](),this['on']('change:_lastItem',(_0x28009b,_0x52214c,_0x511914,_0x22e6a6)=>{_0x22e6a6&&_0x4df6eb['unbind']('minHeight'),_0x511914?_0x4df6eb['bind']('minHeight')['to'](_0x511914,'bottom'):_0x4df6eb['minHeight']=null;}),_0x4df6eb;}_updateLastItem(){this['_lastItem']=this['_annotations']?.['last']?this['getSidebarItemView'](this['_annotations']['last']):null;}_getItemBefore(_0xfc27e6){const _0x2bd38d=this['_sidebarItemViewToAnnotation']['get'](_0xfc27e6),_0x381b63=_0x2bd38d&&this['_annotations']?.['get'](this['_annotations']['getIndex'](_0x2bd38d)-0x1);return _0x381b63&&this['getSidebarItemView'](_0x381b63)||null;}_getItemAfter(_0x35dca5){const _0x4e9c49=this['_sidebarItemViewToAnnotation']['get'](_0x35dca5),_0x334356=_0x4e9c49&&this['_annotations']?.['get'](this['_annotations']['getIndex'](_0x4e9c49)+0x1);return _0x334356&&this['getSidebarItemView'](_0x334356)||null;}_alignBeforeItem(_0x59330a,_0x235705){_0x59330a['updateHeight']();const _0x339811=Ve(_0x235705['bottom']+this['_spaceBetweenItems'],_0x59330a['top']);return!!_0x339811&&(this['_setItemTop'](_0x235705,_0x235705['top']-_0x339811),!0x0);}_alignAfterItem(_0x1b4d57,_0x2b11a4){_0x1b4d57['updateHeight']();const _0x272e23=Ve(_0x1b4d57['bottom']+this['_spaceBetweenItems'],_0x2b11a4['top']);return!!_0x272e23&&(this['_setItemTop'](_0x2b11a4,_0x2b11a4['top']+_0x272e23,!0x1),!0x0);}_alignToTargetRect(_0x9b1603){const _0xf64b2f=this['_sidebarItemViewToAnnotation']['get'](_0x9b1603);if(!_0xf64b2f||!_0xf64b2f['target']||!_0xf64b2f['targetRect'])return;const _0x9f2b6a=this['_getTargetTop'](_0xf64b2f,_0xf64b2f['targetRect']);this['_setItemTop'](_0x9b1603,_0x9f2b6a);}_getTargetTop(_0x4ab9ff,_0x26a8c0){if(null===_0x26a8c0)return 0x0;if(_0x4ab9ff['target']instanceof _0xfb6dad)return _0x26a8c0['top'];{const _0x1cf373=new _0xfb6dad(this['view']['element'])['top'];return _0x26a8c0['top']-_0x1cf373;}}_setItemTop(_0x13f203,_0x52bbc0,_0x54655f=this['context']['config']['get']('sidebar.preventScrollOutOfView')){_0x54655f&&(_0x52bbc0=Math['max'](_0x52bbc0,this['_getMaxAvailableTop'](_0x13f203))),_0x13f203['top']=_0x52bbc0;}_getMaxAvailableTop(_0x51b5bd){let _0x1a8c9a=this['_getItemBefore'](_0x51b5bd),_0x143eaf=0x0;for(;_0x1a8c9a;)_0x1a8c9a['updateHeight'](),_0x143eaf+=this['_spaceBetweenItems']+_0x1a8c9a['height'],_0x1a8c9a=this['_getItemBefore'](_0x1a8c9a);return _0x143eaf;}};function Ve(_0x1278d8,_0x1c2e2d){return Math['max'](_0x1278d8-_0x1c2e2d,0x0);}function Be(_0x190d02){return null!==_0x190d02&&'object'==typeof _0x190d02&&0x1===_0x190d02['nodeType'];}var He=class extends _0x16df46{isAttached;annotations;_editorAnnotations;_refreshPositioningDebounced;static get requires(){return[De,Re];}static get['pluginName'](){return'WideSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1b4995){super(_0x1b4995),this['isAttached']=!0x1,this['set']('activeAnnotation',null),this['annotations']=null,this['_editorAnnotations']=new _0x574e6b(),this['_refreshPositioningDebounced']=_0x520e15(()=>{_0x1b4995['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning']();},0xfa,{'leading':!0x1});}init(){const _0x45fefb=this['context']['plugins']['get'](Re),_0x4818fb=this['context']['plugins']['get'](De);_0x45fefb['register']('wideSidebar',this),_0x4818fb['container']&&_0x45fefb['switchTo']('wideSidebar');}setActiveAnnotation(_0x2c8c93){if(_0x2c8c93===this['activeAnnotation'])return;const _0x51643b=this['context']['plugins']['get'](De);_0x51643b['_activeAnnotation']=_0x2c8c93;const _0x438033=this['activeAnnotation'];_0x51643b['refresh']({'blurredAnnotation':_0x438033,'activatedAnnotation':_0x2c8c93}),this['activeAnnotation']=_0x2c8c93;}attach(_0x161314){this['annotations']=_0x161314;const _0x21d3ec=this['context']['plugins']['get'](De);if(_0x21d3ec['_annotations']=_0x161314,this['isAttached'])throw new _0x465b2f('widesidebar-attach-already-attached',this);this['isAttached']=!0x0,this['listenTo'](_0x21d3ec,'set:container',()=>{this['detach'](),this['listenTo'](_0x21d3ec,'change:container',_0x261e41=>{_0x261e41['off'](),this['attach'](_0x161314);});}),_0x21d3ec['_attachToContainer']({'viewClass':'ck-sidebar--wide'});const _0x5ac87c=_0x45ac2a=>{_0x45ac2a['updateTargetRect'](),_0x21d3ec['addAnnotation'](_0x45ac2a);};for(const _0x468256 of _0x161314)_0x5ac87c(_0x468256);this['listenTo'](_0x161314,'add',(_0x38891f,_0x3cfffe)=>{_0x5ac87c(_0x3cfffe);}),this['listenTo'](_0x161314,'remove',(_0x281aba,_0x68082,_0x3ca30d)=>{_0x21d3ec['rearrange']({'removedAnnotation':_0x68082,'previousAnnotation':_0x161314['get'](_0x3ca30d-0x1),'nextAnnotation':_0x161314['get'](_0x3ca30d+0x1)}),_0x68082===this['activeAnnotation']&&this['setActiveAnnotation'](null);},{'priority':'high'}),this['listenTo'](_0x161314,'focus',(_0x408cb8,_0x393887)=>{this['setActiveAnnotation'](_0x393887);}),this['listenTo'](_0x161314,'blur',()=>{this['setActiveAnnotation'](null);});const _0x33ca85=this['context']instanceof _0x11fc3f?this['context']['editors']:new _0x574e6b([this['context']]);for(const _0x2abc07 of _0x33ca85)this['_integrateWithEditorAnnotations'](_0x2abc07);this['listenTo'](_0x33ca85,'add',(_0x26f44d,_0x15189d)=>{this['listenTo'](_0x15189d,'ready',()=>{this['_integrateWithEditorAnnotations'](_0x15189d);});}),this['listenTo'](_0x33ca85,'remove',(_0x1406c2,_0x3cb539)=>{_0x3cb539['plugins']['has']('EditorAnnotations')&&this['_destroyEditorAnnotationsIntegration'](_0x3cb539['plugins']['get']('EditorAnnotations'));}),window['addEventListener']('resize',this['_refreshPositioningDebounced']),this['context']['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning']();}detach(){if(!this['isAttached'])throw new _0x465b2f('widesidebar-detach-not-attached',this);this['setActiveAnnotation'](null);const _0x4c623d=this['context']['plugins']['get'](De);_0x4c623d['_detachFromContainer'](this['annotations']),this['stopListening'](_0x4c623d),this['stopListening'](this['annotations']),this['context']instanceof _0x11fc3f&&this['stopListening'](this['context']['editors']);for(const _0x1011b8 of Array['from'](this['_editorAnnotations']))this['_destroyEditorAnnotationsIntegration'](_0x1011b8);window['removeEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioningDebounced']['cancel'](),this['activeAnnotation']=null,this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach']();}_integrateWithEditorAnnotations(_0xe4b60c){if(!_0xe4b60c['plugins']['has']('EditorAnnotations'))return;const _0x523007=_0xe4b60c['plugins']['get']('EditorAnnotations'),_0x139471=()=>{const _0x559fe0=_0x523007['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});this['setActiveAnnotation'](_0x559fe0[0x0]||null);};this['listenTo'](_0x523007,'refresh',_0x139471),this['listenTo'](_0x523007,'blur',(_0x3a3c5f,{isAnnotationTracked:_0x35e389})=>{this['activeAnnotation']&&_0x35e389(this['activeAnnotation'])&&this['setActiveAnnotation'](null);}),this['listenTo'](_0x523007,'uiUpdate',()=>{this['_refreshPositioningDebounced']();}),this['listenTo'](this['annotations'],'blur',_0xc820b2=>{_0x523007['hasDomSelection']()&&(_0x139471(),_0xc820b2['stop']());},{'priority':'high'}),this['_editorAnnotations']['add'](_0x523007);}_destroyEditorAnnotationsIntegration(_0x37ffaa){this['stopListening'](_0x37ffaa),this['_editorAnnotations']['remove'](_0x37ffaa);}},Ue=class extends it{counterView;constructor(_0x32a68a){super(_0x32a68a);const _0x558d7e=this['bindTemplate'];this['set']('isDirty',!0x1),this['set']('number',0x0),this['bind']('_badge')['to'](this,'isDirty',this,'number',(_0x2b4dfa,_0x3bd4f1)=>_0x2b4dfa?'…':_0x3bd4f1['toString']()),this['set']('annotationType',''),this['bind']('icon')['to'](this,'annotationType',_0x26ab3f=>'comment'===_0x26ab3f?_0xfcc39a:_0x41f446),this['extendTemplate']({'attributes':{'class':['ck-annotation-counter']}}),this['counterView']=new ft(),this['counterView']['setTemplate']({'tag':'span','attributes':{'class':['ck-annotation-counter__badge',_0x558d7e['to']('annotationType',_0x15c6ad=>'ck-annotation-counter__badge--'+_0x15c6ad),_0x558d7e['if']('isDirty','ck-annotation-counter__badge--edit-mode')]},'children':[{'text':_0x558d7e['to']('_badge')}]}),this['children']['add'](this['counterView']);}},Fe=class extends _0x16df46{isAttached;annotations;_manuallyClosedAnnotationViews;_domEmitter;_annotationToNarrowView;_selectedAnnotations;_editorAnnotations;_refreshPositioningDebounced;static get requires(){return[De,Re];}static get['pluginName'](){return'NarrowSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x27beeb){super(_0x27beeb),this['isAttached']=!0x1,this['_manuallyClosedAnnotationViews']=new Set(),this['_domEmitter']=new(_0xc0abb6())(),this['_annotationToNarrowView']=new Map(),this['set']('activeAnnotation',null),this['annotations']=null,this['_selectedAnnotations']=[],this['_editorAnnotations']=new _0x574e6b(),this['_refreshPositioningDebounced']=_0x520e15(()=>{this['_refreshPositioning']();},0xfa,{'leading':!0x1});}init(){this['context']['plugins']['get'](Re)['register']('narrowSidebar',this),this['_overlayHost']=new ut(this['context']['locale'],{'resolveMountTarget':()=>this['_resolveOverlayTarget'](),'resolveInlineContainer':()=>this['context']['plugins']['get'](De)['container']}),this['_overlayHost']['sync'](),this['bodyCollection']=this['_overlayHost']['bodyCollection'],this['balloonPanelView']=new et(this['context']['locale']),this['bodyCollection']['add'](this['balloonPanelView']);}attach(_0x29bc85){this['annotations']=_0x29bc85;const _0x2cbf03=this['context']['plugins']['get'](De),_0x1debee=this['balloonPanelView'];if(_0x2cbf03['_annotations']=_0x29bc85,this['isAttached'])throw new _0x465b2f('narrowsidebar-attach-already-attached',this);this['isAttached']=!0x0,this['listenTo'](_0x2cbf03,'set:container',()=>{this['detach'](),this['listenTo'](_0x2cbf03,'change:container',_0x3d5ce7=>{_0x3d5ce7['off'](),this['attach'](_0x29bc85);});}),_0x2cbf03['_attachToContainer']({'viewClass':'ck-sidebar--narrow','spaceBetweenItems':0x5}),this['_overlayHost']['sync']();const _0x1b4514=_0x400f49=>{const _0x43e838=new Ue(this['context']['locale']);_0x2cbf03['addAnnotation'](_0x400f49,_0x43e838),this['_annotationToNarrowView']['set'](_0x400f49,_0x43e838),_0x43e838['bind']('isDirty','annotationType','number')['to'](_0x400f49['view'],'isDirty','type','length'),_0x43e838['on']('execute',()=>{this['_manuallyClosedAnnotationViews']['clear'](),_0x1debee['content']['first']!==_0x400f49['view']?(this['_showBalloon'](_0x400f49),_0x400f49['view']['element']['focus'](),this['setActiveAnnotation'](_0x400f49)):this['setActiveAnnotation'](null);});};for(const _0x2ff437 of _0x29bc85)_0x1b4514(_0x2ff437);this['listenTo'](_0x29bc85,'add',(_0x4d367b,_0x39cd7a)=>{_0x1b4514(_0x39cd7a);}),this['listenTo'](_0x29bc85,'remove',(_0x18ca6c,_0x2f6ecc,_0x8a51e7)=>{this['_annotationToNarrowView']['get'](_0x2f6ecc)['destroy'](),this['_annotationToNarrowView']['delete'](_0x2f6ecc),_0x2cbf03['rearrange']({'removedAnnotation':_0x2f6ecc,'previousAnnotation':_0x29bc85['get'](_0x8a51e7-0x1),'nextAnnotation':_0x29bc85['get'](_0x8a51e7+0x1)}),_0x2f6ecc===this['activeAnnotation']&&this['setActiveAnnotation'](null);},{'priority':'low'}),this['listenTo'](_0x29bc85,'focus',(_0x38f4f,_0x140694)=>{this['setActiveAnnotation'](_0x140694);}),this['listenTo'](_0x29bc85,'blur',()=>{this['setActiveAnnotation'](null);}),this['_domEmitter']['listenTo'](document,'keydown',(_0x2ac3fb,_0x3fc18a)=>{_0x3fc18a['keyCode']===_0x35c86d['esc']&&_0x1debee['isVisible']&&(this['_manuallyClosedAnnotationViews']['add'](_0x1debee['content']['first']),this['_hideBalloon'](),_0x3fc18a['stopPropagation'](),_0x3fc18a['preventDefault']());}),wt({'emitter':this['_domEmitter'],'activator':()=>_0x1debee['isVisible']&&!this['_hasEditorDomSelection'](),'contextElements':()=>{const _0x4102a8=[_0x2cbf03['view']['element']];return _0x1debee['isVisible']&&_0x4102a8['push'](_0x1debee['element']),this['activeAnnotation']&&_0x4102a8['push'](...this['activeAnnotation']['focusableElements']),_0x4102a8;},'callback':()=>{this['_manuallyClosedAnnotationViews']['clear'](),this['_hideBalloon'](),this['setActiveAnnotation'](null);}});const _0x276bce=this['context']instanceof _0x11fc3f?this['context']['editors']:new _0x574e6b([this['context']]);for(const _0x46f585 of _0x276bce)this['_integrateWithEditorAnnotations'](_0x46f585);this['listenTo'](_0x276bce,'add',(_0x171669,_0x7040cb)=>{this['listenTo'](_0x7040cb,'ready',()=>{this['_integrateWithEditorAnnotations'](_0x7040cb);});}),this['listenTo'](_0x276bce,'remove',(_0x2ae292,_0x31b293)=>{_0x31b293['plugins']['has']('EditorAnnotations')&&this['_destroyEditorAnnotationsIntegration'](_0x31b293['plugins']['get']('EditorAnnotations'));}),window['addEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioning']();}setActiveAnnotation(_0x44cfda){if(_0x44cfda===this['activeAnnotation'])return;const _0x4a76b7=this['context']['plugins']['get'](De);_0x4a76b7['refresh']({'blurredAnnotation':this['activeAnnotation'],'activatedAnnotation':_0x44cfda,'disableAnimationOnActivatedAnnotation':!0x0}),_0x44cfda&&_0x4a76b7['getSidebarItemView'](_0x44cfda)?this['_showBalloon'](_0x44cfda):this['_hideBalloon'](),this['activeAnnotation']=_0x44cfda;}detach(){if(!this['isAttached'])throw new _0x465b2f('narrowsidebar-detach-not-attached',this);this['setActiveAnnotation'](null);const _0x412111=this['context']['plugins']['get'](De);this['_hideBalloon'](),Array['from'](this['_annotationToNarrowView']['values'](),_0x3871a4=>_0x3871a4['destroy']()),this['_annotationToNarrowView']['clear'](),_0x412111['_detachFromContainer'](this['annotations']),this['stopListening'](),this['_domEmitter']['stopListening'](),this['context']instanceof _0x11fc3f&&this['stopListening'](this['context']['editors']);for(const _0x50811b of Array['from'](this['_editorAnnotations']))this['_destroyEditorAnnotationsIntegration'](_0x50811b);window['removeEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioningDebounced']['cancel'](),this['_selectedAnnotations']=[],this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach'](),this['_overlayHost']['destroy']();}_integrateWithEditorAnnotations(_0x14ac4c){if(!_0x14ac4c['plugins']['has']('EditorAnnotations'))return;const _0x258c04=_0x14ac4c['plugins']['get']('EditorAnnotations'),_0x43f2b1=this['context']['plugins']['get'](De),_0x28ad51=this['annotations'],_0x1bb397=this['balloonPanelView'],_0x27a535=()=>{const _0x1b7a76=_0x258c04['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});this['_setSelectedAnnotations'](_0x1b7a76),this['setActiveAnnotation'](_0x1b7a76[0x0]||null);};this['listenTo'](_0x258c04,'refresh',_0x27a535),this['listenTo'](_0x258c04,'blur',(_0x90c402,{isAnnotationTracked:_0x4d7c9d})=>{this['activeAnnotation']&&_0x4d7c9d(this['activeAnnotation'])&&(this['_setSelectedAnnotations']([]),this['setActiveAnnotation'](null));}),this['listenTo'](_0x258c04,'uiUpdate',()=>{this['_refreshPositioningDebounced']();}),this['listenTo'](_0x28ad51,'blur',_0xad5c21=>{_0x258c04['hasDomSelection']()&&_0xad5c21['stop']();},{'priority':'high'}),wt({'emitter':this['_domEmitter'],'activator':()=>!!this['activeAnnotation'],'contextElements':()=>{const _0x1c3971=[_0x43f2b1['view']['element']];return _0x1bb397['isVisible']&&_0x1c3971['push'](_0x1bb397['element']),_0x1c3971;},'callback':()=>{_0x258c04['hasDomSelection']()&&_0x27a535();}}),this['_editorAnnotations']['add'](_0x258c04),this['_overlayHost']['sync']();}_destroyEditorAnnotationsIntegration(_0x52f6d5){_0x52f6d5&&(this['stopListening'](_0x52f6d5),this['_editorAnnotations']['remove'](_0x52f6d5));}_hasEditorDomSelection(){return Array['from'](this['_editorAnnotations'])['some'](_0x448a58=>_0x448a58['hasDomSelection']());}_setSelectedAnnotations(_0x1dd550){for(const _0xcfcd2 of this['_selectedAnnotations'])_0x1dd550['includes'](_0xcfcd2)||this['_manuallyClosedAnnotationViews']['delete'](_0xcfcd2['view']);this['_selectedAnnotations']=_0x1dd550;}_refreshPositioning(){const _0x465899=this['balloonPanelView'];this['context']['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning'](),_0x465899['isVisible']&&this['_updateBalloonPosition']();}_resolveOverlayTarget(){const _0x80529c=this['context']['config']['get']('sidebar.overlayContainer')||this['context']['config']['get']('ui.overlayContainer');if(_0x80529c)return _0x80529c;const _0x100e8b=this['context']['plugins']['get'](De)['container'];return _0x100e8b?_0x2601ca(_0x100e8b):null;}['_showBalloon'](_0x1330b6){if(this['_manuallyClosedAnnotationViews']['has'](_0x1330b6['view']))return;const _0x20af10=this['balloonPanelView']['content']['first'];_0x20af10!==_0x1330b6['view']?(_0x20af10&&this['_detachListeners'](_0x20af10),this['_overlayHost']['sync'](),this['_attachListeners'](_0x1330b6['view']),this['balloonPanelView']['content']['clear'](),this['balloonPanelView']['content']['add'](_0x1330b6['view']),this['_updateBalloonPosition']()):this['_updateBalloonPosition']();}_updateBalloonPosition(){const _0x4e34ca=this['balloonPanelView']['content']['first'],_0x1f72a9=_0x4e34ca&&this['annotations']['getByView'](_0x4e34ca);if(!_0x1f72a9||!this['_annotationToNarrowView']['has'](_0x1f72a9))return;const _0x2cb4bc=this['_annotationToNarrowView']['get'](_0x1f72a9)['element'],_0x1c980a=(function(){const _0x381572=et['defaultPositions'];return[_0x381572['southArrowNorthEast'],_0x381572['northArrowSouthEast'],_0x381572['southArrowNorth'],_0x381572['northArrowSouth'],_0x381572['southArrowNorthWest'],_0x381572['northArrowSouthWest']];}());this['balloonPanelView']['pin']({'target':_0x2cb4bc,'positions':_0x1c980a});}['_hideBalloon'](){const _0x3e3476=this['balloonPanelView'],_0x627a63=_0x3e3476['content']['first'];_0x627a63&&(this['_detachListeners'](_0x627a63),_0x3e3476['unpin'](),_0x3e3476['content']['clear']());}_attachListeners(_0x3ca3b4){this['listenTo'](_0x3ca3b4,'change:height',()=>this['_updateBalloonPosition']()),this['listenTo'](_0x3ca3b4,'Esc',(_0x125265,_0x33717d)=>{this['_manuallyClosedAnnotationViews']['add'](_0x3ca3b4),this['_hideBalloon'](),_0x33717d();});}_detachListeners(_0x2f6baa){this['stopListening'](_0x2f6baa);}},We=class extends _0x1a85c9{isAttached;annotations;['_manuallyClosed'];['_balloon'];_addedAnnotations;_selectedAnnotations;['_forceRefresh'];_refreshVisibilityDebounced;static get requires(){return[Ae,st,Re];}static get['pluginName'](){return'InlineAnnotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x46faa2){super(_0x46faa2),_0x46faa2['editing']['view']['addObserver'](At),this['isAttached']=!0x1,this['set']('activeAnnotation',null),this['annotations']=null,this['_manuallyClosed']=new Set(),this['_balloon']=_0x46faa2['plugins']['get'](st),this['_addedAnnotations']=new Set(),this['_selectedAnnotations']=[],this['_forceRefresh']=!0x1,this['_refreshVisibilityDebounced']=_0x520e15(()=>{this['editor']['plugins']['get']('Annotations')['refreshVisibility']();},0xfa,{'leading':!0x1});}init(){const _0x198556=this['editor']['plugins']['get'](Re);_0x198556['context']===this['editor']&&(_0x198556['register']('inline',this),this['editor']['keystrokes']['set']('Esc',(_0x660921,_0xc199b5)=>{const _0x590343=this['_balloon'];if(this['isAttached']&&_0x590343['visibleView']){const _0x170f3c=this['annotations']['getByView'](_0x590343['visibleView']);_0x170f3c&&this['_closeAnnotation'](_0x170f3c),_0xc199b5();}}));}afterInit(){const _0x2baa53=this['editor']['plugins']['get'](Re);_0x2baa53['context']===this['editor']&&(_0x2baa53['hasActive']()||_0x2baa53['switchTo']('inline'));}setActiveAnnotation(_0x4d5a97){_0x4d5a97!==this['activeAnnotation']&&(this['activeAnnotation']&&(this['activeAnnotation']['isActive']=!0x1),_0x4d5a97&&this['editor']['ui']['focusTracker']['isFocused']&&(this['annotations']['has'](_0x4d5a97)&&this['_addAnnotationToBalloon'](_0x4d5a97,!0x0),_0x4d5a97['isActive']=!0x0),_0x4d5a97||this['_setSelectedAnnotations']([]),this['activeAnnotation']=_0x4d5a97);}attach(_0x4f5cfc){this['annotations']=_0x4f5cfc;const _0x55c53d=this['editor']['plugins']['get'](Re),_0x44f49d=this['_balloon'];if(this['isAttached'])throw new _0x465b2f('inlineannotations-attach-already-attached',this);if(_0x55c53d['context']!==this['editor'])throw new _0x465b2f('inlineannotations-not-allowed-with-context',this);const _0x38b7c7=this['editor']['plugins']['get'](Ae);this['listenTo'](_0x38b7c7,'refresh',()=>{const _0x347103=_0x38b7c7['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});var _0x4a5a84,_0x78dd03;!this['_forceRefresh']&&(_0x4a5a84=_0x347103,_0x78dd03=this['_selectedAnnotations'],_0x4a5a84['length']===_0x78dd03['length']&&_0x4a5a84['every'](_0x11f7e2=>_0x78dd03['includes'](_0x11f7e2)))||(this['_forceRefresh']=!0x1,this['_setSelectedAnnotations'](_0x347103),this['setActiveAnnotation'](_0x347103[0x0]||null));}),this['listenTo'](_0x38b7c7,'blur',(_0x510864,{isAnnotationTracked:_0x4f5bea})=>{this['activeAnnotation']&&_0x4f5bea(this['activeAnnotation'])&&(this['_setSelectedAnnotations']([]),this['setActiveAnnotation'](null));}),this['listenTo'](_0x38b7c7,'uiUpdate',()=>{this['_refreshVisibilityDebounced']();}),this['listenTo'](this['editor']['ui']['focusTracker'],'change:isFocused',(_0x174216,_0x397808,_0x163654)=>{_0x163654||this['setActiveAnnotation'](null);}),this['listenTo'](_0x4f5cfc,'remove',(_0x51f530,_0x3d8afd)=>{this['_removeAnnotationFromBalloon'](_0x3d8afd),_0x3d8afd===this['activeAnnotation']&&this['setActiveAnnotation'](null);}),this['listenTo'](_0x44f49d,'change:visibleView',(_0xe492e8,_0x1442fa,_0xe866ff,_0x18fe93)=>{_0x18fe93&&this['stopListening'](_0x18fe93);const _0x3ec9fb=_0x4f5cfc['getByView'](_0xe866ff);_0xe866ff&&_0x3ec9fb&&(this['listenTo'](_0xe866ff,'change:height',()=>{_0x44f49d['updatePosition']();}),this['listenTo'](_0xe866ff,'Esc',()=>{this['_closeAnnotation'](_0x3ec9fb),this['editor']['editing']['view']['focus']();}),this['activeAnnotation']!==_0x3ec9fb&&this['setActiveAnnotation'](_0x3ec9fb));}),this['listenTo'](this['editor']['ui'],'update',()=>{_0x44f49d['visibleView']&&_0x4f5cfc['getByView'](_0x44f49d['visibleView'])&&_0x44f49d['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 _0x465b2f('inlineannotations-detach-not-attached',this);this['setActiveAnnotation'](null);for(const _0x1764cd of this['_addedAnnotations'])this['_removeAnnotationFromBalloon'](_0x1764cd);this['_refreshVisibilityDebounced']['cancel'](),this['stopListening'](),this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach'](),this['_refreshVisibilityDebounced']['cancel']();}_setSelectedAnnotations(_0xbea45b){for(const _0x34b30d of this['_selectedAnnotations'])_0xbea45b['includes'](_0x34b30d)||this['_manuallyClosed']['delete'](_0x34b30d);for(const _0x1f64d6 of this['annotations'])_0xbea45b['includes'](_0x1f64d6)||this['_removeAnnotationFromBalloon'](_0x1f64d6);if(this['editor']['ui']['focusTracker']['isFocused']){for(const _0x3dbc15 of _0xbea45b)this['_addAnnotationToBalloon'](_0x3dbc15);}this['_selectedAnnotations']=_0xbea45b;}_addAnnotationToBalloon(_0x5c4c34,_0x1f6303=!0x1){this['_manuallyClosed']['has'](_0x5c4c34)||(this['_addedAnnotations']['has'](_0x5c4c34)||this['_balloon']['hasView'](_0x5c4c34['view'])||(this['_addedAnnotations']['add'](_0x5c4c34),this['_balloon']['add']({'stackId':_0x5c4c34['view']['id'],'view':_0x5c4c34['view'],'position':{'target':()=>this['_getBalloonTargetForAnnotation'](_0x5c4c34)}})),_0x1f6303&&this['_balloon']['showStack'](_0x5c4c34['view']['id']));}_getBalloonTargetForAnnotation(_0x5e1cbf){const _0x37a1f9=_0x5e1cbf['target'],_0x122b87=this['editor']['editing']['view'],_0x16458a=_0x122b87['document']['selection']['getFirstRange'](),_0x143511=_0x122b87['domConverter']['viewRangeToDom'](_0x16458a);if(_0x143511['collapse'](!0x0),_0x37a1f9){if(_0x37a1f9 instanceof _0xfb6dad)return _0x37a1f9;let _0x5b75ae=[];for(const _0xf2e5a7 of _0x37a1f9)_0x5b75ae['push'](..._0xfb6dad['getDomElementRects'](_0xf2e5a7));_0x5b75ae=function(_0x40c4a9){const _0x446e56=[];let _0x2a1b60=_0x40c4a9[0x0];for(let _0x359ac1=0x1;_0x359ac1<_0x40c4a9['length'];_0x359ac1++)if(Ke(_0x2a1b60,_0x40c4a9[_0x359ac1])){const _0x4fceae=_0x40c4a9[_0x359ac1]['width'];_0x2a1b60['width']+=_0x4fceae,_0x2a1b60['right']+=_0x4fceae;}else _0x446e56['push'](_0x2a1b60),_0x2a1b60=_0x40c4a9[_0x359ac1];return _0x446e56['push'](_0x2a1b60),_0x446e56;}(_0x5b75ae);const _0xd55d92=_0x143511['getBoundingClientRect']();return _0x5b75ae['find'](_0x3e635b=>_0x3e635b['top']<=_0xd55d92['top']&&_0x3e635b['bottom']>=_0xd55d92['bottom']&&_0x3e635b['left']<=_0xd55d92['left']&&_0x3e635b['right']>=_0xd55d92['right'])||_0x5b75ae[0x0];}return _0x5e1cbf['targetRect']||_0x143511;}_removeAnnotationFromBalloon(_0x13c1f3){this['_addedAnnotations']['has'](_0x13c1f3)&&this['_balloon']['hasView'](_0x13c1f3['view'])&&(this['_addedAnnotations']['delete'](_0x13c1f3),this['_balloon']['remove'](_0x13c1f3['view']));}_closeAnnotation(_0x5bf5c7){this['_manuallyClosed']['add'](_0x5bf5c7),this['_removeAnnotationFromBalloon'](_0x5bf5c7);}};function Ke(_0x81262f,_0x4a627f){return _0x81262f['top']===_0x4a627f['top']&&_0x81262f['bottom']===_0x4a627f['bottom']&&_0x81262f['right']===_0x4a627f['left'];}var Ge=class extends ft{['focusTracker'];['focusCycler'];_annotationViews;constructor(_0x435ccd,_0x57467d){super(_0x435ccd),this['set']('isEmpty',!_0x57467d['length']),this['focusTracker']=new _0x2532f1(),this['_annotationViews']=_0x57467d,this['_annotationViews']['delegate']('arrowup','arrowdown')['to'](this),this['on']('arrowup',()=>{this['focusCycler']['focusPrevious']();}),this['on']('arrowdown',()=>{this['focusCycler']['focusNext']();}),this['focusCycler']=new at({'focusables':_0x57467d,'focusTracker':this['focusTracker']}),this['listenTo'](_0x57467d,'add',()=>{this['isEmpty']=!0x1;}),this['listenTo'](_0x57467d,'remove',(_0x1f6e51,_0x3c54e9)=>{_0x3c54e9['isActive']&&this['focus'](),_0x57467d['length']||(this['isEmpty']=!0x0);});const _0x3f45cb=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'dir':'auto','class':['ck','ck-comments-archive'],'tabindex':-0x1,'role':'list','aria-label':Pt(_0x435ccd,'COMMENTS_ARCHIVE_LIST_LABEL')},'children':[{'tag':'div','attributes':{'class':['ck-comments-archive__content'],'role':'presentation'},'children':[{'tag':'div','attributes':{'role':'presentation'},'children':_0x57467d},{'tag':'p','attributes':{'class':['ck-comments-archive__info',_0x3f45cb['if']('isEmpty','ck-hidden',_0x25e4c8=>!_0x25e4c8)]},'children':[{'text':Pt(_0x435ccd,'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 _0x30dc99 of this['_annotationViews'])this['focusTracker']['add'](_0x30dc99['element']);this['_annotationViews']['on']('change',(_0x45a07d,{added:_0x489416,removed:_0x1deca2})=>{for(const _0x2b5f55 of _0x489416)this['focusTracker']['add'](_0x2b5f55['element']);for(const _0x33989a of _0x1deca2)this['focusTracker']['remove'](_0x33989a['element']);});}},Ye=class extends _0x16df46{static get['pluginName'](){return'CommentsArchive';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[fe,ce];}constructor(_0xc8f374){super(_0xc8f374),this['archivedThreads']=new _0x574e6b();}init(){const _0x2af573=this['context'],_0x4d288d=_0x2af573['plugins']['get'](fe),_0x27b9f7=_0x2af573['plugins']['get'](ce);this['listenTo'](_0x4d288d,'addCommentThread',(_0x580289,{threadId:_0x4560af})=>{const _0x2d30b6=_0x4d288d['getCommentThread'](_0x4560af);_0x2d30b6['archivedAt']&&this['archivedThreads']['add'](_0x2d30b6,this['_calculatePosition'](_0x2d30b6['archivedAt'])),this['listenTo'](_0x2d30b6,'change:archivedAt',(_0x576b52,_0x5d5edb,_0x212eba)=>{_0x212eba?this['archivedThreads']['has'](_0x2d30b6)||this['archivedThreads']['add'](_0x2d30b6,this['_calculatePosition'](_0x2d30b6['archivedAt'])):this['archivedThreads']['has'](_0x2d30b6)&&this['archivedThreads']['remove'](_0x2d30b6);});}),this['listenTo'](_0x4d288d,'removeCommentThread',(_0x45d99f,{threadId:_0xa06bf5})=>{const _0x5c59dc=_0x4d288d['getCommentThread'](_0xa06bf5);this['stopListening'](_0x5c59dc),this['archivedThreads']['has'](_0x5c59dc)&&this['archivedThreads']['remove'](_0x5c59dc);},{'priority':'highest'}),this['listenTo'](_0x27b9f7['collection'],'focus',(_0x266d20,_0x1bb153)=>{_0x1bb153['isVisible']||(_0x1bb153['isActive']=!0x0,_0x27b9f7['activate'](_0x1bb153));});}_calculatePosition(_0x488089){const _0x20ff08=[...this['archivedThreads']]['findIndex'](_0x2105ba=>_0x2105ba['archivedAt']<_0x488089);return _0x20ff08>-0x1?_0x20ff08:this['archivedThreads']['length'];}},Xe=class extends _0x1a85c9{commentsArchiveView;annotationViews;['_pendingThreads'];static get['pluginName'](){return'CommentsArchiveUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Ye,nt];}constructor(_0x1a01dc){super(_0x1a01dc),this['annotationViews']=new pt(),this['_pendingThreads']=[];}init(){const _0x5047a6=this['editor'],_0xf24f21=this['_hideDialogOnAnnotationEscape']['bind'](this);_0x5047a6['ui']['componentFactory']['add']('commentsArchive',()=>this['_createCommentsArchiveButton'](it,!0x0)),_0x5047a6['ui']['componentFactory']['add']('menuBar:commentsArchive',()=>{const _0x7b336b=this['_createCommentsArchiveButton'](mt);return _0x7b336b['set']({'role':'menuitemcheckbox'}),_0x7b336b;});const _0x58b25c=_0x5047a6['plugins']['get'](Ye),_0x14c662=_0x5047a6['plugins']['get']('Annotations'),_0x3b3dbc=_0x5047a6['plugins']['get']('CommentsRepository');_0x58b25c['archivedThreads']['forEach'](_0x198282=>{this['_handleNewThread'](_0x198282);}),this['listenTo'](_0x58b25c['archivedThreads'],'add',(_0x1fc1db,_0x2e952f)=>{this['_handleNewThread'](_0x2e952f);}),this['listenTo'](_0x14c662['collection'],'add',(_0x1459ce,_0x4f94bd)=>{const _0x25a7bc=this['_pendingThreads']['find'](_0x1e0ed6=>{const _0x1570fd=_0x3b3dbc['_threadToController']['get'](_0x1e0ed6);return _0x1570fd&&_0x4f94bd['innerView']===_0x1570fd['view'];});if(_0x25a7bc){const _0x15fcde=this['_calculatePosition'](_0x25a7bc['archivedAt']);this['_addAnnotationToArchive'](_0x4f94bd,_0x15fcde),this['_pendingThreads']['splice'](this['_pendingThreads']['indexOf'](_0x25a7bc),0x1);}}),this['listenTo'](_0x58b25c['archivedThreads'],'remove',(_0x30a639,_0x3a666b)=>{const _0x30cac5=_0x5047a6['config']['get']('collaboration.channelId');if(!_0x30cac5||_0x3a666b['channelId']===_0x30cac5){if(this['_pendingThreads']['includes'](_0x3a666b))this['_pendingThreads']['splice'](this['_pendingThreads']['indexOf'](_0x3a666b),0x1);else{const _0x2b5bd7=_0x3b3dbc['_threadToController']['get'](_0x3a666b),_0x1a1766=_0x14c662['getByInnerView'](_0x2b5bd7['view']);this['annotationViews']['remove'](_0x1a1766['view']),this['stopListening'](_0x1a1766),this['stopListening'](_0x1a1766['focusableElements']);}}}),this['listenTo'](_0x14c662['collection'],'add',(_0x4add90,_0x3a88c1)=>{this['listenTo'](_0x3a88c1,'escape',_0xf24f21);}),this['listenTo'](_0x14c662['collection'],'remove',(_0x567ba7,_0x2ab132)=>{this['stopListening'](_0x2ab132,'escape',_0xf24f21);});}_addAnnotationToArchive(_0x280d79,_0x455884){this['listenTo'](_0x280d79,'set:isVisible',_0x565038=>{_0x565038['return']=!0x1,_0x565038['stop']();}),this['annotationViews']['add'](_0x280d79['view'],_0x455884);}['_handleNewThread'](_0x2f29c4){const _0x2cda45=this['editor']['plugins']['get']('CommentsRepository'),_0x2a8cf0=this['editor']['plugins']['get']('Annotations'),_0xf8a43e=this['editor']['config']['get']('collaboration.channelId');if(!_0xf8a43e||_0x2f29c4['channelId']===_0xf8a43e){const _0x2ec2f3=_0x2cda45['_threadToController']['get'](_0x2f29c4);if(!_0x2ec2f3)return void this['_pendingThreads']['push'](_0x2f29c4);const _0x44f425=this['_calculatePosition'](_0x2f29c4['archivedAt']),_0x1b051e=_0x2a8cf0['getByInnerView'](_0x2ec2f3['view']);_0x1b051e['isVisible']&&_0x2a8cf0['_visibleAnnotations']['remove'](_0x1b051e),this['_addAnnotationToArchive'](_0x1b051e,_0x44f425);}}_calculatePosition(_0x216517){const _0x51c7ad=this['editor']['config']['get']('collaboration.channelId'),_0x4772d9=[...this['editor']['plugins']['get'](Ye)['archivedThreads']]['filter'](_0x33994b=>_0x33994b['channelId']===_0x51c7ad)['findIndex'](_0x1a367f=>_0x1a367f['archivedAt']<_0x216517);return _0x4772d9<0x0||_0x4772d9>this['annotationViews']['length']?this['annotationViews']['length']:_0x4772d9-0x1;}_toggleDialog(){const _0x281d0a=this['editor'],_0x56ece9=_0x281d0a['plugins']['get']('Dialog');this['commentsArchiveView']||(this['commentsArchiveView']=new Ge(_0x281d0a['locale'],this['annotationViews'])),'commentsArchive'===_0x56ece9['id']?_0x56ece9['hide']():_0x56ece9['show']({'id':'commentsArchive','title':Pt(_0x281d0a['locale'],'COMMENTS_ARCHIVE'),'hasCloseButton':!0x0,'content':this['commentsArchiveView'],'position':ot['EDITOR_TOP_SIDE']});}_createCommentsArchiveButton(_0x2f1ce4,_0x57f6e5=!0x1){const _0x304f70=this['editor']['locale'],_0x2fae27=this['editor']['plugins']['get']('Dialog'),_0x457361=new _0x2f1ce4(_0x304f70);return _0x457361['bind']('isEnabled')['to'](this,'isEnabled'),_0x457361['bind']('isOn')['to'](_0x2fae27,'id',_0x469b99=>'commentsArchive'===_0x469b99),_0x457361['set']({'label':Pt(_0x304f70,'COMMENTS_ARCHIVE'),'icon':_0x4953e0,'isToggleable':!0x0}),_0x57f6e5&&(_0x457361['tooltip']=!0x0),this['listenTo'](_0x457361,'execute',()=>this['_toggleDialog']()),_0x457361;}_hideDialogOnAnnotationEscape=_0x54ce03=>{const _0x61c684=_0x54ce03['source'];if(!this['annotationViews']['has'](_0x61c684['view']))return;const _0x53e99b=this['editor']['plugins']['get']('Dialog');_0x53e99b['isOpen']&&'commentsArchive'===_0x53e99b['id']&&(_0x53e99b['hide'](),_0x54ce03['stop']());};},qe=class extends _0x1a85c9{static get requires(){return[fe,be,Oe,Ye,Xe,Me,He,Fe,We];}static get['pluginName'](){return'Comments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{_e as AddCommentThreadCommand,ne as Annotation,re as AnnotationCollection,Ue as AnnotationCounterButtonView,ie as AnnotationView,ce as Annotations,Le as AnnotationsSidebarItemView,Se as AnnotationsSidebarView,Re as AnnotationsUIs,jt as BaseCommentThreadView,Qt as BaseCommentView,we as Comment,pe as CommentThread,St as CommentThreadController,Ft as CommentThreadInputView,zt as CommentThreadView,te as CommentView,qe as Comments,Ye as CommentsArchive,Xe as CommentsArchiveUI,be as CommentsEditing,Kt as CommentsListView,Me as CommentsOnly,fe as CommentsRepository,Oe as CommentsUI,Ae as EditorAnnotations,We as InlineAnnotations,Fe as NarrowSidebar,De as Sidebar,He as WideSidebar,he as bindAnnotationCollections};
|
|
23
|
+
import{Command as _0x4df77b,Context as _0x30407b,ContextPlugin as _0x1dc739,Editor as _0x5ac7c6,PendingActions as _0x4a9301,Plugin as _0x327214}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x3a2101,Collection as _0x1b9c8e,DomEmitterMixin as _0x535847,FocusTracker as _0x564482,KeystrokeHandler as _0x26c931,ObservableMixin as _0x503b6d,Rect as _0x189269,ResizeObserver as _0x2be476,containsNode as _0x5356cd,diff as _0x29befc,first as _0x140f7a,getActiveElement as _0x12b741,getEnvKeystrokeText as _0x1305f5,getOverlayMountRoot as _0x2fc285,keyCodes as _0x1bc182,priorities as _0x44687d,scrollViewportToShowTarget as _0x472ecb,toUnit as _0x208053,trustedHtml as _0x3bd6cb,uid as _0x3370ee}from'@ckeditor/ckeditor5-utils';import{AriaDescriptionView as _0x1e4c22,ConfirmMixin as _0x19ef51,FOCUS_ANNOTATION_KEYSTROKE as _0x381db6,LateFocusButtonView as _0x260d0d,LateFocusDropdownButtonView as _0x133f9f,UserView as _0x3a6df2,Users as _0x2fb247,getAllMarkersDomElementsSorted as _0x316fd2,getDateTimeFormatter as _0x3c5a7b,hashObject as _0x7ad685,setupThreadKeyboardNavigation as _0x3bc21c,surroundingMarkersDetector as _0x503f3d,trimHtml as _0x43dd06}from'@ckeditor/ckeditor5-collaboration-core';import{cloneDeep as _0x56b638,debounce as _0x42d68c,isEqual as _0x40e030,set as _0x1d593d,throttle as _0x340290,unset as _0x40f5d1}from'es-toolkit/compat';import{IconAddComment as _0x301fc7,IconCheck as _0x19c124,IconComments as _0xdbccf,IconCommentsArchive as _0x2d2432,IconDropdownArrow as _0x1e7317,IconPencil as _0x343650,IconRemoveComment as _0x4414cd,IconThreeVerticalDots as _0x5cf0b3,IconTrackChanges as tt,IconUndo as et,IconUnlink as it}from'@ckeditor/ckeditor5-icons';import{BalloonPanelView as st,ButtonView as nt,ContextualBalloon as ot,Dialog as rt,DialogViewPosition as ht,EditorUI as at,EditorUIView as ct,FocusCycler as dt,IconView as lt,InlineEditableUIView as mt,ListItemView as ut,ListView as ft,MenuBarMenuListItemButtonView as pt,OverlayHost as _t,View as wt,ViewCollection as gt,clickOutsideHandler as At,createDropdown as vt,focusChildOnDropdownOpen as Tt}from'@ckeditor/ckeditor5-ui';import{MouseObserver as yt,disableViewPlaceholder as Ct,enableViewPlaceholder as It}from'@ckeditor/ckeditor5-engine';import{Clipboard as bt,ClipboardMarkersUtils as Et,ClipboardPipeline as kt}from'@ckeditor/ckeditor5-clipboard';import{Enter as Nt,ShiftEnter as Ot}from'@ckeditor/ckeditor5-enter';import{SelectAll as Mt}from'@ckeditor/ckeditor5-select-all';import{Typing as Rt}from'@ckeditor/ckeditor5-typing';import{Undo as xt}from'@ckeditor/ckeditor5-undo';import{Paragraph as St}from'@ckeditor/ckeditor5-paragraph';import{toWidget as Pt}from'@ckeditor/ckeditor5-widget';const Lt=/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x503b6d();var Dt=class extends Lt{['model'];['view'];constructor(_0x354d3a,_0xdd0644){super(),this['model']=_0x354d3a,this['model']['_isAttached']=!0x0,this['view']=_0xdd0644,this['listenTo'](_0xdd0644,'submitCommentThread',()=>this['submit']()),this['listenTo'](_0xdd0644,'removeCommentThread',()=>this['remove']()),this['listenTo'](_0xdd0644,'resolveCommentThread',()=>this['resolve']()),this['listenTo'](_0xdd0644,'reopenCommentThread',()=>this['reopen']()),this['listenTo'](_0xdd0644,'addComment',(_0x3da9d0,_0x1fb8bf)=>this['addComment'](_0x1fb8bf)),this['listenTo'](_0xdd0644,'updateComment',(_0x574e5d,_0x2860c9,_0x4f466f)=>this['updateComment'](_0x2860c9,_0x4f466f)),this['listenTo'](_0xdd0644,'removeComment',(_0x4d68ff,_0xf16fe9)=>this['removeComment'](_0xf16fe9));}submit(){this['model']['submit']();}['remove'](){this['model']['remove']();}['resolve'](){this['model']['isResolved']||this['model']['resolve']();}['reopen'](){this['model']['isResolved']&&this['model']['reopen']();}addComment(_0x539a8b){this['model']['addComment']({'content':_0x539a8b,'authorId':this['view']['_localUser']['id']});}updateComment(_0xa14bcb,_0x496174){this['model']['getComment'](_0xa14bcb)['update']({'content':_0x496174});}removeComment(_0x572775){this['model']['getComment'](_0x572775)['remove']();}destroy(){this['stopListening'](),this['model']['_isAttached']=!0x1;}};function Vt(_0x3b720e,_0x483dc0,_0x1bf5f3){const t=_0x3b720e['t'];switch(_0x483dc0){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'},_0x1bf5f3);case'THREAD_CONTEXT_UNLINKED_LABEL':return t({'string':'Thread\x20context\x20removed\x20from\x20the\x20document:\x20%0','id':'THREAD_CONTEXT_UNLINKED_LABEL'},_0x1bf5f3);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'},_0x1bf5f3);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'},_0x1bf5f3);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'},_0x1bf5f3);case'NUMBER_OF_COMMENTS':return t({'string':'Show\x20%0\x20comment','plural':'Show\x20%0\x20comments','id':'NUMBER_OF_COMMENTS'},_0x1bf5f3);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'},_0x1bf5f3);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'},_0x1bf5f3);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'},_0x1bf5f3);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 Bt=class extends ct{['main'];editable;constructor(_0x2d5490,_0x4fa87a){super(_0x2d5490);const _0x2ba559=_0x3370ee();this['main']=this['createCollection'](),this['editable']=new mt(_0x2d5490,_0x4fa87a,void 0x0,{'label':()=>Vt(_0x2d5490,'Comment\x20editor')}),this['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-editor','ck-rounded-corners','ck-comment__input'],'dir':_0x2d5490['uiLanguageDirection'],'lang':_0x2d5490['uiLanguage'],'aria-labelledby':'cke-editor__aria-label_'+_0x2ba559},'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']();}},Ht=class extends at{['view'];constructor(_0x1436ee){super(_0x1436ee),this['view']=new Bt(_0x1436ee['locale'],_0x1436ee['editing']['view']);}get element(){return this['view']['element'];}init(){const _0x14782d=this['editor']['editing']['view'],_0x4b0f05=this['view']['editable'];_0x4b0f05['name']=_0x14782d['document']['getRoot']()['rootName'],this['view']['render']();const _0x383d14=_0x4b0f05['element'];this['setEditableElement'](_0x4b0f05['name'],_0x383d14),this['view']['editable']['bind']('isFocused')['to'](this['focusTracker']),_0x14782d['attachDomRoot'](_0x383d14),this['fire']('ready');}destroy(){super['destroy'](),this['view']['destroy']();}};const Ut=[bt,Nt,Ot,Mt,Rt,xt,St],Ft=/* #__PURE__ -- @preserve */
|
|
25
|
+
_0x503b6d(_0x5ac7c6);var Wt=class CommentEditor extends Ft{static defaultPlugins=/* #__PURE__ -- @preserve */
|
|
26
|
+
((()=>Ut)());constructor(_0x5c8f88={}){(_0x5c8f88=Object['assign']({},_0x5c8f88))['plugins']||(_0x5c8f88['plugins']=CommentEditor['defaultPlugins']),super(_0x5c8f88),this['ui']=new Ht(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 _0x5dde43=this['config']['get']('initialData')||'';return this['initPlugins']()['then'](()=>this['ui']['init']())['then'](()=>this['data']['init'](_0x5dde43))['then'](()=>this['fire']('ready'));}destroy(){return super['destroy']()['then'](()=>this['ui']['destroy']());}['focus'](){this['model']['change'](_0x3c4634=>{const _0x4d089a=this['model']['document']['getRoot'](),_0x31180e=_0x4d089a&&_0x4d089a['getChild'](_0x4d089a['childCount']-0x1);_0x3c4634['setSelection'](_0x31180e,'end'),this['editing']['view']['focus']();});}_updatePlaceholder(){const _0x3769df=this['editing']['view'],_0x1ea828=_0x3769df['document']['getRoot'](),_0x270e7b=_0x1ea828['getChild'](0x0);_0x1ea828['childCount']>0x1||!_0x270e7b||'p'!=_0x270e7b['name']?this['placeholderElement']&&this['placeholderElement']['placeholder']&&(Ct(_0x3769df,this['placeholderElement']),this['placeholderElement']=void 0x0):(this['placeholder']&&(_0x270e7b['placeholder']=this['placeholder']),It({'view':_0x3769df,'element':_0x270e7b,'keepOnFocus':!0x0}),this['placeholderElement']=_0x270e7b);}},Kt=class extends wt{keystrokes;['focusTracker'];['focusables'];['focusCycler'];submitButtonView;cancelButtonView;_editorConfig;constructor(_0x1dbd08,_0x3d4bba={}){super(_0x1dbd08),this['editor']=null,this['_editorConfig']=_0x3d4bba,this['set']('value',_0x3d4bba['initialData']||''),this['set']('disabledSubmit',!0x1),this['set']('showButtons',!0x0),this['set']('placeholder',Vt(_0x1dbd08,'Reply...')),this['set']('submitLabel',Vt(_0x1dbd08,'Reply')),this['submitButtonView']=this['_createSubmitButton'](),this['cancelButtonView']=this['_createCancelButton'](),this['focusables']=this['createCollection']([this['cancelButtonView'],this['submitButtonView']]),this['keystrokes']=new _0x26c931(),this['focusTracker']=new _0x564482(),this['focusCycler']=new dt({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0xed86a9=>!_0xed86a9['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['cancelButtonView'],this['submitButtonView']]}]}),this['keystrokes']['set']('Esc',(_0x459c64,_0x154ccd)=>{this['cancelButtonView']['fire']('execute'),_0x154ccd();}),this['keystrokes']['set']('Ctrl+Enter',(_0x19b11f,_0xfd2066)=>{this['submitButtonView']['isEnabled']&&(this['submitButtonView']['fire']('execute'),_0xfd2066());}),this['on']('submit',(_0x8c64be,_0x55e2b4)=>{_0x55e2b4['length']>0xfde8?(alert(Vt(_0x1dbd08,'TOO_LONG_COMMENT_ALERT',[_0x55e2b4['length'],0xfde8])),_0x8c64be['stop']()):this['editor']['setData']('');},{'priority':'high'});}['render'](){super['render'](),this['_setupKeyboardNavigation']();}createEditor(){return this['editor']||(this['editor']=new Wt(this['_editorConfig']),this['_editorCreationPromise']=this['editor']['create']()['then'](()=>{if(this['_isDestroyed'])return;const _0xcd8429=this['editor'];this['element']['insertBefore'](_0xcd8429['ui']['element'],this['element']['firstChild']),_0xcd8429['model']['document']['on']('change',()=>this['value']=_0xcd8429['getData']()),_0xcd8429['bind']('placeholder')['to'](this),this['focusables']['add'](_0xcd8429['ui']['view'],0x0),this['fire']('editorReady',this['editor']);})),this['_editorCreationPromise'];}['focus'](_0x452e01){-0x1===_0x452e01?(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:_0x4e492b}=this,_0x265aa3=new nt(_0x4e492b);return _0x265aa3['extendTemplate']({'attributes':{'class':['ck-button-action','ck-button_small','ck-comment__input-actions--submit']}}),_0x265aa3['withText']=!0x0,_0x265aa3['bind']('label')['to'](this,'submitLabel'),_0x265aa3['on']('execute',()=>{this['fire']('submit',this['value']);}),_0x265aa3['bind']('isEnabled')['to'](this,'value',this,'disabledSubmit',(_0x24169a,_0x365803)=>!_0x365803&&!!_0x24169a['trim']()),_0x265aa3;}_createCancelButton(){const {locale:_0x259dc6}=this,_0x5d107e=new nt(_0x259dc6);return _0x5d107e['extendTemplate']({'attributes':{'class':['ck-button_small','ck-comment__input-actions--cancel']}}),_0x5d107e['label']=Vt(_0x259dc6,'Cancel'),_0x5d107e['withText']=!0x0,_0x5d107e['on']('execute',()=>{this['editor']['setData'](''),this['fire']('cancel');}),_0x5d107e;}_setupKeyboardNavigation(){this['keystrokes']['listenTo'](this['element']),this['focusables']['forEach'](_0x527177=>{this['focusTracker']['add'](_0x527177['element']);}),this['focusables']['on']('change',(_0x230c1f,_0x197cf8)=>{for(const _0x214281 of Array['from'](_0x197cf8['added'])['reverse']())this['focusTracker']['add'](_0x214281['element']);});}},Gt=class extends wt{constructor(_0x1192f3,_0x16e5c5,_0x2cc2aa){super(_0x1192f3),this['commentInputView']=new Kt(_0x1192f3,_0x2cc2aa),this['focusCycler']=this['commentInputView']['focusCycler'],this['commentInputView']['bind']('showButtons')['to'](this['commentInputView']['focusTracker'],'isFocused',this['commentInputView'],'value',(_0x1cadac,_0xb2d6fb)=>_0x1cadac||!!_0xb2d6fb),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 _0x3a6df2(_0x1192f3,_0x16e5c5),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'](_0x2cb037){this['commentInputView']['focus'](_0x2cb037);}_focusOnNonInteractiveMouseDown(){this['listenTo'](this['element'],'mousedown',(_0x4dd8b9,_0x1eebbf)=>{const {submitButtonView:_0x3b0189,cancelButtonView:_0x15f97d,editor:_0x1d568e}=this['commentInputView'];[_0x3b0189['element'],_0x15f97d['element'],_0x1d568e?_0x1d568e['editing']['view']['getDomRoot']():null]['filter'](_0x1fe760=>_0x1fe760)['some'](_0x407059=>_0x5356cd(_0x407059,_0x1eebbf['target']))||(this['focus'](),_0x1eebbf['preventDefault']());});}},Yt=class extends wt{revealButtonView;constructor(_0x378797){super(_0x378797),this['set']('count',void 0x0);const _0x227279=this['revealButtonView']=new nt(_0x378797);_0x227279['icon']=_0x1e7317,_0x227279['withText']=!0x0,_0x227279['bind']('label')['to'](this,'count',_0x58d918=>Vt(_0x378797,'NUMBER_OF_COMMENTS',_0x58d918)),_0x227279['extendTemplate']({'attributes':{'class':'ck-button_small'}}),this['setTemplate']({'tag':'li','attributes':{'class':'ck-thread__comment-count'},'children':[_0x227279]});}},Xt=class extends wt{commentViews;resolvedCommentView;['focusTracker'];keystrokes;['focusCycler'];['_model'];['_config'];_collapsedCommentsView;constructor(_0x9b5fff,_0x33a423,_0x5885f4){super(_0x9b5fff);const _0xb065ea=this['bindTemplate'];this['set']('hasDirtyComment',!0x1),this['set']('length',_0x33a423['comments']['length']),this['set']('isActive',!0x1),this['set']('isExpandedByUser',!0x1),this['_model']=_0x33a423,this['_config']=_0x5885f4,this['commentViews']=this['createCollection'](),this['visibleViews']=this['createCollection'](),this['resolvedCommentView']=null,this['focusTracker']=new _0x564482(),this['keystrokes']=new _0x26c931(),this['focusCycler']=new dt({'focusables':this['commentViews'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x57f283=>this['commentViews']['map'](_0x1b132a=>_0x1b132a['element'])['includes'](_0x57f283['target'])},'actions':{'focusPrevious':'arrowup','focusNext':'arrowdown'}}),this['_collapsedCommentsView']=new Yt(_0x9b5fff),this['_collapsedCommentsView']['bind']('count')['to'](this,'length',_0x54e8cb=>_0x54e8cb-this['_config']['maxCommentsWhenCollapsed']),this['listenTo'](this['_collapsedCommentsView']['revealButtonView'],'execute',()=>{this['isExpandedByUser']=!0x0;});for(const _0x79393f of _0x33a423['comments'])this['_handleNewCommentModel'](_0x79393f);this['_handleInfoComment'](),this['listenTo'](_0x33a423['comments'],'add',(_0x1a9759,_0x46688b)=>{const _0x48f9a2=this['_calculatePosition'](_0x46688b);this['length']++,this['_handleNewCommentModel'](_0x46688b,_0x48f9a2),this['refreshVisibleViews']();}),this['listenTo'](_0x33a423['comments'],'remove',(_0x38ac3b,_0x97c5a5)=>{this['length']--,this['_handleRemoveCommentModel'](_0x97c5a5),this['refreshVisibleViews']();}),this['listenTo'](_0x33a423,'commentUpdated',()=>this['refreshVisibleViews']()),this['listenTo'](_0x33a423,'change:isResolved',()=>this['_handleInfoComment']()),this['on']('change:isActive',(_0x2bdb68,_0x2e45a5,_0x3b2cff)=>{_0x3b2cff||(this['isExpandedByUser']=!0x1),this['refreshVisibleViews']();}),this['on']('change:hasDirtyComment',()=>this['refreshVisibleViews']()),this['on']('change:isExpandedByUser',()=>this['refreshVisibleViews']()),this['setTemplate']({'tag':'ul','attributes':{'class':['ck-thread__comments',_0xb065ea['if']('length','ck-hidden',_0xa960d=>!_0xa960d)],'aria-label':Vt(_0x9b5fff,'Thread\x20comments')},'children':this['visibleViews']});}get['_shouldCollapse'](){return this['_model']['weight']>this['_config']['maxThreadTotalWeight']&&!this['isActive']&&!this['hasDirtyComment']&&!this['isExpandedByUser'];}['render'](){super['render'](),this['refreshVisibleViews'](),this['_setupKeyboardNavigation']();}['focus'](_0x3d12f7){-0x1===_0x3d12f7?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}destroy(){this['_collapsedCommentsView']['destroy']();for(const _0x4c49a3 of this['commentViews'])_0x4c49a3['destroy']();super['destroy']();}['refreshVisibleViews'](){this['_shouldCollapse']?this['_rearrangeCollapse']():this['_rearrangeExpand']();}_handleNewCommentModel(_0x23b6b2,_0x1cc0b7){const _0x24722d=new this['_config']['CommentView'](this['locale'],_0x23b6b2,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig']});_0x24722d['viewUid']=_0x23b6b2['id'],_0x24722d['delegate']('removeComment')['to'](this),_0x24722d['delegate']('updateComment')['to'](this),_0x24722d['delegate']('resolveCommentThread')['to'](this),_0x24722d['delegate']('editorReady')['to'](this),_0x24722d['delegate']('editorDestroyed')['to'](this),this['listenTo'](_0x24722d,'change:isEditMode',()=>this['_updateHasDirtyComment']()),this['commentViews']['add'](_0x24722d,_0x1cc0b7);}_calculatePosition(_0x27c667){const _0x81f895=this['_model']['_findOptimalIndex'](_0x27c667);return this['resolvedCommentView']?this['resolvedCommentView']['authoredAt']>_0x27c667['authoredAt']?_0x81f895-0x1:_0x81f895:_0x81f895-0x1;}_handleInfoComment(){if(this['_model']['resolvedBy']&&this['_model']['resolvedAt']){const _0x5f1fd2={'id':'resolved','author':this['_model']['resolvedBy'],'authoredAt':this['_model']['resolvedAt'],'content':Vt(this['locale'],'Marked\x20as\x20resolved'),'attributes':{}};this['resolvedCommentView']=new this['_config']['CommentView'](this['locale'],_0x5f1fd2,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig'],'isSystemComment':!0x0}),this['commentViews']['add'](this['resolvedCommentView'],this['_model']['_findOptimalIndex'](_0x5f1fd2));}else this['resolvedCommentView']&&(this['commentViews']['remove'](this['resolvedCommentView']),this['resolvedCommentView']['destroy'](),this['resolvedCommentView']=null);this['refreshVisibleViews']();}_handleRemoveCommentModel(_0x4861e1){const _0x3f52af=this['commentViews']['remove'](_0x4861e1['id']);this['stopListening'](_0x3f52af),_0x3f52af['isEditMode']&&this['_updateHasDirtyComment'](),_0x3f52af['destroy']();}_updateHasDirtyComment(){this['hasDirtyComment']=Array['from'](this['commentViews'])['some'](_0x56e65e=>_0x56e65e['isEditMode']);}['_rearrangeCollapse'](){const _0x3d6dac=function(_0x44fa8d){const _0x45c15e=new _0x1b9c8e();for(const _0x4d85fe of _0x44fa8d)_0x45c15e['add'](_0x4d85fe);return _0x45c15e;}(this['commentViews']),_0x3ebc4c=this['_collapsedCommentsView']['count'];for(let _0x137738=0x1;_0x137738<=_0x3ebc4c;_0x137738++)_0x3d6dac['remove'](0x1);for(const _0x14434a of _0x3d6dac)_0x14434a['collapse']();_0x3ebc4c>0x0&&_0x3d6dac['add'](this['_collapsedCommentsView'],0x1),qt(_0x29befc(Array['from'](this['visibleViews']),Array['from'](_0x3d6dac)),this['visibleViews'],_0x3d6dac);}['_rearrangeExpand'](){const _0x2e9704=this['_collapsedCommentsView']['revealButtonView']['element'],_0x14b71e=!!_0x2e9704&&_0x2e9704['contains'](_0x12b741(_0x2e9704));qt(_0x29befc(Array['from'](this['visibleViews']),Array['from'](this['commentViews'])),this['visibleViews'],this['commentViews']);for(const _0x48c491 of this['visibleViews'])_0x48c491['expand']();_0x14b71e&&this['commentViews']['get'](0x1)['focus']();}_setupKeyboardNavigation(){this['commentViews']['forEach'](_0x15ca01=>{this['focusTracker']['add'](_0x15ca01['element']),this['keystrokes']['listenTo'](_0x15ca01['element']);}),this['commentViews']['on']('change',(_0x2aa8a4,_0x12259f)=>{for(const _0xcb2712 of _0x12259f['removed'])this['focusTracker']['remove'](_0xcb2712['element']),this['keystrokes']['stopListening'](_0xcb2712['element']);for(const _0x5cfc32 of Array['from'](_0x12259f['added'])['reverse']())this['focusTracker']['add'](_0x5cfc32['element']),this['keystrokes']['listenTo'](_0x5cfc32['element']);});const _0x5d26f8=_0x17c2a3=>{const _0x85c503=this['_collapsedCommentsView']['revealButtonView']['element'];_0x85c503&&(_0x17c2a3?(this['focusTracker']['add'](_0x85c503),this['keystrokes']['listenTo'](_0x85c503)):(this['focusTracker']['remove'](_0x85c503),this['keystrokes']['stopListening'](_0x85c503)));};this['listenTo'](this['visibleViews'],'add',(_0x4b1002,_0xe47736)=>{_0xe47736===this['_collapsedCommentsView']&&_0x5d26f8(!0x0);}),this['listenTo'](this['visibleViews'],'remove',(_0x1929b5,_0xdadde3)=>{_0xdadde3===this['_collapsedCommentsView']&&_0x5d26f8(!0x1);}),this['visibleViews']['has'](this['_collapsedCommentsView'])&&_0x5d26f8(!0x0);}};function qt(_0x578766,_0x5ae8d0,_0x4d25d4){let _0x45a574=0x0;for(const _0x4284a1 of _0x578766)switch(_0x4284a1){case'insert':_0x5ae8d0['add'](_0x4d25d4['get'](_0x45a574),_0x45a574),_0x45a574++;break;case'delete':_0x5ae8d0['remove'](_0x45a574);break;case'equal':_0x45a574++;}}function $t(_0x9bab0f,_0x143d7c=0x96){const _0x369ee2=_0x143d7c-0x1;if(_0x9bab0f['length']<_0x143d7c)return _0x9bab0f;const _0x30a619=_0x9bab0f['lastIndexOf']('\x20',_0x369ee2);return _0x9bab0f['substring'](0x0,_0x30a619>-0x1?_0x30a619:_0x369ee2)+'…';}var jt=class extends wt{constructor(_0x3ece6a){super(_0x3ece6a);const _0x34f376=this['bindTemplate'];this['set']('contextValue',''),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-context__value'],'aria-label':_0x34f376['to']('contextValue',_0x44135d=>Vt(_0x3ece6a,'THREAD_CONTEXT_LABEL',_0x44135d)),'tabindex':-0x1},'children':[{'text':_0x34f376['to']('contextValue')}]});}['focus'](){this['element']['focus']();}},zt=class extends wt{['_model'];reopenButtonView;contextView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];constructor(_0x11053c,_0x1e98f3){super(_0x11053c);const _0x3eb18d=this['bindTemplate'];this['_model']=_0x1e98f3,this['reopenButtonView']=this['_createReopenButton'](),this['contextView']=this['_createContextView'](),this['focusables']=this['createCollection']([this['contextView'],this['reopenButtonView']]),this['focusTracker']=new _0x564482(),this['keystrokes']=new _0x26c931(),this['focusCycler']=new dt({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['bind']('hasContext')['to'](this['_model'],'context',_0x2dd3f6=>!!_0x2dd3f6),this['bind']('contextValue')['to'](this['_model'],'context',_0x5decfc=>_0x5decfc&&_0x5decfc['value']?$t(_0x5decfc['value']):Vt(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',_0x3eb18d['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 _0xfb7f5d=new nt(this['locale']);return _0xfb7f5d['label']=Vt(this['locale'],'Reopen'),_0xfb7f5d['tooltip']=Vt(this['locale'],'Reopen'),_0xfb7f5d['icon']=et,_0xfb7f5d['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x32a0cc=>!_0x32a0cc),_0xfb7f5d['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x1bd281,_0x1f4526)=>_0x1bd281&&_0x1f4526),_0xfb7f5d['on']('execute',()=>{this['fire']('reopenCommentThread',this['_model']['id']);}),_0xfb7f5d;}_attachContextActions(){const _0x2a34bb=this['element']['querySelector']('.ck-context'),_0x40d64a=_0x2a34bb['querySelector']('.ck-context__value');this['listenTo'](_0x2a34bb,'mouseenter',()=>{_0x40d64a['offsetWidth']<_0x40d64a['scrollWidth']&&_0x2a34bb['classList']['add']('overlay');}),this['listenTo'](_0x2a34bb,'mouseleave',()=>{_0x2a34bb['classList']['remove']('overlay');});}_setupKeyboardNavigation(){this['keystrokes']['listenTo'](this['element']);for(const _0x5be126 of this['focusables'])this['focusTracker']['add'](_0x5be126['element']),this['keystrokes']['listenTo'](_0x5be126['element']);}_createContextView(){const _0x9510cb=new jt(this['locale']);return _0x9510cb['bind']('contextValue')['to'](this),_0x9510cb;}},Jt=class extends wt{['_model'];['_config'];commentThreadHeaderView;commentThreadInputView;ariaDescriptionView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];constructor(_0x98e99,_0x32596d,_0x5e334a,_0x41d454){super(_0x98e99),this['set']('isActive',!0x1),this['set']('isDirty',!0x1),this['_model']=_0x32596d,this['_localUser']=_0x5e334a,this['_config']=_0x41d454,this['commentThreadHeaderView']=new zt(_0x98e99,_0x32596d),this['commentThreadHeaderView']['delegate']('reopenCommentThread')['to'](this),this['ariaDescriptionView']=new _0x1e4c22(_0x98e99,Vt(_0x98e99,'COMMENT_THREAD_DESCRIPTION')),this['listenTo'](this,'reopenCommentThread',()=>{this['focus']();}),this['commentsListView']=new Xt(_0x98e99,_0x32596d,Object['assign']({'CommentView':this['_config']['CommentView']},_0x41d454)),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',(_0x3afbf9,_0xa4219)=>_0x3afbf9||!!_0xa4219),this['bind']('isUnlinked')['to'](_0x32596d,'unlinkedAt',_0x22071f=>!!_0x22071f);let _0x562d3b=null;const _0x34c53b=()=>{const _0x13cbff=this['_model']['comments']['first']||null;_0x13cbff!==_0x562d3b&&(_0x562d3b&&this['stopListening'](_0x562d3b,'change:content'),_0x562d3b=_0x13cbff,_0x13cbff&&this['listenTo'](_0x13cbff,'change:content',_0x34c53b));const _0x5a3056=_0x13cbff?_0x13cbff['author']['name']:this['_localUser']['name'],_0x18d89b=_0x13cbff?new DOMParser()['parseFromString'](_0x3bd6cb(_0x43dd06(_0x13cbff['content'],{'limit':this['_config']['maxCommentCharsWhenCollapsed']})),'text/html')['body']['textContent']:'',_0x5d78e8=Vt(this['locale'],'COMMENT_THREAD_LABEL',[this['length'],_0x5a3056]);this['set']('ariaLabel',_0x18d89b?_0x5d78e8+'\x20'+_0x18d89b:_0x5d78e8);};this['listenTo'](this['_model']['comments'],'change',_0x34c53b),_0x34c53b(),this['focusables']=this['createCollection']([this['commentsListView'],this['commentThreadInputView']]),this['focusTracker']=new _0x564482(),this['keystrokes']=new _0x26c931(),this['focusCycler']=new dt({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0xe84f56=>_0xe84f56['target']!==this['element']},'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}});}['focus'](){this['element']['focus']();}['render'](){super['render'](),_0x3bc21c(this,this['focusables']);}async destroy(){this['isDirty']=!0x1,this['commentsListView']['destroy'](),this['commentThreadHeaderView']['destroy'](),await this['commentThreadInputView']['destroy'](),super['destroy']();}_createCommentThreadInputView(){const _0x130448=new Gt(this['locale'],this['_localUser'],this['_config']['editorConfig']),_0x478db9=_0x130448['commentInputView'];return _0x130448['bind']('showInput')['to'](this,'isActive',this['_model'],'isReadOnly',this['_model'],'canComment',this['_model'],'archivedAt',_0x478db9,'value',(_0x30c47b,_0x355937,_0x414c51,_0x2a3533,_0x44bf9b)=>!!_0x44bf9b||!!_0x2a3533&&_0x414c51&&!_0x355937||_0x30c47b&&_0x414c51&&!_0x355937),_0x478db9['bind']('placeholder')['to'](this,'length',this['_model'],'isResolvable',this['_model'],'isResolved',(_0xbba7fa,_0x39442d,_0x1e3714)=>{let _0x2b6eb8;return _0x2b6eb8=_0x1e3714&&_0x39442d?'Reply\x20to\x20reopen\x20discussion...':_0xbba7fa?'Reply...':'Write\x20a\x20comment...',Vt(this['locale'],_0x2b6eb8);}),_0x478db9['bind']('submitLabel')['to'](this,'length',_0x440e0d=>Vt(this['locale'],_0x440e0d?'Reply':'Comment')),_0x478db9['on']('submit',(_0x30b405,_0x152658)=>{this['fire']('addComment',_0x152658),this['_model']['isResolved']&&this['_model']['isResolvable']&&this['fire']('reopenCommentThread',this['_model']['id']),this['_model']['isSubmitted']||this['fire']('submitCommentThread');}),_0x478db9['on']('cancel',()=>{this['focus']();}),_0x478db9['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0x478db9['on']('cancel',_0x402dcc=>{0x0==this['length']&&(this['fire']('removeCommentThread'),_0x402dcc['stop']());}),this['on']('change:isActive',(_0x233d0f,_0x4e6aa4,_0x5eb8e4)=>{_0x5eb8e4||this['length']||_0x478db9['value']||this['fire']('removeCommentThread');}),_0x130448;}};const Qt=/* #__PURE__ -- @preserve */
|
|
27
|
+
_0x19ef51(Jt);var Zt=class extends Qt{commentThreadChildren;containerElement;resolveButton;reopenButton;_boundFirstCommentView;constructor(_0x4a7d06,_0x1b4a88,_0x574882,_0x110440){super(_0x4a7d06,_0x1b4a88,_0x574882,_0x110440),this['commentThreadChildren']=this['createCollection']([this['commentsListView'],this['commentThreadInputView'],this['ariaDescriptionView']]),this['set']('actionIndicator',null),this['containerElement']=null,this['_boundFirstCommentView']=null,this['locale']=_0x4a7d06,this['resolveButton']=this['_createResolveButton'](),this['reopenButton']=this['_createReopenButton'](),this['setTemplate'](this['getTemplate']()),this['on']('change:isActive',(_0x4667c7,_0x491ca9,_0x25a343)=>{_0x25a343||this['_cancelAllConfirms']();}),this['listenTo'](this['_model'],'change:isReadOnly',(_0x3df644,_0x35e928,_0x681ef3)=>{_0x681ef3&&this['_cancelAllConfirms']();}),this['length']>0x0&&this['_bindFirstCommentView'](),this['listenTo'](this['commentsListView']['commentViews'],'add',()=>{this['_bindFirstCommentView']();});}getTemplate(){const _0xc95eb8=this['bindTemplate'];return{'tag':'div','attributes':{'class':['ck','ck-thread','ck-reset_all-excluded','ck-rounded-corners',_0xc95eb8['if']('isActive','ck-thread--active'),_0xc95eb8['if']('isUnlinked','ck-thread--unlinked'),_0xc95eb8['to']('actionIndicator',_0x5cd6a7=>_0x5cd6a7?'ck-thread--'+_0x5cd6a7:'')],'data-thread-id':this['_model']['id'],'tabindex':0x0,'role':'listitem','aria-label':_0xc95eb8['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');}['_cancelAllConfirms'](){this['cancelConfirm']();for(const _0x17e1c5 of this['commentsListView']['commentViews'])_0x17e1c5['cancelConfirm']();}_bindFirstCommentView(){const {locale:_0x18b2f4}=this,_0x153f6d=this['commentsListView']['commentViews']['get'](0x0);_0x153f6d===this['_boundFirstCommentView']||_0x153f6d['isSystemComment']||(this['_boundFirstCommentView']=_0x153f6d,this['unbind']('actionIndicator'),this['bind']('actionIndicator')['to'](_0x153f6d,'actionIndicator',_0x47d262=>'remove'===_0x47d262?'remove':null),_0x153f6d['placeholder']=Vt(_0x18b2f4,'Write\x20a\x20comment...'),_0x153f6d['bind']('contextValue')['to'](this['_model'],'context',_0x26bb30=>_0x26bb30?'string'==typeof _0x26bb30['value']&&_0x26bb30['value']?$t(_0x26bb30['value']):Vt(_0x18b2f4,'Comment\x20was\x20made\x20on\x20an\x20element'):null),_0x153f6d['bind']('isThreadArchived')['to'](this['_model'],'archivedAt',_0x563cbf=>!!_0x563cbf),_0x153f6d['bind']('isThreadUnlinked')['to'](this['_model'],'unlinkedAt',_0x1ac11d=>!!_0x1ac11d),_0x153f6d['removeButton']['on']('execute',_0xcfd14c=>{_0xcfd14c['stop'](),this['showConfirm'](Vt(_0x18b2f4,'Delete\x20comment\x20thread?'),this['containerElement'])['then'](()=>{this['fire']('removeCommentThread');});},{'priority':'high'}),this['on']('removeConfirm',()=>{_0x153f6d['focus']();}),_0x153f6d['actionBar']['add'](this['reopenButton'],0x0),_0x153f6d['focusables']['add'](this['reopenButton'],0x0),_0x153f6d['actionBar']['add'](this['resolveButton'],0x0),_0x153f6d['focusables']['add'](this['resolveButton'],0x0));}_createResolveButton(){const _0x193b1d=new _0x260d0d(this['locale']);return _0x193b1d['label']=Vt(this['locale'],'Resolve'),_0x193b1d['tooltip']=Vt(this['locale'],'Resolve'),_0x193b1d['icon']=_0x19c124,_0x193b1d['extendTemplate']({'attributes':{'class':['ck-comment--resolve','ck-button_small']}}),_0x193b1d['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x1879f6=>!_0x1879f6),_0x193b1d['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x263de9,_0x13da90)=>_0x263de9&&!_0x13da90),_0x193b1d['on']('execute',()=>{this['fire']('resolveCommentThread',this['_model']['id']);}),_0x193b1d;}_createReopenButton(){const _0x4f5025=new _0x260d0d(this['locale']);return _0x4f5025['label']=Vt(this['locale'],'Reopen'),_0x4f5025['tooltip']=Vt(this['locale'],'Reopen'),_0x4f5025['icon']=et,_0x4f5025['extendTemplate']({'attributes':{'class':['ck-comment--reopen','ck-button_small']}}),_0x4f5025['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x3c1a5a=>!_0x3c1a5a),_0x4f5025['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x50f00f,_0x5cc3f7)=>_0x50f00f&&_0x5cc3f7),_0x4f5025['on']('execute',()=>{this['fire']('reopenCommentThread',this['_model']['id']);}),_0x4f5025;}},te=class extends wt{_contextUnlinkedIconView;_contextResizeObserver=null;constructor(_0x140e43){super(_0x140e43),this['set']('content',''),this['set']('contextValue',null),this['set']('isThreadArchived',!0x1),this['set']('isThreadUnlinked',!0x1),this['_contextUnlinkedIconView']=new lt(),this['_contextUnlinkedIconView']['content']=it,this['registerChild'](this['_contextUnlinkedIconView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck-content','ck-comment__content','ck-annotation__content']}});}['render'](){super['render'](),this['on']('change:content',()=>this['_renderContent']()),this['on']('change:contextValue',()=>this['_renderContent']()),this['on']('change:isThreadArchived',()=>this['_renderContent']()),this['on']('change:isThreadUnlinked',()=>this['_renderContent']()),this['_renderContent']();}destroy(){super['destroy'](),this['_destroyContextResizeObserver']();}_renderContent(){const _0x4ea0c7=this['element'];this['_destroyContextResizeObserver'](),_0x4ea0c7['innerHTML']=_0x3bd6cb(this['content']);const _0x1615a0=this['contextValue']?.['trim']();if(_0x1615a0){const _0x5e2c0f=document['createElement']('div'),_0x59bce5=document['createElement']('p');_0x5e2c0f['classList']['add']('ck-comment__context'),_0x59bce5['textContent']=_0x1615a0,_0x5e2c0f['append'](_0x59bce5),this['isThreadUnlinked']&&(_0x5e2c0f['classList']['add']('ck-comment__context_unlinked'),_0x5e2c0f['prepend'](this['_contextUnlinkedIconView']['element'])),_0x4ea0c7['prepend'](_0x5e2c0f),this['isThreadArchived']&&this['_attachContextTooltip'](_0x5e2c0f,_0x59bce5,_0x1615a0);}}_attachContextTooltip(_0x595d64,_0x5e0412,_0x12874f){_0x595d64['dataset']['ckeTooltipText']=_0x12874f,_0x595d64['dataset']['ckeTooltipClass']='ck-tooltip_multi-line\x20ck-comment__context-tooltip',_0x595d64['dataset']['ckeTooltipDisabled']='true',this['_contextResizeObserver']=new _0x2be476(_0x5e0412,()=>{_0x5e0412['scrollWidth']>_0x5e0412['clientWidth']?delete _0x595d64['dataset']['ckeTooltipDisabled']:_0x595d64['dataset']['ckeTooltipDisabled']='true';});}_destroyContextResizeObserver(){this['_contextResizeObserver']&&(this['_contextResizeObserver']['destroy'](),this['_contextResizeObserver']=null);}},ee=class extends wt{['visibleView'];ariaDescriptionView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];['_model'];['_config'];constructor(_0x4e0207,_0xc3a2d4,_0x6ade5d){super(_0x4e0207),this['_model']=_0xc3a2d4,this['_config']=_0x6ade5d,this['isSystemComment']=!!this['_config']['isSystemComment'],this['set']('isEditMode',!0x1),this['set']('isCollapsed',!0x0),this['set']('contextValue',null),this['set']('isThreadArchived',!0x1),this['set']('isThreadUnlinked',!0x1),this['bind']('ariaLabel')['to'](_0xc3a2d4,'content',_0xc3a2d4,'authoredAt',this,'contextValue',this,'isThreadUnlinked',(_0x3ceed4,_0x32f6d2,_0x125558,_0x2a42c7)=>{const _0x155d8c=new DOMParser()['parseFromString'](_0x3bd6cb(_0x3ceed4),'text/html')['body']['textContent'],_0x352596=Vt(_0x4e0207,'COMMENT_ARIA_LABEL',[_0xc3a2d4['author']['name'],_0x6ade5d['formatDateTime'](_0x32f6d2),_0x155d8c,_0xc3a2d4['isExternal']?this['getExternalCommentNote']():'']),_0x1a1634=_0x125558?.['trim']();if(!_0x1a1634)return _0x352596;const _0xc8e208=Vt(_0x4e0207,_0x2a42c7?'THREAD_CONTEXT_UNLINKED_LABEL':'THREAD_CONTEXT_LABEL',_0x1a1634);return _0x352596['trimEnd']()['replace'](/\.$/,'')+'.\x20'+_0xc8e208;}),this['ariaDescriptionView']=new _0x1e4c22(_0x4e0207,Vt(_0x4e0207,'COMMENT_THREAD_DESCRIPTION')),this['visibleView']=this['createCollection'](),this['visibleView']['add'](this['_createCommentContentView']()),this['focusables']=new gt(),this['focusTracker']=new _0x564482(),this['keystrokes']=new _0x26c931(),this['focusCycler']=new dt({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x3a7755=>_0x3a7755['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']?Vt(this['locale'],'EXTERNAL_IMPORT_WORD_COMMENT'):Vt(this['locale'],'EXTERNAL_COMMENT');}getUserViewNotificationText(){return this['_model']['isExternal']?'importWord'===this['_model']['attributes']['@external']['source']?Vt(this['locale'],'EXTERNAL_IMPORT_WORD_AVATAR',this['_model']['creator']['name']):Vt(this['locale'],'EXTERNAL_AVATAR',this['_model']['creator']['name']):null;}_createCommentContentView(){const _0x3df9a7=new te(this['locale']);return _0x3df9a7['bind']('contextValue','isThreadArchived','isThreadUnlinked')['to'](this),_0x3df9a7['bind']('content')['to'](this['_model'],'content',this,'isCollapsed',(_0x17fdd9,_0x315647)=>_0x315647?_0x43dd06(_0x17fdd9,{'limit':this['_config']['maxCommentCharsWhenCollapsed']}):_0x17fdd9),_0x3df9a7;}_createCommentInputView(){this['_config']['editorConfig']||(this['_config']['editorConfig']={}),this['_config']['editorConfig']['initialData']=this['_model']['content'];const _0x4d2a11=new Kt(this['locale'],this['_config']['editorConfig']);return _0x4d2a11['value']=this['_model']['content'],_0x4d2a11['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0x4d2a11['submitLabel']=Vt(this['locale'],'Save'),_0x4d2a11['on']('submit',(_0x5f042b,_0x12fb14)=>{this['fire']('updateComment',this['_model']['id'],_0x12fb14),this['switchToDisplayMode'](),this['focus']();}),_0x4d2a11['on']('cancel',()=>{this['switchToDisplayMode'](),this['focus']();}),_0x4d2a11['once']('editorReady',()=>{_0x4d2a11['focus']();}),_0x4d2a11['createEditor'](),_0x4d2a11['delegate']('editorReady')['to'](this),_0x4d2a11['delegate']('editorDestroyed')['to'](this),_0x4d2a11;}_setupKeyboardNavigation(){const _0x156d1a=this['element'];this['keystrokes']['listenTo'](_0x156d1a);for(const _0x101b41 of this['focusables'])this['focusTracker']['add'](_0x101b41['element']),this['keystrokes']['listenTo'](_0x101b41['element']);this['focusables']['on']('change',(_0x4f8965,_0x2b9342)=>{for(const _0x366cba of _0x2b9342['removed'])this['focusTracker']['remove'](_0x366cba['element']),this['keystrokes']['stopListening'](_0x366cba['element']);for(const _0x4e8c01 of _0x2b9342['added'])this['focusTracker']['add'](_0x4e8c01['element']),this['keystrokes']['listenTo'](_0x4e8c01['element']);}),this['keystrokes']['set']('enter',(_0x5d8ccf,_0x1a66c6)=>{_0x156d1a===_0x5d8ccf['target']&&(this['focusCycler']['focusFirst'](),_0x1a66c6());}),this['keystrokes']['set']('esc',(_0x13a207,_0x51309e)=>{_0x156d1a!==_0x13a207['target']&&(this['focus'](),_0x51309e());});}};const ie=/* #__PURE__ -- @preserve */
|
|
28
|
+
_0x19ef51(ee);var se=class extends ie{actionBar;['userView'];constructor(_0x42fbb4,_0x291bc8,_0x4b7c4a){super(_0x42fbb4,_0x291bc8,_0x4b7c4a),this['set']('actionIndicator',null),this['set']('placeholder',Vt(_0x42fbb4,'Reply...')),this['bind']('authoredAt')['to'](_0x291bc8),this['bind']('resolvedAt')['to'](_0x291bc8),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 _0x3a6df2(_0x42fbb4,_0x291bc8['author'],this['getUserViewNotificationText']()),this['userView']['extendTemplate']({'attributes':{'class':['ck-comment__user','ck-annotation__user'],'aria-hidden':!0x0}}),this['listenTo'](_0x291bc8,'change:isRemovable',()=>this['cancelConfirm']()),this['setTemplate'](this['getTemplate']());}getTemplate(){const _0x1f6a45=this['bindTemplate'],_0x5b31ca=[{'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']}},{'tag':'time','attributes':{'datetime':_0x1f6a45['to']('authoredAt'),'class':['ck-comment__info-time','ck-annotation__info-time']},'children':[{'text':_0x1f6a45['to']('authoredAt',_0x175c96=>this['_config']['formatDateTime'](_0x175c96))}]}]},{'tag':'div','attributes':{'class':['ck-comment__actions','ck-annotation__actions',_0x1f6a45['if']('isEditMode','ck-comment__actions--hidden'),_0x1f6a45['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']&&_0x5b31ca['push']({'tag':'div','attributes':{'class':['ck-comment__external']},'children':[{'text':this['getExternalCommentNote']()}]}),{'tag':'li','attributes':{'class':['ck-comment__wrapper'],'tabindex':-0x1,'aria-label':_0x1f6a45['to']('ariaLabel'),'aria-describedby':this['ariaDescriptionView']['id'],'role':'listitem'},'children':[{'tag':'div','attributes':{'class':['ck-comment','ck-annotation',_0x1f6a45['if']('isEditMode','ck-comment--edit'),_0x1f6a45['if']('isSystemComment','ck-comment--info'),_0x1f6a45['to']('actionIndicator',_0x470254=>_0x470254?'ck-comment--'+_0x470254:'')],'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':_0x5b31ca}]}]};}_createEditButton(){const _0x6383d7=new nt(this['locale']);return _0x6383d7['label']=Vt(this['locale'],'Edit'),_0x6383d7['icon']=_0x343650,_0x6383d7['withText']=!0x0,_0x6383d7['extendTemplate']({'attributes':{'class':'ck-comment--edit'}}),_0x6383d7['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x1b2502=>!_0x1b2502),_0x6383d7['bind']('isVisible')['to'](this['_model'],'isEditable'),_0x6383d7['on']('execute',()=>this['switchToEditMode']()),_0x6383d7;}_createRemoveButton(){const _0x2b9233=new nt(this['locale']);return _0x2b9233['label']=Vt(this['locale'],'Remove'),_0x2b9233['icon']=_0x4414cd,_0x2b9233['withText']=!0x0,_0x2b9233['extendTemplate']({'attributes':{'class':'ck-comment--remove'}}),_0x2b9233['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x1a20be=>!_0x1a20be),_0x2b9233['bind']('isVisible')['to'](this['_model'],'isRemovable'),_0x2b9233['on']('execute',()=>{this['showConfirm'](Vt(this['locale'],'Delete\x20comment?'),this['element'])['then'](()=>{this['fire']('removeComment',this['_model']['id']);});}),_0x2b9233;}_createDropdown(){const _0x40639c=vt(this['locale'],_0x133f9f),_0xb51a57=_0x40639c['panelView']['children'],_0x13fae5=new ft(this['locale']),_0x447230=_0x40639c['bindTemplate'];Tt(_0x40639c,()=>this['items']['find'](_0x284c9c=>_0x284c9c['isVisible'])),_0x40639c['extendTemplate']({'attributes':{'class':[_0x447230['if']('isVisible','ck-hidden',_0x24a0df=>!_0x24a0df)]}});const _0x40dca1=(_0x2d4e5b,_0x11189f=-0x1)=>{const _0x29743e=new ut(this['locale']);_0x29743e['children']['add'](_0x2d4e5b);const _0x372189=_0x11189f>-0x1?_0x11189f:_0x13fae5['items']['length'];_0x13fae5['items']['add'](_0x29743e,_0x372189);const _0x13af80=Array['from'](this['items']);_0x40639c['unbind']('isEnabled','isVisible'),_0x40639c['bind']('isEnabled')['toMany'](_0x13af80,'isEnabled',(..._0xfc62ed)=>_0xfc62ed['some'](_0x544f22=>_0x544f22)),_0x40639c['bind']('isVisible')['toMany'](_0x13af80,'isVisible',(..._0x205cad)=>_0x205cad['some'](_0x2f2f3a=>_0x2f2f3a));};_0x40639c['panelPosition']='sw',_0x40639c['buttonView']['set']({'label':Vt(this['locale'],'Show\x20more\x20items'),'icon':_0x5cf0b3}),_0x40639c['buttonView']['extendTemplate']({'attributes':{'class':'ck-button_small'}});for(const _0x4fb8b7 of this['items'])_0x40dca1(_0x4fb8b7);return _0xb51a57['add'](_0x13fae5),_0x40639c['listenTo'](this['items'],'add',(_0x267872,_0x54745e,_0x5d4af4)=>{_0x40dca1(_0x54745e,_0x5d4af4);}),_0x40639c['listenTo'](this['items'],'remove',(_0x3895c3,_0x48621b,_0x544fd7)=>{_0x13fae5['items']['remove'](_0x544fd7);}),_0x40639c;}_attachActions(_0x808ffe,_0xd70dae){const _0x4e264b=_0x808ffe&&_0x808ffe['element'];_0x4e264b&&(this['listenTo'](_0x4e264b,'mouseenter',()=>this['actionIndicator']=_0xd70dae),this['listenTo'](_0x4e264b,'focus',()=>this['actionIndicator']=_0xd70dae),this['listenTo'](_0x4e264b,'mouseleave',()=>this['actionIndicator']=null),this['listenTo'](_0x4e264b,'blur',()=>this['actionIndicator']=null));}_createCommentInputView(){const _0x3c8490=super['_createCommentInputView']();return _0x3c8490['bind']('placeholder')['to'](this),_0x3c8490;}['render'](){super['render'](),this['_attachActions'](this['editButton'],'edit'),this['_attachActions'](this['removeButton'],'remove');}};function ne(_0x54d574){const _0xd4728c=_0x340290(_0x54d574,0x1e),_0x4092bc=new MutationObserver(_0x1a89a9=>{for(const _0x264fea of _0x1a89a9)('attributes'==_0x264fea['type']&&'class'==_0x264fea['attributeName']||'childList'==_0x264fea['type']||'characterData'==_0x264fea['type'])&&_0xd4728c();});return{'attach'(_0x23deb7){_0x4092bc['observe'](_0x23deb7,{'attributes':!0x0,'childList':!0x0,'subtree':!0x0,'characterData':!0x0});},'detach'(){_0x4092bc['disconnect'](),_0xd4728c['cancel']();}};}var oe=class extends wt{['focusTracker'];['id'];keystrokes;content;['mainView'];_mutationObserver;constructor(_0x45958e,_0x540689){super(_0x45958e),this['id']=_0x3370ee(),this['focusTracker']=new _0x564482(),this['keystrokes']=new _0x26c931(),this['keystrokes']['set']('Esc',(_0xda9b91,_0x4cfaa5)=>this['fire']('Esc',_0x4cfaa5)),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']=ne(()=>this['_updateHeight']()),this['content']=this['createCollection'](),this['content']['delegate']('arrowup','arrowdown')['to'](this),this['content']['add'](_0x540689),this['mainView']=_0x540689;const _0x53f9d5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-annotation-wrapper','ck-rounded-corners',_0x53f9d5['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 _0x3aae21=this['element']['clientHeight'];_0x3aae21&&(this['height']=_0x3aae21);}};const re=/* #__PURE__ -- @preserve */
|
|
29
|
+
_0x503b6d();var he=class Annotation extends re{['view'];focusableElements;_type;_target;constructor({view:_0x51f81d,target:_0x47b448,type:_0x39e966,isVisible:_0x97f0c6=!0x0}){super(),this['view']=_0x51f81d,this['view']['element']||this['view']['render'](),this['_type']=_0x39e966,this['_target']=_0x47b448,Annotation['_assertCorrectTarget'](this['_getNormalizedTarget']()),this['focusableElements']=new _0x1b9c8e([this['view']['element']],{'idProperty':'_id'}),this['focusableElements']['on']('add',(_0x3d14c6,_0x2d1fce)=>{this['view']['focusTracker']['add'](_0x2d1fce);}),this['focusableElements']['on']('remove',(_0x354ce2,_0xc543a5)=>{this['view']['focusTracker']['remove'](_0xc543a5);}),this['set']('isVisible',_0x97f0c6);}get type(){return'function'==typeof this['_type']?this['_type']():this['_type'];}get['innerView'](){return this['view']['mainView'];}get target(){const _0x40558c=this['_getNormalizedTarget']();return Annotation['_assertCorrectTarget'](_0x40558c),_0x40558c;}get targetRect(){const _0x1bd18a=this['target'];if(null===_0x1bd18a)return null;if(_0x1bd18a instanceof _0x189269)return _0x1bd18a;const _0xe5ea62=_0x1bd18a['filter'](_0x325650=>function(_0x5bbe7b){return!!_0x5bbe7b['offsetParent']||!!_0x5bbe7b['getClientRects']()['item'](0x0);}(_0x325650));return 0x0===_0xe5ea62['length']?null:_0x189269['getDomElementRects'](_0xe5ea62[0x0])[0x0];}get isActive(){return this['view']['isActive'];}set isActive(_0x272f47){this['view']['isActive']=_0x272f47,this['view']['mainView']['isActive']=_0x272f47;}updateTargetRect(){this['view']['targetRect']=this['targetRect'];}destroy(){this['focusableElements']['stopListening'](),this['focusableElements']['clear'](),this['stopListening']();}refreshVisibility(){this['isVisible']=!!this['targetRect'];}static _assertCorrectTarget(_0x274bc7){if(!(null===_0x274bc7||_0x274bc7 instanceof _0x189269||Array['isArray'](_0x274bc7)&&_0x274bc7['every'](_0x3d34af=>ae(_0x3d34af))))throw new _0x3a2101('annotation-invalid-target',null,{'target':_0x274bc7});}_getNormalizedTarget(){const _0x3e7774='function'==typeof this['_target']?this['_target']():this['_target'];return ae(_0x3e7774)?[_0x3e7774]:_0x3e7774;}};function ae(_0x2fb0c0){return null!==_0x2fb0c0&&'object'==typeof _0x2fb0c0&&'nodeType'in _0x2fb0c0&&0x1===_0x2fb0c0['nodeType'];}var ce=class extends _0x1b9c8e{_innerViewToAnnotation;_viewToAnnotation;['_focusTracker'];constructor(_0x54daab=[]){super(),this['_innerViewToAnnotation']=new Map(),this['_viewToAnnotation']=new Map(),this['_focusTracker']=new _0x564482(),this['_focusTracker']['on']('change:isFocused',(_0x51335b,_0x1a9d0e,_0x9c3463)=>{_0x9c3463||this['fire']('blur');});for(const _0x1460c8 of _0x54daab)this['add'](_0x1460c8);}get['isFocused'](){return this['_focusTracker']['isFocused'];}['add'](_0x31647c){if(this['has'](_0x31647c))throw new _0x3a2101('annotationcollection-duplicated-item',null);this['_innerViewToAnnotation']['set'](_0x31647c['innerView'],_0x31647c),this['_viewToAnnotation']['set'](_0x31647c['view'],_0x31647c);for(const _0xb3339a of _0x31647c['focusableElements'])this['_focusTracker']['add'](_0xb3339a);if(this['listenTo'](_0x31647c['focusableElements'],'add',(_0x1ccfff,_0x2691c8)=>{this['_focusTracker']['add'](_0x2691c8);}),this['listenTo'](_0x31647c['focusableElements'],'remove',(_0x260b9f,_0x358797)=>{this['_focusTracker']['remove'](_0x358797);}),this['listenTo'](_0x31647c['view']['focusTracker'],'change:isFocused',(_0x1300d8,_0x1ca8a3,_0x4f83f3)=>{_0x4f83f3&&this['fire']('focus',_0x31647c);}),_0x31647c['updateTargetRect'](),this['_areCachedRectsStale']()){for(const _0x4c55d5 of this)_0x4c55d5['updateTargetRect']();}const _0x535af0=this['_getOrderInContent'](_0x31647c['view']['targetRect']);return super['add'](_0x31647c,_0x535af0);}['remove'](_0x402d2b){if(!this['has'](_0x402d2b))throw new _0x3a2101('annotationcollection-not-existing-item',null);this['stopListening'](_0x402d2b['view']['focusTracker']),this['stopListening'](_0x402d2b['focusableElements']);for(const _0x15d405 of _0x402d2b['focusableElements'])this['_focusTracker']['remove'](_0x15d405);return this['_viewToAnnotation']['delete'](_0x402d2b['view']),this['_innerViewToAnnotation']['delete'](_0x402d2b['innerView']),super['remove'](_0x402d2b);}getByInnerView(_0x39e23a){return this['_innerViewToAnnotation']['get'](_0x39e23a);}getByView(_0x2bf5b0){return this['_viewToAnnotation']['get'](_0x2bf5b0);}destroy(){super['clear'](),this['stopListening'](),this['_innerViewToAnnotation']['clear'](),this['_viewToAnnotation']['clear'](),this['_focusTracker']['destroy']();}refreshPositioning(){for(const _0x2cd5d6 of this)_0x2cd5d6['updateTargetRect']();this['_sort']();}_sort(){const _0x57510d=Array['from'](this)['sort']((_0xdbbf4e,_0x5af36c)=>le(_0xdbbf4e['view']['targetRect'],_0x5af36c['view']['targetRect']));for(let _0x16ff1b=_0x57510d['length']-0x1;_0x16ff1b>0x0;_0x16ff1b--){const _0x1bb4fb=_0x57510d[_0x16ff1b];_0x16ff1b!==this['getIndex'](_0x1bb4fb)&&(this['remove'](_0x1bb4fb),this['add'](_0x1bb4fb));}}_getOrderInContent(_0x317993){let _0x203437=0x0;if(!_0x317993)return this['length'];for(const _0x222495 of this){const _0x200022=_0x222495['view']['targetRect'];if(_0x200022){if(le(_0x317993,_0x200022)<0x0)return _0x203437;_0x203437++;}}return _0x203437;}_areCachedRectsStale(){const _0x24a16a=this['get'](0x0);if(!_0x24a16a)return!0x1;const _0x3af7b3=_0x24a16a['view']['targetRect'],_0x3f2399=_0x24a16a['targetRect'];return!(!_0x3af7b3||!_0x3f2399)&&(_0x3af7b3['top']!==_0x3f2399['top']||_0x3af7b3['left']!==_0x3f2399['left']);}};function de({source:_0x49d007,target:_0x30a6ee,filter:_0xabc6b6}){for(const _0x4b6c09 of _0x49d007)_0xabc6b6(_0x4b6c09)&&_0x30a6ee['add'](_0x4b6c09);_0x30a6ee['listenTo'](_0x49d007,'add',(_0x1e08e1,_0x20a424)=>{_0xabc6b6(_0x20a424)&&_0x30a6ee['add'](_0x20a424);}),_0x30a6ee['listenTo'](_0x49d007,'remove',(_0x226b74,_0x3cd366)=>{_0x30a6ee['has'](_0x3cd366)&&_0x30a6ee['remove'](_0x3cd366);});}function le(_0x550944,_0x4412da){if(null===_0x550944&&null===_0x4412da)return 0x0;if(null===_0x550944)return-0x1;if(null===_0x4412da)return 0x1;const _0x54e01c=_0x550944['top']-_0x4412da['top'];return 0x0==_0x54e01c?_0x550944['left']-_0x4412da['left']:_0x54e01c;}var me=class extends _0x1dc739{collection;_visibleAnnotations;static get['pluginName'](){return'Annotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3d6725){if(super(_0x3d6725),this['collection']=new ce(),this['_visibleAnnotations']=new ce(),this['set']('activeAnnotations',new Set()),this['_bindAnnotationsToVisibleAnnotations'](),_0x3d6725 instanceof _0x5ac7c6){const _0x7bcba9=_0x3d6725['locale'];_0x3d6725['accessibility']['addKeystrokeInfoGroup']({'id':'annotations','label':Vt(_0x7bcba9,'ACCESSIBILITY_HELP_ANNOTATIONS_GROUP'),'keystrokes':[{'label':Vt(_0x7bcba9,'ACCESSIBILITY_HELP_ANNOTATIONS_MOVE_TO'),'keystroke':'Ctrl+Shift+E'},{'label':Vt(_0x7bcba9,'ACCESSIBILITY_HELP_ANNOTATIONS_EXIT'),'keystroke':'Esc'},{'label':Vt(_0x7bcba9,'ACCESSIBILITY_HELP_ANNOTATIONS_ENTER'),'keystroke':'Enter'},{'label':Vt(_0x7bcba9,'ACCESSIBILITY_HELP_ANNOTATIONS_BROWSE_GROUPS'),'keystroke':[['Tab'],['Shift+Tab']]},{'label':Vt(_0x7bcba9,'ACCESSIBILITY_HELP_ANNOTATIONS_SUBMIT_COMMENT'),'keystroke':['Ctrl+Enter']},{'label':Vt(_0x7bcba9,'ACCESSIBILITY_HELP_ANNOTATIONS_NAVIGATE_THREADS'),'keystroke':[['Arrowup'],['Arrowdown']]}]});}this['_setupEnterAnnotationKeystroke'](),this['_setupEscapeAnnotationHandling']();}['add'](_0x2540ea){this['collection']['add'](_0x2540ea);}['remove'](_0x70ead0){this['collection']['remove'](_0x70ead0),_0x70ead0['destroy']();}refreshVisibility(){for(const _0x5188a2 of this['collection'])_0x5188a2['refreshVisibility']();}refreshPositioning(){this['_visibleAnnotations']['refreshPositioning']();}getByInnerView(_0x152520){return this['collection']['getByInnerView'](_0x152520);}deactivateAll(){this['fire']('_deactivateAllAnnotations');}destroy(){for(const _0x5b044f of this['collection'])_0x5b044f['destroy']();this['_visibleAnnotations']['destroy'](),this['collection']['destroy'](),super['destroy']();}activate(_0x346d75){this['fire']('_activateAnnotation',_0x346d75);}createAnnotation(_0x19b31c){return new he(_0x19b31c);}createAnnotationView(_0x2cc086,_0x517d7e){return new oe(_0x2cc086,_0x517d7e);}_addActiveAnnotation(_0x3e8095){const _0xdb5e88=new Set(this['activeAnnotations']);_0xdb5e88['add'](_0x3e8095),this['activeAnnotations']=_0xdb5e88;}_removeActiveAnnotation(_0x16fc85){const _0x50799a=new Set(this['activeAnnotations']);_0x50799a['delete'](_0x16fc85),this['activeAnnotations']=_0x50799a;}_bindAnnotationsToVisibleAnnotations(){const _0x48f4e1=this['collection'],_0xa62b80=this['_visibleAnnotations'];function _0x32cd3d(_0x5007ab){const _0x328ad6=_0x5007ab['source'];_0x328ad6['isVisible']&&!_0xa62b80['has'](_0x328ad6)?_0xa62b80['add'](_0x328ad6):!_0x328ad6['isVisible']&&_0xa62b80['has'](_0x328ad6)&&_0xa62b80['remove'](_0x328ad6),_0x328ad6['view']['focusTracker']['remove'](_0x328ad6['view']['element']),_0x328ad6['view']['focusTracker']['add'](_0x328ad6['view']['element']);}this['listenTo'](_0x48f4e1,'add',(_0x5ad7b1,_0x4d9189)=>{_0x4d9189['isVisible']&&_0xa62b80['add'](_0x4d9189),this['listenTo'](_0x4d9189,'change:isVisible',_0x32cd3d);}),this['listenTo'](_0x48f4e1,'remove',(_0x479de5,_0x4a37c7)=>{_0xa62b80['has'](_0x4a37c7)&&_0xa62b80['remove'](_0x4a37c7),this['stopListening'](_0x4a37c7,'change:isVisible',_0x32cd3d);});}_setupEnterAnnotationKeystroke(){const _0x45904d=_0x36a323=>{_0x36a323['on']('ready',()=>{_0x36a323['keystrokes']['set'](_0x381db6,(_0x5525fb,_0xa38eea)=>{const _0xe7908f=_0x140f7a(this['activeAnnotations']['values']());_0xe7908f&&(_0xe7908f['view']['focus'](),_0xa38eea());});});};this['context']instanceof _0x5ac7c6?_0x45904d(this['context']):this['context']['editors']&&this['context']['editors']['on']('add',(_0x39304c,_0x25a8ff)=>{_0x45904d(_0x25a8ff);});}_setupEscapeAnnotationHandling(){const _0x981bca=_0x35ba26=>{const _0xefd485=_0x35ba26['source'],_0x1fa154=[];let _0x4e79c0;if(Array['isArray'](_0xefd485['target'])){_0x4e79c0=_0xefd485['target'][0x0],this['context']instanceof _0x5ac7c6?_0x1fa154['push'](this['context']):this['context']['editors']&&_0x1fa154['push'](...this['context']['editors']);for(const _0x536f81 of _0x1fa154)for(const _0x30b842 of _0x536f81['editing']['view']['domRoots']['values']())if(_0x5356cd(_0x30b842,_0x4e79c0))return void _0x536f81['editing']['view']['focus']();_0x4e79c0['focus']();}};this['listenTo'](this['collection'],'add',(_0x27704d,_0x5d48a0)=>{this['listenTo'](_0x5d48a0,'escape',_0x981bca,{'priority':'low'});}),this['listenTo'](this['collection'],'remove',(_0x33c18b,_0x1e18a4)=>{this['stopListening'](_0x1e18a4,'escape',_0x981bca);});}};const ue=Symbol('noChannel'),fe={'admin':!0x0,'modifyAll':!0x1,'write':!0x0,'resolve':!0x0},pe=/* #__PURE__ -- @preserve */
|
|
30
|
+
_0x503b6d(),_e=/* #__PURE__ -- @preserve */
|
|
31
|
+
_0x503b6d();var we=class extends _0x1dc739{_threads;_threadToController;_viewToController;static get requires(){return[me,_0x4a9301,_0x2fb247];}static get['pluginName'](){return'CommentsRepository';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x50dc4f){super(_0x50dc4f),this['_threads']=new Map(),this['_threadToController']=new Map(),this['_viewToController']=new Map(),this['set']('_readOnlyChannels',new Set()),this['set']('_permissions',new Map());const _0x315021=this['context']['config'];_0x315021['define']('comments.maxCommentsWhenCollapsed',0x2),_0x315021['define']('comments.maxThreadTotalWeight',0x1f4),_0x315021['define']('comments.maxCommentCharsWhenCollapsed',0x8c),_0x315021['define']('comments.CommentThreadView',Zt),_0x315021['define']('comments.CommentView',se),_0x315021['get']('comments.editorConfig')||console['warn']('Missing\x20comments\x20editor\x20configuration\x20(`comments.editorConfig`).\x20Default\x20configuration\x20will\x20be\x20used\x20instead.');}init(){const _0x25b733=this['context']['plugins']['get'](me);this['set']('activeCommentThread',null),this['on']('addCommentThread',(_0x471413,_0x4dd3da)=>this['_addCommentThread'](_0x4dd3da)),this['on']('submitCommentThread',(_0x9b79cd,_0x115d40)=>this['_submitCommentThread'](_0x115d40)),this['on']('resolveCommentThread',(_0x1f2bcc,_0x8322ca)=>this['_resolveCommentThread'](_0x8322ca)),this['on']('resolveCommentThread',(_0x4ec60a,_0x9b94ab)=>this['_updateActiveAnnotation'](_0x9b94ab),{'priority':'lowest'}),this['on']('reopenCommentThread',(_0x57e899,_0x1549d9)=>this['_reopenCommentThread'](_0x1549d9)),this['on']('reopenCommentThread',(_0x183ae6,_0x1d0f7d)=>this['_updateActiveAnnotation'](_0x1d0f7d),{'priority':'lowest'}),this['on']('removeCommentThread',(_0x48952d,_0x4c14d6)=>this['_removeCommentThread'](_0x4c14d6)),this['on']('updateCommentThread',(_0x5eed3f,_0x2f611b)=>this['_updateCommentThread'](_0x2f611b)),this['on']('updateCommentThread',(_0xb0f473,_0x3b52d7)=>this['_updateActiveAnnotation'](_0x3b52d7),{'priority':'lowest'}),this['on']('addComment',(_0x5b0f6f,_0x20a038)=>this['_addComment'](_0x20a038)),this['on']('updateComment',(_0x4187a5,_0x44a21e)=>this['_updateComment'](_0x44a21e)),this['on']('removeComment',(_0xecf9f9,_0xbdfac3)=>this['_removeComment'](_0xbdfac3)),this['on']('addComment',(_0x171b13,{threadId:_0x241732,isFromAdapter:_0x333480})=>{if(_0x333480)return;const _0x58ce63=this['getCommentThread'](_0x241732),_0x4b92de=_0x58ce63&&this['_threadToController']['get'](_0x58ce63);_0x4b92de&&_0x4b92de['view']['commentsListView']['focus'](-0x1);},{'priority':'lowest'}),this['listenTo'](_0x25b733,'change:activeAnnotations',(_0x43dce1,_0x21109b,_0x5ee790)=>{const _0x2f76cc=Array['from'](_0x5ee790)['map'](_0x2030a6=>this['_viewToController']['get'](_0x2030a6['innerView']))['filter'](Boolean)[0x0];this['activeCommentThread']=_0x2f76cc?_0x2f76cc['model']:null;});}set adapter(_0x1dca7e){if(this['_adapter'])throw new _0x3a2101('commentsrepository-adapter-already-set');this['_adapter']=_0x1dca7e;}get adapter(){return this['_adapter'];}addCommentThread({channelId:_0x2dff8d=ue,threadId:_0xd0c34d=_0x3370ee(),comments:_0x2963d7=[],unlinkedAt:_0x1dfcef=null,resolvedAt:_0x1f48d5=null,resolvedBy:_0x57df9f=null,target:_0xf76272=null,context:_0x4f8535=null,attributes:_0x9e47ea={},isResolvable:_0x4babe0=!0x0,isSubmitted:_0x44fb69=!0x1,isFromAdapter:_0x3e05eb=!0x1}={}){return this['fire'](ve('addCommentThread',_0x2dff8d),{'channelId':_0x2dff8d,'threadId':_0xd0c34d,'comments':_0x2963d7,'unlinkedAt':_0x1dfcef,'resolvedAt':_0x1f48d5,'resolvedBy':_0x57df9f,'target':_0xf76272,'context':_0x4f8535,'attributes':_0x9e47ea,'isFromAdapter':_0x3e05eb,'isResolvable':_0x4babe0,'isSubmitted':_0x44fb69}),this['getCommentThread'](_0xd0c34d);}openNewCommentThread({channelId:_0x1ac33e=ue,threadId:_0x56fe34=_0x3370ee(),target:_0x5f5038,context:_0x36180b=null,isResolvable:_0x2259d4=!0x0}){if(this['_readOnlyChannels']['has'](_0x1ac33e)||this['_readOnlyChannels']['has'](void 0x0))return null;if(!_0x5f5038)throw new _0x3a2101('commentsrepository-missing-target');const _0x45e6df=this['addCommentThread']({'channelId':_0x1ac33e,'threadId':_0x56fe34,'target':_0x5f5038,'context':_0x36180b,'isResolvable':_0x2259d4});if(!_0x45e6df)return null;const _0x3e55a4=this['_threadToController']['get'](_0x45e6df),_0x35e083=_0x3e55a4['view']['commentThreadInputView']['commentInputView'],_0x4b74f2=this['context']['plugins']['get'](me),_0x50fe19=_0x4b74f2['getByInnerView'](_0x3e55a4['view']);return _0x4b74f2['activate'](_0x50fe19),_0x35e083['once']('editorReady',()=>_0x35e083['focus']()),_0x45e6df;}hasCommentThread(_0x5ace4e){if('string'!=typeof _0x5ace4e)throw new _0x3a2101('commentsrepository-invalid-comment-thread-id');return this['_threads']['has'](_0x5ace4e);}updateCommentThread({channelId:_0x4cc77f=ue,threadId:_0x5a1aea,context:_0x32590e,unlinkedAt:_0x39bead,attributes:_0x4bdd55,isFromAdapter:_0x27b1f1=!0x1}){return this['fire'](ve('updateCommentThread',_0x4cc77f),{'channelId':_0x4cc77f,'threadId':_0x5a1aea,'context':_0x32590e,'unlinkedAt':_0x39bead,'attributes':_0x4bdd55,'isFromAdapter':_0x27b1f1}),this['getCommentThread'](_0x5a1aea);}getCommentThread(_0x425759){if('string'!=typeof _0x425759)throw new _0x3a2101('commentsrepository-invalid-comment-thread-id');return this['_threads']['get'](_0x425759);}fetchCommentThread({channelId:_0x374926,threadId:_0x7f299c}={}){const _0x101cd4=this['getCommentThread'](_0x7f299c);if(_0x101cd4)return Promise['resolve'](_0x101cd4);if(!this['adapter'])return Promise['resolve'](void 0x0);if('function'!=typeof this['adapter']['getCommentThread'])throw new _0x3a2101('commentsrepository-missing-thread-and-adapter-method',this['context']);return this['adapter']['getCommentThread']({'channelId':_0x374926,'threadId':_0x7f299c})['then'](_0x5eab8f=>this['hasCommentThread'](_0x7f299c)?this['getCommentThread'](_0x7f299c):_0x5eab8f?this['addCommentThread'](Object['assign']({'isFromAdapter':!0x0,'channelId':_0x374926},_0x5eab8f)):void 0x0)['catch'](_0x3d4ca2=>{throw console['error'](_0x3d4ca2),new _0x3a2101('commentsrepository-fetch-comment-thread',this['context']);});}getCommentThreads({channelId:_0x15b273,skipNotAttached:_0x529a2a=!0x1,skipEmpty:_0x42c4b1=!0x1,toJSON:_0x8aa041=!0x1}={}){const _0x19499c=[];for(const _0x45de41 of this['_threads']['values']())_0x15b273&&_0x45de41['channelId']!==_0x15b273||_0x529a2a&&!_0x45de41['isAttached']||_0x42c4b1&&0x0===_0x45de41['length']||_0x19499c['push'](_0x45de41);return _0x8aa041?_0x19499c['map'](_0x339e0d=>_0x339e0d['toJSON']()):_0x19499c;}getAnnotationForCommentThread(_0x67285f){const _0x233286=this['_threadToController']['get'](_0x67285f);return _0x233286&&this['context']['plugins']['get'](me)['getByInnerView'](_0x233286['view'])||null;}getCommentThreadForAnnotation(_0x482532){const _0x4ca08d=this['_viewToController']['get'](_0x482532['innerView']);return _0x4ca08d?_0x4ca08d['model']:null;}setActiveCommentThread(_0x4aa549){const _0x192e7b=this['context']['plugins']['get'](me);if(!_0x4aa549)return void(this['activeCommentThread']&&_0x192e7b['deactivateAll']());const _0x1dfa92=this['getCommentThread'](_0x4aa549);if(!_0x1dfa92)throw new _0x3a2101('commentsrepository-active-missing-comment-thread',null,{'threadId':_0x4aa549});if(!this['_threadToController']['has'](_0x1dfa92))throw new _0x3a2101('commentsrepository-active-not-attached',null,{'threadId':_0x4aa549});const _0x91d133=_0x192e7b['getByInnerView'](this['_threadToController']['get'](_0x1dfa92)['view']);_0x192e7b['activate'](_0x91d133);}switchReadOnly(_0x1b56ba,_0x192662){_0x1b56ba?this['_readOnlyChannels']['add'](_0x192662):this['_readOnlyChannels']['delete'](_0x192662),this['fire']('change:_readOnlyChannels','_readOnlyChannels',this['_readOnlyChannels'],this['_readOnlyChannels']);}['isReadOnly'](_0x1f8170){return this['_readOnlyChannels']['has'](_0x1f8170)||this['_readOnlyChannels']['has'](void 0x0);}createCommentThreadController(_0x4e137c,_0x1abce5){return new Dt(_0x4e137c,_0x1abce5);}setPermissions(_0x4c09cd,_0x3fb3c7=ue){this['_permissions']['set'](_0x3fb3c7,_0x4c09cd),this['fire']('change:_permissions','_permissions',this['_permissions'],this['_permissions']);}getPermissions(_0x294f31=ue){return this['_permissions']['has'](_0x294f31)?this['_permissions']['get'](_0x294f31):fe;}_addCommentThread({channelId:_0x19f2a0,threadId:_0x2d0220,comments:_0x46be66,unlinkedAt:_0x485c7a,resolvedAt:_0x1f0eaa,resolvedBy:_0x276240,target:_0x405392,context:_0x58f53a,attributes:_0x3c8d08,isFromAdapter:_0x1fe517,isResolvable:_0x3a80a0,isSubmitted:_0x5e7456}){if('string'!=typeof _0x2d0220)throw new _0x3a2101('commentsrepository-invalid-comment-thread-id',null,{'threadId':_0x2d0220});if(this['hasCommentThread'](_0x2d0220))throw new _0x3a2101('commentsrepository-duplicated-comment-thread-id',null,{'threadId':_0x2d0220});const _0xd44423=new ge(this,{'channelId':_0x19f2a0,'id':_0x2d0220,'context':_0x58f53a,'attributes':_0x3c8d08,'unlinkedAt':_0x485c7a,'resolvedAt':_0x1f0eaa,'resolvedBy':_0x276240?this['context']['plugins']['get'](_0x2fb247)['getUser'](_0x276240):null,'isResolvable':_0x3a80a0,'isSubmitted':_0x5e7456||_0x1fe517});this['_threads']['set'](_0x2d0220,_0xd44423);for(const _0x5cb42f of _0x46be66)_0xd44423['_add'](this['_createNewComment']({'threadId':_0x2d0220,..._0x5cb42f}));return _0x405392&&_0xd44423['attachTo'](_0x405392),_0x1fe517||!_0xd44423['length']?Promise['resolve']():this['_submitCommentThread']({'channelId':_0x19f2a0,'threadId':_0x2d0220});}_submitCommentThread({channelId:_0x13bd3e,threadId:_0x23ab17}){if(!this['hasCommentThread'](_0x23ab17))throw new _0x3a2101('commentsrepository-missing-comment-thread',this);const _0x5a1ffa=this['getCommentThread'](_0x23ab17);if(_0x5a1ffa['_isSubmitted']=!0x0,!this['adapter']||'function'!=typeof this['adapter']['addCommentThread'])return Promise['resolve']();const {id:_0x20f359,comments:_0x5e7c89,resolvedAt:_0x1c693a,resolvedBy:_0x36aa61,context:_0x39dcb5,attributes:_0x4d43fa}=_0x5a1ffa,_0x1b9b7c=this['context']['plugins']['get']('PendingActions'),_0x13841c=_0x1b9b7c['add'](Vt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['addCommentThread']({'channelId':_0x13bd3e,'threadId':_0x20f359,'comments':_0x5e7c89['map'](_0x4797a0=>_0x4797a0['toJSON']()),'resolvedAt':_0x1c693a,'resolvedBy':_0x36aa61?_0x36aa61['id']:_0x36aa61,'context':_0x39dcb5,'attributes':_0x4d43fa})['then'](({comments:_0x503863})=>{_0x1b9b7c['remove'](_0x13841c);for(const _0x5d9e91 of _0x503863)this['_updateComment']({'channelId':_0x13bd3e,'threadId':_0x23ab17,'commentId':_0x5d9e91['commentId'],'createdAt':_0x5d9e91['createdAt'],'isFromAdapter':!0x0});})['catch'](_0x3622e3=>{throw console['error'](_0x3622e3),new _0x3a2101('commentsrepository-add-comment-thread-internal-error',this);});}_attachCommentThread({threadId:_0xf990a3,target:_0x4408ef}){const _0x2eaf1b=this['getCommentThread'](_0xf990a3);if(!_0x2eaf1b)throw new _0x3a2101('commentsrepository-attach-missing-comment-thread',this);const _0x4afcf0=this['context']['plugins']['get']('PendingActions'),_0x2cc361=this['context']['plugins']['get'](me),_0x5491d9=this['_createCommentThreadView'](_0x2eaf1b),_0x33c45d=new Dt(_0x2eaf1b,_0x5491d9);let _0x1a37fe=null;_0x5491d9['on']('change:isDirty',(_0x2639cb,_0x107948,_0x3f0df8)=>{_0x3f0df8?_0x1a37fe=_0x4afcf0['add'](Vt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD')):_0x1a37fe&&(_0x4afcf0['remove'](_0x1a37fe),_0x1a37fe=null);}),this['_threadToController']['set'](_0x2eaf1b,_0x33c45d),this['_viewToController']['set'](_0x5491d9,_0x33c45d);const _0x499d2d=new oe(this['context']['locale'],_0x5491d9);_0x499d2d['bind']('length')['to'](_0x5491d9),_0x499d2d['bind']('isDirty')['to'](_0x5491d9,'isDirty',_0x5491d9,'length',(_0x2f4ad1,_0x1c5d46)=>_0x2f4ad1||!_0x1c5d46),_0x499d2d['bind']('isActive')['to'](_0x5491d9),_0x499d2d['type']='comment';const _0x31f55b=new he({'view':_0x499d2d,'target':_0x4408ef,'type':'comment','isVisible':!_0x2eaf1b['archivedAt']&&!!('function'==typeof _0x4408ef?_0x4408ef():_0x4408ef)});return _0x5491d9['on']('escape',()=>{_0x31f55b['fire']('escape');}),this['_bindAnnotationToEditors'](_0x5491d9,_0x31f55b),_0x2cc361['add'](_0x31f55b),_0x31f55b;}_bindAnnotationToEditors(_0xd954cf,_0x2ef1ee){this['listenTo'](_0xd954cf,'editorReady',(_0x187f83,_0x3c4e6a)=>{const _0x3159a3=_0x3c4e6a['ui']['view']['body']['bodyCollectionContainer'];_0x2ef1ee['focusableElements']['add'](_0x3159a3),this['context']instanceof _0x5ac7c6&&this['context']['ui']['focusTracker']['add'](_0x3159a3);},{'priority':'highest'}),this['listenTo'](_0xd954cf,'editorDestroyed',(_0x3da8e4,_0x4dad12)=>{const _0x25b72a=_0x4dad12['ui']['view']['body']['bodyCollectionContainer'];_0x2ef1ee['focusableElements']['has'](_0x25b72a)&&_0x2ef1ee['focusableElements']['remove'](_0x25b72a),this['context']instanceof _0x5ac7c6&&this['context']['ui']['focusTracker']['remove'](_0x25b72a);});}_unbindEditors(_0x1bbaef){this['stopListening'](_0x1bbaef,'editorReady'),this['stopListening'](_0x1bbaef,'editorDestroyed');}_createCommentThreadView(_0x4cc8b0){const _0xbe185=this['context']['plugins']['get'](_0x2fb247),{config:_0x4e0745,locale:_0x218d85}=this['context'],_0x26c7dd=_0x3c5a7b(_0x4e0745['get']('locale'),_0x218d85);return new(0x0,(_0x4e0745['get']('comments'))['CommentThreadView'])(_0x218d85,_0x4cc8b0,_0xbe185['me'],{'editorConfig':{..._0x4e0745['get']('comments.editorConfig'),...this['_getCommentEditorOverlayConfig'](),'licenseKey':this['context']['config']['get']('licenseKey')},'copyMarkers':_0x4e0745['get']('comments.copyMarkers'),'maxCommentsWhenCollapsed':_0x4e0745['get']('comments.maxCommentsWhenCollapsed'),'maxThreadTotalWeight':_0x4e0745['get']('comments.maxThreadTotalWeight'),'maxCommentCharsWhenCollapsed':_0x4e0745['get']('comments.maxCommentCharsWhenCollapsed'),'formatDateTime':_0x26c7dd,'CommentView':_0x4e0745['get']('comments')['CommentView']});}_getCommentEditorOverlayConfig(){const _0x1b2e1a=this['context']['config'],_0x133a6d=_0x1b2e1a['get']('comments.editorConfig'),_0x33b356=_0x133a6d?.['ui']?.['overlayContainer']||_0x1b2e1a['get']('sidebar.overlayContainer')||_0x1b2e1a['get']('ui.overlayContainer');return _0x33b356?{'ui':{..._0x133a6d?.['ui'],'overlayContainer':_0x33b356}}:{};}_resolveCommentThread({threadId:_0x2797a9,channelId:_0x411454,resolvedAt:_0x5c2983,resolvedBy:_0x5e3e6c,isFromAdapter:_0x519442}){if(!this['hasCommentThread'](_0x2797a9))throw new _0x3a2101('commentsrepository-missing-comment-thread',null,{'threadId':_0x2797a9});const _0x2e1650=this['getCommentThread'](_0x2797a9);if(_0x2e1650['isResolved'])throw new _0x3a2101('commentsrepository-resolved-comment-thread',null,{'threadId':_0x2797a9});const _0x560822=this['context']['plugins']['get'](_0x2fb247);if(_0x2e1650['resolvedBy']=_0x560822['getUser'](_0x5e3e6c),_0x2e1650['resolvedAt']=_0x5c2983,_0x519442||!this['adapter']||'function'!=typeof this['adapter']['resolveCommentThread'])return Promise['resolve']();const _0x356220=this['context']['plugins']['get']('PendingActions'),_0x5bf54d=_0x356220['add'](Vt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['resolveCommentThread']({'channelId':_0x411454,'threadId':_0x2797a9})['then'](({resolvedAt:_0x132b82,resolvedBy:_0x5e653a})=>{_0x356220['remove'](_0x5bf54d),_0x2e1650['resolvedBy']['id']!==_0x5e653a&&(_0x2e1650['resolvedBy']=_0x560822['getUser'](_0x5e653a)),_0x2e1650['resolvedAt']=_0x132b82;})['catch'](_0x3cc1a8=>{throw console['error'](_0x3cc1a8),new _0x3a2101('commentsrepository-resolve-comment-thread-internal-error',this);});}_reopenCommentThread({threadId:_0x3ffaf2,channelId:_0x282422,isFromAdapter:_0x5abce7}){if(!this['hasCommentThread'](_0x3ffaf2))throw new _0x3a2101('commentsrepository-missing-comment-thread',null,{'threadId':_0x3ffaf2});const _0x1537bd=this['getCommentThread'](_0x3ffaf2);if(!_0x1537bd['isResolved'])throw new _0x3a2101('commentsrepository-reopen-comment-thread',null,{'threadId':_0x3ffaf2});if(_0x1537bd['resolvedBy']=null,_0x1537bd['resolvedAt']=null,_0x5abce7||!this['adapter']||'function'!=typeof this['adapter']['reopenCommentThread'])return Promise['resolve']();const _0x31a52f=this['context']['plugins']['get']('PendingActions'),_0x567c61=_0x31a52f['add'](Vt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['reopenCommentThread']({'channelId':_0x282422,'threadId':_0x3ffaf2})['then'](()=>_0x31a52f['remove'](_0x567c61))['catch'](_0x3a842c=>{throw console['error'](_0x3a842c),new _0x3a2101('commentsrepository-reopen-comment-thread-internal-error',this);});}_removeCommentThread({threadId:_0xb3b978,isFromAdapter:_0x39b9bd}){const _0x21008d=this['getCommentThread'](_0xb3b978);if(!_0x21008d)throw new _0x3a2101('commentsrepository-remove-missing-comment-thread',this);if(this['_detachCommentThread'](_0xb3b978),this['_threads']['delete'](_0xb3b978),!_0x21008d['isSubmitted']||_0x39b9bd||!this['adapter']||'function'!=typeof this['adapter']['removeCommentThread'])return Promise['resolve']();const _0x5415ae=this['context']['plugins']['get']('PendingActions'),{channelId:_0x5c4c05}=_0x21008d,_0x295dba=_0x5415ae['add'](Vt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['removeCommentThread']({'channelId':_0x5c4c05,'threadId':_0xb3b978})['then'](()=>_0x5415ae['remove'](_0x295dba))['catch'](_0x2b63da=>{throw console['error'](_0x2b63da),new _0x3a2101('commentsrepository-remove-comment-thread-internal-error',this);});}_updateCommentThread({threadId:_0x215545,unlinkedAt:_0x2386be,context:_0x3ec385,attributes:_0x590f1c,isFromAdapter:_0x256d98}){if('string'!=typeof _0x215545)throw new _0x3a2101('commentsrepository-invalid-comment-thread-id',null,{'threadId':_0x215545});if(!this['hasCommentThread'](_0x215545))throw new _0x3a2101('commentsrepository-missing-comment-thread',null,{'threadId':_0x215545});const _0x27b08a=this['getCommentThread'](_0x215545);let _0x4f5bba=!0x1;if(void 0x0!==_0x3ec385&&_0x27b08a['context']!==_0x3ec385&&(_0x27b08a['context']=_0x3ec385,_0x4f5bba=!0x0),void 0x0!==_0x2386be&&_0x27b08a['unlinkedAt']!==_0x2386be&&(_0x27b08a['unlinkedAt']=_0x2386be,_0x4f5bba=!0x0),_0x590f1c&&!_0x40e030(_0x590f1c,_0x27b08a['attributes'])&&(_0x27b08a['attributes']=_0x590f1c,_0x4f5bba=!0x0),!_0x4f5bba)return Promise['resolve']();if(!_0x27b08a['isSubmitted']||_0x256d98||!this['adapter']||'function'!=typeof this['adapter']['updateCommentThread'])return Promise['resolve']();const _0xac7751=this['context']['plugins']['get']('PendingActions'),{channelId:_0x2fd573}=_0x27b08a,_0x20fac8=_0xac7751['add'](Vt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['updateCommentThread']({'channelId':_0x2fd573,'threadId':_0x215545,'context':_0x3ec385,'unlinkedAt':_0x2386be,'attributes':_0x590f1c})['then'](()=>_0xac7751['remove'](_0x20fac8))['catch'](_0x4c9312=>{throw console['error'](_0x4c9312),new _0x3a2101('commentsrepository-update-comment-thread-internal-error',this);});}_detachCommentThread(_0x4d7347){const _0x3ac0be=this['context']['plugins']['get'](me),_0x3ba0c6=this['getCommentThread'](_0x4d7347);if(_0x3ba0c6['_isAttached']=!0x1,this['_threadToController']['has'](_0x3ba0c6)){const _0x445e18=this['_threadToController']['get'](_0x3ba0c6),_0x6ffc5c=_0x445e18['view'],_0x9c31c7=_0x3ac0be['getByInnerView'](_0x6ffc5c);this['_threadToController']['delete'](_0x3ba0c6),this['_viewToController']['delete'](_0x6ffc5c),_0x9c31c7&&_0x3ac0be['remove'](_0x9c31c7),_0x445e18['destroy'](),_0x6ffc5c['destroy']()['then'](()=>{this['_unbindEditors'](_0x6ffc5c);});}}_updateActiveAnnotation({threadId:_0x426455,resolvedAt:_0x1bc641,unlinkedAt:_0x44d039}){const _0x591b65=!!_0x1bc641,_0x3f5759=this['context']['plugins']['get'](me),_0x17626f=this['getCommentThread'](_0x426455);if(this['_threadToController']['has'](_0x17626f)){const _0x8e15b7=this['_threadToController']['get'](_0x17626f)['view'],_0x373d22=_0x3f5759['getByInnerView'](_0x8e15b7);_0x373d22&&(_0x591b65&&_0x3f5759['_removeActiveAnnotation'](_0x373d22),_0x44d039?_0x373d22['isVisible']=!0x1:_0x373d22['refreshVisibility']());}}_getExternalAuthor(_0xdb3531){const _0xa80a0f=this['context']['plugins']['get'](_0x2fb247),_0x374b3b=_0x7ad685('external:'+_0xdb3531),_0x7686f3=_0xa80a0f['getUser'](_0x374b3b);return _0x7686f3||_0xa80a0f['addUser']({'id':_0x374b3b,'name':_0xdb3531});}_createNewComment({threadId:_0x49cad7,commentId:_0x2450bb=_0x3370ee(),content:_0xcebc49,authorId:_0x4806a2,createdAt:_0x1d81c1,attributes:_0x3d80f5}){if('string'!=typeof _0x2450bb)throw new _0x3a2101('commentsrepository-invalid-commentid');if('string'!=typeof _0x4806a2)throw new _0x3a2101('commentsrepository-invalid-comment-authorid');if('string'!=typeof _0xcebc49||!_0xcebc49['trim']())throw new _0x3a2101('commentsrepository-invalid-comment-content');const _0x564575=this['context']['plugins']['get'](_0x2fb247)['getUser'](_0x4806a2);if(!_0x564575)throw new _0x3a2101('commentsrepository-add-comment-user-not-exists',null,{'authorId':_0x4806a2});let _0x74a3d0=null,_0x49fb2d=_0x1d81c1;return _0x3d80f5?.['@external']&&(_0x74a3d0=this['_getExternalAuthor'](_0x3d80f5['@external']['authorName']),_0x49fb2d=new Date(_0x3d80f5['@external']['createdAt'])),new Ae(this,{'threadId':_0x49cad7,'id':_0x2450bb,'author':_0x74a3d0||_0x564575,'creator':_0x564575,'content':_0xcebc49,'createdAt':_0x1d81c1,'authoredAt':_0x49fb2d,'attributes':_0x3d80f5});}_addComment(_0x35e73a){let {threadId:_0x3446b4,content:_0x55e1cc,attributes:_0x52a577,isFromAdapter:_0x1ba1b6}=_0x35e73a;const _0xf9e345=this['getCommentThread'](_0x35e73a['threadId']);if(!_0xf9e345)throw new _0x3a2101('commentsrepository-add-comment-to-missing-comment-thread',this);const _0x344ead=this['_createNewComment'](_0x35e73a),{id:_0x234b62}=_0x344ead;if(_0xf9e345['_add'](_0x344ead),_0x1ba1b6||!this['adapter']||'function'!=typeof this['adapter']['addComment']||!_0xf9e345['isSubmitted'])return Promise['resolve']();const _0x47906b=this['context']['plugins']['get']('PendingActions'),{channelId:_0x44d2c}=_0xf9e345,_0x55001a=_0x47906b['add'](Vt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return _0x52a577||(_0x52a577={}),this['adapter']['addComment']({'channelId':_0x44d2c,'threadId':_0x3446b4,'commentId':_0x234b62,'content':_0x55e1cc,'attributes':_0x52a577})['then'](_0x37cd18=>{_0x47906b['remove'](_0x55001a),_0x37cd18&&this['_updateComment']({'channelId':_0x44d2c,'threadId':_0x3446b4,'commentId':_0x234b62,'createdAt':_0x37cd18['createdAt'],'isFromAdapter':!0x0});})['catch'](_0x3babfa=>{throw console['error'](_0x3babfa),new _0x3a2101('commentsrepository-add-comment-internal-error',this);});}_updateComment({threadId:_0x4d5626,commentId:_0x4df6ff,content:_0x198079,createdAt:_0x37e4bb,attributes:_0x18cc74,isFromAdapter:_0x201e3b}){if(void 0x0!==_0x198079&&('string'!=typeof _0x198079||!_0x198079['trim']()['length']))throw new _0x3a2101('commentsrepository-update-comment-invalid-content');const _0x200727=this['getCommentThread'](_0x4d5626),_0x113b85=_0x200727['getComment'](_0x4df6ff);if(!_0x113b85)throw new _0x3a2101('commentsrepository-update-missing-comment',this);let _0x4998f1=!0x1;if(_0x198079&&_0x198079!==_0x113b85['content']&&(_0x113b85['isEditable']||_0x201e3b)&&(_0x113b85['content']=_0x198079,_0x4998f1=!0x0),_0x37e4bb&&_0x37e4bb!==_0x113b85['createdAt']&&(_0x113b85['createdAt']=_0x37e4bb,_0x113b85['isExternal']||(_0x113b85['authoredAt']=_0x37e4bb),_0x4998f1=!0x0),_0x18cc74&&!_0x40e030(_0x18cc74,_0x113b85['attributes'])&&(_0x113b85['attributes']=_0x18cc74,_0x4998f1=!0x0),!_0x4998f1)return Promise['resolve']();if(_0x200727['fire']('commentUpdated'),_0x201e3b||!this['adapter']||'function'!=typeof this['adapter']['updateComment'])return Promise['resolve']();const _0x591256=this['context']['plugins']['get']('PendingActions'),{channelId:_0x276533}=this['getCommentThread'](_0x113b85['threadId']),_0x3801c1=_0x591256['add'](Vt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['updateComment']({'channelId':_0x276533,'threadId':_0x4d5626,'commentId':_0x4df6ff,'content':_0x198079,'attributes':_0x18cc74})['then'](()=>_0x591256['remove'](_0x3801c1))['catch'](_0x4abae9=>{throw console['error'](_0x4abae9),new _0x3a2101('commentsrepository-update-comment-internal-error',this);});}_removeComment({threadId:_0x3dc5fa,commentId:_0x5e3c04,isFromAdapter:_0x3f9974}){const _0x1f780c=this['getCommentThread'](_0x3dc5fa),_0x5c0709=_0x1f780c['getComment'](_0x5e3c04);if(!_0x5c0709)throw new _0x3a2101('commentsrepository-remove-missing-comment',this);if(_0x1f780c['_remove'](_0x5c0709),_0x3f9974||!this['adapter']||'function'!=typeof this['adapter']['removeComment'])return Promise['resolve']();const _0xfc4f5e=this['context']['plugins']['get']('PendingActions'),{channelId:_0x5c12e6}=_0x1f780c,_0x3c017b=_0xfc4f5e['add'](Vt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['removeComment']({'channelId':_0x5c12e6,'threadId':_0x3dc5fa,'commentId':_0x5e3c04})['then'](()=>_0xfc4f5e['remove'](_0x3c017b))['catch'](_0x52192c=>{throw console['error'](_0x52192c),new _0x3a2101('commentsrepository-remove-comment-internal-error',this);});}},ge=class extends pe{['channelId'];['id'];_isAttached;_isSubmitted;comments;_repository;constructor(_0x4ca13a,_0x4a6971){super();const _0x4bb639=_0x4a6971['isResolvable'];this['channelId']=_0x4a6971['channelId'],this['id']=_0x4a6971['id'],this['comments']=new _0x1b9c8e(),this['_repository']=_0x4ca13a,this['_isAttached']=!0x1,this['_isSubmitted']=_0x4a6971['isSubmitted'],this['set']('_hasTargetInContent',!0x0),this['bind']('isReadOnly')['to'](_0x4ca13a,'_permissions',_0x4ca13a,'_readOnlyChannels',()=>_0x4ca13a['isReadOnly'](this['channelId'])),this['bind']('isRemovable')['to'](_0x4ca13a,'_permissions',()=>_0x4ca13a['getPermissions'](this['channelId'])['admin']),this['bind']('canComment')['to'](_0x4ca13a,'_permissions',()=>{const _0x1b694e=_0x4ca13a['getPermissions'](this['channelId']);return _0x1b694e['write']||_0x1b694e['admin'];}),this['bind']('isResolvable')['to'](_0x4ca13a,'_permissions',()=>_0x4bb639&&_0x4ca13a['getPermissions'](this['channelId'])['resolve']),this['set']('context',_0x4a6971['context']),this['bind']('archivedAt')['to'](this,'resolvedAt',this,'unlinkedAt',(_0x36292c,_0xe03179)=>_0x36292c?_0xe03179?_0x36292c<_0xe03179?_0x36292c:_0xe03179:_0x36292c:_0xe03179),this['set']('unlinkedAt',_0x4a6971['unlinkedAt']||null),this['set']('resolvedAt',_0x4a6971['resolvedAt']||null),this['set']('resolvedBy',_0x4a6971['resolvedBy']||null),this['bind']('isResolved')['to'](this,'resolvedAt',_0x44c085=>!!_0x44c085),this['set']('attributes',_0x4a6971['attributes']||{});}get weight(){return Array['from'](this['comments'])['reduce']((_0x414c6c,_0x17c082)=>_0x414c6c+_0x17c082['weight'],0x0);}get length(){return this['comments']['length'];}get isAttached(){return this['_isAttached'];}get isSubmitted(){return this['_isSubmitted'];}submit(){const {channelId:_0x27be2b,id:_0x4c0638}=this;this['_repository']['fire'](ve('submitCommentThread',_0x27be2b),{'channelId':_0x27be2b,'threadId':_0x4c0638});}setUnlinkedAt(_0x8f86){this['_update']({'unlinkedAt':_0x8f86});}['resolve']({resolvedAt:_0x5b7776=new Date(),resolvedBy:_0x10e396='',isFromAdapter:_0x64f7f3=!0x1}={}){const _0x358975=this['_repository']['context']['plugins']['get'](_0x2fb247)['me'],{channelId:_0x55e424,id:_0x4af43f}=this;this['_repository']['fire'](ve('resolveCommentThread',_0x55e424),{'channelId':_0x55e424,'threadId':_0x4af43f,'resolvedAt':_0x5b7776,'resolvedBy':_0x10e396||_0x358975['id'],'isFromAdapter':_0x64f7f3});}['reopen']({isFromAdapter:_0x3c2b97=!0x1}={}){const {channelId:_0x1d12dd,id:_0x29d1b0}=this;this['_repository']['fire'](ve('reopenCommentThread',_0x1d12dd),{'channelId':_0x1d12dd,'threadId':_0x29d1b0,'isFromAdapter':_0x3c2b97});}setContext(_0x2f6a2a){this['context']||this['_update']({'context':_0x2f6a2a});}setAttribute(_0x40f6da,_0x724ede){const _0x43f324=_0x56b638(this['attributes']);_0x1d593d(_0x43f324,_0x40f6da,_0x724ede),this['_update']({'attributes':_0x43f324});}removeAttribute(_0x5b0779){const _0x4ccc66=_0x56b638(this['attributes']);_0x40f5d1(_0x4ccc66,_0x5b0779),this['_update']({'attributes':_0x4ccc66});}['remove']({isFromAdapter:_0xa91f9d=!0x1}={}){const {channelId:_0x115aa7,id:_0x221ca1}=this;this['_repository']['fire'](ve('removeCommentThread',_0x115aa7),{'channelId':_0x115aa7,'threadId':_0x221ca1,'isFromAdapter':_0xa91f9d});}attachTo(_0x9f5d03){return this['_repository']['_attachCommentThread']({'threadId':this['id'],'target':_0x9f5d03});}addComment(_0x139a91){const {channelId:_0x1bb2d8,id:_0x3bb53d}=this;this['_repository']['fire'](ve('addComment',_0x1bb2d8,_0x3bb53d),Object['assign']({'channelId':_0x1bb2d8,'threadId':_0x3bb53d},_0x139a91));}getComment(_0x12579b){if('string'!=typeof _0x12579b)throw new _0x3a2101('commentsrepository-get-comment-invalid-id',null,{'commentId':_0x12579b});return this['comments']['get'](_0x12579b);}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'](_0x5b5103=>_0x5b5103['toJSON']()),'attributes':this['attributes']};}['_add'](_0x3ffe88){return this['listenTo'](_0x3ffe88,'change:authoredAt',()=>{const _0x1d610a=this['_findOptimalIndex'](_0x3ffe88),_0xcbe25d=this['comments'];_0x1d610a-0x1!=_0xcbe25d['getIndex'](_0x3ffe88)&&_0x1d610a+0x1!=_0xcbe25d['getIndex'](_0x3ffe88)&&(this['_remove'](_0x3ffe88),this['_add'](_0x3ffe88));}),this['comments']['add'](_0x3ffe88,this['_findOptimalIndex'](_0x3ffe88));}_update(_0x2ef9b4){const {channelId:_0x449825,id:_0x4049b2}=this;this['_repository']['fire'](ve('updateCommentThread',_0x449825),{..._0x2ef9b4,'channelId':_0x449825,'threadId':_0x4049b2});}['_remove'](_0x3b6cc6){return this['stopListening'](_0x3b6cc6),_0x3b6cc6['destroy'](),this['comments']['remove'](_0x3b6cc6);}_findOptimalIndex(_0x14a8ab){const _0x11277c=this['comments']['find'](_0x239937=>new Date(_0x239937['authoredAt'])['getTime']()>new Date(_0x14a8ab['authoredAt'])['getTime']());return _0x11277c?this['comments']['getIndex'](_0x11277c):this['length'];}},Ae=class extends _e{['id'];threadId;author;creator;createdAt;_repository;constructor(_0x9000ea,_0xeca2a6){super();const _0x15ee2c=_0x9000ea['context']['plugins']['get'](_0x2fb247)['me'],_0x2a18e3=_0x9000ea['getCommentThread'](_0xeca2a6['threadId']),_0x2fe5b5=0x0===_0x2a18e3['comments']['length'],_0x520328=_0x15ee2c===_0xeca2a6['author'];this['id']=_0xeca2a6['id'],this['threadId']=_0xeca2a6['threadId'],this['author']=_0xeca2a6['author'],this['creator']=_0xeca2a6['creator'],this['set']('content',_0xeca2a6['content']),this['createdAt']=_0xeca2a6['createdAt']||new Date(),this['set']('authoredAt',_0xeca2a6['authoredAt']||new Date()),this['bind']('resolvedAt')['to'](_0x2a18e3,'resolvedAt'),this['set']('attributes',_0xeca2a6['attributes']||{}),this['bind']('isEditable')['to'](_0x9000ea,'_permissions',()=>{const _0x125f4c=_0x9000ea['getPermissions'](_0x2a18e3['channelId'])['write'],_0x1b8736=_0x9000ea['getPermissions'](_0x2a18e3['channelId'])['modifyAll'];return _0x520328&&_0x125f4c||!_0x520328&&_0x1b8736;}),this['bind']('isRemovable')['to'](_0x2a18e3,'isRemovable',_0x9000ea,'_permissions',_0x51a5e4=>{const _0x5135c9=_0x9000ea['getPermissions'](_0x2a18e3['channelId'])['write'],_0x4cc2a0=_0x9000ea['getPermissions'](_0x2a18e3['channelId'])['modifyAll'];return _0x520328&&_0x5135c9||_0x51a5e4&&_0x2fe5b5||!_0x520328&&_0x4cc2a0&&!_0x2fe5b5;}),this['bind']('isReadOnly')['to'](_0x2a18e3,'isReadOnly'),this['_repository']=_0x9000ea;}get isExternal(){return Boolean(this['attributes']&&this['attributes']['@external']);}get weight(){return Math['max'](function(_0x494cb6){const _0x476dba=document['createElement']('div');return _0x476dba['innerHTML']=_0x3bd6cb(_0x494cb6),_0x476dba['textContent']['length'];}(this['content']),0xc8);}update(_0x1a4a90){const {threadId:_0xfeb7ab,id:_0x1eff4e}=this;if(!this['_repository']['hasCommentThread'](_0xfeb7ab))throw new _0x3a2101('commentsrepository-update-comment-missing-comment-thread',this);const {channelId:_0x3671a0}=this['_repository']['getCommentThread'](_0xfeb7ab);this['_repository']['fire'](ve('updateComment',_0x3671a0,_0xfeb7ab),{'channelId':_0x3671a0,'threadId':_0xfeb7ab,'commentId':_0x1eff4e,..._0x1a4a90});}setAttribute(_0x352aaf,_0x4982e6){const _0x52adb6=_0x56b638(this['attributes']);_0x1d593d(_0x52adb6,_0x352aaf,_0x4982e6),this['update']({'attributes':_0x52adb6});}removeAttribute(_0x21e6f3){const _0x59c64c=_0x56b638(this['attributes']);_0x40f5d1(_0x59c64c,_0x21e6f3),this['update']({'attributes':_0x59c64c});}['remove'](_0x5176dc={}){if(!_0x5176dc['isFromAdapter']&&!this['isRemovable'])return;const {threadId:_0x2f1de2,id:_0x355909}=this;if(!this['_repository']['hasCommentThread'](_0x2f1de2))throw new _0x3a2101('commentsrepository-remove-comment-missing-comment-thread',this);const {channelId:_0x13b511}=this['_repository']['getCommentThread'](_0x2f1de2);this['_repository']['fire'](ve('removeComment',_0x13b511,_0x2f1de2),{'channelId':_0x13b511,'threadId':_0x2f1de2,'commentId':_0x355909,..._0x5176dc});}toJSON(){return{'commentId':this['id'],'content':this['content'],'createdAt':this['createdAt'],'authorId':this['creator']['id'],'attributes':this['attributes']};}destroy(){this['stopListening']();}};function ve(_0x183410,..._0x102a5a){for(const _0x15912e of _0x102a5a)void 0x0!==_0x15912e&&(_0x183410+=':'+String(_0x15912e));return _0x183410;}var Te=class extends _0x4df77b{constructor(_0x4787b5){super(_0x4787b5),this['set']('hasContent',!0x1);}['refresh'](){const _0x5b68a5=this['editor']['model']['document']['selection'];this['isEnabled']=!0x0,this['hasContent']=!0x1;for(const _0x135c4f of _0x5b68a5['getRanges']())if(this['_hasContent'](_0x135c4f))return void(this['hasContent']=!0x0);}execute({threadId:_0x2641a2=_0x3370ee(),ranges:_0x260593,comment:_0x3f580b}={}){const _0x3139ba=this['editor']['model'],_0x5827fa=_0x260593??Array['from'](_0x3139ba['document']['selection']['getRanges']()),_0x24b9e2=[];for(const _0x55167c of _0x5827fa)this['_hasContent'](_0x55167c)&&_0x24b9e2['push'](this['_trimToContent'](_0x55167c));if(!_0x24b9e2['length'])throw new _0x3a2101('addcommentthreadcommand-incorrect-ranges',null);_0x3f580b&&this['_createCommentThread'](_0x2641a2,_0x3f580b),this['_createMarkersFromRanges'](_0x2641a2,_0x24b9e2,!!_0x3f580b);}_createMarkersFromRanges(_0xf115c4,_0x421879,_0x4bc828){this['editor']['model']['change'](_0x2b0066=>{for(const _0x51f313 of _0x421879){const _0x21d203='comment:'+_0xf115c4+':'+_0x3370ee()['substr'](0x1,0x5);_0x2b0066['addMarker'](_0x21d203,{'range':_0x51f313,'usingOperation':_0x4bc828,'affectsData':_0x4bc828});}});}_createCommentThread(_0x13745e,_0x29bc31){const _0x2a5957=this['editor']['plugins']['get']('CommentsRepository'),_0x13ac8f=this['editor']['config']['get']('collaboration.channelId'),_0x8cf472=this['editor']['plugins']['get']('Users')['me'];if(!_0x8cf472)throw new _0x3a2101('addcommentthreadcommand-user-not-found',null);_0x2a5957['addCommentThread']({'threadId':_0x13745e,'channelId':_0x13ac8f,'comments':[{'authorId':_0x8cf472['id'],'content':_0x29bc31,'createdAt':new Date(),'attributes':{}}]});}_hasContent(_0x3c4951){for(const _0x2aa343 of _0x3c4951['getItems']())if(this['_itemIsContent'](_0x2aa343))return!0x0;return!0x1;}_itemIsContent(_0x38e1ad){return _0x38e1ad['is']('$textProxy')||this['editor']['model']['schema']['isObject'](_0x38e1ad)&&!_0x38e1ad['is']('element','tableCell');}_trimToContent(_0x28fe9c){const _0x4cd8f4=_0x22b221=>!this['_itemIsContent'](_0x22b221['item']),_0x216bff=_0x28fe9c['start']['getLastMatchingPosition'](_0x4cd8f4),_0x37acce=_0x28fe9c['end']['getLastMatchingPosition'](_0x4cd8f4,{'direction':'backward'});return this['editor']['model']['createRange'](_0x216bff,_0x37acce);}},ye=class extends _0x327214{_dataCollectors;_editorAnnotations;static get requires(){return[me];}static get['pluginName'](){return'EditorAnnotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x40f5c0){super(_0x40f5c0),this['_dataCollectors']=new Set(),this['_editorAnnotations']=new Set();}init(){const _0x203f6c=this['editor'],_0x208705=_0x203f6c['model']['document']['selection'],_0x2b0139=_0x42d68c(()=>this['refreshSelectedViews'](),0xa);_0x208705['on']('change:range',(_0x12e7ea,_0x5b4e7e)=>{_0x5b4e7e['directChange']&&(_0x2b0139['cancel'](),this['refreshSelectedViews']());}),this['listenTo'](_0x203f6c['editing']['view']['document'],'change:isFocused',(_0x213bd2,_0x1e8418,_0x530a66)=>{_0x530a66&&_0x2b0139();}),this['listenTo'](_0x203f6c['ui']['focusTracker'],'change:isFocused',(_0x514b7e,_0x21e4d1,_0x5f0874)=>{_0x5f0874||this['fire']('blur',{'isAnnotationTracked':_0x7c7049=>this['_editorAnnotationsData']['has'](_0x7c7049['innerView'])});}),this['listenTo'](this['editor']['ui'],'update',()=>this['fire']('uiUpdate'));}registerAnnotation(_0x542d3a){if(this['_editorAnnotations']['has'](_0x542d3a['view']))return;this['_editorAnnotations']['add'](_0x542d3a['view']),this['editor']['ui']['focusTracker']['add'](_0x542d3a['view']['element']);const _0x311a40=this['editor']['plugins']['get'](me);this['listenTo'](_0x311a40['collection'],'remove',(_0x196654,_0x55e20f)=>{this['editor']['ui']['focusTracker']['remove'](_0x55e20f['view']['element']),this['_editorAnnotations']['delete'](_0x55e20f['view']);});}hasDomSelection(){return this['editor']['editing']['view']['hasDomSelection'];}addSourceCollector(_0x27818b){if('function'!=typeof _0x27818b)throw new _0x3a2101('editorannotations-invalid-source-callback');this['_dataCollectors']['add'](_0x27818b);}refreshSelectedViews(){this['fire']('refresh');}getOrderedSelectedAnnotations({activeAnnotation:_0x42d8ee,annotations:_0x2d0512}){const _0x589fc1=[],_0x561fb5=this['editor']['model']['document']['selection'],_0x282ca0=Array['from'](_0x561fb5['getRanges']());for(const [_0x14d031,_0x5efd0e]of this['_editorAnnotationsData']){const _0x41790b=_0x34d630(_0x5efd0e),_0x28872c=_0x2d0512['getByInnerView'](_0x14d031);_0x41790b&&_0x28872c&&_0x589fc1['push']({'annotation':_0x28872c,'range':_0x41790b});}function _0x34d630(_0x27c02a){for(const _0x444ca8 of _0x27c02a)for(const _0x12715f of _0x282ca0)if(_0x444ca8['containsRange'](_0x12715f,!_0x561fb5['isCollapsed']))return _0x444ca8;return null;}const _0x50ef16=new Map(Array['from'](_0x2d0512,(_0x455f40,_0x116731)=>[_0x455f40,_0x116731]));return _0x589fc1['sort']((_0xd6d86a,_0x24b72c)=>{const _0x23b70f=_0xd6d86a['range'],_0x2c287a=_0x24b72c['range'];if(!_0x23b70f['start']['isTouching'](_0x2c287a['start'])||!_0x23b70f['end']['isTouching'](_0x2c287a['end'])){if(_0x23b70f['containsRange'](_0x2c287a,!0x0))return 0x1;if(_0x2c287a['containsRange'](_0x23b70f,!0x0))return-0x1;}return _0xd6d86a['annotation']==_0x42d8ee?-0x1:_0x24b72c['annotation']==_0x42d8ee?0x1:(_0x50ef16['get'](_0xd6d86a['annotation'])??0x0)-(_0x50ef16['get'](_0x24b72c['annotation'])??0x0);})['map'](_0x459bab=>_0x459bab['annotation']);}get _editorAnnotationsData(){const _0x1816f8=new Map();for(const _0x4cf31e of Array['from'](this['_dataCollectors']))for(const [_0x2873e9,_0x2eed9f]of _0x4cf31e())_0x1816f8['set'](_0x2873e9,_0x2eed9f);return _0x1816f8;}},Ce=class extends _0x327214{afterInit(){const _0xade2c1=this['editor'];_0xade2c1['plugins']['has']('RestrictedEditingModeEditing')&&_0xade2c1['plugins']['get']('RestrictedEditingModeEditing')['enableCommand']('addCommentThread');}},Ie=class extends _0x327214{constructor(_0x1dff75){super(_0x1dff75),this['editor']['config']['define']('importWord.formatting.comments','basic');}afterInit(){const _0x45f1df=this['editor'],_0x17294c=_0x45f1df['commands']['get']('importWord'),_0x222f77=_0x45f1df['plugins']['get'](_0x2fb247);_0x17294c&&(_0x17294c['on']('execute',(_0x15b99c,[,_0x368c2c])=>{_0x368c2c['collaboration_features']={'comments':!0x0,'user_id':_0x222f77['me']['id']};},{'priority':_0x44687d['high']+0xa}),this['listenTo'](_0x17294c,'dataInsert',this['_handleImportedData']));}_handleImportedData(_0x9a604f,_0x12b014){const {comment_threads:_0x3743dc}=_0x12b014;_0x3743dc&&_0x3743dc['forEach'](({thread_id:_0x235a84,comments:_0x32993a,is_resolved:_0x918379})=>{const _0x1139b3=new Date(),_0xef9d9=_0x32993a['map'](({author:_0x2849ef,content:_0x5aa26b,created_at:_0x3ac32a})=>({'content':_0x5aa26b,'authorId':this['editor']['plugins']['get'](_0x2fb247)['me']['id'],'createdAt':_0x1139b3,'attributes':{'@external':{'authorName':_0x2849ef,'createdAt':_0x3ac32a?new Date(_0x3ac32a):new Date(),'source':'importWord'}}})),_0x5b04a5=this['editor']['config']['get']('collaboration.channelId');this['editor']['plugins']['get'](we)['addCommentThread']({'channelId':_0x5b04a5,'threadId':_0x235a84,'comments':_0xef9d9,'resolvedAt':_0x918379?_0x1139b3:null});});}},be=class extends _0x327214{constructor(_0x26a8a7){super(_0x26a8a7),this['editor']['config']['define']('comments.copyMarkers','default');}static get requires(){return[Et,kt];}afterInit(){const _0x2f190d=this['editor']['plugins']['get']('ClipboardPipeline');this['_registerMarkerInClipboardPipeline'](),this['listenTo'](_0x2f190d,'contentInsertion',(_0x2cf9eb,_0x1fd065)=>this['_removeMarkersWithoutThreads'](_0x1fd065['content']['markers']),{'priority':'highest'});}_removeMarkersWithoutThreads(_0x48c68b){if(!this['editor']['plugins']['has']('CommentsRepository'))return _0x48c68b;const _0xb0b56e=this['editor']['plugins']['get']('CommentsRepository');for(const _0x31a73d of _0x48c68b['keys']()){const [_0x2b22f3,_0x5763de]=_0x31a73d['split'](':');'comment'!=_0x2b22f3||_0xb0b56e['hasCommentThread'](_0x5763de)||_0x48c68b['delete'](_0x31a73d);}return _0x48c68b;}_registerMarkerInClipboardPipeline(){const _0x221693=this['editor']['plugins']['get']('ClipboardMarkersUtils'),_0x198cde=this['_mapCommentsCopyConfigToRegisterConfiguration'](this['editor']['config']['get']('comments.copyMarkers'));_0x198cde&&_0x221693['_registerMarkerToCopy']('comment',_0x198cde);}_mapCommentsCopyConfigToRegisterConfiguration(_0x534a9b){switch(_0x534a9b){case'always':return{'allowedActions':'all','copyPartiallySelected':!0x1,'duplicateOnPaste':!0x0};case'default':return{'allowedActions':['cut','dragstart'],'copyPartiallySelected':!0x1,'duplicateOnPaste':!0x1};default:return null;}}};function Ee(_0x4474ff){const _0x5a0877=_0x4474ff['split'](':');return{'group':_0x5a0877[0x0],'id':_0x5a0877[0x1],'part':_0x5a0877[0x2]};}var ke=class extends _0x327214{init(){this['overrideMarkerConverters'](),this['overrideHorizontalRuleConverter'](),this['overrideImageInlineConverter'](),this['overrideMediaEmbedConverter']();}overrideMarkerConverters(){this['editor']['conversion']['for']('dataDowncast')['markerToHighlight']({'model':'comment','view':(_0x8ad948,_0x3e4195)=>{if(!_0x3e4195['options']['showCommentHighlights'])return null;if(_0x3e4195['options']['ignoreResolvedComments']){const {id:_0x32cb90}=Ee(_0x8ad948['markerName']);if(this['editor']['plugins']['get'](we)['getCommentThread'](_0x32cb90)?.['isResolved']&&_0x8ad948['item'])return _0x3e4195['consumable']['consume'](_0x8ad948['item'],'addMarker:'+_0x8ad948['markerName']),_0x3e4195['consumable']['consume'](_0x8ad948['item'],'removeMarker:'+_0x8ad948['markerName']),null;}return{'classes':['ck-comment-marker']};}}),this['editor']['conversion']['for']('dataDowncast')['add'](_0x13759b=>{_0x13759b['on']('addMarker:comment',(_0x3d8883,_0x4ed5a5,_0x259294)=>{if(!_0x259294['options']['showCommentHighlights'])return;const _0x1473b2=_0x4ed5a5['item'];if(!_0x1473b2)return;const _0x330ac4=_0x259294['mapper']['toViewElement'](_0x1473b2);this['editor']['model']['schema']['isObject'](_0x1473b2)&&_0x330ac4&&!_0x330ac4['getCustomProperty']('widget')&&_0x330ac4['is']('containerElement')&&Pt(_0x330ac4,_0x259294['writer']);},{'priority':'high'});});}overrideHorizontalRuleConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToStructure']({'model':'horizontalLine','view':(_0x3134df,{writer:_0x3f47d0,options:_0x3e6a19})=>{if(!_0x3e6a19['showCommentHighlights'])return null;const _0xa6cbf5=_0x3f47d0['createContainerElement']('div'),_0x3d2134=_0x3f47d0['createEmptyElement']('hr');return _0x3f47d0['addClass']('ck-horizontal-line',_0xa6cbf5),_0x3f47d0['insert'](_0x3f47d0['createPositionAt'](_0xa6cbf5,0x0),_0x3d2134),_0xa6cbf5;},'converterPriority':'high'});}overrideImageInlineConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToStructure']({'model':'imageInline','view':(_0x1a899a,{writer:_0x45adfc,options:_0x299da2})=>{if(!_0x299da2['showCommentHighlights'])return null;const _0x166626=_0x45adfc['createContainerElement']('span'),_0x56dad9=_0x45adfc['createEmptyElement']('img');return _0x45adfc['addClass']('image-inline',_0x166626),_0x45adfc['insert'](_0x45adfc['createPositionAt'](_0x166626,0x0),_0x56dad9),_0x166626;},'converterPriority':'high'});}overrideMediaEmbedConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToElement']({'model':'media','view':(_0x3b22c4,{writer:_0x25e959,options:_0x20e197})=>{if(_0x20e197['showCommentHighlights'])return _0x25e959['createEmptyElement']('div');},'converterPriority':'high'}),this['editor']['data']['downcastDispatcher']['on']('attribute:url:media',(_0x4230ee,_0x1a3e3e,_0x2e0138)=>{_0x2e0138['options']['showCommentHighlights']&&_0x4230ee['stop']();},{'priority':'high'});}},Ne=class extends _0x327214{static get requires(){return[we,ye,_0x2fb247,Ce,Ie,be,ke];}static get['pluginName'](){return'CommentsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x10bd39){super(_0x10bd39),this['set']('isThreadsLoadingPaused',!0x0),_0x10bd39['data']['once']('ready',()=>this['isThreadsLoadingPaused']=!0x1),this['set']('activeMarker',null),this['on']('change:activeMarker',(_0xca6411,_0x822483,_0x1f883e,_0x398b2c)=>{const _0x24f498=_0x10bd39['plugins']['get'](we),_0xee674e=_0x1f883e?Ee(_0x1f883e)['id']:null;_0x10bd39['model']['change'](()=>{if(_0xee674e){const _0x419101=this['getAllMarkersForId'](_0xee674e);for(const _0x307434 of _0x419101)_0x10bd39['editing']['reconvertMarker'](_0x307434);}if(_0x398b2c){const {id:_0x365dca}=Ee(_0x398b2c),_0x2dc991=_0x24f498['getCommentThread'](_0x365dca);if(_0x2dc991&&_0x2dc991['unlinkedAt'])return;if(_0x2dc991&&!_0x2dc991['isAttached'])return;const _0x5dcc2c=this['getAllMarkersForId'](_0x365dca);for(const _0x437d8d of _0x5dcc2c)_0x10bd39['editing']['reconvertMarker'](_0x437d8d);}}),_0xee674e&&this['scrollToThreadMarker'](_0xee674e);}),this['_initAriaMarkerChangeAnnouncements']();}init(){const _0x526985=this['editor'],_0x2ded46=_0x526985['plugins']['get'](we),_0x439203=_0x526985['config']['get']('collaboration.channelId'),_0x5146d5=_0x2ded46['getCommentThreads']()['filter'](_0x48c18f=>_0x48c18f['channelId']!==_0x439203);_0x526985['commands']['add']('addCommentThread',new Te(_0x526985)),this['listenTo'](_0x526985,'change:isReadOnly',(_0x4b0922,_0xfe00d3,_0x38a8be)=>{_0x2ded46['switchReadOnly'](_0x38a8be,_0x526985['config']['get']('collaboration.channelId'));}),this['listenTo'](_0x2ded46,Oe('addCommentThread',_0x439203),(_0x3c06f9,{threadId:_0x491004})=>{this['editor']['plugins']['get'](we)['getCommentThread'](_0x491004)?.['unlinkedAt']&&this['_attachArchivedThread'](_0x491004);}),this['listenTo'](_0x2ded46,Oe('removeCommentThread',_0x439203),(_0x4614eb,{threadId:_0x2a207a})=>{_0x526985['model']['enqueueChange']({'isUndoable':!0x1},_0xf0cfa3=>{const _0x4d1df6=this['getAllMarkersForId'](_0x2a207a);for(const _0x5e5561 of _0x4d1df6)_0xf0cfa3['removeMarker'](_0x5e5561);});}),this['listenTo'](_0x2ded46,Oe('resolveCommentThread',_0x439203),(_0x42a205,{threadId:_0x5f25c0})=>{this['_reconvertMarkers'](_0x5f25c0);const _0x41de6c=this['editor']['plugins']['get'](me);(this['editor']['editing']['view']['hasDomSelection']||_0x41de6c['collection']['isFocused'])&&(this['editor']['plugins']['get'](we)['getCommentThread'](_0x5f25c0)['unlinkedAt']||this['editor']['editing']['view']['focus']());},{'priority':'low'}),this['listenTo'](_0x2ded46,Oe('reopenCommentThread',_0x439203),(_0x50f547,{threadId:_0x224620})=>{this['_reconvertMarkers'](_0x224620);},{'priority':'low'}),this['listenTo'](_0x2ded46,Oe('addComment',_0x439203),(_0x1a744f,{threadId:_0x5db0b8,isFromAdapter:_0x1d1b89})=>{const _0x6c052b=this['getAllMarkersForId'](_0x5db0b8);!_0x1d1b89&&0x0!=_0x6c052b['length']&&_0x2ded46['hasCommentThread'](_0x5db0b8)&&0x1===_0x2ded46['getCommentThread'](_0x5db0b8)['length']&&_0x526985['model']['enqueueChange']({'isUndoable':!0x1},_0x27dda1=>{for(const _0x25d29e of _0x6c052b)_0x27dda1['updateMarker'](_0x25d29e,{'usingOperation':!0x0,'affectsData':!0x0});});},{'priority':'low'}),this['_initializeMarkerConverters'](),this['_handleMarkerAddAndRemove'](),this['_handleInitialThreads'](_0x5146d5);}afterInit(){!async function(_0x23e283){const _0xfa5c99='uizTdvyBIa4RKsnOYmEXGMfjehwJQqbPSCk7DtZgF58Lxl29Ho6cAUW1pV3Nr0',_0x84ff42=0x799b0,_0x8f847={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x53ff79(_0x4ddaae){const _0x1cdfe5=new window['Promise'](_0x212b4e=>{_0x4ddaae['once']('ready',_0x212b4e);}),_0x13a359=window['Date']['now'](),_0x248516=_0x4ddaae['config']['get']('licenseKey');async function _0x4c15b3(){let _0x13f689,_0xce9752=null,_0x107b2f=null;try{return'GPL'==_0x248516?'NotAllowed':(_0x13f689=_0x80e69c(),_0x13f689?(_0x13f689['usageEndpoint']&&(_0x107b2f=_0x25d712(_0x13f689['usageEndpoint'],_0x13f689['jti'])),await _0xf18409()?_0x17811c()?_0x3f5843()?'Expired':_0x53ed10()?('evaluation'==_0x13f689['licenseType']&&(_0xce9752=_0x1116e7('EvaluationLimit')),await _0x3bd171()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x3f5843(){const _0x50e8dc=['evaluation','trial']['includes'](_0x13f689['licenseType'])?_0x13a359/0x3e8:0xe10*_0x84ff42;return _0x13f689['exp']<_0x50e8dc;}function _0x17811c(){const _0x56e525=_0x13f689['features'];if(!_0x56e525)return!0x1;if(_0x56e525['includes']('*'))return!0x0;if(_0x56e525['includes']('CMT'))return!0x0;if(_0x56e525['includes']('TRILIUM')&&_0x5f4e59())return!0x0;if(_0x56e525['includes']('RCMT')){if(_0x19d389())return!0x0;if(_0x1c19f3()||_0x1591c8())return!0x0;}return!0x1;}function _0x53ed10(){const _0x5183ef=_0x13f689['licensedHosts'];if(!_0x5183ef||0x0==_0x5183ef['length'])return!0x0;const {hostname:_0x3dccfd}=new URL(window['location']['href']);if(_0x5183ef['includes'](_0x3dccfd))return!0x0;const _0x93e545=_0x3dccfd['split']('.');return _0x5183ef['filter'](_0x244178=>_0x244178['includes']('*'))['map'](_0x4e8917=>_0x4e8917['split']('.'))['filter'](_0x1ed22b=>_0x1ed22b['length']<=_0x93e545['length'])['map'](_0x543ce4=>Array(_0x93e545['length']-_0x543ce4['length'])['fill']('*'===_0x543ce4[0x0]?'*':'')['concat'](_0x543ce4))['some'](_0x6eddc2=>_0x93e545['every']((_0x3d7e90,_0x3f2d9a)=>_0x6eddc2[_0x3f2d9a]===_0x3d7e90||'*'===_0x6eddc2[_0x3f2d9a]));}function _0x3bd171(){return _0xce9752&&_0x107b2f?new window['Promise']((_0x136774,_0x22564f)=>{_0xce9752['then'](_0x136774,_0x22564f),_0x107b2f['then'](_0x6592f2=>{'Valid'!=_0x6592f2&&_0x136774(_0x6592f2);},_0x22564f);}):_0xce9752||_0x107b2f||'Valid';}}function _0x25d712(_0x1e0af5,_0xc34f35){return new window['Promise'](_0x4e8907=>{if(_0x536b1c())return _0x4e8907('Valid');_0x2ce78c(),_0x4ddaae['decorate']('_sendUsageRequest');let _0x216c10=!0x1;const _0x8031f5=_0x3370ee();function _0x58f6a5(_0x5017f7){return!!_0x5017f7&&('object'==typeof _0x5017f7||'function'==typeof _0x5017f7)&&'function'==typeof _0x5017f7['then']&&'function'==typeof _0x5017f7['catch'];}function _0x839cd2(_0x59bba2){_0x2d2cfd(_0x59bba2)['then'](_0x24988c=>_0x24988c&&'ok'==_0x24988c['status']?_0x379704(_0x150e88(_0x8031f5+_0xc34f35))!=_0x24988c['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x51dd2b=>(_0x52407d(),_0x51dd2b),()=>{const _0x2e388e=_0x42ccb3();return null==_0x2e388e?(_0x52407d(),'Valid'):_0x13a359-_0x2e388e>0x240c8400?'UsageLimit':'Valid';})['then'](_0x4e8907)['catch'](()=>{_0x4e8907('UsageLimit');});const _0x3d6e55=0x36ee80;function _0x52407d(){const _0x7008f7='llct-'+_0x379704(_0x150e88(_0x1e0af5)),_0x2472bc=_0x454583(_0x379704(window['Math']['ceil'](_0x13a359/_0x3d6e55)));window['localStorage']['setItem'](_0x7008f7,_0x2472bc);}function _0x42ccb3(){const _0x4e6f67='llct-'+_0x379704(_0x150e88(_0x1e0af5)),_0x47f0a1=window['localStorage']['getItem'](_0x4e6f67);return _0x47f0a1?window['parseInt'](_0x454583(_0x47f0a1),0x10)*_0x3d6e55:null;}function _0x2d2cfd(_0xeda9c9){return new window['Promise']((_0x27882f,_0x6c3636)=>{_0xeda9c9['then'](_0x27882f,_0x6c3636),window['setTimeout'](_0x6c3636,0x1d4c0);});}}_0x4ddaae['on']('_sendUsageRequest',(_0x661428,_0x21c087)=>{if(_0x21c087[0x0]!=_0x1e0af5)return _0x4e8907('UsageLimit');_0x21c087[0x1]={..._0x21c087[0x1],'requestId':_0x8031f5};},{'priority':'high'}),_0x4ddaae['on']('_sendUsageRequest',_0x40ff32=>{_0x58f6a5(_0x40ff32['return'])&&(_0x216c10=!0x0,_0x839cd2(_0x40ff32['return']));},{'priority':'low'}),_0x1cdfe5['then'](()=>{_0x216c10||_0x4e8907('UsageLimit');});});function _0x536b1c(){return'auto'==_0x4ddaae['editing']['view']['_overlayModeHint'];}function _0x2ce78c(){_0x4ddaae['editing']['view']['_overlayModeHint']='auto';}}function _0x1116e7(_0x209201){const _0x203090=[new window['Promise'](_0x4b2c17=>setTimeout(_0x4b2c17,0x93ecc)),_0x1cdfe5['then'](()=>new window['Promise'](_0x2bb241=>{let _0x2a76ab=0x0;_0x4ddaae['model']['on']('applyOperation',(_0x263ab9,_0x49ee46)=>{_0x49ee46[0x0]['isDocumentOperation']&&_0x2a76ab++,0x5e8==_0x2a76ab&&(_0x2bb241(),_0x263ab9['off']());});}))];return window['Promise']['race'](_0x203090)['then'](()=>_0x209201);}async function _0x599ba4(){await _0x1cdfe5,_0x4ddaae['model']['change']=_0x18abea,_0x4ddaae['model']['enqueueChange']=_0x18abea,_0x4ddaae['enableReadOnlyMode']('model');}function _0x5f4e59(){return window['glob']&&window['glob']['triliumVersion'];}function _0x19d389(){return _0x10248f('WebSocketGateway')&&'connected'==_0x2e7d58('WebSocketGateway')['state'];}function _0x1c19f3(){return _0x10248f('RevisionViewerIntegration');}function _0x1591c8(){return _0x10248f('TrackChangesDataGetter');}function _0x2fb2d1(_0x290f0d){const _0x237b13=_0x25b7e2();_0x4ddaae[_0x237b13]='commentsLicenseKey'+_0x290f0d,'Valid'!=_0x290f0d&&_0x599ba4();}function _0x25b7e2(){const _0x545400=window['String'](window['performance']['now']())['replace']('.','');let _0x149702='u';for(let _0x5641ff=0x0;_0x5641ff<_0x545400['length'];_0x5641ff+=0x2){let _0x8321c9=window['parseInt'](_0x545400['substring'](_0x5641ff,_0x5641ff+0x2));_0x8321c9>=0x3e&&(_0x8321c9-=0x3e),_0x149702+=_0xfa5c99[_0x8321c9];}return _0x149702;}function _0x80e69c(){const _0x4b2e26=_0x248516['split']('.');if(0x3!=_0x4b2e26['length'])return null;return _0x271e5c(_0x4b2e26[0x1]);function _0x271e5c(_0x556138){const _0x5d1da9=_0x53c467(_0x556138);return _0x5d1da9&&_0x5b0757()?_0x5d1da9:null;function _0x5b0757(){const _0x4530eb=_0x5d1da9['jti'],_0x335905=window['parseInt'](_0x4530eb['substring'](_0x4530eb['length']-0x8),0x10),_0x312d2c={..._0x5d1da9,'jti':_0x4530eb['substring'](0x0,_0x4530eb['length']-0x8)};return delete _0x312d2c['vc'],_0x150e88(_0x312d2c)==_0x335905;}}}async function _0xf18409(){let _0x4f6f3d=!0x0;try{const [_0x166782,_0x35f92a,_0x495b59]=_0x248516['split']('.');return _0x257723(_0x166782),await _0x2d2884(_0x166782,_0x35f92a,_0x495b59),_0x4f6f3d;}catch{return!0x1;}function _0x257723(_0x1cd658){const _0x450398=_0x53c467(_0x1cd658);_0x450398&&'ES256'==_0x450398['alg']||(_0x4f6f3d=!0x1);}async function _0x2d2884(_0x1295f5,_0x302ec5,_0x394ad6){const _0x30036b=window['Uint8Array']['from'](_0x1e6c31(_0x394ad6),_0x50efaa=>_0x50efaa['charCodeAt'](0x0)),_0x42e4d6=new window['TextEncoder']()['encode'](_0x1295f5+'.'+_0x302ec5),_0x148e79=window['crypto']['subtle'];if(!_0x148e79)return;const _0x16a9f0=await _0x148e79['importKey']('jwk',_0x8f847,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x148e79['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x16a9f0,_0x30036b,_0x42e4d6)||(_0x4f6f3d=!0x1);}}function _0x53c467(_0x2aab35){return _0x2aab35['startsWith']('ey')?JSON['parse'](_0x1e6c31(_0x2aab35)):null;}function _0x1e6c31(_0x56c6f9){return window['atob'](_0x56c6f9['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x150e88(_0x4e371f){let _0x213608=0x1505;function _0x420057(_0x89519c){for(let _0x4e2cf9=0x0;_0x4e2cf9<_0x89519c['length'];_0x4e2cf9++){const _0x42cf4e=_0x89519c['charCodeAt'](_0x4e2cf9);_0x213608=(_0x213608<<0x5)+_0x213608+_0x42cf4e,_0x213608&=_0x213608;}}function _0xc98072(_0xa04953){Array['isArray'](_0xa04953)?_0xa04953['forEach'](_0xc98072):_0xa04953&&'object'==typeof _0xa04953?Object['entries'](_0xa04953)['sort']()['forEach'](([_0x2c8a6d,_0x145e85])=>{_0x420057(_0x2c8a6d),_0xc98072(_0x145e85);}):_0x420057(window['String'](_0xa04953));}return _0xc98072(_0x4e371f),_0x213608>>>0x0;}function _0x379704(_0x16b5d6){return _0x16b5d6['toString'](0x10)['padStart'](0x8,'0');}function _0x454583(_0x20c687){return _0x20c687['split']('')['reverse']()['join']('');}function _0x10248f(_0x28ed27){return _0x4ddaae['plugins']['has'](_0x28ed27);}function _0x2e7d58(_0x1b722f){return _0x4ddaae['plugins']['get'](_0x1b722f);}function _0x18abea(){}_0x2fb2d1(await _0x4c15b3());}_0x53ff79(_0x23e283['editor']);}(this);}destroy(){const _0x492e63=this['editor']['plugins']['get'](we),_0x247591=this['editor']['config']['get']('collaboration.channelId');for(const _0x28b441 of _0x492e63['getCommentThreads']({'channelId':_0x247591}))_0x492e63['_detachCommentThread'](_0x28b441['id']),_0x492e63['_threads']['delete'](_0x28b441['id']);super['destroy']();}['hasMarkerForId'](_0x11bf8e){return this['getAllMarkersForId'](_0x11bf8e)['length']>0x0;}getAllMarkersForId(_0x562320){const _0x42227e=[];for(const _0x5deea4 of this['editor']['model']['markers'])_0x5deea4['name']['startsWith']('comment:'+_0x562320)&&_0x42227e['push'](_0x5deea4);return _0x42227e;}['scrollToThreadMarker'](_0x22908c){setTimeout(()=>{const _0x487cce=this['_getTargetForId'](_0x22908c);_0x487cce&&this['activeMarker']&&Ee(this['activeMarker'])['id']===_0x22908c&&_0x472ecb({'target':_0x487cce[0x0],'viewportOffset':0x64,'alignToTop':!0x0});},0x32);}_reconvertMarkers(_0xb72009){this['editor']['model']['change'](()=>{for(const _0xf76098 of this['getAllMarkersForId'](_0xb72009))this['editor']['editing']['reconvertMarker'](_0xf76098);});}_attachArchivedThread(_0x52b8f9){const _0x5967d7=this['editor']['plugins']['get'](we),_0x2cdcf4=this['editor']['plugins']['get'](ye),_0x42a185=_0x5967d7['getCommentThread'](_0x52b8f9);if(!_0x42a185['isAttached']){const _0x2f7bff=_0x42a185['attachTo'](()=>this['_getTargetForId'](_0x42a185['id']));_0x2cdcf4['registerAnnotation'](_0x2f7bff),_0x42a185['_hasTargetInContent']=!0x1;}}_initializeMarkerConverters(){const _0x20d6dc=this['editor'],_0x7f78f5=_0x20d6dc['plugins']['get'](_0x2fb247);_0x20d6dc['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'comment','view':(_0x4dcd10,_0xb171ae)=>{const {id:_0x2fd62a}=Ee(_0x4dcd10['markerName']),_0x12bda6=_0x20d6dc['plugins']['get'](we)['getCommentThread'](_0x2fd62a),_0x5d99ba=this['activeMarker']&&Ee(this['activeMarker'])['id']===_0x2fd62a;let _0x5e1ac9;if(_0x12bda6&&_0x12bda6['isResolved']&&!_0x5d99ba&&_0x4dcd10['item'])return _0xb171ae['consumable']['consume'](_0x4dcd10['item'],'addMarker:'+_0x4dcd10['markerName']),_0xb171ae['consumable']['consume'](_0x4dcd10['item'],'removeMarker:'+_0x4dcd10['markerName']),null;const _0x1d7433=['ck-comment-marker'];return _0x5d99ba&&_0x1d7433['push']('ck-comment-marker--active'),_0x5e1ac9=_0x12bda6?.['length']?_0x12bda6['comments']['first']['author']['id']:_0x7f78f5['me']['id'],{'classes':_0x1d7433,'attributes':{'data-comment':_0x2fd62a,'data-author-id':_0x5e1ac9}};}}),_0x20d6dc['conversion']['for']('dataDowncast')['markerToData']({'model':'comment','view':(_0x45bd25,{options:_0x407c20})=>{if(_0x407c20['showCommentHighlights'])return null;const _0x5adff3=_0x20d6dc['plugins']['get'](we),_0x4266b2=_0x20d6dc['model']['markers']['get'](_0x45bd25),{id:_0x31f88b,part:_0x224e37}=Ee(_0x45bd25);return _0x4266b2&&!_0x4266b2['affectsData']||_0x407c20['ignoreResolvedComments']&&_0x5adff3['getCommentThread'](_0x31f88b)?.['isResolved']?null:{'group':'comment','name':_0x224e37?_0x31f88b+':'+_0x224e37:_0x31f88b};}}),_0x20d6dc['conversion']['for']('upcast')['elementToElement']({'view':{'name':'comment','attributes':{'id':/^\w/}},'model':(_0x41e9ba,{writer:_0x427b71})=>_0x427b71['createElement']('$marker',{'data-name':'comment:'+_0x41e9ba['getAttribute']('id')})}),_0x20d6dc['conversion']['for']('upcast')['dataToMarker']({'view':'comment'});}['_handleMarkerAddAndRemove'](){const _0x137b88=this['editor'],_0x37c03c=_0x137b88['plugins']['get'](we),_0xc80664=new Set(),_0x55166a=new Set();_0x137b88['model']['document']['registerPostFixer'](_0x54ea0e=>{let _0x423a05=!0x1;for(const {name:_0x2e5240,data:_0x3ff907}of _0x137b88['model']['document']['differ']['getChangedMarkers']()){const {group:_0x2a87a3,id:_0x2937f1}=Ee(_0x2e5240);let _0x19d6e1=_0x3ff907['newRange'];if('comment'!==_0x2a87a3||!_0x19d6e1)continue;const _0x134ff8='$graveyard'===_0x19d6e1['root']['rootName'];_0x134ff8||(_0x19d6e1=Me(_0x19d6e1,_0x137b88['model']),!_0x19d6e1||_0x19d6e1['isCollapsed']||!_0x3ff907['newRange']||_0x19d6e1['isEqual'](_0x3ff907['newRange']))?_0x137b88['model']['hasContent'](_0x19d6e1)&&!_0x134ff8?this['isThreadsLoadingPaused']?_0xc80664['add'](_0x2e5240):this['_handleThreadMarker'](_0x2e5240,_0x2937f1):(_0x55166a['add'](_0x2e5240),_0xc80664['delete'](_0x2e5240),_0x54ea0e['removeMarker'](_0x2e5240),_0x423a05=!0x0):(_0x54ea0e['updateMarker'](_0x2e5240,{'range':_0x19d6e1}),_0x423a05=!0x0);}return _0x423a05;}),this['on']('change:isThreadsLoadingPaused',(_0x3e5cb0,_0x16ff17,_0x52d4e6)=>{if(!_0x52d4e6&&_0xc80664['size'])for(const _0x2348c6 of _0xc80664){const {id:_0x5ebdfa}=Ee(_0x2348c6);_0xc80664['delete'](_0x2348c6),_0x137b88['model']['markers']['get'](_0x2348c6)&&this['_handleThreadMarker'](_0x2348c6,_0x5ebdfa);}}),this['listenTo'](_0x137b88['model']['document'],'change',()=>{for(const {name:_0x4a6c14,data:{newRange:_0x246590}}of _0x137b88['model']['document']['differ']['getChangedMarkers']()){const {group:_0x1cfaf4,id:_0x7e8f55}=Ee(_0x4a6c14);if('comment'!==_0x1cfaf4)continue;const _0x1a2b47=_0x37c03c['getCommentThread'](_0x7e8f55),_0x5163c1=this['hasMarkerForId'](_0x7e8f55);_0x1a2b47&&(!_0x1a2b47['_hasTargetInContent']&&_0x246590&&_0x137b88['editing']['view']['once']('render',()=>{const _0xb2adc2=_0x137b88['plugins']['get'](me),_0x10145d=_0x37c03c['_threadToController']['get'](_0x1a2b47)['view'];_0xb2adc2['getByInnerView'](_0x10145d)['refreshVisibility']();},{'priority':'low'}),_0x1a2b47['_hasTargetInContent']=_0x5163c1||!!_0x246590),_0x246590||(_0x55166a['add'](_0x4a6c14),_0xc80664['delete'](_0x4a6c14));}for(const _0x51bfae of _0x55166a){const {id:_0x4bd044}=Ee(_0x51bfae),_0x4c186c=_0x37c03c['getCommentThread'](_0x4bd044);if(_0xc80664['delete'](_0x51bfae),!_0x4c186c)continue;const _0x34da12=this['hasMarkerForId'](_0x4bd044);_0x34da12||_0x4c186c['isSubmitted']?_0x34da12||_0x4c186c['unlinkedAt']||_0x4c186c['setUnlinkedAt'](new Date()):_0x4c186c['remove']();}_0x55166a['clear']();});}_handleInitialThreads(_0x44d1bf){_0x44d1bf['forEach'](_0x16b863=>{_0x16b863['unlinkedAt']&&this['_attachArchivedThread'](_0x16b863['id']);});}_getTargetForId(_0xeb394){const _0x31bc1b=this['editor'],_0xae6325=this['getAllMarkersForId'](_0xeb394);return _0x316fd2(_0x31bc1b['editing'],_0xae6325);}_getTextContext(_0x38cb4b){const _0x449d52=this['getAllMarkersForId'](_0x38cb4b);let _0x2e65fe='',_0x1e1e5e=!0x1;for(const _0x24c1e7 of _0x449d52){const _0x47612e=_0x24c1e7['getRange']();for(const _0x41b1de of Array['from'](_0x47612e['getItems']()))_0x41b1de['is']('$textProxy')?(_0x2e65fe&&_0x1e1e5e&&(_0x2e65fe+='\x20',_0x1e1e5e=!0x1),_0x2e65fe+=_0x41b1de['data']):_0x1e1e5e=!0x0;_0x1e1e5e=!0x0;}return _0x2e65fe['substring'](0x0,0x96);}_attachMarkerToThread(_0x4ef646,_0x5ef52a){const _0x252966=this['editor'],_0x233fec=_0x252966['plugins']['get'](we);let _0x57817c=_0x233fec['getCommentThread'](_0x5ef52a);const _0x8b5c2a=_0x252966['config']['get']('collaboration.channelId'),_0x4f3063=_0x252966['plugins']['get'](ye);return _0x57817c&&(_0x57817c['unlinkedAt']&&_0x57817c['setUnlinkedAt'](null),_0x57817c['isAttached'])||(this['getAllMarkersForId'](_0x5ef52a)[0x0]['managedUsingOperations']?_0x233fec['fetchCommentThread']({'channelId':_0x8b5c2a,'threadId':_0x5ef52a})['then'](_0x266149=>{if('destroyed'!==_0x252966['state']){if(_0x57817c=_0x266149,_0x57817c&&!_0x57817c['isAttached']){const _0x4f2b0e=_0x57817c['attachTo'](()=>this['_getTargetForId'](_0x5ef52a));_0x4f3063['registerAnnotation'](_0x4f2b0e),_0x57817c['isResolved']&&this['_reconvertMarkers'](_0x5ef52a);}else{if(!_0x57817c){const _0x4390f5=this['getAllMarkersForId'](_0x5ef52a);_0x252966['model']['change'](_0x11850d=>{for(const _0x3b89c0 of _0x4390f5)_0x11850d['removeMarker'](_0x3b89c0);});}}}}):_0x252966['editing']['view']['once']('render',()=>{if(_0x233fec['getCommentThread'](_0x5ef52a))return;const _0x41bcb4=_0x252966['plugins']['get'](me);_0x57817c=_0x233fec['openNewCommentThread']({'channelId':_0x8b5c2a,'threadId':_0x5ef52a,'target':()=>this['_getTargetForId'](_0x5ef52a),'context':{'type':'text','value':this['_getTextContext'](_0x5ef52a)}});const _0x17c123=_0x233fec['_threadToController']['get'](_0x57817c)['view'],_0x3e5817=_0x41bcb4['getByInnerView'](_0x17c123);_0x3e5817&&_0x4f3063['registerAnnotation'](_0x3e5817);},{'priority':'low'})),_0x57817c;}['_handleThreadMarker'](_0x286db6,_0x1cda63){const _0x3fe603=this['_attachMarkerToThread'](_0x286db6,_0x1cda63);_0x3fe603&&!_0x3fe603['context']&&_0x3fe603['setContext']({'type':'text','value':this['_getTextContext'](_0x1cda63)});}_initAriaMarkerChangeAnnouncements(){const _0x838aeb=this['editor'];_0x503f3d(_0x838aeb['model'],({left:_0x5c57b3,entered:_0x1f8429})=>{for(const _0x4e72cb of _0x5c57b3)if(Re(_0x4e72cb)){_0x838aeb['ui']['ariaLiveAnnouncer']['announce'](Vt(_0x838aeb['locale'],'LEAVE_COMMENT_ANNOUNCEMENT'));break;}for(const _0x2549ac of _0x1f8429)if(Re(_0x2549ac)){_0x838aeb['ui']['ariaLiveAnnouncer']['announce'](Vt(_0x838aeb['locale'],'ENTER_COMMENT_ANNOUNCEMENT',_0x1305f5(_0x381db6)));break;}});}};function Oe(_0x2215d8,_0x400564){return _0x400564?_0x2215d8+':'+_0x400564:_0x2215d8;}function Me(_0x23c47f,_0x9ef91){const _0x1dcf1c=_0x9ef91['schema'],_0x5bdf82=_0x9ef91['createRange'](_0x23c47f['start']);for(const _0x10c750 of _0x23c47f['getWalker']()){const {type:_0x42972d,item:_0x53fdcb,nextPosition:_0xfd48da}=_0x10c750;if('text'===_0x42972d||_0x1dcf1c['isObject'](_0x53fdcb)){const _0x290144=_0x9ef91['createPositionBefore'](_0x53fdcb);_0x5bdf82['isCollapsed']&&(_0x5bdf82['start']=_0x290144),_0x5bdf82['end']=_0xfd48da;}}return _0x5bdf82;}function Re(_0x81d7a){return'comment'===Ee(_0x81d7a['name'])['group'];}var xe=class extends _0x327214{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'CommentsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[we,Ne,ye,me];}get CommentsListView(){return Xt;}get CommentThreadInputView(){return Gt;}init(){const _0x36119d=this['editor'],_0x1479dc=_0x36119d['plugins']['get'](we),_0x1665d9=_0x36119d['plugins']['get'](Ne),_0x3e2da4=_0x36119d['plugins']['get'](me),_0x5d97f2=_0x36119d['plugins']['get'](ye);_0x36119d['ui']['componentFactory']['add']('comment',()=>{const _0x1c75d9=this['_createUIButton'](nt);return _0x1c75d9['tooltip']=!0x0,_0x1c75d9;}),_0x36119d['ui']['componentFactory']['add']('menuBar:comment',()=>this['_createUIButton'](pt)),_0x5d97f2['addSourceCollector'](()=>{const _0x267b2a=[];for(const [_0x239bbe,_0x24b172]of _0x1479dc['_threadToController']){const _0x4d68c3=_0x1665d9['getAllMarkersForId'](_0x239bbe['id']),_0x26e519=_0x4d68c3['map'](_0x41d754=>_0x41d754['getRange']());_0x4d68c3['length']>0x0&&_0x267b2a['push']([_0x24b172['view'],_0x26e519]);}return _0x267b2a;}),this['listenTo'](_0x3e2da4,'change:activeAnnotations',(_0x4391e1,_0x2d3ee0,_0x1928f3)=>{const _0x4980e0=Array['from'](_0x1928f3)['map'](_0x1f6acd=>_0x1f6acd['innerView'])['find'](_0x4ae17f=>_0x1479dc['_viewToController']['has'](_0x4ae17f));if(!_0x4980e0)return void(_0x1665d9['activeMarker']=null);const _0x4e8863=_0x1479dc['_viewToController']['get'](_0x4980e0)['model']['id'],_0x4c7a03='comment:'+_0x4e8863;_0x4e8863&&_0x1665d9['hasMarkerForId'](_0x4e8863)?_0x1665d9['activeMarker']=_0x4c7a03:_0x1665d9['activeMarker']&&(_0x1665d9['activeMarker']=null);}),this['listenTo'](_0x1479dc,'removeCommentThread',(_0x4bcdc7,{threadId:_0x4b10fa,isFromAdapter:_0x40ea13})=>{!_0x40ea13&&_0x36119d['ui']['focusTracker']['isFocused']&&_0x1665d9['hasMarkerForId'](_0x4b10fa)&&_0x36119d['editing']['view']['focus']();},{'priority':'highest'}),this['listenTo'](_0x1479dc,'addComment',(_0x4b9bf7,{threadId:_0x47b120,isFromAdapter:_0x128fbc})=>{!_0x128fbc&&_0x1665d9['hasMarkerForId'](_0x47b120)&&_0x1479dc['hasCommentThread'](_0x47b120)&&0x1===_0x1479dc['getCommentThread'](_0x47b120)['length']&&(_0x36119d['editing']['view']['focus'](),_0x4b9bf7['stop']());},{'priority':'low'}),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x5dcecc=[this['editor']];for(const _0x420c1d of _0x5dcecc){let _0x3ca035;for(const _0x45ce2a in _0x420c1d){const _0x5991d6=_0x45ce2a,_0x412b0d=_0x420c1d[_0x5991d6];if('commentsLicenseKeyValid'==_0x412b0d||'commentsLicenseKeyInvalid'==_0x412b0d||'commentsLicenseKeyExpired'==_0x412b0d||'commentsLicenseKeyDomainLimit'==_0x412b0d||'commentsLicenseKeyNotAllowed'==_0x412b0d||'commentsLicenseKeyEvaluationLimit'==_0x412b0d||'commentsLicenseKeyUsageLimit'==_0x412b0d){delete _0x420c1d[_0x5991d6],_0x3ca035=_0x412b0d,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'commentsLicenseKeyInvalid'==_0x3ca035&&_0x420c1d['_showLicenseError']('invalid'),'commentsLicenseKeyExpired'==_0x3ca035&&_0x420c1d['_showLicenseError']('expired'),'commentsLicenseKeyDomainLimit'==_0x3ca035&&_0x420c1d['_showLicenseError']('domainLimit'),'commentsLicenseKeyNotAllowed'==_0x3ca035&&_0x420c1d['_showLicenseError']('featureNotAllowed','Comments'),'commentsLicenseKeyEvaluationLimit'==_0x3ca035&&_0x420c1d['_showLicenseError']('evaluationLimit'),'commentsLicenseKeyUsageLimit'==_0x3ca035&&_0x420c1d['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_createUIButton(_0x53116d){const _0xd333e=this['editor'],_0x33526c=new _0x53116d(_0xd333e['locale']),_0x19234d=_0xd333e['commands']['get']('addCommentThread');return _0x33526c['set']({'label':Vt(_0xd333e['locale'],'Comment'),'icon':_0x301fc7}),_0x33526c['bind']('isEnabled')['to'](_0x19234d,'isEnabled',_0x19234d,'hasContent',(_0x19f71e,_0x56cbbf)=>_0x19f71e&&_0x56cbbf),this['listenTo'](_0x33526c,'execute',()=>{_0x19234d['execute']();}),_0x33526c;}},Se=class extends _0x327214{static get['pluginName'](){return'CommentsOnly';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Ne];}constructor(_0x5107c4){super(_0x5107c4),this['set']('isEnabled',!0x1),this['on']('change:isEnabled',(_0x5b6a01,_0xbc460c,_0x34234c)=>{_0x34234c?this['_enableCommentsOnlyMode']():this['_disableCommentsOnlyMode']();});}afterInit(){!this['isEnabled']&&this['editor']['config']['get']('commentsOnly')&&(this['isEnabled']=!0x0);}_enableCommentsOnlyMode(){for(const [_0x6aa1a4,_0x1a8da4]of this['editor']['commands'])_0x1a8da4['affectsData']&&'addCommentThread'!==_0x6aa1a4&&_0x1a8da4['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 _0x24206e=this['editor']['editing']['view']['document'];this['listenTo'](_0x24206e,'cut',_0x46de3d=>_0x46de3d['stop'](),{'priority':'highest'}),this['listenTo'](_0x24206e,'clipboardInput',_0x49a654=>_0x49a654['stop'](),{'priority':'highest'}),this['listenTo'](_0x24206e,'delete',_0x39da5a=>_0x39da5a['stop'](),{'priority':'highest'});}_disableCommentsOnlyMode(){for(const [_0x55279d,_0x260ba9]of this['editor']['commands'])_0x260ba9['affectsData']&&'addCommentThread'!==_0x55279d&&_0x260ba9['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']);}},Pe=class extends _0x1dc739{activeUIs;uisData;['_uis'];static get requires(){return[me];}static get['pluginName'](){return'AnnotationsUIs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5a5fc1){super(_0x5a5fc1),this['activeUIs']=new Set(),this['_uis']=new Map(),this['uisData']=new Map();}init(){const _0x298d87=this['context']['plugins']['get'](me);this['listenTo'](_0x298d87,'_activateAnnotation',(_0x31d6c1,_0x2095e5)=>{for(const _0x55a697 of this['activeUIs']){const _0x1bdfea=this['_uis']['get'](_0x55a697);(0x0,this['uisData']['get'](_0x55a697)['filter'])(_0x2095e5)&&_0x1bdfea['setActiveAnnotation'](_0x2095e5);}}),this['listenTo'](_0x298d87,'_deactivateAllAnnotations',()=>{for(const _0x417fc9 of this['activeUIs'])this['_uis']['get'](_0x417fc9)['setActiveAnnotation'](null);}),this['listenTo'](_0x298d87['_visibleAnnotations'],'add',(_0x4cf236,_0x2ef46c)=>{this['_assertAnnotationDoesNotBelongToMultipleUIs'](_0x2ef46c);});}hasActive(){return this['activeUIs']['size']>0x0;}isActive(_0x25553f){return this['activeUIs']['has'](_0x25553f);}activate(_0x21406d,_0x485650=this['defaultFilter']){const _0x53c77a=this['context']['plugins']['get'](me);if(!this['_uis']['has'](_0x21406d))throw new _0x3a2101('annotationsuis-missing-ui',this,{'uiName':_0x21406d});this['isActive'](_0x21406d)&&this['deactivate'](_0x21406d),this['activeUIs']['add'](_0x21406d);const _0xeb16f1=new ce();de({'source':_0x53c77a['_visibleAnnotations'],'target':_0xeb16f1,'filter':_0x485650}),this['uisData']['set'](_0x21406d,{'collection':_0xeb16f1,'filter':_0x485650});const _0x5140fe=this['_uis']['get'](_0x21406d);_0x5140fe['attach'](_0xeb16f1),this['listenTo'](_0x5140fe,'change:activeAnnotation',(_0x1e2232,_0x427f04,_0x18f074,_0x40292e)=>{_0x40292e&&_0x53c77a['_removeActiveAnnotation'](_0x40292e),_0x18f074&&_0x53c77a['_addActiveAnnotation'](_0x18f074);});}deactivate(_0x44a3d7){if(this['activeUIs']['delete'](_0x44a3d7),!this['_uis']['has'](_0x44a3d7))throw new _0x3a2101('annotationsuis-missing-ui',this,{'uiName':_0x44a3d7});const _0x904eb=this['_uis']['get'](_0x44a3d7);_0x904eb['detach'](),this['stopListening'](_0x904eb),this['uisData']['get'](_0x44a3d7)['collection']['destroy'](),this['uisData']['delete'](_0x44a3d7);}switchTo(_0x5c2cba){if(!this['_uis']['has'](_0x5c2cba))throw new _0x3a2101('annotationsuis-missing-ui',this,{'uiName':_0x5c2cba});const _0x4aea22=this['context']['plugins']['get'](me),_0x499c2d=Array['from'](_0x4aea22['activeAnnotations'])[0x0]||null;this['deactivateAll'](),this['activate'](_0x5c2cba);const _0x5b1217=this['_uis']['get'](_0x5c2cba);_0x5b1217['setActiveAnnotation'](_0x499c2d),_0x5b1217['_setSelectedAnnotations']&&_0x499c2d&&_0x5b1217['_setSelectedAnnotations']([_0x499c2d]);}deactivateAll(){for(const _0xfda997 of this['activeUIs'])this['deactivate'](_0xfda997);}register(_0x445e47,_0x4976ac){if(this['_uis']['has'](_0x445e47))throw new _0x3a2101('annotationsuis-register-already-registered');if('function'!=typeof _0x4976ac['attach']||'function'!=typeof _0x4976ac['detach']||'function'!=typeof _0x4976ac['setActiveAnnotation'])throw new _0x3a2101('annotationsuis-register-invalid-interface',null);this['_uis']['set'](_0x445e47,_0x4976ac);}refilterAnnotations(){const _0x27dc14=this['context']['plugins']['get'](me)['collection'],_0x35dc6d=new Map(),_0x1a85c3=Array['from'](this['activeUIs']);for(const _0x3115df of this['activeUIs']){const _0x385fa2=this['uisData']['get'](_0x3115df)['collection'];for(const _0x152c10 of _0x385fa2)_0x35dc6d['set'](_0x152c10,_0x3115df);}for(const _0x51a696 of _0x27dc14){const _0x84c1e7=_0x35dc6d['get'](_0x51a696);this['_assertAnnotationDoesNotBelongToMultipleUIs'](_0x51a696);const _0x5b2663=_0x1a85c3['find'](_0x1d593e=>this['uisData']['get'](_0x1d593e)['filter'](_0x51a696));_0x84c1e7!==_0x5b2663&&(_0x84c1e7&&this['uisData']['get'](_0x84c1e7)['collection']['remove'](_0x51a696),_0x5b2663&&this['uisData']['get'](_0x5b2663)['collection']['add'](_0x51a696));}}destroy(){this['deactivateAll'](),super['destroy']();}defaultFilter(){return!0x0;}_assertAnnotationDoesNotBelongToMultipleUIs(_0x26e7a8){const _0x41d5fb=[];for(const _0x384f3f of this['activeUIs']){(0x0,this['uisData']['get'](_0x384f3f)['filter'])(_0x26e7a8)&&_0x41d5fb['push'](_0x384f3f);}if(_0x41d5fb['length']>0x1)throw new _0x3a2101('annotationsuis-annotation-mismatch',null,{'matchedUIs':_0x41d5fb,'annotationType':_0x26e7a8['type']});}};const Le=/* #__PURE__ -- @preserve */
|
|
32
|
+
_0x208053('px');var De=class extends wt{list;['focusables'];['focusTracker'];['focusCycler'];constructor(_0x24b4d1){super(_0x24b4d1);const _0x41adac=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 _0x564482(),this['focusCycler']=new dt({'focusables':this['focusables'],'focusTracker':this['focusTracker']}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-sidebar','ck-reset',_0x41adac['to']('class')],'style':{'minHeight':_0x41adac['to']('minHeight',_0xbd4870=>'number'==typeof _0xbd4870?Le(_0xbd4870+0xa):null)},'dir':_0x24b4d1['uiLanguageDirection'],'role':'application','aria-label':Vt(_0x24b4d1,'Annotations\x20sidebar'),'tabindex':0x0},'children':[{'tag':'div','attributes':{'role':'list','aria-label':Vt(_0x24b4d1,'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',_0x59df85=>{this['_updateItemPositionInFocusables'](_0x59df85['source']);}),this['list']['forEach'](_0x31914c=>{this['focusTracker']['add'](_0x31914c['element']),this['_updateItemPositionInFocusables'](_0x31914c);}),this['list']['on']('change',(_0x23c7b9,_0x5c78eb)=>{for(const _0x5e732a of _0x5c78eb['removed'])this['focusTracker']['remove'](_0x5e732a['element']),this['focusables']['remove'](_0x5e732a);for(const _0x2e51a0 of _0x5c78eb['added'])this['focusTracker']['add'](_0x2e51a0['element']),this['_updateItemPositionInFocusables'](_0x2e51a0);}),this['on']('arrowup',()=>{this['focusCycler']['focusPrevious']();}),this['on']('arrowdown',()=>{this['focusCycler']['focusNext']();}),this['listenTo'](this['element'],'focus',()=>{this['focus']();});}_updateItemPositionInFocusables(_0x562428){const _0x384203=this['focusables']['getIndex'](_0x562428);let _0x4df58f,_0x496fdc;for(const _0x1370fc of this['focusables'])if(_0x562428['top']<_0x1370fc['top']){_0x4df58f=_0x1370fc;break;}if(_0x496fdc=_0x4df58f?this['focusables']['getIndex'](_0x4df58f):this['focusables']['length'],-0x1!==_0x384203){if(_0x384203===_0x496fdc-0x1)return;this['focusables']['remove'](_0x562428),_0x496fdc=_0x4df58f?this['focusables']['getIndex'](_0x4df58f):this['focusables']['length'];}this['focusables']['add'](_0x562428,_0x496fdc);}};const Ve=/* #__PURE__ -- @preserve */
|
|
33
|
+
_0x208053('px');var Be=class extends wt{content;_targetTop;_mutationObserver;constructor(_0x3791d4){super(_0x3791d4),this['set']('top',0x0),this['set']('height',0x0),this['bind']('bottom')['to'](this,'top',this,'height',(_0x1efb42,_0xd55fe5)=>_0x1efb42+_0xd55fe5),this['set']('isAnimationDisabled',!0x1),this['_mutationObserver']=ne(()=>this['updateHeight']()),this['_targetTop']=null,this['content']=this['createCollection'](),this['content']['delegate']('arrowup','arrowdown')['to'](this);const _0x59b9a8=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-sidebar-item',_0x59b9a8['to']('isAnimationDisabled',_0x1320e0=>_0x1320e0?'ck-sidebar-item--no-animation':'')],'style':{'top':_0x59b9a8['to']('top',_0x14c2de=>Ve(_0x14c2de))},'role':'presentation'},'children':this['content']});}['render'](){super['render'](),this['_mutationObserver']['attach'](this['element']);}['focus'](){this['content']['first']&&this['content']['first']['focus']();}updateHeight(){const _0x6954de=this['element']['clientHeight'];_0x6954de&&(this['height']=_0x6954de);}destroy(){this['content']['clear'](),this['_mutationObserver']['detach'](),super['destroy']();}},He=class extends _0x1dc739{['view'];_activeAnnotation;_annotations;_spaceBetweenItems;_sidebarItemViewToAnnotation;_annotationToSidebarItemView;_recalculateBuffer;static get['pluginName'](){return'Sidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5e2f35){super(_0x5e2f35),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 _0x29b236=this['context']['config']['get']('sidebar.container');_0x29b236&&this['setContainer'](_0x29b236);}setContainer(_0x173249){if(!Fe(_0x173249))throw new _0x3a2101('sidebar-setcontainer-invalid-element');this['container']=_0x173249;}_attachToContainer({viewClass:_0x3f9bd1='',spaceBetweenItems:_0x737535=0x19}={}){if(!Fe(this['container']))throw new _0x3a2101('sidebar-attachtocontainer-missing-container',this);this['container']['appendChild'](this['view']['element']),this['view']['class']=_0x3f9bd1,this['_spaceBetweenItems']=_0x737535;}['rearrange']({removedAnnotation:_0x3d34d5,previousAnnotation:_0x595cc2,nextAnnotation:_0x5a1745}){const _0x219c96=this['getSidebarItemView'](_0x3d34d5);this['view']['list']['remove'](_0x219c96),this['_destroySidebarItemView'](_0x3d34d5),_0x595cc2&&this['_alignToTargetRect'](this['getSidebarItemView'](_0x595cc2)),_0x5a1745&&this['_alignToTargetRect'](this['getSidebarItemView'](_0x5a1745)),this['_updateLastItem']();}['refresh']({blurredAnnotation:_0xbc6de3,activatedAnnotation:_0x69d7e3,disableAnimationOnActivatedAnnotation:_0x93a5ad}){if(this['_activeAnnotation']=_0x69d7e3,_0xbc6de3){_0xbc6de3['isActive']=!0x1;const _0x531fdd=this['getSidebarItemView'](_0xbc6de3);_0x531fdd&&_0x93a5ad&&(_0x531fdd['isAnimationDisabled']=!0x1);}if(_0x69d7e3){const _0x26d3c7=this['getSidebarItemView'](_0x69d7e3);_0x26d3c7&&(_0x69d7e3['isActive']=!0x0,_0x93a5ad&&(_0x26d3c7['isAnimationDisabled']=!0x0,_0x26d3c7['top']+=0x1),this['_alignToTargetRect'](_0x26d3c7));}}_detachFromContainer(_0x200492){if(this['view']['element']['remove'](),_0x200492){for(const _0x13f1fd of _0x200492)this['_destroySidebarItemView'](_0x13f1fd);}this['view']['list']['clear'](),this['view']['class']='',this['_lastItem']=null;}addAnnotation(_0x1090fd,_0x2c958d){_0x2c958d||(_0x2c958d=_0x1090fd['view']);const _0x308dff=new Be(this['context']['locale']);this['_sidebarItemViewToAnnotation']['set'](_0x308dff,_0x1090fd),this['_annotationToSidebarItemView']['set'](_0x1090fd,_0x308dff),_0x308dff['content']['add'](_0x2c958d),this['listenTo'](_0x1090fd['view'],'change:targetRect',(_0x307dde,_0x4e8520,_0x4e6910)=>{const _0x1c2871=this['_getTargetTop'](_0x1090fd,_0x4e6910);_0x308dff['_targetTop']!=_0x1c2871&&(_0x308dff['_targetTop']=_0x1c2871,this['_setItemTop'](_0x308dff,_0x1c2871));}),this['listenTo'](_0x308dff,'change:top',()=>{this['_recalculate'](_0x308dff,'top');}),this['listenTo'](_0x308dff,'change:bottom',()=>{this['_recalculate'](_0x308dff,'bottom');}),this['_alignToTargetRect'](_0x308dff);const _0x3d9ffb=this['_getItemBefore'](_0x308dff);return _0x3d9ffb&&this['_alignAfterItem'](_0x3d9ffb,_0x308dff)||this['_alignToTargetRect'](_0x308dff),this['_updateLastItem'](),this['view']['list']['add'](_0x308dff),_0x308dff;}['_alignForTopChange'](_0x1990a2){if(!_0x1990a2['content']['length'])return;const _0x198b4f=this['_getItemBefore'](_0x1990a2);if(!_0x198b4f)return;const _0x197355=this['_sidebarItemViewToAnnotation']['get'](_0x198b4f),_0x1084ef=this['_activeAnnotation'];_0x1084ef&&_0x1084ef===_0x197355?this['_alignAfterItem'](_0x198b4f,_0x1990a2):this['_alignBeforeItem'](_0x1990a2,_0x198b4f);}_alignForBottomChange(_0x2ddf1d){if(!_0x2ddf1d['content']['length'])return;const _0x38bebd=this['_getItemAfter'](_0x2ddf1d);if(!_0x38bebd)return;const _0x3b6883=this['_sidebarItemViewToAnnotation']['get'](_0x38bebd),_0x26cfd3=this['context']['config']['get']('sidebar.preventScrollOutOfView'),_0x2b2281=this['_activeAnnotation'];_0x2b2281&&_0x2b2281===_0x3b6883&&_0x26cfd3?(this['_alignBeforeItem'](_0x38bebd,_0x2ddf1d),this['_alignAfterItem'](_0x2ddf1d,_0x38bebd)):_0x2b2281&&_0x2b2281===_0x3b6883?this['_alignBeforeItem'](_0x38bebd,_0x2ddf1d):this['_alignAfterItem'](_0x2ddf1d,_0x38bebd);}_recalculate(_0x2d4a2b,_0x96a730){0x0===this['_recalculateBuffer']['length']&&setTimeout(()=>{for(const {sidebarItemView:_0x18c97a,changedProp:_0x19b50f}of this['_recalculateBuffer'])'top'===_0x19b50f?this['_alignForTopChange'](_0x18c97a):this['_alignForBottomChange'](_0x18c97a);this['_recalculateBuffer']=[];},0xa),this['_recalculateBuffer']['push']({'sidebarItemView':_0x2d4a2b,'changedProp':_0x96a730});}getSidebarItemView(_0x54ebe8){return this['_annotationToSidebarItemView']['get'](_0x54ebe8);}destroy(){this['stopListening'](),this['view']['destroy']();}_destroySidebarItemView(_0x42d275){const _0x4b6f96=this['getSidebarItemView'](_0x42d275);this['stopListening'](_0x4b6f96),this['stopListening'](_0x42d275['view']),_0x4b6f96['destroy'](),this['_annotationToSidebarItemView']['delete'](_0x42d275),this['_sidebarItemViewToAnnotation']['delete'](_0x4b6f96);}_createSidebarView(){const _0x566a71=new De(this['context']['locale']);return _0x566a71['render'](),this['on']('change:_lastItem',(_0x223365,_0x497c4e,_0x2ff7a1,_0x320af0)=>{_0x320af0&&_0x566a71['unbind']('minHeight'),_0x2ff7a1?_0x566a71['bind']('minHeight')['to'](_0x2ff7a1,'bottom'):_0x566a71['minHeight']=null;}),_0x566a71;}_updateLastItem(){this['_lastItem']=this['_annotations']?.['last']?this['getSidebarItemView'](this['_annotations']['last']):null;}_getItemBefore(_0x38fedd){const _0x49b5a2=this['_sidebarItemViewToAnnotation']['get'](_0x38fedd),_0x352272=_0x49b5a2&&this['_annotations']?.['get'](this['_annotations']['getIndex'](_0x49b5a2)-0x1);return _0x352272&&this['getSidebarItemView'](_0x352272)||null;}_getItemAfter(_0x349c72){const _0x20cc0b=this['_sidebarItemViewToAnnotation']['get'](_0x349c72),_0x2e5187=_0x20cc0b&&this['_annotations']?.['get'](this['_annotations']['getIndex'](_0x20cc0b)+0x1);return _0x2e5187&&this['getSidebarItemView'](_0x2e5187)||null;}_alignBeforeItem(_0x27fd85,_0x4acb3f){_0x27fd85['updateHeight']();const _0x1d93af=Ue(_0x4acb3f['bottom']+this['_spaceBetweenItems'],_0x27fd85['top']);return!!_0x1d93af&&(this['_setItemTop'](_0x4acb3f,_0x4acb3f['top']-_0x1d93af),!0x0);}_alignAfterItem(_0x5833a0,_0x23c47e){_0x5833a0['updateHeight']();const _0x27d93e=Ue(_0x5833a0['bottom']+this['_spaceBetweenItems'],_0x23c47e['top']);return!!_0x27d93e&&(this['_setItemTop'](_0x23c47e,_0x23c47e['top']+_0x27d93e,!0x1),!0x0);}_alignToTargetRect(_0x511c1d){const _0x569c74=this['_sidebarItemViewToAnnotation']['get'](_0x511c1d);if(!_0x569c74||!_0x569c74['target']||!_0x569c74['targetRect'])return;const _0x3bb87d=this['_getTargetTop'](_0x569c74,_0x569c74['targetRect']);this['_setItemTop'](_0x511c1d,_0x3bb87d);}_getTargetTop(_0x527081,_0xc0e471){if(null===_0xc0e471)return 0x0;if(_0x527081['target']instanceof _0x189269)return _0xc0e471['top'];{const _0x3b5308=new _0x189269(this['view']['element'])['top'];return _0xc0e471['top']-_0x3b5308;}}_setItemTop(_0x521e24,_0x317a39,_0x26a912=this['context']['config']['get']('sidebar.preventScrollOutOfView')){_0x26a912&&(_0x317a39=Math['max'](_0x317a39,this['_getMaxAvailableTop'](_0x521e24))),_0x521e24['top']=_0x317a39;}_getMaxAvailableTop(_0x5c0151){let _0x32186f=this['_getItemBefore'](_0x5c0151),_0xdfe4fd=0x0;for(;_0x32186f;)_0x32186f['updateHeight'](),_0xdfe4fd+=this['_spaceBetweenItems']+_0x32186f['height'],_0x32186f=this['_getItemBefore'](_0x32186f);return _0xdfe4fd;}};function Ue(_0x218e09,_0x1c87c9){return Math['max'](_0x218e09-_0x1c87c9,0x0);}function Fe(_0x194c6c){return null!==_0x194c6c&&'object'==typeof _0x194c6c&&0x1===_0x194c6c['nodeType'];}var We=class extends _0x1dc739{isAttached;annotations;_editorAnnotations;_refreshPositioningDebounced;static get requires(){return[He,Pe];}static get['pluginName'](){return'WideSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3891db){super(_0x3891db),this['isAttached']=!0x1,this['set']('activeAnnotation',null),this['annotations']=null,this['_editorAnnotations']=new _0x1b9c8e(),this['_refreshPositioningDebounced']=_0x42d68c(()=>{_0x3891db['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning']();},0xfa,{'leading':!0x1});}init(){const _0x57912d=this['context']['plugins']['get'](Pe),_0x36d062=this['context']['plugins']['get'](He);_0x57912d['register']('wideSidebar',this),_0x36d062['container']&&_0x57912d['switchTo']('wideSidebar');}setActiveAnnotation(_0x1334bf){if(_0x1334bf===this['activeAnnotation'])return;const _0x4a9968=this['context']['plugins']['get'](He);_0x4a9968['_activeAnnotation']=_0x1334bf;const _0x7b0bad=this['activeAnnotation'];_0x4a9968['refresh']({'blurredAnnotation':_0x7b0bad,'activatedAnnotation':_0x1334bf}),this['activeAnnotation']=_0x1334bf;}attach(_0x7c1284){this['annotations']=_0x7c1284;const _0x10308b=this['context']['plugins']['get'](He);if(_0x10308b['_annotations']=_0x7c1284,this['isAttached'])throw new _0x3a2101('widesidebar-attach-already-attached',this);this['isAttached']=!0x0,this['listenTo'](_0x10308b,'set:container',()=>{this['detach'](),this['listenTo'](_0x10308b,'change:container',_0x245283=>{_0x245283['off'](),this['attach'](_0x7c1284);});}),_0x10308b['_attachToContainer']({'viewClass':'ck-sidebar--wide'});const _0x7f7e39=_0x52e790=>{_0x52e790['updateTargetRect'](),_0x10308b['addAnnotation'](_0x52e790);};for(const _0x162d0b of _0x7c1284)_0x7f7e39(_0x162d0b);this['listenTo'](_0x7c1284,'add',(_0x1ec606,_0x75386)=>{_0x7f7e39(_0x75386);}),this['listenTo'](_0x7c1284,'remove',(_0x138cba,_0x23e392,_0x4c2c0f)=>{_0x10308b['rearrange']({'removedAnnotation':_0x23e392,'previousAnnotation':_0x7c1284['get'](_0x4c2c0f-0x1),'nextAnnotation':_0x7c1284['get'](_0x4c2c0f+0x1)}),_0x23e392===this['activeAnnotation']&&this['setActiveAnnotation'](null);},{'priority':'high'}),this['listenTo'](_0x7c1284,'focus',(_0x69d3f8,_0x440471)=>{this['setActiveAnnotation'](_0x440471);}),this['listenTo'](_0x7c1284,'blur',()=>{this['setActiveAnnotation'](null);});const _0x275b86=this['context']instanceof _0x30407b?this['context']['editors']:new _0x1b9c8e([this['context']]);for(const _0x16e81c of _0x275b86)this['_integrateWithEditorAnnotations'](_0x16e81c);this['listenTo'](_0x275b86,'add',(_0x5839e3,_0x29ef4c)=>{this['listenTo'](_0x29ef4c,'ready',()=>{this['_integrateWithEditorAnnotations'](_0x29ef4c);});}),this['listenTo'](_0x275b86,'remove',(_0x2f6ce0,_0x40483c)=>{_0x40483c['plugins']['has']('EditorAnnotations')&&this['_destroyEditorAnnotationsIntegration'](_0x40483c['plugins']['get']('EditorAnnotations'));}),window['addEventListener']('resize',this['_refreshPositioningDebounced']),this['context']['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning']();}detach(){if(!this['isAttached'])throw new _0x3a2101('widesidebar-detach-not-attached',this);this['setActiveAnnotation'](null);const _0x5168d6=this['context']['plugins']['get'](He);_0x5168d6['_detachFromContainer'](this['annotations']),this['stopListening'](_0x5168d6),this['stopListening'](this['annotations']),this['context']instanceof _0x30407b&&this['stopListening'](this['context']['editors']);for(const _0x32f697 of Array['from'](this['_editorAnnotations']))this['_destroyEditorAnnotationsIntegration'](_0x32f697);window['removeEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioningDebounced']['cancel'](),this['activeAnnotation']=null,this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach']();}_integrateWithEditorAnnotations(_0x52b0be){if(!_0x52b0be['plugins']['has']('EditorAnnotations'))return;const _0x26af3c=_0x52b0be['plugins']['get']('EditorAnnotations'),_0x43fbc8=()=>{const _0x309033=_0x26af3c['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});this['setActiveAnnotation'](_0x309033[0x0]||null);};this['listenTo'](_0x26af3c,'refresh',_0x43fbc8),this['listenTo'](_0x26af3c,'blur',(_0x2c4394,{isAnnotationTracked:_0x22f31e})=>{this['activeAnnotation']&&_0x22f31e(this['activeAnnotation'])&&this['setActiveAnnotation'](null);}),this['listenTo'](_0x26af3c,'uiUpdate',()=>{this['_refreshPositioningDebounced']();}),this['listenTo'](this['annotations'],'blur',_0x5a4ffe=>{_0x26af3c['hasDomSelection']()&&(_0x43fbc8(),_0x5a4ffe['stop']());},{'priority':'high'}),this['_editorAnnotations']['add'](_0x26af3c);}_destroyEditorAnnotationsIntegration(_0x39c456){this['stopListening'](_0x39c456),this['_editorAnnotations']['remove'](_0x39c456);}},Ke=class extends nt{counterView;constructor(_0x20ad7b){super(_0x20ad7b);const _0xcd7990=this['bindTemplate'];this['set']('isDirty',!0x1),this['set']('number',0x0),this['bind']('_badge')['to'](this,'isDirty',this,'number',(_0x48e6d5,_0x3fb4d8)=>_0x48e6d5?'…':_0x3fb4d8['toString']()),this['set']('annotationType',''),this['bind']('icon')['to'](this,'annotationType',_0x3e6138=>'comment'===_0x3e6138?_0xdbccf:tt),this['extendTemplate']({'attributes':{'class':['ck-annotation-counter']}}),this['counterView']=new wt(),this['counterView']['setTemplate']({'tag':'span','attributes':{'class':['ck-annotation-counter__badge',_0xcd7990['to']('annotationType',_0x29c93f=>'ck-annotation-counter__badge--'+_0x29c93f),_0xcd7990['if']('isDirty','ck-annotation-counter__badge--edit-mode')]},'children':[{'text':_0xcd7990['to']('_badge')}]}),this['children']['add'](this['counterView']);}},Ge=class extends _0x1dc739{isAttached;annotations;_manuallyClosedAnnotationViews;_domEmitter;_annotationToNarrowView;_selectedAnnotations;_editorAnnotations;_refreshPositioningDebounced;static get requires(){return[He,Pe];}static get['pluginName'](){return'NarrowSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x56fc5c){super(_0x56fc5c),this['isAttached']=!0x1,this['_manuallyClosedAnnotationViews']=new Set(),this['_domEmitter']=new(_0x535847())(),this['_annotationToNarrowView']=new Map(),this['set']('activeAnnotation',null),this['annotations']=null,this['_selectedAnnotations']=[],this['_editorAnnotations']=new _0x1b9c8e(),this['_refreshPositioningDebounced']=_0x42d68c(()=>{this['_refreshPositioning']();},0xfa,{'leading':!0x1});}init(){this['context']['plugins']['get'](Pe)['register']('narrowSidebar',this),this['_overlayHost']=new _t(this['context']['locale'],{'resolveMountTarget':()=>this['_resolveOverlayTarget'](),'resolveInlineContainer':()=>this['context']['plugins']['get'](He)['container']}),this['_overlayHost']['sync'](),this['bodyCollection']=this['_overlayHost']['bodyCollection'],this['balloonPanelView']=new st(this['context']['locale']),this['bodyCollection']['add'](this['balloonPanelView']);}attach(_0x13c851){this['annotations']=_0x13c851;const _0x4ad70f=this['context']['plugins']['get'](He),_0x95bdef=this['balloonPanelView'];if(_0x4ad70f['_annotations']=_0x13c851,this['isAttached'])throw new _0x3a2101('narrowsidebar-attach-already-attached',this);this['isAttached']=!0x0,this['listenTo'](_0x4ad70f,'set:container',()=>{this['detach'](),this['listenTo'](_0x4ad70f,'change:container',_0x5ebb1e=>{_0x5ebb1e['off'](),this['attach'](_0x13c851);});}),_0x4ad70f['_attachToContainer']({'viewClass':'ck-sidebar--narrow','spaceBetweenItems':0x5}),this['_overlayHost']['sync']();const _0x4abfc9=_0x47291f=>{const _0xd9f96c=new Ke(this['context']['locale']);_0x4ad70f['addAnnotation'](_0x47291f,_0xd9f96c),this['_annotationToNarrowView']['set'](_0x47291f,_0xd9f96c),_0xd9f96c['bind']('isDirty','annotationType','number')['to'](_0x47291f['view'],'isDirty','type','length'),_0xd9f96c['on']('execute',()=>{this['_manuallyClosedAnnotationViews']['clear'](),_0x95bdef['content']['first']!==_0x47291f['view']?(this['_showBalloon'](_0x47291f),_0x47291f['view']['element']['focus'](),this['setActiveAnnotation'](_0x47291f)):this['setActiveAnnotation'](null);});};for(const _0x1b623f of _0x13c851)_0x4abfc9(_0x1b623f);this['listenTo'](_0x13c851,'add',(_0x291d42,_0x131522)=>{_0x4abfc9(_0x131522);}),this['listenTo'](_0x13c851,'remove',(_0x51ce8b,_0xd33125,_0x2c8f5f)=>{this['_annotationToNarrowView']['get'](_0xd33125)['destroy'](),this['_annotationToNarrowView']['delete'](_0xd33125),_0x4ad70f['rearrange']({'removedAnnotation':_0xd33125,'previousAnnotation':_0x13c851['get'](_0x2c8f5f-0x1),'nextAnnotation':_0x13c851['get'](_0x2c8f5f+0x1)}),_0xd33125===this['activeAnnotation']&&this['setActiveAnnotation'](null);},{'priority':'low'}),this['listenTo'](_0x13c851,'focus',(_0x2ab7aa,_0x2c19ea)=>{this['setActiveAnnotation'](_0x2c19ea);}),this['listenTo'](_0x13c851,'blur',()=>{this['setActiveAnnotation'](null);}),this['_domEmitter']['listenTo'](document,'keydown',(_0x2e0809,_0x12dca3)=>{_0x12dca3['keyCode']===_0x1bc182['esc']&&_0x95bdef['isVisible']&&(this['_manuallyClosedAnnotationViews']['add'](_0x95bdef['content']['first']),this['_hideBalloon'](),_0x12dca3['stopPropagation'](),_0x12dca3['preventDefault']());}),At({'emitter':this['_domEmitter'],'activator':()=>_0x95bdef['isVisible']&&!this['_hasEditorDomSelection'](),'contextElements':()=>{const _0x5c3037=[_0x4ad70f['view']['element']];return _0x95bdef['isVisible']&&_0x5c3037['push'](_0x95bdef['element']),this['activeAnnotation']&&_0x5c3037['push'](...this['activeAnnotation']['focusableElements']),_0x5c3037;},'callback':()=>{this['_manuallyClosedAnnotationViews']['clear'](),this['_hideBalloon'](),this['setActiveAnnotation'](null);}});const _0x134bad=this['context']instanceof _0x30407b?this['context']['editors']:new _0x1b9c8e([this['context']]);for(const _0x2d1da0 of _0x134bad)this['_integrateWithEditorAnnotations'](_0x2d1da0);this['listenTo'](_0x134bad,'add',(_0x8cc1ef,_0xf5fe20)=>{this['listenTo'](_0xf5fe20,'ready',()=>{this['_integrateWithEditorAnnotations'](_0xf5fe20);});}),this['listenTo'](_0x134bad,'remove',(_0x19b163,_0x1ba0ec)=>{_0x1ba0ec['plugins']['has']('EditorAnnotations')&&this['_destroyEditorAnnotationsIntegration'](_0x1ba0ec['plugins']['get']('EditorAnnotations'));}),window['addEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioning']();}setActiveAnnotation(_0x5f456a){if(_0x5f456a===this['activeAnnotation'])return;const _0x40ca60=this['context']['plugins']['get'](He);_0x40ca60['refresh']({'blurredAnnotation':this['activeAnnotation'],'activatedAnnotation':_0x5f456a,'disableAnimationOnActivatedAnnotation':!0x0}),_0x5f456a&&_0x40ca60['getSidebarItemView'](_0x5f456a)?this['_showBalloon'](_0x5f456a):this['_hideBalloon'](),this['activeAnnotation']=_0x5f456a;}detach(){if(!this['isAttached'])throw new _0x3a2101('narrowsidebar-detach-not-attached',this);this['setActiveAnnotation'](null);const _0x28d054=this['context']['plugins']['get'](He);this['_hideBalloon'](),Array['from'](this['_annotationToNarrowView']['values'](),_0x16f0e6=>_0x16f0e6['destroy']()),this['_annotationToNarrowView']['clear'](),_0x28d054['_detachFromContainer'](this['annotations']),this['stopListening'](),this['_domEmitter']['stopListening'](),this['context']instanceof _0x30407b&&this['stopListening'](this['context']['editors']);for(const _0x4aaef9 of Array['from'](this['_editorAnnotations']))this['_destroyEditorAnnotationsIntegration'](_0x4aaef9);window['removeEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioningDebounced']['cancel'](),this['_selectedAnnotations']=[],this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach'](),this['_overlayHost']['destroy']();}_integrateWithEditorAnnotations(_0x4eb1d6){if(!_0x4eb1d6['plugins']['has']('EditorAnnotations'))return;const _0xe719e3=_0x4eb1d6['plugins']['get']('EditorAnnotations'),_0x2bc0f3=this['context']['plugins']['get'](He),_0x4c435f=this['annotations'],_0x1c0a83=this['balloonPanelView'],_0x5c9d5e=()=>{const _0x3be11f=_0xe719e3['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});this['_setSelectedAnnotations'](_0x3be11f),this['setActiveAnnotation'](_0x3be11f[0x0]||null);};this['listenTo'](_0xe719e3,'refresh',_0x5c9d5e),this['listenTo'](_0xe719e3,'blur',(_0x2e1cd7,{isAnnotationTracked:_0x39fe8d})=>{this['activeAnnotation']&&_0x39fe8d(this['activeAnnotation'])&&(this['_setSelectedAnnotations']([]),this['setActiveAnnotation'](null));}),this['listenTo'](_0xe719e3,'uiUpdate',()=>{this['_refreshPositioningDebounced']();}),this['listenTo'](_0x4c435f,'blur',_0x41c9b8=>{_0xe719e3['hasDomSelection']()&&_0x41c9b8['stop']();},{'priority':'high'}),At({'emitter':this['_domEmitter'],'activator':()=>!!this['activeAnnotation'],'contextElements':()=>{const _0x3b6192=[_0x2bc0f3['view']['element']];return _0x1c0a83['isVisible']&&_0x3b6192['push'](_0x1c0a83['element']),_0x3b6192;},'callback':()=>{_0xe719e3['hasDomSelection']()&&_0x5c9d5e();}}),this['_editorAnnotations']['add'](_0xe719e3),this['_overlayHost']['sync']();}_destroyEditorAnnotationsIntegration(_0x136247){_0x136247&&(this['stopListening'](_0x136247),this['_editorAnnotations']['remove'](_0x136247));}_hasEditorDomSelection(){return Array['from'](this['_editorAnnotations'])['some'](_0x5a67ce=>_0x5a67ce['hasDomSelection']());}_setSelectedAnnotations(_0x394a31){for(const _0x4eac92 of this['_selectedAnnotations'])_0x394a31['includes'](_0x4eac92)||this['_manuallyClosedAnnotationViews']['delete'](_0x4eac92['view']);this['_selectedAnnotations']=_0x394a31;}_refreshPositioning(){const _0x2137d8=this['balloonPanelView'];this['context']['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning'](),_0x2137d8['isVisible']&&this['_updateBalloonPosition']();}_resolveOverlayTarget(){const _0x3022af=this['context']['config']['get']('sidebar.overlayContainer')||this['context']['config']['get']('ui.overlayContainer');if(_0x3022af)return _0x3022af;const _0x2559dd=this['context']['plugins']['get'](He)['container'];return _0x2559dd?_0x2fc285(_0x2559dd):null;}['_showBalloon'](_0x1a0156){if(this['_manuallyClosedAnnotationViews']['has'](_0x1a0156['view']))return;const _0x39e8ff=this['balloonPanelView']['content']['first'];_0x39e8ff!==_0x1a0156['view']?(_0x39e8ff&&this['_detachListeners'](_0x39e8ff),this['_overlayHost']['sync'](),this['_attachListeners'](_0x1a0156['view']),this['balloonPanelView']['content']['clear'](),this['balloonPanelView']['content']['add'](_0x1a0156['view']),this['_updateBalloonPosition']()):this['_updateBalloonPosition']();}_updateBalloonPosition(){const _0x425c98=this['balloonPanelView']['content']['first'],_0x1a9ef8=_0x425c98&&this['annotations']['getByView'](_0x425c98);if(!_0x1a9ef8||!this['_annotationToNarrowView']['has'](_0x1a9ef8))return;const _0x10c0a1=this['_annotationToNarrowView']['get'](_0x1a9ef8)['element'],_0x3b2182=(function(){const _0x26f8a3=st['defaultPositions'];return[_0x26f8a3['southArrowNorthEast'],_0x26f8a3['northArrowSouthEast'],_0x26f8a3['southArrowNorth'],_0x26f8a3['northArrowSouth'],_0x26f8a3['southArrowNorthWest'],_0x26f8a3['northArrowSouthWest']];}());this['balloonPanelView']['pin']({'target':_0x10c0a1,'positions':_0x3b2182});}['_hideBalloon'](){const _0x332222=this['balloonPanelView'],_0x364665=_0x332222['content']['first'];_0x364665&&(this['_detachListeners'](_0x364665),_0x332222['unpin'](),_0x332222['content']['clear']());}_attachListeners(_0x53528d){this['listenTo'](_0x53528d,'change:height',()=>this['_updateBalloonPosition']()),this['listenTo'](_0x53528d,'Esc',(_0x4d3aa5,_0x5eca33)=>{this['_manuallyClosedAnnotationViews']['add'](_0x53528d),this['_hideBalloon'](),_0x5eca33();});}_detachListeners(_0x2f4b8b){this['stopListening'](_0x2f4b8b);}},Ye=class extends _0x327214{isAttached;annotations;['_manuallyClosed'];['_balloon'];_addedAnnotations;_selectedAnnotations;['_forceRefresh'];_refreshVisibilityDebounced;static get requires(){return[ye,ot,Pe];}static get['pluginName'](){return'InlineAnnotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x359bf2){super(_0x359bf2),_0x359bf2['editing']['view']['addObserver'](yt),this['isAttached']=!0x1,this['set']('activeAnnotation',null),this['annotations']=null,this['_manuallyClosed']=new Set(),this['_balloon']=_0x359bf2['plugins']['get'](ot),this['_addedAnnotations']=new Set(),this['_selectedAnnotations']=[],this['_forceRefresh']=!0x1,this['_refreshVisibilityDebounced']=_0x42d68c(()=>{this['editor']['plugins']['get']('Annotations')['refreshVisibility']();},0xfa,{'leading':!0x1});}init(){const _0x5030a1=this['editor']['plugins']['get'](Pe);_0x5030a1['context']===this['editor']&&(_0x5030a1['register']('inline',this),this['editor']['keystrokes']['set']('Esc',(_0x3d5c89,_0x39ea24)=>{const _0x5cae7c=this['_balloon'];if(this['isAttached']&&_0x5cae7c['visibleView']){const _0x2cd627=this['annotations']['getByView'](_0x5cae7c['visibleView']);_0x2cd627&&this['_closeAnnotation'](_0x2cd627),_0x39ea24();}}));}afterInit(){const _0x380bcb=this['editor']['plugins']['get'](Pe);_0x380bcb['context']===this['editor']&&(_0x380bcb['hasActive']()||_0x380bcb['switchTo']('inline'));}setActiveAnnotation(_0x194972){_0x194972!==this['activeAnnotation']&&(this['activeAnnotation']&&(this['activeAnnotation']['isActive']=!0x1),_0x194972&&this['editor']['ui']['focusTracker']['isFocused']&&(this['annotations']['has'](_0x194972)&&this['_addAnnotationToBalloon'](_0x194972,!0x0),_0x194972['isActive']=!0x0),_0x194972||this['_setSelectedAnnotations']([]),this['activeAnnotation']=_0x194972);}attach(_0x14d153){this['annotations']=_0x14d153;const _0x29fa1b=this['editor']['plugins']['get'](Pe),_0xc3aee7=this['_balloon'];if(this['isAttached'])throw new _0x3a2101('inlineannotations-attach-already-attached',this);if(_0x29fa1b['context']!==this['editor'])throw new _0x3a2101('inlineannotations-not-allowed-with-context',this);const _0x539a60=this['editor']['plugins']['get'](ye);this['listenTo'](_0x539a60,'refresh',()=>{const _0x3e7222=_0x539a60['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});var _0x73ad65,_0x20a515;!this['_forceRefresh']&&(_0x73ad65=_0x3e7222,_0x20a515=this['_selectedAnnotations'],_0x73ad65['length']===_0x20a515['length']&&_0x73ad65['every'](_0x2b4145=>_0x20a515['includes'](_0x2b4145)))||(this['_forceRefresh']=!0x1,this['_setSelectedAnnotations'](_0x3e7222),this['setActiveAnnotation'](_0x3e7222[0x0]||null));}),this['listenTo'](_0x539a60,'blur',(_0xbc27b5,{isAnnotationTracked:_0x2abad9})=>{this['activeAnnotation']&&_0x2abad9(this['activeAnnotation'])&&(this['_setSelectedAnnotations']([]),this['setActiveAnnotation'](null));}),this['listenTo'](_0x539a60,'uiUpdate',()=>{this['_refreshVisibilityDebounced']();}),this['listenTo'](this['editor']['ui']['focusTracker'],'change:isFocused',(_0x5d75d5,_0x17a540,_0x5578ae)=>{_0x5578ae||this['setActiveAnnotation'](null);}),this['listenTo'](_0x14d153,'remove',(_0x563ff3,_0x293589)=>{this['_removeAnnotationFromBalloon'](_0x293589),_0x293589===this['activeAnnotation']&&this['setActiveAnnotation'](null);}),this['listenTo'](_0xc3aee7,'change:visibleView',(_0x26dfe8,_0x2cc01f,_0x599e04,_0x4a5b56)=>{_0x4a5b56&&this['stopListening'](_0x4a5b56);const _0x897ed1=_0x14d153['getByView'](_0x599e04);_0x599e04&&_0x897ed1&&(this['listenTo'](_0x599e04,'change:height',()=>{_0xc3aee7['updatePosition']();}),this['listenTo'](_0x599e04,'Esc',()=>{this['_closeAnnotation'](_0x897ed1),this['editor']['editing']['view']['focus']();}),this['activeAnnotation']!==_0x897ed1&&this['setActiveAnnotation'](_0x897ed1));}),this['listenTo'](this['editor']['ui'],'update',()=>{_0xc3aee7['visibleView']&&_0x14d153['getByView'](_0xc3aee7['visibleView'])&&_0xc3aee7['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 _0x3a2101('inlineannotations-detach-not-attached',this);this['setActiveAnnotation'](null);for(const _0x79758a of this['_addedAnnotations'])this['_removeAnnotationFromBalloon'](_0x79758a);this['_refreshVisibilityDebounced']['cancel'](),this['stopListening'](),this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach'](),this['_refreshVisibilityDebounced']['cancel']();}_setSelectedAnnotations(_0x2f7b78){for(const _0x536977 of this['_selectedAnnotations'])_0x2f7b78['includes'](_0x536977)||this['_manuallyClosed']['delete'](_0x536977);for(const _0x1dfeca of this['annotations'])_0x2f7b78['includes'](_0x1dfeca)||this['_removeAnnotationFromBalloon'](_0x1dfeca);if(this['editor']['ui']['focusTracker']['isFocused']){for(const _0x597e03 of _0x2f7b78)this['_addAnnotationToBalloon'](_0x597e03);}this['_selectedAnnotations']=_0x2f7b78;}_addAnnotationToBalloon(_0x3005f5,_0x3946eb=!0x1){this['_manuallyClosed']['has'](_0x3005f5)||(this['_addedAnnotations']['has'](_0x3005f5)||this['_balloon']['hasView'](_0x3005f5['view'])||(this['_addedAnnotations']['add'](_0x3005f5),this['_balloon']['add']({'stackId':_0x3005f5['view']['id'],'view':_0x3005f5['view'],'position':{'target':()=>this['_getBalloonTargetForAnnotation'](_0x3005f5)}})),_0x3946eb&&this['_balloon']['showStack'](_0x3005f5['view']['id']));}_getBalloonTargetForAnnotation(_0x1d49ea){const _0x5a3bf8=_0x1d49ea['target'],_0x5463cb=this['editor']['editing']['view'],_0xdafa3b=_0x5463cb['document']['selection']['getFirstRange'](),_0x237e21=_0x5463cb['domConverter']['viewRangeToDom'](_0xdafa3b);if(_0x237e21['collapse'](!0x0),_0x5a3bf8){if(_0x5a3bf8 instanceof _0x189269)return _0x5a3bf8;let _0x46c5e8=[];for(const _0x14a3f9 of _0x5a3bf8)_0x46c5e8['push'](..._0x189269['getDomElementRects'](_0x14a3f9));_0x46c5e8=function(_0x4b4ff2){const _0x21c0c7=[];let _0xc9f287=_0x4b4ff2[0x0];for(let _0x23607d=0x1;_0x23607d<_0x4b4ff2['length'];_0x23607d++)if(Xe(_0xc9f287,_0x4b4ff2[_0x23607d])){const _0x26e111=_0x4b4ff2[_0x23607d]['width'];_0xc9f287['width']+=_0x26e111,_0xc9f287['right']+=_0x26e111;}else _0x21c0c7['push'](_0xc9f287),_0xc9f287=_0x4b4ff2[_0x23607d];return _0x21c0c7['push'](_0xc9f287),_0x21c0c7;}(_0x46c5e8);const _0x1c56bd=_0x237e21['getBoundingClientRect']();return _0x46c5e8['find'](_0x495715=>_0x495715['top']<=_0x1c56bd['top']&&_0x495715['bottom']>=_0x1c56bd['bottom']&&_0x495715['left']<=_0x1c56bd['left']&&_0x495715['right']>=_0x1c56bd['right'])||_0x46c5e8[0x0];}return _0x1d49ea['targetRect']||_0x237e21;}_removeAnnotationFromBalloon(_0x31e5a5){this['_addedAnnotations']['has'](_0x31e5a5)&&this['_balloon']['hasView'](_0x31e5a5['view'])&&(this['_addedAnnotations']['delete'](_0x31e5a5),this['_balloon']['remove'](_0x31e5a5['view']));}_closeAnnotation(_0x2072c4){this['_manuallyClosed']['add'](_0x2072c4),this['_removeAnnotationFromBalloon'](_0x2072c4);}};function Xe(_0x3e89fa,_0x563907){return _0x3e89fa['top']===_0x563907['top']&&_0x3e89fa['bottom']===_0x563907['bottom']&&_0x3e89fa['right']===_0x563907['left'];}var qe=class extends wt{['focusTracker'];['focusCycler'];_annotationViews;constructor(_0x37b0c9,_0x24500d){super(_0x37b0c9),this['set']('isEmpty',!_0x24500d['length']),this['focusTracker']=new _0x564482(),this['_annotationViews']=_0x24500d,this['_annotationViews']['delegate']('arrowup','arrowdown')['to'](this),this['on']('arrowup',()=>{this['focusCycler']['focusPrevious']();}),this['on']('arrowdown',()=>{this['focusCycler']['focusNext']();}),this['focusCycler']=new dt({'focusables':_0x24500d,'focusTracker':this['focusTracker']}),this['listenTo'](_0x24500d,'add',()=>{this['isEmpty']=!0x1;}),this['listenTo'](_0x24500d,'remove',(_0x4dcb1a,_0xd20c)=>{_0xd20c['isActive']&&this['focus'](),_0x24500d['length']||(this['isEmpty']=!0x0);});const _0x32280e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'dir':'auto','class':['ck','ck-comments-archive'],'tabindex':-0x1,'role':'list','aria-label':Vt(_0x37b0c9,'COMMENTS_ARCHIVE_LIST_LABEL')},'children':[{'tag':'div','attributes':{'class':['ck-comments-archive__content'],'role':'presentation'},'children':[{'tag':'div','attributes':{'role':'presentation'},'children':_0x24500d},{'tag':'p','attributes':{'class':['ck-comments-archive__info',_0x32280e['if']('isEmpty','ck-hidden',_0x4133f7=>!_0x4133f7)]},'children':[{'text':Vt(_0x37b0c9,'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 _0x15fecd of this['_annotationViews'])this['focusTracker']['add'](_0x15fecd['element']);this['_annotationViews']['on']('change',(_0x4addc4,{added:_0x56d2e7,removed:_0x1ec8ce})=>{for(const _0x101ff2 of _0x56d2e7)this['focusTracker']['add'](_0x101ff2['element']);for(const _0x58fd3e of _0x1ec8ce)this['focusTracker']['remove'](_0x58fd3e['element']);});}},$e=class extends _0x1dc739{static get['pluginName'](){return'CommentsArchive';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[we,me];}constructor(_0x3dbb2e){super(_0x3dbb2e),this['archivedThreads']=new _0x1b9c8e();}init(){const _0x17ba16=this['context'],_0x592fec=_0x17ba16['plugins']['get'](we),_0x1231e7=_0x17ba16['plugins']['get'](me);this['listenTo'](_0x592fec,'addCommentThread',(_0x29015c,{threadId:_0x1a395e})=>{const _0x85bffa=_0x592fec['getCommentThread'](_0x1a395e);_0x85bffa['archivedAt']&&this['archivedThreads']['add'](_0x85bffa,this['_calculatePosition'](_0x85bffa['archivedAt'])),this['listenTo'](_0x85bffa,'change:archivedAt',(_0x1e10ea,_0x4e6076,_0x3f6ab6)=>{_0x3f6ab6?this['archivedThreads']['has'](_0x85bffa)||this['archivedThreads']['add'](_0x85bffa,this['_calculatePosition'](_0x85bffa['archivedAt'])):this['archivedThreads']['has'](_0x85bffa)&&this['archivedThreads']['remove'](_0x85bffa);});}),this['listenTo'](_0x592fec,'removeCommentThread',(_0xb26e18,{threadId:_0x1a42ab})=>{const _0xedd8b7=_0x592fec['getCommentThread'](_0x1a42ab);this['stopListening'](_0xedd8b7),this['archivedThreads']['has'](_0xedd8b7)&&this['archivedThreads']['remove'](_0xedd8b7);},{'priority':'highest'}),this['listenTo'](_0x1231e7['collection'],'focus',(_0x203861,_0x2a9963)=>{_0x2a9963['isVisible']||(_0x2a9963['isActive']=!0x0,_0x1231e7['activate'](_0x2a9963));});}_calculatePosition(_0x465d93){const _0x28459f=[...this['archivedThreads']]['findIndex'](_0x1bf5b7=>_0x1bf5b7['archivedAt']<_0x465d93);return _0x28459f>-0x1?_0x28459f:this['archivedThreads']['length'];}},je=class extends _0x327214{commentsArchiveView;annotationViews;['_pendingThreads'];static get['pluginName'](){return'CommentsArchiveUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[$e,rt];}constructor(_0x1d620f){super(_0x1d620f),this['annotationViews']=new gt(),this['_pendingThreads']=[];}init(){const _0x1c014d=this['editor'],_0x2bc00b=this['_hideDialogOnAnnotationEscape']['bind'](this);_0x1c014d['ui']['componentFactory']['add']('commentsArchive',()=>this['_createCommentsArchiveButton'](nt,!0x0)),_0x1c014d['ui']['componentFactory']['add']('menuBar:commentsArchive',()=>{const _0x243c1f=this['_createCommentsArchiveButton'](pt);return _0x243c1f['set']({'role':'menuitemcheckbox'}),_0x243c1f;});const _0x4e3cd0=_0x1c014d['plugins']['get']($e),_0xaa81dc=_0x1c014d['plugins']['get']('Annotations'),_0x3e660e=_0x1c014d['plugins']['get']('CommentsRepository');_0x4e3cd0['archivedThreads']['forEach'](_0x4dd938=>{this['_handleNewThread'](_0x4dd938);}),this['listenTo'](_0x4e3cd0['archivedThreads'],'add',(_0x37982c,_0x4cb4cc)=>{this['_handleNewThread'](_0x4cb4cc);}),this['listenTo'](_0xaa81dc['collection'],'add',(_0x3e48d4,_0x5415a7)=>{const _0x1b2e56=this['_pendingThreads']['find'](_0x3e192b=>{const _0x14fb92=_0x3e660e['_threadToController']['get'](_0x3e192b);return _0x14fb92&&_0x5415a7['innerView']===_0x14fb92['view'];});if(_0x1b2e56){const _0x49a0b6=this['_calculatePosition'](_0x1b2e56['archivedAt']);this['_addAnnotationToArchive'](_0x5415a7,_0x49a0b6),this['_pendingThreads']['splice'](this['_pendingThreads']['indexOf'](_0x1b2e56),0x1);}}),this['listenTo'](_0x4e3cd0['archivedThreads'],'remove',(_0x253e9b,_0x23e1e0)=>{const _0x2fb107=_0x1c014d['config']['get']('collaboration.channelId');if(!_0x2fb107||_0x23e1e0['channelId']===_0x2fb107){if(this['_pendingThreads']['includes'](_0x23e1e0))this['_pendingThreads']['splice'](this['_pendingThreads']['indexOf'](_0x23e1e0),0x1);else{const _0x13cf66=_0x3e660e['_threadToController']['get'](_0x23e1e0),_0x57ce20=_0xaa81dc['getByInnerView'](_0x13cf66['view']);this['annotationViews']['remove'](_0x57ce20['view']),this['stopListening'](_0x57ce20),this['stopListening'](_0x57ce20['focusableElements']);}}}),this['listenTo'](_0xaa81dc['collection'],'add',(_0x306b79,_0x16da29)=>{this['listenTo'](_0x16da29,'escape',_0x2bc00b);}),this['listenTo'](_0xaa81dc['collection'],'remove',(_0x34adc5,_0xa14436)=>{this['stopListening'](_0xa14436,'escape',_0x2bc00b);});}_addAnnotationToArchive(_0x39012e,_0x1da170){this['listenTo'](_0x39012e,'set:isVisible',_0x221897=>{_0x221897['return']=!0x1,_0x221897['stop']();}),this['annotationViews']['add'](_0x39012e['view'],_0x1da170);}['_handleNewThread'](_0x3d7d5c){const _0x374656=this['editor']['plugins']['get']('CommentsRepository'),_0x5eacbf=this['editor']['plugins']['get']('Annotations'),_0x255edb=this['editor']['config']['get']('collaboration.channelId');if(!_0x255edb||_0x3d7d5c['channelId']===_0x255edb){const _0x7179fb=_0x374656['_threadToController']['get'](_0x3d7d5c);if(!_0x7179fb)return void this['_pendingThreads']['push'](_0x3d7d5c);const _0xf3cdf8=this['_calculatePosition'](_0x3d7d5c['archivedAt']),_0x5dcc61=_0x5eacbf['getByInnerView'](_0x7179fb['view']);_0x5dcc61['isVisible']&&_0x5eacbf['_visibleAnnotations']['remove'](_0x5dcc61),this['_addAnnotationToArchive'](_0x5dcc61,_0xf3cdf8);}}_calculatePosition(_0x57dc71){const _0x2b67a8=this['editor']['config']['get']('collaboration.channelId'),_0x2340af=[...this['editor']['plugins']['get']($e)['archivedThreads']]['filter'](_0x548d12=>_0x548d12['channelId']===_0x2b67a8)['findIndex'](_0x3b61a3=>_0x3b61a3['archivedAt']<_0x57dc71);return _0x2340af<0x0||_0x2340af>this['annotationViews']['length']?this['annotationViews']['length']:_0x2340af-0x1;}_toggleDialog(){const _0x278247=this['editor'],_0x431b01=_0x278247['plugins']['get']('Dialog');this['commentsArchiveView']||(this['commentsArchiveView']=new qe(_0x278247['locale'],this['annotationViews'])),'commentsArchive'===_0x431b01['id']?_0x431b01['hide']():_0x431b01['show']({'id':'commentsArchive','title':Vt(_0x278247['locale'],'COMMENTS_ARCHIVE'),'hasCloseButton':!0x0,'content':this['commentsArchiveView'],'position':ht['EDITOR_TOP_SIDE']});}_createCommentsArchiveButton(_0x22a6a8,_0x59a963=!0x1){const _0xc2af5b=this['editor']['locale'],_0x4f6dff=this['editor']['plugins']['get']('Dialog'),_0x46bba7=new _0x22a6a8(_0xc2af5b);return _0x46bba7['bind']('isEnabled')['to'](this,'isEnabled'),_0x46bba7['bind']('isOn')['to'](_0x4f6dff,'id',_0x2828c6=>'commentsArchive'===_0x2828c6),_0x46bba7['set']({'label':Vt(_0xc2af5b,'COMMENTS_ARCHIVE'),'icon':_0x2d2432,'isToggleable':!0x0}),_0x59a963&&(_0x46bba7['tooltip']=!0x0),this['listenTo'](_0x46bba7,'execute',()=>this['_toggleDialog']()),_0x46bba7;}_hideDialogOnAnnotationEscape=_0x2662f8=>{const _0x235255=_0x2662f8['source'];if(!this['annotationViews']['has'](_0x235255['view']))return;const _0x347ea0=this['editor']['plugins']['get']('Dialog');_0x347ea0['isOpen']&&'commentsArchive'===_0x347ea0['id']&&(_0x347ea0['hide'](),_0x2662f8['stop']());};},ze=class extends _0x327214{static get requires(){return[we,Ne,xe,$e,je,Se,We,Ge,Ye];}static get['pluginName'](){return'Comments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{Te as AddCommentThreadCommand,he as Annotation,ce as AnnotationCollection,Ke as AnnotationCounterButtonView,oe as AnnotationView,me as Annotations,Be as AnnotationsSidebarItemView,De as AnnotationsSidebarView,Pe as AnnotationsUIs,Jt as BaseCommentThreadView,ee as BaseCommentView,Ae as Comment,ge as CommentThread,Dt as CommentThreadController,Gt as CommentThreadInputView,Zt as CommentThreadView,se as CommentView,ze as Comments,$e as CommentsArchive,je as CommentsArchiveUI,Ne as CommentsEditing,Xt as CommentsListView,Se as CommentsOnly,we as CommentsRepository,xe as CommentsUI,ye as EditorAnnotations,Ye as InlineAnnotations,Ge as NarrowSidebar,He as Sidebar,We as WideSidebar,de as bindAnnotationCollections};
|