@ckeditor/ckeditor5-comments 48.5.0-alpha.3 → 48.5.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +11 -11
- package/package.json +16 -16
package/dist/index.js
CHANGED
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Command as
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
((()=>Ot)());constructor(_0x4f86e5={}){(_0x4f86e5=Object['assign']({},_0x4f86e5))['plugins']||(_0x4f86e5['plugins']=CommentEditor['defaultPlugins']),super(_0x4f86e5),this['ui']=new Nt(this),this['set']('placeholder',''),this['model']['document']['on']('change',()=>this['_updatePlaceholder'](),{'priority':'low'}),this['on']('change:placeholder',()=>this['_updatePlaceholder']()),this['model']['document']['createRoot'](),this['editing']['view']['_overlayModeHint']='auto',this['_sendUsageRequest']=()=>window['Promise']['resolve']({'status':'ok'});}create(){const _0x9c0f2=this['config']['get']('initialData')||'';return this['initPlugins']()['then'](()=>this['ui']['init']())['then'](()=>this['data']['init'](_0x9c0f2))['then'](()=>this['fire']('ready'));}destroy(){return super['destroy']()['then'](()=>this['ui']['destroy']());}['focus'](){this['model']['change'](_0xa57270=>{const _0x20e187=this['model']['document']['getRoot'](),_0x141765=_0x20e187&&_0x20e187['getChild'](_0x20e187['childCount']-0x1);_0xa57270['setSelection'](_0x141765,'end'),this['editing']['view']['focus']();});}_updatePlaceholder(){const _0xc42d90=this['editing']['view'],_0x2e54a4=_0xc42d90['document']['getRoot'](),_0x13d75e=_0x2e54a4['getChild'](0x0);_0x2e54a4['childCount']>0x1||!_0x13d75e||'p'!=_0x13d75e['name']?this['placeholderElement']&&this['placeholderElement']['placeholder']&&(mt(_0xc42d90,this['placeholderElement']),this['placeholderElement']=void 0x0):(this['placeholder']&&(_0x13d75e['placeholder']=this['placeholder']),ut({'view':_0xc42d90,'element':_0x13d75e,'keepOnFocus':!0x0}),this['placeholderElement']=_0x13d75e);}},St=class extends ht{keystrokes;['focusTracker'];['focusables'];['focusCycler'];submitButtonView;cancelButtonView;_editorConfig;constructor(_0x267dfa,_0x20aeba={}){super(_0x267dfa),this['editor']=null,this['_editorConfig']=_0x20aeba,this['set']('value',_0x20aeba['initialData']||''),this['set']('disabledSubmit',!0x1),this['set']('showButtons',!0x0),this['set']('placeholder',Et(_0x267dfa,'Reply...')),this['set']('submitLabel',Et(_0x267dfa,'Reply')),this['submitButtonView']=this['_createSubmitButton'](),this['cancelButtonView']=this['_createCancelButton'](),this['focusables']=this['createCollection']([this['submitButtonView'],this['cancelButtonView']]),this['keystrokes']=new _0x2f2b28(),this['focusTracker']=new _0x198c81(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x1baba4=>!_0x1baba4['defaultPrevented']},'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['setTemplate']({'tag':'div','attributes':{'class':['ck-comment__input-wrapper']},'children':[{'tag':'div','attributes':{'class':['ck-comment__input-actions',this['bindTemplate']['if']('showButtons','ck-comment__input-actions--active')]},'children':[this['submitButtonView'],this['cancelButtonView']]}]}),this['keystrokes']['set']('Esc',(_0x107c97,_0x20ecfd)=>{this['cancelButtonView']['fire']('execute'),_0x20ecfd();}),this['keystrokes']['set']('Ctrl+Enter',(_0x2f3f96,_0x39c63c)=>{this['submitButtonView']['isEnabled']&&(this['submitButtonView']['fire']('execute'),_0x39c63c());}),this['on']('submit',(_0x5dc2d7,_0xc67159)=>{_0xc67159['length']>0xfde8?(alert(Et(_0x267dfa,'TOO_LONG_COMMENT_ALERT',[_0xc67159['length'],0xfde8])),_0x5dc2d7['stop']()):this['editor']['setData']('');},{'priority':'high'});}['render'](){super['render'](),this['_setupKeyboardNavigation']();}createEditor(){return this['editor']||(this['editor']=new Rt(this['_editorConfig']),this['_editorCreationPromise']=this['editor']['create']()['then'](()=>{if(this['_isDestroyed'])return;const _0x2dab16=this['editor'];this['element']['insertBefore'](_0x2dab16['ui']['element'],this['element']['firstChild']),_0x2dab16['model']['document']['on']('change',()=>this['value']=_0x2dab16['getData']()),_0x2dab16['bind']('placeholder')['to'](this),this['focusables']['add'](_0x2dab16['ui']['view'],0x0),this['fire']('editorReady',this['editor']);})),this['_editorCreationPromise'];}['focus'](_0x2106e1){-0x1===_0x2106e1?(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:_0x162c4a}=this,_0x26f874=new _0x151ed2(_0x162c4a);return _0x26f874['extendTemplate']({'attributes':{'class':['ck-comment__input-actions--submit']}}),_0x26f874['withText']=!0x0,_0x26f874['bind']('label')['to'](this,'submitLabel'),_0x26f874['on']('execute',()=>{this['fire']('submit',this['value']);}),_0x26f874['bind']('isEnabled')['to'](this,'value',this,'disabledSubmit',(_0x36851f,_0x15ad61)=>!_0x15ad61&&!!_0x36851f['trim']()),_0x26f874;}_createCancelButton(){const {locale:_0x48cf10}=this,_0x521723=new _0x151ed2(_0x48cf10);return _0x521723['extendTemplate']({'attributes':{'class':['ck-comment__input-actions--cancel']}}),_0x521723['label']=Et(_0x48cf10,'Cancel'),_0x521723['withText']=!0x0,_0x521723['on']('execute',()=>{this['editor']['setData'](''),this['fire']('cancel');}),_0x521723;}_setupKeyboardNavigation(){this['keystrokes']['listenTo'](this['element']),this['focusables']['forEach'](_0x457566=>{this['focusTracker']['add'](_0x457566['element']);}),this['focusables']['on']('change',(_0x55053d,_0x771710)=>{for(const _0x1cea7c of Array['from'](_0x771710['added'])['reverse']())this['focusTracker']['add'](_0x1cea7c['element']);});}},xt=class extends ht{constructor(_0x2855e2,_0x3b9bf3,_0x845aef){super(_0x2855e2),this['commentInputView']=new St(_0x2855e2,_0x845aef),this['focusCycler']=this['commentInputView']['focusCycler'],this['commentInputView']['bind']('showButtons')['to'](this['commentInputView']['focusTracker'],'isFocused',this['commentInputView'],'value',(_0x10ee72,_0x231280)=>_0x10ee72||!!_0x231280),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 _0x1f130d(_0x2855e2,_0x3b9bf3),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'](_0xcbedce){this['commentInputView']['focus'](_0xcbedce);}_focusOnNonInteractiveMouseDown(){this['listenTo'](this['element'],'mousedown',(_0x8bcdca,_0x274822)=>{const {submitButtonView:_0x3640e5,cancelButtonView:_0xe0e8dd,editor:_0x4ed326}=this['commentInputView'];[_0x3640e5['element'],_0xe0e8dd['element'],_0x4ed326?_0x4ed326['editing']['view']['getDomRoot']():null]['filter'](_0x4a84df=>_0x4a84df)['some'](_0x1737e9=>_0x1737e9['contains'](_0x274822['target']))||(this['focus'](),_0x274822['preventDefault']());});}},Pt=class extends ht{constructor(_0x47128f){super(_0x47128f);const _0x343d37=this['bindTemplate'];this['set']('count',void 0x0),this['setTemplate']({'tag':'li','attributes':{'class':'ck-thread__comment-count'},'children':[{'text':_0x343d37['to']('count',_0x5494a5=>Et(_0x47128f,'NUMBER_OF_COMMENTS',_0x5494a5))}]});}},Lt=class extends ht{commentViews;resolvedCommentView;['focusTracker'];keystrokes;['focusCycler'];['_model'];['_config'];_collapsedCommentsView;constructor(_0x35af61,_0x4135c7,_0x509e0b){super(_0x35af61);const _0x4c4cbc=this['bindTemplate'];this['set']('hasDirtyComment',!0x1),this['set']('length',_0x4135c7['comments']['length']),this['set']('isActive',!0x1),this['_model']=_0x4135c7,this['_config']=_0x509e0b,this['commentViews']=this['createCollection'](),this['visibleViews']=this['createCollection'](),this['resolvedCommentView']=null,this['focusTracker']=new _0x198c81(),this['keystrokes']=new _0x2f2b28(),this['focusCycler']=new et({'focusables':this['commentViews'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x20d70f=>this['commentViews']['map'](_0x13aeee=>_0x13aeee['element'])['includes'](_0x20d70f['target'])},'actions':{'focusPrevious':'arrowup','focusNext':'arrowdown'}}),this['_collapsedCommentsView']=new Pt(_0x35af61),this['_collapsedCommentsView']['bind']('count')['to'](this,'length',_0x13c2d9=>_0x13c2d9-this['_config']['maxCommentsWhenCollapsed']);for(const _0x42d055 of _0x4135c7['comments'])this['_handleNewCommentModel'](_0x42d055);this['_handleInfoComment'](),this['listenTo'](_0x4135c7['comments'],'add',(_0x4225b4,_0x159d1b)=>{const _0x58d924=this['_calculatePosition'](_0x159d1b);this['length']++,this['_handleNewCommentModel'](_0x159d1b,_0x58d924),this['refreshVisibleViews']();}),this['listenTo'](_0x4135c7['comments'],'remove',(_0x329f67,_0x139423)=>{this['length']--,this['_handleRemoveCommentModel'](_0x139423),this['refreshVisibleViews']();}),this['listenTo'](_0x4135c7,'commentUpdated',()=>this['refreshVisibleViews']()),this['listenTo'](_0x4135c7,'change:isResolved',()=>this['_handleInfoComment']()),this['on']('change:isActive',()=>this['refreshVisibleViews']()),this['on']('change:hasDirtyComment',()=>this['refreshVisibleViews']()),this['setTemplate']({'tag':'ul','attributes':{'class':['ck-thread__comments',_0x4c4cbc['if']('length','ck-hidden',_0x252a7f=>!_0x252a7f)],'aria-label':Et(_0x35af61,'Thread\x20comments')},'children':this['visibleViews']});}get['_shouldCollapse'](){return this['_model']['weight']>this['_config']['maxThreadTotalWeight']&&!this['isActive']&&!this['hasDirtyComment'];}['render'](){super['render'](),this['refreshVisibleViews'](),this['_setupKeyboardNavigation']();}['focus'](_0x2e336d){-0x1===_0x2e336d?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}destroy(){this['_collapsedCommentsView']['destroy']();for(const _0x58df28 of this['commentViews'])_0x58df28['destroy']();super['destroy']();}['refreshVisibleViews'](){this['_shouldCollapse']?this['_rearrangeCollapse']():this['_rearrangeExpand']();}_handleNewCommentModel(_0x1e9a94,_0x12ef73){const _0x2edf9e=new this['_config']['CommentView'](this['locale'],_0x1e9a94,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig']});_0x2edf9e['viewUid']=_0x1e9a94['id'],_0x2edf9e['delegate']('removeComment')['to'](this),_0x2edf9e['delegate']('updateComment')['to'](this),_0x2edf9e['delegate']('resolveCommentThread')['to'](this),_0x2edf9e['delegate']('editorReady')['to'](this),_0x2edf9e['delegate']('editorDestroyed')['to'](this),this['listenTo'](_0x2edf9e,'change:isEditMode',()=>this['_updateHasDirtyComment']()),this['commentViews']['add'](_0x2edf9e,_0x12ef73);}_calculatePosition(_0x247772){const _0x5a4348=this['_model']['_findOptimalIndex'](_0x247772);return this['resolvedCommentView']?this['resolvedCommentView']['authoredAt']>_0x247772['authoredAt']?_0x5a4348-0x1:_0x5a4348:_0x5a4348-0x1;}_handleInfoComment(){if(this['_model']['resolvedBy']&&this['_model']['resolvedAt']){const _0x352cce={'id':'resolved','author':this['_model']['resolvedBy'],'authoredAt':this['_model']['resolvedAt'],'content':Et(this['locale'],'Marked\x20as\x20resolved'),'attributes':{}};this['resolvedCommentView']=new this['_config']['CommentView'](this['locale'],_0x352cce,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig'],'isSystemComment':!0x0}),this['commentViews']['add'](this['resolvedCommentView'],this['_model']['_findOptimalIndex'](_0x352cce));}else this['resolvedCommentView']&&(this['commentViews']['remove'](this['resolvedCommentView']),this['resolvedCommentView']['destroy'](),this['resolvedCommentView']=null);this['refreshVisibleViews']();}_handleRemoveCommentModel(_0x1c87e9){const _0x28fe2f=this['commentViews']['remove'](_0x1c87e9['id']);this['stopListening'](_0x28fe2f),_0x28fe2f['isEditMode']&&this['_updateHasDirtyComment'](),_0x28fe2f['destroy']();}_updateHasDirtyComment(){this['hasDirtyComment']=Array['from'](this['commentViews'])['some'](_0x54364b=>_0x54364b['isEditMode']);}['_rearrangeCollapse'](){const _0x24816d=function(_0x298b94){const _0x14383d=new _0x33b802();for(const _0x14a131 of _0x298b94)_0x14383d['add'](_0x14a131);return _0x14383d;}(this['commentViews']),_0x2cd37a=this['_collapsedCommentsView']['count'];for(let _0xd73e23=0x1;_0xd73e23<=_0x2cd37a;_0xd73e23++)_0x24816d['remove'](0x1);for(const _0x1bfe57 of _0x24816d)_0x1bfe57['collapse']();_0x2cd37a>0x0&&_0x24816d['add'](this['_collapsedCommentsView'],0x1),Dt(_0x3d2856(Array['from'](this['visibleViews']),Array['from'](_0x24816d)),this['visibleViews'],_0x24816d);}['_rearrangeExpand'](){Dt(_0x3d2856(Array['from'](this['visibleViews']),Array['from'](this['commentViews'])),this['visibleViews'],this['commentViews']);for(const _0x2bdbf7 of this['visibleViews'])_0x2bdbf7['expand']();}_setupKeyboardNavigation(){this['commentViews']['forEach'](_0x4cea8f=>{this['focusTracker']['add'](_0x4cea8f['element']),this['keystrokes']['listenTo'](_0x4cea8f['element']);}),this['commentViews']['on']('change',(_0x5d37f3,_0x538e5e)=>{for(const _0xdadb99 of _0x538e5e['removed'])this['focusTracker']['remove'](_0xdadb99['element']),this['keystrokes']['stopListening'](_0xdadb99['element']);for(const _0x34d547 of Array['from'](_0x538e5e['added'])['reverse']())this['focusTracker']['add'](_0x34d547['element']),this['keystrokes']['listenTo'](_0x34d547['element']);});}};function Dt(_0x569040,_0x20f19b,_0x3705e0){let _0x1f23f2=0x0;for(const _0x20158b of _0x569040)switch(_0x20158b){case'insert':_0x20f19b['add'](_0x3705e0['get'](_0x1f23f2),_0x1f23f2),_0x1f23f2++;break;case'delete':_0x20f19b['remove'](_0x1f23f2);break;case'equal':_0x1f23f2++;}}var Vt=class extends ht{constructor(_0xe62c16){super(_0xe62c16);const _0x487cbf=this['bindTemplate'];this['set']('contextValue',''),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-context__value'],'aria-label':_0x487cbf['to']('contextValue',_0x53324a=>Et(_0xe62c16,'THREAD_CONTEXT_LABEL',_0x53324a)),'tabindex':-0x1},'children':[{'text':_0x487cbf['to']('contextValue')}]});}['focus'](){this['element']['focus']();}},Bt=class extends ht{['_model'];reopenButtonView;contextView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];constructor(_0x16da22,_0x2fe32f){super(_0x16da22);const _0x49f721=this['bindTemplate'];this['_model']=_0x2fe32f,this['reopenButtonView']=this['_createReopenButton'](),this['contextView']=this['_createContextView'](),this['focusables']=this['createCollection']([this['contextView'],this['reopenButtonView']]),this['focusTracker']=new _0x198c81(),this['keystrokes']=new _0x2f2b28(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['bind']('hasContext')['to'](this['_model'],'context',_0x536dad=>!!_0x536dad),this['bind']('contextValue')['to'](this['_model'],'context',_0x3c9bd3=>_0x3c9bd3&&_0x3c9bd3['value']?this['_trimContextValue'](_0x3c9bd3['value']):Et(this['locale'],'Comment\x20was\x20made\x20on\x20an\x20element')),this['setTemplate']({'tag':'div','attributes':{'class':['ck-thread__header']},'children':[{'tag':'div','attributes':{'class':['ck-context-wrapper']},'children':[{'tag':'div','attributes':{'class':['ck-context',_0x49f721['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 _0xbe9b17=new _0x151ed2(this['locale']);return _0xbe9b17['label']=Et(this['locale'],'Reopen'),_0xbe9b17['tooltip']=Et(this['locale'],'Reopen'),_0xbe9b17['icon']=_0x2b133d,_0xbe9b17['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x1337c0=>!_0x1337c0),_0xbe9b17['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x3ba781,_0x26feb6)=>_0x3ba781&&_0x26feb6),_0xbe9b17['on']('execute',()=>{this['fire']('reopenCommentThread',this['_model']['id']);}),_0xbe9b17;}_trimContextValue(_0xcd2b82){if(_0xcd2b82['length']<0x96)return _0xcd2b82;const _0xbde25d=_0xcd2b82['lastIndexOf']('\x20',0x93);return _0xcd2b82['substring'](0x0,_0xbde25d>-0x1?_0xbde25d:0x93)+'...';}_attachContextActions(){const _0x50ea3c=this['element']['querySelector']('.ck-context'),_0x132eb7=_0x50ea3c['querySelector']('.ck-context__value');this['listenTo'](_0x50ea3c,'mouseenter',()=>{_0x132eb7['offsetWidth']<_0x132eb7['scrollWidth']&&_0x50ea3c['classList']['add']('overlay');}),this['listenTo'](_0x50ea3c,'mouseleave',()=>{_0x50ea3c['classList']['remove']('overlay');});}_setupKeyboardNavigation(){this['keystrokes']['listenTo'](this['element']);for(const _0x5ce4ff of this['focusables'])this['focusTracker']['add'](_0x5ce4ff['element']),this['keystrokes']['listenTo'](_0x5ce4ff['element']);}_createContextView(){const _0x3b3eca=new Vt(this['locale']);return _0x3b3eca['bind']('contextValue')['to'](this),_0x3b3eca;}},Ht=class extends ht{['_model'];['_config'];commentThreadHeaderView;commentThreadInputView;ariaDescriptionView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];constructor(_0x23fa18,_0x350053,_0x40d5ab,_0x32ca7a){super(_0x23fa18),this['set']('isActive',!0x1),this['set']('isDirty',!0x1),this['_model']=_0x350053,this['_localUser']=_0x40d5ab,this['_config']=_0x32ca7a,this['commentThreadHeaderView']=new Bt(_0x23fa18,_0x350053),this['commentThreadHeaderView']['delegate']('reopenCommentThread')['to'](this),this['ariaDescriptionView']=new _0x557fb6(_0x23fa18,Et(_0x23fa18,'COMMENT_THREAD_DESCRIPTION')),this['listenTo'](this,'reopenCommentThread',()=>{this['focus']();}),this['commentsListView']=new Lt(_0x23fa18,_0x350053,Object['assign']({'CommentView':this['_config']['CommentView']},_0x32ca7a)),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',(_0x2b4f22,_0x41bd13)=>_0x2b4f22||!!_0x41bd13),this['bind']('isUnlinked')['to'](_0x350053,'unlinkedAt',_0x485746=>!!_0x485746);let _0x32bb04=null;const _0x4db901=()=>{const _0x39a4e8=this['_model']['comments']['first']||null;_0x39a4e8!==_0x32bb04&&(_0x32bb04&&this['stopListening'](_0x32bb04,'change:content'),_0x32bb04=_0x39a4e8,_0x39a4e8&&this['listenTo'](_0x39a4e8,'change:content',_0x4db901));const _0x3c0071=_0x39a4e8?_0x39a4e8['author']['name']:this['_localUser']['name'],_0x33ba05=_0x39a4e8?new DOMParser()['parseFromString'](_0x301d12(_0x39a4e8['content'],{'limit':this['_config']['maxCommentCharsWhenCollapsed']}),'text/html')['body']['textContent']:'',_0x372cb4=Et(this['locale'],'COMMENT_THREAD_LABEL',[this['length'],_0x3c0071]);this['set']('ariaLabel',_0x33ba05?_0x372cb4+'\x20'+_0x33ba05:_0x372cb4);};this['listenTo'](this['_model']['comments'],'change',_0x4db901),_0x4db901(),this['focusables']=this['createCollection']([this['commentsListView'],this['commentThreadInputView']]),this['focusTracker']=new _0x198c81(),this['keystrokes']=new _0x2f2b28(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0xd530e1=>_0xd530e1['target']!==this['element']},'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}});}['focus'](){this['element']['focus']();}['render'](){super['render'](),_0x262b7e(this,this['focusables']);}async destroy(){this['isDirty']=!0x1,this['commentsListView']['destroy'](),await this['commentThreadInputView']['destroy'](),super['destroy']();}_createCommentThreadInputView(){const _0x163b2b=new xt(this['locale'],this['_localUser'],this['_config']['editorConfig']),_0x54b303=_0x163b2b['commentInputView'];return _0x163b2b['bind']('showInput')['to'](this,'isActive',this['_model'],'isReadOnly',this['_model'],'canComment',this['_model'],'archivedAt',_0x54b303,'value',(_0x225820,_0x1141e3,_0x5e8f6c,_0x2cb199,_0x524ab1)=>!!_0x524ab1||!!_0x2cb199&&_0x5e8f6c&&!_0x1141e3||_0x225820&&_0x5e8f6c&&!_0x1141e3),_0x54b303['bind']('placeholder')['to'](this,'length',this['_model'],'isResolvable',this['_model'],'isResolved',(_0x459de1,_0x599462,_0x148d0c)=>{let _0x10d7e0;return _0x10d7e0=_0x148d0c&&_0x599462?'Reply\x20to\x20reopen\x20discussion...':_0x459de1?'Reply...':'Write\x20a\x20comment...',Et(this['locale'],_0x10d7e0);}),_0x54b303['bind']('submitLabel')['to'](this,'length',_0x53b0ac=>Et(this['locale'],_0x53b0ac?'Reply':'Comment')),_0x54b303['on']('submit',(_0x5f2598,_0x25ec52)=>{this['fire']('addComment',_0x25ec52),this['_model']['isResolved']&&this['_model']['isResolvable']&&this['fire']('reopenCommentThread',this['_model']['id']),this['_model']['isSubmitted']||this['fire']('submitCommentThread');}),_0x54b303['on']('cancel',()=>{this['focus']();}),_0x54b303['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0x54b303['on']('cancel',_0x325bcf=>{0x0==this['length']&&(this['fire']('removeCommentThread'),_0x325bcf['stop']());}),this['on']('change:isActive',(_0x261156,_0x54e211,_0x2afc33)=>{_0x2afc33||this['length']||_0x54b303['value']||this['fire']('removeCommentThread');}),_0x163b2b;}};const Ft=/* #__PURE__ -- @preserve */
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
_0x3d5e80();var $t=class Annotation extends jt{['view'];focusableElements;_type;_target;constructor({view:_0x338c70,target:_0x3e4616,type:_0x53d277,isVisible:_0xda2077=!0x0}){super(),this['view']=_0x338c70,this['view']['element']||this['view']['render'](),this['_type']=_0x53d277,this['_target']=_0x3e4616,Annotation['_assertCorrectTarget'](this['_getNormalizedTarget']()),this['focusableElements']=new _0x33b802([this['view']['element']],{'idProperty':'_id'}),this['focusableElements']['on']('add',(_0x508f66,_0x4d38ad)=>{this['view']['focusTracker']['add'](_0x4d38ad);}),this['focusableElements']['on']('remove',(_0x1f64e9,_0x2a572c)=>{this['view']['focusTracker']['remove'](_0x2a572c);}),this['set']('isVisible',_0xda2077);}get type(){return'function'==typeof this['_type']?this['_type']():this['_type'];}get['innerView'](){return this['view']['mainView'];}get target(){const _0x5daea3=this['_getNormalizedTarget']();return Annotation['_assertCorrectTarget'](_0x5daea3),_0x5daea3;}get targetRect(){const _0x51adf3=this['target'];if(null===_0x51adf3)return null;if(_0x51adf3 instanceof _0x23f3bc)return _0x51adf3;const _0x5e6b7d=_0x51adf3['filter'](_0x225424=>function(_0x3f7470){return!!_0x3f7470['offsetParent']||!!_0x3f7470['getClientRects']()['item'](0x0);}(_0x225424));return 0x0===_0x5e6b7d['length']?null:_0x23f3bc['getDomElementRects'](_0x5e6b7d[0x0])[0x0];}get isActive(){return this['view']['isActive'];}set isActive(_0x50278d){this['view']['isActive']=_0x50278d,this['view']['mainView']['isActive']=_0x50278d;}updateTargetRect(){this['view']['targetRect']=this['targetRect'];}destroy(){this['focusableElements']['stopListening'](),this['focusableElements']['clear'](),this['stopListening']();}refreshVisibility(){this['isVisible']=!!this['targetRect'];}static _assertCorrectTarget(_0x971d4b){if(!(null===_0x971d4b||_0x971d4b instanceof _0x23f3bc||Array['isArray'](_0x971d4b)&&_0x971d4b['every'](_0x44d1d5=>zt(_0x44d1d5))))throw new _0x402d5c('annotation-invalid-target',null,{'target':_0x971d4b});}_getNormalizedTarget(){const _0x11e1e6='function'==typeof this['_target']?this['_target']():this['_target'];return zt(_0x11e1e6)?[_0x11e1e6]:_0x11e1e6;}};function zt(_0x308eea){return null!==_0x308eea&&'object'==typeof _0x308eea&&'nodeType'in _0x308eea&&0x1===_0x308eea['nodeType'];}var Jt=class extends _0x33b802{_innerViewToAnnotation;_viewToAnnotation;['_focusTracker'];constructor(_0x2239b4=[]){super(),this['_innerViewToAnnotation']=new Map(),this['_viewToAnnotation']=new Map(),this['_focusTracker']=new _0x198c81(),this['_focusTracker']['on']('change:isFocused',(_0x303a73,_0x1d0816,_0x5bd92b)=>{_0x5bd92b||this['fire']('blur');});for(const _0x2a1b48 of _0x2239b4)this['add'](_0x2a1b48);}get['isFocused'](){return this['_focusTracker']['isFocused'];}['add'](_0xf9186f){if(this['has'](_0xf9186f))throw new _0x402d5c('annotationcollection-duplicated-item',null);this['_innerViewToAnnotation']['set'](_0xf9186f['innerView'],_0xf9186f),this['_viewToAnnotation']['set'](_0xf9186f['view'],_0xf9186f);for(const _0x353c91 of _0xf9186f['focusableElements'])this['_focusTracker']['add'](_0x353c91);if(this['listenTo'](_0xf9186f['focusableElements'],'add',(_0x249c0e,_0x21d6a4)=>{this['_focusTracker']['add'](_0x21d6a4);}),this['listenTo'](_0xf9186f['focusableElements'],'remove',(_0x18083b,_0x5e87ca)=>{this['_focusTracker']['remove'](_0x5e87ca);}),this['listenTo'](_0xf9186f['view']['focusTracker'],'change:isFocused',(_0x2a74eb,_0x36286c,_0xbaf597)=>{_0xbaf597&&this['fire']('focus',_0xf9186f);}),_0xf9186f['updateTargetRect'](),this['_areCachedRectsStale']()){for(const _0x5d2173 of this)_0x5d2173['updateTargetRect']();}const _0x4d553d=this['_getOrderInContent'](_0xf9186f['view']['targetRect']);return super['add'](_0xf9186f,_0x4d553d);}['remove'](_0x3771bd){if(!this['has'](_0x3771bd))throw new _0x402d5c('annotationcollection-not-existing-item',null);this['stopListening'](_0x3771bd['view']['focusTracker']),this['stopListening'](_0x3771bd['focusableElements']);for(const _0x4aa819 of _0x3771bd['focusableElements'])this['_focusTracker']['remove'](_0x4aa819);return this['_viewToAnnotation']['delete'](_0x3771bd['view']),this['_innerViewToAnnotation']['delete'](_0x3771bd['innerView']),super['remove'](_0x3771bd);}getByInnerView(_0x581780){return this['_innerViewToAnnotation']['get'](_0x581780);}getByView(_0x140711){return this['_viewToAnnotation']['get'](_0x140711);}destroy(){super['clear'](),this['stopListening'](),this['_innerViewToAnnotation']['clear'](),this['_viewToAnnotation']['clear'](),this['_focusTracker']['destroy']();}refreshPositioning(){for(const _0x2db1a0 of this)_0x2db1a0['updateTargetRect']();this['_sort']();}_sort(){const _0x214967=Array['from'](this)['sort']((_0x2a6fff,_0x1cb1f4)=>Zt(_0x2a6fff['view']['targetRect'],_0x1cb1f4['view']['targetRect']));for(let _0x315e93=_0x214967['length']-0x1;_0x315e93>0x0;_0x315e93--){const _0x48a87a=_0x214967[_0x315e93];_0x315e93!==this['getIndex'](_0x48a87a)&&(this['remove'](_0x48a87a),this['add'](_0x48a87a));}}_getOrderInContent(_0x2b78f6){let _0x4f61f2=0x0;if(!_0x2b78f6)return this['length'];for(const _0x5b6f08 of this){const _0x19b6b6=_0x5b6f08['view']['targetRect'];if(_0x19b6b6){if(Zt(_0x2b78f6,_0x19b6b6)<0x0)return _0x4f61f2;_0x4f61f2++;}}return _0x4f61f2;}_areCachedRectsStale(){const _0x1afff6=this['get'](0x0);if(!_0x1afff6)return!0x1;const _0x1b97dd=_0x1afff6['view']['targetRect'],_0x51d1ba=_0x1afff6['targetRect'];return!(!_0x1b97dd||!_0x51d1ba)&&(_0x1b97dd['top']!==_0x51d1ba['top']||_0x1b97dd['left']!==_0x51d1ba['left']);}};function Qt({source:_0x465cd3,target:_0xa5ff5c,filter:_0xcbc169}){for(const _0x1bd8ef of _0x465cd3)_0xcbc169(_0x1bd8ef)&&_0xa5ff5c['add'](_0x1bd8ef);_0xa5ff5c['listenTo'](_0x465cd3,'add',(_0x44f16b,_0x60df42)=>{_0xcbc169(_0x60df42)&&_0xa5ff5c['add'](_0x60df42);}),_0xa5ff5c['listenTo'](_0x465cd3,'remove',(_0x1811e0,_0x350103)=>{_0xa5ff5c['has'](_0x350103)&&_0xa5ff5c['remove'](_0x350103);});}function Zt(_0x3dfa83,_0x110c4d){if(null===_0x3dfa83&&null===_0x110c4d)return 0x0;if(null===_0x3dfa83)return-0x1;if(null===_0x110c4d)return 0x1;const _0x26ac50=_0x3dfa83['top']-_0x110c4d['top'];return 0x0==_0x26ac50?_0x3dfa83['left']-_0x110c4d['left']:_0x26ac50;}var ti=class extends _0x2bb426{collection;_visibleAnnotations;static get['pluginName'](){return'Annotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x27bfab){if(super(_0x27bfab),this['collection']=new Jt(),this['_visibleAnnotations']=new Jt(),this['set']('activeAnnotations',new Set()),this['_bindAnnotationsToVisibleAnnotations'](),_0x27bfab instanceof _0x2e081e){const _0x19bb16=_0x27bfab['locale'];_0x27bfab['accessibility']['addKeystrokeInfoGroup']({'id':'annotations','label':Et(_0x19bb16,'ACCESSIBILITY_HELP_ANNOTATIONS_GROUP'),'keystrokes':[{'label':Et(_0x19bb16,'ACCESSIBILITY_HELP_ANNOTATIONS_MOVE_TO'),'keystroke':'Ctrl+Shift+E'},{'label':Et(_0x19bb16,'ACCESSIBILITY_HELP_ANNOTATIONS_EXIT'),'keystroke':'Esc'},{'label':Et(_0x19bb16,'ACCESSIBILITY_HELP_ANNOTATIONS_ENTER'),'keystroke':'Enter'},{'label':Et(_0x19bb16,'ACCESSIBILITY_HELP_ANNOTATIONS_BROWSE_GROUPS'),'keystroke':[['Tab'],['Shift+Tab']]},{'label':Et(_0x19bb16,'ACCESSIBILITY_HELP_ANNOTATIONS_SUBMIT_COMMENT'),'keystroke':['Ctrl+Enter']},{'label':Et(_0x19bb16,'ACCESSIBILITY_HELP_ANNOTATIONS_NAVIGATE_THREADS'),'keystroke':[['Arrowup'],['Arrowdown']]}]});}this['_setupEnterAnnotationKeystroke'](),this['_setupEscapeAnnotationHandling']();}['add'](_0x415feb){this['collection']['add'](_0x415feb);}['remove'](_0x5899a4){this['collection']['remove'](_0x5899a4),_0x5899a4['destroy']();}refreshVisibility(){for(const _0x216601 of this['collection'])_0x216601['refreshVisibility']();}refreshPositioning(){this['_visibleAnnotations']['refreshPositioning']();}getByInnerView(_0x45ea74){return this['collection']['getByInnerView'](_0x45ea74);}deactivateAll(){this['fire']('_deactivateAllAnnotations');}destroy(){for(const _0x1f54ab of this['collection'])_0x1f54ab['destroy']();this['_visibleAnnotations']['destroy'](),this['collection']['destroy'](),super['destroy']();}activate(_0x4f6673){this['fire']('_activateAnnotation',_0x4f6673);}createAnnotation(_0x116884){return new $t(_0x116884);}createAnnotationView(_0x33a1d2,_0x5f0728){return new qt(_0x33a1d2,_0x5f0728);}_addActiveAnnotation(_0xf14e53){const _0x59a226=new Set(this['activeAnnotations']);_0x59a226['add'](_0xf14e53),this['activeAnnotations']=_0x59a226;}_removeActiveAnnotation(_0x55a040){const _0x454e03=new Set(this['activeAnnotations']);_0x454e03['delete'](_0x55a040),this['activeAnnotations']=_0x454e03;}_bindAnnotationsToVisibleAnnotations(){const _0x4d8051=this['collection'],_0x51d019=this['_visibleAnnotations'];function _0xf14909(_0x329241){const _0x47a703=_0x329241['source'];_0x47a703['isVisible']&&!_0x51d019['has'](_0x47a703)?_0x51d019['add'](_0x47a703):!_0x47a703['isVisible']&&_0x51d019['has'](_0x47a703)&&_0x51d019['remove'](_0x47a703),_0x47a703['view']['focusTracker']['remove'](_0x47a703['view']['element']),_0x47a703['view']['focusTracker']['add'](_0x47a703['view']['element']);}this['listenTo'](_0x4d8051,'add',(_0x24d205,_0x54ed6a)=>{_0x54ed6a['isVisible']&&_0x51d019['add'](_0x54ed6a),this['listenTo'](_0x54ed6a,'change:isVisible',_0xf14909);}),this['listenTo'](_0x4d8051,'remove',(_0x56df00,_0x3de9b0)=>{_0x51d019['has'](_0x3de9b0)&&_0x51d019['remove'](_0x3de9b0),this['stopListening'](_0x3de9b0,'change:isVisible',_0xf14909);});}_setupEnterAnnotationKeystroke(){const _0x53907f=_0x528669=>{_0x528669['on']('ready',()=>{_0x528669['keystrokes']['set'](_0x5baba3,(_0x40401b,_0x415daf)=>{const _0x353d0d=_0x3468db(this['activeAnnotations']['values']());_0x353d0d&&(_0x353d0d['view']['focus'](),_0x415daf());});});};this['context']instanceof _0x2e081e?_0x53907f(this['context']):this['context']['editors']&&this['context']['editors']['on']('add',(_0x11bff3,_0xc10e8a)=>{_0x53907f(_0xc10e8a);});}_setupEscapeAnnotationHandling(){const _0x1628c7=_0x16eedf=>{const _0x3c9ab4=_0x16eedf['source'],_0x4803de=[];let _0x59903f;if(Array['isArray'](_0x3c9ab4['target'])){_0x59903f=_0x3c9ab4['target'][0x0],this['context']instanceof _0x2e081e?_0x4803de['push'](this['context']):this['context']['editors']&&_0x4803de['push'](...this['context']['editors']);for(const _0x44410d of _0x4803de)for(const _0x1e3712 of _0x44410d['editing']['view']['domRoots']['values']())if(_0x1e3712['contains'](_0x59903f))return void _0x44410d['editing']['view']['focus']();_0x59903f['focus']();}};this['listenTo'](this['collection'],'add',(_0x25ae04,_0x250b6d)=>{this['listenTo'](_0x250b6d,'escape',_0x1628c7,{'priority':'low'});}),this['listenTo'](this['collection'],'remove',(_0x149821,_0x16ff81)=>{this['stopListening'](_0x16ff81,'escape',_0x1628c7);});}};const ii=Symbol('noChannel'),ei={'admin':!0x0,'modifyAll':!0x1,'write':!0x0,'resolve':!0x0},si=/* #__PURE__ -- @preserve */
|
|
30
|
-
|
|
31
|
-
_0x3d5e80();var oi=class extends _0x2bb426{_threads;_threadToController;_viewToController;static get requires(){return[ti,_0x478212,_0x552e83];}static get['pluginName'](){return'CommentsRepository';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xa60533){super(_0xa60533),this['_threads']=new Map(),this['_threadToController']=new Map(),this['_viewToController']=new Map(),this['set']('_readOnlyChannels',new Set()),this['set']('_permissions',new Map());const _0x234e6f=this['context']['config'];_0x234e6f['define']('comments.maxCommentsWhenCollapsed',0x2),_0x234e6f['define']('comments.maxThreadTotalWeight',0x1f4),_0x234e6f['define']('comments.maxCommentCharsWhenCollapsed',0x8c),_0x234e6f['define']('comments.CommentThreadView',Ut),_0x234e6f['define']('comments.CommentView',Yt),_0x234e6f['get']('comments.editorConfig')||console['warn']('Missing\x20comments\x20editor\x20configuration\x20(`comments.editorConfig`).\x20Default\x20configuration\x20will\x20be\x20used\x20instead.');}init(){const _0x36cee7=this['context']['plugins']['get'](ti);this['set']('activeCommentThread',null),this['on']('addCommentThread',(_0x2041d4,_0x152c8a)=>this['_addCommentThread'](_0x152c8a)),this['on']('submitCommentThread',(_0x51591f,_0x1ab9f3)=>this['_submitCommentThread'](_0x1ab9f3)),this['on']('resolveCommentThread',(_0x372d88,_0x202bd0)=>this['_resolveCommentThread'](_0x202bd0)),this['on']('resolveCommentThread',(_0x21aa62,_0x1ba181)=>this['_updateActiveAnnotation'](_0x1ba181),{'priority':'lowest'}),this['on']('reopenCommentThread',(_0x39e97b,_0x1d4631)=>this['_reopenCommentThread'](_0x1d4631)),this['on']('reopenCommentThread',(_0x26e868,_0x534b95)=>this['_updateActiveAnnotation'](_0x534b95),{'priority':'lowest'}),this['on']('removeCommentThread',(_0x296700,_0x2a43ef)=>this['_removeCommentThread'](_0x2a43ef)),this['on']('updateCommentThread',(_0x519a7a,_0x557534)=>this['_updateCommentThread'](_0x557534)),this['on']('updateCommentThread',(_0x1460b2,_0x1c8cb0)=>this['_updateActiveAnnotation'](_0x1c8cb0),{'priority':'lowest'}),this['on']('addComment',(_0x5d5054,_0x3236df)=>this['_addComment'](_0x3236df)),this['on']('updateComment',(_0x21d694,_0xfbc507)=>this['_updateComment'](_0xfbc507)),this['on']('removeComment',(_0x15a9a9,_0x2ae804)=>this['_removeComment'](_0x2ae804)),this['on']('addComment',(_0x5be0f1,{threadId:_0x2e9e84,isFromAdapter:_0x232571})=>{if(_0x232571)return;const _0x5054d0=this['getCommentThread'](_0x2e9e84),_0xdcb89f=_0x5054d0&&this['_threadToController']['get'](_0x5054d0);_0xdcb89f&&_0xdcb89f['view']['commentsListView']['focus'](-0x1);},{'priority':'lowest'}),this['listenTo'](_0x36cee7,'change:activeAnnotations',(_0x1ef0e4,_0x5004d1,_0x2f6290)=>{const _0x255677=Array['from'](_0x2f6290)['map'](_0x3daf73=>this['_viewToController']['get'](_0x3daf73['innerView']))['filter'](Boolean)[0x0];this['activeCommentThread']=_0x255677?_0x255677['model']:null;});}set adapter(_0x14d5ad){if(this['_adapter'])throw new _0x402d5c('commentsrepository-adapter-already-set');this['_adapter']=_0x14d5ad;}get adapter(){return this['_adapter'];}addCommentThread({channelId:_0x4b281e=ii,threadId:_0x38235e=_0x295c58(),comments:_0x3c763b=[],unlinkedAt:_0x2a52c6=null,resolvedAt:_0x5e1fda=null,resolvedBy:_0x33b664=null,target:_0x51ae32=null,context:_0x3e2163=null,attributes:_0x3e996e={},isResolvable:_0x2328c2=!0x0,isSubmitted:_0x223df2=!0x1,isFromAdapter:_0x255feb=!0x1}={}){return this['fire'](ai('addCommentThread',_0x4b281e),{'channelId':_0x4b281e,'threadId':_0x38235e,'comments':_0x3c763b,'unlinkedAt':_0x2a52c6,'resolvedAt':_0x5e1fda,'resolvedBy':_0x33b664,'target':_0x51ae32,'context':_0x3e2163,'attributes':_0x3e996e,'isFromAdapter':_0x255feb,'isResolvable':_0x2328c2,'isSubmitted':_0x223df2}),this['getCommentThread'](_0x38235e);}openNewCommentThread({channelId:_0x392b38=ii,threadId:_0x36f0f0=_0x295c58(),target:_0x5e3f07,context:_0x206ddb=null,isResolvable:_0x1d3e5a=!0x0}){if(this['_readOnlyChannels']['has'](_0x392b38)||this['_readOnlyChannels']['has'](void 0x0))return null;if(!_0x5e3f07)throw new _0x402d5c('commentsrepository-missing-target');const _0x2fc5f6=this['addCommentThread']({'channelId':_0x392b38,'threadId':_0x36f0f0,'target':_0x5e3f07,'context':_0x206ddb,'isResolvable':_0x1d3e5a});if(!_0x2fc5f6)return null;const _0xc25db5=this['_threadToController']['get'](_0x2fc5f6),_0x20251a=_0xc25db5['view']['commentThreadInputView']['commentInputView'],_0x1d49e7=this['context']['plugins']['get'](ti),_0x5aa45b=_0x1d49e7['getByInnerView'](_0xc25db5['view']);return _0x1d49e7['activate'](_0x5aa45b),_0x20251a['once']('editorReady',()=>_0x20251a['focus']()),_0x2fc5f6;}hasCommentThread(_0x41c8da){if('string'!=typeof _0x41c8da)throw new _0x402d5c('commentsrepository-invalid-comment-thread-id');return this['_threads']['has'](_0x41c8da);}updateCommentThread({channelId:_0x2ff0bd=ii,threadId:_0x49b944,context:_0x14450e,unlinkedAt:_0x54e408,attributes:_0x588281,isFromAdapter:_0x35e891=!0x1}){return this['fire'](ai('updateCommentThread',_0x2ff0bd),{'channelId':_0x2ff0bd,'threadId':_0x49b944,'context':_0x14450e,'unlinkedAt':_0x54e408,'attributes':_0x588281,'isFromAdapter':_0x35e891}),this['getCommentThread'](_0x49b944);}getCommentThread(_0x58e4d4){if('string'!=typeof _0x58e4d4)throw new _0x402d5c('commentsrepository-invalid-comment-thread-id');return this['_threads']['get'](_0x58e4d4);}fetchCommentThread({channelId:_0x5b2d04,threadId:_0x3aa73a}={}){const _0x6efc8=this['getCommentThread'](_0x3aa73a);if(_0x6efc8)return Promise['resolve'](_0x6efc8);if(!this['adapter'])return Promise['resolve'](void 0x0);if('function'!=typeof this['adapter']['getCommentThread'])throw new _0x402d5c('commentsrepository-missing-thread-and-adapter-method',this['context']);return this['adapter']['getCommentThread']({'channelId':_0x5b2d04,'threadId':_0x3aa73a})['then'](_0x37ea08=>this['hasCommentThread'](_0x3aa73a)?this['getCommentThread'](_0x3aa73a):_0x37ea08?this['addCommentThread'](Object['assign']({'isFromAdapter':!0x0,'channelId':_0x5b2d04},_0x37ea08)):void 0x0)['catch'](_0x32c507=>{throw console['error'](_0x32c507),new _0x402d5c('commentsrepository-fetch-comment-thread',this['context']);});}getCommentThreads({channelId:_0xa5a376,skipNotAttached:_0xb61149=!0x1,skipEmpty:_0x57e0df=!0x1,toJSON:_0x3351a2=!0x1}={}){const _0x13f9e5=[];for(const _0x20880d of this['_threads']['values']())_0xa5a376&&_0x20880d['channelId']!==_0xa5a376||_0xb61149&&!_0x20880d['isAttached']||_0x57e0df&&0x0===_0x20880d['length']||_0x13f9e5['push'](_0x20880d);return _0x3351a2?_0x13f9e5['map'](_0x5e8fee=>_0x5e8fee['toJSON']()):_0x13f9e5;}getAnnotationForCommentThread(_0x318099){const _0xd26155=this['_threadToController']['get'](_0x318099);return _0xd26155&&this['context']['plugins']['get'](ti)['getByInnerView'](_0xd26155['view'])||null;}getCommentThreadForAnnotation(_0x1def06){const _0x711a48=this['_viewToController']['get'](_0x1def06['innerView']);return _0x711a48?_0x711a48['model']:null;}setActiveCommentThread(_0x51ca54){const _0x80a66f=this['context']['plugins']['get'](ti);if(!_0x51ca54)return void(this['activeCommentThread']&&_0x80a66f['deactivateAll']());const _0x326e03=this['getCommentThread'](_0x51ca54);if(!_0x326e03)throw new _0x402d5c('commentsrepository-active-missing-comment-thread',null,{'threadId':_0x51ca54});if(!this['_threadToController']['has'](_0x326e03))throw new _0x402d5c('commentsrepository-active-not-attached',null,{'threadId':_0x51ca54});const _0x32cf18=_0x80a66f['getByInnerView'](this['_threadToController']['get'](_0x326e03)['view']);_0x80a66f['activate'](_0x32cf18);}switchReadOnly(_0x5acc1a,_0x483305){_0x5acc1a?this['_readOnlyChannels']['add'](_0x483305):this['_readOnlyChannels']['delete'](_0x483305),this['fire']('change:_readOnlyChannels','_readOnlyChannels',this['_readOnlyChannels'],this['_readOnlyChannels']);}['isReadOnly'](_0x33b4b2){return this['_readOnlyChannels']['has'](_0x33b4b2)||this['_readOnlyChannels']['has'](void 0x0);}createCommentThreadController(_0x2cda7c,_0x1e6437){return new bt(_0x2cda7c,_0x1e6437);}setPermissions(_0x4d764b,_0x1f5ce9=ii){this['_permissions']['set'](_0x1f5ce9,_0x4d764b),this['fire']('change:_permissions','_permissions',this['_permissions'],this['_permissions']);}getPermissions(_0x546f46=ii){return this['_permissions']['has'](_0x546f46)?this['_permissions']['get'](_0x546f46):ei;}_addCommentThread({channelId:_0x42fe58,threadId:_0x594572,comments:_0x17c009,unlinkedAt:_0x1f0135,resolvedAt:_0x54b367,resolvedBy:_0x5e3e4b,target:_0x50e1fd,context:_0xe12e,attributes:_0xb5da84,isFromAdapter:_0x71a937,isResolvable:_0x2f6d8f,isSubmitted:_0x21eb63}){if('string'!=typeof _0x594572)throw new _0x402d5c('commentsrepository-invalid-comment-thread-id',null,{'threadId':_0x594572});if(this['hasCommentThread'](_0x594572))throw new _0x402d5c('commentsrepository-duplicated-comment-thread-id',null,{'threadId':_0x594572});const _0x53bd59=new ri(this,{'channelId':_0x42fe58,'id':_0x594572,'context':_0xe12e,'attributes':_0xb5da84,'unlinkedAt':_0x1f0135,'resolvedAt':_0x54b367,'resolvedBy':_0x5e3e4b?this['context']['plugins']['get'](_0x552e83)['getUser'](_0x5e3e4b):null,'isResolvable':_0x2f6d8f,'isSubmitted':_0x21eb63||_0x71a937});this['_threads']['set'](_0x594572,_0x53bd59);for(const _0x491278 of _0x17c009)_0x53bd59['_add'](this['_createNewComment']({'threadId':_0x594572,..._0x491278}));return _0x50e1fd&&_0x53bd59['attachTo'](_0x50e1fd),_0x71a937||!_0x53bd59['length']?Promise['resolve']():this['_submitCommentThread']({'channelId':_0x42fe58,'threadId':_0x594572});}_submitCommentThread({channelId:_0x41ba18,threadId:_0x3f39f3}){if(!this['hasCommentThread'](_0x3f39f3))throw new _0x402d5c('commentsrepository-missing-comment-thread',this);const _0x146fcd=this['getCommentThread'](_0x3f39f3);if(_0x146fcd['_isSubmitted']=!0x0,!this['adapter']||'function'!=typeof this['adapter']['addCommentThread'])return Promise['resolve']();const {id:_0x8be069,comments:_0x447afe,resolvedAt:_0x5c72eb,resolvedBy:_0x4b5fba,context:_0x41f0b8,attributes:_0x32ce98}=_0x146fcd,_0x17d8ae=this['context']['plugins']['get']('PendingActions'),_0x5db6a9=_0x17d8ae['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['addCommentThread']({'channelId':_0x41ba18,'threadId':_0x8be069,'comments':_0x447afe['map'](_0xc437b5=>_0xc437b5['toJSON']()),'resolvedAt':_0x5c72eb,'resolvedBy':_0x4b5fba?_0x4b5fba['id']:_0x4b5fba,'context':_0x41f0b8,'attributes':_0x32ce98})['then'](({comments:_0x4250b3})=>{_0x17d8ae['remove'](_0x5db6a9);for(const _0x131377 of _0x4250b3)this['_updateComment']({'channelId':_0x41ba18,'threadId':_0x3f39f3,'commentId':_0x131377['commentId'],'createdAt':_0x131377['createdAt'],'isFromAdapter':!0x0});})['catch'](_0x521367=>{throw console['error'](_0x521367),new _0x402d5c('commentsrepository-add-comment-thread-internal-error',this);});}_attachCommentThread({threadId:_0xda8ae2,target:_0x2ce2ec}){const _0x2fbd74=this['getCommentThread'](_0xda8ae2);if(!_0x2fbd74)throw new _0x402d5c('commentsrepository-attach-missing-comment-thread',this);const _0x5d4c55=this['context']['plugins']['get']('PendingActions'),_0x4f59a4=this['context']['plugins']['get'](ti),_0x506c53=this['_createCommentThreadView'](_0x2fbd74),_0x17b176=new bt(_0x2fbd74,_0x506c53);let _0x3a880b=null;_0x506c53['on']('change:isDirty',(_0x48d05f,_0x221ca7,_0x72226a)=>{_0x72226a?_0x3a880b=_0x5d4c55['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD')):_0x3a880b&&(_0x5d4c55['remove'](_0x3a880b),_0x3a880b=null);}),this['_threadToController']['set'](_0x2fbd74,_0x17b176),this['_viewToController']['set'](_0x506c53,_0x17b176);const _0x2fb726=new qt(this['context']['locale'],_0x506c53);_0x2fb726['bind']('length')['to'](_0x506c53),_0x2fb726['bind']('isDirty')['to'](_0x506c53,'isDirty',_0x506c53,'length',(_0x1cac49,_0x4ef6c2)=>_0x1cac49||!_0x4ef6c2),_0x2fb726['bind']('isActive')['to'](_0x506c53),_0x2fb726['type']='comment';const _0x5c97da=new $t({'view':_0x2fb726,'target':_0x2ce2ec,'type':'comment','isVisible':!_0x2fbd74['archivedAt']&&!!('function'==typeof _0x2ce2ec?_0x2ce2ec():_0x2ce2ec)});return _0x506c53['on']('escape',()=>{_0x5c97da['fire']('escape');}),this['_bindAnnotationToEditors'](_0x506c53,_0x5c97da),_0x4f59a4['add'](_0x5c97da),_0x5c97da;}_bindAnnotationToEditors(_0xf14bfe,_0x260e52){this['listenTo'](_0xf14bfe,'editorReady',(_0x5559c5,_0x300ee8)=>{const _0x26628f=_0x300ee8['ui']['view']['body']['bodyCollectionContainer'];_0x260e52['focusableElements']['add'](_0x26628f),this['context']instanceof _0x2e081e&&this['context']['ui']['focusTracker']['add'](_0x26628f);},{'priority':'highest'}),this['listenTo'](_0xf14bfe,'editorDestroyed',(_0x587bf9,_0x44067d)=>{const _0x46597d=_0x44067d['ui']['view']['body']['bodyCollectionContainer'];_0x260e52['focusableElements']['has'](_0x46597d)&&_0x260e52['focusableElements']['remove'](_0x46597d),this['context']instanceof _0x2e081e&&this['context']['ui']['focusTracker']['remove'](_0x46597d);});}_unbindEditors(_0x42eadc){this['stopListening'](_0x42eadc,'editorReady'),this['stopListening'](_0x42eadc,'editorDestroyed');}_createCommentThreadView(_0x489c05){const _0x41e205=this['context']['plugins']['get'](_0x552e83),{config:_0x38b79b,locale:_0x3cd74d}=this['context'],_0x2d5464=_0x337b38(_0x38b79b['get']('locale'),_0x3cd74d);return new(0x0,(_0x38b79b['get']('comments'))['CommentThreadView'])(_0x3cd74d,_0x489c05,_0x41e205['me'],{'editorConfig':{..._0x38b79b['get']('comments.editorConfig'),'licenseKey':this['context']['config']['get']('licenseKey')},'copyMarkers':_0x38b79b['get']('comments.copyMarkers'),'maxCommentsWhenCollapsed':_0x38b79b['get']('comments.maxCommentsWhenCollapsed'),'maxThreadTotalWeight':_0x38b79b['get']('comments.maxThreadTotalWeight'),'maxCommentCharsWhenCollapsed':_0x38b79b['get']('comments.maxCommentCharsWhenCollapsed'),'formatDateTime':_0x2d5464,'CommentView':_0x38b79b['get']('comments')['CommentView']});}_resolveCommentThread({threadId:_0x4cd2aa,channelId:_0x5a893e,resolvedAt:_0x391e66,resolvedBy:_0x1f04eb,isFromAdapter:_0x1c7a50}){if(!this['hasCommentThread'](_0x4cd2aa))throw new _0x402d5c('commentsrepository-missing-comment-thread',null,{'threadId':_0x4cd2aa});const _0x1b4099=this['getCommentThread'](_0x4cd2aa);if(_0x1b4099['isResolved'])throw new _0x402d5c('commentsrepository-resolved-comment-thread',null,{'threadId':_0x4cd2aa});const _0x2ed79a=this['context']['plugins']['get'](_0x552e83);if(_0x1b4099['resolvedBy']=_0x2ed79a['getUser'](_0x1f04eb),_0x1b4099['resolvedAt']=_0x391e66,_0x1c7a50||!this['adapter']||'function'!=typeof this['adapter']['resolveCommentThread'])return Promise['resolve']();const _0x4c4b5d=this['context']['plugins']['get']('PendingActions'),_0x29ec2d=_0x4c4b5d['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['resolveCommentThread']({'channelId':_0x5a893e,'threadId':_0x4cd2aa})['then'](({resolvedAt:_0x3e0aa9,resolvedBy:_0x2a0a9c})=>{_0x4c4b5d['remove'](_0x29ec2d),_0x1b4099['resolvedBy']['id']!==_0x2a0a9c&&(_0x1b4099['resolvedBy']=_0x2ed79a['getUser'](_0x2a0a9c)),_0x1b4099['resolvedAt']=_0x3e0aa9;})['catch'](_0x4e9502=>{throw console['error'](_0x4e9502),new _0x402d5c('commentsrepository-resolve-comment-thread-internal-error',this);});}_reopenCommentThread({threadId:_0x265a5f,channelId:_0x177417,isFromAdapter:_0x56bae3}){if(!this['hasCommentThread'](_0x265a5f))throw new _0x402d5c('commentsrepository-missing-comment-thread',null,{'threadId':_0x265a5f});const _0x4d8150=this['getCommentThread'](_0x265a5f);if(!_0x4d8150['isResolved'])throw new _0x402d5c('commentsrepository-reopen-comment-thread',null,{'threadId':_0x265a5f});if(_0x4d8150['resolvedBy']=null,_0x4d8150['resolvedAt']=null,_0x56bae3||!this['adapter']||'function'!=typeof this['adapter']['reopenCommentThread'])return Promise['resolve']();const _0x638fe7=this['context']['plugins']['get']('PendingActions'),_0x51278c=_0x638fe7['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['reopenCommentThread']({'channelId':_0x177417,'threadId':_0x265a5f})['then'](()=>_0x638fe7['remove'](_0x51278c))['catch'](_0x31430d=>{throw console['error'](_0x31430d),new _0x402d5c('commentsrepository-reopen-comment-thread-internal-error',this);});}_removeCommentThread({threadId:_0x1c1c56,isFromAdapter:_0x5e17c7}){const _0x2d8b6b=this['getCommentThread'](_0x1c1c56);if(!_0x2d8b6b)throw new _0x402d5c('commentsrepository-remove-missing-comment-thread',this);if(this['_detachCommentThread'](_0x1c1c56),this['_threads']['delete'](_0x1c1c56),!_0x2d8b6b['isSubmitted']||_0x5e17c7||!this['adapter']||'function'!=typeof this['adapter']['removeCommentThread'])return Promise['resolve']();const _0x5e5547=this['context']['plugins']['get']('PendingActions'),{channelId:_0x3f2b5b}=_0x2d8b6b,_0x12dc89=_0x5e5547['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['removeCommentThread']({'channelId':_0x3f2b5b,'threadId':_0x1c1c56})['then'](()=>_0x5e5547['remove'](_0x12dc89))['catch'](_0x10d7cd=>{throw console['error'](_0x10d7cd),new _0x402d5c('commentsrepository-remove-comment-thread-internal-error',this);});}_updateCommentThread({threadId:_0x34c8bc,unlinkedAt:_0x2b1fb1,context:_0xe25cf0,attributes:_0x3237e7,isFromAdapter:_0x4e9dd9}){if('string'!=typeof _0x34c8bc)throw new _0x402d5c('commentsrepository-invalid-comment-thread-id',null,{'threadId':_0x34c8bc});if(!this['hasCommentThread'](_0x34c8bc))throw new _0x402d5c('commentsrepository-missing-comment-thread',null,{'threadId':_0x34c8bc});const _0x39ddf9=this['getCommentThread'](_0x34c8bc);let _0x1a1814=!0x1;if(void 0x0!==_0xe25cf0&&_0x39ddf9['context']!==_0xe25cf0&&(_0x39ddf9['context']=_0xe25cf0,_0x1a1814=!0x0),void 0x0!==_0x2b1fb1&&_0x39ddf9['unlinkedAt']!==_0x2b1fb1&&(_0x39ddf9['unlinkedAt']=_0x2b1fb1,_0x1a1814=!0x0),_0x3237e7&&!_0x4472b0(_0x3237e7,_0x39ddf9['attributes'])&&(_0x39ddf9['attributes']=_0x3237e7,_0x1a1814=!0x0),!_0x1a1814)return Promise['resolve']();if(!_0x39ddf9['isSubmitted']||_0x4e9dd9||!this['adapter']||'function'!=typeof this['adapter']['updateCommentThread'])return Promise['resolve']();const _0xc60cb4=this['context']['plugins']['get']('PendingActions'),{channelId:_0x5685ab}=_0x39ddf9,_0x525909=_0xc60cb4['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['updateCommentThread']({'channelId':_0x5685ab,'threadId':_0x34c8bc,'context':_0xe25cf0,'unlinkedAt':_0x2b1fb1,'attributes':_0x3237e7})['then'](()=>_0xc60cb4['remove'](_0x525909))['catch'](_0x43185a=>{throw console['error'](_0x43185a),new _0x402d5c('commentsrepository-update-comment-thread-internal-error',this);});}_detachCommentThread(_0x56d5ce){const _0x4a3b37=this['context']['plugins']['get'](ti),_0x4511d7=this['getCommentThread'](_0x56d5ce);if(_0x4511d7['_isAttached']=!0x1,this['_threadToController']['has'](_0x4511d7)){const _0x456c87=this['_threadToController']['get'](_0x4511d7),_0x4eafa3=_0x456c87['view'],_0x2e1eaa=_0x4a3b37['getByInnerView'](_0x4eafa3);this['_threadToController']['delete'](_0x4511d7),this['_viewToController']['delete'](_0x4eafa3),_0x2e1eaa&&_0x4a3b37['remove'](_0x2e1eaa),_0x456c87['destroy'](),_0x4eafa3['destroy']()['then'](()=>{this['_unbindEditors'](_0x4eafa3);});}}_updateActiveAnnotation({threadId:_0x3a311c,resolvedAt:_0x3c1839,unlinkedAt:_0x2b7646}){const _0x7164ed=!!_0x3c1839,_0x33ca4b=this['context']['plugins']['get'](ti),_0x590819=this['getCommentThread'](_0x3a311c);if(this['_threadToController']['has'](_0x590819)){const _0x5d3bad=this['_threadToController']['get'](_0x590819)['view'],_0x6b667c=_0x33ca4b['getByInnerView'](_0x5d3bad);_0x6b667c&&(_0x7164ed&&_0x33ca4b['_removeActiveAnnotation'](_0x6b667c),_0x2b7646?_0x6b667c['isVisible']=!0x1:_0x6b667c['refreshVisibility']());}}_getExternalAuthor(_0x250c9f){const _0x5b5227=this['context']['plugins']['get'](_0x552e83),_0x106bee=_0x1480b3('external:'+_0x250c9f),_0x122919=_0x5b5227['getUser'](_0x106bee);return _0x122919||_0x5b5227['addUser']({'id':_0x106bee,'name':_0x250c9f});}_createNewComment({threadId:_0x2fb172,commentId:_0x2e936f=_0x295c58(),content:_0x2fcdd3,authorId:_0x50ef6e,createdAt:_0x86d955,attributes:_0x5ebb26}){if('string'!=typeof _0x2e936f)throw new _0x402d5c('commentsrepository-invalid-commentid');if('string'!=typeof _0x50ef6e)throw new _0x402d5c('commentsrepository-invalid-comment-authorid');if('string'!=typeof _0x2fcdd3||!_0x2fcdd3['trim']())throw new _0x402d5c('commentsrepository-invalid-comment-content');const _0xd0b00a=this['context']['plugins']['get'](_0x552e83)['getUser'](_0x50ef6e);if(!_0xd0b00a)throw new _0x402d5c('commentsrepository-add-comment-user-not-exists',null,{'authorId':_0x50ef6e});let _0x268c19=null,_0x5b3c68=_0x86d955;return _0x5ebb26?.['@external']&&(_0x268c19=this['_getExternalAuthor'](_0x5ebb26['@external']['authorName']),_0x5b3c68=new Date(_0x5ebb26['@external']['createdAt'])),new hi(this,{'threadId':_0x2fb172,'id':_0x2e936f,'author':_0x268c19||_0xd0b00a,'creator':_0xd0b00a,'content':_0x2fcdd3,'createdAt':_0x86d955,'authoredAt':_0x5b3c68,'attributes':_0x5ebb26});}_addComment(_0xb398e1){let {threadId:_0x4d5cd4,content:_0x195e78,attributes:_0x4baf02,isFromAdapter:_0xb9d9dc}=_0xb398e1;const _0x18c955=this['getCommentThread'](_0xb398e1['threadId']);if(!_0x18c955)throw new _0x402d5c('commentsrepository-add-comment-to-missing-comment-thread',this);const _0xdd5691=this['_createNewComment'](_0xb398e1),{id:_0x2ee4d9}=_0xdd5691;if(_0x18c955['_add'](_0xdd5691),_0xb9d9dc||!this['adapter']||'function'!=typeof this['adapter']['addComment']||!_0x18c955['isSubmitted'])return Promise['resolve']();const _0x1d2642=this['context']['plugins']['get']('PendingActions'),{channelId:_0x32c234}=_0x18c955,_0x28065d=_0x1d2642['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return _0x4baf02||(_0x4baf02={}),this['adapter']['addComment']({'channelId':_0x32c234,'threadId':_0x4d5cd4,'commentId':_0x2ee4d9,'content':_0x195e78,'attributes':_0x4baf02})['then'](_0x3a2a46=>{_0x1d2642['remove'](_0x28065d),_0x3a2a46&&this['_updateComment']({'channelId':_0x32c234,'threadId':_0x4d5cd4,'commentId':_0x2ee4d9,'createdAt':_0x3a2a46['createdAt'],'isFromAdapter':!0x0});})['catch'](_0x3af585=>{throw console['error'](_0x3af585),new _0x402d5c('commentsrepository-add-comment-internal-error',this);});}_updateComment({threadId:_0x5e501a,commentId:_0x3fef77,content:_0x5ef6df,createdAt:_0x373378,attributes:_0x30c574,isFromAdapter:_0x54966b}){if(void 0x0!==_0x5ef6df&&('string'!=typeof _0x5ef6df||!_0x5ef6df['trim']()['length']))throw new _0x402d5c('commentsrepository-update-comment-invalid-content');const _0x4d0c20=this['getCommentThread'](_0x5e501a),_0x5db073=_0x4d0c20['getComment'](_0x3fef77);if(!_0x5db073)throw new _0x402d5c('commentsrepository-update-missing-comment',this);let _0x1640bf=!0x1;if(_0x5ef6df&&_0x5ef6df!==_0x5db073['content']&&(_0x5db073['isEditable']||_0x54966b)&&(_0x5db073['content']=_0x5ef6df,_0x1640bf=!0x0),_0x373378&&_0x373378!==_0x5db073['createdAt']&&(_0x5db073['createdAt']=_0x373378,_0x5db073['isExternal']||(_0x5db073['authoredAt']=_0x373378),_0x1640bf=!0x0),_0x30c574&&!_0x4472b0(_0x30c574,_0x5db073['attributes'])&&(_0x5db073['attributes']=_0x30c574,_0x1640bf=!0x0),!_0x1640bf)return Promise['resolve']();if(_0x4d0c20['fire']('commentUpdated'),_0x54966b||!this['adapter']||'function'!=typeof this['adapter']['updateComment'])return Promise['resolve']();const _0xb7a487=this['context']['plugins']['get']('PendingActions'),{channelId:_0x31f9e6}=this['getCommentThread'](_0x5db073['threadId']),_0x3964ab=_0xb7a487['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['updateComment']({'channelId':_0x31f9e6,'threadId':_0x5e501a,'commentId':_0x3fef77,'content':_0x5ef6df,'attributes':_0x30c574})['then'](()=>_0xb7a487['remove'](_0x3964ab))['catch'](_0x399407=>{throw console['error'](_0x399407),new _0x402d5c('commentsrepository-update-comment-internal-error',this);});}_removeComment({threadId:_0x35b12e,commentId:_0xe0c2af,isFromAdapter:_0x292f65}){const _0xce0fdb=this['getCommentThread'](_0x35b12e),_0x3a96f7=_0xce0fdb['getComment'](_0xe0c2af);if(!_0x3a96f7)throw new _0x402d5c('commentsrepository-remove-missing-comment',this);if(_0xce0fdb['_remove'](_0x3a96f7),_0x292f65||!this['adapter']||'function'!=typeof this['adapter']['removeComment'])return Promise['resolve']();const _0x1556bc=this['context']['plugins']['get']('PendingActions'),{channelId:_0x4d1794}=_0xce0fdb,_0x42a79b=_0x1556bc['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['removeComment']({'channelId':_0x4d1794,'threadId':_0x35b12e,'commentId':_0xe0c2af})['then'](()=>_0x1556bc['remove'](_0x42a79b))['catch'](_0x5b6f7a=>{throw console['error'](_0x5b6f7a),new _0x402d5c('commentsrepository-remove-comment-internal-error',this);});}},ri=class extends si{['channelId'];['id'];_isAttached;_isSubmitted;comments;_repository;constructor(_0x1be7fd,_0x49c010){super();const _0x5c745a=_0x49c010['isResolvable'];this['channelId']=_0x49c010['channelId'],this['id']=_0x49c010['id'],this['comments']=new _0x33b802(),this['_repository']=_0x1be7fd,this['_isAttached']=!0x1,this['_isSubmitted']=_0x49c010['isSubmitted'],this['set']('_hasTargetInContent',!0x0),this['bind']('isReadOnly')['to'](_0x1be7fd,'_permissions',_0x1be7fd,'_readOnlyChannels',()=>_0x1be7fd['isReadOnly'](this['channelId'])),this['bind']('isRemovable')['to'](_0x1be7fd,'_permissions',()=>_0x1be7fd['getPermissions'](this['channelId'])['admin']),this['bind']('canComment')['to'](_0x1be7fd,'_permissions',()=>{const _0x58371f=_0x1be7fd['getPermissions'](this['channelId']);return _0x58371f['write']||_0x58371f['admin'];}),this['bind']('isResolvable')['to'](_0x1be7fd,'_permissions',()=>_0x5c745a&&_0x1be7fd['getPermissions'](this['channelId'])['resolve']),this['set']('context',_0x49c010['context']),this['bind']('archivedAt')['to'](this,'resolvedAt',this,'unlinkedAt',(_0xaf1ad2,_0x30be7b)=>_0xaf1ad2?_0x30be7b?_0xaf1ad2<_0x30be7b?_0xaf1ad2:_0x30be7b:_0xaf1ad2:_0x30be7b),this['set']('unlinkedAt',_0x49c010['unlinkedAt']||null),this['set']('resolvedAt',_0x49c010['resolvedAt']||null),this['set']('resolvedBy',_0x49c010['resolvedBy']||null),this['bind']('isResolved')['to'](this,'resolvedAt',_0x5250b0=>!!_0x5250b0),this['set']('attributes',_0x49c010['attributes']||{});}get weight(){return Array['from'](this['comments'])['reduce']((_0x3a51f6,_0x59efa4)=>_0x3a51f6+_0x59efa4['weight'],0x0);}get length(){return this['comments']['length'];}get isAttached(){return this['_isAttached'];}get isSubmitted(){return this['_isSubmitted'];}submit(){const {channelId:_0x4c94a,id:_0x5c7f3e}=this;this['_repository']['fire'](ai('submitCommentThread',_0x4c94a),{'channelId':_0x4c94a,'threadId':_0x5c7f3e});}setUnlinkedAt(_0x5e5d4f){this['_update']({'unlinkedAt':_0x5e5d4f});}['resolve']({resolvedAt:_0x4db6c2=new Date(),resolvedBy:_0x49e10b='',isFromAdapter:_0x574fc6=!0x1}={}){const _0x100ec7=this['_repository']['context']['plugins']['get'](_0x552e83)['me'],{channelId:_0x4fbc44,id:_0x3ba2a3}=this;this['_repository']['fire'](ai('resolveCommentThread',_0x4fbc44),{'channelId':_0x4fbc44,'threadId':_0x3ba2a3,'resolvedAt':_0x4db6c2,'resolvedBy':_0x49e10b||_0x100ec7['id'],'isFromAdapter':_0x574fc6});}['reopen']({isFromAdapter:_0x463800=!0x1}={}){const {channelId:_0x39f078,id:_0x5ed5a9}=this;this['_repository']['fire'](ai('reopenCommentThread',_0x39f078),{'channelId':_0x39f078,'threadId':_0x5ed5a9,'isFromAdapter':_0x463800});}setContext(_0x130fcf){this['context']||this['_update']({'context':_0x130fcf});}setAttribute(_0x318aa8,_0x421581){const _0x5b907e=_0x2feb7e(this['attributes']);_0x3f4a33(_0x5b907e,_0x318aa8,_0x421581),this['_update']({'attributes':_0x5b907e});}removeAttribute(_0xc0d4f6){const _0x49ca80=_0x2feb7e(this['attributes']);_0x3ab25c(_0x49ca80,_0xc0d4f6),this['_update']({'attributes':_0x49ca80});}['remove']({isFromAdapter:_0x1018fb=!0x1}={}){const {channelId:_0x163d52,id:_0x52df8b}=this;this['_repository']['fire'](ai('removeCommentThread',_0x163d52),{'channelId':_0x163d52,'threadId':_0x52df8b,'isFromAdapter':_0x1018fb});}attachTo(_0x174052){return this['_repository']['_attachCommentThread']({'threadId':this['id'],'target':_0x174052});}addComment(_0x270de0){const {channelId:_0x254e89,id:_0x2b65b8}=this;this['_repository']['fire'](ai('addComment',_0x254e89,_0x2b65b8),Object['assign']({'channelId':_0x254e89,'threadId':_0x2b65b8},_0x270de0));}getComment(_0x276896){if('string'!=typeof _0x276896)throw new _0x402d5c('commentsrepository-get-comment-invalid-id',null,{'commentId':_0x276896});return this['comments']['get'](_0x276896);}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'](_0x4c8a01=>_0x4c8a01['toJSON']()),'attributes':this['attributes']};}['_add'](_0x1d3f81){return this['listenTo'](_0x1d3f81,'change:authoredAt',()=>{const _0x4ba2fe=this['_findOptimalIndex'](_0x1d3f81),_0x19c229=this['comments'];_0x4ba2fe-0x1!=_0x19c229['getIndex'](_0x1d3f81)&&_0x4ba2fe+0x1!=_0x19c229['getIndex'](_0x1d3f81)&&(this['_remove'](_0x1d3f81),this['_add'](_0x1d3f81));}),this['comments']['add'](_0x1d3f81,this['_findOptimalIndex'](_0x1d3f81));}_update(_0x59a765){const {channelId:_0x3cce4b,id:_0x28562f}=this;this['_repository']['fire'](ai('updateCommentThread',_0x3cce4b),{..._0x59a765,'channelId':_0x3cce4b,'threadId':_0x28562f});}['_remove'](_0xdd45cb){return this['stopListening'](_0xdd45cb),_0xdd45cb['destroy'](),this['comments']['remove'](_0xdd45cb);}_findOptimalIndex(_0x141529){const _0x36027c=this['comments']['find'](_0xceb362=>new Date(_0xceb362['authoredAt'])['getTime']()>new Date(_0x141529['authoredAt'])['getTime']());return _0x36027c?this['comments']['getIndex'](_0x36027c):this['length'];}},hi=class extends ni{['id'];threadId;author;creator;createdAt;_repository;constructor(_0x3a66e2,_0x2a1c50){super();const _0x236779=_0x3a66e2['context']['plugins']['get'](_0x552e83)['me'],_0x97d71f=_0x3a66e2['getCommentThread'](_0x2a1c50['threadId']),_0xb57cee=0x0===_0x97d71f['comments']['length'],_0x29b7f6=_0x236779===_0x2a1c50['author'];this['id']=_0x2a1c50['id'],this['threadId']=_0x2a1c50['threadId'],this['author']=_0x2a1c50['author'],this['creator']=_0x2a1c50['creator'],this['set']('content',_0x2a1c50['content']),this['createdAt']=_0x2a1c50['createdAt']||new Date(),this['set']('authoredAt',_0x2a1c50['authoredAt']||new Date()),this['bind']('resolvedAt')['to'](_0x97d71f,'resolvedAt'),this['set']('attributes',_0x2a1c50['attributes']||{}),this['bind']('isEditable')['to'](_0x3a66e2,'_permissions',()=>{const _0x377844=_0x3a66e2['getPermissions'](_0x97d71f['channelId'])['write'],_0x514e65=_0x3a66e2['getPermissions'](_0x97d71f['channelId'])['modifyAll'];return _0x29b7f6&&_0x377844||!_0x29b7f6&&_0x514e65;}),this['bind']('isRemovable')['to'](_0x97d71f,'isRemovable',_0x3a66e2,'_permissions',_0x47d875=>{const _0x3035fb=_0x3a66e2['getPermissions'](_0x97d71f['channelId'])['write'],_0x475a64=_0x3a66e2['getPermissions'](_0x97d71f['channelId'])['modifyAll'];return _0x29b7f6&&_0x3035fb||_0x47d875&&_0xb57cee||!_0x29b7f6&&_0x475a64&&!_0xb57cee;}),this['bind']('isReadOnly')['to'](_0x97d71f,'isReadOnly'),this['_repository']=_0x3a66e2;}get isExternal(){return Boolean(this['attributes']&&this['attributes']['@external']);}get weight(){return Math['max'](function(_0x3d23aa){const _0x4ccbe1=document['createElement']('div');return _0x4ccbe1['innerHTML']=_0x3d23aa,_0x4ccbe1['textContent']['length'];}(this['content']),0xc8);}update(_0x3478ae){const {threadId:_0xdb5b66,id:_0x359207}=this;if(!this['_repository']['hasCommentThread'](_0xdb5b66))throw new _0x402d5c('commentsrepository-update-comment-missing-comment-thread',this);const {channelId:_0x4ddc9f}=this['_repository']['getCommentThread'](_0xdb5b66);this['_repository']['fire'](ai('updateComment',_0x4ddc9f,_0xdb5b66),{'channelId':_0x4ddc9f,'threadId':_0xdb5b66,'commentId':_0x359207,..._0x3478ae});}setAttribute(_0x55e5ff,_0x50407b){const _0x7b53d1=_0x2feb7e(this['attributes']);_0x3f4a33(_0x7b53d1,_0x55e5ff,_0x50407b),this['update']({'attributes':_0x7b53d1});}removeAttribute(_0x2dd9c2){const _0xd60a12=_0x2feb7e(this['attributes']);_0x3ab25c(_0xd60a12,_0x2dd9c2),this['update']({'attributes':_0xd60a12});}['remove'](_0x28bcba={}){if(!_0x28bcba['isFromAdapter']&&!this['isRemovable'])return;const {threadId:_0x2a3508,id:_0x5dace1}=this;if(!this['_repository']['hasCommentThread'](_0x2a3508))throw new _0x402d5c('commentsrepository-remove-comment-missing-comment-thread',this);const {channelId:_0x350a84}=this['_repository']['getCommentThread'](_0x2a3508);this['_repository']['fire'](ai('removeComment',_0x350a84,_0x2a3508),{'channelId':_0x350a84,'threadId':_0x2a3508,'commentId':_0x5dace1,..._0x28bcba});}toJSON(){return{'commentId':this['id'],'content':this['content'],'createdAt':this['createdAt'],'authorId':this['creator']['id'],'attributes':this['attributes']};}destroy(){this['stopListening']();}};function ai(_0x4efb5e,..._0x110824){for(const _0x621ad1 of _0x110824)void 0x0!==_0x621ad1&&(_0x4efb5e+=':'+String(_0x621ad1));return _0x4efb5e;}var ci=class extends _0x56f817{constructor(_0x28ac24){super(_0x28ac24),this['set']('hasContent',!0x1);}['refresh'](){const _0x499b25=this['editor']['model']['document']['selection'];this['isEnabled']=!0x0,this['hasContent']=!0x1;for(const _0x34a997 of _0x499b25['getRanges']())if(this['_hasContent'](_0x34a997))return void(this['hasContent']=!0x0);}execute({threadId:_0x3abbd5=_0x295c58(),ranges:_0x282dd5,comment:_0x3aa62a}={}){const _0x13137f=this['editor']['model'],_0x1dea56=_0x282dd5??Array['from'](_0x13137f['document']['selection']['getRanges']()),_0xa4d9d4=[];for(const _0x43e999 of _0x1dea56)this['_hasContent'](_0x43e999)&&_0xa4d9d4['push'](this['_trimToContent'](_0x43e999));if(!_0xa4d9d4['length'])throw new _0x402d5c('addcommentthreadcommand-incorrect-ranges',null);_0x3aa62a&&this['_createCommentThread'](_0x3abbd5,_0x3aa62a),this['_createMarkersFromRanges'](_0x3abbd5,_0xa4d9d4,!!_0x3aa62a);}_createMarkersFromRanges(_0x6ecf67,_0xdd7798,_0x57c99c){this['editor']['model']['change'](_0x8aedcd=>{for(const _0xdeecbb of _0xdd7798){const _0x420f0c='comment:'+_0x6ecf67+':'+_0x295c58()['substr'](0x1,0x5);_0x8aedcd['addMarker'](_0x420f0c,{'range':_0xdeecbb,'usingOperation':_0x57c99c,'affectsData':_0x57c99c});}});}_createCommentThread(_0x207a8f,_0x39892c){const _0x3b47cd=this['editor']['plugins']['get']('CommentsRepository'),_0x380051=this['editor']['config']['get']('collaboration.channelId'),_0x5c903d=this['editor']['plugins']['get']('Users')['me'];if(!_0x5c903d)throw new _0x402d5c('addcommentthreadcommand-user-not-found',null);_0x3b47cd['addCommentThread']({'threadId':_0x207a8f,'channelId':_0x380051,'comments':[{'authorId':_0x5c903d['id'],'content':_0x39892c,'createdAt':new Date(),'attributes':{}}]});}_hasContent(_0xe5b7e3){for(const _0x4c66b8 of _0xe5b7e3['getItems']())if(this['_itemIsContent'](_0x4c66b8))return!0x0;return!0x1;}_itemIsContent(_0x332be4){return _0x332be4['is']('$textProxy')||this['editor']['model']['schema']['isObject'](_0x332be4)&&!_0x332be4['is']('element','tableCell');}_trimToContent(_0x175dd2){const _0x16a92b=_0x535937=>!this['_itemIsContent'](_0x535937['item']),_0x8971d7=_0x175dd2['start']['getLastMatchingPosition'](_0x16a92b),_0x437122=_0x175dd2['end']['getLastMatchingPosition'](_0x16a92b,{'direction':'backward'});return this['editor']['model']['createRange'](_0x8971d7,_0x437122);}},di=class extends _0x2bcbce{_dataCollectors;_editorAnnotations;static get requires(){return[ti];}static get['pluginName'](){return'EditorAnnotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5d5ef0){super(_0x5d5ef0),this['_dataCollectors']=new Set(),this['_editorAnnotations']=new Set();}init(){const _0x668bb0=this['editor'],_0x460f7f=_0x668bb0['model']['document']['selection'],_0x577fd0=_0x420187(()=>this['refreshSelectedViews'](),0xa);_0x460f7f['on']('change:range',(_0x46267a,_0x197054)=>{_0x197054['directChange']&&(_0x577fd0['cancel'](),this['refreshSelectedViews']());}),this['listenTo'](_0x668bb0['editing']['view']['document'],'change:isFocused',(_0x260795,_0x38b873,_0x2588f8)=>{_0x2588f8&&_0x577fd0();}),this['listenTo'](_0x668bb0['ui']['focusTracker'],'change:isFocused',(_0x1d54b9,_0x3396c9,_0x366a04)=>{_0x366a04||this['fire']('blur',{'isAnnotationTracked':_0x2b889e=>this['_editorAnnotationsData']['has'](_0x2b889e['innerView'])});}),this['listenTo'](this['editor']['ui'],'update',()=>this['fire']('uiUpdate'));}registerAnnotation(_0x543574){if(this['_editorAnnotations']['has'](_0x543574['view']))return;this['_editorAnnotations']['add'](_0x543574['view']),this['editor']['ui']['focusTracker']['add'](_0x543574['view']['element']);const _0x3755a9=this['editor']['plugins']['get'](ti);this['listenTo'](_0x3755a9['collection'],'remove',(_0x339243,_0x34dfc3)=>{this['editor']['ui']['focusTracker']['remove'](_0x34dfc3['view']['element']),this['_editorAnnotations']['delete'](_0x34dfc3['view']);});}hasDomSelection(){return this['editor']['editing']['view']['hasDomSelection'];}addSourceCollector(_0x16ddb8){if('function'!=typeof _0x16ddb8)throw new _0x402d5c('editorannotations-invalid-source-callback');this['_dataCollectors']['add'](_0x16ddb8);}refreshSelectedViews(){this['fire']('refresh');}getOrderedSelectedAnnotations({activeAnnotation:_0x2475ce,annotations:_0x288f2b}){const _0x29960d=[],_0x57eb66=this['editor']['model']['document']['selection'],_0x4039a8=Array['from'](_0x57eb66['getRanges']());for(const [_0x3698d9,_0x3a5a08]of this['_editorAnnotationsData']){const _0x2503e1=_0x4b558f(_0x3a5a08),_0x3da9dc=_0x288f2b['getByInnerView'](_0x3698d9);_0x2503e1&&_0x3da9dc&&_0x29960d['push']({'annotation':_0x3da9dc,'range':_0x2503e1});}function _0x4b558f(_0x1c149d){for(const _0x59e049 of _0x1c149d)for(const _0x5a1246 of _0x4039a8)if(_0x59e049['containsRange'](_0x5a1246,!_0x57eb66['isCollapsed']))return _0x59e049;return null;}const _0x15b8ed=new Map(Array['from'](_0x288f2b,(_0x1e7029,_0x529a59)=>[_0x1e7029,_0x529a59]));return _0x29960d['sort']((_0x58241d,_0x4646d5)=>{const _0x422314=_0x58241d['range'],_0x15a056=_0x4646d5['range'];if(!_0x422314['isEqual'](_0x15a056)){if(_0x422314['containsRange'](_0x15a056,!0x0))return 0x1;if(_0x15a056['containsRange'](_0x422314,!0x0))return-0x1;}return _0x58241d['annotation']==_0x2475ce?-0x1:_0x4646d5['annotation']==_0x2475ce?0x1:(_0x15b8ed['get'](_0x58241d['annotation'])??0x0)-(_0x15b8ed['get'](_0x4646d5['annotation'])??0x0);})['map'](_0x1c2ebe=>_0x1c2ebe['annotation']);}get _editorAnnotationsData(){const _0x1724de=new Map();for(const _0x4f8e64 of Array['from'](this['_dataCollectors']))for(const [_0x5b1812,_0x5a607f]of _0x4f8e64())_0x1724de['set'](_0x5b1812,_0x5a607f);return _0x1724de;}},li=class extends _0x2bcbce{afterInit(){const _0x21efce=this['editor'];_0x21efce['plugins']['has']('RestrictedEditingModeEditing')&&_0x21efce['plugins']['get']('RestrictedEditingModeEditing')['enableCommand']('addCommentThread');}},mi=class extends _0x2bcbce{constructor(_0x1f3714){super(_0x1f3714),this['editor']['config']['define']('importWord.formatting.comments','basic');}afterInit(){const _0x388c07=this['editor'],_0x78ef2d=_0x388c07['commands']['get']('importWord'),_0x15797d=_0x388c07['plugins']['get'](_0x552e83);_0x78ef2d&&(_0x78ef2d['on']('execute',(_0x4714b1,[,_0x1dba2c])=>{_0x1dba2c['collaboration_features']={'comments':!0x0,'user_id':_0x15797d['me']['id']};},{'priority':_0x31e8a7['high']+0xa}),this['listenTo'](_0x78ef2d,'dataInsert',this['_handleImportedData']));}_handleImportedData(_0x1aa1b1,_0x4d363a){const {comment_threads:_0x1b9a83}=_0x4d363a;_0x1b9a83&&_0x1b9a83['forEach'](({thread_id:_0x2a8637,comments:_0x1fd376,is_resolved:_0x1a4fb0})=>{const _0x2c7f8f=new Date(),_0x26af33=_0x1fd376['map'](({author:_0x4a430e,content:_0xf8d7f6,created_at:_0x3f973a})=>({'content':_0xf8d7f6,'authorId':this['editor']['plugins']['get'](_0x552e83)['me']['id'],'createdAt':_0x2c7f8f,'attributes':{'@external':{'authorName':_0x4a430e,'createdAt':_0x3f973a?new Date(_0x3f973a):new Date(),'source':'importWord'}}})),_0x73c4d=this['editor']['config']['get']('collaboration.channelId');this['editor']['plugins']['get'](oi)['addCommentThread']({'channelId':_0x73c4d,'threadId':_0x2a8637,'comments':_0x26af33,'resolvedAt':_0x1a4fb0?_0x2c7f8f:null});});}},ui=class extends _0x2bcbce{constructor(_0x1ad5e3){super(_0x1ad5e3),this['editor']['config']['define']('comments.copyMarkers','default');}static get requires(){return[pt,wt];}afterInit(){const _0x217432=this['editor']['plugins']['get']('ClipboardPipeline');this['_registerMarkerInClipboardPipeline'](),this['listenTo'](_0x217432,'contentInsertion',(_0x445332,_0x902d73)=>this['_removeMarkersWithoutThreads'](_0x902d73['content']['markers']),{'priority':'highest'});}_removeMarkersWithoutThreads(_0x324f88){if(!this['editor']['plugins']['has']('CommentsRepository'))return _0x324f88;const _0x52bb86=this['editor']['plugins']['get']('CommentsRepository');for(const _0x572838 of _0x324f88['keys']()){const [_0x3f817c,_0x2bef17]=_0x572838['split'](':');'comment'!=_0x3f817c||_0x52bb86['hasCommentThread'](_0x2bef17)||_0x324f88['delete'](_0x572838);}return _0x324f88;}_registerMarkerInClipboardPipeline(){const _0x4fde18=this['editor']['plugins']['get']('ClipboardMarkersUtils'),_0xe8b9db=this['_mapCommentsCopyConfigToRegisterConfiguration'](this['editor']['config']['get']('comments.copyMarkers'));_0xe8b9db&&_0x4fde18['_registerMarkerToCopy']('comment',_0xe8b9db);}_mapCommentsCopyConfigToRegisterConfiguration(_0x10f239){switch(_0x10f239){case'always':return{'allowedActions':'all','copyPartiallySelected':!0x1,'duplicateOnPaste':!0x0};case'default':return{'allowedActions':['cut','dragstart'],'copyPartiallySelected':!0x1,'duplicateOnPaste':!0x1};default:return null;}}};function fi(_0x4e2950){const _0x300b53=_0x4e2950['split'](':');return{'group':_0x300b53[0x0],'id':_0x300b53[0x1],'part':_0x300b53[0x2]};}var pi=class extends _0x2bcbce{init(){this['overrideMarkerConverters'](),this['overrideHorizontalRuleConverter'](),this['overrideImageInlineConverter'](),this['overrideMediaEmbedConverter']();}overrideMarkerConverters(){this['editor']['conversion']['for']('dataDowncast')['markerToHighlight']({'model':'comment','view':(_0x12a500,_0x4de831)=>{if(!_0x4de831['options']['showCommentHighlights'])return null;if(_0x4de831['options']['ignoreResolvedComments']){const {id:_0x4990bd}=fi(_0x12a500['markerName']);if(this['editor']['plugins']['get'](oi)['getCommentThread'](_0x4990bd)?.['isResolved']&&_0x12a500['item'])return _0x4de831['consumable']['consume'](_0x12a500['item'],'addMarker:'+_0x12a500['markerName']),_0x4de831['consumable']['consume'](_0x12a500['item'],'removeMarker:'+_0x12a500['markerName']),null;}return{'classes':['ck-comment-marker']};}}),this['editor']['conversion']['for']('dataDowncast')['add'](_0x4cc66f=>{_0x4cc66f['on']('addMarker:comment',(_0x11defc,_0x1e1fd2,_0x1c3365)=>{if(!_0x1c3365['options']['showCommentHighlights'])return;const _0x11cf61=_0x1e1fd2['item'];if(!_0x11cf61)return;const _0x3ff7e3=_0x1c3365['mapper']['toViewElement'](_0x11cf61);this['editor']['model']['schema']['isObject'](_0x11cf61)&&_0x3ff7e3&&!_0x3ff7e3['getCustomProperty']('widget')&&_0x3ff7e3['is']('containerElement')&&Ct(_0x3ff7e3,_0x1c3365['writer']);},{'priority':'high'});});}overrideHorizontalRuleConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToStructure']({'model':'horizontalLine','view':(_0x5a88c4,{writer:_0xd81b47,options:_0x5a8b34})=>{if(!_0x5a8b34['showCommentHighlights'])return null;const _0x173b6b=_0xd81b47['createContainerElement']('div'),_0x40965e=_0xd81b47['createEmptyElement']('hr');return _0xd81b47['addClass']('ck-horizontal-line',_0x173b6b),_0xd81b47['insert'](_0xd81b47['createPositionAt'](_0x173b6b,0x0),_0x40965e),_0x173b6b;},'converterPriority':'high'});}overrideImageInlineConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToStructure']({'model':'imageInline','view':(_0x466884,{writer:_0x130aaf,options:_0x2a1e8e})=>{if(!_0x2a1e8e['showCommentHighlights'])return null;const _0xef4706=_0x130aaf['createContainerElement']('span'),_0x4936d8=_0x130aaf['createEmptyElement']('img');return _0x130aaf['addClass']('image-inline',_0xef4706),_0x130aaf['insert'](_0x130aaf['createPositionAt'](_0xef4706,0x0),_0x4936d8),_0xef4706;},'converterPriority':'high'});}overrideMediaEmbedConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToElement']({'model':'media','view':(_0x5bf843,{writer:_0x5c8fae,options:_0x63f842})=>{if(_0x63f842['showCommentHighlights'])return _0x5c8fae['createEmptyElement']('div');},'converterPriority':'high'}),this['editor']['data']['downcastDispatcher']['on']('attribute:url:media',(_0xbe12f,_0x58d88c,_0x4e8e98)=>{_0x4e8e98['options']['showCommentHighlights']&&_0xbe12f['stop']();},{'priority':'high'});}},wi=class extends _0x2bcbce{static get requires(){return[oi,di,_0x552e83,li,mi,ui,pi];}static get['pluginName'](){return'CommentsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1869c4){super(_0x1869c4),this['set']('isThreadsLoadingPaused',!0x0),_0x1869c4['data']['once']('ready',()=>this['isThreadsLoadingPaused']=!0x1),this['set']('activeMarker',null),this['on']('change:activeMarker',(_0x2a3e88,_0x212b2a,_0x1c5da9,_0x1e7023)=>{const _0x5ce96d=_0x1869c4['plugins']['get'](oi),_0x4e086c=_0x1c5da9?fi(_0x1c5da9)['id']:null;_0x1869c4['model']['change'](()=>{if(_0x4e086c){const _0x4026a4=this['getAllMarkersForId'](_0x4e086c);for(const _0x4778d5 of _0x4026a4)_0x1869c4['editing']['reconvertMarker'](_0x4778d5);}if(_0x1e7023){const {id:_0x177e03}=fi(_0x1e7023),_0x434219=_0x5ce96d['getCommentThread'](_0x177e03);if(_0x434219&&_0x434219['unlinkedAt'])return;if(_0x434219&&!_0x434219['isAttached'])return;const _0x19d570=this['getAllMarkersForId'](_0x177e03);for(const _0x399af1 of _0x19d570)_0x1869c4['editing']['reconvertMarker'](_0x399af1);}}),_0x4e086c&&this['scrollToThreadMarker'](_0x4e086c);}),this['_initAriaMarkerChangeAnnouncements']();}init(){const _0xb731f5=this['editor'],_0xad497c=_0xb731f5['plugins']['get'](oi),_0x3aa8ab=_0xb731f5['config']['get']('collaboration.channelId'),_0x4fe99e=_0xad497c['getCommentThreads']()['filter'](_0x2b702f=>_0x2b702f['channelId']!==_0x3aa8ab);_0xb731f5['commands']['add']('addCommentThread',new ci(_0xb731f5)),this['listenTo'](_0xb731f5,'change:isReadOnly',(_0x4d274c,_0x232b5b,_0xfd3509)=>{_0xad497c['switchReadOnly'](_0xfd3509,_0xb731f5['config']['get']('collaboration.channelId'));}),this['listenTo'](_0xad497c,gi('addCommentThread',_0x3aa8ab),(_0x292b61,{threadId:_0xeb2b5e})=>{this['editor']['plugins']['get'](oi)['getCommentThread'](_0xeb2b5e)?.['unlinkedAt']&&this['_attachArchivedThread'](_0xeb2b5e);}),this['listenTo'](_0xad497c,gi('removeCommentThread',_0x3aa8ab),(_0x4da734,{threadId:_0x13dc67})=>{_0xb731f5['model']['enqueueChange']({'isUndoable':!0x1},_0x40d355=>{const _0xb3615f=this['getAllMarkersForId'](_0x13dc67);for(const _0x2b10dd of _0xb3615f)_0x40d355['removeMarker'](_0x2b10dd);});}),this['listenTo'](_0xad497c,gi('resolveCommentThread',_0x3aa8ab),(_0xf5a47b,{threadId:_0x26dbdf})=>{this['_reconvertMarkers'](_0x26dbdf);const _0x4b7354=this['editor']['plugins']['get'](ti);(this['editor']['editing']['view']['hasDomSelection']||_0x4b7354['collection']['isFocused'])&&(this['editor']['plugins']['get'](oi)['getCommentThread'](_0x26dbdf)['unlinkedAt']||this['editor']['editing']['view']['focus']());},{'priority':'low'}),this['listenTo'](_0xad497c,gi('reopenCommentThread',_0x3aa8ab),(_0x4b1d2e,{threadId:_0x817571})=>{this['_reconvertMarkers'](_0x817571);},{'priority':'low'}),this['listenTo'](_0xad497c,gi('addComment',_0x3aa8ab),(_0x6d6c69,{threadId:_0x12a261,isFromAdapter:_0x297bad})=>{const _0x2e7276=this['getAllMarkersForId'](_0x12a261);!_0x297bad&&0x0!=_0x2e7276['length']&&_0xad497c['hasCommentThread'](_0x12a261)&&0x1===_0xad497c['getCommentThread'](_0x12a261)['length']&&_0xb731f5['model']['enqueueChange']({'isUndoable':!0x1},_0x3e06e6=>{for(const _0x3986d7 of _0x2e7276)_0x3e06e6['updateMarker'](_0x3986d7,{'usingOperation':!0x0,'affectsData':!0x0});});},{'priority':'low'}),this['_initializeMarkerConverters'](),this['_handleMarkerAddAndRemove'](),this['_handleInitialThreads'](_0x4fe99e);}afterInit(){!async function(_0x19bec1){const _0x79cc07='mr4z2yakM3x0phtD7jBw1T6qRfeUuZcOLNKVgQSPE9iGIHoXlJW8YsCb5AndFv',_0x2ea6dc=0x79410,_0x306707={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x326680(_0x95676a){const _0x4bb334=new window['Promise'](_0x20c7df=>{_0x95676a['once']('ready',_0x20c7df);}),_0x3a3b4f=window['Date']['now'](),_0x528102=_0x95676a['config']['get']('licenseKey');async function _0x2eaa04(){let _0x2f4d2e,_0x5223a9=null,_0x427823=null;try{return'GPL'==_0x528102?'NotAllowed':(_0x2f4d2e=_0x7a769f(),_0x2f4d2e?(_0x2f4d2e['usageEndpoint']&&(_0x427823=_0x6d9c8b(_0x2f4d2e['usageEndpoint'],_0x2f4d2e['jti'])),await _0x5f2d06()?_0x372ac3()?_0x1ebad1()?'Expired':_0x447f0c()?('evaluation'==_0x2f4d2e['licenseType']&&(_0x5223a9=_0x3f2c50('EvaluationLimit')),await _0x49229c()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x1ebad1(){const _0x55c568=['evaluation','trial']['includes'](_0x2f4d2e['licenseType'])?_0x3a3b4f/0x3e8:0xe10*_0x2ea6dc;return _0x2f4d2e['exp']<_0x55c568;}function _0x372ac3(){const _0x5e7deb=_0x2f4d2e['features'];if(!_0x5e7deb)return!0x1;if(_0x5e7deb['includes']('*'))return!0x0;if(_0x5e7deb['includes']('CMT'))return!0x0;if(_0x5e7deb['includes']('TRILIUM')&&_0x2b215d())return!0x0;if(_0x5e7deb['includes']('RCMT')){if(_0x58fb36())return!0x0;if(_0x355856()||_0x48e52a())return!0x0;}return!0x1;}function _0x447f0c(){const _0x23ca3c=_0x2f4d2e['licensedHosts'];if(!_0x23ca3c||0x0==_0x23ca3c['length'])return!0x0;const {hostname:_0xb8e42b}=new URL(window['location']['href']);if(_0x23ca3c['includes'](_0xb8e42b))return!0x0;const _0x5b0229=_0xb8e42b['split']('.');return _0x23ca3c['filter'](_0x3e7e29=>_0x3e7e29['includes']('*'))['map'](_0x4f13e8=>_0x4f13e8['split']('.'))['filter'](_0x157232=>_0x157232['length']<=_0x5b0229['length'])['map'](_0x2c32f8=>Array(_0x5b0229['length']-_0x2c32f8['length'])['fill']('*'===_0x2c32f8[0x0]?'*':'')['concat'](_0x2c32f8))['some'](_0x4cd2e2=>_0x5b0229['every']((_0x3b28da,_0x2e2462)=>_0x4cd2e2[_0x2e2462]===_0x3b28da||'*'===_0x4cd2e2[_0x2e2462]));}function _0x49229c(){return _0x5223a9&&_0x427823?new window['Promise']((_0xfa2747,_0x4bb85a)=>{_0x5223a9['then'](_0xfa2747,_0x4bb85a),_0x427823['then'](_0xa99f48=>{'Valid'!=_0xa99f48&&_0xfa2747(_0xa99f48);},_0x4bb85a);}):_0x5223a9||_0x427823||'Valid';}}function _0x6d9c8b(_0x54e7be,_0x40cb7d){return new window['Promise'](_0x17de72=>{if(_0x321d64())return _0x17de72('Valid');_0x53d650(),_0x95676a['decorate']('_sendUsageRequest');let _0xc9d7c7=!0x1;const _0x241b75=_0x295c58();function _0x59a0a3(_0x34548f){return!!_0x34548f&&('object'==typeof _0x34548f||'function'==typeof _0x34548f)&&'function'==typeof _0x34548f['then']&&'function'==typeof _0x34548f['catch'];}function _0x82c8e1(_0x3f179b){_0x9fb176(_0x3f179b)['then'](_0x44226b=>_0x44226b&&'ok'==_0x44226b['status']?_0x54d7ab(_0x328a6c(_0x241b75+_0x40cb7d))!=_0x44226b['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x111055=>(_0x418f53(),_0x111055),()=>{const _0x41fc81=_0x2eec6e();return null==_0x41fc81?(_0x418f53(),'Valid'):_0x3a3b4f-_0x41fc81>0x240c8400?'UsageLimit':'Valid';})['then'](_0x17de72)['catch'](()=>{_0x17de72('UsageLimit');});const _0x3f42bc=0x36ee80;function _0x418f53(){const _0x3e82b5='llct-'+_0x54d7ab(_0x328a6c(_0x54e7be)),_0x3c04ee=_0x326476(_0x54d7ab(window['Math']['ceil'](_0x3a3b4f/_0x3f42bc)));window['localStorage']['setItem'](_0x3e82b5,_0x3c04ee);}function _0x2eec6e(){const _0x36d238='llct-'+_0x54d7ab(_0x328a6c(_0x54e7be)),_0x5ee301=window['localStorage']['getItem'](_0x36d238);return _0x5ee301?window['parseInt'](_0x326476(_0x5ee301),0x10)*_0x3f42bc:null;}function _0x9fb176(_0x5090fc){return new window['Promise']((_0x23e65b,_0x200bcd)=>{_0x5090fc['then'](_0x23e65b,_0x200bcd),window['setTimeout'](_0x200bcd,0x1d4c0);});}}_0x95676a['on']('_sendUsageRequest',(_0x2cd320,_0x4d3863)=>{if(_0x4d3863[0x0]!=_0x54e7be)return _0x17de72('UsageLimit');_0x4d3863[0x1]={..._0x4d3863[0x1],'requestId':_0x241b75};},{'priority':'high'}),_0x95676a['on']('_sendUsageRequest',_0x11469c=>{_0x59a0a3(_0x11469c['return'])&&(_0xc9d7c7=!0x0,_0x82c8e1(_0x11469c['return']));},{'priority':'low'}),_0x4bb334['then'](()=>{_0xc9d7c7||_0x17de72('UsageLimit');});});function _0x321d64(){return'auto'==_0x95676a['editing']['view']['_overlayModeHint'];}function _0x53d650(){_0x95676a['editing']['view']['_overlayModeHint']='auto';}}function _0x3f2c50(_0x445fc7){const _0x416576=[new window['Promise'](_0x4c85da=>setTimeout(_0x4c85da,0x93ecc)),_0x4bb334['then'](()=>new window['Promise'](_0x54b302=>{let _0x176610=0x0;_0x95676a['model']['on']('applyOperation',(_0x3d4b77,_0x463350)=>{_0x463350[0x0]['isDocumentOperation']&&_0x176610++,0x5e8==_0x176610&&(_0x54b302(),_0x3d4b77['off']());});}))];return window['Promise']['race'](_0x416576)['then'](()=>_0x445fc7);}async function _0x145eb4(){await _0x4bb334,_0x95676a['model']['change']=_0x1f3206,_0x95676a['model']['enqueueChange']=_0x1f3206,_0x95676a['enableReadOnlyMode']('model');}function _0x2b215d(){return window['glob']&&window['glob']['triliumVersion'];}function _0x58fb36(){return _0xc1a568('WebSocketGateway')&&'connected'==_0x4a20c5('WebSocketGateway')['state'];}function _0x355856(){return _0xc1a568('RevisionViewerIntegration');}function _0x48e52a(){return _0xc1a568('TrackChangesDataGetter');}function _0x8d23d8(_0x1c681c){const _0x27059a=_0x2f9851();_0x95676a[_0x27059a]='commentsLicenseKey'+_0x1c681c,'Valid'!=_0x1c681c&&_0x145eb4();}function _0x2f9851(){const _0x35c4c0=window['String'](window['performance']['now']())['replace']('.','');let _0x379326='m';for(let _0x30779e=0x0;_0x30779e<_0x35c4c0['length'];_0x30779e+=0x2){let _0x33c94f=window['parseInt'](_0x35c4c0['substring'](_0x30779e,_0x30779e+0x2));_0x33c94f>=0x3e&&(_0x33c94f-=0x3e),_0x379326+=_0x79cc07[_0x33c94f];}return _0x379326;}function _0x7a769f(){const _0xb1de1a=_0x528102['split']('.');if(0x3!=_0xb1de1a['length'])return null;return _0x480293(_0xb1de1a[0x1]);function _0x480293(_0x3760f3){const _0x297378=_0x259846(_0x3760f3);return _0x297378&&_0x269489()?_0x297378:null;function _0x269489(){const _0x141c9b=_0x297378['jti'],_0xbb4604=window['parseInt'](_0x141c9b['substring'](_0x141c9b['length']-0x8),0x10),_0x1db625={..._0x297378,'jti':_0x141c9b['substring'](0x0,_0x141c9b['length']-0x8)};return delete _0x1db625['vc'],_0x328a6c(_0x1db625)==_0xbb4604;}}}async function _0x5f2d06(){let _0x451e6d=!0x0;try{const [_0x3f6481,_0xcff8b9,_0xddc4ff]=_0x528102['split']('.');return _0x1dea80(_0x3f6481),await _0x5759d6(_0x3f6481,_0xcff8b9,_0xddc4ff),_0x451e6d;}catch{return!0x1;}function _0x1dea80(_0x197bd8){const _0x574123=_0x259846(_0x197bd8);_0x574123&&'ES256'==_0x574123['alg']||(_0x451e6d=!0x1);}async function _0x5759d6(_0xd2b575,_0x2b0cfa,_0x5b9f8f){const _0x34aad3=window['Uint8Array']['from'](_0x1f2f30(_0x5b9f8f),_0x284c60=>_0x284c60['charCodeAt'](0x0)),_0x4025f5=new window['TextEncoder']()['encode'](_0xd2b575+'.'+_0x2b0cfa),_0x147fb1=window['crypto']['subtle'];if(!_0x147fb1)return;const _0x4e3523=await _0x147fb1['importKey']('jwk',_0x306707,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x147fb1['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x4e3523,_0x34aad3,_0x4025f5)||(_0x451e6d=!0x1);}}function _0x259846(_0x35c37a){return _0x35c37a['startsWith']('ey')?JSON['parse'](_0x1f2f30(_0x35c37a)):null;}function _0x1f2f30(_0x1b3a8f){return window['atob'](_0x1b3a8f['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x328a6c(_0x579d60){let _0x356997=0x1505;function _0x30a8b8(_0x7d653a){for(let _0x62165b=0x0;_0x62165b<_0x7d653a['length'];_0x62165b++){const _0x4b6d32=_0x7d653a['charCodeAt'](_0x62165b);_0x356997=(_0x356997<<0x5)+_0x356997+_0x4b6d32,_0x356997&=_0x356997;}}function _0x2136f9(_0x261601){Array['isArray'](_0x261601)?_0x261601['forEach'](_0x2136f9):_0x261601&&'object'==typeof _0x261601?Object['entries'](_0x261601)['sort']()['forEach'](([_0xa4cd26,_0x28ce61])=>{_0x30a8b8(_0xa4cd26),_0x2136f9(_0x28ce61);}):_0x30a8b8(window['String'](_0x261601));}return _0x2136f9(_0x579d60),_0x356997>>>0x0;}function _0x54d7ab(_0x7fc3db){return _0x7fc3db['toString'](0x10)['padStart'](0x8,'0');}function _0x326476(_0x1e24fc){return _0x1e24fc['split']('')['reverse']()['join']('');}function _0xc1a568(_0x13cc73){return _0x95676a['plugins']['has'](_0x13cc73);}function _0x4a20c5(_0xdebc0f){return _0x95676a['plugins']['get'](_0xdebc0f);}function _0x1f3206(){}_0x8d23d8(await _0x2eaa04());}_0x326680(_0x19bec1['editor']);}(this);}destroy(){const _0x463873=this['editor']['plugins']['get'](oi),_0x19818d=this['editor']['config']['get']('collaboration.channelId');for(const _0x17a9bb of _0x463873['getCommentThreads']({'channelId':_0x19818d}))_0x463873['_detachCommentThread'](_0x17a9bb['id']),_0x463873['_threads']['delete'](_0x17a9bb['id']);super['destroy']();}['hasMarkerForId'](_0x183ebd){return this['getAllMarkersForId'](_0x183ebd)['length']>0x0;}getAllMarkersForId(_0x4ae5f2){const _0x464c99=[];for(const _0x4fccf8 of this['editor']['model']['markers'])_0x4fccf8['name']['startsWith']('comment:'+_0x4ae5f2)&&_0x464c99['push'](_0x4fccf8);return _0x464c99;}['scrollToThreadMarker'](_0x167018){setTimeout(()=>{const _0x154d21=this['_getTargetForId'](_0x167018);_0x154d21&&this['activeMarker']&&fi(this['activeMarker'])['id']===_0x167018&&_0x5de251({'target':_0x154d21[0x0],'viewportOffset':0x64,'alignToTop':!0x0});},0x32);}_reconvertMarkers(_0x13a652){this['editor']['model']['change'](()=>{for(const _0x20888a of this['getAllMarkersForId'](_0x13a652))this['editor']['editing']['reconvertMarker'](_0x20888a);});}_attachArchivedThread(_0x38d1eb){const _0x3ea14f=this['editor']['plugins']['get'](oi),_0xf53602=this['editor']['plugins']['get'](di),_0x1573a7=_0x3ea14f['getCommentThread'](_0x38d1eb);if(!_0x1573a7['isAttached']){const _0x5c13af=_0x1573a7['attachTo'](()=>this['_getTargetForId'](_0x1573a7['id']));_0xf53602['registerAnnotation'](_0x5c13af),_0x1573a7['_hasTargetInContent']=!0x1;}}_initializeMarkerConverters(){const _0x584a29=this['editor'],_0x363c35=_0x584a29['plugins']['get'](_0x552e83);_0x584a29['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'comment','view':(_0x4bb011,_0x34b566)=>{const {id:_0x339791}=fi(_0x4bb011['markerName']),_0x28e89b=_0x584a29['plugins']['get'](oi)['getCommentThread'](_0x339791),_0x24e4a1=this['activeMarker']&&fi(this['activeMarker'])['id']===_0x339791;let _0x3e8596;if(_0x28e89b&&_0x28e89b['isResolved']&&!_0x24e4a1&&_0x4bb011['item'])return _0x34b566['consumable']['consume'](_0x4bb011['item'],'addMarker:'+_0x4bb011['markerName']),_0x34b566['consumable']['consume'](_0x4bb011['item'],'removeMarker:'+_0x4bb011['markerName']),null;const _0x3d0cbf=['ck-comment-marker'];return _0x24e4a1&&_0x3d0cbf['push']('ck-comment-marker--active'),_0x3e8596=_0x28e89b?.['length']?_0x28e89b['comments']['first']['author']['id']:_0x363c35['me']['id'],{'classes':_0x3d0cbf,'attributes':{'data-comment':_0x339791,'data-author-id':_0x3e8596}};}}),_0x584a29['conversion']['for']('dataDowncast')['markerToData']({'model':'comment','view':(_0x10e86a,{options:_0x1f37d4})=>{if(_0x1f37d4['showCommentHighlights'])return null;const _0x61a8e2=_0x584a29['plugins']['get'](oi),_0x42b80e=_0x584a29['model']['markers']['get'](_0x10e86a),{id:_0x56d529,part:_0xcb2cc0}=fi(_0x10e86a);return _0x42b80e&&!_0x42b80e['affectsData']||_0x1f37d4['ignoreResolvedComments']&&_0x61a8e2['getCommentThread'](_0x56d529)?.['isResolved']?null:{'group':'comment','name':_0xcb2cc0?_0x56d529+':'+_0xcb2cc0:_0x56d529};}}),_0x584a29['conversion']['for']('upcast')['elementToElement']({'view':{'name':'comment','attributes':{'id':/^\w/}},'model':(_0x4835b7,{writer:_0x429d9e})=>_0x429d9e['createElement']('$marker',{'data-name':'comment:'+_0x4835b7['getAttribute']('id')})}),_0x584a29['conversion']['for']('upcast')['dataToMarker']({'view':'comment'});}['_handleMarkerAddAndRemove'](){const _0x2d6a7e=this['editor'],_0x245b60=_0x2d6a7e['plugins']['get'](oi),_0x3b6f30=new Set(),_0x5273ae=new Set();_0x2d6a7e['model']['document']['registerPostFixer'](_0x54cf8c=>{let _0x1db58c=!0x1;for(const {name:_0x5b1de9,data:_0x50d543}of _0x2d6a7e['model']['document']['differ']['getChangedMarkers']()){const {group:_0x1c6a71,id:_0x4457d0}=fi(_0x5b1de9);let _0x2809db=_0x50d543['newRange'];if('comment'!==_0x1c6a71||!_0x2809db)continue;const _0x33e066='$graveyard'===_0x2809db['root']['rootName'];_0x33e066||(_0x2809db=_i(_0x2809db,_0x2d6a7e['model']),!_0x2809db||_0x2809db['isCollapsed']||!_0x50d543['newRange']||_0x2809db['isEqual'](_0x50d543['newRange']))?_0x2d6a7e['model']['hasContent'](_0x2809db)&&!_0x33e066?this['isThreadsLoadingPaused']?_0x3b6f30['add'](_0x5b1de9):this['_handleThreadMarker'](_0x5b1de9,_0x4457d0):(_0x5273ae['add'](_0x5b1de9),_0x3b6f30['delete'](_0x5b1de9),_0x54cf8c['removeMarker'](_0x5b1de9),_0x1db58c=!0x0):(_0x54cf8c['updateMarker'](_0x5b1de9,{'range':_0x2809db}),_0x1db58c=!0x0);}return _0x1db58c;}),this['on']('change:isThreadsLoadingPaused',(_0x519848,_0x5c3901,_0x44a25c)=>{if(!_0x44a25c&&_0x3b6f30['size'])for(const _0x3b91cb of _0x3b6f30){const {id:_0x12f8ed}=fi(_0x3b91cb);_0x3b6f30['delete'](_0x3b91cb),_0x2d6a7e['model']['markers']['get'](_0x3b91cb)&&this['_handleThreadMarker'](_0x3b91cb,_0x12f8ed);}}),this['listenTo'](_0x2d6a7e['model']['document'],'change',()=>{for(const {name:_0xb253c5,data:{newRange:_0x114f38}}of _0x2d6a7e['model']['document']['differ']['getChangedMarkers']()){const {group:_0x5a9ee2,id:_0x6fee26}=fi(_0xb253c5);if('comment'!==_0x5a9ee2)continue;const _0x106900=_0x245b60['getCommentThread'](_0x6fee26),_0x5a7828=this['hasMarkerForId'](_0x6fee26);_0x106900&&(!_0x106900['_hasTargetInContent']&&_0x114f38&&_0x2d6a7e['editing']['view']['once']('render',()=>{const _0x191e33=_0x2d6a7e['plugins']['get'](ti),_0x5a3c99=_0x245b60['_threadToController']['get'](_0x106900)['view'];_0x191e33['getByInnerView'](_0x5a3c99)['refreshVisibility']();},{'priority':'low'}),_0x106900['_hasTargetInContent']=_0x5a7828||!!_0x114f38),_0x114f38||(_0x5273ae['add'](_0xb253c5),_0x3b6f30['delete'](_0xb253c5));}for(const _0x3a7094 of _0x5273ae){const {id:_0x33682d}=fi(_0x3a7094),_0x4a0dc6=_0x245b60['getCommentThread'](_0x33682d);if(_0x3b6f30['delete'](_0x3a7094),!_0x4a0dc6)continue;const _0x9f3682=this['hasMarkerForId'](_0x33682d);_0x9f3682||_0x4a0dc6['isSubmitted']?_0x9f3682||_0x4a0dc6['unlinkedAt']||_0x4a0dc6['setUnlinkedAt'](new Date()):_0x4a0dc6['remove']();}_0x5273ae['clear']();});}_handleInitialThreads(_0x310cf5){_0x310cf5['forEach'](_0x59e7ed=>{_0x59e7ed['unlinkedAt']&&this['_attachArchivedThread'](_0x59e7ed['id']);});}_getTargetForId(_0x1dbedf){const _0x17eff8=this['editor'],_0x59a1df=this['getAllMarkersForId'](_0x1dbedf);return _0x1461bc(_0x17eff8['editing'],_0x59a1df);}_getTextContext(_0x310e95){const _0xcfe960=this['getAllMarkersForId'](_0x310e95);let _0x5ca322='',_0x475fda=!0x1;for(const _0x3c3fea of _0xcfe960){const _0x3ddc14=_0x3c3fea['getRange']();for(const _0x2b6544 of Array['from'](_0x3ddc14['getItems']()))_0x2b6544['is']('$textProxy')?(_0x5ca322&&_0x475fda&&(_0x5ca322+='\x20',_0x475fda=!0x1),_0x5ca322+=_0x2b6544['data']):_0x475fda=!0x0;_0x475fda=!0x0;}return _0x5ca322['substring'](0x0,0x96);}_attachMarkerToThread(_0x2b7e44,_0x26304c){const _0x323f87=this['editor'],_0x2be420=_0x323f87['plugins']['get'](oi);let _0x4cf4d2=_0x2be420['getCommentThread'](_0x26304c);const _0x4d05c0=_0x323f87['config']['get']('collaboration.channelId'),_0xb2ac3a=_0x323f87['plugins']['get'](di);return _0x4cf4d2&&(_0x4cf4d2['unlinkedAt']&&_0x4cf4d2['setUnlinkedAt'](null),_0x4cf4d2['isAttached'])||(this['getAllMarkersForId'](_0x26304c)[0x0]['managedUsingOperations']?_0x2be420['fetchCommentThread']({'channelId':_0x4d05c0,'threadId':_0x26304c})['then'](_0x54f2ba=>{if('destroyed'!==_0x323f87['state']){if(_0x4cf4d2=_0x54f2ba,_0x4cf4d2&&!_0x4cf4d2['isAttached']){const _0x41be80=_0x4cf4d2['attachTo'](()=>this['_getTargetForId'](_0x26304c));_0xb2ac3a['registerAnnotation'](_0x41be80),_0x4cf4d2['isResolved']&&this['_reconvertMarkers'](_0x26304c);}else{if(!_0x4cf4d2){const _0xeba97a=this['getAllMarkersForId'](_0x26304c);_0x323f87['model']['change'](_0x3636f2=>{for(const _0x1d0628 of _0xeba97a)_0x3636f2['removeMarker'](_0x1d0628);});}}}}):_0x323f87['editing']['view']['once']('render',()=>{if(_0x2be420['getCommentThread'](_0x26304c))return;const _0x1cb082=_0x323f87['plugins']['get'](ti);_0x4cf4d2=_0x2be420['openNewCommentThread']({'channelId':_0x4d05c0,'threadId':_0x26304c,'target':()=>this['_getTargetForId'](_0x26304c),'context':{'type':'text','value':this['_getTextContext'](_0x26304c)}});const _0x4a1393=_0x2be420['_threadToController']['get'](_0x4cf4d2)['view'],_0x2b28ec=_0x1cb082['getByInnerView'](_0x4a1393);_0x2b28ec&&_0xb2ac3a['registerAnnotation'](_0x2b28ec);},{'priority':'low'})),_0x4cf4d2;}['_handleThreadMarker'](_0x45ed3a,_0x21b9c9){const _0x345623=this['_attachMarkerToThread'](_0x45ed3a,_0x21b9c9);_0x345623&&!_0x345623['context']&&_0x345623['setContext']({'type':'text','value':this['_getTextContext'](_0x21b9c9)});}_initAriaMarkerChangeAnnouncements(){const _0x4771d9=this['editor'];_0x4fc4eb(_0x4771d9['model'],({left:_0x54f442,entered:_0x359771})=>{for(const _0x3b82e3 of _0x54f442)if(Ai(_0x3b82e3)){_0x4771d9['ui']['ariaLiveAnnouncer']['announce'](Et(_0x4771d9['locale'],'LEAVE_COMMENT_ANNOUNCEMENT'));break;}for(const _0x2e740f of _0x359771)if(Ai(_0x2e740f)){_0x4771d9['ui']['ariaLiveAnnouncer']['announce'](Et(_0x4771d9['locale'],'ENTER_COMMENT_ANNOUNCEMENT',_0x4c72e9(_0x5baba3)));break;}});}};function gi(_0x57aa7c,_0x2eadea){return _0x2eadea?_0x57aa7c+':'+_0x2eadea:_0x57aa7c;}function _i(_0x33a386,_0x548da1){const _0x48b3bf=_0x548da1['schema'],_0x4551a5=_0x548da1['createRange'](_0x33a386['start']);for(const _0x2375d1 of _0x33a386['getWalker']()){const {type:_0x2b7c2c,item:_0x2cab4d,nextPosition:_0x2b4fd4}=_0x2375d1;if('text'===_0x2b7c2c||_0x48b3bf['isObject'](_0x2cab4d)){const _0x51ff8b=_0x548da1['createPositionBefore'](_0x2cab4d);_0x4551a5['isCollapsed']&&(_0x4551a5['start']=_0x51ff8b),_0x4551a5['end']=_0x2b4fd4;}}return _0x4551a5;}function Ai(_0x476c40){return'comment'===fi(_0x476c40['name'])['group'];}var vi=class extends _0x2bcbce{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'CommentsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[oi,wi,di,ti];}get CommentsListView(){return Lt;}get CommentThreadInputView(){return xt;}init(){const _0x4e099d=this['editor'],_0x4e10bf=_0x4e099d['plugins']['get'](oi),_0x35e5a9=_0x4e099d['plugins']['get'](wi),_0x30cd2f=_0x4e099d['plugins']['get'](ti),_0x2eb743=_0x4e099d['plugins']['get'](di);_0x4e099d['ui']['componentFactory']['add']('comment',()=>{const _0x5d06c0=this['_createUIButton'](_0x151ed2);return _0x5d06c0['tooltip']=!0x0,_0x5d06c0;}),_0x4e099d['ui']['componentFactory']['add']('menuBar:comment',()=>this['_createUIButton'](rt)),_0x2eb743['addSourceCollector'](()=>{const _0x362f49=[];for(const [_0x3e4a5b,_0x1ec426]of _0x4e10bf['_threadToController']){const _0x4ffebc=_0x35e5a9['getAllMarkersForId'](_0x3e4a5b['id']),_0x2d8238=_0x4ffebc['map'](_0x234d7e=>_0x234d7e['getRange']());_0x4ffebc['length']>0x0&&_0x362f49['push']([_0x1ec426['view'],_0x2d8238]);}return _0x362f49;}),this['listenTo'](_0x30cd2f,'change:activeAnnotations',(_0x38aae1,_0x4f327f,_0x558237)=>{const _0x468330=Array['from'](_0x558237)['map'](_0x18760f=>_0x18760f['innerView'])['find'](_0x465ef2=>_0x4e10bf['_viewToController']['has'](_0x465ef2));if(!_0x468330)return void(_0x35e5a9['activeMarker']=null);const _0x400af7=_0x4e10bf['_viewToController']['get'](_0x468330)['model']['id'],_0x2be180='comment:'+_0x400af7;_0x400af7&&_0x35e5a9['hasMarkerForId'](_0x400af7)?_0x35e5a9['activeMarker']=_0x2be180:_0x35e5a9['activeMarker']&&(_0x35e5a9['activeMarker']=null);}),this['listenTo'](_0x4e10bf,'removeCommentThread',(_0x10bca4,{threadId:_0x394563,isFromAdapter:_0x307c75})=>{!_0x307c75&&_0x4e099d['ui']['focusTracker']['isFocused']&&_0x35e5a9['hasMarkerForId'](_0x394563)&&_0x4e099d['editing']['view']['focus']();},{'priority':'highest'}),this['listenTo'](_0x4e10bf,'addComment',(_0x3f3ad9,{threadId:_0x418796,isFromAdapter:_0x5e3d76})=>{!_0x5e3d76&&_0x35e5a9['hasMarkerForId'](_0x418796)&&_0x4e10bf['hasCommentThread'](_0x418796)&&0x1===_0x4e10bf['getCommentThread'](_0x418796)['length']&&(_0x4e099d['editing']['view']['focus'](),_0x3f3ad9['stop']());},{'priority':'low'}),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x4b9f7e=[this['editor']];for(const _0xd1d3bb of _0x4b9f7e){let _0x5aacae;for(const _0x638212 in _0xd1d3bb){const _0x3d3aa9=_0x638212,_0x2d925e=_0xd1d3bb[_0x3d3aa9];if('commentsLicenseKeyValid'==_0x2d925e||'commentsLicenseKeyInvalid'==_0x2d925e||'commentsLicenseKeyExpired'==_0x2d925e||'commentsLicenseKeyDomainLimit'==_0x2d925e||'commentsLicenseKeyNotAllowed'==_0x2d925e||'commentsLicenseKeyEvaluationLimit'==_0x2d925e||'commentsLicenseKeyUsageLimit'==_0x2d925e){delete _0xd1d3bb[_0x3d3aa9],_0x5aacae=_0x2d925e,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'commentsLicenseKeyInvalid'==_0x5aacae&&_0xd1d3bb['_showLicenseError']('invalid'),'commentsLicenseKeyExpired'==_0x5aacae&&_0xd1d3bb['_showLicenseError']('expired'),'commentsLicenseKeyDomainLimit'==_0x5aacae&&_0xd1d3bb['_showLicenseError']('domainLimit'),'commentsLicenseKeyNotAllowed'==_0x5aacae&&_0xd1d3bb['_showLicenseError']('featureNotAllowed','Comments'),'commentsLicenseKeyEvaluationLimit'==_0x5aacae&&_0xd1d3bb['_showLicenseError']('evaluationLimit'),'commentsLicenseKeyUsageLimit'==_0x5aacae&&_0xd1d3bb['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_createUIButton(_0x413c7b){const _0xf61667=this['editor'],_0x3edaa2=new _0x413c7b(_0xf61667['locale']),_0x558f3d=_0xf61667['commands']['get']('addCommentThread');return _0x3edaa2['set']({'label':Et(_0xf61667['locale'],'Comment'),'icon':_0x110cf9}),_0x3edaa2['bind']('isEnabled')['to'](_0x558f3d,'isEnabled',_0x558f3d,'hasContent',(_0x16cf97,_0x44b646)=>_0x16cf97&&_0x44b646),this['listenTo'](_0x3edaa2,'execute',()=>{_0x558f3d['execute']();}),_0x3edaa2;}},yi=class extends _0x2bcbce{static get['pluginName'](){return'CommentsOnly';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[wi];}constructor(_0x1fc53a){super(_0x1fc53a),this['set']('isEnabled',!0x1),this['on']('change:isEnabled',(_0x5199cd,_0x222f4c,_0x4909dc)=>{_0x4909dc?this['_enableCommentsOnlyMode']():this['_disableCommentsOnlyMode']();});}afterInit(){!this['isEnabled']&&this['editor']['config']['get']('commentsOnly')&&(this['isEnabled']=!0x0);}_enableCommentsOnlyMode(){for(const [_0x5abd5f,_0x5bf0a4]of this['editor']['commands'])_0x5bf0a4['affectsData']&&'addCommentThread'!==_0x5abd5f&&_0x5bf0a4['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 _0x5dc60f=this['editor']['editing']['view']['document'];this['listenTo'](_0x5dc60f,'cut',_0x1056d1=>_0x1056d1['stop'](),{'priority':'highest'}),this['listenTo'](_0x5dc60f,'clipboardInput',_0x4c1022=>_0x4c1022['stop'](),{'priority':'highest'}),this['listenTo'](_0x5dc60f,'delete',_0x226ef0=>_0x226ef0['stop'](),{'priority':'highest'});}_disableCommentsOnlyMode(){for(const [_0x56fe7d,_0x46eead]of this['editor']['commands'])_0x46eead['affectsData']&&'addCommentThread'!==_0x56fe7d&&_0x46eead['clearForceDisabled']('commentsOnlyMode');this['editor']['plugins']['has']('RevisionTracker')&&this['editor']['plugins']['get']('RevisionTracker')['clearForceDisabled']('commentsOnlyMode'),this['editor']['plugins']['has']('SourceEditing')&&this['editor']['plugins']['get']('SourceEditing')['clearForceDisabled']('commentsOnlyMode'),this['editor']['commands']['get']('editSource')?.['clearForceDisabled']('commentsOnlyMode'),this['stopListening'](this['editor']['editing']['view']['document']);}},Ti=class extends _0x2bb426{activeUIs;uisData;['_uis'];static get requires(){return[ti];}static get['pluginName'](){return'AnnotationsUIs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x7fb487){super(_0x7fb487),this['activeUIs']=new Set(),this['_uis']=new Map(),this['uisData']=new Map();}init(){const _0x1a489d=this['context']['plugins']['get'](ti);this['listenTo'](_0x1a489d,'_activateAnnotation',(_0x495722,_0x3913f8)=>{for(const _0x10647e of this['activeUIs']){const _0x56fb8a=this['_uis']['get'](_0x10647e);(0x0,this['uisData']['get'](_0x10647e)['filter'])(_0x3913f8)&&_0x56fb8a['setActiveAnnotation'](_0x3913f8);}}),this['listenTo'](_0x1a489d,'_deactivateAllAnnotations',()=>{for(const _0x32398a of this['activeUIs'])this['_uis']['get'](_0x32398a)['setActiveAnnotation'](null);}),this['listenTo'](_0x1a489d['_visibleAnnotations'],'add',(_0x311f87,_0x3d179f)=>{this['_assertAnnotationDoesNotBelongToMultipleUIs'](_0x3d179f);});}hasActive(){return this['activeUIs']['size']>0x0;}isActive(_0x47597c){return this['activeUIs']['has'](_0x47597c);}activate(_0x1d8802,_0x5ebce9=this['defaultFilter']){const _0x4bea9d=this['context']['plugins']['get'](ti);if(!this['_uis']['has'](_0x1d8802))throw new _0x402d5c('annotationsuis-missing-ui',this,{'uiName':_0x1d8802});this['isActive'](_0x1d8802)&&this['deactivate'](_0x1d8802),this['activeUIs']['add'](_0x1d8802);const _0x3050af=new Jt();Qt({'source':_0x4bea9d['_visibleAnnotations'],'target':_0x3050af,'filter':_0x5ebce9}),this['uisData']['set'](_0x1d8802,{'collection':_0x3050af,'filter':_0x5ebce9});const _0x363e24=this['_uis']['get'](_0x1d8802);_0x363e24['attach'](_0x3050af),this['listenTo'](_0x363e24,'change:activeAnnotation',(_0x29d42e,_0x27c535,_0x32799b,_0x154e20)=>{_0x154e20&&_0x4bea9d['_removeActiveAnnotation'](_0x154e20),_0x32799b&&_0x4bea9d['_addActiveAnnotation'](_0x32799b);});}deactivate(_0x57537e){if(this['activeUIs']['delete'](_0x57537e),!this['_uis']['has'](_0x57537e))throw new _0x402d5c('annotationsuis-missing-ui',this,{'uiName':_0x57537e});const _0x270417=this['_uis']['get'](_0x57537e);_0x270417['detach'](),this['stopListening'](_0x270417),this['uisData']['get'](_0x57537e)['collection']['destroy'](),this['uisData']['delete'](_0x57537e);}switchTo(_0x27ceb2){if(!this['_uis']['has'](_0x27ceb2))throw new _0x402d5c('annotationsuis-missing-ui',this,{'uiName':_0x27ceb2});const _0x3dcc31=this['context']['plugins']['get'](ti),_0x4d0f80=Array['from'](_0x3dcc31['activeAnnotations'])[0x0]||null;this['deactivateAll'](),this['activate'](_0x27ceb2);const _0xf35187=this['_uis']['get'](_0x27ceb2);_0xf35187['setActiveAnnotation'](_0x4d0f80),_0xf35187['_setSelectedAnnotations']&&_0x4d0f80&&_0xf35187['_setSelectedAnnotations']([_0x4d0f80]);}deactivateAll(){for(const _0x36ad98 of this['activeUIs'])this['deactivate'](_0x36ad98);}register(_0x5477ca,_0x387820){if(this['_uis']['has'](_0x5477ca))throw new _0x402d5c('annotationsuis-register-already-registered');if('function'!=typeof _0x387820['attach']||'function'!=typeof _0x387820['detach']||'function'!=typeof _0x387820['setActiveAnnotation'])throw new _0x402d5c('annotationsuis-register-invalid-interface',null);this['_uis']['set'](_0x5477ca,_0x387820);}refilterAnnotations(){const _0x16051e=this['context']['plugins']['get'](ti)['collection'],_0x55fe87=new Map(),_0x319fdf=Array['from'](this['activeUIs']);for(const _0x49aa63 of this['activeUIs']){const _0x5e4398=this['uisData']['get'](_0x49aa63)['collection'];for(const _0x2e7750 of _0x5e4398)_0x55fe87['set'](_0x2e7750,_0x49aa63);}for(const _0x14ebbf of _0x16051e){const _0x3a5108=_0x55fe87['get'](_0x14ebbf);this['_assertAnnotationDoesNotBelongToMultipleUIs'](_0x14ebbf);const _0x2f639d=_0x319fdf['find'](_0x56bbd1=>this['uisData']['get'](_0x56bbd1)['filter'](_0x14ebbf));_0x3a5108!==_0x2f639d&&(_0x3a5108&&this['uisData']['get'](_0x3a5108)['collection']['remove'](_0x14ebbf),_0x2f639d&&this['uisData']['get'](_0x2f639d)['collection']['add'](_0x14ebbf));}}destroy(){this['deactivateAll'](),super['destroy']();}defaultFilter(){return!0x0;}_assertAnnotationDoesNotBelongToMultipleUIs(_0x3e917c){const _0x5ca731=[];for(const _0x10e3c8 of this['activeUIs']){(0x0,this['uisData']['get'](_0x10e3c8)['filter'])(_0x3e917c)&&_0x5ca731['push'](_0x10e3c8);}if(_0x5ca731['length']>0x1)throw new _0x402d5c('annotationsuis-annotation-mismatch',null,{'matchedUIs':_0x5ca731,'annotationType':_0x3e917c['type']});}};const Ci=/* #__PURE__ -- @preserve */
|
|
32
|
-
|
|
33
|
-
_0x205aa8('px');var Ei=class extends ht{content;_targetTop;_mutationObserver;constructor(_0x4880ea){super(_0x4880ea),this['set']('top',0x0),this['set']('height',0x0),this['bind']('bottom')['to'](this,'top',this,'height',(_0x255808,_0x449015)=>_0x255808+_0x449015),this['set']('isAnimationDisabled',!0x1),this['_mutationObserver']=Xt(()=>this['updateHeight']()),this['_targetTop']=null,this['content']=this['createCollection'](),this['content']['delegate']('arrowup','arrowdown')['to'](this);const _0x4e3226=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-sidebar-item',_0x4e3226['to']('isAnimationDisabled',_0x4cd762=>_0x4cd762?'ck-sidebar-item--no-animation':'')],'style':{'top':_0x4e3226['to']('top',_0x4a7696=>bi(_0x4a7696))},'role':'presentation'},'children':this['content']});}['render'](){super['render'](),this['_mutationObserver']['attach'](this['element']);}['focus'](){this['content']['first']&&this['content']['first']['focus']();}updateHeight(){const _0x1414f3=this['element']['clientHeight'];_0x1414f3&&(this['height']=_0x1414f3);}destroy(){this['content']['clear'](),this['_mutationObserver']['detach'](),super['destroy']();}},ki=class extends _0x2bb426{['view'];_activeAnnotation;_annotations;_spaceBetweenItems;_sidebarItemViewToAnnotation;_annotationToSidebarItemView;_recalculateBuffer;static get['pluginName'](){return'Sidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x505c3a){super(_0x505c3a),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 _0x1ae60a=this['context']['config']['get']('sidebar.container');_0x1ae60a&&this['setContainer'](_0x1ae60a);}setContainer(_0x3b2c5f){if(!Oi(_0x3b2c5f))throw new _0x402d5c('sidebar-setcontainer-invalid-element');this['container']=_0x3b2c5f;}_attachToContainer({viewClass:_0xce2ad5='',spaceBetweenItems:_0x336844=0x19}={}){if(!Oi(this['container']))throw new _0x402d5c('sidebar-attachtocontainer-missing-container',this);this['container']['appendChild'](this['view']['element']),this['view']['class']=_0xce2ad5,this['_spaceBetweenItems']=_0x336844;}['rearrange']({removedAnnotation:_0x36763f,previousAnnotation:_0x33a24a,nextAnnotation:_0x282b97}){const _0x1ddbc0=this['getSidebarItemView'](_0x36763f);this['view']['list']['remove'](_0x1ddbc0),this['_destroySidebarItemView'](_0x36763f),_0x33a24a&&this['_alignToTargetRect'](this['getSidebarItemView'](_0x33a24a)),_0x282b97&&this['_alignToTargetRect'](this['getSidebarItemView'](_0x282b97)),this['_updateLastItem']();}['refresh']({blurredAnnotation:_0x5271ec,activatedAnnotation:_0x68c678,disableAnimationOnActivatedAnnotation:_0x5850cb}){if(this['_activeAnnotation']=_0x68c678,_0x5271ec){_0x5271ec['isActive']=!0x1;const _0x20aa44=this['getSidebarItemView'](_0x5271ec);_0x20aa44&&_0x5850cb&&(_0x20aa44['isAnimationDisabled']=!0x1);}if(_0x68c678){const _0x45610a=this['getSidebarItemView'](_0x68c678);_0x45610a&&(_0x68c678['isActive']=!0x0,_0x5850cb&&(_0x45610a['isAnimationDisabled']=!0x0,_0x45610a['top']+=0x1),this['_alignToTargetRect'](_0x45610a));}}_detachFromContainer(_0x465c64){if(this['view']['element']['remove'](),_0x465c64){for(const _0x41021a of _0x465c64)this['_destroySidebarItemView'](_0x41021a);}this['view']['list']['clear'](),this['view']['class']='',this['_lastItem']=null;}addAnnotation(_0x467e2e,_0x756b7b){_0x756b7b||(_0x756b7b=_0x467e2e['view']);const _0x5e2820=new Ei(this['context']['locale']);this['_sidebarItemViewToAnnotation']['set'](_0x5e2820,_0x467e2e),this['_annotationToSidebarItemView']['set'](_0x467e2e,_0x5e2820),_0x5e2820['content']['add'](_0x756b7b),this['listenTo'](_0x467e2e['view'],'change:targetRect',(_0x3413e2,_0x111efb,_0x2f9919)=>{const _0x5aab09=this['_getTargetTop'](_0x467e2e,_0x2f9919);_0x5e2820['_targetTop']!=_0x5aab09&&(_0x5e2820['_targetTop']=_0x5aab09,this['_setItemTop'](_0x5e2820,_0x5aab09));}),this['listenTo'](_0x5e2820,'change:top',()=>{this['_recalculate'](_0x5e2820,'top');}),this['listenTo'](_0x5e2820,'change:bottom',()=>{this['_recalculate'](_0x5e2820,'bottom');}),this['_alignToTargetRect'](_0x5e2820);const _0x7282da=this['_getItemBefore'](_0x5e2820);return _0x7282da&&this['_alignAfterItem'](_0x7282da,_0x5e2820)||this['_alignToTargetRect'](_0x5e2820),this['_updateLastItem'](),this['view']['list']['add'](_0x5e2820),_0x5e2820;}['_alignForTopChange'](_0x4ec616){if(!_0x4ec616['content']['length'])return;const _0x9e1327=this['_getItemBefore'](_0x4ec616);if(!_0x9e1327)return;const _0x1a7b90=this['_sidebarItemViewToAnnotation']['get'](_0x9e1327),_0x5ae7d1=this['_activeAnnotation'];_0x5ae7d1&&_0x5ae7d1===_0x1a7b90?this['_alignAfterItem'](_0x9e1327,_0x4ec616):this['_alignBeforeItem'](_0x4ec616,_0x9e1327);}_alignForBottomChange(_0x14cd0b){if(!_0x14cd0b['content']['length'])return;const _0x126466=this['_getItemAfter'](_0x14cd0b);if(!_0x126466)return;const _0xd8d7e8=this['_sidebarItemViewToAnnotation']['get'](_0x126466),_0x56fdd9=this['context']['config']['get']('sidebar.preventScrollOutOfView'),_0x505fbd=this['_activeAnnotation'];_0x505fbd&&_0x505fbd===_0xd8d7e8&&_0x56fdd9?(this['_alignBeforeItem'](_0x126466,_0x14cd0b),this['_alignAfterItem'](_0x14cd0b,_0x126466)):_0x505fbd&&_0x505fbd===_0xd8d7e8?this['_alignBeforeItem'](_0x126466,_0x14cd0b):this['_alignAfterItem'](_0x14cd0b,_0x126466);}_recalculate(_0x76477b,_0x5b739b){0x0===this['_recalculateBuffer']['length']&&setTimeout(()=>{for(const {sidebarItemView:_0x29c204,changedProp:_0x2d9db2}of this['_recalculateBuffer'])'top'===_0x2d9db2?this['_alignForTopChange'](_0x29c204):this['_alignForBottomChange'](_0x29c204);this['_recalculateBuffer']=[];},0xa),this['_recalculateBuffer']['push']({'sidebarItemView':_0x76477b,'changedProp':_0x5b739b});}getSidebarItemView(_0x2816f0){return this['_annotationToSidebarItemView']['get'](_0x2816f0);}destroy(){this['stopListening'](),this['view']['destroy']();}_destroySidebarItemView(_0x49afc4){const _0xd71e33=this['getSidebarItemView'](_0x49afc4);this['stopListening'](_0xd71e33),this['stopListening'](_0x49afc4['view']),_0xd71e33['destroy'](),this['_annotationToSidebarItemView']['delete'](_0x49afc4),this['_sidebarItemViewToAnnotation']['delete'](_0xd71e33);}_createSidebarView(){const _0x4ff2ee=new Ii(this['context']['locale']);return _0x4ff2ee['render'](),this['on']('change:_lastItem',(_0x3760ab,_0x3aae02,_0x57156c,_0x36dcf9)=>{_0x36dcf9&&_0x4ff2ee['unbind']('minHeight'),_0x57156c?_0x4ff2ee['bind']('minHeight')['to'](_0x57156c,'bottom'):_0x4ff2ee['minHeight']=null;}),_0x4ff2ee;}_updateLastItem(){this['_lastItem']=this['_annotations']?.['last']?this['getSidebarItemView'](this['_annotations']['last']):null;}_getItemBefore(_0xc9f996){const _0x5517b8=this['_sidebarItemViewToAnnotation']['get'](_0xc9f996),_0x501850=_0x5517b8&&this['_annotations']?.['get'](this['_annotations']['getIndex'](_0x5517b8)-0x1);return _0x501850&&this['getSidebarItemView'](_0x501850)||null;}_getItemAfter(_0xc8d3c8){const _0x4a01e6=this['_sidebarItemViewToAnnotation']['get'](_0xc8d3c8),_0x16199e=_0x4a01e6&&this['_annotations']?.['get'](this['_annotations']['getIndex'](_0x4a01e6)+0x1);return _0x16199e&&this['getSidebarItemView'](_0x16199e)||null;}_alignBeforeItem(_0x3a85bf,_0x40af47){_0x3a85bf['updateHeight']();const _0x33670b=Ni(_0x40af47['bottom']+this['_spaceBetweenItems'],_0x3a85bf['top']);return!!_0x33670b&&(this['_setItemTop'](_0x40af47,_0x40af47['top']-_0x33670b),!0x0);}_alignAfterItem(_0x3ac380,_0x1e78c9){_0x3ac380['updateHeight']();const _0x5b750d=Ni(_0x3ac380['bottom']+this['_spaceBetweenItems'],_0x1e78c9['top']);return!!_0x5b750d&&(this['_setItemTop'](_0x1e78c9,_0x1e78c9['top']+_0x5b750d,!0x1),!0x0);}_alignToTargetRect(_0x237635){const _0x4e45c0=this['_sidebarItemViewToAnnotation']['get'](_0x237635);if(!_0x4e45c0||!_0x4e45c0['target']||!_0x4e45c0['targetRect'])return;const _0x2411fb=this['_getTargetTop'](_0x4e45c0,_0x4e45c0['targetRect']);this['_setItemTop'](_0x237635,_0x2411fb);}_getTargetTop(_0x28a7a9,_0x504626){if(null===_0x504626)return 0x0;if(_0x28a7a9['target']instanceof _0x23f3bc)return _0x504626['top'];{const _0x56dc12=new _0x23f3bc(this['view']['element'])['top'];return _0x504626['top']-_0x56dc12;}}_setItemTop(_0x2d49e0,_0x594c85,_0x25db16=this['context']['config']['get']('sidebar.preventScrollOutOfView')){_0x25db16&&(_0x594c85=Math['max'](_0x594c85,this['_getMaxAvailableTop'](_0x2d49e0))),_0x2d49e0['top']=_0x594c85;}_getMaxAvailableTop(_0x630987){let _0x27f66=this['_getItemBefore'](_0x630987),_0x3c9b15=0x0;for(;_0x27f66;)_0x27f66['updateHeight'](),_0x3c9b15+=this['_spaceBetweenItems']+_0x27f66['height'],_0x27f66=this['_getItemBefore'](_0x27f66);return _0x3c9b15;}};function Ni(_0x3738fd,_0x53a480){return Math['max'](_0x3738fd-_0x53a480,0x0);}function Oi(_0xf4b272){return null!==_0xf4b272&&'object'==typeof _0xf4b272&&0x1===_0xf4b272['nodeType'];}var Mi=class extends _0x2bb426{isAttached;annotations;_editorAnnotations;_refreshPositioningDebounced;static get requires(){return[ki,Ti];}static get['pluginName'](){return'WideSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1211be){super(_0x1211be),this['isAttached']=!0x1,this['set']('activeAnnotation',null),this['annotations']=null,this['_editorAnnotations']=new _0x33b802(),this['_refreshPositioningDebounced']=_0x420187(()=>{_0x1211be['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning']();},0xfa,{'leading':!0x1});}init(){const _0x240994=this['context']['plugins']['get'](Ti),_0x114690=this['context']['plugins']['get'](ki);_0x240994['register']('wideSidebar',this),_0x114690['container']&&_0x240994['switchTo']('wideSidebar');}setActiveAnnotation(_0x2c5c0e){if(_0x2c5c0e===this['activeAnnotation'])return;const _0x43e068=this['context']['plugins']['get'](ki);_0x43e068['_activeAnnotation']=_0x2c5c0e;const _0x203361=this['activeAnnotation'];_0x43e068['refresh']({'blurredAnnotation':_0x203361,'activatedAnnotation':_0x2c5c0e}),this['activeAnnotation']=_0x2c5c0e;}attach(_0x4efd0a){this['annotations']=_0x4efd0a;const _0x50a24c=this['context']['plugins']['get'](ki);if(_0x50a24c['_annotations']=_0x4efd0a,this['isAttached'])throw new _0x402d5c('widesidebar-attach-already-attached',this);this['isAttached']=!0x0,this['listenTo'](_0x50a24c,'set:container',()=>{this['detach'](),this['listenTo'](_0x50a24c,'change:container',_0x1e73be=>{_0x1e73be['off'](),this['attach'](_0x4efd0a);});}),_0x50a24c['_attachToContainer']({'viewClass':'ck-sidebar--wide'});const _0x2c0046=_0x284639=>{_0x284639['updateTargetRect'](),_0x50a24c['addAnnotation'](_0x284639);};for(const _0x17288e of _0x4efd0a)_0x2c0046(_0x17288e);this['listenTo'](_0x4efd0a,'add',(_0x1b4f0d,_0x50aeea)=>{_0x2c0046(_0x50aeea);}),this['listenTo'](_0x4efd0a,'remove',(_0x18bde3,_0xc519b9,_0x427693)=>{_0x50a24c['rearrange']({'removedAnnotation':_0xc519b9,'previousAnnotation':_0x4efd0a['get'](_0x427693-0x1),'nextAnnotation':_0x4efd0a['get'](_0x427693+0x1)}),_0xc519b9===this['activeAnnotation']&&this['setActiveAnnotation'](null);},{'priority':'high'}),this['listenTo'](_0x4efd0a,'focus',(_0x32c0e1,_0x286276)=>{this['setActiveAnnotation'](_0x286276);}),this['listenTo'](_0x4efd0a,'blur',()=>{this['setActiveAnnotation'](null);});const _0x3bf71c=this['context']instanceof _0x9685b6?this['context']['editors']:new _0x33b802([this['context']]);for(const _0x408695 of _0x3bf71c)this['_integrateWithEditorAnnotations'](_0x408695);this['listenTo'](_0x3bf71c,'add',(_0xcfcb57,_0x431e5f)=>{this['listenTo'](_0x431e5f,'ready',()=>{this['_integrateWithEditorAnnotations'](_0x431e5f);});}),this['listenTo'](_0x3bf71c,'remove',(_0x1a0245,_0x330847)=>{_0x330847['plugins']['has']('EditorAnnotations')&&this['_destroyEditorAnnotationsIntegration'](_0x330847['plugins']['get']('EditorAnnotations'));}),window['addEventListener']('resize',this['_refreshPositioningDebounced']),this['context']['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning']();}detach(){if(!this['isAttached'])throw new _0x402d5c('widesidebar-detach-not-attached',this);this['setActiveAnnotation'](null);const _0x312597=this['context']['plugins']['get'](ki);_0x312597['_detachFromContainer'](this['annotations']),this['stopListening'](_0x312597),this['stopListening'](this['annotations']),this['context']instanceof _0x9685b6&&this['stopListening'](this['context']['editors']);for(const _0x29fbeb of Array['from'](this['_editorAnnotations']))this['_destroyEditorAnnotationsIntegration'](_0x29fbeb);window['removeEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioningDebounced']['cancel'](),this['activeAnnotation']=null,this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach']();}_integrateWithEditorAnnotations(_0x1d0568){if(!_0x1d0568['plugins']['has']('EditorAnnotations'))return;const _0x5dc980=_0x1d0568['plugins']['get']('EditorAnnotations'),_0x4846f1=()=>{const _0x479007=_0x5dc980['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});this['setActiveAnnotation'](_0x479007[0x0]||null);};this['listenTo'](_0x5dc980,'refresh',_0x4846f1),this['listenTo'](_0x5dc980,'blur',(_0xc6a769,{isAnnotationTracked:_0x51864e})=>{this['activeAnnotation']&&_0x51864e(this['activeAnnotation'])&&this['setActiveAnnotation'](null);}),this['listenTo'](_0x5dc980,'uiUpdate',()=>{this['_refreshPositioningDebounced']();}),this['listenTo'](this['annotations'],'blur',_0x28d8f3=>{_0x5dc980['hasDomSelection']()&&(_0x4846f1(),_0x28d8f3['stop']());},{'priority':'high'}),this['_editorAnnotations']['add'](_0x5dc980);}_destroyEditorAnnotationsIntegration(_0x2074a0){this['stopListening'](_0x2074a0),this['_editorAnnotations']['remove'](_0x2074a0);}},Ri=class extends _0x151ed2{counterView;constructor(_0x1b6118){super(_0x1b6118);const _0x5c32bf=this['bindTemplate'];this['set']('isDirty',!0x1),this['set']('number',0x0),this['bind']('_badge')['to'](this,'isDirty',this,'number',(_0x588ca1,_0x436465)=>_0x588ca1?'...':_0x436465['toString']()),this['set']('annotationType',''),this['icon']=_0x110cf9,this['extendTemplate']({'attributes':{'class':['ck-annotation-counter']}}),this['counterView']=new ht(),this['counterView']['setTemplate']({'tag':'span','attributes':{'class':['ck-annotation-counter__badge',_0x5c32bf['to']('annotationType',_0x1bc626=>'ck-annotation-counter__badge--'+_0x1bc626),_0x5c32bf['if']('isDirty','ck-annotation-counter__badge--edit-mode')]},'children':[{'text':_0x5c32bf['to']('_badge')}]}),this['children']['add'](this['counterView']);}},Si=class extends _0x2bb426{isAttached;annotations;_manuallyClosedAnnotationViews;_domEmitter;_annotationToNarrowView;_selectedAnnotations;_editorAnnotations;_refreshPositioningDebounced;static get requires(){return[ki,Ti];}static get['pluginName'](){return'NarrowSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4b53e0){super(_0x4b53e0),this['isAttached']=!0x1,this['_manuallyClosedAnnotationViews']=new Set(),this['_domEmitter']=new(_0x408eb5())(),this['_annotationToNarrowView']=new Map(),this['set']('activeAnnotation',null),this['annotations']=null,this['_selectedAnnotations']=[],this['_editorAnnotations']=new _0x33b802(),this['_refreshPositioningDebounced']=_0x420187(()=>{this['_refreshPositioning']();},0xfa,{'leading':!0x1});}init(){this['context']['plugins']['get'](Ti)['register']('narrowSidebar',this),this['bodyCollection']=new _0x286678(this['context']['locale']),this['balloonPanelView']=new _0x48bc2e(this['context']['locale']),this['bodyCollection']['attachToDom'](),this['bodyCollection']['add'](this['balloonPanelView']);}attach(_0x3ff09c){this['annotations']=_0x3ff09c;const _0xce311b=this['context']['plugins']['get'](ki),_0x3a0b6c=this['balloonPanelView'];if(_0xce311b['_annotations']=_0x3ff09c,this['isAttached'])throw new _0x402d5c('narrowsidebar-attach-already-attached',this);this['isAttached']=!0x0,this['listenTo'](_0xce311b,'set:container',()=>{this['detach'](),this['listenTo'](_0xce311b,'change:container',_0x3b0f19=>{_0x3b0f19['off'](),this['attach'](_0x3ff09c);});}),_0xce311b['_attachToContainer']({'viewClass':'ck-sidebar--narrow','spaceBetweenItems':0x5});const _0x178c80=_0x2736e4=>{const _0x2738eb=new Ri(this['context']['locale']);_0xce311b['addAnnotation'](_0x2736e4,_0x2738eb),this['_annotationToNarrowView']['set'](_0x2736e4,_0x2738eb),_0x2738eb['bind']('isDirty','annotationType','number')['to'](_0x2736e4['view'],'isDirty','type','length'),_0x2738eb['on']('execute',()=>{this['_manuallyClosedAnnotationViews']['clear'](),_0x3a0b6c['content']['first']!==_0x2736e4['view']?(this['_showBalloon'](_0x2736e4),_0x2736e4['view']['element']['focus'](),this['setActiveAnnotation'](_0x2736e4)):this['setActiveAnnotation'](null);});};for(const _0x4dc430 of _0x3ff09c)_0x178c80(_0x4dc430);this['listenTo'](_0x3ff09c,'add',(_0x40b466,_0x29030c)=>{_0x178c80(_0x29030c);}),this['listenTo'](_0x3ff09c,'remove',(_0x1c22b8,_0x384ce0,_0x1ef917)=>{this['_annotationToNarrowView']['get'](_0x384ce0)['destroy'](),this['_annotationToNarrowView']['delete'](_0x384ce0),_0xce311b['rearrange']({'removedAnnotation':_0x384ce0,'previousAnnotation':_0x3ff09c['get'](_0x1ef917-0x1),'nextAnnotation':_0x3ff09c['get'](_0x1ef917+0x1)}),_0x384ce0===this['activeAnnotation']&&this['setActiveAnnotation'](null);},{'priority':'low'}),this['listenTo'](_0x3ff09c,'focus',(_0x5dd3e5,_0x45fba0)=>{this['setActiveAnnotation'](_0x45fba0);}),this['listenTo'](_0x3ff09c,'blur',()=>{this['setActiveAnnotation'](null);}),this['_domEmitter']['listenTo'](document,'keydown',(_0x1c7e2b,_0x22dc1f)=>{_0x22dc1f['keyCode']===_0x319fd4['esc']&&_0x3a0b6c['isVisible']&&(this['_manuallyClosedAnnotationViews']['add'](_0x3a0b6c['content']['first']),this['_hideBalloon'](),_0x22dc1f['stopPropagation'](),_0x22dc1f['preventDefault']());}),this['_domEmitter']['listenTo'](document,'mousedown',(_0x4d9ca1,_0x1c97d6)=>{const _0x12dff9=_0x1c97d6['target'];_0x3a0b6c['isVisible']&&_0x3a0b6c['element']['contains'](_0x12dff9)||_0xce311b['view']['element']['contains'](_0x12dff9)||_0x4d9ca1['preventClosingBalloon']||this['activeAnnotation']&&this['activeAnnotation']['focusableElements']['find'](_0x5806a7=>_0x5806a7['contains'](_0x12dff9))||(this['_manuallyClosedAnnotationViews']['clear'](),this['_hideBalloon'](),this['setActiveAnnotation'](null));});const _0x104030=this['context']instanceof _0x9685b6?this['context']['editors']:new _0x33b802([this['context']]);for(const _0x6b0d7f of _0x104030)this['_integrateWithEditorAnnotations'](_0x6b0d7f);this['listenTo'](_0x104030,'add',(_0x3c3588,_0x11f57a)=>{this['listenTo'](_0x11f57a,'ready',()=>{this['_integrateWithEditorAnnotations'](_0x11f57a);});}),this['listenTo'](_0x104030,'remove',(_0x1f042a,_0x5e1f8b)=>{_0x5e1f8b['plugins']['has']('EditorAnnotations')&&this['_destroyEditorAnnotationsIntegration'](_0x5e1f8b['plugins']['get']('EditorAnnotations'));}),window['addEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioning']();}setActiveAnnotation(_0x337c3f){if(_0x337c3f===this['activeAnnotation'])return;const _0x3bf4c6=this['context']['plugins']['get'](ki);_0x3bf4c6['refresh']({'blurredAnnotation':this['activeAnnotation'],'activatedAnnotation':_0x337c3f,'disableAnimationOnActivatedAnnotation':!0x0}),_0x337c3f&&_0x3bf4c6['getSidebarItemView'](_0x337c3f)?this['_showBalloon'](_0x337c3f):this['_hideBalloon'](),this['activeAnnotation']=_0x337c3f;}detach(){if(!this['isAttached'])throw new _0x402d5c('narrowsidebar-detach-not-attached',this);this['setActiveAnnotation'](null);const _0x3dede9=this['context']['plugins']['get'](ki);this['_hideBalloon'](),Array['from'](this['_annotationToNarrowView']['values'](),_0x45a929=>_0x45a929['destroy']()),this['_annotationToNarrowView']['clear'](),_0x3dede9['_detachFromContainer'](this['annotations']),this['stopListening'](),this['_domEmitter']['stopListening'](),this['context']instanceof _0x9685b6&&this['stopListening'](this['context']['editors']);for(const _0x27feea of Array['from'](this['_editorAnnotations']))this['_destroyEditorAnnotationsIntegration'](_0x27feea);window['removeEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioningDebounced']['cancel'](),this['_selectedAnnotations']=[],this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach'](),this['bodyCollection']['detachFromDom']();}_integrateWithEditorAnnotations(_0x289bdb){if(!_0x289bdb['plugins']['has']('EditorAnnotations'))return;const _0xa3f8b3=_0x289bdb['plugins']['get']('EditorAnnotations'),_0x58e090=this['context']['plugins']['get'](ki),_0x3f6116=this['annotations'],_0x4fd26e=this['balloonPanelView'],_0x3b491f=()=>{const _0x5f5afc=_0xa3f8b3['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});this['_setSelectedAnnotations'](_0x5f5afc),this['setActiveAnnotation'](_0x5f5afc[0x0]||null);};this['listenTo'](_0xa3f8b3,'refresh',_0x3b491f),this['listenTo'](_0xa3f8b3,'blur',(_0x2f7f87,{isAnnotationTracked:_0x1ea46})=>{this['activeAnnotation']&&_0x1ea46(this['activeAnnotation'])&&(this['_setSelectedAnnotations']([]),this['setActiveAnnotation'](null));}),this['listenTo'](_0xa3f8b3,'uiUpdate',()=>{this['_refreshPositioningDebounced']();}),this['listenTo'](_0x3f6116,'blur',_0x2f6c63=>{_0xa3f8b3['hasDomSelection']()&&_0x2f6c63['stop']();},{'priority':'high'}),this['listenTo'](this['_domEmitter'],'mousedown',(_0x3cb681,_0x463e2a)=>{const _0x1beb96=_0x463e2a['target'];_0x4fd26e['isVisible']&&_0x4fd26e['element']['contains'](_0x1beb96)||_0x58e090['view']['element']['contains'](_0x1beb96)||this['activeAnnotation']&&_0xa3f8b3['hasDomSelection']()&&(_0x3b491f(),_0x3cb681['preventClosingBalloon']=!0x0);},{'priority':'high'}),this['_editorAnnotations']['add'](_0xa3f8b3);}_destroyEditorAnnotationsIntegration(_0x56e145){_0x56e145&&(this['stopListening'](_0x56e145),this['_editorAnnotations']['remove'](_0x56e145));}_setSelectedAnnotations(_0x125e6e){for(const _0x5ae9d7 of this['_selectedAnnotations'])_0x125e6e['includes'](_0x5ae9d7)||this['_manuallyClosedAnnotationViews']['delete'](_0x5ae9d7['view']);this['_selectedAnnotations']=_0x125e6e;}_refreshPositioning(){const _0x11fcc1=this['balloonPanelView'];this['context']['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning'](),_0x11fcc1['isVisible']&&this['_updateBalloonPosition']();}['_showBalloon'](_0x3e11a3){if(this['_manuallyClosedAnnotationViews']['has'](_0x3e11a3['view']))return;const _0x4c8541=this['balloonPanelView']['content']['first'];_0x4c8541!==_0x3e11a3['view']?(_0x4c8541&&this['_detachListeners'](_0x4c8541),this['_attachListeners'](_0x3e11a3['view']),this['balloonPanelView']['content']['clear'](),this['balloonPanelView']['content']['add'](_0x3e11a3['view']),this['_updateBalloonPosition']()):this['_updateBalloonPosition']();}_updateBalloonPosition(){const _0x2c855f=this['balloonPanelView']['content']['first'],_0x54f27e=_0x2c855f&&this['annotations']['getByView'](_0x2c855f);if(!_0x54f27e||!this['_annotationToNarrowView']['has'](_0x54f27e))return;const _0x208c94=this['_annotationToNarrowView']['get'](_0x54f27e)['element'],_0x31ce86=(function(){const _0x3293ed=_0x48bc2e['defaultPositions'];return[_0x3293ed['southArrowNorthEast'],_0x3293ed['northArrowSouthEast'],_0x3293ed['southArrowNorth'],_0x3293ed['northArrowSouth'],_0x3293ed['southArrowNorthWest'],_0x3293ed['northArrowSouthWest']];}());this['balloonPanelView']['pin']({'target':_0x208c94,'positions':_0x31ce86});}['_hideBalloon'](){const _0x132af9=this['balloonPanelView'],_0x5876fd=_0x132af9['content']['first'];_0x5876fd&&(this['_detachListeners'](_0x5876fd),_0x132af9['unpin'](),_0x132af9['content']['clear']());}_attachListeners(_0x32f7d5){this['listenTo'](_0x32f7d5,'change:height',()=>this['_updateBalloonPosition']()),this['listenTo'](_0x32f7d5,'Esc',(_0x132dd1,_0x37256f)=>{this['_manuallyClosedAnnotationViews']['add'](_0x32f7d5),this['_hideBalloon'](),_0x37256f();});}_detachListeners(_0x2323f3){this['stopListening'](_0x2323f3);}},xi=class extends _0x2bcbce{isAttached;annotations;['_manuallyClosed'];['_balloon'];_addedAnnotations;_selectedAnnotations;['_forceRefresh'];_refreshVisibilityDebounced;static get requires(){return[di,_0x5d1799,Ti];}static get['pluginName'](){return'InlineAnnotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1db32){super(_0x1db32),_0x1db32['editing']['view']['addObserver'](lt),this['isAttached']=!0x1,this['set']('activeAnnotation',null),this['annotations']=null,this['_manuallyClosed']=new Set(),this['_balloon']=_0x1db32['plugins']['get'](_0x5d1799),this['_addedAnnotations']=new Set(),this['_selectedAnnotations']=[],this['_forceRefresh']=!0x1,this['_refreshVisibilityDebounced']=_0x420187(()=>{this['editor']['plugins']['get']('Annotations')['refreshVisibility']();},0xfa,{'leading':!0x1});}init(){const _0x42512e=this['editor']['plugins']['get'](Ti);_0x42512e['context']===this['editor']&&(_0x42512e['register']('inline',this),this['editor']['keystrokes']['set']('Esc',(_0x325926,_0x152af0)=>{const _0x277335=this['_balloon'];if(this['isAttached']&&_0x277335['visibleView']){const _0x10df75=this['annotations']['getByView'](_0x277335['visibleView']);_0x10df75&&this['_closeAnnotation'](_0x10df75),_0x152af0();}}));}afterInit(){const _0x1d6021=this['editor']['plugins']['get'](Ti);_0x1d6021['context']===this['editor']&&(_0x1d6021['hasActive']()||_0x1d6021['switchTo']('inline'));}setActiveAnnotation(_0x2920fa){_0x2920fa!==this['activeAnnotation']&&(this['activeAnnotation']&&(this['activeAnnotation']['isActive']=!0x1),_0x2920fa&&this['editor']['ui']['focusTracker']['isFocused']&&(this['annotations']['has'](_0x2920fa)&&this['_addAnnotationToBalloon'](_0x2920fa,!0x0),_0x2920fa['isActive']=!0x0),_0x2920fa||this['_setSelectedAnnotations']([]),this['activeAnnotation']=_0x2920fa);}attach(_0x3abf9c){this['annotations']=_0x3abf9c;const _0x4bb6b0=this['editor']['plugins']['get'](Ti),_0x4b68ce=this['_balloon'];if(this['isAttached'])throw new _0x402d5c('inlineannotations-attach-already-attached',this);if(_0x4bb6b0['context']!==this['editor'])throw new _0x402d5c('inlineannotations-not-allowed-with-context',this);const _0xac39fb=this['editor']['plugins']['get'](di);this['listenTo'](_0xac39fb,'refresh',()=>{const _0x3ade63=_0xac39fb['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});var _0x6d916f,_0x914360;!this['_forceRefresh']&&(_0x6d916f=_0x3ade63,_0x914360=this['_selectedAnnotations'],_0x6d916f['length']===_0x914360['length']&&_0x6d916f['every'](_0x570361=>_0x914360['includes'](_0x570361)))||(this['_forceRefresh']=!0x1,this['_setSelectedAnnotations'](_0x3ade63),this['setActiveAnnotation'](_0x3ade63[0x0]||null));}),this['listenTo'](_0xac39fb,'blur',(_0x50d3ee,{isAnnotationTracked:_0x2aca1b})=>{this['activeAnnotation']&&_0x2aca1b(this['activeAnnotation'])&&(this['_setSelectedAnnotations']([]),this['setActiveAnnotation'](null));}),this['listenTo'](_0xac39fb,'uiUpdate',()=>{this['_refreshVisibilityDebounced']();}),this['listenTo'](this['editor']['ui']['focusTracker'],'change:isFocused',(_0x276c15,_0xa92280,_0x34d575)=>{_0x34d575||this['setActiveAnnotation'](null);}),this['listenTo'](_0x3abf9c,'remove',(_0xce54fe,_0x1fd8d2)=>{this['_removeAnnotationFromBalloon'](_0x1fd8d2),_0x1fd8d2===this['activeAnnotation']&&this['setActiveAnnotation'](null);}),this['listenTo'](_0x4b68ce,'change:visibleView',(_0x537937,_0x4ab511,_0x279b41,_0x54ef90)=>{_0x54ef90&&this['stopListening'](_0x54ef90);const _0x52eda0=_0x3abf9c['getByView'](_0x279b41);_0x279b41&&_0x52eda0&&(this['listenTo'](_0x279b41,'change:height',()=>{_0x4b68ce['updatePosition']();}),this['listenTo'](_0x279b41,'Esc',()=>{this['_closeAnnotation'](_0x52eda0),this['editor']['editing']['view']['focus']();}),this['activeAnnotation']!==_0x52eda0&&this['setActiveAnnotation'](_0x52eda0));}),this['listenTo'](this['editor']['ui'],'update',()=>{_0x4b68ce['visibleView']&&_0x3abf9c['getByView'](_0x4b68ce['visibleView'])&&_0x4b68ce['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 _0x402d5c('inlineannotations-detach-not-attached',this);this['setActiveAnnotation'](null);for(const _0x1215a3 of this['_addedAnnotations'])this['_removeAnnotationFromBalloon'](_0x1215a3);this['_refreshVisibilityDebounced']['cancel'](),this['stopListening'](),this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach'](),this['_refreshVisibilityDebounced']['cancel']();}_setSelectedAnnotations(_0x3c05e0){for(const _0x1a5888 of this['_selectedAnnotations'])_0x3c05e0['includes'](_0x1a5888)||this['_manuallyClosed']['delete'](_0x1a5888);for(const _0x13c106 of this['annotations'])_0x3c05e0['includes'](_0x13c106)||this['_removeAnnotationFromBalloon'](_0x13c106);if(this['editor']['ui']['focusTracker']['isFocused']){for(const _0x23dc42 of _0x3c05e0)this['_addAnnotationToBalloon'](_0x23dc42);}this['_selectedAnnotations']=_0x3c05e0;}_addAnnotationToBalloon(_0x5e0284,_0x35b3df=!0x1){this['_manuallyClosed']['has'](_0x5e0284)||(this['_addedAnnotations']['has'](_0x5e0284)||this['_balloon']['hasView'](_0x5e0284['view'])||(this['_addedAnnotations']['add'](_0x5e0284),this['_balloon']['add']({'stackId':_0x5e0284['view']['id'],'view':_0x5e0284['view'],'position':{'target':()=>this['_getBalloonTargetForAnnotation'](_0x5e0284)}})),_0x35b3df&&this['_balloon']['showStack'](_0x5e0284['view']['id']));}_getBalloonTargetForAnnotation(_0x329343){const _0x4622b8=_0x329343['target'],_0x9dffde=this['editor']['editing']['view'],_0x5ddce5=_0x9dffde['document']['selection']['getFirstRange'](),_0x2a9842=_0x9dffde['domConverter']['viewRangeToDom'](_0x5ddce5);if(_0x2a9842['collapse'](!0x0),_0x4622b8){if(_0x4622b8 instanceof _0x23f3bc)return _0x4622b8;let _0x507ffb=[];for(const _0x47d2bd of _0x4622b8)_0x507ffb['push'](..._0x23f3bc['getDomElementRects'](_0x47d2bd));_0x507ffb=function(_0x41ed95){const _0x46a3fc=[];let _0x59300d=_0x41ed95[0x0];for(let _0x4c626a=0x1;_0x4c626a<_0x41ed95['length'];_0x4c626a++)if(Pi(_0x59300d,_0x41ed95[_0x4c626a])){const _0x28d883=_0x41ed95[_0x4c626a]['width'];_0x59300d['width']+=_0x28d883,_0x59300d['right']+=_0x28d883;}else _0x46a3fc['push'](_0x59300d),_0x59300d=_0x41ed95[_0x4c626a];return _0x46a3fc['push'](_0x59300d),_0x46a3fc;}(_0x507ffb);const _0x2fc6e5=_0x2a9842['getBoundingClientRect']();return _0x507ffb['find'](_0x1ab7b0=>_0x1ab7b0['top']<=_0x2fc6e5['top']&&_0x1ab7b0['bottom']>=_0x2fc6e5['bottom']&&_0x1ab7b0['left']<=_0x2fc6e5['left']&&_0x1ab7b0['right']>=_0x2fc6e5['right'])||_0x507ffb[0x0];}return _0x329343['targetRect']||_0x2a9842;}_removeAnnotationFromBalloon(_0x485a9f){this['_addedAnnotations']['has'](_0x485a9f)&&this['_balloon']['hasView'](_0x485a9f['view'])&&(this['_addedAnnotations']['delete'](_0x485a9f),this['_balloon']['remove'](_0x485a9f['view']));}_closeAnnotation(_0x8fd592){this['_manuallyClosed']['add'](_0x8fd592),this['_removeAnnotationFromBalloon'](_0x8fd592);}};function Pi(_0x1fae96,_0x5607a1){return _0x1fae96['top']===_0x5607a1['top']&&_0x1fae96['bottom']===_0x5607a1['bottom']&&_0x1fae96['right']===_0x5607a1['left'];}var Li=class extends ht{['focusTracker'];['focusCycler'];_annotationViews;constructor(_0xf510fb,_0x1faf3b){super(_0xf510fb),this['set']('isEmpty',!_0x1faf3b['length']),this['focusTracker']=new _0x198c81(),this['_annotationViews']=_0x1faf3b,this['_annotationViews']['delegate']('arrowup','arrowdown')['to'](this),this['on']('arrowup',()=>{this['focusCycler']['focusPrevious']();}),this['on']('arrowdown',()=>{this['focusCycler']['focusNext']();}),this['focusCycler']=new et({'focusables':_0x1faf3b,'focusTracker':this['focusTracker']}),this['listenTo'](_0x1faf3b,'add',()=>{this['isEmpty']=!0x1;}),this['listenTo'](_0x1faf3b,'remove',(_0x5e0cb1,_0x5b3e47)=>{_0x5b3e47['isActive']&&this['focus'](),_0x1faf3b['length']||(this['isEmpty']=!0x0);});const _0x3c7ddd=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'dir':'auto','class':['ck','ck-comments-archive'],'tabindex':-0x1,'role':'list','aria-label':Et(_0xf510fb,'COMMENTS_ARCHIVE_LIST_LABEL')},'children':[{'tag':'div','attributes':{'class':['ck-comments-archive__content'],'role':'presentation'},'children':[{'tag':'div','attributes':{'role':'presentation'},'children':_0x1faf3b},{'tag':'p','attributes':{'class':['ck-comments-archive__info',_0x3c7ddd['if']('isEmpty','ck-hidden',_0x5a9b4f=>!_0x5a9b4f)]},'children':[{'text':Et(_0xf510fb,'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 _0x24152b of this['_annotationViews'])this['focusTracker']['add'](_0x24152b['element']);this['_annotationViews']['on']('change',(_0x2a39d0,{added:_0x5a3e62,removed:_0x681e3})=>{for(const _0x5e7bc1 of _0x5a3e62)this['focusTracker']['add'](_0x5e7bc1['element']);for(const _0x4a44f3 of _0x681e3)this['focusTracker']['remove'](_0x4a44f3['element']);});}},Di=class extends _0x2bb426{static get['pluginName'](){return'CommentsArchive';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[oi,ti];}constructor(_0x2bcaf1){super(_0x2bcaf1),this['archivedThreads']=new _0x33b802();}init(){const _0xff5bf7=this['context'],_0x129db5=_0xff5bf7['plugins']['get'](oi),_0x27da42=_0xff5bf7['plugins']['get'](ti);this['listenTo'](_0x129db5,'addCommentThread',(_0xc6bdd3,{threadId:_0x1459a1})=>{const _0x3992bf=_0x129db5['getCommentThread'](_0x1459a1);_0x3992bf['archivedAt']&&this['archivedThreads']['add'](_0x3992bf,this['_calculatePosition'](_0x3992bf['archivedAt'])),this['listenTo'](_0x3992bf,'change:archivedAt',(_0x58cf86,_0x32ebf6,_0x37934c)=>{_0x37934c?this['archivedThreads']['has'](_0x3992bf)||this['archivedThreads']['add'](_0x3992bf,this['_calculatePosition'](_0x3992bf['archivedAt'])):this['archivedThreads']['has'](_0x3992bf)&&this['archivedThreads']['remove'](_0x3992bf);});}),this['listenTo'](_0x129db5,'removeCommentThread',(_0x59770e,{threadId:_0x5b473d})=>{const _0x2dd139=_0x129db5['getCommentThread'](_0x5b473d);this['stopListening'](_0x2dd139),this['archivedThreads']['has'](_0x2dd139)&&this['archivedThreads']['remove'](_0x2dd139);},{'priority':'highest'}),this['listenTo'](_0x27da42['collection'],'focus',(_0xa5200d,_0x30e8e3)=>{_0x30e8e3['isVisible']||(_0x30e8e3['isActive']=!0x0,_0x27da42['activate'](_0x30e8e3));});}_calculatePosition(_0x5911b4){const _0x96c2a8=[...this['archivedThreads']]['findIndex'](_0x2bd9f1=>_0x2bd9f1['archivedAt']<_0x5911b4);return _0x96c2a8>-0x1?_0x96c2a8:this['archivedThreads']['length'];}},Vi=class extends _0x2bcbce{commentsArchiveView;annotationViews;['_pendingThreads'];static get['pluginName'](){return'CommentsArchiveUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Di,_0x4580c1];}constructor(_0x228e8e){super(_0x228e8e),this['annotationViews']=new at(),this['_pendingThreads']=[];}init(){const _0x3c6cee=this['editor'],_0x137e14=this['_hideDialogOnAnnotationEscape']['bind'](this);_0x3c6cee['ui']['componentFactory']['add']('commentsArchive',()=>this['_createCommentsArchiveButton'](_0x151ed2,!0x0)),_0x3c6cee['ui']['componentFactory']['add']('menuBar:commentsArchive',()=>{const _0x7e93a3=this['_createCommentsArchiveButton'](rt);return _0x7e93a3['set']({'role':'menuitemcheckbox'}),_0x7e93a3;});const _0x706d44=_0x3c6cee['plugins']['get'](Di),_0x5b25a9=_0x3c6cee['plugins']['get']('Annotations'),_0x19409e=_0x3c6cee['plugins']['get']('CommentsRepository');_0x706d44['archivedThreads']['forEach'](_0x29fcda=>{this['_handleNewThread'](_0x29fcda);}),this['listenTo'](_0x706d44['archivedThreads'],'add',(_0x548f69,_0x191e4a)=>{this['_handleNewThread'](_0x191e4a);}),this['listenTo'](_0x5b25a9['collection'],'add',(_0x373684,_0x31a6a0)=>{const _0x591d6b=this['_pendingThreads']['find'](_0x1c76b2=>{const _0x1f7e6f=_0x19409e['_threadToController']['get'](_0x1c76b2);return _0x1f7e6f&&_0x31a6a0['innerView']===_0x1f7e6f['view'];});if(_0x591d6b){const _0x22a581=this['_calculatePosition'](_0x591d6b['archivedAt']);this['_addAnnotationToArchive'](_0x31a6a0,_0x22a581),this['_pendingThreads']['splice'](this['_pendingThreads']['indexOf'](_0x591d6b),0x1);}}),this['listenTo'](_0x706d44['archivedThreads'],'remove',(_0x5ebbc0,_0x7ddda5)=>{const _0x30f7f2=_0x3c6cee['config']['get']('collaboration.channelId');if(!_0x30f7f2||_0x7ddda5['channelId']===_0x30f7f2){if(this['_pendingThreads']['includes'](_0x7ddda5))this['_pendingThreads']['splice'](this['_pendingThreads']['indexOf'](_0x7ddda5),0x1);else{const _0x2d8ac0=_0x19409e['_threadToController']['get'](_0x7ddda5),_0x5190ca=_0x5b25a9['getByInnerView'](_0x2d8ac0['view']);this['annotationViews']['remove'](_0x5190ca['view']),this['stopListening'](_0x5190ca),this['stopListening'](_0x5190ca['focusableElements']);}}}),this['listenTo'](_0x5b25a9['collection'],'add',(_0x27a8ba,_0x571575)=>{this['listenTo'](_0x571575,'escape',_0x137e14);}),this['listenTo'](_0x5b25a9['collection'],'remove',(_0x339ede,_0x4cfc2a)=>{this['stopListening'](_0x4cfc2a,'escape',_0x137e14);});}_addAnnotationToArchive(_0x1040c1,_0x1ef5a9){this['listenTo'](_0x1040c1,'set:isVisible',_0x760ddb=>{_0x760ddb['return']=!0x1,_0x760ddb['stop']();}),this['annotationViews']['add'](_0x1040c1['view'],_0x1ef5a9);}['_handleNewThread'](_0x182b2c){const _0x58fdd2=this['editor']['plugins']['get']('CommentsRepository'),_0x4baeb5=this['editor']['plugins']['get']('Annotations'),_0x418df0=this['editor']['config']['get']('collaboration.channelId');if(!_0x418df0||_0x182b2c['channelId']===_0x418df0){const _0x209507=_0x58fdd2['_threadToController']['get'](_0x182b2c);if(!_0x209507)return void this['_pendingThreads']['push'](_0x182b2c);const _0x13e9a2=this['_calculatePosition'](_0x182b2c['archivedAt']),_0xee5513=_0x4baeb5['getByInnerView'](_0x209507['view']);_0xee5513['isVisible']&&_0x4baeb5['_visibleAnnotations']['remove'](_0xee5513),this['_addAnnotationToArchive'](_0xee5513,_0x13e9a2);}}_calculatePosition(_0x41e3bf){const _0x2d393a=this['editor']['config']['get']('collaboration.channelId'),_0x54a183=[...this['editor']['plugins']['get'](Di)['archivedThreads']]['filter'](_0x1f316a=>_0x1f316a['channelId']===_0x2d393a)['findIndex'](_0x2d11f3=>_0x2d11f3['archivedAt']<_0x41e3bf);return _0x54a183<0x0||_0x54a183>this['annotationViews']['length']?this['annotationViews']['length']:_0x54a183-0x1;}_toggleDialog(){const _0x524f90=this['editor'],_0x1f3a9e=_0x524f90['plugins']['get']('Dialog');this['commentsArchiveView']||(this['commentsArchiveView']=new Li(_0x524f90['locale'],this['annotationViews'])),'commentsArchive'===_0x1f3a9e['id']?_0x1f3a9e['hide']():_0x1f3a9e['show']({'id':'commentsArchive','title':Et(_0x524f90['locale'],'COMMENTS_ARCHIVE'),'icon':_0xa8fd73,'hasCloseButton':!0x0,'content':this['commentsArchiveView'],'position':_0x43beb4['EDITOR_TOP_SIDE']});}_createCommentsArchiveButton(_0x47622f,_0x501cdf=!0x1){const _0x433103=this['editor']['locale'],_0x4de6d1=this['editor']['plugins']['get']('Dialog'),_0x1eb846=new _0x47622f(_0x433103);return _0x1eb846['bind']('isEnabled')['to'](this,'isEnabled'),_0x1eb846['bind']('isOn')['to'](_0x4de6d1,'id',_0x1854e8=>'commentsArchive'===_0x1854e8),_0x1eb846['set']({'label':Et(_0x433103,'COMMENTS_ARCHIVE'),'icon':_0xa8fd73,'isToggleable':!0x0}),_0x501cdf&&(_0x1eb846['tooltip']=!0x0),this['listenTo'](_0x1eb846,'execute',()=>this['_toggleDialog']()),_0x1eb846;}_hideDialogOnAnnotationEscape=_0x3104fb=>{const _0x4fbb42=_0x3104fb['source'];if(!this['annotationViews']['has'](_0x4fbb42['view']))return;const _0x366bd4=this['editor']['plugins']['get']('Dialog');_0x366bd4['isOpen']&&'commentsArchive'===_0x366bd4['id']&&(_0x366bd4['hide'](),_0x3104fb['stop']());};},Bi=class extends _0x2bcbce{static get requires(){return[oi,wi,vi,Di,Vi,yi,Mi,Si,xi];}static get['pluginName'](){return'Comments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{ci as AddCommentThreadCommand,$t as Annotation,Jt as AnnotationCollection,Ri as AnnotationCounterButtonView,qt as AnnotationView,ti as Annotations,Ei as AnnotationsSidebarItemView,Ii as AnnotationsSidebarView,Ti as AnnotationsUIs,Ht as BaseCommentThreadView,Kt as BaseCommentView,hi as Comment,ri as CommentThread,bt as CommentThreadController,xt as CommentThreadInputView,Ut as CommentThreadView,Yt as CommentView,Bi as Comments,Di as CommentsArchive,Vi as CommentsArchiveUI,wi as CommentsEditing,Lt as CommentsListView,yi as CommentsOnly,oi as CommentsRepository,vi as CommentsUI,di as EditorAnnotations,xi as InlineAnnotations,Si as NarrowSidebar,ki as Sidebar,Mi as WideSidebar,Qt as bindAnnotationCollections};
|
|
23
|
+
import{Command as _0x44703a,Context as _0x4d8ccf,ContextPlugin as _0xe32c07,Editor as _0x458c52,PendingActions as _0x24dddb,Plugin as _0x12b188}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x3fd207,Collection as _0x5d687e,DomEmitterMixin as _0x30f8a8,FocusTracker as _0x4804cc,KeystrokeHandler as _0x225c8d,ObservableMixin as _0x1bcd46,Rect as _0x1f4f60,diff as _0x46451d,first as _0x9ba8a7,getEnvKeystrokeText as _0x10baf1,keyCodes as _0x5f035e,priorities as _0x4103ab,scrollViewportToShowTarget as _0x38c3bf,toUnit as _0x26abaa,uid as _0x185ea0}from'@ckeditor/ckeditor5-utils';import{AriaDescriptionView as _0x5319be,ConfirmMixin as _0x327e2c,FOCUS_ANNOTATION_KEYSTROKE as _0x14d518,LateFocusButtonView as _0x3a79be,LateFocusDropdownButtonView as _0x1dc2cf,UserView as _0x29d00e,Users as _0x23b29b,getAllMarkersDomElementsSorted as _0x71726c,getDateTimeFormatter as _0x110226,hashObject as _0x4543c7,setupThreadKeyboardNavigation as _0x146ecb,surroundingMarkersDetector as _0x1b50a0,trimHtml as _0x1f45e6}from'@ckeditor/ckeditor5-collaboration-core';import{cloneDeep as _0x2dad8a,debounce as _0x98290e,isEqual as _0x11ae2a,set as _0x200648,throttle as _0xdb138e,unset as _0x4c0a55}from'es-toolkit/compat';import{IconAddComment as _0x1aed3d,IconCheck as _0x3237c4,IconCommentsArchive as _0x2a22ba,IconPencil as _0x38ac55,IconRemoveComment as _0x52171e,IconThreeVerticalDots as _0x2c70f9,IconUndo as _0x4884c7}from'@ckeditor/ckeditor5-icons';import{BalloonPanelView as _0x4f61cf,BodyCollection as _0x456151,ButtonView as _0x422b1d,ContextualBalloon as _0xbf878f,Dialog as _0x3da253,DialogViewPosition as _0x56ba8b,EditorUI as tt,EditorUIView as it,FocusCycler as et,InlineEditableUIView as st,ListItemView as nt,ListView as ot,MenuBarMenuListItemButtonView as rt,View as ht,ViewCollection as at,createDropdown as ct,focusChildOnDropdownOpen as dt}from'@ckeditor/ckeditor5-ui';import{MouseObserver as lt,disableViewPlaceholder as mt,enableViewPlaceholder as ut}from'@ckeditor/ckeditor5-engine';import{Clipboard as ft,ClipboardMarkersUtils as pt,ClipboardPipeline as wt}from'@ckeditor/ckeditor5-clipboard';import{Enter as gt,ShiftEnter as _t}from'@ckeditor/ckeditor5-enter';import{SelectAll as At}from'@ckeditor/ckeditor5-select-all';import{Typing as vt}from'@ckeditor/ckeditor5-typing';import{Undo as yt}from'@ckeditor/ckeditor5-undo';import{Paragraph as Tt}from'@ckeditor/ckeditor5-paragraph';import{toWidget as Ct}from'@ckeditor/ckeditor5-widget';const It=/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x1bcd46();var bt=class extends It{['model'];['view'];constructor(_0x45c665,_0xbbfe45){super(),this['model']=_0x45c665,this['model']['_isAttached']=!0x0,this['view']=_0xbbfe45,this['listenTo'](_0xbbfe45,'submitCommentThread',()=>this['submit']()),this['listenTo'](_0xbbfe45,'removeCommentThread',()=>this['remove']()),this['listenTo'](_0xbbfe45,'resolveCommentThread',()=>this['resolve']()),this['listenTo'](_0xbbfe45,'reopenCommentThread',()=>this['reopen']()),this['listenTo'](_0xbbfe45,'addComment',(_0x27f93e,_0x6bd991)=>this['addComment'](_0x6bd991)),this['listenTo'](_0xbbfe45,'updateComment',(_0x5a1135,_0x534849,_0x53e3a9)=>this['updateComment'](_0x534849,_0x53e3a9)),this['listenTo'](_0xbbfe45,'removeComment',(_0x4d008b,_0xa6e9fb)=>this['removeComment'](_0xa6e9fb));}submit(){this['model']['submit']();}['remove'](){this['model']['remove']();}['resolve'](){this['model']['isResolved']||this['model']['resolve']();}['reopen'](){this['model']['isResolved']&&this['model']['reopen']();}addComment(_0x4d45d4){this['model']['addComment']({'content':_0x4d45d4,'authorId':this['view']['_localUser']['id']});}updateComment(_0x210a3f,_0x98e91c){this['model']['getComment'](_0x210a3f)['update']({'content':_0x98e91c});}removeComment(_0x1f9099){this['model']['getComment'](_0x1f9099)['remove']();}destroy(){this['stopListening'](),this['model']['_isAttached']=!0x1;}};function Et(_0x2c66e4,_0x51e9c7,_0x1de845){const t=_0x2c66e4['t'];switch(_0x51e9c7){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'},_0x1de845);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'},_0x1de845);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'},_0x1de845);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'},_0x1de845);case'NUMBER_OF_COMMENTS':return t({'string':'%0\x20Comment','plural':'%0\x20Comments','id':'NUMBER_OF_COMMENTS'},_0x1de845);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'},_0x1de845);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'},_0x1de845);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'},_0x1de845);case'COMMENTS_ARCHIVE':return t({'string':'Comments\x20archive','id':'COMMENTS_ARCHIVE'});case'EMPTY_COMMENTS_ARCHIVE':return t({'string':'There\x20are\x20no\x20archived\x20comment\x20threads.','id':'EMPTY_COMMENTS_ARCHIVE'});case'COMMENTS_ARCHIVE_LIST_LABEL':return t({'string':'List\x20of\x20comments','id':'COMMENTS_ARCHIVE_LIST_LABEL'});case'ACCESSIBILITY_HELP_ANNOTATIONS_GROUP':return t({'string':'Keystrokes\x20for\x20interacting\x20with\x20annotation\x20threads\x20(e.g.\x20comments,\x20track\x20changes\x20suggestions)','id':'ACCESSIBILITY_HELP_ANNOTATIONS_GROUP'});case'ACCESSIBILITY_HELP_ANNOTATIONS_MOVE_TO':return t({'string':'Move\x20focus\x20to\x20the\x20thread\x20when\x20the\x20selection\x20is\x20anchored\x20in\x20its\x20marker','id':'ACCESSIBILITY_HELP_ANNOTATIONS_MOVE_TO'});case'ACCESSIBILITY_HELP_ANNOTATIONS_EXIT':return t({'string':'Exit\x20the\x20annotation\x20and\x20move\x20focus\x20back\x20to\x20the\x20edited\x20content','id':'ACCESSIBILITY_HELP_ANNOTATIONS_EXIT'});case'ACCESSIBILITY_HELP_ANNOTATIONS_ENTER':return t({'string':'Browse\x20the\x20focused\x20annotation\x20thread\x20or\x20thread\x20comment','id':'ACCESSIBILITY_HELP_ANNOTATIONS_ENTER'});case'ACCESSIBILITY_HELP_ANNOTATIONS_BROWSE_GROUPS':return t({'string':'Move\x20across\x20internals\x20of\x20the\x20annotation\x20thread','id':'ACCESSIBILITY_HELP_ANNOTATIONS_BROWSE_GROUPS'});case'ACCESSIBILITY_HELP_ANNOTATIONS_SUBMIT_COMMENT':return t({'string':'Submit\x20the\x20reply\x20while\x20writing\x20a\x20comment','id':'ACCESSIBILITY_HELP_ANNOTATIONS_SUBMIT_COMMENT'});case'ACCESSIBILITY_HELP_ANNOTATIONS_NAVIGATE_THREADS':return t({'string':'Move\x20to\x20the\x20previous\x20or\x20next\x20thread\x20in\x20the\x20annotations\x20sidebar\x20or\x20comments\x20archive','id':'ACCESSIBILITY_HELP_ANNOTATIONS_NAVIGATE_THREADS'});default:return'';}}var kt=class extends it{['main'];editable;constructor(_0x59d09d,_0x1df671){super(_0x59d09d);const _0xef0b36=_0x185ea0();this['main']=this['createCollection'](),this['editable']=new st(_0x59d09d,_0x1df671,void 0x0,{'label':()=>Et(_0x59d09d,'Comment\x20editor')}),this['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-editor','ck-rounded-corners','ck-comment__input'],'dir':_0x59d09d['uiLanguageDirection'],'lang':_0x59d09d['uiLanguage'],'aria-labelledby':'cke-editor__aria-label_'+_0xef0b36},'children':[{'tag':'div','attributes':{'class':'ck-editor__main','role':'presentation'},'children':this['main']}]});}['render'](){super['render'](),this['main']['add'](this['editable']);}['focus'](){this['editable']['element']['focus']();}},Nt=class extends tt{['view'];constructor(_0xc6d1a0){super(_0xc6d1a0),this['view']=new kt(_0xc6d1a0['locale'],_0xc6d1a0['editing']['view']);}get element(){return this['view']['element'];}init(){const _0x11c928=this['editor']['editing']['view'],_0x4f4353=this['view']['editable'];_0x4f4353['name']=_0x11c928['document']['getRoot']()['rootName'],this['view']['render']();const _0x3f54c4=_0x4f4353['element'];this['setEditableElement'](_0x4f4353['name'],_0x3f54c4),this['view']['editable']['bind']('isFocused')['to'](this['focusTracker']),_0x11c928['attachDomRoot'](_0x3f54c4),this['fire']('ready');}destroy(){super['destroy'](),this['view']['destroy']();}};const Ot=[ft,gt,_t,At,vt,yt,Tt],Mt=/* #__PURE__ -- @preserve */
|
|
25
|
+
_0x1bcd46(_0x458c52);var Rt=class CommentEditor extends Mt{static defaultPlugins=/* #__PURE__ -- @preserve */
|
|
26
|
+
((()=>Ot)());constructor(_0x391ad5={}){(_0x391ad5=Object['assign']({},_0x391ad5))['plugins']||(_0x391ad5['plugins']=CommentEditor['defaultPlugins']),super(_0x391ad5),this['ui']=new Nt(this),this['set']('placeholder',''),this['model']['document']['on']('change',()=>this['_updatePlaceholder'](),{'priority':'low'}),this['on']('change:placeholder',()=>this['_updatePlaceholder']()),this['model']['document']['createRoot'](),this['editing']['view']['_overlayModeHint']='auto',this['_sendUsageRequest']=()=>window['Promise']['resolve']({'status':'ok'});}create(){const _0x57cddd=this['config']['get']('initialData')||'';return this['initPlugins']()['then'](()=>this['ui']['init']())['then'](()=>this['data']['init'](_0x57cddd))['then'](()=>this['fire']('ready'));}destroy(){return super['destroy']()['then'](()=>this['ui']['destroy']());}['focus'](){this['model']['change'](_0x3ca089=>{const _0x1631f2=this['model']['document']['getRoot'](),_0x3186bc=_0x1631f2&&_0x1631f2['getChild'](_0x1631f2['childCount']-0x1);_0x3ca089['setSelection'](_0x3186bc,'end'),this['editing']['view']['focus']();});}_updatePlaceholder(){const _0x414654=this['editing']['view'],_0x1e55b6=_0x414654['document']['getRoot'](),_0x372c1e=_0x1e55b6['getChild'](0x0);_0x1e55b6['childCount']>0x1||!_0x372c1e||'p'!=_0x372c1e['name']?this['placeholderElement']&&this['placeholderElement']['placeholder']&&(mt(_0x414654,this['placeholderElement']),this['placeholderElement']=void 0x0):(this['placeholder']&&(_0x372c1e['placeholder']=this['placeholder']),ut({'view':_0x414654,'element':_0x372c1e,'keepOnFocus':!0x0}),this['placeholderElement']=_0x372c1e);}},St=class extends ht{keystrokes;['focusTracker'];['focusables'];['focusCycler'];submitButtonView;cancelButtonView;_editorConfig;constructor(_0x3ac517,_0x2d1a2d={}){super(_0x3ac517),this['editor']=null,this['_editorConfig']=_0x2d1a2d,this['set']('value',_0x2d1a2d['initialData']||''),this['set']('disabledSubmit',!0x1),this['set']('showButtons',!0x0),this['set']('placeholder',Et(_0x3ac517,'Reply...')),this['set']('submitLabel',Et(_0x3ac517,'Reply')),this['submitButtonView']=this['_createSubmitButton'](),this['cancelButtonView']=this['_createCancelButton'](),this['focusables']=this['createCollection']([this['submitButtonView'],this['cancelButtonView']]),this['keystrokes']=new _0x225c8d(),this['focusTracker']=new _0x4804cc(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x5d3268=>!_0x5d3268['defaultPrevented']},'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['setTemplate']({'tag':'div','attributes':{'class':['ck-comment__input-wrapper']},'children':[{'tag':'div','attributes':{'class':['ck-comment__input-actions',this['bindTemplate']['if']('showButtons','ck-comment__input-actions--active')]},'children':[this['submitButtonView'],this['cancelButtonView']]}]}),this['keystrokes']['set']('Esc',(_0x4966b3,_0x438be2)=>{this['cancelButtonView']['fire']('execute'),_0x438be2();}),this['keystrokes']['set']('Ctrl+Enter',(_0x1dbfe9,_0x4772de)=>{this['submitButtonView']['isEnabled']&&(this['submitButtonView']['fire']('execute'),_0x4772de());}),this['on']('submit',(_0x3005a9,_0x255629)=>{_0x255629['length']>0xfde8?(alert(Et(_0x3ac517,'TOO_LONG_COMMENT_ALERT',[_0x255629['length'],0xfde8])),_0x3005a9['stop']()):this['editor']['setData']('');},{'priority':'high'});}['render'](){super['render'](),this['_setupKeyboardNavigation']();}createEditor(){return this['editor']||(this['editor']=new Rt(this['_editorConfig']),this['_editorCreationPromise']=this['editor']['create']()['then'](()=>{if(this['_isDestroyed'])return;const _0x2ac213=this['editor'];this['element']['insertBefore'](_0x2ac213['ui']['element'],this['element']['firstChild']),_0x2ac213['model']['document']['on']('change',()=>this['value']=_0x2ac213['getData']()),_0x2ac213['bind']('placeholder')['to'](this),this['focusables']['add'](_0x2ac213['ui']['view'],0x0),this['fire']('editorReady',this['editor']);})),this['_editorCreationPromise'];}['focus'](_0x56fedf){-0x1===_0x56fedf?(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:_0x14cd1d}=this,_0x50a0ff=new _0x422b1d(_0x14cd1d);return _0x50a0ff['extendTemplate']({'attributes':{'class':['ck-comment__input-actions--submit']}}),_0x50a0ff['withText']=!0x0,_0x50a0ff['bind']('label')['to'](this,'submitLabel'),_0x50a0ff['on']('execute',()=>{this['fire']('submit',this['value']);}),_0x50a0ff['bind']('isEnabled')['to'](this,'value',this,'disabledSubmit',(_0x53cbd5,_0x539e9d)=>!_0x539e9d&&!!_0x53cbd5['trim']()),_0x50a0ff;}_createCancelButton(){const {locale:_0x2f0df5}=this,_0x56c0fb=new _0x422b1d(_0x2f0df5);return _0x56c0fb['extendTemplate']({'attributes':{'class':['ck-comment__input-actions--cancel']}}),_0x56c0fb['label']=Et(_0x2f0df5,'Cancel'),_0x56c0fb['withText']=!0x0,_0x56c0fb['on']('execute',()=>{this['editor']['setData'](''),this['fire']('cancel');}),_0x56c0fb;}_setupKeyboardNavigation(){this['keystrokes']['listenTo'](this['element']),this['focusables']['forEach'](_0xead881=>{this['focusTracker']['add'](_0xead881['element']);}),this['focusables']['on']('change',(_0x1effbb,_0x4a20fc)=>{for(const _0x37c6d8 of Array['from'](_0x4a20fc['added'])['reverse']())this['focusTracker']['add'](_0x37c6d8['element']);});}},xt=class extends ht{constructor(_0x9a9658,_0x58988d,_0x572ecc){super(_0x9a9658),this['commentInputView']=new St(_0x9a9658,_0x572ecc),this['focusCycler']=this['commentInputView']['focusCycler'],this['commentInputView']['bind']('showButtons')['to'](this['commentInputView']['focusTracker'],'isFocused',this['commentInputView'],'value',(_0x3a4bb1,_0x34d7a6)=>_0x3a4bb1||!!_0x34d7a6),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 _0x29d00e(_0x9a9658,_0x58988d),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'](_0x1ac69b){this['commentInputView']['focus'](_0x1ac69b);}_focusOnNonInteractiveMouseDown(){this['listenTo'](this['element'],'mousedown',(_0x3061f1,_0x4e5fb5)=>{const {submitButtonView:_0x17428d,cancelButtonView:_0x31b24c,editor:_0x15eee8}=this['commentInputView'];[_0x17428d['element'],_0x31b24c['element'],_0x15eee8?_0x15eee8['editing']['view']['getDomRoot']():null]['filter'](_0xc7168a=>_0xc7168a)['some'](_0x52b617=>_0x52b617['contains'](_0x4e5fb5['target']))||(this['focus'](),_0x4e5fb5['preventDefault']());});}},Pt=class extends ht{constructor(_0x19d513){super(_0x19d513);const _0x33f646=this['bindTemplate'];this['set']('count',void 0x0),this['setTemplate']({'tag':'li','attributes':{'class':'ck-thread__comment-count'},'children':[{'text':_0x33f646['to']('count',_0x5e1177=>Et(_0x19d513,'NUMBER_OF_COMMENTS',_0x5e1177))}]});}},Lt=class extends ht{commentViews;resolvedCommentView;['focusTracker'];keystrokes;['focusCycler'];['_model'];['_config'];_collapsedCommentsView;constructor(_0x37d100,_0x8faf96,_0x2144b3){super(_0x37d100);const _0x44ae22=this['bindTemplate'];this['set']('hasDirtyComment',!0x1),this['set']('length',_0x8faf96['comments']['length']),this['set']('isActive',!0x1),this['_model']=_0x8faf96,this['_config']=_0x2144b3,this['commentViews']=this['createCollection'](),this['visibleViews']=this['createCollection'](),this['resolvedCommentView']=null,this['focusTracker']=new _0x4804cc(),this['keystrokes']=new _0x225c8d(),this['focusCycler']=new et({'focusables':this['commentViews'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x1312d9=>this['commentViews']['map'](_0x1cbad5=>_0x1cbad5['element'])['includes'](_0x1312d9['target'])},'actions':{'focusPrevious':'arrowup','focusNext':'arrowdown'}}),this['_collapsedCommentsView']=new Pt(_0x37d100),this['_collapsedCommentsView']['bind']('count')['to'](this,'length',_0x5be0b0=>_0x5be0b0-this['_config']['maxCommentsWhenCollapsed']);for(const _0x9e42d7 of _0x8faf96['comments'])this['_handleNewCommentModel'](_0x9e42d7);this['_handleInfoComment'](),this['listenTo'](_0x8faf96['comments'],'add',(_0x4b365c,_0x5b071b)=>{const _0x2e873b=this['_calculatePosition'](_0x5b071b);this['length']++,this['_handleNewCommentModel'](_0x5b071b,_0x2e873b),this['refreshVisibleViews']();}),this['listenTo'](_0x8faf96['comments'],'remove',(_0x71749,_0x4b7f64)=>{this['length']--,this['_handleRemoveCommentModel'](_0x4b7f64),this['refreshVisibleViews']();}),this['listenTo'](_0x8faf96,'commentUpdated',()=>this['refreshVisibleViews']()),this['listenTo'](_0x8faf96,'change:isResolved',()=>this['_handleInfoComment']()),this['on']('change:isActive',()=>this['refreshVisibleViews']()),this['on']('change:hasDirtyComment',()=>this['refreshVisibleViews']()),this['setTemplate']({'tag':'ul','attributes':{'class':['ck-thread__comments',_0x44ae22['if']('length','ck-hidden',_0x1b5a0c=>!_0x1b5a0c)],'aria-label':Et(_0x37d100,'Thread\x20comments')},'children':this['visibleViews']});}get['_shouldCollapse'](){return this['_model']['weight']>this['_config']['maxThreadTotalWeight']&&!this['isActive']&&!this['hasDirtyComment'];}['render'](){super['render'](),this['refreshVisibleViews'](),this['_setupKeyboardNavigation']();}['focus'](_0x117502){-0x1===_0x117502?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}destroy(){this['_collapsedCommentsView']['destroy']();for(const _0x496a72 of this['commentViews'])_0x496a72['destroy']();super['destroy']();}['refreshVisibleViews'](){this['_shouldCollapse']?this['_rearrangeCollapse']():this['_rearrangeExpand']();}_handleNewCommentModel(_0x2bede2,_0x32245e){const _0x4f3fbb=new this['_config']['CommentView'](this['locale'],_0x2bede2,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig']});_0x4f3fbb['viewUid']=_0x2bede2['id'],_0x4f3fbb['delegate']('removeComment')['to'](this),_0x4f3fbb['delegate']('updateComment')['to'](this),_0x4f3fbb['delegate']('resolveCommentThread')['to'](this),_0x4f3fbb['delegate']('editorReady')['to'](this),_0x4f3fbb['delegate']('editorDestroyed')['to'](this),this['listenTo'](_0x4f3fbb,'change:isEditMode',()=>this['_updateHasDirtyComment']()),this['commentViews']['add'](_0x4f3fbb,_0x32245e);}_calculatePosition(_0x14f447){const _0x37ebbe=this['_model']['_findOptimalIndex'](_0x14f447);return this['resolvedCommentView']?this['resolvedCommentView']['authoredAt']>_0x14f447['authoredAt']?_0x37ebbe-0x1:_0x37ebbe:_0x37ebbe-0x1;}_handleInfoComment(){if(this['_model']['resolvedBy']&&this['_model']['resolvedAt']){const _0x12d023={'id':'resolved','author':this['_model']['resolvedBy'],'authoredAt':this['_model']['resolvedAt'],'content':Et(this['locale'],'Marked\x20as\x20resolved'),'attributes':{}};this['resolvedCommentView']=new this['_config']['CommentView'](this['locale'],_0x12d023,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig'],'isSystemComment':!0x0}),this['commentViews']['add'](this['resolvedCommentView'],this['_model']['_findOptimalIndex'](_0x12d023));}else this['resolvedCommentView']&&(this['commentViews']['remove'](this['resolvedCommentView']),this['resolvedCommentView']['destroy'](),this['resolvedCommentView']=null);this['refreshVisibleViews']();}_handleRemoveCommentModel(_0x5235d5){const _0x4ef485=this['commentViews']['remove'](_0x5235d5['id']);this['stopListening'](_0x4ef485),_0x4ef485['isEditMode']&&this['_updateHasDirtyComment'](),_0x4ef485['destroy']();}_updateHasDirtyComment(){this['hasDirtyComment']=Array['from'](this['commentViews'])['some'](_0x1910bc=>_0x1910bc['isEditMode']);}['_rearrangeCollapse'](){const _0x2fc1f1=function(_0xcbee23){const _0x40b705=new _0x5d687e();for(const _0x1a643c of _0xcbee23)_0x40b705['add'](_0x1a643c);return _0x40b705;}(this['commentViews']),_0x530733=this['_collapsedCommentsView']['count'];for(let _0x2979d6=0x1;_0x2979d6<=_0x530733;_0x2979d6++)_0x2fc1f1['remove'](0x1);for(const _0x158f2c of _0x2fc1f1)_0x158f2c['collapse']();_0x530733>0x0&&_0x2fc1f1['add'](this['_collapsedCommentsView'],0x1),Dt(_0x46451d(Array['from'](this['visibleViews']),Array['from'](_0x2fc1f1)),this['visibleViews'],_0x2fc1f1);}['_rearrangeExpand'](){Dt(_0x46451d(Array['from'](this['visibleViews']),Array['from'](this['commentViews'])),this['visibleViews'],this['commentViews']);for(const _0x569d04 of this['visibleViews'])_0x569d04['expand']();}_setupKeyboardNavigation(){this['commentViews']['forEach'](_0x2a962b=>{this['focusTracker']['add'](_0x2a962b['element']),this['keystrokes']['listenTo'](_0x2a962b['element']);}),this['commentViews']['on']('change',(_0x20010d,_0x11e875)=>{for(const _0x301ed3 of _0x11e875['removed'])this['focusTracker']['remove'](_0x301ed3['element']),this['keystrokes']['stopListening'](_0x301ed3['element']);for(const _0x1ebd5f of Array['from'](_0x11e875['added'])['reverse']())this['focusTracker']['add'](_0x1ebd5f['element']),this['keystrokes']['listenTo'](_0x1ebd5f['element']);});}};function Dt(_0x1a6281,_0x495cca,_0x3b40b0){let _0x2b73bd=0x0;for(const _0x37b7b1 of _0x1a6281)switch(_0x37b7b1){case'insert':_0x495cca['add'](_0x3b40b0['get'](_0x2b73bd),_0x2b73bd),_0x2b73bd++;break;case'delete':_0x495cca['remove'](_0x2b73bd);break;case'equal':_0x2b73bd++;}}var Vt=class extends ht{constructor(_0x3c0c10){super(_0x3c0c10);const _0x2d5ce9=this['bindTemplate'];this['set']('contextValue',''),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-context__value'],'aria-label':_0x2d5ce9['to']('contextValue',_0xefef5a=>Et(_0x3c0c10,'THREAD_CONTEXT_LABEL',_0xefef5a)),'tabindex':-0x1},'children':[{'text':_0x2d5ce9['to']('contextValue')}]});}['focus'](){this['element']['focus']();}},Bt=class extends ht{['_model'];reopenButtonView;contextView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];constructor(_0x5259e3,_0x405230){super(_0x5259e3);const _0x557b71=this['bindTemplate'];this['_model']=_0x405230,this['reopenButtonView']=this['_createReopenButton'](),this['contextView']=this['_createContextView'](),this['focusables']=this['createCollection']([this['contextView'],this['reopenButtonView']]),this['focusTracker']=new _0x4804cc(),this['keystrokes']=new _0x225c8d(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['bind']('hasContext')['to'](this['_model'],'context',_0x4f1bfa=>!!_0x4f1bfa),this['bind']('contextValue')['to'](this['_model'],'context',_0x3dcd57=>_0x3dcd57&&_0x3dcd57['value']?this['_trimContextValue'](_0x3dcd57['value']):Et(this['locale'],'Comment\x20was\x20made\x20on\x20an\x20element')),this['setTemplate']({'tag':'div','attributes':{'class':['ck-thread__header']},'children':[{'tag':'div','attributes':{'class':['ck-context-wrapper']},'children':[{'tag':'div','attributes':{'class':['ck-context',_0x557b71['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 _0x30d218=new _0x422b1d(this['locale']);return _0x30d218['label']=Et(this['locale'],'Reopen'),_0x30d218['tooltip']=Et(this['locale'],'Reopen'),_0x30d218['icon']=_0x4884c7,_0x30d218['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x2a4322=>!_0x2a4322),_0x30d218['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x12a50e,_0x3b2e70)=>_0x12a50e&&_0x3b2e70),_0x30d218['on']('execute',()=>{this['fire']('reopenCommentThread',this['_model']['id']);}),_0x30d218;}_trimContextValue(_0x57e2aa){if(_0x57e2aa['length']<0x96)return _0x57e2aa;const _0x3f9e04=_0x57e2aa['lastIndexOf']('\x20',0x93);return _0x57e2aa['substring'](0x0,_0x3f9e04>-0x1?_0x3f9e04:0x93)+'...';}_attachContextActions(){const _0x34b0b8=this['element']['querySelector']('.ck-context'),_0x11f668=_0x34b0b8['querySelector']('.ck-context__value');this['listenTo'](_0x34b0b8,'mouseenter',()=>{_0x11f668['offsetWidth']<_0x11f668['scrollWidth']&&_0x34b0b8['classList']['add']('overlay');}),this['listenTo'](_0x34b0b8,'mouseleave',()=>{_0x34b0b8['classList']['remove']('overlay');});}_setupKeyboardNavigation(){this['keystrokes']['listenTo'](this['element']);for(const _0x3f308c of this['focusables'])this['focusTracker']['add'](_0x3f308c['element']),this['keystrokes']['listenTo'](_0x3f308c['element']);}_createContextView(){const _0x5d0bea=new Vt(this['locale']);return _0x5d0bea['bind']('contextValue')['to'](this),_0x5d0bea;}},Ht=class extends ht{['_model'];['_config'];commentThreadHeaderView;commentThreadInputView;ariaDescriptionView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];constructor(_0x209854,_0x23801d,_0x572b95,_0x7b49d){super(_0x209854),this['set']('isActive',!0x1),this['set']('isDirty',!0x1),this['_model']=_0x23801d,this['_localUser']=_0x572b95,this['_config']=_0x7b49d,this['commentThreadHeaderView']=new Bt(_0x209854,_0x23801d),this['commentThreadHeaderView']['delegate']('reopenCommentThread')['to'](this),this['ariaDescriptionView']=new _0x5319be(_0x209854,Et(_0x209854,'COMMENT_THREAD_DESCRIPTION')),this['listenTo'](this,'reopenCommentThread',()=>{this['focus']();}),this['commentsListView']=new Lt(_0x209854,_0x23801d,Object['assign']({'CommentView':this['_config']['CommentView']},_0x7b49d)),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',(_0x170528,_0x2da179)=>_0x170528||!!_0x2da179),this['bind']('isUnlinked')['to'](_0x23801d,'unlinkedAt',_0x2b8aa6=>!!_0x2b8aa6);let _0x461452=null;const _0x22ed13=()=>{const _0xe9f70d=this['_model']['comments']['first']||null;_0xe9f70d!==_0x461452&&(_0x461452&&this['stopListening'](_0x461452,'change:content'),_0x461452=_0xe9f70d,_0xe9f70d&&this['listenTo'](_0xe9f70d,'change:content',_0x22ed13));const _0x548ae4=_0xe9f70d?_0xe9f70d['author']['name']:this['_localUser']['name'],_0x580166=_0xe9f70d?new DOMParser()['parseFromString'](_0x1f45e6(_0xe9f70d['content'],{'limit':this['_config']['maxCommentCharsWhenCollapsed']}),'text/html')['body']['textContent']:'',_0x7f409=Et(this['locale'],'COMMENT_THREAD_LABEL',[this['length'],_0x548ae4]);this['set']('ariaLabel',_0x580166?_0x7f409+'\x20'+_0x580166:_0x7f409);};this['listenTo'](this['_model']['comments'],'change',_0x22ed13),_0x22ed13(),this['focusables']=this['createCollection']([this['commentsListView'],this['commentThreadInputView']]),this['focusTracker']=new _0x4804cc(),this['keystrokes']=new _0x225c8d(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x396035=>_0x396035['target']!==this['element']},'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}});}['focus'](){this['element']['focus']();}['render'](){super['render'](),_0x146ecb(this,this['focusables']);}async destroy(){this['isDirty']=!0x1,this['commentsListView']['destroy'](),await this['commentThreadInputView']['destroy'](),super['destroy']();}_createCommentThreadInputView(){const _0x54c10e=new xt(this['locale'],this['_localUser'],this['_config']['editorConfig']),_0x55d472=_0x54c10e['commentInputView'];return _0x54c10e['bind']('showInput')['to'](this,'isActive',this['_model'],'isReadOnly',this['_model'],'canComment',this['_model'],'archivedAt',_0x55d472,'value',(_0x18f2ee,_0x1c0c62,_0x2fa3da,_0xee38a3,_0x52fdb5)=>!!_0x52fdb5||!!_0xee38a3&&_0x2fa3da&&!_0x1c0c62||_0x18f2ee&&_0x2fa3da&&!_0x1c0c62),_0x55d472['bind']('placeholder')['to'](this,'length',this['_model'],'isResolvable',this['_model'],'isResolved',(_0x23e51f,_0x4cea5c,_0x4b6a10)=>{let _0x25311;return _0x25311=_0x4b6a10&&_0x4cea5c?'Reply\x20to\x20reopen\x20discussion...':_0x23e51f?'Reply...':'Write\x20a\x20comment...',Et(this['locale'],_0x25311);}),_0x55d472['bind']('submitLabel')['to'](this,'length',_0x136cc9=>Et(this['locale'],_0x136cc9?'Reply':'Comment')),_0x55d472['on']('submit',(_0x38da2d,_0x3ede04)=>{this['fire']('addComment',_0x3ede04),this['_model']['isResolved']&&this['_model']['isResolvable']&&this['fire']('reopenCommentThread',this['_model']['id']),this['_model']['isSubmitted']||this['fire']('submitCommentThread');}),_0x55d472['on']('cancel',()=>{this['focus']();}),_0x55d472['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0x55d472['on']('cancel',_0x501c69=>{0x0==this['length']&&(this['fire']('removeCommentThread'),_0x501c69['stop']());}),this['on']('change:isActive',(_0x23d05c,_0x51939c,_0x5ef1a7)=>{_0x5ef1a7||this['length']||_0x55d472['value']||this['fire']('removeCommentThread');}),_0x54c10e;}};const Ft=/* #__PURE__ -- @preserve */
|
|
27
|
+
_0x327e2c(Ht);var Ut=class extends Ft{commentThreadChildren;containerElement;resolveButton;_boundFirstCommentView;constructor(_0x5c14ea,_0x3fad2f,_0x4d1f6a,_0x4a29cb){super(_0x5c14ea,_0x3fad2f,_0x4d1f6a,_0x4a29cb),this['commentThreadChildren']=this['createCollection']([this['commentsListView'],this['commentThreadInputView'],this['ariaDescriptionView']]),this['set']('actionIndicator',null),this['containerElement']=null,this['_boundFirstCommentView']=null,this['locale']=_0x5c14ea,this['resolveButton']=this['_createResolveButton'](),this['setTemplate'](this['getTemplate']()),this['on']('change:isActive',(_0x24a83a,_0x2dc2ae,_0x511aee)=>{_0x511aee||this['_cancelAllConfirms']();}),this['listenTo'](this['_model'],'change:isReadOnly',(_0x4e18b7,_0x4d0952,_0xf6e88e)=>{_0xf6e88e&&this['_cancelAllConfirms']();}),this['length']>0x0&&this['_bindFirstCommentView'](),this['listenTo'](this['commentsListView']['commentViews'],'add',()=>{this['_bindFirstCommentView']();});}getTemplate(){const _0xbab00d=this['bindTemplate'];return{'tag':'div','attributes':{'class':['ck','ck-thread','ck-reset_all-excluded','ck-rounded-corners',_0xbab00d['if']('isActive','ck-thread--active'),_0xbab00d['if']('isUnlinked','ck-thread--unlinked'),_0xbab00d['to']('actionIndicator',_0x4b29a2=>_0x4b29a2?'ck-thread--'+_0x4b29a2:'')],'data-thread-id':this['_model']['id'],'tabindex':0x0,'role':'listitem','aria-label':_0xbab00d['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 _0x40546c of this['commentsListView']['commentViews'])_0x40546c['cancelConfirm']();}_bindFirstCommentView(){const {locale:_0x2a78e9}=this,_0x296400=this['commentsListView']['commentViews']['get'](0x0);_0x296400===this['_boundFirstCommentView']||_0x296400['isSystemComment']||(this['_boundFirstCommentView']=_0x296400,this['unbind']('actionIndicator'),this['bind']('actionIndicator')['to'](_0x296400,'actionIndicator',_0x5b1a62=>'remove'===_0x5b1a62?'remove':null),_0x296400['placeholder']=Et(_0x2a78e9,'Write\x20a\x20comment...'),_0x296400['removeButton']['on']('execute',_0x21081a=>{_0x21081a['stop'](),this['showConfirm'](Et(_0x2a78e9,'Delete\x20comment\x20thread?'),this['containerElement'])['then'](()=>{this['fire']('removeCommentThread');});},{'priority':'high'}),this['on']('removeConfirm',()=>{_0x296400['focus']();}),_0x296400['actionBar']['add'](this['resolveButton'],0x0),_0x296400['focusables']['add'](this['resolveButton'],0x0));}_createResolveButton(){const _0x272ac8=new _0x3a79be(this['locale']);return _0x272ac8['label']=Et(this['locale'],'Resolve'),_0x272ac8['tooltip']=Et(this['locale'],'Resolve'),_0x272ac8['icon']=_0x3237c4,_0x272ac8['extendTemplate']({'attributes':{'class':'ck-comment--resolve'}}),_0x272ac8['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x35ba83=>!_0x35ba83),_0x272ac8['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x28c6f7,_0x2d3c99)=>_0x28c6f7&&!_0x2d3c99),_0x272ac8['on']('execute',()=>{this['fire']('resolveCommentThread',this['_model']['id']);}),_0x272ac8;}_updateArchivedThreadHeader(){this['_model']['archivedAt']?this['commentThreadChildren']['has'](this['commentThreadHeaderView'])||(this['commentThreadChildren']['add'](this['commentThreadHeaderView'],0x0),this['focusables']['add'](this['commentThreadHeaderView'],0x0)):this['commentThreadChildren']['has'](this['commentThreadHeaderView'])&&(this['commentThreadChildren']['remove'](this['commentThreadHeaderView']),this['focusables']['remove'](this['commentThreadHeaderView']));}},Wt=class extends ht{constructor(_0x54cc6){super(_0x54cc6),this['set']('content',''),this['setTemplate']({'tag':'div','attributes':{'class':['ck-content','ck-comment__content','ck-annotation__content']}});}['render'](){super['render'](),this['on']('change:content',(_0x12bc2e,_0x16194a,_0x33c37f)=>{this['element']['innerHTML']=_0x33c37f;}),this['element']['innerHTML']=this['content'];}},Kt=class extends ht{['visibleView'];ariaDescriptionView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];['_model'];['_config'];constructor(_0x1b97e7,_0x5bedd9,_0x255769){super(_0x1b97e7),this['_model']=_0x5bedd9,this['_config']=_0x255769,this['isSystemComment']=!!this['_config']['isSystemComment'],this['set']('isEditMode',!0x1),this['set']('isCollapsed',!0x0),this['bind']('ariaLabel')['to'](_0x5bedd9,'content',_0x5bedd9,'authoredAt',(_0x59fe68,_0xcb7ef4)=>Et(_0x1b97e7,'COMMENT_ARIA_LABEL',[_0x5bedd9['author']['name'],_0x255769['formatDateTime'](_0xcb7ef4),new DOMParser()['parseFromString'](_0x59fe68,'text/html')['body']['textContent'],_0x5bedd9['isExternal']?this['getExternalCommentNote']():''])),this['ariaDescriptionView']=new _0x5319be(_0x1b97e7,Et(_0x1b97e7,'COMMENT_THREAD_DESCRIPTION')),this['visibleView']=this['createCollection'](),this['visibleView']['add'](this['_createCommentContentView']()),this['focusables']=new at(),this['focusTracker']=new _0x4804cc(),this['keystrokes']=new _0x225c8d(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x1891f0=>_0x1891f0['target']!==this['element']},'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}});}['expand'](){this['isCollapsed']=!0x1;}['collapse'](){this['isEditMode']||(this['isCollapsed']=!0x0);}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['_setupKeyboardNavigation']();}async destroy(){await this['visibleView']['get'](0x0)['destroy'](),super['destroy']();}switchToEditMode(){this['isEditMode']||(this['isEditMode']=!0x0,this['visibleView']['remove'](0x0)['destroy'](),this['visibleView']['add'](this['_createCommentInputView']()));}switchToDisplayMode(){this['isEditMode']&&(this['isEditMode']=!0x1,this['visibleView']['remove'](0x0)['destroy'](),this['visibleView']['add'](this['_createCommentContentView']()));}getExternalCommentNote(){return'importWord'===this['_model']['attributes']['@external']['source']?Et(this['locale'],'EXTERNAL_IMPORT_WORD_COMMENT'):Et(this['locale'],'EXTERNAL_COMMENT');}getUserViewNotificationText(){return this['_model']['isExternal']?'importWord'===this['_model']['attributes']['@external']['source']?Et(this['locale'],'EXTERNAL_IMPORT_WORD_AVATAR',this['_model']['creator']['name']):Et(this['locale'],'EXTERNAL_AVATAR',this['_model']['creator']['name']):null;}_createCommentContentView(){const _0x42707b=new Wt(this['locale']);return _0x42707b['bind']('content')['to'](this['_model'],'content',this,'isCollapsed',(_0x2bb3e3,_0xe7e608)=>_0xe7e608?_0x1f45e6(_0x2bb3e3,{'limit':this['_config']['maxCommentCharsWhenCollapsed']}):_0x2bb3e3),_0x42707b;}_createCommentInputView(){this['_config']['editorConfig']||(this['_config']['editorConfig']={}),this['_config']['editorConfig']['initialData']=this['_model']['content'];const _0x490018=new St(this['locale'],this['_config']['editorConfig']);return _0x490018['value']=this['_model']['content'],_0x490018['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0x490018['submitLabel']=Et(this['locale'],'Save'),_0x490018['on']('submit',(_0x18df50,_0x1b9317)=>{this['fire']('updateComment',this['_model']['id'],_0x1b9317),this['switchToDisplayMode'](),this['focus']();}),_0x490018['on']('cancel',()=>{this['switchToDisplayMode'](),this['focus']();}),_0x490018['once']('editorReady',()=>{_0x490018['focus']();}),_0x490018['createEditor'](),_0x490018['delegate']('editorReady')['to'](this),_0x490018['delegate']('editorDestroyed')['to'](this),_0x490018;}_setupKeyboardNavigation(){const _0x15e512=this['element'];this['keystrokes']['listenTo'](_0x15e512);for(const _0x255d4f of this['focusables'])this['focusTracker']['add'](_0x255d4f['element']),this['keystrokes']['listenTo'](_0x255d4f['element']);this['focusables']['on']('change',(_0x4d2613,_0x74d6b3)=>{for(const _0x21a8fd of _0x74d6b3['removed'])this['focusTracker']['remove'](_0x21a8fd['element']),this['keystrokes']['stopListening'](_0x21a8fd['element']);for(const _0x12575b of _0x74d6b3['added'])this['focusTracker']['add'](_0x12575b['element']),this['keystrokes']['listenTo'](_0x12575b['element']);}),this['keystrokes']['set']('enter',(_0x627ff2,_0x287359)=>{_0x15e512===_0x627ff2['target']&&(this['focusCycler']['focusFirst'](),_0x287359());}),this['keystrokes']['set']('esc',(_0x382575,_0x484c97)=>{_0x15e512!==_0x382575['target']&&(this['focus'](),_0x484c97());});}};const Gt=/* #__PURE__ -- @preserve */
|
|
28
|
+
_0x327e2c(Kt);var Yt=class extends Gt{actionBar;['userView'];constructor(_0x14c354,_0x30bcf3,_0x2b5b55){super(_0x14c354,_0x30bcf3,_0x2b5b55),this['set']('actionIndicator',null),this['set']('placeholder',Et(_0x14c354,'Reply...')),this['bind']('authoredAt')['to'](_0x30bcf3),this['bind']('resolvedAt')['to'](_0x30bcf3),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 _0x29d00e(_0x14c354,_0x30bcf3['author'],this['getUserViewNotificationText']()),this['userView']['extendTemplate']({'attributes':{'class':['ck-comment__user','ck-annotation__user'],'aria-hidden':!0x0}}),this['listenTo'](_0x30bcf3,'change:isRemovable',()=>this['cancelConfirm']()),this['setTemplate'](this['getTemplate']());}getTemplate(){const _0x25b980=this['bindTemplate'],_0x33b3d2=[{'tag':'div','attributes':{'class':['ck-comment__info','ck-annotation__info']},'children':[{'tag':'span','children':[{'text':this['userView']['name']}],'attributes':{'class':['ck-comment__info-name','ck-annotation__info-name'],'data-cke-tooltip-text':this['userView']['name']}},{'tag':'time','attributes':{'datetime':_0x25b980['to']('authoredAt'),'class':['ck-comment__info-time','ck-annotation__info-time']},'children':[{'text':_0x25b980['to']('authoredAt',_0x7c0640=>this['_config']['formatDateTime'](_0x7c0640))}]}]},{'tag':'div','attributes':{'class':['ck-comment__actions','ck-annotation__actions',_0x25b980['if']('isEditMode','ck-comment__actions--hidden'),_0x25b980['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']&&_0x33b3d2['push']({'tag':'div','attributes':{'class':['ck-comment__external']},'children':[{'text':this['getExternalCommentNote']()}]}),{'tag':'li','attributes':{'class':['ck-comment__wrapper'],'tabindex':-0x1,'aria-label':_0x25b980['to']('ariaLabel'),'aria-describedby':this['ariaDescriptionView']['id'],'role':'listitem'},'children':[{'tag':'div','attributes':{'class':['ck-comment','ck-annotation',_0x25b980['if']('isEditMode','ck-comment--edit'),_0x25b980['if']('isSystemComment','ck-comment--info'),_0x25b980['to']('actionIndicator',_0x2434d1=>_0x2434d1?'ck-comment--'+_0x2434d1:'')],'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':_0x33b3d2}]}]};}_createEditButton(){const _0x57ba1c=new _0x422b1d(this['locale']);return _0x57ba1c['label']=Et(this['locale'],'Edit'),_0x57ba1c['icon']=_0x38ac55,_0x57ba1c['withText']=!0x0,_0x57ba1c['extendTemplate']({'attributes':{'class':'ck-comment--edit'}}),_0x57ba1c['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x1e2b97=>!_0x1e2b97),_0x57ba1c['bind']('isVisible')['to'](this['_model'],'isEditable'),_0x57ba1c['on']('execute',()=>this['switchToEditMode']()),_0x57ba1c;}_createRemoveButton(){const _0x1b48c1=new _0x422b1d(this['locale']);return _0x1b48c1['label']=Et(this['locale'],'Remove'),_0x1b48c1['icon']=_0x52171e,_0x1b48c1['withText']=!0x0,_0x1b48c1['extendTemplate']({'attributes':{'class':'ck-comment--remove'}}),_0x1b48c1['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x433697=>!_0x433697),_0x1b48c1['bind']('isVisible')['to'](this['_model'],'isRemovable'),_0x1b48c1['on']('execute',()=>{this['showConfirm'](Et(this['locale'],'Delete\x20comment?'),this['element'])['then'](()=>{this['fire']('removeComment',this['_model']['id']);});}),_0x1b48c1;}_createDropdown(){const _0x2b9f86=ct(this['locale'],_0x1dc2cf),_0x520869=_0x2b9f86['panelView']['children'],_0x2aab17=new ot(this['locale']),_0x4d4c96=_0x2b9f86['bindTemplate'];dt(_0x2b9f86,()=>this['items']['find'](_0x62eb21=>_0x62eb21['isVisible'])),_0x2b9f86['extendTemplate']({'attributes':{'class':[_0x4d4c96['if']('isVisible','ck-hidden',_0x8c379c=>!_0x8c379c)]}});const _0x2463dc=(_0xde8bfc,_0x5e56f1=-0x1)=>{const _0x2da68f=new nt(this['locale']);_0x2da68f['children']['add'](_0xde8bfc);const _0x140572=_0x5e56f1>-0x1?_0x5e56f1:_0x2aab17['items']['length'];_0x2aab17['items']['add'](_0x2da68f,_0x140572);const _0x54ae05=Array['from'](this['items']);_0x2b9f86['unbind']('isEnabled','isVisible'),_0x2b9f86['bind']('isEnabled')['toMany'](_0x54ae05,'isEnabled',(..._0x3028f9)=>_0x3028f9['some'](_0x3285f1=>_0x3285f1)),_0x2b9f86['bind']('isVisible')['toMany'](_0x54ae05,'isVisible',(..._0x7e0e2f)=>_0x7e0e2f['some'](_0x3105bc=>_0x3105bc));};_0x2b9f86['panelPosition']='sw',_0x2b9f86['buttonView']['set']({'label':Et(this['locale'],'Show\x20more\x20items'),'icon':_0x2c70f9});for(const _0x444b8b of this['items'])_0x2463dc(_0x444b8b);return _0x520869['add'](_0x2aab17),_0x2b9f86['listenTo'](this['items'],'add',(_0x31c259,_0xa67ad8,_0x1aada8)=>{_0x2463dc(_0xa67ad8,_0x1aada8);}),_0x2b9f86['listenTo'](this['items'],'remove',(_0x53c8ee,_0x1a10e6,_0x239407)=>{_0x2aab17['items']['remove'](_0x239407);}),_0x2b9f86;}_attachActions(_0x603f81,_0x332d3b){const _0xbba5db=_0x603f81&&_0x603f81['element'];_0xbba5db&&(this['listenTo'](_0xbba5db,'mouseenter',()=>this['actionIndicator']=_0x332d3b),this['listenTo'](_0xbba5db,'focus',()=>this['actionIndicator']=_0x332d3b),this['listenTo'](_0xbba5db,'mouseleave',()=>this['actionIndicator']=null),this['listenTo'](_0xbba5db,'blur',()=>this['actionIndicator']=null));}_createCommentInputView(){const _0x36d0b3=super['_createCommentInputView']();return _0x36d0b3['bind']('placeholder')['to'](this),_0x36d0b3;}['render'](){super['render'](),this['_attachActions'](this['editButton'],'edit'),this['_attachActions'](this['removeButton'],'remove');}};function Xt(_0x2262f2){const _0x4f9996=_0xdb138e(_0x2262f2,0x1e),_0x3078ce=new MutationObserver(_0x17fe03=>{for(const _0x3bf8ae of _0x17fe03)('attributes'==_0x3bf8ae['type']&&'class'==_0x3bf8ae['attributeName']||'childList'==_0x3bf8ae['type']||'characterData'==_0x3bf8ae['type'])&&_0x4f9996();});return{'attach'(_0x5dca7c){_0x3078ce['observe'](_0x5dca7c,{'attributes':!0x0,'childList':!0x0,'subtree':!0x0,'characterData':!0x0});},'detach'(){_0x3078ce['disconnect'](),_0x4f9996['cancel']();}};}var qt=class extends ht{['focusTracker'];['id'];keystrokes;content;['mainView'];_mutationObserver;constructor(_0x34b28d,_0x57e9f3){super(_0x34b28d),this['id']=_0x185ea0(),this['focusTracker']=new _0x4804cc(),this['keystrokes']=new _0x225c8d(),this['keystrokes']['set']('Esc',(_0x255497,_0x419cb8)=>this['fire']('Esc',_0x419cb8)),this['set']('targetRect',{'top':0x0,'right':0x0,'bottom':0x0,'left':0x0}),this['set']('height',0x0),this['set']('isActive',!0x1),this['set']('isDirty',!0x1),this['set']('length',0x0),this['set']('type',''),this['_mutationObserver']=Xt(()=>this['_updateHeight']()),this['content']=this['createCollection'](),this['content']['delegate']('arrowup','arrowdown')['to'](this),this['content']['add'](_0x57e9f3),this['mainView']=_0x57e9f3;const _0x1eaf6e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-annotation-wrapper','ck-rounded-corners',_0x1eaf6e['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 _0x174be4=this['element']['clientHeight'];_0x174be4&&(this['height']=_0x174be4);}};const jt=/* #__PURE__ -- @preserve */
|
|
29
|
+
_0x1bcd46();var $t=class Annotation extends jt{['view'];focusableElements;_type;_target;constructor({view:_0x2c2b5a,target:_0x14142e,type:_0x25f38a,isVisible:_0x47a679=!0x0}){super(),this['view']=_0x2c2b5a,this['view']['element']||this['view']['render'](),this['_type']=_0x25f38a,this['_target']=_0x14142e,Annotation['_assertCorrectTarget'](this['_getNormalizedTarget']()),this['focusableElements']=new _0x5d687e([this['view']['element']],{'idProperty':'_id'}),this['focusableElements']['on']('add',(_0x50db16,_0x3c5ce6)=>{this['view']['focusTracker']['add'](_0x3c5ce6);}),this['focusableElements']['on']('remove',(_0x11d72e,_0x2fabff)=>{this['view']['focusTracker']['remove'](_0x2fabff);}),this['set']('isVisible',_0x47a679);}get type(){return'function'==typeof this['_type']?this['_type']():this['_type'];}get['innerView'](){return this['view']['mainView'];}get target(){const _0x860d9b=this['_getNormalizedTarget']();return Annotation['_assertCorrectTarget'](_0x860d9b),_0x860d9b;}get targetRect(){const _0x1b525b=this['target'];if(null===_0x1b525b)return null;if(_0x1b525b instanceof _0x1f4f60)return _0x1b525b;const _0x19dc3a=_0x1b525b['filter'](_0x4fee4d=>function(_0x564f02){return!!_0x564f02['offsetParent']||!!_0x564f02['getClientRects']()['item'](0x0);}(_0x4fee4d));return 0x0===_0x19dc3a['length']?null:_0x1f4f60['getDomElementRects'](_0x19dc3a[0x0])[0x0];}get isActive(){return this['view']['isActive'];}set isActive(_0x2904a9){this['view']['isActive']=_0x2904a9,this['view']['mainView']['isActive']=_0x2904a9;}updateTargetRect(){this['view']['targetRect']=this['targetRect'];}destroy(){this['focusableElements']['stopListening'](),this['focusableElements']['clear'](),this['stopListening']();}refreshVisibility(){this['isVisible']=!!this['targetRect'];}static _assertCorrectTarget(_0x6190ac){if(!(null===_0x6190ac||_0x6190ac instanceof _0x1f4f60||Array['isArray'](_0x6190ac)&&_0x6190ac['every'](_0x3556bc=>zt(_0x3556bc))))throw new _0x3fd207('annotation-invalid-target',null,{'target':_0x6190ac});}_getNormalizedTarget(){const _0x41d226='function'==typeof this['_target']?this['_target']():this['_target'];return zt(_0x41d226)?[_0x41d226]:_0x41d226;}};function zt(_0x359e58){return null!==_0x359e58&&'object'==typeof _0x359e58&&'nodeType'in _0x359e58&&0x1===_0x359e58['nodeType'];}var Jt=class extends _0x5d687e{_innerViewToAnnotation;_viewToAnnotation;['_focusTracker'];constructor(_0x11858b=[]){super(),this['_innerViewToAnnotation']=new Map(),this['_viewToAnnotation']=new Map(),this['_focusTracker']=new _0x4804cc(),this['_focusTracker']['on']('change:isFocused',(_0x27631a,_0x5a2985,_0x531253)=>{_0x531253||this['fire']('blur');});for(const _0x16eda9 of _0x11858b)this['add'](_0x16eda9);}get['isFocused'](){return this['_focusTracker']['isFocused'];}['add'](_0x564da4){if(this['has'](_0x564da4))throw new _0x3fd207('annotationcollection-duplicated-item',null);this['_innerViewToAnnotation']['set'](_0x564da4['innerView'],_0x564da4),this['_viewToAnnotation']['set'](_0x564da4['view'],_0x564da4);for(const _0xfd4a7c of _0x564da4['focusableElements'])this['_focusTracker']['add'](_0xfd4a7c);if(this['listenTo'](_0x564da4['focusableElements'],'add',(_0x6a0871,_0x2a8f13)=>{this['_focusTracker']['add'](_0x2a8f13);}),this['listenTo'](_0x564da4['focusableElements'],'remove',(_0x44651b,_0x1d54d2)=>{this['_focusTracker']['remove'](_0x1d54d2);}),this['listenTo'](_0x564da4['view']['focusTracker'],'change:isFocused',(_0x3d6a23,_0x161ec6,_0x4948b5)=>{_0x4948b5&&this['fire']('focus',_0x564da4);}),_0x564da4['updateTargetRect'](),this['_areCachedRectsStale']()){for(const _0x29eb1b of this)_0x29eb1b['updateTargetRect']();}const _0xa857c5=this['_getOrderInContent'](_0x564da4['view']['targetRect']);return super['add'](_0x564da4,_0xa857c5);}['remove'](_0x251505){if(!this['has'](_0x251505))throw new _0x3fd207('annotationcollection-not-existing-item',null);this['stopListening'](_0x251505['view']['focusTracker']),this['stopListening'](_0x251505['focusableElements']);for(const _0x3fefac of _0x251505['focusableElements'])this['_focusTracker']['remove'](_0x3fefac);return this['_viewToAnnotation']['delete'](_0x251505['view']),this['_innerViewToAnnotation']['delete'](_0x251505['innerView']),super['remove'](_0x251505);}getByInnerView(_0x31bd88){return this['_innerViewToAnnotation']['get'](_0x31bd88);}getByView(_0x5a4e97){return this['_viewToAnnotation']['get'](_0x5a4e97);}destroy(){super['clear'](),this['stopListening'](),this['_innerViewToAnnotation']['clear'](),this['_viewToAnnotation']['clear'](),this['_focusTracker']['destroy']();}refreshPositioning(){for(const _0xc316c8 of this)_0xc316c8['updateTargetRect']();this['_sort']();}_sort(){const _0x1d725f=Array['from'](this)['sort']((_0x363a53,_0x59f909)=>Zt(_0x363a53['view']['targetRect'],_0x59f909['view']['targetRect']));for(let _0x2393f9=_0x1d725f['length']-0x1;_0x2393f9>0x0;_0x2393f9--){const _0x244e30=_0x1d725f[_0x2393f9];_0x2393f9!==this['getIndex'](_0x244e30)&&(this['remove'](_0x244e30),this['add'](_0x244e30));}}_getOrderInContent(_0x11f695){let _0x4957c4=0x0;if(!_0x11f695)return this['length'];for(const _0x5c465c of this){const _0x193c5c=_0x5c465c['view']['targetRect'];if(_0x193c5c){if(Zt(_0x11f695,_0x193c5c)<0x0)return _0x4957c4;_0x4957c4++;}}return _0x4957c4;}_areCachedRectsStale(){const _0x273ca2=this['get'](0x0);if(!_0x273ca2)return!0x1;const _0x3f80b7=_0x273ca2['view']['targetRect'],_0x30c59f=_0x273ca2['targetRect'];return!(!_0x3f80b7||!_0x30c59f)&&(_0x3f80b7['top']!==_0x30c59f['top']||_0x3f80b7['left']!==_0x30c59f['left']);}};function Qt({source:_0x59f035,target:_0x5bb0f3,filter:_0x508ac7}){for(const _0x5a1f58 of _0x59f035)_0x508ac7(_0x5a1f58)&&_0x5bb0f3['add'](_0x5a1f58);_0x5bb0f3['listenTo'](_0x59f035,'add',(_0x2c23ba,_0x39c0a3)=>{_0x508ac7(_0x39c0a3)&&_0x5bb0f3['add'](_0x39c0a3);}),_0x5bb0f3['listenTo'](_0x59f035,'remove',(_0x4653fe,_0x45f2f6)=>{_0x5bb0f3['has'](_0x45f2f6)&&_0x5bb0f3['remove'](_0x45f2f6);});}function Zt(_0x288449,_0x515904){if(null===_0x288449&&null===_0x515904)return 0x0;if(null===_0x288449)return-0x1;if(null===_0x515904)return 0x1;const _0x450b16=_0x288449['top']-_0x515904['top'];return 0x0==_0x450b16?_0x288449['left']-_0x515904['left']:_0x450b16;}var ti=class extends _0xe32c07{collection;_visibleAnnotations;static get['pluginName'](){return'Annotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2ca6c9){if(super(_0x2ca6c9),this['collection']=new Jt(),this['_visibleAnnotations']=new Jt(),this['set']('activeAnnotations',new Set()),this['_bindAnnotationsToVisibleAnnotations'](),_0x2ca6c9 instanceof _0x458c52){const _0x30f70b=_0x2ca6c9['locale'];_0x2ca6c9['accessibility']['addKeystrokeInfoGroup']({'id':'annotations','label':Et(_0x30f70b,'ACCESSIBILITY_HELP_ANNOTATIONS_GROUP'),'keystrokes':[{'label':Et(_0x30f70b,'ACCESSIBILITY_HELP_ANNOTATIONS_MOVE_TO'),'keystroke':'Ctrl+Shift+E'},{'label':Et(_0x30f70b,'ACCESSIBILITY_HELP_ANNOTATIONS_EXIT'),'keystroke':'Esc'},{'label':Et(_0x30f70b,'ACCESSIBILITY_HELP_ANNOTATIONS_ENTER'),'keystroke':'Enter'},{'label':Et(_0x30f70b,'ACCESSIBILITY_HELP_ANNOTATIONS_BROWSE_GROUPS'),'keystroke':[['Tab'],['Shift+Tab']]},{'label':Et(_0x30f70b,'ACCESSIBILITY_HELP_ANNOTATIONS_SUBMIT_COMMENT'),'keystroke':['Ctrl+Enter']},{'label':Et(_0x30f70b,'ACCESSIBILITY_HELP_ANNOTATIONS_NAVIGATE_THREADS'),'keystroke':[['Arrowup'],['Arrowdown']]}]});}this['_setupEnterAnnotationKeystroke'](),this['_setupEscapeAnnotationHandling']();}['add'](_0x4f3a64){this['collection']['add'](_0x4f3a64);}['remove'](_0x531b9c){this['collection']['remove'](_0x531b9c),_0x531b9c['destroy']();}refreshVisibility(){for(const _0x42d96a of this['collection'])_0x42d96a['refreshVisibility']();}refreshPositioning(){this['_visibleAnnotations']['refreshPositioning']();}getByInnerView(_0x3e70cf){return this['collection']['getByInnerView'](_0x3e70cf);}deactivateAll(){this['fire']('_deactivateAllAnnotations');}destroy(){for(const _0x29f870 of this['collection'])_0x29f870['destroy']();this['_visibleAnnotations']['destroy'](),this['collection']['destroy'](),super['destroy']();}activate(_0x51d9e3){this['fire']('_activateAnnotation',_0x51d9e3);}createAnnotation(_0x6e1a62){return new $t(_0x6e1a62);}createAnnotationView(_0x191de1,_0x1e5a83){return new qt(_0x191de1,_0x1e5a83);}_addActiveAnnotation(_0x3936d2){const _0x585191=new Set(this['activeAnnotations']);_0x585191['add'](_0x3936d2),this['activeAnnotations']=_0x585191;}_removeActiveAnnotation(_0x5839fc){const _0x3a6649=new Set(this['activeAnnotations']);_0x3a6649['delete'](_0x5839fc),this['activeAnnotations']=_0x3a6649;}_bindAnnotationsToVisibleAnnotations(){const _0x2d8880=this['collection'],_0x570f44=this['_visibleAnnotations'];function _0x435994(_0x59fe79){const _0x2eabf7=_0x59fe79['source'];_0x2eabf7['isVisible']&&!_0x570f44['has'](_0x2eabf7)?_0x570f44['add'](_0x2eabf7):!_0x2eabf7['isVisible']&&_0x570f44['has'](_0x2eabf7)&&_0x570f44['remove'](_0x2eabf7),_0x2eabf7['view']['focusTracker']['remove'](_0x2eabf7['view']['element']),_0x2eabf7['view']['focusTracker']['add'](_0x2eabf7['view']['element']);}this['listenTo'](_0x2d8880,'add',(_0x55f14f,_0x52a73d)=>{_0x52a73d['isVisible']&&_0x570f44['add'](_0x52a73d),this['listenTo'](_0x52a73d,'change:isVisible',_0x435994);}),this['listenTo'](_0x2d8880,'remove',(_0x25ceab,_0x2664dc)=>{_0x570f44['has'](_0x2664dc)&&_0x570f44['remove'](_0x2664dc),this['stopListening'](_0x2664dc,'change:isVisible',_0x435994);});}_setupEnterAnnotationKeystroke(){const _0x534a67=_0x1eceb5=>{_0x1eceb5['on']('ready',()=>{_0x1eceb5['keystrokes']['set'](_0x14d518,(_0x2ef573,_0x191edb)=>{const _0x1da2d5=_0x9ba8a7(this['activeAnnotations']['values']());_0x1da2d5&&(_0x1da2d5['view']['focus'](),_0x191edb());});});};this['context']instanceof _0x458c52?_0x534a67(this['context']):this['context']['editors']&&this['context']['editors']['on']('add',(_0x277f26,_0x164b20)=>{_0x534a67(_0x164b20);});}_setupEscapeAnnotationHandling(){const _0x541f3a=_0xcc5e4f=>{const _0x122230=_0xcc5e4f['source'],_0xc77d7e=[];let _0x251779;if(Array['isArray'](_0x122230['target'])){_0x251779=_0x122230['target'][0x0],this['context']instanceof _0x458c52?_0xc77d7e['push'](this['context']):this['context']['editors']&&_0xc77d7e['push'](...this['context']['editors']);for(const _0x5e0ea6 of _0xc77d7e)for(const _0x448f58 of _0x5e0ea6['editing']['view']['domRoots']['values']())if(_0x448f58['contains'](_0x251779))return void _0x5e0ea6['editing']['view']['focus']();_0x251779['focus']();}};this['listenTo'](this['collection'],'add',(_0x1dfe59,_0x38f8fd)=>{this['listenTo'](_0x38f8fd,'escape',_0x541f3a,{'priority':'low'});}),this['listenTo'](this['collection'],'remove',(_0x133ec9,_0x4c4452)=>{this['stopListening'](_0x4c4452,'escape',_0x541f3a);});}};const ii=Symbol('noChannel'),ei={'admin':!0x0,'modifyAll':!0x1,'write':!0x0,'resolve':!0x0},si=/* #__PURE__ -- @preserve */
|
|
30
|
+
_0x1bcd46(),ni=/* #__PURE__ -- @preserve */
|
|
31
|
+
_0x1bcd46();var oi=class extends _0xe32c07{_threads;_threadToController;_viewToController;static get requires(){return[ti,_0x24dddb,_0x23b29b];}static get['pluginName'](){return'CommentsRepository';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x24f841){super(_0x24f841),this['_threads']=new Map(),this['_threadToController']=new Map(),this['_viewToController']=new Map(),this['set']('_readOnlyChannels',new Set()),this['set']('_permissions',new Map());const _0x564a18=this['context']['config'];_0x564a18['define']('comments.maxCommentsWhenCollapsed',0x2),_0x564a18['define']('comments.maxThreadTotalWeight',0x1f4),_0x564a18['define']('comments.maxCommentCharsWhenCollapsed',0x8c),_0x564a18['define']('comments.CommentThreadView',Ut),_0x564a18['define']('comments.CommentView',Yt),_0x564a18['get']('comments.editorConfig')||console['warn']('Missing\x20comments\x20editor\x20configuration\x20(`comments.editorConfig`).\x20Default\x20configuration\x20will\x20be\x20used\x20instead.');}init(){const _0x176a8f=this['context']['plugins']['get'](ti);this['set']('activeCommentThread',null),this['on']('addCommentThread',(_0x5cf516,_0x51f02e)=>this['_addCommentThread'](_0x51f02e)),this['on']('submitCommentThread',(_0x2457f1,_0x3b0c18)=>this['_submitCommentThread'](_0x3b0c18)),this['on']('resolveCommentThread',(_0x5d20ec,_0x1965d9)=>this['_resolveCommentThread'](_0x1965d9)),this['on']('resolveCommentThread',(_0x1969e3,_0x392f13)=>this['_updateActiveAnnotation'](_0x392f13),{'priority':'lowest'}),this['on']('reopenCommentThread',(_0x55a40c,_0x39a68f)=>this['_reopenCommentThread'](_0x39a68f)),this['on']('reopenCommentThread',(_0x4da64a,_0x4e050a)=>this['_updateActiveAnnotation'](_0x4e050a),{'priority':'lowest'}),this['on']('removeCommentThread',(_0x300f2b,_0x3fff61)=>this['_removeCommentThread'](_0x3fff61)),this['on']('updateCommentThread',(_0x2e3562,_0x37b2f7)=>this['_updateCommentThread'](_0x37b2f7)),this['on']('updateCommentThread',(_0x519269,_0x4a34b6)=>this['_updateActiveAnnotation'](_0x4a34b6),{'priority':'lowest'}),this['on']('addComment',(_0x336d0d,_0x4a13e6)=>this['_addComment'](_0x4a13e6)),this['on']('updateComment',(_0x1313ce,_0x595d14)=>this['_updateComment'](_0x595d14)),this['on']('removeComment',(_0xe3b55f,_0x3bb5ce)=>this['_removeComment'](_0x3bb5ce)),this['on']('addComment',(_0x4967e9,{threadId:_0x2b913b,isFromAdapter:_0x5a0894})=>{if(_0x5a0894)return;const _0x154add=this['getCommentThread'](_0x2b913b),_0x52b2f0=_0x154add&&this['_threadToController']['get'](_0x154add);_0x52b2f0&&_0x52b2f0['view']['commentsListView']['focus'](-0x1);},{'priority':'lowest'}),this['listenTo'](_0x176a8f,'change:activeAnnotations',(_0x1b31fe,_0x5f7317,_0x4dc2d1)=>{const _0x5cf8ad=Array['from'](_0x4dc2d1)['map'](_0x22a773=>this['_viewToController']['get'](_0x22a773['innerView']))['filter'](Boolean)[0x0];this['activeCommentThread']=_0x5cf8ad?_0x5cf8ad['model']:null;});}set adapter(_0x1c54f5){if(this['_adapter'])throw new _0x3fd207('commentsrepository-adapter-already-set');this['_adapter']=_0x1c54f5;}get adapter(){return this['_adapter'];}addCommentThread({channelId:_0x2c2036=ii,threadId:_0x14c980=_0x185ea0(),comments:_0xf89ebc=[],unlinkedAt:_0x5c9bb5=null,resolvedAt:_0x2df93b=null,resolvedBy:_0x82ebe4=null,target:_0x2e45ee=null,context:_0x346d68=null,attributes:_0x185448={},isResolvable:_0x20967c=!0x0,isSubmitted:_0x55fa9b=!0x1,isFromAdapter:_0x3b8a44=!0x1}={}){return this['fire'](ai('addCommentThread',_0x2c2036),{'channelId':_0x2c2036,'threadId':_0x14c980,'comments':_0xf89ebc,'unlinkedAt':_0x5c9bb5,'resolvedAt':_0x2df93b,'resolvedBy':_0x82ebe4,'target':_0x2e45ee,'context':_0x346d68,'attributes':_0x185448,'isFromAdapter':_0x3b8a44,'isResolvable':_0x20967c,'isSubmitted':_0x55fa9b}),this['getCommentThread'](_0x14c980);}openNewCommentThread({channelId:_0x188ebc=ii,threadId:_0x41dea7=_0x185ea0(),target:_0x3b933f,context:_0x346434=null,isResolvable:_0xc1d47b=!0x0}){if(this['_readOnlyChannels']['has'](_0x188ebc)||this['_readOnlyChannels']['has'](void 0x0))return null;if(!_0x3b933f)throw new _0x3fd207('commentsrepository-missing-target');const _0x51baf5=this['addCommentThread']({'channelId':_0x188ebc,'threadId':_0x41dea7,'target':_0x3b933f,'context':_0x346434,'isResolvable':_0xc1d47b});if(!_0x51baf5)return null;const _0x5eb87a=this['_threadToController']['get'](_0x51baf5),_0x56fcfb=_0x5eb87a['view']['commentThreadInputView']['commentInputView'],_0x2a4a3e=this['context']['plugins']['get'](ti),_0x55ed11=_0x2a4a3e['getByInnerView'](_0x5eb87a['view']);return _0x2a4a3e['activate'](_0x55ed11),_0x56fcfb['once']('editorReady',()=>_0x56fcfb['focus']()),_0x51baf5;}hasCommentThread(_0x192410){if('string'!=typeof _0x192410)throw new _0x3fd207('commentsrepository-invalid-comment-thread-id');return this['_threads']['has'](_0x192410);}updateCommentThread({channelId:_0x524708=ii,threadId:_0x4cabfb,context:_0x52b679,unlinkedAt:_0x1ce96,attributes:_0x49fb0f,isFromAdapter:_0x297396=!0x1}){return this['fire'](ai('updateCommentThread',_0x524708),{'channelId':_0x524708,'threadId':_0x4cabfb,'context':_0x52b679,'unlinkedAt':_0x1ce96,'attributes':_0x49fb0f,'isFromAdapter':_0x297396}),this['getCommentThread'](_0x4cabfb);}getCommentThread(_0x6118a1){if('string'!=typeof _0x6118a1)throw new _0x3fd207('commentsrepository-invalid-comment-thread-id');return this['_threads']['get'](_0x6118a1);}fetchCommentThread({channelId:_0x34f961,threadId:_0x4a2a7c}={}){const _0x589afe=this['getCommentThread'](_0x4a2a7c);if(_0x589afe)return Promise['resolve'](_0x589afe);if(!this['adapter'])return Promise['resolve'](void 0x0);if('function'!=typeof this['adapter']['getCommentThread'])throw new _0x3fd207('commentsrepository-missing-thread-and-adapter-method',this['context']);return this['adapter']['getCommentThread']({'channelId':_0x34f961,'threadId':_0x4a2a7c})['then'](_0x1fca77=>this['hasCommentThread'](_0x4a2a7c)?this['getCommentThread'](_0x4a2a7c):_0x1fca77?this['addCommentThread'](Object['assign']({'isFromAdapter':!0x0,'channelId':_0x34f961},_0x1fca77)):void 0x0)['catch'](_0xdfc986=>{throw console['error'](_0xdfc986),new _0x3fd207('commentsrepository-fetch-comment-thread',this['context']);});}getCommentThreads({channelId:_0x3f21da,skipNotAttached:_0x37cb36=!0x1,skipEmpty:_0x31e879=!0x1,toJSON:_0x3462fb=!0x1}={}){const _0x2d8635=[];for(const _0x15e613 of this['_threads']['values']())_0x3f21da&&_0x15e613['channelId']!==_0x3f21da||_0x37cb36&&!_0x15e613['isAttached']||_0x31e879&&0x0===_0x15e613['length']||_0x2d8635['push'](_0x15e613);return _0x3462fb?_0x2d8635['map'](_0xb08269=>_0xb08269['toJSON']()):_0x2d8635;}getAnnotationForCommentThread(_0x281c38){const _0x1bdea9=this['_threadToController']['get'](_0x281c38);return _0x1bdea9&&this['context']['plugins']['get'](ti)['getByInnerView'](_0x1bdea9['view'])||null;}getCommentThreadForAnnotation(_0x57d463){const _0x3cee23=this['_viewToController']['get'](_0x57d463['innerView']);return _0x3cee23?_0x3cee23['model']:null;}setActiveCommentThread(_0x110b1d){const _0x2fc8fd=this['context']['plugins']['get'](ti);if(!_0x110b1d)return void(this['activeCommentThread']&&_0x2fc8fd['deactivateAll']());const _0x16213f=this['getCommentThread'](_0x110b1d);if(!_0x16213f)throw new _0x3fd207('commentsrepository-active-missing-comment-thread',null,{'threadId':_0x110b1d});if(!this['_threadToController']['has'](_0x16213f))throw new _0x3fd207('commentsrepository-active-not-attached',null,{'threadId':_0x110b1d});const _0x5468c8=_0x2fc8fd['getByInnerView'](this['_threadToController']['get'](_0x16213f)['view']);_0x2fc8fd['activate'](_0x5468c8);}switchReadOnly(_0x3234a8,_0x59b05e){_0x3234a8?this['_readOnlyChannels']['add'](_0x59b05e):this['_readOnlyChannels']['delete'](_0x59b05e),this['fire']('change:_readOnlyChannels','_readOnlyChannels',this['_readOnlyChannels'],this['_readOnlyChannels']);}['isReadOnly'](_0x5a846e){return this['_readOnlyChannels']['has'](_0x5a846e)||this['_readOnlyChannels']['has'](void 0x0);}createCommentThreadController(_0x1fbf51,_0x4f284b){return new bt(_0x1fbf51,_0x4f284b);}setPermissions(_0x5de380,_0x39cd73=ii){this['_permissions']['set'](_0x39cd73,_0x5de380),this['fire']('change:_permissions','_permissions',this['_permissions'],this['_permissions']);}getPermissions(_0x34ace2=ii){return this['_permissions']['has'](_0x34ace2)?this['_permissions']['get'](_0x34ace2):ei;}_addCommentThread({channelId:_0x3aab75,threadId:_0x310a39,comments:_0x4270e7,unlinkedAt:_0x1a1e3e,resolvedAt:_0x192fa6,resolvedBy:_0x4ecaf4,target:_0x21d475,context:_0x3e37ee,attributes:_0x43b738,isFromAdapter:_0x30d718,isResolvable:_0x5f421a,isSubmitted:_0x867fd1}){if('string'!=typeof _0x310a39)throw new _0x3fd207('commentsrepository-invalid-comment-thread-id',null,{'threadId':_0x310a39});if(this['hasCommentThread'](_0x310a39))throw new _0x3fd207('commentsrepository-duplicated-comment-thread-id',null,{'threadId':_0x310a39});const _0x4911ae=new ri(this,{'channelId':_0x3aab75,'id':_0x310a39,'context':_0x3e37ee,'attributes':_0x43b738,'unlinkedAt':_0x1a1e3e,'resolvedAt':_0x192fa6,'resolvedBy':_0x4ecaf4?this['context']['plugins']['get'](_0x23b29b)['getUser'](_0x4ecaf4):null,'isResolvable':_0x5f421a,'isSubmitted':_0x867fd1||_0x30d718});this['_threads']['set'](_0x310a39,_0x4911ae);for(const _0xdbe1cd of _0x4270e7)_0x4911ae['_add'](this['_createNewComment']({'threadId':_0x310a39,..._0xdbe1cd}));return _0x21d475&&_0x4911ae['attachTo'](_0x21d475),_0x30d718||!_0x4911ae['length']?Promise['resolve']():this['_submitCommentThread']({'channelId':_0x3aab75,'threadId':_0x310a39});}_submitCommentThread({channelId:_0x2d5a17,threadId:_0x3c104a}){if(!this['hasCommentThread'](_0x3c104a))throw new _0x3fd207('commentsrepository-missing-comment-thread',this);const _0x50807e=this['getCommentThread'](_0x3c104a);if(_0x50807e['_isSubmitted']=!0x0,!this['adapter']||'function'!=typeof this['adapter']['addCommentThread'])return Promise['resolve']();const {id:_0x42355b,comments:_0x3b7a66,resolvedAt:_0x195599,resolvedBy:_0x53c89f,context:_0xb5b81f,attributes:_0x149621}=_0x50807e,_0x1f9467=this['context']['plugins']['get']('PendingActions'),_0x41f951=_0x1f9467['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['addCommentThread']({'channelId':_0x2d5a17,'threadId':_0x42355b,'comments':_0x3b7a66['map'](_0x4aefdd=>_0x4aefdd['toJSON']()),'resolvedAt':_0x195599,'resolvedBy':_0x53c89f?_0x53c89f['id']:_0x53c89f,'context':_0xb5b81f,'attributes':_0x149621})['then'](({comments:_0x56b1db})=>{_0x1f9467['remove'](_0x41f951);for(const _0x2bab1d of _0x56b1db)this['_updateComment']({'channelId':_0x2d5a17,'threadId':_0x3c104a,'commentId':_0x2bab1d['commentId'],'createdAt':_0x2bab1d['createdAt'],'isFromAdapter':!0x0});})['catch'](_0x2b0646=>{throw console['error'](_0x2b0646),new _0x3fd207('commentsrepository-add-comment-thread-internal-error',this);});}_attachCommentThread({threadId:_0x5b5c43,target:_0x532854}){const _0x219eb4=this['getCommentThread'](_0x5b5c43);if(!_0x219eb4)throw new _0x3fd207('commentsrepository-attach-missing-comment-thread',this);const _0x271389=this['context']['plugins']['get']('PendingActions'),_0x488cac=this['context']['plugins']['get'](ti),_0x177b14=this['_createCommentThreadView'](_0x219eb4),_0x36dc61=new bt(_0x219eb4,_0x177b14);let _0x606565=null;_0x177b14['on']('change:isDirty',(_0x1cec8c,_0x3cf6b3,_0x5d14cc)=>{_0x5d14cc?_0x606565=_0x271389['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD')):_0x606565&&(_0x271389['remove'](_0x606565),_0x606565=null);}),this['_threadToController']['set'](_0x219eb4,_0x36dc61),this['_viewToController']['set'](_0x177b14,_0x36dc61);const _0x35f3f9=new qt(this['context']['locale'],_0x177b14);_0x35f3f9['bind']('length')['to'](_0x177b14),_0x35f3f9['bind']('isDirty')['to'](_0x177b14,'isDirty',_0x177b14,'length',(_0x1268eb,_0x167e10)=>_0x1268eb||!_0x167e10),_0x35f3f9['bind']('isActive')['to'](_0x177b14),_0x35f3f9['type']='comment';const _0x5b363e=new $t({'view':_0x35f3f9,'target':_0x532854,'type':'comment','isVisible':!_0x219eb4['archivedAt']&&!!('function'==typeof _0x532854?_0x532854():_0x532854)});return _0x177b14['on']('escape',()=>{_0x5b363e['fire']('escape');}),this['_bindAnnotationToEditors'](_0x177b14,_0x5b363e),_0x488cac['add'](_0x5b363e),_0x5b363e;}_bindAnnotationToEditors(_0x2812b0,_0x1dc1ba){this['listenTo'](_0x2812b0,'editorReady',(_0x5757f7,_0x1194ab)=>{const _0x5a83f4=_0x1194ab['ui']['view']['body']['bodyCollectionContainer'];_0x1dc1ba['focusableElements']['add'](_0x5a83f4),this['context']instanceof _0x458c52&&this['context']['ui']['focusTracker']['add'](_0x5a83f4);},{'priority':'highest'}),this['listenTo'](_0x2812b0,'editorDestroyed',(_0x216861,_0x46ebc3)=>{const _0x4b6a29=_0x46ebc3['ui']['view']['body']['bodyCollectionContainer'];_0x1dc1ba['focusableElements']['has'](_0x4b6a29)&&_0x1dc1ba['focusableElements']['remove'](_0x4b6a29),this['context']instanceof _0x458c52&&this['context']['ui']['focusTracker']['remove'](_0x4b6a29);});}_unbindEditors(_0x49c6cc){this['stopListening'](_0x49c6cc,'editorReady'),this['stopListening'](_0x49c6cc,'editorDestroyed');}_createCommentThreadView(_0x4efad7){const _0x447f46=this['context']['plugins']['get'](_0x23b29b),{config:_0xfd0b87,locale:_0x40de55}=this['context'],_0xdf4443=_0x110226(_0xfd0b87['get']('locale'),_0x40de55);return new(0x0,(_0xfd0b87['get']('comments'))['CommentThreadView'])(_0x40de55,_0x4efad7,_0x447f46['me'],{'editorConfig':{..._0xfd0b87['get']('comments.editorConfig'),'licenseKey':this['context']['config']['get']('licenseKey')},'copyMarkers':_0xfd0b87['get']('comments.copyMarkers'),'maxCommentsWhenCollapsed':_0xfd0b87['get']('comments.maxCommentsWhenCollapsed'),'maxThreadTotalWeight':_0xfd0b87['get']('comments.maxThreadTotalWeight'),'maxCommentCharsWhenCollapsed':_0xfd0b87['get']('comments.maxCommentCharsWhenCollapsed'),'formatDateTime':_0xdf4443,'CommentView':_0xfd0b87['get']('comments')['CommentView']});}_resolveCommentThread({threadId:_0x814e34,channelId:_0x25bb10,resolvedAt:_0x3edda6,resolvedBy:_0x1e1018,isFromAdapter:_0xb1e893}){if(!this['hasCommentThread'](_0x814e34))throw new _0x3fd207('commentsrepository-missing-comment-thread',null,{'threadId':_0x814e34});const _0x2382f8=this['getCommentThread'](_0x814e34);if(_0x2382f8['isResolved'])throw new _0x3fd207('commentsrepository-resolved-comment-thread',null,{'threadId':_0x814e34});const _0x4b5aac=this['context']['plugins']['get'](_0x23b29b);if(_0x2382f8['resolvedBy']=_0x4b5aac['getUser'](_0x1e1018),_0x2382f8['resolvedAt']=_0x3edda6,_0xb1e893||!this['adapter']||'function'!=typeof this['adapter']['resolveCommentThread'])return Promise['resolve']();const _0x4a29f9=this['context']['plugins']['get']('PendingActions'),_0x1c06c9=_0x4a29f9['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['resolveCommentThread']({'channelId':_0x25bb10,'threadId':_0x814e34})['then'](({resolvedAt:_0x38f791,resolvedBy:_0x1bd16d})=>{_0x4a29f9['remove'](_0x1c06c9),_0x2382f8['resolvedBy']['id']!==_0x1bd16d&&(_0x2382f8['resolvedBy']=_0x4b5aac['getUser'](_0x1bd16d)),_0x2382f8['resolvedAt']=_0x38f791;})['catch'](_0x436f28=>{throw console['error'](_0x436f28),new _0x3fd207('commentsrepository-resolve-comment-thread-internal-error',this);});}_reopenCommentThread({threadId:_0x389cd5,channelId:_0x5a9258,isFromAdapter:_0xc1af68}){if(!this['hasCommentThread'](_0x389cd5))throw new _0x3fd207('commentsrepository-missing-comment-thread',null,{'threadId':_0x389cd5});const _0x51f852=this['getCommentThread'](_0x389cd5);if(!_0x51f852['isResolved'])throw new _0x3fd207('commentsrepository-reopen-comment-thread',null,{'threadId':_0x389cd5});if(_0x51f852['resolvedBy']=null,_0x51f852['resolvedAt']=null,_0xc1af68||!this['adapter']||'function'!=typeof this['adapter']['reopenCommentThread'])return Promise['resolve']();const _0x34457b=this['context']['plugins']['get']('PendingActions'),_0xf2167b=_0x34457b['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['reopenCommentThread']({'channelId':_0x5a9258,'threadId':_0x389cd5})['then'](()=>_0x34457b['remove'](_0xf2167b))['catch'](_0xb66d2=>{throw console['error'](_0xb66d2),new _0x3fd207('commentsrepository-reopen-comment-thread-internal-error',this);});}_removeCommentThread({threadId:_0x4ccfe7,isFromAdapter:_0x11e8b2}){const _0x280e4e=this['getCommentThread'](_0x4ccfe7);if(!_0x280e4e)throw new _0x3fd207('commentsrepository-remove-missing-comment-thread',this);if(this['_detachCommentThread'](_0x4ccfe7),this['_threads']['delete'](_0x4ccfe7),!_0x280e4e['isSubmitted']||_0x11e8b2||!this['adapter']||'function'!=typeof this['adapter']['removeCommentThread'])return Promise['resolve']();const _0x4b5438=this['context']['plugins']['get']('PendingActions'),{channelId:_0x231b06}=_0x280e4e,_0x3356bc=_0x4b5438['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['removeCommentThread']({'channelId':_0x231b06,'threadId':_0x4ccfe7})['then'](()=>_0x4b5438['remove'](_0x3356bc))['catch'](_0x5290b8=>{throw console['error'](_0x5290b8),new _0x3fd207('commentsrepository-remove-comment-thread-internal-error',this);});}_updateCommentThread({threadId:_0x373f7b,unlinkedAt:_0xdcbaff,context:_0x28f5eb,attributes:_0x3fe3c4,isFromAdapter:_0x52b3d2}){if('string'!=typeof _0x373f7b)throw new _0x3fd207('commentsrepository-invalid-comment-thread-id',null,{'threadId':_0x373f7b});if(!this['hasCommentThread'](_0x373f7b))throw new _0x3fd207('commentsrepository-missing-comment-thread',null,{'threadId':_0x373f7b});const _0x268a39=this['getCommentThread'](_0x373f7b);let _0x520cc6=!0x1;if(void 0x0!==_0x28f5eb&&_0x268a39['context']!==_0x28f5eb&&(_0x268a39['context']=_0x28f5eb,_0x520cc6=!0x0),void 0x0!==_0xdcbaff&&_0x268a39['unlinkedAt']!==_0xdcbaff&&(_0x268a39['unlinkedAt']=_0xdcbaff,_0x520cc6=!0x0),_0x3fe3c4&&!_0x11ae2a(_0x3fe3c4,_0x268a39['attributes'])&&(_0x268a39['attributes']=_0x3fe3c4,_0x520cc6=!0x0),!_0x520cc6)return Promise['resolve']();if(!_0x268a39['isSubmitted']||_0x52b3d2||!this['adapter']||'function'!=typeof this['adapter']['updateCommentThread'])return Promise['resolve']();const _0x1a4a9a=this['context']['plugins']['get']('PendingActions'),{channelId:_0x5304b1}=_0x268a39,_0x3a0b2a=_0x1a4a9a['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['updateCommentThread']({'channelId':_0x5304b1,'threadId':_0x373f7b,'context':_0x28f5eb,'unlinkedAt':_0xdcbaff,'attributes':_0x3fe3c4})['then'](()=>_0x1a4a9a['remove'](_0x3a0b2a))['catch'](_0x182242=>{throw console['error'](_0x182242),new _0x3fd207('commentsrepository-update-comment-thread-internal-error',this);});}_detachCommentThread(_0xbac409){const _0xf0f7c7=this['context']['plugins']['get'](ti),_0x90f696=this['getCommentThread'](_0xbac409);if(_0x90f696['_isAttached']=!0x1,this['_threadToController']['has'](_0x90f696)){const _0x23a490=this['_threadToController']['get'](_0x90f696),_0x38c54d=_0x23a490['view'],_0x4469c7=_0xf0f7c7['getByInnerView'](_0x38c54d);this['_threadToController']['delete'](_0x90f696),this['_viewToController']['delete'](_0x38c54d),_0x4469c7&&_0xf0f7c7['remove'](_0x4469c7),_0x23a490['destroy'](),_0x38c54d['destroy']()['then'](()=>{this['_unbindEditors'](_0x38c54d);});}}_updateActiveAnnotation({threadId:_0x269509,resolvedAt:_0x50f3ea,unlinkedAt:_0x52a0a8}){const _0x5668ea=!!_0x50f3ea,_0x5f355f=this['context']['plugins']['get'](ti),_0x14335b=this['getCommentThread'](_0x269509);if(this['_threadToController']['has'](_0x14335b)){const _0x4a67a5=this['_threadToController']['get'](_0x14335b)['view'],_0x14ad4b=_0x5f355f['getByInnerView'](_0x4a67a5);_0x14ad4b&&(_0x5668ea&&_0x5f355f['_removeActiveAnnotation'](_0x14ad4b),_0x52a0a8?_0x14ad4b['isVisible']=!0x1:_0x14ad4b['refreshVisibility']());}}_getExternalAuthor(_0x5338c9){const _0x834aa2=this['context']['plugins']['get'](_0x23b29b),_0x4af14c=_0x4543c7('external:'+_0x5338c9),_0x4cb06d=_0x834aa2['getUser'](_0x4af14c);return _0x4cb06d||_0x834aa2['addUser']({'id':_0x4af14c,'name':_0x5338c9});}_createNewComment({threadId:_0x40e81e,commentId:_0x267ded=_0x185ea0(),content:_0x4d7c4e,authorId:_0x1c5013,createdAt:_0x146aa5,attributes:_0x2a1734}){if('string'!=typeof _0x267ded)throw new _0x3fd207('commentsrepository-invalid-commentid');if('string'!=typeof _0x1c5013)throw new _0x3fd207('commentsrepository-invalid-comment-authorid');if('string'!=typeof _0x4d7c4e||!_0x4d7c4e['trim']())throw new _0x3fd207('commentsrepository-invalid-comment-content');const _0x4a1ebe=this['context']['plugins']['get'](_0x23b29b)['getUser'](_0x1c5013);if(!_0x4a1ebe)throw new _0x3fd207('commentsrepository-add-comment-user-not-exists',null,{'authorId':_0x1c5013});let _0x280284=null,_0x291c17=_0x146aa5;return _0x2a1734?.['@external']&&(_0x280284=this['_getExternalAuthor'](_0x2a1734['@external']['authorName']),_0x291c17=new Date(_0x2a1734['@external']['createdAt'])),new hi(this,{'threadId':_0x40e81e,'id':_0x267ded,'author':_0x280284||_0x4a1ebe,'creator':_0x4a1ebe,'content':_0x4d7c4e,'createdAt':_0x146aa5,'authoredAt':_0x291c17,'attributes':_0x2a1734});}_addComment(_0x1fef8d){let {threadId:_0x6c425,content:_0x40a494,attributes:_0x130cb7,isFromAdapter:_0x52fa25}=_0x1fef8d;const _0x360d60=this['getCommentThread'](_0x1fef8d['threadId']);if(!_0x360d60)throw new _0x3fd207('commentsrepository-add-comment-to-missing-comment-thread',this);const _0x40f132=this['_createNewComment'](_0x1fef8d),{id:_0x6ed61f}=_0x40f132;if(_0x360d60['_add'](_0x40f132),_0x52fa25||!this['adapter']||'function'!=typeof this['adapter']['addComment']||!_0x360d60['isSubmitted'])return Promise['resolve']();const _0x40a85a=this['context']['plugins']['get']('PendingActions'),{channelId:_0x5a64b5}=_0x360d60,_0x438ac9=_0x40a85a['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return _0x130cb7||(_0x130cb7={}),this['adapter']['addComment']({'channelId':_0x5a64b5,'threadId':_0x6c425,'commentId':_0x6ed61f,'content':_0x40a494,'attributes':_0x130cb7})['then'](_0x5e1a4f=>{_0x40a85a['remove'](_0x438ac9),_0x5e1a4f&&this['_updateComment']({'channelId':_0x5a64b5,'threadId':_0x6c425,'commentId':_0x6ed61f,'createdAt':_0x5e1a4f['createdAt'],'isFromAdapter':!0x0});})['catch'](_0x5d16cc=>{throw console['error'](_0x5d16cc),new _0x3fd207('commentsrepository-add-comment-internal-error',this);});}_updateComment({threadId:_0x40d683,commentId:_0x5c5086,content:_0x1d070d,createdAt:_0x45629c,attributes:_0x108d43,isFromAdapter:_0x45b711}){if(void 0x0!==_0x1d070d&&('string'!=typeof _0x1d070d||!_0x1d070d['trim']()['length']))throw new _0x3fd207('commentsrepository-update-comment-invalid-content');const _0x16e78c=this['getCommentThread'](_0x40d683),_0xc253a1=_0x16e78c['getComment'](_0x5c5086);if(!_0xc253a1)throw new _0x3fd207('commentsrepository-update-missing-comment',this);let _0x1b7a9e=!0x1;if(_0x1d070d&&_0x1d070d!==_0xc253a1['content']&&(_0xc253a1['isEditable']||_0x45b711)&&(_0xc253a1['content']=_0x1d070d,_0x1b7a9e=!0x0),_0x45629c&&_0x45629c!==_0xc253a1['createdAt']&&(_0xc253a1['createdAt']=_0x45629c,_0xc253a1['isExternal']||(_0xc253a1['authoredAt']=_0x45629c),_0x1b7a9e=!0x0),_0x108d43&&!_0x11ae2a(_0x108d43,_0xc253a1['attributes'])&&(_0xc253a1['attributes']=_0x108d43,_0x1b7a9e=!0x0),!_0x1b7a9e)return Promise['resolve']();if(_0x16e78c['fire']('commentUpdated'),_0x45b711||!this['adapter']||'function'!=typeof this['adapter']['updateComment'])return Promise['resolve']();const _0x3170cf=this['context']['plugins']['get']('PendingActions'),{channelId:_0x254724}=this['getCommentThread'](_0xc253a1['threadId']),_0xabaaa9=_0x3170cf['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['updateComment']({'channelId':_0x254724,'threadId':_0x40d683,'commentId':_0x5c5086,'content':_0x1d070d,'attributes':_0x108d43})['then'](()=>_0x3170cf['remove'](_0xabaaa9))['catch'](_0x2a3823=>{throw console['error'](_0x2a3823),new _0x3fd207('commentsrepository-update-comment-internal-error',this);});}_removeComment({threadId:_0x4c8005,commentId:_0x57d4fa,isFromAdapter:_0x1c101f}){const _0x47f5a2=this['getCommentThread'](_0x4c8005),_0x249b2b=_0x47f5a2['getComment'](_0x57d4fa);if(!_0x249b2b)throw new _0x3fd207('commentsrepository-remove-missing-comment',this);if(_0x47f5a2['_remove'](_0x249b2b),_0x1c101f||!this['adapter']||'function'!=typeof this['adapter']['removeComment'])return Promise['resolve']();const _0x297f83=this['context']['plugins']['get']('PendingActions'),{channelId:_0x4f8c9c}=_0x47f5a2,_0x177a9d=_0x297f83['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['removeComment']({'channelId':_0x4f8c9c,'threadId':_0x4c8005,'commentId':_0x57d4fa})['then'](()=>_0x297f83['remove'](_0x177a9d))['catch'](_0x2a85ec=>{throw console['error'](_0x2a85ec),new _0x3fd207('commentsrepository-remove-comment-internal-error',this);});}},ri=class extends si{['channelId'];['id'];_isAttached;_isSubmitted;comments;_repository;constructor(_0x35948c,_0x51dee6){super();const _0x3fa95a=_0x51dee6['isResolvable'];this['channelId']=_0x51dee6['channelId'],this['id']=_0x51dee6['id'],this['comments']=new _0x5d687e(),this['_repository']=_0x35948c,this['_isAttached']=!0x1,this['_isSubmitted']=_0x51dee6['isSubmitted'],this['set']('_hasTargetInContent',!0x0),this['bind']('isReadOnly')['to'](_0x35948c,'_permissions',_0x35948c,'_readOnlyChannels',()=>_0x35948c['isReadOnly'](this['channelId'])),this['bind']('isRemovable')['to'](_0x35948c,'_permissions',()=>_0x35948c['getPermissions'](this['channelId'])['admin']),this['bind']('canComment')['to'](_0x35948c,'_permissions',()=>{const _0x33346e=_0x35948c['getPermissions'](this['channelId']);return _0x33346e['write']||_0x33346e['admin'];}),this['bind']('isResolvable')['to'](_0x35948c,'_permissions',()=>_0x3fa95a&&_0x35948c['getPermissions'](this['channelId'])['resolve']),this['set']('context',_0x51dee6['context']),this['bind']('archivedAt')['to'](this,'resolvedAt',this,'unlinkedAt',(_0x140768,_0x586012)=>_0x140768?_0x586012?_0x140768<_0x586012?_0x140768:_0x586012:_0x140768:_0x586012),this['set']('unlinkedAt',_0x51dee6['unlinkedAt']||null),this['set']('resolvedAt',_0x51dee6['resolvedAt']||null),this['set']('resolvedBy',_0x51dee6['resolvedBy']||null),this['bind']('isResolved')['to'](this,'resolvedAt',_0x332fb8=>!!_0x332fb8),this['set']('attributes',_0x51dee6['attributes']||{});}get weight(){return Array['from'](this['comments'])['reduce']((_0x3685f1,_0x56e507)=>_0x3685f1+_0x56e507['weight'],0x0);}get length(){return this['comments']['length'];}get isAttached(){return this['_isAttached'];}get isSubmitted(){return this['_isSubmitted'];}submit(){const {channelId:_0x307926,id:_0x3dab8f}=this;this['_repository']['fire'](ai('submitCommentThread',_0x307926),{'channelId':_0x307926,'threadId':_0x3dab8f});}setUnlinkedAt(_0x2141d5){this['_update']({'unlinkedAt':_0x2141d5});}['resolve']({resolvedAt:_0x14186e=new Date(),resolvedBy:_0x489692='',isFromAdapter:_0x26b9b5=!0x1}={}){const _0x403a54=this['_repository']['context']['plugins']['get'](_0x23b29b)['me'],{channelId:_0x12aef3,id:_0x118360}=this;this['_repository']['fire'](ai('resolveCommentThread',_0x12aef3),{'channelId':_0x12aef3,'threadId':_0x118360,'resolvedAt':_0x14186e,'resolvedBy':_0x489692||_0x403a54['id'],'isFromAdapter':_0x26b9b5});}['reopen']({isFromAdapter:_0x2104b8=!0x1}={}){const {channelId:_0x2c28df,id:_0x82d56b}=this;this['_repository']['fire'](ai('reopenCommentThread',_0x2c28df),{'channelId':_0x2c28df,'threadId':_0x82d56b,'isFromAdapter':_0x2104b8});}setContext(_0x4e93ea){this['context']||this['_update']({'context':_0x4e93ea});}setAttribute(_0x50171c,_0x5a95fd){const _0x1b4328=_0x2dad8a(this['attributes']);_0x200648(_0x1b4328,_0x50171c,_0x5a95fd),this['_update']({'attributes':_0x1b4328});}removeAttribute(_0x26ac3b){const _0x4409c3=_0x2dad8a(this['attributes']);_0x4c0a55(_0x4409c3,_0x26ac3b),this['_update']({'attributes':_0x4409c3});}['remove']({isFromAdapter:_0xbf09e0=!0x1}={}){const {channelId:_0x44c97d,id:_0x259cca}=this;this['_repository']['fire'](ai('removeCommentThread',_0x44c97d),{'channelId':_0x44c97d,'threadId':_0x259cca,'isFromAdapter':_0xbf09e0});}attachTo(_0xc60275){return this['_repository']['_attachCommentThread']({'threadId':this['id'],'target':_0xc60275});}addComment(_0x2020b5){const {channelId:_0xcfd44c,id:_0x43907d}=this;this['_repository']['fire'](ai('addComment',_0xcfd44c,_0x43907d),Object['assign']({'channelId':_0xcfd44c,'threadId':_0x43907d},_0x2020b5));}getComment(_0x42d17c){if('string'!=typeof _0x42d17c)throw new _0x3fd207('commentsrepository-get-comment-invalid-id',null,{'commentId':_0x42d17c});return this['comments']['get'](_0x42d17c);}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'](_0x45b668=>_0x45b668['toJSON']()),'attributes':this['attributes']};}['_add'](_0x2f3451){return this['listenTo'](_0x2f3451,'change:authoredAt',()=>{const _0x5aec04=this['_findOptimalIndex'](_0x2f3451),_0x3d13d6=this['comments'];_0x5aec04-0x1!=_0x3d13d6['getIndex'](_0x2f3451)&&_0x5aec04+0x1!=_0x3d13d6['getIndex'](_0x2f3451)&&(this['_remove'](_0x2f3451),this['_add'](_0x2f3451));}),this['comments']['add'](_0x2f3451,this['_findOptimalIndex'](_0x2f3451));}_update(_0x3a74dd){const {channelId:_0x3fd2a5,id:_0x507dd9}=this;this['_repository']['fire'](ai('updateCommentThread',_0x3fd2a5),{..._0x3a74dd,'channelId':_0x3fd2a5,'threadId':_0x507dd9});}['_remove'](_0xf86e44){return this['stopListening'](_0xf86e44),_0xf86e44['destroy'](),this['comments']['remove'](_0xf86e44);}_findOptimalIndex(_0x27ff23){const _0x47a178=this['comments']['find'](_0x19b64d=>new Date(_0x19b64d['authoredAt'])['getTime']()>new Date(_0x27ff23['authoredAt'])['getTime']());return _0x47a178?this['comments']['getIndex'](_0x47a178):this['length'];}},hi=class extends ni{['id'];threadId;author;creator;createdAt;_repository;constructor(_0x31e091,_0xc27955){super();const _0x5f21ea=_0x31e091['context']['plugins']['get'](_0x23b29b)['me'],_0x3b6237=_0x31e091['getCommentThread'](_0xc27955['threadId']),_0x53d864=0x0===_0x3b6237['comments']['length'],_0x2ec38e=_0x5f21ea===_0xc27955['author'];this['id']=_0xc27955['id'],this['threadId']=_0xc27955['threadId'],this['author']=_0xc27955['author'],this['creator']=_0xc27955['creator'],this['set']('content',_0xc27955['content']),this['createdAt']=_0xc27955['createdAt']||new Date(),this['set']('authoredAt',_0xc27955['authoredAt']||new Date()),this['bind']('resolvedAt')['to'](_0x3b6237,'resolvedAt'),this['set']('attributes',_0xc27955['attributes']||{}),this['bind']('isEditable')['to'](_0x31e091,'_permissions',()=>{const _0x1f5176=_0x31e091['getPermissions'](_0x3b6237['channelId'])['write'],_0x172c3a=_0x31e091['getPermissions'](_0x3b6237['channelId'])['modifyAll'];return _0x2ec38e&&_0x1f5176||!_0x2ec38e&&_0x172c3a;}),this['bind']('isRemovable')['to'](_0x3b6237,'isRemovable',_0x31e091,'_permissions',_0x2775a9=>{const _0x371616=_0x31e091['getPermissions'](_0x3b6237['channelId'])['write'],_0x21343f=_0x31e091['getPermissions'](_0x3b6237['channelId'])['modifyAll'];return _0x2ec38e&&_0x371616||_0x2775a9&&_0x53d864||!_0x2ec38e&&_0x21343f&&!_0x53d864;}),this['bind']('isReadOnly')['to'](_0x3b6237,'isReadOnly'),this['_repository']=_0x31e091;}get isExternal(){return Boolean(this['attributes']&&this['attributes']['@external']);}get weight(){return Math['max'](function(_0x105b4a){const _0x4f989e=document['createElement']('div');return _0x4f989e['innerHTML']=_0x105b4a,_0x4f989e['textContent']['length'];}(this['content']),0xc8);}update(_0x158adb){const {threadId:_0x16e0d3,id:_0x2b0b7e}=this;if(!this['_repository']['hasCommentThread'](_0x16e0d3))throw new _0x3fd207('commentsrepository-update-comment-missing-comment-thread',this);const {channelId:_0x5ef944}=this['_repository']['getCommentThread'](_0x16e0d3);this['_repository']['fire'](ai('updateComment',_0x5ef944,_0x16e0d3),{'channelId':_0x5ef944,'threadId':_0x16e0d3,'commentId':_0x2b0b7e,..._0x158adb});}setAttribute(_0x47c46f,_0xb93e33){const _0x108b47=_0x2dad8a(this['attributes']);_0x200648(_0x108b47,_0x47c46f,_0xb93e33),this['update']({'attributes':_0x108b47});}removeAttribute(_0x1cd5f8){const _0xe41560=_0x2dad8a(this['attributes']);_0x4c0a55(_0xe41560,_0x1cd5f8),this['update']({'attributes':_0xe41560});}['remove'](_0x551bd4={}){if(!_0x551bd4['isFromAdapter']&&!this['isRemovable'])return;const {threadId:_0x60a099,id:_0x29066b}=this;if(!this['_repository']['hasCommentThread'](_0x60a099))throw new _0x3fd207('commentsrepository-remove-comment-missing-comment-thread',this);const {channelId:_0x375ddc}=this['_repository']['getCommentThread'](_0x60a099);this['_repository']['fire'](ai('removeComment',_0x375ddc,_0x60a099),{'channelId':_0x375ddc,'threadId':_0x60a099,'commentId':_0x29066b,..._0x551bd4});}toJSON(){return{'commentId':this['id'],'content':this['content'],'createdAt':this['createdAt'],'authorId':this['creator']['id'],'attributes':this['attributes']};}destroy(){this['stopListening']();}};function ai(_0x587c82,..._0x47579a){for(const _0x51c810 of _0x47579a)void 0x0!==_0x51c810&&(_0x587c82+=':'+String(_0x51c810));return _0x587c82;}var ci=class extends _0x44703a{constructor(_0x4630f0){super(_0x4630f0),this['set']('hasContent',!0x1);}['refresh'](){const _0x5a73c2=this['editor']['model']['document']['selection'];this['isEnabled']=!0x0,this['hasContent']=!0x1;for(const _0x3e8505 of _0x5a73c2['getRanges']())if(this['_hasContent'](_0x3e8505))return void(this['hasContent']=!0x0);}execute({threadId:_0x4db5c3=_0x185ea0(),ranges:_0xdafc3e,comment:_0x5ed376}={}){const _0x2f4c48=this['editor']['model'],_0x286c5e=_0xdafc3e??Array['from'](_0x2f4c48['document']['selection']['getRanges']()),_0x145c3b=[];for(const _0x225e1c of _0x286c5e)this['_hasContent'](_0x225e1c)&&_0x145c3b['push'](this['_trimToContent'](_0x225e1c));if(!_0x145c3b['length'])throw new _0x3fd207('addcommentthreadcommand-incorrect-ranges',null);_0x5ed376&&this['_createCommentThread'](_0x4db5c3,_0x5ed376),this['_createMarkersFromRanges'](_0x4db5c3,_0x145c3b,!!_0x5ed376);}_createMarkersFromRanges(_0x525bac,_0x4405d3,_0x46246c){this['editor']['model']['change'](_0x5c6c34=>{for(const _0x143ef7 of _0x4405d3){const _0x27ddae='comment:'+_0x525bac+':'+_0x185ea0()['substr'](0x1,0x5);_0x5c6c34['addMarker'](_0x27ddae,{'range':_0x143ef7,'usingOperation':_0x46246c,'affectsData':_0x46246c});}});}_createCommentThread(_0x1d22f8,_0x15b757){const _0x1db476=this['editor']['plugins']['get']('CommentsRepository'),_0xfd9341=this['editor']['config']['get']('collaboration.channelId'),_0x32b0c2=this['editor']['plugins']['get']('Users')['me'];if(!_0x32b0c2)throw new _0x3fd207('addcommentthreadcommand-user-not-found',null);_0x1db476['addCommentThread']({'threadId':_0x1d22f8,'channelId':_0xfd9341,'comments':[{'authorId':_0x32b0c2['id'],'content':_0x15b757,'createdAt':new Date(),'attributes':{}}]});}_hasContent(_0x359e3c){for(const _0x965d0f of _0x359e3c['getItems']())if(this['_itemIsContent'](_0x965d0f))return!0x0;return!0x1;}_itemIsContent(_0x586e36){return _0x586e36['is']('$textProxy')||this['editor']['model']['schema']['isObject'](_0x586e36)&&!_0x586e36['is']('element','tableCell');}_trimToContent(_0x665871){const _0x2ab4c0=_0x2247be=>!this['_itemIsContent'](_0x2247be['item']),_0x598d0d=_0x665871['start']['getLastMatchingPosition'](_0x2ab4c0),_0x451b36=_0x665871['end']['getLastMatchingPosition'](_0x2ab4c0,{'direction':'backward'});return this['editor']['model']['createRange'](_0x598d0d,_0x451b36);}},di=class extends _0x12b188{_dataCollectors;_editorAnnotations;static get requires(){return[ti];}static get['pluginName'](){return'EditorAnnotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3fcfa8){super(_0x3fcfa8),this['_dataCollectors']=new Set(),this['_editorAnnotations']=new Set();}init(){const _0x5f55cc=this['editor'],_0x20f846=_0x5f55cc['model']['document']['selection'],_0x1e06ae=_0x98290e(()=>this['refreshSelectedViews'](),0xa);_0x20f846['on']('change:range',(_0x2b8da2,_0x147523)=>{_0x147523['directChange']&&(_0x1e06ae['cancel'](),this['refreshSelectedViews']());}),this['listenTo'](_0x5f55cc['editing']['view']['document'],'change:isFocused',(_0x5e8b45,_0x5984b,_0x5c6dac)=>{_0x5c6dac&&_0x1e06ae();}),this['listenTo'](_0x5f55cc['ui']['focusTracker'],'change:isFocused',(_0x2c4fad,_0x5982d3,_0xd21e6c)=>{_0xd21e6c||this['fire']('blur',{'isAnnotationTracked':_0x5ec8de=>this['_editorAnnotationsData']['has'](_0x5ec8de['innerView'])});}),this['listenTo'](this['editor']['ui'],'update',()=>this['fire']('uiUpdate'));}registerAnnotation(_0x56a01a){if(this['_editorAnnotations']['has'](_0x56a01a['view']))return;this['_editorAnnotations']['add'](_0x56a01a['view']),this['editor']['ui']['focusTracker']['add'](_0x56a01a['view']['element']);const _0x2fae1e=this['editor']['plugins']['get'](ti);this['listenTo'](_0x2fae1e['collection'],'remove',(_0x598f5d,_0x1ddd16)=>{this['editor']['ui']['focusTracker']['remove'](_0x1ddd16['view']['element']),this['_editorAnnotations']['delete'](_0x1ddd16['view']);});}hasDomSelection(){return this['editor']['editing']['view']['hasDomSelection'];}addSourceCollector(_0x1745e8){if('function'!=typeof _0x1745e8)throw new _0x3fd207('editorannotations-invalid-source-callback');this['_dataCollectors']['add'](_0x1745e8);}refreshSelectedViews(){this['fire']('refresh');}getOrderedSelectedAnnotations({activeAnnotation:_0x4e1c28,annotations:_0x7f89db}){const _0x157743=[],_0x19ed73=this['editor']['model']['document']['selection'],_0x55dd44=Array['from'](_0x19ed73['getRanges']());for(const [_0x521776,_0xcac468]of this['_editorAnnotationsData']){const _0x171fa1=_0x51413a(_0xcac468),_0x3f8749=_0x7f89db['getByInnerView'](_0x521776);_0x171fa1&&_0x3f8749&&_0x157743['push']({'annotation':_0x3f8749,'range':_0x171fa1});}function _0x51413a(_0x454bf0){for(const _0x4f1b1b of _0x454bf0)for(const _0x4b41d7 of _0x55dd44)if(_0x4f1b1b['containsRange'](_0x4b41d7,!_0x19ed73['isCollapsed']))return _0x4f1b1b;return null;}const _0xcdcf6f=new Map(Array['from'](_0x7f89db,(_0x3d9e7c,_0x519fad)=>[_0x3d9e7c,_0x519fad]));return _0x157743['sort']((_0x46e3d2,_0x31b346)=>{const _0x3b3464=_0x46e3d2['range'],_0x2a625e=_0x31b346['range'];if(!_0x3b3464['isEqual'](_0x2a625e)){if(_0x3b3464['containsRange'](_0x2a625e,!0x0))return 0x1;if(_0x2a625e['containsRange'](_0x3b3464,!0x0))return-0x1;}return _0x46e3d2['annotation']==_0x4e1c28?-0x1:_0x31b346['annotation']==_0x4e1c28?0x1:(_0xcdcf6f['get'](_0x46e3d2['annotation'])??0x0)-(_0xcdcf6f['get'](_0x31b346['annotation'])??0x0);})['map'](_0x52c3f5=>_0x52c3f5['annotation']);}get _editorAnnotationsData(){const _0x3b409c=new Map();for(const _0x30e1bf of Array['from'](this['_dataCollectors']))for(const [_0x3b3062,_0x4d9f35]of _0x30e1bf())_0x3b409c['set'](_0x3b3062,_0x4d9f35);return _0x3b409c;}},li=class extends _0x12b188{afterInit(){const _0x34d1c0=this['editor'];_0x34d1c0['plugins']['has']('RestrictedEditingModeEditing')&&_0x34d1c0['plugins']['get']('RestrictedEditingModeEditing')['enableCommand']('addCommentThread');}},mi=class extends _0x12b188{constructor(_0x21caf6){super(_0x21caf6),this['editor']['config']['define']('importWord.formatting.comments','basic');}afterInit(){const _0x2c77ba=this['editor'],_0x17ab4e=_0x2c77ba['commands']['get']('importWord'),_0x1ed75e=_0x2c77ba['plugins']['get'](_0x23b29b);_0x17ab4e&&(_0x17ab4e['on']('execute',(_0x12ec83,[,_0x246721])=>{_0x246721['collaboration_features']={'comments':!0x0,'user_id':_0x1ed75e['me']['id']};},{'priority':_0x4103ab['high']+0xa}),this['listenTo'](_0x17ab4e,'dataInsert',this['_handleImportedData']));}_handleImportedData(_0x397d69,_0x439f70){const {comment_threads:_0x463c27}=_0x439f70;_0x463c27&&_0x463c27['forEach'](({thread_id:_0x320bbc,comments:_0x20ccd5,is_resolved:_0x971c93})=>{const _0x7b4b72=new Date(),_0x10e523=_0x20ccd5['map'](({author:_0x54e965,content:_0x1558e0,created_at:_0x276bd0})=>({'content':_0x1558e0,'authorId':this['editor']['plugins']['get'](_0x23b29b)['me']['id'],'createdAt':_0x7b4b72,'attributes':{'@external':{'authorName':_0x54e965,'createdAt':_0x276bd0?new Date(_0x276bd0):new Date(),'source':'importWord'}}})),_0x261002=this['editor']['config']['get']('collaboration.channelId');this['editor']['plugins']['get'](oi)['addCommentThread']({'channelId':_0x261002,'threadId':_0x320bbc,'comments':_0x10e523,'resolvedAt':_0x971c93?_0x7b4b72:null});});}},ui=class extends _0x12b188{constructor(_0x262a83){super(_0x262a83),this['editor']['config']['define']('comments.copyMarkers','default');}static get requires(){return[pt,wt];}afterInit(){const _0x386b26=this['editor']['plugins']['get']('ClipboardPipeline');this['_registerMarkerInClipboardPipeline'](),this['listenTo'](_0x386b26,'contentInsertion',(_0x4070d5,_0x2d033e)=>this['_removeMarkersWithoutThreads'](_0x2d033e['content']['markers']),{'priority':'highest'});}_removeMarkersWithoutThreads(_0x333539){if(!this['editor']['plugins']['has']('CommentsRepository'))return _0x333539;const _0xfedb0=this['editor']['plugins']['get']('CommentsRepository');for(const _0x58cf8d of _0x333539['keys']()){const [_0x281347,_0x5e725e]=_0x58cf8d['split'](':');'comment'!=_0x281347||_0xfedb0['hasCommentThread'](_0x5e725e)||_0x333539['delete'](_0x58cf8d);}return _0x333539;}_registerMarkerInClipboardPipeline(){const _0x43a295=this['editor']['plugins']['get']('ClipboardMarkersUtils'),_0x360651=this['_mapCommentsCopyConfigToRegisterConfiguration'](this['editor']['config']['get']('comments.copyMarkers'));_0x360651&&_0x43a295['_registerMarkerToCopy']('comment',_0x360651);}_mapCommentsCopyConfigToRegisterConfiguration(_0x536275){switch(_0x536275){case'always':return{'allowedActions':'all','copyPartiallySelected':!0x1,'duplicateOnPaste':!0x0};case'default':return{'allowedActions':['cut','dragstart'],'copyPartiallySelected':!0x1,'duplicateOnPaste':!0x1};default:return null;}}};function fi(_0x499736){const _0x2959e5=_0x499736['split'](':');return{'group':_0x2959e5[0x0],'id':_0x2959e5[0x1],'part':_0x2959e5[0x2]};}var pi=class extends _0x12b188{init(){this['overrideMarkerConverters'](),this['overrideHorizontalRuleConverter'](),this['overrideImageInlineConverter'](),this['overrideMediaEmbedConverter']();}overrideMarkerConverters(){this['editor']['conversion']['for']('dataDowncast')['markerToHighlight']({'model':'comment','view':(_0x5d2269,_0x152d81)=>{if(!_0x152d81['options']['showCommentHighlights'])return null;if(_0x152d81['options']['ignoreResolvedComments']){const {id:_0x3e5624}=fi(_0x5d2269['markerName']);if(this['editor']['plugins']['get'](oi)['getCommentThread'](_0x3e5624)?.['isResolved']&&_0x5d2269['item'])return _0x152d81['consumable']['consume'](_0x5d2269['item'],'addMarker:'+_0x5d2269['markerName']),_0x152d81['consumable']['consume'](_0x5d2269['item'],'removeMarker:'+_0x5d2269['markerName']),null;}return{'classes':['ck-comment-marker']};}}),this['editor']['conversion']['for']('dataDowncast')['add'](_0x2690dc=>{_0x2690dc['on']('addMarker:comment',(_0xcad72d,_0x2e3937,_0x7bf824)=>{if(!_0x7bf824['options']['showCommentHighlights'])return;const _0x1f567a=_0x2e3937['item'];if(!_0x1f567a)return;const _0x2d223e=_0x7bf824['mapper']['toViewElement'](_0x1f567a);this['editor']['model']['schema']['isObject'](_0x1f567a)&&_0x2d223e&&!_0x2d223e['getCustomProperty']('widget')&&_0x2d223e['is']('containerElement')&&Ct(_0x2d223e,_0x7bf824['writer']);},{'priority':'high'});});}overrideHorizontalRuleConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToStructure']({'model':'horizontalLine','view':(_0x569f1a,{writer:_0x250be5,options:_0x2485c5})=>{if(!_0x2485c5['showCommentHighlights'])return null;const _0x37314c=_0x250be5['createContainerElement']('div'),_0x338939=_0x250be5['createEmptyElement']('hr');return _0x250be5['addClass']('ck-horizontal-line',_0x37314c),_0x250be5['insert'](_0x250be5['createPositionAt'](_0x37314c,0x0),_0x338939),_0x37314c;},'converterPriority':'high'});}overrideImageInlineConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToStructure']({'model':'imageInline','view':(_0x48e589,{writer:_0x1958a3,options:_0x55f580})=>{if(!_0x55f580['showCommentHighlights'])return null;const _0x365755=_0x1958a3['createContainerElement']('span'),_0x20c8b5=_0x1958a3['createEmptyElement']('img');return _0x1958a3['addClass']('image-inline',_0x365755),_0x1958a3['insert'](_0x1958a3['createPositionAt'](_0x365755,0x0),_0x20c8b5),_0x365755;},'converterPriority':'high'});}overrideMediaEmbedConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToElement']({'model':'media','view':(_0x368540,{writer:_0x611a75,options:_0x1b2b79})=>{if(_0x1b2b79['showCommentHighlights'])return _0x611a75['createEmptyElement']('div');},'converterPriority':'high'}),this['editor']['data']['downcastDispatcher']['on']('attribute:url:media',(_0x47cae9,_0x1e010d,_0x56f802)=>{_0x56f802['options']['showCommentHighlights']&&_0x47cae9['stop']();},{'priority':'high'});}},wi=class extends _0x12b188{static get requires(){return[oi,di,_0x23b29b,li,mi,ui,pi];}static get['pluginName'](){return'CommentsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xcd736e){super(_0xcd736e),this['set']('isThreadsLoadingPaused',!0x0),_0xcd736e['data']['once']('ready',()=>this['isThreadsLoadingPaused']=!0x1),this['set']('activeMarker',null),this['on']('change:activeMarker',(_0x431838,_0x226c7c,_0x118464,_0x55b0c9)=>{const _0x2b14a1=_0xcd736e['plugins']['get'](oi),_0x920d19=_0x118464?fi(_0x118464)['id']:null;_0xcd736e['model']['change'](()=>{if(_0x920d19){const _0x4f2c23=this['getAllMarkersForId'](_0x920d19);for(const _0x1c5481 of _0x4f2c23)_0xcd736e['editing']['reconvertMarker'](_0x1c5481);}if(_0x55b0c9){const {id:_0x4263c4}=fi(_0x55b0c9),_0x29dba2=_0x2b14a1['getCommentThread'](_0x4263c4);if(_0x29dba2&&_0x29dba2['unlinkedAt'])return;if(_0x29dba2&&!_0x29dba2['isAttached'])return;const _0x4049f0=this['getAllMarkersForId'](_0x4263c4);for(const _0x379023 of _0x4049f0)_0xcd736e['editing']['reconvertMarker'](_0x379023);}}),_0x920d19&&this['scrollToThreadMarker'](_0x920d19);}),this['_initAriaMarkerChangeAnnouncements']();}init(){const _0x495ec9=this['editor'],_0x3cccec=_0x495ec9['plugins']['get'](oi),_0x1394eb=_0x495ec9['config']['get']('collaboration.channelId'),_0x180890=_0x3cccec['getCommentThreads']()['filter'](_0x1dff6c=>_0x1dff6c['channelId']!==_0x1394eb);_0x495ec9['commands']['add']('addCommentThread',new ci(_0x495ec9)),this['listenTo'](_0x495ec9,'change:isReadOnly',(_0x4fc34b,_0x3a5a22,_0xbf211a)=>{_0x3cccec['switchReadOnly'](_0xbf211a,_0x495ec9['config']['get']('collaboration.channelId'));}),this['listenTo'](_0x3cccec,gi('addCommentThread',_0x1394eb),(_0x4921be,{threadId:_0x4e3bdf})=>{this['editor']['plugins']['get'](oi)['getCommentThread'](_0x4e3bdf)?.['unlinkedAt']&&this['_attachArchivedThread'](_0x4e3bdf);}),this['listenTo'](_0x3cccec,gi('removeCommentThread',_0x1394eb),(_0x751279,{threadId:_0x4290ad})=>{_0x495ec9['model']['enqueueChange']({'isUndoable':!0x1},_0x4ee70f=>{const _0x3c9d98=this['getAllMarkersForId'](_0x4290ad);for(const _0x8f6275 of _0x3c9d98)_0x4ee70f['removeMarker'](_0x8f6275);});}),this['listenTo'](_0x3cccec,gi('resolveCommentThread',_0x1394eb),(_0x4cca58,{threadId:_0x5c4f67})=>{this['_reconvertMarkers'](_0x5c4f67);const _0x3f3df4=this['editor']['plugins']['get'](ti);(this['editor']['editing']['view']['hasDomSelection']||_0x3f3df4['collection']['isFocused'])&&(this['editor']['plugins']['get'](oi)['getCommentThread'](_0x5c4f67)['unlinkedAt']||this['editor']['editing']['view']['focus']());},{'priority':'low'}),this['listenTo'](_0x3cccec,gi('reopenCommentThread',_0x1394eb),(_0x5f07cd,{threadId:_0x1f17f7})=>{this['_reconvertMarkers'](_0x1f17f7);},{'priority':'low'}),this['listenTo'](_0x3cccec,gi('addComment',_0x1394eb),(_0x260c2e,{threadId:_0xe263cd,isFromAdapter:_0x3aaccf})=>{const _0x10b1b0=this['getAllMarkersForId'](_0xe263cd);!_0x3aaccf&&0x0!=_0x10b1b0['length']&&_0x3cccec['hasCommentThread'](_0xe263cd)&&0x1===_0x3cccec['getCommentThread'](_0xe263cd)['length']&&_0x495ec9['model']['enqueueChange']({'isUndoable':!0x1},_0x3b50fd=>{for(const _0x551a13 of _0x10b1b0)_0x3b50fd['updateMarker'](_0x551a13,{'usingOperation':!0x0,'affectsData':!0x0});});},{'priority':'low'}),this['_initializeMarkerConverters'](),this['_handleMarkerAddAndRemove'](),this['_handleInitialThreads'](_0x180890);}afterInit(){!async function(_0x318ffb){const _0x32ba48='mr4z2yakM3x0phtD7jBw1T6qRfeUuZcOLNKVgQSPE9iGIHoXlJW8YsCb5AndFv',_0x8dea20=0x79440,_0x2e4434={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x29cc88(_0x5045f9){const _0xc47546=new window['Promise'](_0x15bfb2=>{_0x5045f9['once']('ready',_0x15bfb2);}),_0x2cac14=window['Date']['now'](),_0x5481fb=_0x5045f9['config']['get']('licenseKey');async function _0x2ae980(){let _0x159e5b,_0x44b63b=null,_0x3fdfb6=null;try{return'GPL'==_0x5481fb?'NotAllowed':(_0x159e5b=_0xf82203(),_0x159e5b?(_0x159e5b['usageEndpoint']&&(_0x3fdfb6=_0x22e3f2(_0x159e5b['usageEndpoint'],_0x159e5b['jti'])),await _0x25e317()?_0x6b920a()?_0x48d1ef()?'Expired':_0x5457b4()?('evaluation'==_0x159e5b['licenseType']&&(_0x44b63b=_0x4d4c62('EvaluationLimit')),await _0x53a75e()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x48d1ef(){const _0x49ad6c=['evaluation','trial']['includes'](_0x159e5b['licenseType'])?_0x2cac14/0x3e8:0xe10*_0x8dea20;return _0x159e5b['exp']<_0x49ad6c;}function _0x6b920a(){const _0x111bd3=_0x159e5b['features'];if(!_0x111bd3)return!0x1;if(_0x111bd3['includes']('*'))return!0x0;if(_0x111bd3['includes']('CMT'))return!0x0;if(_0x111bd3['includes']('TRILIUM')&&_0x3b5c62())return!0x0;if(_0x111bd3['includes']('RCMT')){if(_0x11c9b5())return!0x0;if(_0x336f58()||_0x37d112())return!0x0;}return!0x1;}function _0x5457b4(){const _0x2903bd=_0x159e5b['licensedHosts'];if(!_0x2903bd||0x0==_0x2903bd['length'])return!0x0;const {hostname:_0x2775df}=new URL(window['location']['href']);if(_0x2903bd['includes'](_0x2775df))return!0x0;const _0x10f47b=_0x2775df['split']('.');return _0x2903bd['filter'](_0x378e85=>_0x378e85['includes']('*'))['map'](_0x9aadce=>_0x9aadce['split']('.'))['filter'](_0x108379=>_0x108379['length']<=_0x10f47b['length'])['map'](_0x35305b=>Array(_0x10f47b['length']-_0x35305b['length'])['fill']('*'===_0x35305b[0x0]?'*':'')['concat'](_0x35305b))['some'](_0x3b407c=>_0x10f47b['every']((_0x95ddee,_0x3fa734)=>_0x3b407c[_0x3fa734]===_0x95ddee||'*'===_0x3b407c[_0x3fa734]));}function _0x53a75e(){return _0x44b63b&&_0x3fdfb6?new window['Promise']((_0x439d00,_0x1bea1e)=>{_0x44b63b['then'](_0x439d00,_0x1bea1e),_0x3fdfb6['then'](_0x481c5f=>{'Valid'!=_0x481c5f&&_0x439d00(_0x481c5f);},_0x1bea1e);}):_0x44b63b||_0x3fdfb6||'Valid';}}function _0x22e3f2(_0x41a541,_0x2e44e9){return new window['Promise'](_0x3b528c=>{if(_0x3bd45f())return _0x3b528c('Valid');_0x4580b3(),_0x5045f9['decorate']('_sendUsageRequest');let _0x29665b=!0x1;const _0x237b75=_0x185ea0();function _0x3a343b(_0x21036a){return!!_0x21036a&&('object'==typeof _0x21036a||'function'==typeof _0x21036a)&&'function'==typeof _0x21036a['then']&&'function'==typeof _0x21036a['catch'];}function _0x17bfd0(_0x20cf4c){_0x4e7c06(_0x20cf4c)['then'](_0x32c8b4=>_0x32c8b4&&'ok'==_0x32c8b4['status']?_0x5dea99(_0x4d630d(_0x237b75+_0x2e44e9))!=_0x32c8b4['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x39de35=>(_0x5eed40(),_0x39de35),()=>{const _0x4388f8=_0x18073f();return null==_0x4388f8?(_0x5eed40(),'Valid'):_0x2cac14-_0x4388f8>0x240c8400?'UsageLimit':'Valid';})['then'](_0x3b528c)['catch'](()=>{_0x3b528c('UsageLimit');});const _0x3cbb60=0x36ee80;function _0x5eed40(){const _0x3530f2='llct-'+_0x5dea99(_0x4d630d(_0x41a541)),_0x3707b5=_0x1bd57f(_0x5dea99(window['Math']['ceil'](_0x2cac14/_0x3cbb60)));window['localStorage']['setItem'](_0x3530f2,_0x3707b5);}function _0x18073f(){const _0x12f464='llct-'+_0x5dea99(_0x4d630d(_0x41a541)),_0x482d00=window['localStorage']['getItem'](_0x12f464);return _0x482d00?window['parseInt'](_0x1bd57f(_0x482d00),0x10)*_0x3cbb60:null;}function _0x4e7c06(_0x5ba112){return new window['Promise']((_0x295168,_0x191a62)=>{_0x5ba112['then'](_0x295168,_0x191a62),window['setTimeout'](_0x191a62,0x1d4c0);});}}_0x5045f9['on']('_sendUsageRequest',(_0x3fb637,_0x29b8bb)=>{if(_0x29b8bb[0x0]!=_0x41a541)return _0x3b528c('UsageLimit');_0x29b8bb[0x1]={..._0x29b8bb[0x1],'requestId':_0x237b75};},{'priority':'high'}),_0x5045f9['on']('_sendUsageRequest',_0x184d72=>{_0x3a343b(_0x184d72['return'])&&(_0x29665b=!0x0,_0x17bfd0(_0x184d72['return']));},{'priority':'low'}),_0xc47546['then'](()=>{_0x29665b||_0x3b528c('UsageLimit');});});function _0x3bd45f(){return'auto'==_0x5045f9['editing']['view']['_overlayModeHint'];}function _0x4580b3(){_0x5045f9['editing']['view']['_overlayModeHint']='auto';}}function _0x4d4c62(_0x2d8fb0){const _0x382511=[new window['Promise'](_0x11a024=>setTimeout(_0x11a024,0x93ecc)),_0xc47546['then'](()=>new window['Promise'](_0x57147e=>{let _0x52a095=0x0;_0x5045f9['model']['on']('applyOperation',(_0x5da602,_0x55fdeb)=>{_0x55fdeb[0x0]['isDocumentOperation']&&_0x52a095++,0x5e8==_0x52a095&&(_0x57147e(),_0x5da602['off']());});}))];return window['Promise']['race'](_0x382511)['then'](()=>_0x2d8fb0);}async function _0x4865b3(){await _0xc47546,_0x5045f9['model']['change']=_0x5dfef6,_0x5045f9['model']['enqueueChange']=_0x5dfef6,_0x5045f9['enableReadOnlyMode']('model');}function _0x3b5c62(){return window['glob']&&window['glob']['triliumVersion'];}function _0x11c9b5(){return _0x520049('WebSocketGateway')&&'connected'==_0xcd2ae3('WebSocketGateway')['state'];}function _0x336f58(){return _0x520049('RevisionViewerIntegration');}function _0x37d112(){return _0x520049('TrackChangesDataGetter');}function _0x1a352b(_0x58dc0e){const _0x5ab112=_0x3e990a();_0x5045f9[_0x5ab112]='commentsLicenseKey'+_0x58dc0e,'Valid'!=_0x58dc0e&&_0x4865b3();}function _0x3e990a(){const _0x5ad2b8=window['String'](window['performance']['now']())['replace']('.','');let _0x55cc5e='m';for(let _0x368d42=0x0;_0x368d42<_0x5ad2b8['length'];_0x368d42+=0x2){let _0x3028a2=window['parseInt'](_0x5ad2b8['substring'](_0x368d42,_0x368d42+0x2));_0x3028a2>=0x3e&&(_0x3028a2-=0x3e),_0x55cc5e+=_0x32ba48[_0x3028a2];}return _0x55cc5e;}function _0xf82203(){const _0x533d0f=_0x5481fb['split']('.');if(0x3!=_0x533d0f['length'])return null;return _0x5c0b67(_0x533d0f[0x1]);function _0x5c0b67(_0x5d963d){const _0x288779=_0x23fd63(_0x5d963d);return _0x288779&&_0x175aa1()?_0x288779:null;function _0x175aa1(){const _0x47cad1=_0x288779['jti'],_0xfa3de4=window['parseInt'](_0x47cad1['substring'](_0x47cad1['length']-0x8),0x10),_0x103901={..._0x288779,'jti':_0x47cad1['substring'](0x0,_0x47cad1['length']-0x8)};return delete _0x103901['vc'],_0x4d630d(_0x103901)==_0xfa3de4;}}}async function _0x25e317(){let _0x1f0c07=!0x0;try{const [_0x37295b,_0x1bbd8f,_0x34ad1f]=_0x5481fb['split']('.');return _0x317ecf(_0x37295b),await _0x2d6771(_0x37295b,_0x1bbd8f,_0x34ad1f),_0x1f0c07;}catch{return!0x1;}function _0x317ecf(_0xa27e2d){const _0x143295=_0x23fd63(_0xa27e2d);_0x143295&&'ES256'==_0x143295['alg']||(_0x1f0c07=!0x1);}async function _0x2d6771(_0x13a80a,_0x4deb4c,_0x126983){const _0x25f956=window['Uint8Array']['from'](_0x3396f5(_0x126983),_0x1e28d5=>_0x1e28d5['charCodeAt'](0x0)),_0x433798=new window['TextEncoder']()['encode'](_0x13a80a+'.'+_0x4deb4c),_0x522948=window['crypto']['subtle'];if(!_0x522948)return;const _0x4cef92=await _0x522948['importKey']('jwk',_0x2e4434,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x522948['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x4cef92,_0x25f956,_0x433798)||(_0x1f0c07=!0x1);}}function _0x23fd63(_0x8fc24e){return _0x8fc24e['startsWith']('ey')?JSON['parse'](_0x3396f5(_0x8fc24e)):null;}function _0x3396f5(_0x533508){return window['atob'](_0x533508['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x4d630d(_0x3b2201){let _0xb45a7c=0x1505;function _0x3b89f5(_0x92371f){for(let _0x32c8d6=0x0;_0x32c8d6<_0x92371f['length'];_0x32c8d6++){const _0x4281a7=_0x92371f['charCodeAt'](_0x32c8d6);_0xb45a7c=(_0xb45a7c<<0x5)+_0xb45a7c+_0x4281a7,_0xb45a7c&=_0xb45a7c;}}function _0x202f5b(_0x41a781){Array['isArray'](_0x41a781)?_0x41a781['forEach'](_0x202f5b):_0x41a781&&'object'==typeof _0x41a781?Object['entries'](_0x41a781)['sort']()['forEach'](([_0x245cad,_0x1ae70a])=>{_0x3b89f5(_0x245cad),_0x202f5b(_0x1ae70a);}):_0x3b89f5(window['String'](_0x41a781));}return _0x202f5b(_0x3b2201),_0xb45a7c>>>0x0;}function _0x5dea99(_0xa57399){return _0xa57399['toString'](0x10)['padStart'](0x8,'0');}function _0x1bd57f(_0x3bf5b9){return _0x3bf5b9['split']('')['reverse']()['join']('');}function _0x520049(_0x5862e6){return _0x5045f9['plugins']['has'](_0x5862e6);}function _0xcd2ae3(_0x2b14b9){return _0x5045f9['plugins']['get'](_0x2b14b9);}function _0x5dfef6(){}_0x1a352b(await _0x2ae980());}_0x29cc88(_0x318ffb['editor']);}(this);}destroy(){const _0xb85092=this['editor']['plugins']['get'](oi),_0x36099d=this['editor']['config']['get']('collaboration.channelId');for(const _0x3cff94 of _0xb85092['getCommentThreads']({'channelId':_0x36099d}))_0xb85092['_detachCommentThread'](_0x3cff94['id']),_0xb85092['_threads']['delete'](_0x3cff94['id']);super['destroy']();}['hasMarkerForId'](_0x27cc0d){return this['getAllMarkersForId'](_0x27cc0d)['length']>0x0;}getAllMarkersForId(_0x2d9642){const _0x2f9af7=[];for(const _0x4cf065 of this['editor']['model']['markers'])_0x4cf065['name']['startsWith']('comment:'+_0x2d9642)&&_0x2f9af7['push'](_0x4cf065);return _0x2f9af7;}['scrollToThreadMarker'](_0x5241d0){setTimeout(()=>{const _0x22390a=this['_getTargetForId'](_0x5241d0);_0x22390a&&this['activeMarker']&&fi(this['activeMarker'])['id']===_0x5241d0&&_0x38c3bf({'target':_0x22390a[0x0],'viewportOffset':0x64,'alignToTop':!0x0});},0x32);}_reconvertMarkers(_0xd71a6b){this['editor']['model']['change'](()=>{for(const _0x59850e of this['getAllMarkersForId'](_0xd71a6b))this['editor']['editing']['reconvertMarker'](_0x59850e);});}_attachArchivedThread(_0x178275){const _0x1cc1c=this['editor']['plugins']['get'](oi),_0x39d012=this['editor']['plugins']['get'](di),_0x4bdcd2=_0x1cc1c['getCommentThread'](_0x178275);if(!_0x4bdcd2['isAttached']){const _0x533334=_0x4bdcd2['attachTo'](()=>this['_getTargetForId'](_0x4bdcd2['id']));_0x39d012['registerAnnotation'](_0x533334),_0x4bdcd2['_hasTargetInContent']=!0x1;}}_initializeMarkerConverters(){const _0x1e9ad3=this['editor'],_0x5c3eb6=_0x1e9ad3['plugins']['get'](_0x23b29b);_0x1e9ad3['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'comment','view':(_0x371e26,_0x193eef)=>{const {id:_0x3d3d62}=fi(_0x371e26['markerName']),_0x5835b4=_0x1e9ad3['plugins']['get'](oi)['getCommentThread'](_0x3d3d62),_0x2eddd9=this['activeMarker']&&fi(this['activeMarker'])['id']===_0x3d3d62;let _0x1089b1;if(_0x5835b4&&_0x5835b4['isResolved']&&!_0x2eddd9&&_0x371e26['item'])return _0x193eef['consumable']['consume'](_0x371e26['item'],'addMarker:'+_0x371e26['markerName']),_0x193eef['consumable']['consume'](_0x371e26['item'],'removeMarker:'+_0x371e26['markerName']),null;const _0x226daa=['ck-comment-marker'];return _0x2eddd9&&_0x226daa['push']('ck-comment-marker--active'),_0x1089b1=_0x5835b4?.['length']?_0x5835b4['comments']['first']['author']['id']:_0x5c3eb6['me']['id'],{'classes':_0x226daa,'attributes':{'data-comment':_0x3d3d62,'data-author-id':_0x1089b1}};}}),_0x1e9ad3['conversion']['for']('dataDowncast')['markerToData']({'model':'comment','view':(_0x568439,{options:_0x1f537c})=>{if(_0x1f537c['showCommentHighlights'])return null;const _0xee676c=_0x1e9ad3['plugins']['get'](oi),_0x4eae72=_0x1e9ad3['model']['markers']['get'](_0x568439),{id:_0x4c332e,part:_0x3745c2}=fi(_0x568439);return _0x4eae72&&!_0x4eae72['affectsData']||_0x1f537c['ignoreResolvedComments']&&_0xee676c['getCommentThread'](_0x4c332e)?.['isResolved']?null:{'group':'comment','name':_0x3745c2?_0x4c332e+':'+_0x3745c2:_0x4c332e};}}),_0x1e9ad3['conversion']['for']('upcast')['elementToElement']({'view':{'name':'comment','attributes':{'id':/^\w/}},'model':(_0x7da22b,{writer:_0x586452})=>_0x586452['createElement']('$marker',{'data-name':'comment:'+_0x7da22b['getAttribute']('id')})}),_0x1e9ad3['conversion']['for']('upcast')['dataToMarker']({'view':'comment'});}['_handleMarkerAddAndRemove'](){const _0x49ddfe=this['editor'],_0x18d3a=_0x49ddfe['plugins']['get'](oi),_0x6ee393=new Set(),_0x47d703=new Set();_0x49ddfe['model']['document']['registerPostFixer'](_0xfa26c4=>{let _0x3e3496=!0x1;for(const {name:_0x2345c6,data:_0x53cf97}of _0x49ddfe['model']['document']['differ']['getChangedMarkers']()){const {group:_0xa2eb01,id:_0x1bd5d8}=fi(_0x2345c6);let _0x595d11=_0x53cf97['newRange'];if('comment'!==_0xa2eb01||!_0x595d11)continue;const _0x21f27c='$graveyard'===_0x595d11['root']['rootName'];_0x21f27c||(_0x595d11=_i(_0x595d11,_0x49ddfe['model']),!_0x595d11||_0x595d11['isCollapsed']||!_0x53cf97['newRange']||_0x595d11['isEqual'](_0x53cf97['newRange']))?_0x49ddfe['model']['hasContent'](_0x595d11)&&!_0x21f27c?this['isThreadsLoadingPaused']?_0x6ee393['add'](_0x2345c6):this['_handleThreadMarker'](_0x2345c6,_0x1bd5d8):(_0x47d703['add'](_0x2345c6),_0x6ee393['delete'](_0x2345c6),_0xfa26c4['removeMarker'](_0x2345c6),_0x3e3496=!0x0):(_0xfa26c4['updateMarker'](_0x2345c6,{'range':_0x595d11}),_0x3e3496=!0x0);}return _0x3e3496;}),this['on']('change:isThreadsLoadingPaused',(_0x3c3a75,_0x286d5f,_0x5b182e)=>{if(!_0x5b182e&&_0x6ee393['size'])for(const _0xcee4b3 of _0x6ee393){const {id:_0x4fc8bb}=fi(_0xcee4b3);_0x6ee393['delete'](_0xcee4b3),_0x49ddfe['model']['markers']['get'](_0xcee4b3)&&this['_handleThreadMarker'](_0xcee4b3,_0x4fc8bb);}}),this['listenTo'](_0x49ddfe['model']['document'],'change',()=>{for(const {name:_0x4cff8a,data:{newRange:_0x44f9aa}}of _0x49ddfe['model']['document']['differ']['getChangedMarkers']()){const {group:_0x2eb2c0,id:_0x1a8e9b}=fi(_0x4cff8a);if('comment'!==_0x2eb2c0)continue;const _0x43b9b2=_0x18d3a['getCommentThread'](_0x1a8e9b),_0x4fd7e3=this['hasMarkerForId'](_0x1a8e9b);_0x43b9b2&&(!_0x43b9b2['_hasTargetInContent']&&_0x44f9aa&&_0x49ddfe['editing']['view']['once']('render',()=>{const _0x5daef6=_0x49ddfe['plugins']['get'](ti),_0x58bcd5=_0x18d3a['_threadToController']['get'](_0x43b9b2)['view'];_0x5daef6['getByInnerView'](_0x58bcd5)['refreshVisibility']();},{'priority':'low'}),_0x43b9b2['_hasTargetInContent']=_0x4fd7e3||!!_0x44f9aa),_0x44f9aa||(_0x47d703['add'](_0x4cff8a),_0x6ee393['delete'](_0x4cff8a));}for(const _0x130c78 of _0x47d703){const {id:_0x483494}=fi(_0x130c78),_0x50d4db=_0x18d3a['getCommentThread'](_0x483494);if(_0x6ee393['delete'](_0x130c78),!_0x50d4db)continue;const _0x3274f3=this['hasMarkerForId'](_0x483494);_0x3274f3||_0x50d4db['isSubmitted']?_0x3274f3||_0x50d4db['unlinkedAt']||_0x50d4db['setUnlinkedAt'](new Date()):_0x50d4db['remove']();}_0x47d703['clear']();});}_handleInitialThreads(_0x1d1d7b){_0x1d1d7b['forEach'](_0x59869e=>{_0x59869e['unlinkedAt']&&this['_attachArchivedThread'](_0x59869e['id']);});}_getTargetForId(_0x2c12f2){const _0x494e7e=this['editor'],_0x3af908=this['getAllMarkersForId'](_0x2c12f2);return _0x71726c(_0x494e7e['editing'],_0x3af908);}_getTextContext(_0x4352bf){const _0xfe86dd=this['getAllMarkersForId'](_0x4352bf);let _0x4c0d55='',_0x3309dd=!0x1;for(const _0x3af153 of _0xfe86dd){const _0x19fc57=_0x3af153['getRange']();for(const _0x227a9d of Array['from'](_0x19fc57['getItems']()))_0x227a9d['is']('$textProxy')?(_0x4c0d55&&_0x3309dd&&(_0x4c0d55+='\x20',_0x3309dd=!0x1),_0x4c0d55+=_0x227a9d['data']):_0x3309dd=!0x0;_0x3309dd=!0x0;}return _0x4c0d55['substring'](0x0,0x96);}_attachMarkerToThread(_0x561a7c,_0x453aa3){const _0x53ee4e=this['editor'],_0x31bea8=_0x53ee4e['plugins']['get'](oi);let _0x3935af=_0x31bea8['getCommentThread'](_0x453aa3);const _0x5c4480=_0x53ee4e['config']['get']('collaboration.channelId'),_0x2a0f84=_0x53ee4e['plugins']['get'](di);return _0x3935af&&(_0x3935af['unlinkedAt']&&_0x3935af['setUnlinkedAt'](null),_0x3935af['isAttached'])||(this['getAllMarkersForId'](_0x453aa3)[0x0]['managedUsingOperations']?_0x31bea8['fetchCommentThread']({'channelId':_0x5c4480,'threadId':_0x453aa3})['then'](_0x540ae2=>{if('destroyed'!==_0x53ee4e['state']){if(_0x3935af=_0x540ae2,_0x3935af&&!_0x3935af['isAttached']){const _0x39f589=_0x3935af['attachTo'](()=>this['_getTargetForId'](_0x453aa3));_0x2a0f84['registerAnnotation'](_0x39f589),_0x3935af['isResolved']&&this['_reconvertMarkers'](_0x453aa3);}else{if(!_0x3935af){const _0x645635=this['getAllMarkersForId'](_0x453aa3);_0x53ee4e['model']['change'](_0x53dafd=>{for(const _0x44f648 of _0x645635)_0x53dafd['removeMarker'](_0x44f648);});}}}}):_0x53ee4e['editing']['view']['once']('render',()=>{if(_0x31bea8['getCommentThread'](_0x453aa3))return;const _0x2e633c=_0x53ee4e['plugins']['get'](ti);_0x3935af=_0x31bea8['openNewCommentThread']({'channelId':_0x5c4480,'threadId':_0x453aa3,'target':()=>this['_getTargetForId'](_0x453aa3),'context':{'type':'text','value':this['_getTextContext'](_0x453aa3)}});const _0x7e5e25=_0x31bea8['_threadToController']['get'](_0x3935af)['view'],_0x5ee211=_0x2e633c['getByInnerView'](_0x7e5e25);_0x5ee211&&_0x2a0f84['registerAnnotation'](_0x5ee211);},{'priority':'low'})),_0x3935af;}['_handleThreadMarker'](_0x15c149,_0x48b201){const _0x7cf440=this['_attachMarkerToThread'](_0x15c149,_0x48b201);_0x7cf440&&!_0x7cf440['context']&&_0x7cf440['setContext']({'type':'text','value':this['_getTextContext'](_0x48b201)});}_initAriaMarkerChangeAnnouncements(){const _0x522f2e=this['editor'];_0x1b50a0(_0x522f2e['model'],({left:_0x23b951,entered:_0x378521})=>{for(const _0x345699 of _0x23b951)if(Ai(_0x345699)){_0x522f2e['ui']['ariaLiveAnnouncer']['announce'](Et(_0x522f2e['locale'],'LEAVE_COMMENT_ANNOUNCEMENT'));break;}for(const _0x5c1290 of _0x378521)if(Ai(_0x5c1290)){_0x522f2e['ui']['ariaLiveAnnouncer']['announce'](Et(_0x522f2e['locale'],'ENTER_COMMENT_ANNOUNCEMENT',_0x10baf1(_0x14d518)));break;}});}};function gi(_0x4bc4a4,_0x31533b){return _0x31533b?_0x4bc4a4+':'+_0x31533b:_0x4bc4a4;}function _i(_0x11f325,_0x5e519a){const _0x4601e9=_0x5e519a['schema'],_0x95ef8c=_0x5e519a['createRange'](_0x11f325['start']);for(const _0x1da677 of _0x11f325['getWalker']()){const {type:_0x15942c,item:_0x53074f,nextPosition:_0x3e945c}=_0x1da677;if('text'===_0x15942c||_0x4601e9['isObject'](_0x53074f)){const _0x2ce602=_0x5e519a['createPositionBefore'](_0x53074f);_0x95ef8c['isCollapsed']&&(_0x95ef8c['start']=_0x2ce602),_0x95ef8c['end']=_0x3e945c;}}return _0x95ef8c;}function Ai(_0x4fd141){return'comment'===fi(_0x4fd141['name'])['group'];}var vi=class extends _0x12b188{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'CommentsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[oi,wi,di,ti];}get CommentsListView(){return Lt;}get CommentThreadInputView(){return xt;}init(){const _0x97ed01=this['editor'],_0x2d37b8=_0x97ed01['plugins']['get'](oi),_0x478806=_0x97ed01['plugins']['get'](wi),_0x788aa8=_0x97ed01['plugins']['get'](ti),_0x16d217=_0x97ed01['plugins']['get'](di);_0x97ed01['ui']['componentFactory']['add']('comment',()=>{const _0x3c00cd=this['_createUIButton'](_0x422b1d);return _0x3c00cd['tooltip']=!0x0,_0x3c00cd;}),_0x97ed01['ui']['componentFactory']['add']('menuBar:comment',()=>this['_createUIButton'](rt)),_0x16d217['addSourceCollector'](()=>{const _0x140972=[];for(const [_0x19435c,_0x3df7b1]of _0x2d37b8['_threadToController']){const _0x41d9c8=_0x478806['getAllMarkersForId'](_0x19435c['id']),_0x7fa154=_0x41d9c8['map'](_0x223115=>_0x223115['getRange']());_0x41d9c8['length']>0x0&&_0x140972['push']([_0x3df7b1['view'],_0x7fa154]);}return _0x140972;}),this['listenTo'](_0x788aa8,'change:activeAnnotations',(_0x2f5f1b,_0x5b3294,_0x3bb572)=>{const _0x290ff3=Array['from'](_0x3bb572)['map'](_0x17042d=>_0x17042d['innerView'])['find'](_0x3093b6=>_0x2d37b8['_viewToController']['has'](_0x3093b6));if(!_0x290ff3)return void(_0x478806['activeMarker']=null);const _0x44279f=_0x2d37b8['_viewToController']['get'](_0x290ff3)['model']['id'],_0xf8d4ca='comment:'+_0x44279f;_0x44279f&&_0x478806['hasMarkerForId'](_0x44279f)?_0x478806['activeMarker']=_0xf8d4ca:_0x478806['activeMarker']&&(_0x478806['activeMarker']=null);}),this['listenTo'](_0x2d37b8,'removeCommentThread',(_0x11395b,{threadId:_0x546fae,isFromAdapter:_0x1ca09d})=>{!_0x1ca09d&&_0x97ed01['ui']['focusTracker']['isFocused']&&_0x478806['hasMarkerForId'](_0x546fae)&&_0x97ed01['editing']['view']['focus']();},{'priority':'highest'}),this['listenTo'](_0x2d37b8,'addComment',(_0x3a77e8,{threadId:_0x17d6a1,isFromAdapter:_0x2adc22})=>{!_0x2adc22&&_0x478806['hasMarkerForId'](_0x17d6a1)&&_0x2d37b8['hasCommentThread'](_0x17d6a1)&&0x1===_0x2d37b8['getCommentThread'](_0x17d6a1)['length']&&(_0x97ed01['editing']['view']['focus'](),_0x3a77e8['stop']());},{'priority':'low'}),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x423141=[this['editor']];for(const _0x51987c of _0x423141){let _0x4d31f0;for(const _0x532973 in _0x51987c){const _0x478528=_0x532973,_0x4e28f9=_0x51987c[_0x478528];if('commentsLicenseKeyValid'==_0x4e28f9||'commentsLicenseKeyInvalid'==_0x4e28f9||'commentsLicenseKeyExpired'==_0x4e28f9||'commentsLicenseKeyDomainLimit'==_0x4e28f9||'commentsLicenseKeyNotAllowed'==_0x4e28f9||'commentsLicenseKeyEvaluationLimit'==_0x4e28f9||'commentsLicenseKeyUsageLimit'==_0x4e28f9){delete _0x51987c[_0x478528],_0x4d31f0=_0x4e28f9,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'commentsLicenseKeyInvalid'==_0x4d31f0&&_0x51987c['_showLicenseError']('invalid'),'commentsLicenseKeyExpired'==_0x4d31f0&&_0x51987c['_showLicenseError']('expired'),'commentsLicenseKeyDomainLimit'==_0x4d31f0&&_0x51987c['_showLicenseError']('domainLimit'),'commentsLicenseKeyNotAllowed'==_0x4d31f0&&_0x51987c['_showLicenseError']('featureNotAllowed','Comments'),'commentsLicenseKeyEvaluationLimit'==_0x4d31f0&&_0x51987c['_showLicenseError']('evaluationLimit'),'commentsLicenseKeyUsageLimit'==_0x4d31f0&&_0x51987c['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_createUIButton(_0x213ade){const _0x48a0ef=this['editor'],_0x5e7cb3=new _0x213ade(_0x48a0ef['locale']),_0x36a460=_0x48a0ef['commands']['get']('addCommentThread');return _0x5e7cb3['set']({'label':Et(_0x48a0ef['locale'],'Comment'),'icon':_0x1aed3d}),_0x5e7cb3['bind']('isEnabled')['to'](_0x36a460,'isEnabled',_0x36a460,'hasContent',(_0x4aedbc,_0xdc12ba)=>_0x4aedbc&&_0xdc12ba),this['listenTo'](_0x5e7cb3,'execute',()=>{_0x36a460['execute']();}),_0x5e7cb3;}},yi=class extends _0x12b188{static get['pluginName'](){return'CommentsOnly';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[wi];}constructor(_0x3ee928){super(_0x3ee928),this['set']('isEnabled',!0x1),this['on']('change:isEnabled',(_0x144828,_0x14c81e,_0x7a3e08)=>{_0x7a3e08?this['_enableCommentsOnlyMode']():this['_disableCommentsOnlyMode']();});}afterInit(){!this['isEnabled']&&this['editor']['config']['get']('commentsOnly')&&(this['isEnabled']=!0x0);}_enableCommentsOnlyMode(){for(const [_0x134410,_0x39b8f1]of this['editor']['commands'])_0x39b8f1['affectsData']&&'addCommentThread'!==_0x134410&&_0x39b8f1['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 _0x190c33=this['editor']['editing']['view']['document'];this['listenTo'](_0x190c33,'cut',_0x112df9=>_0x112df9['stop'](),{'priority':'highest'}),this['listenTo'](_0x190c33,'clipboardInput',_0xae6934=>_0xae6934['stop'](),{'priority':'highest'}),this['listenTo'](_0x190c33,'delete',_0x29284f=>_0x29284f['stop'](),{'priority':'highest'});}_disableCommentsOnlyMode(){for(const [_0x43d769,_0x2eb63d]of this['editor']['commands'])_0x2eb63d['affectsData']&&'addCommentThread'!==_0x43d769&&_0x2eb63d['clearForceDisabled']('commentsOnlyMode');this['editor']['plugins']['has']('RevisionTracker')&&this['editor']['plugins']['get']('RevisionTracker')['clearForceDisabled']('commentsOnlyMode'),this['editor']['plugins']['has']('SourceEditing')&&this['editor']['plugins']['get']('SourceEditing')['clearForceDisabled']('commentsOnlyMode'),this['editor']['commands']['get']('editSource')?.['clearForceDisabled']('commentsOnlyMode'),this['stopListening'](this['editor']['editing']['view']['document']);}},Ti=class extends _0xe32c07{activeUIs;uisData;['_uis'];static get requires(){return[ti];}static get['pluginName'](){return'AnnotationsUIs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4d0a76){super(_0x4d0a76),this['activeUIs']=new Set(),this['_uis']=new Map(),this['uisData']=new Map();}init(){const _0x41ebb4=this['context']['plugins']['get'](ti);this['listenTo'](_0x41ebb4,'_activateAnnotation',(_0x2759d9,_0x18d93d)=>{for(const _0x205667 of this['activeUIs']){const _0x3b8f61=this['_uis']['get'](_0x205667);(0x0,this['uisData']['get'](_0x205667)['filter'])(_0x18d93d)&&_0x3b8f61['setActiveAnnotation'](_0x18d93d);}}),this['listenTo'](_0x41ebb4,'_deactivateAllAnnotations',()=>{for(const _0x97420f of this['activeUIs'])this['_uis']['get'](_0x97420f)['setActiveAnnotation'](null);}),this['listenTo'](_0x41ebb4['_visibleAnnotations'],'add',(_0x4bd147,_0x364eaa)=>{this['_assertAnnotationDoesNotBelongToMultipleUIs'](_0x364eaa);});}hasActive(){return this['activeUIs']['size']>0x0;}isActive(_0x362407){return this['activeUIs']['has'](_0x362407);}activate(_0x3ee74d,_0x219bec=this['defaultFilter']){const _0x4343d0=this['context']['plugins']['get'](ti);if(!this['_uis']['has'](_0x3ee74d))throw new _0x3fd207('annotationsuis-missing-ui',this,{'uiName':_0x3ee74d});this['isActive'](_0x3ee74d)&&this['deactivate'](_0x3ee74d),this['activeUIs']['add'](_0x3ee74d);const _0x12e9e2=new Jt();Qt({'source':_0x4343d0['_visibleAnnotations'],'target':_0x12e9e2,'filter':_0x219bec}),this['uisData']['set'](_0x3ee74d,{'collection':_0x12e9e2,'filter':_0x219bec});const _0x7dac82=this['_uis']['get'](_0x3ee74d);_0x7dac82['attach'](_0x12e9e2),this['listenTo'](_0x7dac82,'change:activeAnnotation',(_0x142760,_0x410503,_0x45d1b0,_0x1d39ba)=>{_0x1d39ba&&_0x4343d0['_removeActiveAnnotation'](_0x1d39ba),_0x45d1b0&&_0x4343d0['_addActiveAnnotation'](_0x45d1b0);});}deactivate(_0x204947){if(this['activeUIs']['delete'](_0x204947),!this['_uis']['has'](_0x204947))throw new _0x3fd207('annotationsuis-missing-ui',this,{'uiName':_0x204947});const _0x30905e=this['_uis']['get'](_0x204947);_0x30905e['detach'](),this['stopListening'](_0x30905e),this['uisData']['get'](_0x204947)['collection']['destroy'](),this['uisData']['delete'](_0x204947);}switchTo(_0x47253e){if(!this['_uis']['has'](_0x47253e))throw new _0x3fd207('annotationsuis-missing-ui',this,{'uiName':_0x47253e});const _0xd599d3=this['context']['plugins']['get'](ti),_0x3f137d=Array['from'](_0xd599d3['activeAnnotations'])[0x0]||null;this['deactivateAll'](),this['activate'](_0x47253e);const _0x1763f4=this['_uis']['get'](_0x47253e);_0x1763f4['setActiveAnnotation'](_0x3f137d),_0x1763f4['_setSelectedAnnotations']&&_0x3f137d&&_0x1763f4['_setSelectedAnnotations']([_0x3f137d]);}deactivateAll(){for(const _0x1bf476 of this['activeUIs'])this['deactivate'](_0x1bf476);}register(_0x596344,_0x166e58){if(this['_uis']['has'](_0x596344))throw new _0x3fd207('annotationsuis-register-already-registered');if('function'!=typeof _0x166e58['attach']||'function'!=typeof _0x166e58['detach']||'function'!=typeof _0x166e58['setActiveAnnotation'])throw new _0x3fd207('annotationsuis-register-invalid-interface',null);this['_uis']['set'](_0x596344,_0x166e58);}refilterAnnotations(){const _0x4cc564=this['context']['plugins']['get'](ti)['collection'],_0x2688ce=new Map(),_0x5c4be0=Array['from'](this['activeUIs']);for(const _0x26a21e of this['activeUIs']){const _0xf230ea=this['uisData']['get'](_0x26a21e)['collection'];for(const _0x3bffba of _0xf230ea)_0x2688ce['set'](_0x3bffba,_0x26a21e);}for(const _0x491928 of _0x4cc564){const _0x4d7322=_0x2688ce['get'](_0x491928);this['_assertAnnotationDoesNotBelongToMultipleUIs'](_0x491928);const _0x41f5e9=_0x5c4be0['find'](_0x4b99a2=>this['uisData']['get'](_0x4b99a2)['filter'](_0x491928));_0x4d7322!==_0x41f5e9&&(_0x4d7322&&this['uisData']['get'](_0x4d7322)['collection']['remove'](_0x491928),_0x41f5e9&&this['uisData']['get'](_0x41f5e9)['collection']['add'](_0x491928));}}destroy(){this['deactivateAll'](),super['destroy']();}defaultFilter(){return!0x0;}_assertAnnotationDoesNotBelongToMultipleUIs(_0x3cab90){const _0xee5f8a=[];for(const _0x40e466 of this['activeUIs']){(0x0,this['uisData']['get'](_0x40e466)['filter'])(_0x3cab90)&&_0xee5f8a['push'](_0x40e466);}if(_0xee5f8a['length']>0x1)throw new _0x3fd207('annotationsuis-annotation-mismatch',null,{'matchedUIs':_0xee5f8a,'annotationType':_0x3cab90['type']});}};const Ci=/* #__PURE__ -- @preserve */
|
|
32
|
+
_0x26abaa('px');var Ii=class extends ht{list;['focusables'];['focusTracker'];['focusCycler'];constructor(_0x39f3f6){super(_0x39f3f6);const _0x1278a8=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 _0x4804cc(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker']}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-sidebar','ck-reset',_0x1278a8['to']('class')],'style':{'minHeight':_0x1278a8['to']('minHeight',_0x2e2070=>'number'==typeof _0x2e2070?Ci(_0x2e2070+0xa):null)},'dir':_0x39f3f6['uiLanguageDirection'],'role':'application','aria-label':Et(_0x39f3f6,'Annotations\x20sidebar'),'tabindex':0x0},'children':[{'tag':'div','attributes':{'role':'list','aria-label':Et(_0x39f3f6,'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',_0x591fe9=>{this['_updateItemPositionInFocusables'](_0x591fe9['source']);}),this['list']['forEach'](_0x31ff7b=>{this['focusTracker']['add'](_0x31ff7b['element']),this['_updateItemPositionInFocusables'](_0x31ff7b);}),this['list']['on']('change',(_0x52e7b6,_0x217e59)=>{for(const _0x3f6c1f of _0x217e59['removed'])this['focusTracker']['remove'](_0x3f6c1f['element']),this['focusables']['remove'](_0x3f6c1f);for(const _0x47d3ec of _0x217e59['added'])this['focusTracker']['add'](_0x47d3ec['element']),this['_updateItemPositionInFocusables'](_0x47d3ec);}),this['on']('arrowup',()=>{this['focusCycler']['focusPrevious']();}),this['on']('arrowdown',()=>{this['focusCycler']['focusNext']();}),this['listenTo'](this['element'],'focus',()=>{this['focus']();});}_updateItemPositionInFocusables(_0x2d540a){const _0x289dc7=this['focusables']['getIndex'](_0x2d540a);let _0x4896ab,_0x44a3de;for(const _0x12e0d2 of this['focusables'])if(_0x2d540a['top']<_0x12e0d2['top']){_0x4896ab=_0x12e0d2;break;}if(_0x44a3de=_0x4896ab?this['focusables']['getIndex'](_0x4896ab):this['focusables']['length'],-0x1!==_0x289dc7){if(_0x289dc7===_0x44a3de-0x1)return;this['focusables']['remove'](_0x2d540a),_0x44a3de=_0x4896ab?this['focusables']['getIndex'](_0x4896ab):this['focusables']['length'];}this['focusables']['add'](_0x2d540a,_0x44a3de);}};const bi=/* #__PURE__ -- @preserve */
|
|
33
|
+
_0x26abaa('px');var Ei=class extends ht{content;_targetTop;_mutationObserver;constructor(_0x454be6){super(_0x454be6),this['set']('top',0x0),this['set']('height',0x0),this['bind']('bottom')['to'](this,'top',this,'height',(_0x52c464,_0x5932fa)=>_0x52c464+_0x5932fa),this['set']('isAnimationDisabled',!0x1),this['_mutationObserver']=Xt(()=>this['updateHeight']()),this['_targetTop']=null,this['content']=this['createCollection'](),this['content']['delegate']('arrowup','arrowdown')['to'](this);const _0xafca0=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-sidebar-item',_0xafca0['to']('isAnimationDisabled',_0x3aa3ce=>_0x3aa3ce?'ck-sidebar-item--no-animation':'')],'style':{'top':_0xafca0['to']('top',_0xb3beb7=>bi(_0xb3beb7))},'role':'presentation'},'children':this['content']});}['render'](){super['render'](),this['_mutationObserver']['attach'](this['element']);}['focus'](){this['content']['first']&&this['content']['first']['focus']();}updateHeight(){const _0x1af654=this['element']['clientHeight'];_0x1af654&&(this['height']=_0x1af654);}destroy(){this['content']['clear'](),this['_mutationObserver']['detach'](),super['destroy']();}},ki=class extends _0xe32c07{['view'];_activeAnnotation;_annotations;_spaceBetweenItems;_sidebarItemViewToAnnotation;_annotationToSidebarItemView;_recalculateBuffer;static get['pluginName'](){return'Sidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x848b0a){super(_0x848b0a),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 _0x5aea61=this['context']['config']['get']('sidebar.container');_0x5aea61&&this['setContainer'](_0x5aea61);}setContainer(_0x441ca0){if(!Oi(_0x441ca0))throw new _0x3fd207('sidebar-setcontainer-invalid-element');this['container']=_0x441ca0;}_attachToContainer({viewClass:_0x52ed99='',spaceBetweenItems:_0x142c81=0x19}={}){if(!Oi(this['container']))throw new _0x3fd207('sidebar-attachtocontainer-missing-container',this);this['container']['appendChild'](this['view']['element']),this['view']['class']=_0x52ed99,this['_spaceBetweenItems']=_0x142c81;}['rearrange']({removedAnnotation:_0x1b5a7b,previousAnnotation:_0x3c5b10,nextAnnotation:_0x43441c}){const _0x486baf=this['getSidebarItemView'](_0x1b5a7b);this['view']['list']['remove'](_0x486baf),this['_destroySidebarItemView'](_0x1b5a7b),_0x3c5b10&&this['_alignToTargetRect'](this['getSidebarItemView'](_0x3c5b10)),_0x43441c&&this['_alignToTargetRect'](this['getSidebarItemView'](_0x43441c)),this['_updateLastItem']();}['refresh']({blurredAnnotation:_0x43de77,activatedAnnotation:_0x23f1d8,disableAnimationOnActivatedAnnotation:_0x573cc2}){if(this['_activeAnnotation']=_0x23f1d8,_0x43de77){_0x43de77['isActive']=!0x1;const _0x3e0443=this['getSidebarItemView'](_0x43de77);_0x3e0443&&_0x573cc2&&(_0x3e0443['isAnimationDisabled']=!0x1);}if(_0x23f1d8){const _0x3c8a49=this['getSidebarItemView'](_0x23f1d8);_0x3c8a49&&(_0x23f1d8['isActive']=!0x0,_0x573cc2&&(_0x3c8a49['isAnimationDisabled']=!0x0,_0x3c8a49['top']+=0x1),this['_alignToTargetRect'](_0x3c8a49));}}_detachFromContainer(_0x3d061e){if(this['view']['element']['remove'](),_0x3d061e){for(const _0x2be3b3 of _0x3d061e)this['_destroySidebarItemView'](_0x2be3b3);}this['view']['list']['clear'](),this['view']['class']='',this['_lastItem']=null;}addAnnotation(_0x20fa99,_0x5d2b30){_0x5d2b30||(_0x5d2b30=_0x20fa99['view']);const _0x1b40b7=new Ei(this['context']['locale']);this['_sidebarItemViewToAnnotation']['set'](_0x1b40b7,_0x20fa99),this['_annotationToSidebarItemView']['set'](_0x20fa99,_0x1b40b7),_0x1b40b7['content']['add'](_0x5d2b30),this['listenTo'](_0x20fa99['view'],'change:targetRect',(_0x32bb0a,_0x93d532,_0x3ec6ea)=>{const _0x2d135f=this['_getTargetTop'](_0x20fa99,_0x3ec6ea);_0x1b40b7['_targetTop']!=_0x2d135f&&(_0x1b40b7['_targetTop']=_0x2d135f,this['_setItemTop'](_0x1b40b7,_0x2d135f));}),this['listenTo'](_0x1b40b7,'change:top',()=>{this['_recalculate'](_0x1b40b7,'top');}),this['listenTo'](_0x1b40b7,'change:bottom',()=>{this['_recalculate'](_0x1b40b7,'bottom');}),this['_alignToTargetRect'](_0x1b40b7);const _0x4697fb=this['_getItemBefore'](_0x1b40b7);return _0x4697fb&&this['_alignAfterItem'](_0x4697fb,_0x1b40b7)||this['_alignToTargetRect'](_0x1b40b7),this['_updateLastItem'](),this['view']['list']['add'](_0x1b40b7),_0x1b40b7;}['_alignForTopChange'](_0x250a48){if(!_0x250a48['content']['length'])return;const _0x474370=this['_getItemBefore'](_0x250a48);if(!_0x474370)return;const _0x29b9c9=this['_sidebarItemViewToAnnotation']['get'](_0x474370),_0x286b81=this['_activeAnnotation'];_0x286b81&&_0x286b81===_0x29b9c9?this['_alignAfterItem'](_0x474370,_0x250a48):this['_alignBeforeItem'](_0x250a48,_0x474370);}_alignForBottomChange(_0x1df3fe){if(!_0x1df3fe['content']['length'])return;const _0x14a761=this['_getItemAfter'](_0x1df3fe);if(!_0x14a761)return;const _0x1d0c70=this['_sidebarItemViewToAnnotation']['get'](_0x14a761),_0x3bec4c=this['context']['config']['get']('sidebar.preventScrollOutOfView'),_0x254afa=this['_activeAnnotation'];_0x254afa&&_0x254afa===_0x1d0c70&&_0x3bec4c?(this['_alignBeforeItem'](_0x14a761,_0x1df3fe),this['_alignAfterItem'](_0x1df3fe,_0x14a761)):_0x254afa&&_0x254afa===_0x1d0c70?this['_alignBeforeItem'](_0x14a761,_0x1df3fe):this['_alignAfterItem'](_0x1df3fe,_0x14a761);}_recalculate(_0x38ea49,_0x538b3c){0x0===this['_recalculateBuffer']['length']&&setTimeout(()=>{for(const {sidebarItemView:_0x28cfb9,changedProp:_0x48c3e4}of this['_recalculateBuffer'])'top'===_0x48c3e4?this['_alignForTopChange'](_0x28cfb9):this['_alignForBottomChange'](_0x28cfb9);this['_recalculateBuffer']=[];},0xa),this['_recalculateBuffer']['push']({'sidebarItemView':_0x38ea49,'changedProp':_0x538b3c});}getSidebarItemView(_0x183431){return this['_annotationToSidebarItemView']['get'](_0x183431);}destroy(){this['stopListening'](),this['view']['destroy']();}_destroySidebarItemView(_0x539cff){const _0x4986ef=this['getSidebarItemView'](_0x539cff);this['stopListening'](_0x4986ef),this['stopListening'](_0x539cff['view']),_0x4986ef['destroy'](),this['_annotationToSidebarItemView']['delete'](_0x539cff),this['_sidebarItemViewToAnnotation']['delete'](_0x4986ef);}_createSidebarView(){const _0xe15f54=new Ii(this['context']['locale']);return _0xe15f54['render'](),this['on']('change:_lastItem',(_0x1b252f,_0x4b1a35,_0x42f67a,_0x1974cd)=>{_0x1974cd&&_0xe15f54['unbind']('minHeight'),_0x42f67a?_0xe15f54['bind']('minHeight')['to'](_0x42f67a,'bottom'):_0xe15f54['minHeight']=null;}),_0xe15f54;}_updateLastItem(){this['_lastItem']=this['_annotations']?.['last']?this['getSidebarItemView'](this['_annotations']['last']):null;}_getItemBefore(_0x37a288){const _0x2996f0=this['_sidebarItemViewToAnnotation']['get'](_0x37a288),_0x18fae9=_0x2996f0&&this['_annotations']?.['get'](this['_annotations']['getIndex'](_0x2996f0)-0x1);return _0x18fae9&&this['getSidebarItemView'](_0x18fae9)||null;}_getItemAfter(_0x36f51b){const _0x36e2c3=this['_sidebarItemViewToAnnotation']['get'](_0x36f51b),_0x18775d=_0x36e2c3&&this['_annotations']?.['get'](this['_annotations']['getIndex'](_0x36e2c3)+0x1);return _0x18775d&&this['getSidebarItemView'](_0x18775d)||null;}_alignBeforeItem(_0x22792a,_0xa402e1){_0x22792a['updateHeight']();const _0x1fd0fe=Ni(_0xa402e1['bottom']+this['_spaceBetweenItems'],_0x22792a['top']);return!!_0x1fd0fe&&(this['_setItemTop'](_0xa402e1,_0xa402e1['top']-_0x1fd0fe),!0x0);}_alignAfterItem(_0x49e45e,_0x446628){_0x49e45e['updateHeight']();const _0x4f8a5f=Ni(_0x49e45e['bottom']+this['_spaceBetweenItems'],_0x446628['top']);return!!_0x4f8a5f&&(this['_setItemTop'](_0x446628,_0x446628['top']+_0x4f8a5f,!0x1),!0x0);}_alignToTargetRect(_0x118280){const _0xaa9966=this['_sidebarItemViewToAnnotation']['get'](_0x118280);if(!_0xaa9966||!_0xaa9966['target']||!_0xaa9966['targetRect'])return;const _0x12fff9=this['_getTargetTop'](_0xaa9966,_0xaa9966['targetRect']);this['_setItemTop'](_0x118280,_0x12fff9);}_getTargetTop(_0x5d2c99,_0x284841){if(null===_0x284841)return 0x0;if(_0x5d2c99['target']instanceof _0x1f4f60)return _0x284841['top'];{const _0x43690d=new _0x1f4f60(this['view']['element'])['top'];return _0x284841['top']-_0x43690d;}}_setItemTop(_0x3e06fc,_0x2900a3,_0x1dac37=this['context']['config']['get']('sidebar.preventScrollOutOfView')){_0x1dac37&&(_0x2900a3=Math['max'](_0x2900a3,this['_getMaxAvailableTop'](_0x3e06fc))),_0x3e06fc['top']=_0x2900a3;}_getMaxAvailableTop(_0x325789){let _0x3939d8=this['_getItemBefore'](_0x325789),_0x826bf1=0x0;for(;_0x3939d8;)_0x3939d8['updateHeight'](),_0x826bf1+=this['_spaceBetweenItems']+_0x3939d8['height'],_0x3939d8=this['_getItemBefore'](_0x3939d8);return _0x826bf1;}};function Ni(_0x520ebb,_0x19ae46){return Math['max'](_0x520ebb-_0x19ae46,0x0);}function Oi(_0x3291b8){return null!==_0x3291b8&&'object'==typeof _0x3291b8&&0x1===_0x3291b8['nodeType'];}var Mi=class extends _0xe32c07{isAttached;annotations;_editorAnnotations;_refreshPositioningDebounced;static get requires(){return[ki,Ti];}static get['pluginName'](){return'WideSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x56001a){super(_0x56001a),this['isAttached']=!0x1,this['set']('activeAnnotation',null),this['annotations']=null,this['_editorAnnotations']=new _0x5d687e(),this['_refreshPositioningDebounced']=_0x98290e(()=>{_0x56001a['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning']();},0xfa,{'leading':!0x1});}init(){const _0x196bfe=this['context']['plugins']['get'](Ti),_0x4b844e=this['context']['plugins']['get'](ki);_0x196bfe['register']('wideSidebar',this),_0x4b844e['container']&&_0x196bfe['switchTo']('wideSidebar');}setActiveAnnotation(_0x5c0938){if(_0x5c0938===this['activeAnnotation'])return;const _0x228bd6=this['context']['plugins']['get'](ki);_0x228bd6['_activeAnnotation']=_0x5c0938;const _0xfd25bb=this['activeAnnotation'];_0x228bd6['refresh']({'blurredAnnotation':_0xfd25bb,'activatedAnnotation':_0x5c0938}),this['activeAnnotation']=_0x5c0938;}attach(_0x168ef4){this['annotations']=_0x168ef4;const _0x1a9c35=this['context']['plugins']['get'](ki);if(_0x1a9c35['_annotations']=_0x168ef4,this['isAttached'])throw new _0x3fd207('widesidebar-attach-already-attached',this);this['isAttached']=!0x0,this['listenTo'](_0x1a9c35,'set:container',()=>{this['detach'](),this['listenTo'](_0x1a9c35,'change:container',_0x2a3fa0=>{_0x2a3fa0['off'](),this['attach'](_0x168ef4);});}),_0x1a9c35['_attachToContainer']({'viewClass':'ck-sidebar--wide'});const _0x26b899=_0x461326=>{_0x461326['updateTargetRect'](),_0x1a9c35['addAnnotation'](_0x461326);};for(const _0x26b095 of _0x168ef4)_0x26b899(_0x26b095);this['listenTo'](_0x168ef4,'add',(_0x4aaf99,_0x1e6470)=>{_0x26b899(_0x1e6470);}),this['listenTo'](_0x168ef4,'remove',(_0x3ab46b,_0x5248e3,_0x5ae7d6)=>{_0x1a9c35['rearrange']({'removedAnnotation':_0x5248e3,'previousAnnotation':_0x168ef4['get'](_0x5ae7d6-0x1),'nextAnnotation':_0x168ef4['get'](_0x5ae7d6+0x1)}),_0x5248e3===this['activeAnnotation']&&this['setActiveAnnotation'](null);},{'priority':'high'}),this['listenTo'](_0x168ef4,'focus',(_0x2ad117,_0x53b5e9)=>{this['setActiveAnnotation'](_0x53b5e9);}),this['listenTo'](_0x168ef4,'blur',()=>{this['setActiveAnnotation'](null);});const _0x49e330=this['context']instanceof _0x4d8ccf?this['context']['editors']:new _0x5d687e([this['context']]);for(const _0x593704 of _0x49e330)this['_integrateWithEditorAnnotations'](_0x593704);this['listenTo'](_0x49e330,'add',(_0x176d62,_0x1af1e0)=>{this['listenTo'](_0x1af1e0,'ready',()=>{this['_integrateWithEditorAnnotations'](_0x1af1e0);});}),this['listenTo'](_0x49e330,'remove',(_0x33c659,_0x4ac1da)=>{_0x4ac1da['plugins']['has']('EditorAnnotations')&&this['_destroyEditorAnnotationsIntegration'](_0x4ac1da['plugins']['get']('EditorAnnotations'));}),window['addEventListener']('resize',this['_refreshPositioningDebounced']),this['context']['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning']();}detach(){if(!this['isAttached'])throw new _0x3fd207('widesidebar-detach-not-attached',this);this['setActiveAnnotation'](null);const _0x2a68c7=this['context']['plugins']['get'](ki);_0x2a68c7['_detachFromContainer'](this['annotations']),this['stopListening'](_0x2a68c7),this['stopListening'](this['annotations']),this['context']instanceof _0x4d8ccf&&this['stopListening'](this['context']['editors']);for(const _0x1548f7 of Array['from'](this['_editorAnnotations']))this['_destroyEditorAnnotationsIntegration'](_0x1548f7);window['removeEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioningDebounced']['cancel'](),this['activeAnnotation']=null,this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach']();}_integrateWithEditorAnnotations(_0x437480){if(!_0x437480['plugins']['has']('EditorAnnotations'))return;const _0x2e4fb2=_0x437480['plugins']['get']('EditorAnnotations'),_0x1f7b1b=()=>{const _0xae5da6=_0x2e4fb2['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});this['setActiveAnnotation'](_0xae5da6[0x0]||null);};this['listenTo'](_0x2e4fb2,'refresh',_0x1f7b1b),this['listenTo'](_0x2e4fb2,'blur',(_0x98427c,{isAnnotationTracked:_0x46a2f1})=>{this['activeAnnotation']&&_0x46a2f1(this['activeAnnotation'])&&this['setActiveAnnotation'](null);}),this['listenTo'](_0x2e4fb2,'uiUpdate',()=>{this['_refreshPositioningDebounced']();}),this['listenTo'](this['annotations'],'blur',_0x1d0c60=>{_0x2e4fb2['hasDomSelection']()&&(_0x1f7b1b(),_0x1d0c60['stop']());},{'priority':'high'}),this['_editorAnnotations']['add'](_0x2e4fb2);}_destroyEditorAnnotationsIntegration(_0x524b1f){this['stopListening'](_0x524b1f),this['_editorAnnotations']['remove'](_0x524b1f);}},Ri=class extends _0x422b1d{counterView;constructor(_0x18c667){super(_0x18c667);const _0x14a056=this['bindTemplate'];this['set']('isDirty',!0x1),this['set']('number',0x0),this['bind']('_badge')['to'](this,'isDirty',this,'number',(_0x33a3a4,_0x571c31)=>_0x33a3a4?'...':_0x571c31['toString']()),this['set']('annotationType',''),this['icon']=_0x1aed3d,this['extendTemplate']({'attributes':{'class':['ck-annotation-counter']}}),this['counterView']=new ht(),this['counterView']['setTemplate']({'tag':'span','attributes':{'class':['ck-annotation-counter__badge',_0x14a056['to']('annotationType',_0x45f582=>'ck-annotation-counter__badge--'+_0x45f582),_0x14a056['if']('isDirty','ck-annotation-counter__badge--edit-mode')]},'children':[{'text':_0x14a056['to']('_badge')}]}),this['children']['add'](this['counterView']);}},Si=class extends _0xe32c07{isAttached;annotations;_manuallyClosedAnnotationViews;_domEmitter;_annotationToNarrowView;_selectedAnnotations;_editorAnnotations;_refreshPositioningDebounced;static get requires(){return[ki,Ti];}static get['pluginName'](){return'NarrowSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x45680c){super(_0x45680c),this['isAttached']=!0x1,this['_manuallyClosedAnnotationViews']=new Set(),this['_domEmitter']=new(_0x30f8a8())(),this['_annotationToNarrowView']=new Map(),this['set']('activeAnnotation',null),this['annotations']=null,this['_selectedAnnotations']=[],this['_editorAnnotations']=new _0x5d687e(),this['_refreshPositioningDebounced']=_0x98290e(()=>{this['_refreshPositioning']();},0xfa,{'leading':!0x1});}init(){this['context']['plugins']['get'](Ti)['register']('narrowSidebar',this),this['bodyCollection']=new _0x456151(this['context']['locale']),this['balloonPanelView']=new _0x4f61cf(this['context']['locale']),this['bodyCollection']['attachToDom'](),this['bodyCollection']['add'](this['balloonPanelView']);}attach(_0x480aaa){this['annotations']=_0x480aaa;const _0x5ea8a9=this['context']['plugins']['get'](ki),_0xea2127=this['balloonPanelView'];if(_0x5ea8a9['_annotations']=_0x480aaa,this['isAttached'])throw new _0x3fd207('narrowsidebar-attach-already-attached',this);this['isAttached']=!0x0,this['listenTo'](_0x5ea8a9,'set:container',()=>{this['detach'](),this['listenTo'](_0x5ea8a9,'change:container',_0x2ebab1=>{_0x2ebab1['off'](),this['attach'](_0x480aaa);});}),_0x5ea8a9['_attachToContainer']({'viewClass':'ck-sidebar--narrow','spaceBetweenItems':0x5});const _0x3bed31=_0x48037e=>{const _0x322434=new Ri(this['context']['locale']);_0x5ea8a9['addAnnotation'](_0x48037e,_0x322434),this['_annotationToNarrowView']['set'](_0x48037e,_0x322434),_0x322434['bind']('isDirty','annotationType','number')['to'](_0x48037e['view'],'isDirty','type','length'),_0x322434['on']('execute',()=>{this['_manuallyClosedAnnotationViews']['clear'](),_0xea2127['content']['first']!==_0x48037e['view']?(this['_showBalloon'](_0x48037e),_0x48037e['view']['element']['focus'](),this['setActiveAnnotation'](_0x48037e)):this['setActiveAnnotation'](null);});};for(const _0x1e688f of _0x480aaa)_0x3bed31(_0x1e688f);this['listenTo'](_0x480aaa,'add',(_0x348449,_0x4aaed9)=>{_0x3bed31(_0x4aaed9);}),this['listenTo'](_0x480aaa,'remove',(_0x58f081,_0x31904b,_0x53faaf)=>{this['_annotationToNarrowView']['get'](_0x31904b)['destroy'](),this['_annotationToNarrowView']['delete'](_0x31904b),_0x5ea8a9['rearrange']({'removedAnnotation':_0x31904b,'previousAnnotation':_0x480aaa['get'](_0x53faaf-0x1),'nextAnnotation':_0x480aaa['get'](_0x53faaf+0x1)}),_0x31904b===this['activeAnnotation']&&this['setActiveAnnotation'](null);},{'priority':'low'}),this['listenTo'](_0x480aaa,'focus',(_0x37ceb9,_0x417395)=>{this['setActiveAnnotation'](_0x417395);}),this['listenTo'](_0x480aaa,'blur',()=>{this['setActiveAnnotation'](null);}),this['_domEmitter']['listenTo'](document,'keydown',(_0x2027bb,_0x5cce6b)=>{_0x5cce6b['keyCode']===_0x5f035e['esc']&&_0xea2127['isVisible']&&(this['_manuallyClosedAnnotationViews']['add'](_0xea2127['content']['first']),this['_hideBalloon'](),_0x5cce6b['stopPropagation'](),_0x5cce6b['preventDefault']());}),this['_domEmitter']['listenTo'](document,'mousedown',(_0x1d7144,_0x3848d4)=>{const _0x4bfb72=_0x3848d4['target'];_0xea2127['isVisible']&&_0xea2127['element']['contains'](_0x4bfb72)||_0x5ea8a9['view']['element']['contains'](_0x4bfb72)||_0x1d7144['preventClosingBalloon']||this['activeAnnotation']&&this['activeAnnotation']['focusableElements']['find'](_0x23746d=>_0x23746d['contains'](_0x4bfb72))||(this['_manuallyClosedAnnotationViews']['clear'](),this['_hideBalloon'](),this['setActiveAnnotation'](null));});const _0xabf8bf=this['context']instanceof _0x4d8ccf?this['context']['editors']:new _0x5d687e([this['context']]);for(const _0x36ebe1 of _0xabf8bf)this['_integrateWithEditorAnnotations'](_0x36ebe1);this['listenTo'](_0xabf8bf,'add',(_0x189e8a,_0x2f42c8)=>{this['listenTo'](_0x2f42c8,'ready',()=>{this['_integrateWithEditorAnnotations'](_0x2f42c8);});}),this['listenTo'](_0xabf8bf,'remove',(_0x54f8ce,_0x4a0e60)=>{_0x4a0e60['plugins']['has']('EditorAnnotations')&&this['_destroyEditorAnnotationsIntegration'](_0x4a0e60['plugins']['get']('EditorAnnotations'));}),window['addEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioning']();}setActiveAnnotation(_0x36b2e1){if(_0x36b2e1===this['activeAnnotation'])return;const _0x363a57=this['context']['plugins']['get'](ki);_0x363a57['refresh']({'blurredAnnotation':this['activeAnnotation'],'activatedAnnotation':_0x36b2e1,'disableAnimationOnActivatedAnnotation':!0x0}),_0x36b2e1&&_0x363a57['getSidebarItemView'](_0x36b2e1)?this['_showBalloon'](_0x36b2e1):this['_hideBalloon'](),this['activeAnnotation']=_0x36b2e1;}detach(){if(!this['isAttached'])throw new _0x3fd207('narrowsidebar-detach-not-attached',this);this['setActiveAnnotation'](null);const _0x3fa490=this['context']['plugins']['get'](ki);this['_hideBalloon'](),Array['from'](this['_annotationToNarrowView']['values'](),_0x5aa4ea=>_0x5aa4ea['destroy']()),this['_annotationToNarrowView']['clear'](),_0x3fa490['_detachFromContainer'](this['annotations']),this['stopListening'](),this['_domEmitter']['stopListening'](),this['context']instanceof _0x4d8ccf&&this['stopListening'](this['context']['editors']);for(const _0x589a76 of Array['from'](this['_editorAnnotations']))this['_destroyEditorAnnotationsIntegration'](_0x589a76);window['removeEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioningDebounced']['cancel'](),this['_selectedAnnotations']=[],this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach'](),this['bodyCollection']['detachFromDom']();}_integrateWithEditorAnnotations(_0x550ab2){if(!_0x550ab2['plugins']['has']('EditorAnnotations'))return;const _0x1f694a=_0x550ab2['plugins']['get']('EditorAnnotations'),_0x1597ba=this['context']['plugins']['get'](ki),_0xcdbb6f=this['annotations'],_0x73e863=this['balloonPanelView'],_0x4b64db=()=>{const _0x485f46=_0x1f694a['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});this['_setSelectedAnnotations'](_0x485f46),this['setActiveAnnotation'](_0x485f46[0x0]||null);};this['listenTo'](_0x1f694a,'refresh',_0x4b64db),this['listenTo'](_0x1f694a,'blur',(_0x36f9c0,{isAnnotationTracked:_0x473745})=>{this['activeAnnotation']&&_0x473745(this['activeAnnotation'])&&(this['_setSelectedAnnotations']([]),this['setActiveAnnotation'](null));}),this['listenTo'](_0x1f694a,'uiUpdate',()=>{this['_refreshPositioningDebounced']();}),this['listenTo'](_0xcdbb6f,'blur',_0x4e6f55=>{_0x1f694a['hasDomSelection']()&&_0x4e6f55['stop']();},{'priority':'high'}),this['listenTo'](this['_domEmitter'],'mousedown',(_0xeac3d,_0x2f0353)=>{const _0x656b7a=_0x2f0353['target'];_0x73e863['isVisible']&&_0x73e863['element']['contains'](_0x656b7a)||_0x1597ba['view']['element']['contains'](_0x656b7a)||this['activeAnnotation']&&_0x1f694a['hasDomSelection']()&&(_0x4b64db(),_0xeac3d['preventClosingBalloon']=!0x0);},{'priority':'high'}),this['_editorAnnotations']['add'](_0x1f694a);}_destroyEditorAnnotationsIntegration(_0x199611){_0x199611&&(this['stopListening'](_0x199611),this['_editorAnnotations']['remove'](_0x199611));}_setSelectedAnnotations(_0x30fb77){for(const _0x523365 of this['_selectedAnnotations'])_0x30fb77['includes'](_0x523365)||this['_manuallyClosedAnnotationViews']['delete'](_0x523365['view']);this['_selectedAnnotations']=_0x30fb77;}_refreshPositioning(){const _0x52dc98=this['balloonPanelView'];this['context']['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning'](),_0x52dc98['isVisible']&&this['_updateBalloonPosition']();}['_showBalloon'](_0x45746f){if(this['_manuallyClosedAnnotationViews']['has'](_0x45746f['view']))return;const _0x11b304=this['balloonPanelView']['content']['first'];_0x11b304!==_0x45746f['view']?(_0x11b304&&this['_detachListeners'](_0x11b304),this['_attachListeners'](_0x45746f['view']),this['balloonPanelView']['content']['clear'](),this['balloonPanelView']['content']['add'](_0x45746f['view']),this['_updateBalloonPosition']()):this['_updateBalloonPosition']();}_updateBalloonPosition(){const _0x15d92c=this['balloonPanelView']['content']['first'],_0x4bf81d=_0x15d92c&&this['annotations']['getByView'](_0x15d92c);if(!_0x4bf81d||!this['_annotationToNarrowView']['has'](_0x4bf81d))return;const _0x2e70c1=this['_annotationToNarrowView']['get'](_0x4bf81d)['element'],_0x2f18b7=(function(){const _0x2fdda0=_0x4f61cf['defaultPositions'];return[_0x2fdda0['southArrowNorthEast'],_0x2fdda0['northArrowSouthEast'],_0x2fdda0['southArrowNorth'],_0x2fdda0['northArrowSouth'],_0x2fdda0['southArrowNorthWest'],_0x2fdda0['northArrowSouthWest']];}());this['balloonPanelView']['pin']({'target':_0x2e70c1,'positions':_0x2f18b7});}['_hideBalloon'](){const _0x83fc6c=this['balloonPanelView'],_0x22ad0f=_0x83fc6c['content']['first'];_0x22ad0f&&(this['_detachListeners'](_0x22ad0f),_0x83fc6c['unpin'](),_0x83fc6c['content']['clear']());}_attachListeners(_0x2575a7){this['listenTo'](_0x2575a7,'change:height',()=>this['_updateBalloonPosition']()),this['listenTo'](_0x2575a7,'Esc',(_0x27b717,_0x39be9f)=>{this['_manuallyClosedAnnotationViews']['add'](_0x2575a7),this['_hideBalloon'](),_0x39be9f();});}_detachListeners(_0x2ef4b3){this['stopListening'](_0x2ef4b3);}},xi=class extends _0x12b188{isAttached;annotations;['_manuallyClosed'];['_balloon'];_addedAnnotations;_selectedAnnotations;['_forceRefresh'];_refreshVisibilityDebounced;static get requires(){return[di,_0xbf878f,Ti];}static get['pluginName'](){return'InlineAnnotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x549051){super(_0x549051),_0x549051['editing']['view']['addObserver'](lt),this['isAttached']=!0x1,this['set']('activeAnnotation',null),this['annotations']=null,this['_manuallyClosed']=new Set(),this['_balloon']=_0x549051['plugins']['get'](_0xbf878f),this['_addedAnnotations']=new Set(),this['_selectedAnnotations']=[],this['_forceRefresh']=!0x1,this['_refreshVisibilityDebounced']=_0x98290e(()=>{this['editor']['plugins']['get']('Annotations')['refreshVisibility']();},0xfa,{'leading':!0x1});}init(){const _0x4363b7=this['editor']['plugins']['get'](Ti);_0x4363b7['context']===this['editor']&&(_0x4363b7['register']('inline',this),this['editor']['keystrokes']['set']('Esc',(_0x2aa1c3,_0x185dae)=>{const _0x269a90=this['_balloon'];if(this['isAttached']&&_0x269a90['visibleView']){const _0x7dacd8=this['annotations']['getByView'](_0x269a90['visibleView']);_0x7dacd8&&this['_closeAnnotation'](_0x7dacd8),_0x185dae();}}));}afterInit(){const _0x1e9b2e=this['editor']['plugins']['get'](Ti);_0x1e9b2e['context']===this['editor']&&(_0x1e9b2e['hasActive']()||_0x1e9b2e['switchTo']('inline'));}setActiveAnnotation(_0x3fa98a){_0x3fa98a!==this['activeAnnotation']&&(this['activeAnnotation']&&(this['activeAnnotation']['isActive']=!0x1),_0x3fa98a&&this['editor']['ui']['focusTracker']['isFocused']&&(this['annotations']['has'](_0x3fa98a)&&this['_addAnnotationToBalloon'](_0x3fa98a,!0x0),_0x3fa98a['isActive']=!0x0),_0x3fa98a||this['_setSelectedAnnotations']([]),this['activeAnnotation']=_0x3fa98a);}attach(_0x38689d){this['annotations']=_0x38689d;const _0x7356aa=this['editor']['plugins']['get'](Ti),_0xe1b156=this['_balloon'];if(this['isAttached'])throw new _0x3fd207('inlineannotations-attach-already-attached',this);if(_0x7356aa['context']!==this['editor'])throw new _0x3fd207('inlineannotations-not-allowed-with-context',this);const _0x39d723=this['editor']['plugins']['get'](di);this['listenTo'](_0x39d723,'refresh',()=>{const _0x219432=_0x39d723['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});var _0x90cdc1,_0x267023;!this['_forceRefresh']&&(_0x90cdc1=_0x219432,_0x267023=this['_selectedAnnotations'],_0x90cdc1['length']===_0x267023['length']&&_0x90cdc1['every'](_0x2d9363=>_0x267023['includes'](_0x2d9363)))||(this['_forceRefresh']=!0x1,this['_setSelectedAnnotations'](_0x219432),this['setActiveAnnotation'](_0x219432[0x0]||null));}),this['listenTo'](_0x39d723,'blur',(_0x28c19e,{isAnnotationTracked:_0x31ae8f})=>{this['activeAnnotation']&&_0x31ae8f(this['activeAnnotation'])&&(this['_setSelectedAnnotations']([]),this['setActiveAnnotation'](null));}),this['listenTo'](_0x39d723,'uiUpdate',()=>{this['_refreshVisibilityDebounced']();}),this['listenTo'](this['editor']['ui']['focusTracker'],'change:isFocused',(_0x59eb4b,_0x3c5353,_0x500824)=>{_0x500824||this['setActiveAnnotation'](null);}),this['listenTo'](_0x38689d,'remove',(_0xb0c9d9,_0x4805c6)=>{this['_removeAnnotationFromBalloon'](_0x4805c6),_0x4805c6===this['activeAnnotation']&&this['setActiveAnnotation'](null);}),this['listenTo'](_0xe1b156,'change:visibleView',(_0x120d05,_0x4f584b,_0x300056,_0x21984a)=>{_0x21984a&&this['stopListening'](_0x21984a);const _0x252842=_0x38689d['getByView'](_0x300056);_0x300056&&_0x252842&&(this['listenTo'](_0x300056,'change:height',()=>{_0xe1b156['updatePosition']();}),this['listenTo'](_0x300056,'Esc',()=>{this['_closeAnnotation'](_0x252842),this['editor']['editing']['view']['focus']();}),this['activeAnnotation']!==_0x252842&&this['setActiveAnnotation'](_0x252842));}),this['listenTo'](this['editor']['ui'],'update',()=>{_0xe1b156['visibleView']&&_0x38689d['getByView'](_0xe1b156['visibleView'])&&_0xe1b156['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 _0x3fd207('inlineannotations-detach-not-attached',this);this['setActiveAnnotation'](null);for(const _0xc856e4 of this['_addedAnnotations'])this['_removeAnnotationFromBalloon'](_0xc856e4);this['_refreshVisibilityDebounced']['cancel'](),this['stopListening'](),this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach'](),this['_refreshVisibilityDebounced']['cancel']();}_setSelectedAnnotations(_0x5486e3){for(const _0x3841d9 of this['_selectedAnnotations'])_0x5486e3['includes'](_0x3841d9)||this['_manuallyClosed']['delete'](_0x3841d9);for(const _0x266093 of this['annotations'])_0x5486e3['includes'](_0x266093)||this['_removeAnnotationFromBalloon'](_0x266093);if(this['editor']['ui']['focusTracker']['isFocused']){for(const _0x1771ad of _0x5486e3)this['_addAnnotationToBalloon'](_0x1771ad);}this['_selectedAnnotations']=_0x5486e3;}_addAnnotationToBalloon(_0xba3da6,_0x37c6d0=!0x1){this['_manuallyClosed']['has'](_0xba3da6)||(this['_addedAnnotations']['has'](_0xba3da6)||this['_balloon']['hasView'](_0xba3da6['view'])||(this['_addedAnnotations']['add'](_0xba3da6),this['_balloon']['add']({'stackId':_0xba3da6['view']['id'],'view':_0xba3da6['view'],'position':{'target':()=>this['_getBalloonTargetForAnnotation'](_0xba3da6)}})),_0x37c6d0&&this['_balloon']['showStack'](_0xba3da6['view']['id']));}_getBalloonTargetForAnnotation(_0x52443e){const _0x8c004d=_0x52443e['target'],_0x28def3=this['editor']['editing']['view'],_0x32dd7f=_0x28def3['document']['selection']['getFirstRange'](),_0x42fc0d=_0x28def3['domConverter']['viewRangeToDom'](_0x32dd7f);if(_0x42fc0d['collapse'](!0x0),_0x8c004d){if(_0x8c004d instanceof _0x1f4f60)return _0x8c004d;let _0x3c630c=[];for(const _0x5a9d53 of _0x8c004d)_0x3c630c['push'](..._0x1f4f60['getDomElementRects'](_0x5a9d53));_0x3c630c=function(_0x1e2321){const _0x21f32a=[];let _0x1c3d0a=_0x1e2321[0x0];for(let _0x30d7d0=0x1;_0x30d7d0<_0x1e2321['length'];_0x30d7d0++)if(Pi(_0x1c3d0a,_0x1e2321[_0x30d7d0])){const _0xc17e12=_0x1e2321[_0x30d7d0]['width'];_0x1c3d0a['width']+=_0xc17e12,_0x1c3d0a['right']+=_0xc17e12;}else _0x21f32a['push'](_0x1c3d0a),_0x1c3d0a=_0x1e2321[_0x30d7d0];return _0x21f32a['push'](_0x1c3d0a),_0x21f32a;}(_0x3c630c);const _0x32067a=_0x42fc0d['getBoundingClientRect']();return _0x3c630c['find'](_0x3396e9=>_0x3396e9['top']<=_0x32067a['top']&&_0x3396e9['bottom']>=_0x32067a['bottom']&&_0x3396e9['left']<=_0x32067a['left']&&_0x3396e9['right']>=_0x32067a['right'])||_0x3c630c[0x0];}return _0x52443e['targetRect']||_0x42fc0d;}_removeAnnotationFromBalloon(_0x412843){this['_addedAnnotations']['has'](_0x412843)&&this['_balloon']['hasView'](_0x412843['view'])&&(this['_addedAnnotations']['delete'](_0x412843),this['_balloon']['remove'](_0x412843['view']));}_closeAnnotation(_0x4f3f0d){this['_manuallyClosed']['add'](_0x4f3f0d),this['_removeAnnotationFromBalloon'](_0x4f3f0d);}};function Pi(_0x187853,_0x4716f4){return _0x187853['top']===_0x4716f4['top']&&_0x187853['bottom']===_0x4716f4['bottom']&&_0x187853['right']===_0x4716f4['left'];}var Li=class extends ht{['focusTracker'];['focusCycler'];_annotationViews;constructor(_0x34e5e7,_0x1439eb){super(_0x34e5e7),this['set']('isEmpty',!_0x1439eb['length']),this['focusTracker']=new _0x4804cc(),this['_annotationViews']=_0x1439eb,this['_annotationViews']['delegate']('arrowup','arrowdown')['to'](this),this['on']('arrowup',()=>{this['focusCycler']['focusPrevious']();}),this['on']('arrowdown',()=>{this['focusCycler']['focusNext']();}),this['focusCycler']=new et({'focusables':_0x1439eb,'focusTracker':this['focusTracker']}),this['listenTo'](_0x1439eb,'add',()=>{this['isEmpty']=!0x1;}),this['listenTo'](_0x1439eb,'remove',(_0xc12a24,_0x287171)=>{_0x287171['isActive']&&this['focus'](),_0x1439eb['length']||(this['isEmpty']=!0x0);});const _0x3144b5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'dir':'auto','class':['ck','ck-comments-archive'],'tabindex':-0x1,'role':'list','aria-label':Et(_0x34e5e7,'COMMENTS_ARCHIVE_LIST_LABEL')},'children':[{'tag':'div','attributes':{'class':['ck-comments-archive__content'],'role':'presentation'},'children':[{'tag':'div','attributes':{'role':'presentation'},'children':_0x1439eb},{'tag':'p','attributes':{'class':['ck-comments-archive__info',_0x3144b5['if']('isEmpty','ck-hidden',_0x1f7000=>!_0x1f7000)]},'children':[{'text':Et(_0x34e5e7,'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 _0xdaaaed of this['_annotationViews'])this['focusTracker']['add'](_0xdaaaed['element']);this['_annotationViews']['on']('change',(_0x49b36a,{added:_0x4af26b,removed:_0x552481})=>{for(const _0x307aea of _0x4af26b)this['focusTracker']['add'](_0x307aea['element']);for(const _0x5313ae of _0x552481)this['focusTracker']['remove'](_0x5313ae['element']);});}},Di=class extends _0xe32c07{static get['pluginName'](){return'CommentsArchive';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[oi,ti];}constructor(_0x1255cc){super(_0x1255cc),this['archivedThreads']=new _0x5d687e();}init(){const _0x2a48d2=this['context'],_0x3f9bc4=_0x2a48d2['plugins']['get'](oi),_0x3f66af=_0x2a48d2['plugins']['get'](ti);this['listenTo'](_0x3f9bc4,'addCommentThread',(_0x17e7e9,{threadId:_0x180d67})=>{const _0x26f360=_0x3f9bc4['getCommentThread'](_0x180d67);_0x26f360['archivedAt']&&this['archivedThreads']['add'](_0x26f360,this['_calculatePosition'](_0x26f360['archivedAt'])),this['listenTo'](_0x26f360,'change:archivedAt',(_0x268901,_0x317375,_0x3a9249)=>{_0x3a9249?this['archivedThreads']['has'](_0x26f360)||this['archivedThreads']['add'](_0x26f360,this['_calculatePosition'](_0x26f360['archivedAt'])):this['archivedThreads']['has'](_0x26f360)&&this['archivedThreads']['remove'](_0x26f360);});}),this['listenTo'](_0x3f9bc4,'removeCommentThread',(_0x471f09,{threadId:_0x24cb46})=>{const _0x943026=_0x3f9bc4['getCommentThread'](_0x24cb46);this['stopListening'](_0x943026),this['archivedThreads']['has'](_0x943026)&&this['archivedThreads']['remove'](_0x943026);},{'priority':'highest'}),this['listenTo'](_0x3f66af['collection'],'focus',(_0x36e88a,_0x5aac7a)=>{_0x5aac7a['isVisible']||(_0x5aac7a['isActive']=!0x0,_0x3f66af['activate'](_0x5aac7a));});}_calculatePosition(_0x53b549){const _0x1e4365=[...this['archivedThreads']]['findIndex'](_0x38f4d2=>_0x38f4d2['archivedAt']<_0x53b549);return _0x1e4365>-0x1?_0x1e4365:this['archivedThreads']['length'];}},Vi=class extends _0x12b188{commentsArchiveView;annotationViews;['_pendingThreads'];static get['pluginName'](){return'CommentsArchiveUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Di,_0x3da253];}constructor(_0x1d8f5f){super(_0x1d8f5f),this['annotationViews']=new at(),this['_pendingThreads']=[];}init(){const _0x25d2f8=this['editor'],_0x8eb4c8=this['_hideDialogOnAnnotationEscape']['bind'](this);_0x25d2f8['ui']['componentFactory']['add']('commentsArchive',()=>this['_createCommentsArchiveButton'](_0x422b1d,!0x0)),_0x25d2f8['ui']['componentFactory']['add']('menuBar:commentsArchive',()=>{const _0x318e90=this['_createCommentsArchiveButton'](rt);return _0x318e90['set']({'role':'menuitemcheckbox'}),_0x318e90;});const _0x333640=_0x25d2f8['plugins']['get'](Di),_0x291174=_0x25d2f8['plugins']['get']('Annotations'),_0x17ca9b=_0x25d2f8['plugins']['get']('CommentsRepository');_0x333640['archivedThreads']['forEach'](_0x582a48=>{this['_handleNewThread'](_0x582a48);}),this['listenTo'](_0x333640['archivedThreads'],'add',(_0x36063c,_0x5af929)=>{this['_handleNewThread'](_0x5af929);}),this['listenTo'](_0x291174['collection'],'add',(_0x56121c,_0x2e70b1)=>{const _0x87e4f9=this['_pendingThreads']['find'](_0x42d216=>{const _0x13897e=_0x17ca9b['_threadToController']['get'](_0x42d216);return _0x13897e&&_0x2e70b1['innerView']===_0x13897e['view'];});if(_0x87e4f9){const _0x353c5a=this['_calculatePosition'](_0x87e4f9['archivedAt']);this['_addAnnotationToArchive'](_0x2e70b1,_0x353c5a),this['_pendingThreads']['splice'](this['_pendingThreads']['indexOf'](_0x87e4f9),0x1);}}),this['listenTo'](_0x333640['archivedThreads'],'remove',(_0x3d52ce,_0x66f670)=>{const _0x21f541=_0x25d2f8['config']['get']('collaboration.channelId');if(!_0x21f541||_0x66f670['channelId']===_0x21f541){if(this['_pendingThreads']['includes'](_0x66f670))this['_pendingThreads']['splice'](this['_pendingThreads']['indexOf'](_0x66f670),0x1);else{const _0x4c428c=_0x17ca9b['_threadToController']['get'](_0x66f670),_0x3e22ee=_0x291174['getByInnerView'](_0x4c428c['view']);this['annotationViews']['remove'](_0x3e22ee['view']),this['stopListening'](_0x3e22ee),this['stopListening'](_0x3e22ee['focusableElements']);}}}),this['listenTo'](_0x291174['collection'],'add',(_0x285717,_0x1ef0fb)=>{this['listenTo'](_0x1ef0fb,'escape',_0x8eb4c8);}),this['listenTo'](_0x291174['collection'],'remove',(_0x26385a,_0xe073ad)=>{this['stopListening'](_0xe073ad,'escape',_0x8eb4c8);});}_addAnnotationToArchive(_0x550b0b,_0x4d106c){this['listenTo'](_0x550b0b,'set:isVisible',_0xa9d7eb=>{_0xa9d7eb['return']=!0x1,_0xa9d7eb['stop']();}),this['annotationViews']['add'](_0x550b0b['view'],_0x4d106c);}['_handleNewThread'](_0x55865e){const _0x67d8c9=this['editor']['plugins']['get']('CommentsRepository'),_0x297a8a=this['editor']['plugins']['get']('Annotations'),_0x565461=this['editor']['config']['get']('collaboration.channelId');if(!_0x565461||_0x55865e['channelId']===_0x565461){const _0x16b43a=_0x67d8c9['_threadToController']['get'](_0x55865e);if(!_0x16b43a)return void this['_pendingThreads']['push'](_0x55865e);const _0x3dd1d6=this['_calculatePosition'](_0x55865e['archivedAt']),_0x487738=_0x297a8a['getByInnerView'](_0x16b43a['view']);_0x487738['isVisible']&&_0x297a8a['_visibleAnnotations']['remove'](_0x487738),this['_addAnnotationToArchive'](_0x487738,_0x3dd1d6);}}_calculatePosition(_0x1b908d){const _0x106105=this['editor']['config']['get']('collaboration.channelId'),_0x3b03a0=[...this['editor']['plugins']['get'](Di)['archivedThreads']]['filter'](_0x26ec1c=>_0x26ec1c['channelId']===_0x106105)['findIndex'](_0x334baf=>_0x334baf['archivedAt']<_0x1b908d);return _0x3b03a0<0x0||_0x3b03a0>this['annotationViews']['length']?this['annotationViews']['length']:_0x3b03a0-0x1;}_toggleDialog(){const _0x30bcd9=this['editor'],_0xde210c=_0x30bcd9['plugins']['get']('Dialog');this['commentsArchiveView']||(this['commentsArchiveView']=new Li(_0x30bcd9['locale'],this['annotationViews'])),'commentsArchive'===_0xde210c['id']?_0xde210c['hide']():_0xde210c['show']({'id':'commentsArchive','title':Et(_0x30bcd9['locale'],'COMMENTS_ARCHIVE'),'icon':_0x2a22ba,'hasCloseButton':!0x0,'content':this['commentsArchiveView'],'position':_0x56ba8b['EDITOR_TOP_SIDE']});}_createCommentsArchiveButton(_0x2f69d5,_0x456ee3=!0x1){const _0x27d2a1=this['editor']['locale'],_0x5b2108=this['editor']['plugins']['get']('Dialog'),_0xad32d3=new _0x2f69d5(_0x27d2a1);return _0xad32d3['bind']('isEnabled')['to'](this,'isEnabled'),_0xad32d3['bind']('isOn')['to'](_0x5b2108,'id',_0x181cba=>'commentsArchive'===_0x181cba),_0xad32d3['set']({'label':Et(_0x27d2a1,'COMMENTS_ARCHIVE'),'icon':_0x2a22ba,'isToggleable':!0x0}),_0x456ee3&&(_0xad32d3['tooltip']=!0x0),this['listenTo'](_0xad32d3,'execute',()=>this['_toggleDialog']()),_0xad32d3;}_hideDialogOnAnnotationEscape=_0x9560af=>{const _0x459867=_0x9560af['source'];if(!this['annotationViews']['has'](_0x459867['view']))return;const _0xc09d99=this['editor']['plugins']['get']('Dialog');_0xc09d99['isOpen']&&'commentsArchive'===_0xc09d99['id']&&(_0xc09d99['hide'](),_0x9560af['stop']());};},Bi=class extends _0x12b188{static get requires(){return[oi,wi,vi,Di,Vi,yi,Mi,Si,xi];}static get['pluginName'](){return'Comments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{ci as AddCommentThreadCommand,$t as Annotation,Jt as AnnotationCollection,Ri as AnnotationCounterButtonView,qt as AnnotationView,ti as Annotations,Ei as AnnotationsSidebarItemView,Ii as AnnotationsSidebarView,Ti as AnnotationsUIs,Ht as BaseCommentThreadView,Kt as BaseCommentView,hi as Comment,ri as CommentThread,bt as CommentThreadController,xt as CommentThreadInputView,Ut as CommentThreadView,Yt as CommentView,Bi as Comments,Di as CommentsArchive,Vi as CommentsArchiveUI,wi as CommentsEditing,Lt as CommentsListView,yi as CommentsOnly,oi as CommentsRepository,vi as CommentsUI,di as EditorAnnotations,xi as InlineAnnotations,Si as NarrowSidebar,ki as Sidebar,Mi as WideSidebar,Qt as bindAnnotationCollections};
|