@ckeditor/ckeditor5-comments 49.1.0-alpha.3 → 49.1.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
|
-
((()=>Ut)());constructor(_0x1ad0af={}){(_0x1ad0af=Object['assign']({},_0x1ad0af))['plugins']||(_0x1ad0af['plugins']=CommentEditor['defaultPlugins']),super(_0x1ad0af),this['ui']=new Ht(this),this['set']('placeholder',''),this['model']['document']['on']('change',()=>this['_updatePlaceholder'](),{'priority':'low'}),this['on']('change:placeholder',()=>this['_updatePlaceholder']()),this['model']['document']['createRoot'](),this['editing']['view']['_overlayModeHint']='auto',this['_sendUsageRequest']=()=>window['Promise']['resolve']({'status':'ok'});}create(){const _0xd7753f=this['config']['get']('initialData')||'';return this['initPlugins']()['then'](()=>this['ui']['init']())['then'](()=>this['data']['init'](_0xd7753f))['then'](()=>this['fire']('ready'));}destroy(){return super['destroy']()['then'](()=>this['ui']['destroy']());}['focus'](){this['model']['change'](_0x239e69=>{const _0x5be58c=this['model']['document']['getRoot'](),_0xabf98d=_0x5be58c&&_0x5be58c['getChild'](_0x5be58c['childCount']-0x1);_0x239e69['setSelection'](_0xabf98d,'end'),this['editing']['view']['focus']();});}_updatePlaceholder(){const _0x22559e=this['editing']['view'],_0x4c6816=_0x22559e['document']['getRoot'](),_0x53e52f=_0x4c6816['getChild'](0x0);_0x4c6816['childCount']>0x1||!_0x53e52f||'p'!=_0x53e52f['name']?this['placeholderElement']&&this['placeholderElement']['placeholder']&&(Ct(_0x22559e,this['placeholderElement']),this['placeholderElement']=void 0x0):(this['placeholder']&&(_0x53e52f['placeholder']=this['placeholder']),It({'view':_0x22559e,'element':_0x53e52f,'keepOnFocus':!0x0}),this['placeholderElement']=_0x53e52f);}},Kt=class extends wt{keystrokes;['focusTracker'];['focusables'];['focusCycler'];submitButtonView;cancelButtonView;_editorConfig;constructor(_0x296888,_0x4739e8={}){super(_0x296888),this['editor']=null,this['_editorConfig']=_0x4739e8,this['set']('value',_0x4739e8['initialData']||''),this['set']('disabledSubmit',!0x1),this['set']('showButtons',!0x0),this['set']('placeholder',Vt(_0x296888,'Reply...')),this['set']('submitLabel',Vt(_0x296888,'Reply')),this['submitButtonView']=this['_createSubmitButton'](),this['cancelButtonView']=this['_createCancelButton'](),this['focusables']=this['createCollection']([this['cancelButtonView'],this['submitButtonView']]),this['keystrokes']=new _0x771e58(),this['focusTracker']=new _0xf91994(),this['focusCycler']=new dt({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x59104a=>!_0x59104a['defaultPrevented']},'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['setTemplate']({'tag':'div','attributes':{'class':['ck-comment__input-wrapper']},'children':[{'tag':'div','attributes':{'class':['ck-comment__input-actions',this['bindTemplate']['if']('showButtons','ck-comment__input-actions--active')]},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),this['keystrokes']['set']('Esc',(_0x1e1ba9,_0x449990)=>{this['cancelButtonView']['fire']('execute'),_0x449990();}),this['keystrokes']['set']('Ctrl+Enter',(_0x5c38f3,_0x24d82a)=>{this['submitButtonView']['isEnabled']&&(this['submitButtonView']['fire']('execute'),_0x24d82a());}),this['on']('submit',(_0xaa4e65,_0x58bfa6)=>{_0x58bfa6['length']>0xfde8?(alert(Vt(_0x296888,'TOO_LONG_COMMENT_ALERT',[_0x58bfa6['length'],0xfde8])),_0xaa4e65['stop']()):this['editor']['setData']('');},{'priority':'high'});}['render'](){super['render'](),this['_setupKeyboardNavigation']();}createEditor(){return this['editor']||(this['editor']=new Wt(this['_editorConfig']),this['_editorCreationPromise']=this['editor']['create']()['then'](()=>{if(this['_isDestroyed'])return;const _0x5b9214=this['editor'];this['element']['insertBefore'](_0x5b9214['ui']['element'],this['element']['firstChild']),_0x5b9214['model']['document']['on']('change',()=>this['value']=_0x5b9214['getData']()),_0x5b9214['bind']('placeholder')['to'](this),this['focusables']['add'](_0x5b9214['ui']['view'],0x0),this['fire']('editorReady',this['editor']);})),this['_editorCreationPromise'];}['focus'](_0x4d6288){-0x1===_0x4d6288?(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:_0x5b6e47}=this,_0x3bfa0a=new nt(_0x5b6e47);return _0x3bfa0a['extendTemplate']({'attributes':{'class':['ck-button-action','ck-button_small','ck-comment__input-actions--submit']}}),_0x3bfa0a['withText']=!0x0,_0x3bfa0a['bind']('label')['to'](this,'submitLabel'),_0x3bfa0a['on']('execute',()=>{this['fire']('submit',this['value']);}),_0x3bfa0a['bind']('isEnabled')['to'](this,'value',this,'disabledSubmit',(_0x3c6d2a,_0x45d260)=>!_0x45d260&&!!_0x3c6d2a['trim']()),_0x3bfa0a;}_createCancelButton(){const {locale:_0x20f0cb}=this,_0x36d21d=new nt(_0x20f0cb);return _0x36d21d['extendTemplate']({'attributes':{'class':['ck-button_small','ck-comment__input-actions--cancel']}}),_0x36d21d['label']=Vt(_0x20f0cb,'Cancel'),_0x36d21d['withText']=!0x0,_0x36d21d['on']('execute',()=>{this['editor']['setData'](''),this['fire']('cancel');}),_0x36d21d;}_setupKeyboardNavigation(){this['keystrokes']['listenTo'](this['element']),this['focusables']['forEach'](_0x353f05=>{this['focusTracker']['add'](_0x353f05['element']);}),this['focusables']['on']('change',(_0x522233,_0x45e9d3)=>{for(const _0x168a58 of Array['from'](_0x45e9d3['added'])['reverse']())this['focusTracker']['add'](_0x168a58['element']);});}},Gt=class extends wt{constructor(_0x33ec9e,_0x3b9fb0,_0x45e9a2){super(_0x33ec9e),this['commentInputView']=new Kt(_0x33ec9e,_0x45e9a2),this['focusCycler']=this['commentInputView']['focusCycler'],this['commentInputView']['bind']('showButtons')['to'](this['commentInputView']['focusTracker'],'isFocused',this['commentInputView'],'value',(_0x3bdc8e,_0x1127bc)=>_0x3bdc8e||!!_0x1127bc),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 _0x5d01ca(_0x33ec9e,_0x3b9fb0),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','ck-reset_all-excluded',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'](_0x78377){this['commentInputView']['focus'](_0x78377);}_focusOnNonInteractiveMouseDown(){this['listenTo'](this['element'],'mousedown',(_0x2c6f62,_0x1c5093)=>{const {submitButtonView:_0x1db719,cancelButtonView:_0x470b22,editor:_0x4782dc}=this['commentInputView'];[_0x1db719['element'],_0x470b22['element'],_0x4782dc?_0x4782dc['editing']['view']['getDomRoot']():null]['filter'](_0x4f7b2b=>_0x4f7b2b)['some'](_0x8145b8=>_0x4c4c9b(_0x8145b8,_0x1c5093['target']))||(this['focus'](),_0x1c5093['preventDefault']());});}},Yt=class extends wt{revealButtonView;constructor(_0x281146){super(_0x281146),this['set']('count',void 0x0);const _0x54a224=this['revealButtonView']=new nt(_0x281146);_0x54a224['icon']=_0x1a4316,_0x54a224['withText']=!0x0,_0x54a224['bind']('label')['to'](this,'count',_0x497c75=>Vt(_0x281146,'NUMBER_OF_COMMENTS',_0x497c75)),_0x54a224['extendTemplate']({'attributes':{'class':'ck-button_small'}}),this['setTemplate']({'tag':'li','attributes':{'class':'ck-thread__comment-count'},'children':[_0x54a224]});}},Xt=class extends wt{commentViews;resolvedCommentView;['focusTracker'];keystrokes;['focusCycler'];['_model'];['_config'];_collapsedCommentsView;constructor(_0x5a0157,_0x27e00e,_0x35bfa0){super(_0x5a0157);const _0x125257=this['bindTemplate'];this['set']('hasDirtyComment',!0x1),this['set']('length',_0x27e00e['comments']['length']),this['set']('isActive',!0x1),this['set']('isExpandedByUser',!0x1),this['_model']=_0x27e00e,this['_config']=_0x35bfa0,this['commentViews']=this['createCollection'](),this['visibleViews']=this['createCollection'](),this['resolvedCommentView']=null,this['focusTracker']=new _0xf91994(),this['keystrokes']=new _0x771e58(),this['focusCycler']=new dt({'focusables':this['commentViews'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x1e7b6a=>this['commentViews']['map'](_0x34c3cf=>_0x34c3cf['element'])['includes'](_0x1e7b6a['target'])},'actions':{'focusPrevious':'arrowup','focusNext':'arrowdown'}}),this['_collapsedCommentsView']=new Yt(_0x5a0157),this['_collapsedCommentsView']['bind']('count')['to'](this,'length',_0x195d0c=>_0x195d0c-this['_config']['maxCommentsWhenCollapsed']),this['listenTo'](this['_collapsedCommentsView']['revealButtonView'],'execute',()=>{this['isExpandedByUser']=!0x0;});for(const _0x28301c of _0x27e00e['comments'])this['_handleNewCommentModel'](_0x28301c);this['_handleInfoComment'](),this['listenTo'](_0x27e00e['comments'],'add',(_0x5382a7,_0x3e7700)=>{const _0x898bcf=this['_calculatePosition'](_0x3e7700);this['length']++,this['_handleNewCommentModel'](_0x3e7700,_0x898bcf),this['refreshVisibleViews']();}),this['listenTo'](_0x27e00e['comments'],'remove',(_0xa1dd7e,_0x308cfd)=>{this['length']--,this['_handleRemoveCommentModel'](_0x308cfd),this['refreshVisibleViews']();}),this['listenTo'](_0x27e00e,'commentUpdated',()=>this['refreshVisibleViews']()),this['listenTo'](_0x27e00e,'change:isResolved',()=>this['_handleInfoComment']()),this['on']('change:isActive',(_0x572b18,_0x3d4453,_0x8eff4b)=>{_0x8eff4b||(this['isExpandedByUser']=!0x1),this['refreshVisibleViews']();}),this['on']('change:hasDirtyComment',()=>this['refreshVisibleViews']()),this['on']('change:isExpandedByUser',()=>this['refreshVisibleViews']()),this['setTemplate']({'tag':'ul','attributes':{'class':['ck-thread__comments','ck-reset_all-excluded',_0x125257['if']('length','ck-hidden',_0x3de293=>!_0x3de293)],'aria-label':Vt(_0x5a0157,'Thread\x20comments')},'children':this['visibleViews']});}get['_shouldCollapse'](){return this['_model']['weight']>this['_config']['maxThreadTotalWeight']&&!this['isActive']&&!this['hasDirtyComment']&&!this['isExpandedByUser'];}['render'](){super['render'](),this['refreshVisibleViews'](),this['_setupKeyboardNavigation']();}['focus'](_0x3ebe7e){-0x1===_0x3ebe7e?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}destroy(){this['_collapsedCommentsView']['destroy']();for(const _0x477226 of this['commentViews'])_0x477226['destroy']();super['destroy']();}['refreshVisibleViews'](){this['_shouldCollapse']?this['_rearrangeCollapse']():this['_rearrangeExpand']();}_handleNewCommentModel(_0x4f0e37,_0x15c68d){const _0x8196fd=new this['_config']['CommentView'](this['locale'],_0x4f0e37,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig']});_0x8196fd['viewUid']=_0x4f0e37['id'],_0x8196fd['delegate']('removeComment')['to'](this),_0x8196fd['delegate']('updateComment')['to'](this),_0x8196fd['delegate']('resolveCommentThread')['to'](this),_0x8196fd['delegate']('editorReady')['to'](this),_0x8196fd['delegate']('editorDestroyed')['to'](this),this['listenTo'](_0x8196fd,'change:isEditMode',()=>this['_updateHasDirtyComment']()),this['commentViews']['add'](_0x8196fd,_0x15c68d);}_calculatePosition(_0x380b04){const _0x4751b7=this['_model']['_findOptimalIndex'](_0x380b04);return this['resolvedCommentView']?this['resolvedCommentView']['authoredAt']>_0x380b04['authoredAt']?_0x4751b7-0x1:_0x4751b7:_0x4751b7-0x1;}_handleInfoComment(){if(this['_model']['resolvedBy']&&this['_model']['resolvedAt']){const _0xe3c88e={'id':'resolved','author':this['_model']['resolvedBy'],'authoredAt':this['_model']['resolvedAt'],'content':Vt(this['locale'],'Marked\x20as\x20resolved'),'attributes':{}};this['resolvedCommentView']=new this['_config']['CommentView'](this['locale'],_0xe3c88e,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig'],'isSystemComment':!0x0}),this['commentViews']['add'](this['resolvedCommentView'],this['_model']['_findOptimalIndex'](_0xe3c88e));}else this['resolvedCommentView']&&(this['commentViews']['remove'](this['resolvedCommentView']),this['resolvedCommentView']['destroy'](),this['resolvedCommentView']=null);this['refreshVisibleViews']();}_handleRemoveCommentModel(_0x64d6b4){const _0x3eb3f0=this['commentViews']['remove'](_0x64d6b4['id']);this['stopListening'](_0x3eb3f0),_0x3eb3f0['isEditMode']&&this['_updateHasDirtyComment'](),_0x3eb3f0['destroy']();}_updateHasDirtyComment(){this['hasDirtyComment']=Array['from'](this['commentViews'])['some'](_0xaa392f=>_0xaa392f['isEditMode']);}['_rearrangeCollapse'](){const _0x5935bd=function(_0x19440f){const _0x4d446a=new _0x28de1d();for(const _0x49510a of _0x19440f)_0x4d446a['add'](_0x49510a);return _0x4d446a;}(this['commentViews']),_0x50e812=this['_collapsedCommentsView']['count'];for(let _0x25cc31=0x1;_0x25cc31<=_0x50e812;_0x25cc31++)_0x5935bd['remove'](0x1);for(const _0x309794 of _0x5935bd)_0x309794['collapse']();_0x50e812>0x0&&_0x5935bd['add'](this['_collapsedCommentsView'],0x1),qt(_0x15fbf6(Array['from'](this['visibleViews']),Array['from'](_0x5935bd)),this['visibleViews'],_0x5935bd);}['_rearrangeExpand'](){const _0x455429=this['_collapsedCommentsView']['revealButtonView']['element'],_0x1bff41=!!_0x455429&&_0x455429['contains'](_0x4d1961(_0x455429));qt(_0x15fbf6(Array['from'](this['visibleViews']),Array['from'](this['commentViews'])),this['visibleViews'],this['commentViews']);for(const _0x5a9040 of this['visibleViews'])_0x5a9040['expand']();_0x1bff41&&this['commentViews']['get'](0x1)['focus']();}_setupKeyboardNavigation(){this['commentViews']['forEach'](_0x428493=>{this['focusTracker']['add'](_0x428493['element']),this['keystrokes']['listenTo'](_0x428493['element']);}),this['commentViews']['on']('change',(_0x1c7e30,_0x33a47f)=>{for(const _0x12c46c of _0x33a47f['removed'])this['focusTracker']['remove'](_0x12c46c['element']),this['keystrokes']['stopListening'](_0x12c46c['element']);for(const _0x52cba7 of Array['from'](_0x33a47f['added'])['reverse']())this['focusTracker']['add'](_0x52cba7['element']),this['keystrokes']['listenTo'](_0x52cba7['element']);});const _0x578189=_0x5b8fad=>{const _0x5b7a68=this['_collapsedCommentsView']['revealButtonView']['element'];_0x5b7a68&&(_0x5b8fad?(this['focusTracker']['add'](_0x5b7a68),this['keystrokes']['listenTo'](_0x5b7a68)):(this['focusTracker']['remove'](_0x5b7a68),this['keystrokes']['stopListening'](_0x5b7a68)));};this['listenTo'](this['visibleViews'],'add',(_0x305348,_0xf9db5f)=>{_0xf9db5f===this['_collapsedCommentsView']&&_0x578189(!0x0);}),this['listenTo'](this['visibleViews'],'remove',(_0x5794d2,_0x196f03)=>{_0x196f03===this['_collapsedCommentsView']&&_0x578189(!0x1);}),this['visibleViews']['has'](this['_collapsedCommentsView'])&&_0x578189(!0x0);}};function qt(_0x1d0928,_0x3ee846,_0x73964e){let _0x2b79ba=0x0;for(const _0xf721d6 of _0x1d0928)switch(_0xf721d6){case'insert':_0x3ee846['add'](_0x73964e['get'](_0x2b79ba),_0x2b79ba),_0x2b79ba++;break;case'delete':_0x3ee846['remove'](_0x2b79ba);break;case'equal':_0x2b79ba++;}}function $t(_0x31021e,_0x27c568=0x96){const _0x1e257a=_0x27c568-0x1;if(_0x31021e['length']<_0x27c568)return _0x31021e;const _0xc4c584=_0x31021e['lastIndexOf']('\x20',_0x1e257a);return _0x31021e['substring'](0x0,_0xc4c584>-0x1?_0xc4c584:_0x1e257a)+'…';}var jt=class extends wt{constructor(_0x12b891){super(_0x12b891);const _0x5db667=this['bindTemplate'];this['set']('contextValue',''),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-context__value'],'aria-label':_0x5db667['to']('contextValue',_0x3624be=>Vt(_0x12b891,'THREAD_CONTEXT_LABEL',_0x3624be)),'tabindex':-0x1},'children':[{'text':_0x5db667['to']('contextValue')}]});}['focus'](){this['element']['focus']();}},zt=class extends wt{['_model'];reopenButtonView;contextView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];constructor(_0x54d53c,_0x25f9bc){super(_0x54d53c);const _0x514501=this['bindTemplate'];this['_model']=_0x25f9bc,this['reopenButtonView']=this['_createReopenButton'](),this['contextView']=this['_createContextView'](),this['focusables']=this['createCollection']([this['contextView'],this['reopenButtonView']]),this['focusTracker']=new _0xf91994(),this['keystrokes']=new _0x771e58(),this['focusCycler']=new dt({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['bind']('hasContext')['to'](this['_model'],'context',_0x41b51e=>!!_0x41b51e),this['bind']('contextValue')['to'](this['_model'],'context',_0x279e26=>_0x279e26&&_0x279e26['value']?$t(_0x279e26['value']):Vt(this['locale'],'Comment\x20was\x20made\x20on\x20an\x20element')),this['setTemplate']({'tag':'div','attributes':{'class':['ck-thread__header']},'children':[{'tag':'div','attributes':{'class':['ck-context-wrapper']},'children':[{'tag':'div','attributes':{'class':['ck-context',_0x514501['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 _0x3c0bda=new nt(this['locale']);return _0x3c0bda['label']=Vt(this['locale'],'Reopen'),_0x3c0bda['tooltip']=Vt(this['locale'],'Reopen'),_0x3c0bda['icon']=et,_0x3c0bda['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x231899=>!_0x231899),_0x3c0bda['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x504499,_0x941949)=>_0x504499&&_0x941949),_0x3c0bda['on']('execute',()=>{this['fire']('reopenCommentThread',this['_model']['id']);}),_0x3c0bda;}_attachContextActions(){const _0x51a156=this['element']['querySelector']('.ck-context'),_0x5113c0=_0x51a156['querySelector']('.ck-context__value');this['listenTo'](_0x51a156,'mouseenter',()=>{_0x5113c0['offsetWidth']<_0x5113c0['scrollWidth']&&_0x51a156['classList']['add']('overlay');}),this['listenTo'](_0x51a156,'mouseleave',()=>{_0x51a156['classList']['remove']('overlay');});}_setupKeyboardNavigation(){this['keystrokes']['listenTo'](this['element']);for(const _0x5080ff of this['focusables'])this['focusTracker']['add'](_0x5080ff['element']),this['keystrokes']['listenTo'](_0x5080ff['element']);}_createContextView(){const _0x24c664=new jt(this['locale']);return _0x24c664['bind']('contextValue')['to'](this),_0x24c664;}},Jt=class extends wt{['_model'];['_config'];commentThreadHeaderView;commentThreadInputView;ariaDescriptionView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];constructor(_0x427d8a,_0x10f379,_0x21d7aa,_0x2c81cb){super(_0x427d8a),this['set']('isActive',!0x1),this['set']('isDirty',!0x1),this['_model']=_0x10f379,this['_localUser']=_0x21d7aa,this['_config']=_0x2c81cb,this['commentThreadHeaderView']=new zt(_0x427d8a,_0x10f379),this['commentThreadHeaderView']['delegate']('reopenCommentThread')['to'](this),this['ariaDescriptionView']=new _0x1cdfe9(_0x427d8a,Vt(_0x427d8a,'COMMENT_THREAD_DESCRIPTION')),this['listenTo'](this,'reopenCommentThread',()=>{this['focus']();}),this['commentsListView']=new Xt(_0x427d8a,_0x10f379,Object['assign']({'CommentView':this['_config']['CommentView']},_0x2c81cb)),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',(_0x2313e4,_0x894372)=>_0x2313e4||!!_0x894372),this['bind']('isUnlinked')['to'](_0x10f379,'unlinkedAt',_0x29f037=>!!_0x29f037);let _0x2bb95d=null;const _0x1a83a0=()=>{const _0x3fba12=this['_model']['comments']['first']||null;_0x3fba12!==_0x2bb95d&&(_0x2bb95d&&this['stopListening'](_0x2bb95d,'change:content'),_0x2bb95d=_0x3fba12,_0x3fba12&&this['listenTo'](_0x3fba12,'change:content',_0x1a83a0));const _0x444fdb=_0x3fba12?_0x3fba12['author']['name']:this['_localUser']['name'],_0xc4fa4=_0x3fba12?new DOMParser()['parseFromString'](_0x2af1d3(_0xc55986(_0x3fba12['content'],{'limit':this['_config']['maxCommentCharsWhenCollapsed']})),'text/html')['body']['textContent']:'',_0x2d17dc=Vt(this['locale'],'COMMENT_THREAD_LABEL',[this['length'],_0x444fdb]);this['set']('ariaLabel',_0xc4fa4?_0x2d17dc+'\x20'+_0xc4fa4:_0x2d17dc);};this['listenTo'](this['_model']['comments'],'change',_0x1a83a0),_0x1a83a0(),this['focusables']=this['createCollection']([this['commentsListView'],this['commentThreadInputView']]),this['focusTracker']=new _0xf91994(),this['keystrokes']=new _0x771e58(),this['focusCycler']=new dt({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x5f520c=>_0x5f520c['target']!==this['element']},'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}});}['focus'](){this['element']['focus']();}['render'](){super['render'](),_0xcd4d51(this,this['focusables']);}async destroy(){this['isDirty']=!0x1,this['commentsListView']['destroy'](),this['commentThreadHeaderView']['destroy'](),await this['commentThreadInputView']['destroy'](),super['destroy']();}_createCommentThreadInputView(){const _0x446738=new Gt(this['locale'],this['_localUser'],this['_config']['editorConfig']),_0x18342c=_0x446738['commentInputView'];return _0x446738['bind']('showInput')['to'](this,'isActive',this['_model'],'isReadOnly',this['_model'],'canComment',this['_model'],'archivedAt',_0x18342c,'value',(_0x1aacbc,_0x2bab26,_0x56c2d0,_0x1d61ea,_0x34da21)=>!!_0x34da21||!!_0x1d61ea&&_0x56c2d0&&!_0x2bab26||_0x1aacbc&&_0x56c2d0&&!_0x2bab26),_0x18342c['bind']('placeholder')['to'](this,'length',this['_model'],'isResolvable',this['_model'],'isResolved',(_0x5b4ea9,_0x41d4fb,_0x8868f7)=>{let _0x32bd7c;return _0x32bd7c=_0x8868f7&&_0x41d4fb?'Reply\x20to\x20reopen\x20discussion...':_0x5b4ea9?'Reply...':'Write\x20a\x20comment...',Vt(this['locale'],_0x32bd7c);}),_0x18342c['bind']('submitLabel')['to'](this,'length',_0x1de837=>Vt(this['locale'],_0x1de837?'Reply':'Comment')),_0x18342c['on']('submit',(_0x14be1a,_0x5dd6f9)=>{this['fire']('addComment',_0x5dd6f9),this['_model']['isResolved']&&this['_model']['isResolvable']&&this['fire']('reopenCommentThread',this['_model']['id']),this['_model']['isSubmitted']||this['fire']('submitCommentThread');}),_0x18342c['on']('cancel',()=>{this['focus']();}),_0x18342c['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0x18342c['on']('cancel',_0x3b445e=>{0x0==this['length']&&(this['fire']('removeCommentThread'),_0x3b445e['stop']());}),this['on']('change:isActive',(_0x5e04df,_0x31f47e,_0x18f439)=>{_0x18f439||this['length']||_0x18342c['value']||this['fire']('removeCommentThread');}),_0x446738;}};const Qt=/* #__PURE__ -- @preserve */
|
|
27
|
-
_0x4ef9ec(Jt);var Zt=class extends Qt{commentThreadChildren;containerElement;resolveButton;reopenButton;_boundFirstCommentView;constructor(_0x531cfc,_0x519741,_0x2f2954,_0x1e9713){super(_0x531cfc,_0x519741,_0x2f2954,_0x1e9713),this['commentThreadChildren']=this['createCollection']([this['commentsListView'],this['commentThreadInputView'],this['ariaDescriptionView']]),this['set']('actionIndicator',null),this['containerElement']=null,this['_boundFirstCommentView']=null,this['locale']=_0x531cfc,this['resolveButton']=this['_createResolveButton'](),this['reopenButton']=this['_createReopenButton'](),this['setTemplate'](this['getTemplate']()),this['on']('change:isActive',(_0x5086ec,_0x52a984,_0x1e8915)=>{_0x1e8915||this['_cancelAllConfirms']();}),this['listenTo'](this['_model'],'change:isReadOnly',(_0x4b1648,_0x1ec3c5,_0x1059ab)=>{_0x1059ab&&this['_cancelAllConfirms']();}),this['length']>0x0&&this['_bindFirstCommentView'](),this['listenTo'](this['commentsListView']['commentViews'],'add',()=>{this['_bindFirstCommentView']();});}getTemplate(){const _0x24ee5b=this['bindTemplate'];return{'tag':'div','attributes':{'class':['ck','ck-thread','ck-reset_all-excluded','ck-rounded-corners',_0x24ee5b['if']('isActive','ck-thread--active'),_0x24ee5b['if']('isUnlinked','ck-thread--unlinked'),_0x24ee5b['to']('actionIndicator',_0x38bf83=>_0x38bf83?'ck-thread--'+_0x38bf83:'')],'data-thread-id':this['_model']['id'],'tabindex':0x0,'role':'listitem','aria-label':_0x24ee5b['to']('ariaLabel'),'aria-describedby':this['ariaDescriptionView']['id']},'children':[{'tag':'div','attributes':{'class':'ck-thread__container'},'children':this['commentThreadChildren']}]};}['render'](){super['render'](),this['containerElement']=this['element']['querySelector']('.ck-thread__container');}['_cancelAllConfirms'](){this['cancelConfirm']();for(const _0x4a53de of this['commentsListView']['commentViews'])_0x4a53de['cancelConfirm']();}_bindFirstCommentView(){const {locale:_0x397c9d}=this,_0x320f26=this['commentsListView']['commentViews']['get'](0x0);_0x320f26===this['_boundFirstCommentView']||_0x320f26['isSystemComment']||(this['_boundFirstCommentView']=_0x320f26,this['unbind']('actionIndicator'),this['bind']('actionIndicator')['to'](_0x320f26,'actionIndicator',_0xe3bde9=>'remove'===_0xe3bde9?'remove':null),_0x320f26['placeholder']=Vt(_0x397c9d,'Write\x20a\x20comment...'),_0x320f26['bind']('contextValue')['to'](this['_model'],'context',_0x2dcde3=>_0x2dcde3?'string'==typeof _0x2dcde3['value']&&_0x2dcde3['value']?$t(_0x2dcde3['value']):Vt(_0x397c9d,'Comment\x20was\x20made\x20on\x20an\x20element'):null),_0x320f26['bind']('isThreadArchived')['to'](this['_model'],'archivedAt',_0x276675=>!!_0x276675),_0x320f26['bind']('isThreadUnlinked')['to'](this['_model'],'unlinkedAt',_0x2f1a55=>!!_0x2f1a55),_0x320f26['removeButton']['on']('execute',_0x4cb5b1=>{_0x4cb5b1['stop'](),this['showConfirm'](Vt(_0x397c9d,'Delete\x20comment\x20thread?'),this['containerElement'])['then'](()=>{this['fire']('removeCommentThread');});},{'priority':'high'}),this['on']('removeConfirm',()=>{_0x320f26['focus']();}),_0x320f26['actionBar']['add'](this['reopenButton'],0x0),_0x320f26['focusables']['add'](this['reopenButton'],0x0),_0x320f26['actionBar']['add'](this['resolveButton'],0x0),_0x320f26['focusables']['add'](this['resolveButton'],0x0));}_createResolveButton(){const _0x3fe4c0=new _0x51ccd1(this['locale']);return _0x3fe4c0['label']=Vt(this['locale'],'Resolve'),_0x3fe4c0['tooltip']=Vt(this['locale'],'Resolve'),_0x3fe4c0['icon']=_0x523553,_0x3fe4c0['extendTemplate']({'attributes':{'class':['ck-comment--resolve','ck-button_small']}}),_0x3fe4c0['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x4e86e1=>!_0x4e86e1),_0x3fe4c0['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x624e98,_0x3793aa)=>_0x624e98&&!_0x3793aa),_0x3fe4c0['on']('execute',()=>{this['fire']('resolveCommentThread',this['_model']['id']);}),_0x3fe4c0;}_createReopenButton(){const _0x10302e=new _0x51ccd1(this['locale']);return _0x10302e['label']=Vt(this['locale'],'Reopen'),_0x10302e['tooltip']=Vt(this['locale'],'Reopen'),_0x10302e['icon']=et,_0x10302e['extendTemplate']({'attributes':{'class':['ck-comment--reopen','ck-button_small']}}),_0x10302e['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x355257=>!_0x355257),_0x10302e['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0xe6c479,_0x294fef)=>_0xe6c479&&_0x294fef),_0x10302e['on']('execute',()=>{this['fire']('reopenCommentThread',this['_model']['id']);}),_0x10302e;}},te=class extends wt{_contextUnlinkedIconView;_contextResizeObserver=null;constructor(_0x403a33){super(_0x403a33),this['set']('content',''),this['set']('contextValue',null),this['set']('isThreadArchived',!0x1),this['set']('isThreadUnlinked',!0x1),this['_contextUnlinkedIconView']=new lt(),this['_contextUnlinkedIconView']['content']=it,this['registerChild'](this['_contextUnlinkedIconView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck-content','ck-comment__content','ck-annotation__content']}});}['render'](){super['render'](),this['on']('change:content',()=>this['_renderContent']()),this['on']('change:contextValue',()=>this['_renderContent']()),this['on']('change:isThreadArchived',()=>this['_renderContent']()),this['on']('change:isThreadUnlinked',()=>this['_renderContent']()),this['_renderContent']();}destroy(){super['destroy'](),this['_destroyContextResizeObserver']();}_renderContent(){const _0x33de77=this['element'];this['_destroyContextResizeObserver'](),_0x33de77['innerHTML']=_0x2af1d3(this['content']);const _0x46c7b8=this['contextValue']?.['trim']();if(_0x46c7b8){const _0x503a0f=document['createElement']('div'),_0x17fbb5=document['createElement']('p');_0x503a0f['classList']['add']('ck-comment__context'),_0x17fbb5['textContent']=_0x46c7b8,_0x503a0f['append'](_0x17fbb5),this['isThreadUnlinked']&&(_0x503a0f['classList']['add']('ck-comment__context_unlinked'),_0x503a0f['prepend'](this['_contextUnlinkedIconView']['element'])),_0x33de77['prepend'](_0x503a0f),this['isThreadArchived']&&this['_attachContextTooltip'](_0x503a0f,_0x17fbb5,_0x46c7b8);}}_attachContextTooltip(_0x3faa9e,_0x4741d9,_0x41510a){_0x3faa9e['dataset']['ckeTooltipText']=_0x41510a,_0x3faa9e['dataset']['ckeTooltipClass']='ck-tooltip_multi-line\x20ck-comment__context-tooltip',_0x3faa9e['dataset']['ckeTooltipDisabled']='true',this['_contextResizeObserver']=new _0x5d9245(_0x4741d9,()=>{_0x4741d9['scrollWidth']>_0x4741d9['clientWidth']?delete _0x3faa9e['dataset']['ckeTooltipDisabled']:_0x3faa9e['dataset']['ckeTooltipDisabled']='true';});}_destroyContextResizeObserver(){this['_contextResizeObserver']&&(this['_contextResizeObserver']['destroy'](),this['_contextResizeObserver']=null);}},ee=class extends wt{['visibleView'];ariaDescriptionView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];['_model'];['_config'];constructor(_0xa0ac5c,_0x4217f9,_0x4a6901){super(_0xa0ac5c),this['_model']=_0x4217f9,this['_config']=_0x4a6901,this['isSystemComment']=!!this['_config']['isSystemComment'],this['set']('isEditMode',!0x1),this['set']('isCollapsed',!0x0),this['set']('contextValue',null),this['set']('isThreadArchived',!0x1),this['set']('isThreadUnlinked',!0x1),this['bind']('ariaLabel')['to'](_0x4217f9,'content',_0x4217f9,'authoredAt',this,'contextValue',this,'isThreadUnlinked',(_0x36927f,_0x1a78fc,_0x39665c,_0x2a72a4)=>{const _0x4a06e1=new DOMParser()['parseFromString'](_0x2af1d3(_0x36927f),'text/html')['body']['textContent'],_0x25b158=Vt(_0xa0ac5c,'COMMENT_ARIA_LABEL',[_0x4217f9['author']['name'],_0x4a6901['formatDateTime'](_0x1a78fc),_0x4a06e1,_0x4217f9['isExternal']?this['getExternalCommentNote']():'']),_0x4f5de4=_0x39665c?.['trim']();if(!_0x4f5de4)return _0x25b158;const _0x461b0e=Vt(_0xa0ac5c,_0x2a72a4?'THREAD_CONTEXT_UNLINKED_LABEL':'THREAD_CONTEXT_LABEL',_0x4f5de4);return _0x25b158['trimEnd']()['replace'](/\.$/,'')+'.\x20'+_0x461b0e;}),this['ariaDescriptionView']=new _0x1cdfe9(_0xa0ac5c,Vt(_0xa0ac5c,'COMMENT_THREAD_DESCRIPTION')),this['visibleView']=this['createCollection'](),this['visibleView']['add'](this['_createCommentContentView']()),this['focusables']=new gt(),this['focusTracker']=new _0xf91994(),this['keystrokes']=new _0x771e58(),this['focusCycler']=new dt({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x9515f3=>_0x9515f3['target']!==this['element']},'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}});}['expand'](){this['isCollapsed']=!0x1;}['collapse'](){this['isEditMode']||(this['isCollapsed']=!0x0);}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['_setupKeyboardNavigation']();}async destroy(){await this['visibleView']['get'](0x0)['destroy'](),super['destroy']();}switchToEditMode(){this['isEditMode']||(this['isEditMode']=!0x0,this['visibleView']['remove'](0x0)['destroy'](),this['visibleView']['add'](this['_createCommentInputView']()));}switchToDisplayMode(){this['isEditMode']&&(this['isEditMode']=!0x1,this['visibleView']['remove'](0x0)['destroy'](),this['visibleView']['add'](this['_createCommentContentView']()));}getExternalCommentNote(){return'importWord'===this['_model']['attributes']['@external']['source']?Vt(this['locale'],'EXTERNAL_IMPORT_WORD_COMMENT'):Vt(this['locale'],'EXTERNAL_COMMENT');}getUserViewNotificationText(){return this['_model']['isExternal']?'importWord'===this['_model']['attributes']['@external']['source']?Vt(this['locale'],'EXTERNAL_IMPORT_WORD_AVATAR',this['_model']['creator']['name']):Vt(this['locale'],'EXTERNAL_AVATAR',this['_model']['creator']['name']):null;}_createCommentContentView(){const _0x4a3b2f=new te(this['locale']);return _0x4a3b2f['bind']('contextValue','isThreadArchived','isThreadUnlinked')['to'](this),_0x4a3b2f['bind']('content')['to'](this['_model'],'content',this,'isCollapsed',(_0x2aa579,_0x4f49e3)=>_0x4f49e3?_0xc55986(_0x2aa579,{'limit':this['_config']['maxCommentCharsWhenCollapsed']}):_0x2aa579),_0x4a3b2f;}_createCommentInputView(){this['_config']['editorConfig']||(this['_config']['editorConfig']={}),this['_config']['editorConfig']['initialData']=this['_model']['content'];const _0xce2afc=new Kt(this['locale'],this['_config']['editorConfig']);return _0xce2afc['value']=this['_model']['content'],_0xce2afc['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0xce2afc['submitLabel']=Vt(this['locale'],'Save'),_0xce2afc['on']('submit',(_0x2f9432,_0x47a2c2)=>{this['fire']('updateComment',this['_model']['id'],_0x47a2c2),this['switchToDisplayMode'](),this['focus']();}),_0xce2afc['on']('cancel',()=>{this['switchToDisplayMode'](),this['focus']();}),_0xce2afc['once']('editorReady',()=>{_0xce2afc['focus']();}),_0xce2afc['createEditor'](),_0xce2afc['delegate']('editorReady')['to'](this),_0xce2afc['delegate']('editorDestroyed')['to'](this),_0xce2afc;}_setupKeyboardNavigation(){const _0x17127a=this['element'];this['keystrokes']['listenTo'](_0x17127a);for(const _0x1cab58 of this['focusables'])this['focusTracker']['add'](_0x1cab58['element']),this['keystrokes']['listenTo'](_0x1cab58['element']);this['focusables']['on']('change',(_0x1ea1f6,_0x1b1d96)=>{for(const _0x508e9d of _0x1b1d96['removed'])this['focusTracker']['remove'](_0x508e9d['element']),this['keystrokes']['stopListening'](_0x508e9d['element']);for(const _0x68c14a of _0x1b1d96['added'])this['focusTracker']['add'](_0x68c14a['element']),this['keystrokes']['listenTo'](_0x68c14a['element']);}),this['keystrokes']['set']('enter',(_0x394d94,_0x1e39ed)=>{_0x17127a===_0x394d94['target']&&(this['focusCycler']['focusFirst'](),_0x1e39ed());}),this['keystrokes']['set']('esc',(_0x402bea,_0x3b5c98)=>{_0x17127a!==_0x402bea['target']&&(this['focus'](),_0x3b5c98());});}};const ie=/* #__PURE__ -- @preserve */
|
|
28
|
-
|
|
29
|
-
_0x4c7d8c();var he=class Annotation extends re{['view'];focusableElements;_type;_target;constructor({view:_0x2c5ab9,target:_0x2c8d5c,type:_0x14fa70,isVisible:_0x3015d3=!0x0}){super(),this['view']=_0x2c5ab9,this['view']['element']||this['view']['render'](),this['_type']=_0x14fa70,this['_target']=_0x2c8d5c,Annotation['_assertCorrectTarget'](this['_getNormalizedTarget']()),this['focusableElements']=new _0x28de1d([this['view']['element']],{'idProperty':'_id'}),this['focusableElements']['on']('add',(_0x2819f3,_0x459b58)=>{this['view']['focusTracker']['add'](_0x459b58);}),this['focusableElements']['on']('remove',(_0x30160a,_0x110095)=>{this['view']['focusTracker']['remove'](_0x110095);}),this['set']('isVisible',_0x3015d3);}get type(){return'function'==typeof this['_type']?this['_type']():this['_type'];}get['innerView'](){return this['view']['mainView'];}get target(){const _0x5678d5=this['_getNormalizedTarget']();return Annotation['_assertCorrectTarget'](_0x5678d5),_0x5678d5;}get targetRect(){const _0x1f381e=this['target'];if(null===_0x1f381e)return null;if(_0x1f381e instanceof _0x7454d6)return _0x1f381e;const _0x22010f=_0x1f381e['filter'](_0x4b8f75=>function(_0x5714d6){return!!_0x5714d6['offsetParent']||!!_0x5714d6['getClientRects']()['item'](0x0);}(_0x4b8f75));return 0x0===_0x22010f['length']?null:_0x7454d6['getDomElementRects'](_0x22010f[0x0])[0x0];}get isActive(){return this['view']['isActive'];}set isActive(_0x5a764b){this['view']['isActive']=_0x5a764b,this['view']['mainView']['isActive']=_0x5a764b;}updateTargetRect(){this['view']['targetRect']=this['targetRect'];}destroy(){this['focusableElements']['stopListening'](),this['focusableElements']['clear'](),this['stopListening']();}refreshVisibility(){this['isVisible']=!!this['targetRect'];}static _assertCorrectTarget(_0x5c26c7){if(!(null===_0x5c26c7||_0x5c26c7 instanceof _0x7454d6||Array['isArray'](_0x5c26c7)&&_0x5c26c7['every'](_0x4660fd=>ae(_0x4660fd))))throw new _0x237693('annotation-invalid-target',null,{'target':_0x5c26c7});}_getNormalizedTarget(){const _0x443e0a='function'==typeof this['_target']?this['_target']():this['_target'];return ae(_0x443e0a)?[_0x443e0a]:_0x443e0a;}};function ae(_0x3f9fc6){return null!==_0x3f9fc6&&'object'==typeof _0x3f9fc6&&'nodeType'in _0x3f9fc6&&0x1===_0x3f9fc6['nodeType'];}var ce=class extends _0x28de1d{_innerViewToAnnotation;_viewToAnnotation;['_focusTracker'];constructor(_0x4314ae=[]){super(),this['_innerViewToAnnotation']=new Map(),this['_viewToAnnotation']=new Map(),this['_focusTracker']=new _0xf91994(),this['_focusTracker']['on']('change:isFocused',(_0x3c6eef,_0x3069a4,_0x18616c)=>{_0x18616c||this['fire']('blur');});for(const _0x40f46e of _0x4314ae)this['add'](_0x40f46e);}get['isFocused'](){return this['_focusTracker']['isFocused'];}['add'](_0x539a58){if(this['has'](_0x539a58))throw new _0x237693('annotationcollection-duplicated-item',null);this['_innerViewToAnnotation']['set'](_0x539a58['innerView'],_0x539a58),this['_viewToAnnotation']['set'](_0x539a58['view'],_0x539a58);for(const _0x5ae1cb of _0x539a58['focusableElements'])this['_focusTracker']['add'](_0x5ae1cb);if(this['listenTo'](_0x539a58['focusableElements'],'add',(_0x45a921,_0x5c22d8)=>{this['_focusTracker']['add'](_0x5c22d8);}),this['listenTo'](_0x539a58['focusableElements'],'remove',(_0x1ec0bb,_0x2f9cb7)=>{this['_focusTracker']['remove'](_0x2f9cb7);}),this['listenTo'](_0x539a58['view']['focusTracker'],'change:isFocused',(_0x562938,_0x4bcc55,_0x40326a)=>{_0x40326a&&this['fire']('focus',_0x539a58);}),_0x539a58['updateTargetRect'](),this['_areCachedRectsStale']()){for(const _0x188526 of this)_0x188526['updateTargetRect']();}const _0x255687=this['_getOrderInContent'](_0x539a58['view']['targetRect']);return super['add'](_0x539a58,_0x255687);}['remove'](_0x2455f7){if(!this['has'](_0x2455f7))throw new _0x237693('annotationcollection-not-existing-item',null);this['stopListening'](_0x2455f7['view']['focusTracker']),this['stopListening'](_0x2455f7['focusableElements']);for(const _0x8eb4e of _0x2455f7['focusableElements'])this['_focusTracker']['remove'](_0x8eb4e);return this['_viewToAnnotation']['delete'](_0x2455f7['view']),this['_innerViewToAnnotation']['delete'](_0x2455f7['innerView']),super['remove'](_0x2455f7);}getByInnerView(_0x38e473){return this['_innerViewToAnnotation']['get'](_0x38e473);}getByView(_0x160cb2){return this['_viewToAnnotation']['get'](_0x160cb2);}destroy(){super['clear'](),this['stopListening'](),this['_innerViewToAnnotation']['clear'](),this['_viewToAnnotation']['clear'](),this['_focusTracker']['destroy']();}refreshPositioning(){for(const _0x255c0f of this)_0x255c0f['updateTargetRect']();this['_sort']();}_sort(){const _0x336112=Array['from'](this)['sort']((_0x360120,_0x2f11a0)=>le(_0x360120['view']['targetRect'],_0x2f11a0['view']['targetRect']));for(let _0x42dc2c=_0x336112['length']-0x1;_0x42dc2c>0x0;_0x42dc2c--){const _0x43691f=_0x336112[_0x42dc2c];_0x42dc2c!==this['getIndex'](_0x43691f)&&(this['remove'](_0x43691f),this['add'](_0x43691f));}}_getOrderInContent(_0x4dee2b){let _0x22a137=0x0;if(!_0x4dee2b)return this['length'];for(const _0x3fa54f of this){const _0x2eb24c=_0x3fa54f['view']['targetRect'];if(_0x2eb24c){if(le(_0x4dee2b,_0x2eb24c)<0x0)return _0x22a137;_0x22a137++;}}return _0x22a137;}_areCachedRectsStale(){const _0x129c08=this['get'](0x0);if(!_0x129c08)return!0x1;const _0x552124=_0x129c08['view']['targetRect'],_0x4fd08c=_0x129c08['targetRect'];return!(!_0x552124||!_0x4fd08c)&&(_0x552124['top']!==_0x4fd08c['top']||_0x552124['left']!==_0x4fd08c['left']);}};function de({source:_0x49f7ab,target:_0x577302,filter:_0x47c335}){for(const _0x3f8f58 of _0x49f7ab)_0x47c335(_0x3f8f58)&&_0x577302['add'](_0x3f8f58);_0x577302['listenTo'](_0x49f7ab,'add',(_0x3ef641,_0x525b8c)=>{_0x47c335(_0x525b8c)&&_0x577302['add'](_0x525b8c);}),_0x577302['listenTo'](_0x49f7ab,'remove',(_0x5d99c6,_0x418224)=>{_0x577302['has'](_0x418224)&&_0x577302['remove'](_0x418224);});}function le(_0x472dd5,_0x500e40){if(null===_0x472dd5&&null===_0x500e40)return 0x0;if(null===_0x472dd5)return-0x1;if(null===_0x500e40)return 0x1;const _0x460a29=_0x472dd5['top']-_0x500e40['top'];return 0x0==_0x460a29?_0x472dd5['left']-_0x500e40['left']:_0x460a29;}var me=class extends _0x44c171{collection;_visibleAnnotations;static get['pluginName'](){return'Annotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xbbab27){if(super(_0xbbab27),this['collection']=new ce(),this['_visibleAnnotations']=new ce(),this['set']('activeAnnotations',new Set()),this['_bindAnnotationsToVisibleAnnotations'](),_0xbbab27 instanceof _0x5941e2){const _0x1f665a=_0xbbab27['locale'];_0xbbab27['accessibility']['addKeystrokeInfoGroup']({'id':'annotations','label':Vt(_0x1f665a,'ACCESSIBILITY_HELP_ANNOTATIONS_GROUP'),'keystrokes':[{'label':Vt(_0x1f665a,'ACCESSIBILITY_HELP_ANNOTATIONS_MOVE_TO'),'keystroke':'Ctrl+Shift+E'},{'label':Vt(_0x1f665a,'ACCESSIBILITY_HELP_ANNOTATIONS_EXIT'),'keystroke':'Esc'},{'label':Vt(_0x1f665a,'ACCESSIBILITY_HELP_ANNOTATIONS_ENTER'),'keystroke':'Enter'},{'label':Vt(_0x1f665a,'ACCESSIBILITY_HELP_ANNOTATIONS_BROWSE_GROUPS'),'keystroke':[['Tab'],['Shift+Tab']]},{'label':Vt(_0x1f665a,'ACCESSIBILITY_HELP_ANNOTATIONS_SUBMIT_COMMENT'),'keystroke':['Ctrl+Enter']},{'label':Vt(_0x1f665a,'ACCESSIBILITY_HELP_ANNOTATIONS_NAVIGATE_THREADS'),'keystroke':[['Arrowup'],['Arrowdown']]}]});}this['_setupEnterAnnotationKeystroke'](),this['_setupEscapeAnnotationHandling']();}['add'](_0x5606d7){this['collection']['add'](_0x5606d7);}['remove'](_0x5d4524){this['collection']['remove'](_0x5d4524),_0x5d4524['destroy']();}refreshVisibility(){for(const _0x5e700d of this['collection'])_0x5e700d['refreshVisibility']();}refreshPositioning(){this['_visibleAnnotations']['refreshPositioning']();}getByInnerView(_0x22c6c0){return this['collection']['getByInnerView'](_0x22c6c0);}deactivateAll(){this['fire']('_deactivateAllAnnotations');}destroy(){for(const _0x181998 of this['collection'])_0x181998['destroy']();this['_visibleAnnotations']['destroy'](),this['collection']['destroy'](),super['destroy']();}activate(_0xc8da17){this['fire']('_activateAnnotation',_0xc8da17);}createAnnotation(_0x502504){return new he(_0x502504);}createAnnotationView(_0x36dbdf,_0x493e13){return new oe(_0x36dbdf,_0x493e13);}_addActiveAnnotation(_0x315d5c){const _0x224452=new Set(this['activeAnnotations']);_0x224452['add'](_0x315d5c),this['activeAnnotations']=_0x224452;}_removeActiveAnnotation(_0x1a9953){const _0x2f565c=new Set(this['activeAnnotations']);_0x2f565c['delete'](_0x1a9953),this['activeAnnotations']=_0x2f565c;}_bindAnnotationsToVisibleAnnotations(){const _0xe5c70e=this['collection'],_0x23bfed=this['_visibleAnnotations'];function _0x185efa(_0x82f011){const _0x2e81cd=_0x82f011['source'];_0x2e81cd['isVisible']&&!_0x23bfed['has'](_0x2e81cd)?_0x23bfed['add'](_0x2e81cd):!_0x2e81cd['isVisible']&&_0x23bfed['has'](_0x2e81cd)&&_0x23bfed['remove'](_0x2e81cd),_0x2e81cd['view']['focusTracker']['remove'](_0x2e81cd['view']['element']),_0x2e81cd['view']['focusTracker']['add'](_0x2e81cd['view']['element']);}this['listenTo'](_0xe5c70e,'add',(_0xdf1739,_0x24f36b)=>{_0x24f36b['isVisible']&&_0x23bfed['add'](_0x24f36b),this['listenTo'](_0x24f36b,'change:isVisible',_0x185efa);}),this['listenTo'](_0xe5c70e,'remove',(_0x260b24,_0xea8ed7)=>{_0x23bfed['has'](_0xea8ed7)&&_0x23bfed['remove'](_0xea8ed7),this['stopListening'](_0xea8ed7,'change:isVisible',_0x185efa);});}_setupEnterAnnotationKeystroke(){const _0x5ee22f=_0x595718=>{_0x595718['on']('ready',()=>{_0x595718['keystrokes']['set'](_0xf9ca0,(_0x423d5c,_0x39ce6e)=>{const _0x53e68e=_0x356eaa(this['activeAnnotations']['values']());_0x53e68e&&(_0x53e68e['view']['focus'](),_0x39ce6e());});});};this['context']instanceof _0x5941e2?_0x5ee22f(this['context']):this['context']['editors']&&this['context']['editors']['on']('add',(_0x3de5a7,_0x3e1a22)=>{_0x5ee22f(_0x3e1a22);});}_setupEscapeAnnotationHandling(){const _0x172149=_0x1c63f2=>{const _0x1c5708=_0x1c63f2['source'],_0x11ac53=[];let _0x796125;if(Array['isArray'](_0x1c5708['target'])){_0x796125=_0x1c5708['target'][0x0],this['context']instanceof _0x5941e2?_0x11ac53['push'](this['context']):this['context']['editors']&&_0x11ac53['push'](...this['context']['editors']);for(const _0x17ddc1 of _0x11ac53)for(const _0x114a6c of _0x17ddc1['editing']['view']['domRoots']['values']())if(_0x4c4c9b(_0x114a6c,_0x796125))return void _0x17ddc1['editing']['view']['focus']();_0x796125['focus']();}};this['listenTo'](this['collection'],'add',(_0x1447c3,_0x33de25)=>{this['listenTo'](_0x33de25,'escape',_0x172149,{'priority':'low'});}),this['listenTo'](this['collection'],'remove',(_0x382b7a,_0x361eff)=>{this['stopListening'](_0x361eff,'escape',_0x172149);});}};const ue=Symbol('noChannel'),fe={'admin':!0x0,'modifyAll':!0x1,'write':!0x0,'resolve':!0x0},pe=/* #__PURE__ -- @preserve */
|
|
30
|
-
|
|
31
|
-
_0x4c7d8c();var we=class extends _0x44c171{_threads;_threadToController;_viewToController;_commentEditorConfig=null;static get requires(){return[me,_0x44b09b,_0x227f13];}static get['pluginName'](){return'CommentsRepository';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x383916){super(_0x383916),this['_threads']=new Map(),this['_threadToController']=new Map(),this['_viewToController']=new Map(),this['set']('_readOnlyChannels',new Set()),this['set']('_permissions',new Map());const _0x4afcff=this['context']['config'];_0x4afcff['define']('comments.maxCommentsWhenCollapsed',0x2),_0x4afcff['define']('comments.maxThreadTotalWeight',0x1f4),_0x4afcff['define']('comments.maxCommentCharsWhenCollapsed',0x8c),_0x4afcff['define']('comments.CommentThreadView',Zt),_0x4afcff['define']('comments.CommentView',se),_0x4afcff['get']('comments.editorConfig')||console['warn']('Missing\x20comments\x20editor\x20configuration\x20(`comments.editorConfig`).\x20Default\x20configuration\x20will\x20be\x20used\x20instead.');}init(){const _0x4d21ba=this['context']['plugins']['get'](me);this['set']('activeCommentThread',null),this['on']('addCommentThread',(_0x461e42,_0x182190)=>this['_addCommentThread'](_0x182190)),this['on']('submitCommentThread',(_0x4198a8,_0xf8688a)=>this['_submitCommentThread'](_0xf8688a)),this['on']('resolveCommentThread',(_0x1a0527,_0x3490ec)=>this['_resolveCommentThread'](_0x3490ec)),this['on']('resolveCommentThread',(_0x4cf43d,_0x2e1e45)=>this['_updateActiveAnnotation'](_0x2e1e45),{'priority':'lowest'}),this['on']('reopenCommentThread',(_0x4d97d1,_0x373f21)=>this['_reopenCommentThread'](_0x373f21)),this['on']('reopenCommentThread',(_0x47dd07,_0x155c71)=>this['_updateActiveAnnotation'](_0x155c71),{'priority':'lowest'}),this['on']('removeCommentThread',(_0x22f4e9,_0x25744a)=>this['_removeCommentThread'](_0x25744a)),this['on']('updateCommentThread',(_0x4ce37b,_0x48e3df)=>this['_updateCommentThread'](_0x48e3df)),this['on']('updateCommentThread',(_0x3f044c,_0xc12d6e)=>this['_updateActiveAnnotation'](_0xc12d6e),{'priority':'lowest'}),this['on']('addComment',(_0x2cdddc,_0x5fb024)=>this['_addComment'](_0x5fb024)),this['on']('updateComment',(_0x3c6e05,_0x11978c)=>this['_updateComment'](_0x11978c)),this['on']('removeComment',(_0x5f3714,_0x282f29)=>this['_removeComment'](_0x282f29)),this['on']('addComment',(_0x433965,{threadId:_0x11c49b,isFromAdapter:_0x3769c5})=>{if(_0x3769c5)return;const _0x59ef31=this['getCommentThread'](_0x11c49b),_0x19c1ad=_0x59ef31&&this['_threadToController']['get'](_0x59ef31);_0x19c1ad&&_0x19c1ad['view']['commentsListView']['focus'](-0x1);},{'priority':'lowest'}),this['listenTo'](_0x4d21ba,'change:activeAnnotations',(_0x2bd064,_0x4678c6,_0x5df7fa)=>{const _0x49d793=Array['from'](_0x5df7fa)['map'](_0x5c9443=>this['_viewToController']['get'](_0x5c9443['innerView']))['filter'](Boolean)[0x0];this['activeCommentThread']=_0x49d793?_0x49d793['model']:null;});}set adapter(_0x4133eb){if(this['_adapter'])throw new _0x237693('commentsrepository-adapter-already-set');this['_adapter']=_0x4133eb;}get adapter(){return this['_adapter'];}addCommentThread({channelId:_0x1f44b5=ue,threadId:_0xae3888=_0x25cc7d(),comments:_0x4fc333=[],unlinkedAt:_0x20f2c8=null,resolvedAt:_0x4310ec=null,resolvedBy:_0x2879f4=null,target:_0x26d4df=null,context:_0x3e97a2=null,attributes:_0x52d677={},isResolvable:_0x3485a7=!0x0,isSubmitted:_0x56d005=!0x1,isFromAdapter:_0x4f2f7d=!0x1}={}){return this['fire'](ve('addCommentThread',_0x1f44b5),{'channelId':_0x1f44b5,'threadId':_0xae3888,'comments':_0x4fc333,'unlinkedAt':_0x20f2c8,'resolvedAt':_0x4310ec,'resolvedBy':_0x2879f4,'target':_0x26d4df,'context':_0x3e97a2,'attributes':_0x52d677,'isFromAdapter':_0x4f2f7d,'isResolvable':_0x3485a7,'isSubmitted':_0x56d005}),this['getCommentThread'](_0xae3888);}openNewCommentThread({channelId:_0x20bd70=ue,threadId:_0x140e5b=_0x25cc7d(),target:_0x1da579,context:_0x29936a=null,isResolvable:_0x150bb9=!0x0}){if(this['_readOnlyChannels']['has'](_0x20bd70)||this['_readOnlyChannels']['has'](void 0x0))return null;if(!_0x1da579)throw new _0x237693('commentsrepository-missing-target');const _0x336133=this['addCommentThread']({'channelId':_0x20bd70,'threadId':_0x140e5b,'target':_0x1da579,'context':_0x29936a,'isResolvable':_0x150bb9});if(!_0x336133)return null;const _0x204f3a=this['_threadToController']['get'](_0x336133),_0x3668f0=_0x204f3a['view']['commentThreadInputView']['commentInputView'],_0x1ff5a1=this['context']['plugins']['get'](me),_0x547ab4=_0x1ff5a1['getByInnerView'](_0x204f3a['view']);return _0x1ff5a1['activate'](_0x547ab4),_0x3668f0['once']('editorReady',()=>_0x3668f0['focus']()),_0x336133;}hasCommentThread(_0x377c51){if('string'!=typeof _0x377c51)throw new _0x237693('commentsrepository-invalid-comment-thread-id');return this['_threads']['has'](_0x377c51);}updateCommentThread({channelId:_0x4b5190=ue,threadId:_0xf5bf58,context:_0x1c7e93,unlinkedAt:_0x558e18,attributes:_0x2ae5bc,isFromAdapter:_0x30ca91=!0x1}){return this['fire'](ve('updateCommentThread',_0x4b5190),{'channelId':_0x4b5190,'threadId':_0xf5bf58,'context':_0x1c7e93,'unlinkedAt':_0x558e18,'attributes':_0x2ae5bc,'isFromAdapter':_0x30ca91}),this['getCommentThread'](_0xf5bf58);}getCommentThread(_0x35fe28){if('string'!=typeof _0x35fe28)throw new _0x237693('commentsrepository-invalid-comment-thread-id');return this['_threads']['get'](_0x35fe28);}fetchCommentThread({channelId:_0x16cf33,threadId:_0xc3fbcf}={}){const _0x454040=this['getCommentThread'](_0xc3fbcf);if(_0x454040)return Promise['resolve'](_0x454040);if(!this['adapter'])return Promise['resolve'](void 0x0);if('function'!=typeof this['adapter']['getCommentThread'])throw new _0x237693('commentsrepository-missing-thread-and-adapter-method',this['context']);return this['adapter']['getCommentThread']({'channelId':_0x16cf33,'threadId':_0xc3fbcf})['then'](_0x28c0a0=>this['hasCommentThread'](_0xc3fbcf)?this['getCommentThread'](_0xc3fbcf):_0x28c0a0?this['addCommentThread'](Object['assign']({'isFromAdapter':!0x0,'channelId':_0x16cf33},_0x28c0a0)):void 0x0)['catch'](_0x113b4d=>{throw console['error'](_0x113b4d),new _0x237693('commentsrepository-fetch-comment-thread',this['context']);});}getCommentThreads({channelId:_0x3b8c0d,skipNotAttached:_0x5ebdc7=!0x1,skipEmpty:_0x326d9d=!0x1,toJSON:_0x6672fb=!0x1}={}){const _0x32fcd5=[];for(const _0x45409c of this['_threads']['values']())_0x3b8c0d&&_0x45409c['channelId']!==_0x3b8c0d||_0x5ebdc7&&!_0x45409c['isAttached']||_0x326d9d&&0x0===_0x45409c['length']||_0x32fcd5['push'](_0x45409c);return _0x6672fb?_0x32fcd5['map'](_0x31fb90=>_0x31fb90['toJSON']()):_0x32fcd5;}getAnnotationForCommentThread(_0xc7d3f7){const _0x97dfb0=this['_threadToController']['get'](_0xc7d3f7);return _0x97dfb0&&this['context']['plugins']['get'](me)['getByInnerView'](_0x97dfb0['view'])||null;}getCommentThreadForAnnotation(_0x64e0a0){const _0x2d431a=this['_viewToController']['get'](_0x64e0a0['innerView']);return _0x2d431a?_0x2d431a['model']:null;}setActiveCommentThread(_0x2c58c1){const _0x2aec8b=this['context']['plugins']['get'](me);if(!_0x2c58c1)return void(this['activeCommentThread']&&_0x2aec8b['deactivateAll']());const _0x5b1f63=this['getCommentThread'](_0x2c58c1);if(!_0x5b1f63)throw new _0x237693('commentsrepository-active-missing-comment-thread',null,{'threadId':_0x2c58c1});if(!this['_threadToController']['has'](_0x5b1f63))throw new _0x237693('commentsrepository-active-not-attached',null,{'threadId':_0x2c58c1});const _0x33ee14=_0x2aec8b['getByInnerView'](this['_threadToController']['get'](_0x5b1f63)['view']);_0x2aec8b['activate'](_0x33ee14);}switchReadOnly(_0x143f3c,_0x26fd96){_0x143f3c?this['_readOnlyChannels']['add'](_0x26fd96):this['_readOnlyChannels']['delete'](_0x26fd96),this['fire']('change:_readOnlyChannels','_readOnlyChannels',this['_readOnlyChannels'],this['_readOnlyChannels']);}['isReadOnly'](_0x2af08b){return this['_readOnlyChannels']['has'](_0x2af08b)||this['_readOnlyChannels']['has'](void 0x0);}createCommentThreadController(_0x2f2a0b,_0x12172e){return new Dt(_0x2f2a0b,_0x12172e);}setPermissions(_0x18110f,_0x4ecc79=ue){this['_permissions']['set'](_0x4ecc79,_0x18110f),this['fire']('change:_permissions','_permissions',this['_permissions'],this['_permissions']);}getPermissions(_0x501d48=ue){return this['_permissions']['has'](_0x501d48)?this['_permissions']['get'](_0x501d48):fe;}_addCommentThread({channelId:_0x349d48,threadId:_0x57e904,comments:_0x289049,unlinkedAt:_0x41cbf6,resolvedAt:_0x21934c,resolvedBy:_0x28be8e,target:_0x19c1af,context:_0x12f5b3,attributes:_0x12b0aa,isFromAdapter:_0x37ef8a,isResolvable:_0x171ff6,isSubmitted:_0xd03636}){if('string'!=typeof _0x57e904)throw new _0x237693('commentsrepository-invalid-comment-thread-id',null,{'threadId':_0x57e904});if(this['hasCommentThread'](_0x57e904))throw new _0x237693('commentsrepository-duplicated-comment-thread-id',null,{'threadId':_0x57e904});const _0xe78ed5=new ge(this,{'channelId':_0x349d48,'id':_0x57e904,'context':_0x12f5b3,'attributes':_0x12b0aa,'unlinkedAt':_0x41cbf6,'resolvedAt':_0x21934c,'resolvedBy':_0x28be8e?this['context']['plugins']['get'](_0x227f13)['getUser'](_0x28be8e):null,'isResolvable':_0x171ff6,'isSubmitted':_0xd03636||_0x37ef8a});this['_threads']['set'](_0x57e904,_0xe78ed5);for(const _0x40ae1a of _0x289049)_0xe78ed5['_add'](this['_createNewComment']({'threadId':_0x57e904,..._0x40ae1a}));return _0x19c1af&&_0xe78ed5['attachTo'](_0x19c1af),_0x37ef8a||!_0xe78ed5['length']?Promise['resolve']():this['_submitCommentThread']({'channelId':_0x349d48,'threadId':_0x57e904});}_submitCommentThread({channelId:_0x49bc0b,threadId:_0x16d448}){if(!this['hasCommentThread'](_0x16d448))throw new _0x237693('commentsrepository-missing-comment-thread',this);const _0x34d5c0=this['getCommentThread'](_0x16d448);if(_0x34d5c0['_isSubmitted']=!0x0,!this['adapter']||'function'!=typeof this['adapter']['addCommentThread'])return Promise['resolve']();const {id:_0x1b35eb,comments:_0x809e44,resolvedAt:_0x1abebc,resolvedBy:_0x360488,context:_0x1faac2,attributes:_0x2cffeb}=_0x34d5c0,_0x12b0bc=this['context']['plugins']['get']('PendingActions'),_0x50d3c6=_0x12b0bc['add'](Vt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['addCommentThread']({'channelId':_0x49bc0b,'threadId':_0x1b35eb,'comments':_0x809e44['map'](_0x3b639b=>_0x3b639b['toJSON']()),'resolvedAt':_0x1abebc,'resolvedBy':_0x360488?_0x360488['id']:_0x360488,'context':_0x1faac2,'attributes':_0x2cffeb})['then'](({comments:_0x14ffe6})=>{_0x12b0bc['remove'](_0x50d3c6);for(const _0x34c491 of _0x14ffe6)this['_updateComment']({'channelId':_0x49bc0b,'threadId':_0x16d448,'commentId':_0x34c491['commentId'],'createdAt':_0x34c491['createdAt'],'isFromAdapter':!0x0});})['catch'](_0x204dd3=>{throw console['error'](_0x204dd3),new _0x237693('commentsrepository-add-comment-thread-internal-error',this);});}_attachCommentThread({threadId:_0x298944,target:_0x55cf99}){const _0x29766d=this['getCommentThread'](_0x298944);if(!_0x29766d)throw new _0x237693('commentsrepository-attach-missing-comment-thread',this);const _0x7d90bb=this['context']['plugins']['get']('PendingActions'),_0x4d06ed=this['context']['plugins']['get'](me),_0x49729b=this['_createCommentThreadView'](_0x29766d),_0x57e21c=new Dt(_0x29766d,_0x49729b);let _0x5e7dbe=null;_0x49729b['on']('change:isDirty',(_0x1903d9,_0x206bdd,_0x4f0806)=>{_0x4f0806?_0x5e7dbe=_0x7d90bb['add'](Vt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD')):_0x5e7dbe&&(_0x7d90bb['remove'](_0x5e7dbe),_0x5e7dbe=null);}),this['_threadToController']['set'](_0x29766d,_0x57e21c),this['_viewToController']['set'](_0x49729b,_0x57e21c);const _0x570e29=new oe(this['context']['locale'],_0x49729b);_0x570e29['bind']('length')['to'](_0x49729b),_0x570e29['bind']('isDirty')['to'](_0x49729b,'isDirty',_0x49729b,'length',(_0x4883ef,_0x14151a)=>_0x4883ef||!_0x14151a),_0x570e29['bind']('isActive')['to'](_0x49729b),_0x570e29['type']='comment';const _0x306b2d=new he({'view':_0x570e29,'target':_0x55cf99,'type':'comment','isVisible':!_0x29766d['archivedAt']&&!!('function'==typeof _0x55cf99?_0x55cf99():_0x55cf99)});return _0x49729b['on']('escape',()=>{_0x306b2d['fire']('escape');}),this['_bindAnnotationToEditors'](_0x49729b,_0x306b2d),_0x4d06ed['add'](_0x306b2d),_0x306b2d;}_bindAnnotationToEditors(_0x2a7b3d,_0x18e2bd){this['listenTo'](_0x2a7b3d,'editorReady',(_0x160757,_0x476f6c)=>{const _0x2c5c39=_0x476f6c['ui']['view']['body']['bodyCollectionContainer'];_0x18e2bd['focusableElements']['add'](_0x2c5c39),this['context']instanceof _0x5941e2&&this['context']['ui']['focusTracker']['add'](_0x2c5c39);},{'priority':'highest'}),this['listenTo'](_0x2a7b3d,'editorDestroyed',(_0xbfa30,_0x23d335)=>{const _0x54b717=_0x23d335['ui']['view']['body']['bodyCollectionContainer'];_0x18e2bd['focusableElements']['has'](_0x54b717)&&_0x18e2bd['focusableElements']['remove'](_0x54b717),this['context']instanceof _0x5941e2&&this['context']['ui']['focusTracker']['remove'](_0x54b717);});}_unbindEditors(_0x4c2b83){this['stopListening'](_0x4c2b83,'editorReady'),this['stopListening'](_0x4c2b83,'editorDestroyed');}_createCommentThreadView(_0x2d4a4d){const _0x285833=this['context']['plugins']['get'](_0x227f13),{config:_0x397b8e,locale:_0x5b16a6}=this['context'],_0x9d101b=_0x35d1d5(_0x397b8e['get']('locale'),_0x5b16a6);return new(_0x397b8e['get']('comments.CommentThreadView'))(_0x5b16a6,_0x2d4a4d,_0x285833['me'],{'editorConfig':{...this['_getCommentEditorConfig']()},'copyMarkers':_0x397b8e['get']('comments.copyMarkers'),'maxCommentsWhenCollapsed':_0x397b8e['get']('comments.maxCommentsWhenCollapsed'),'maxThreadTotalWeight':_0x397b8e['get']('comments.maxThreadTotalWeight'),'maxCommentCharsWhenCollapsed':_0x397b8e['get']('comments.maxCommentCharsWhenCollapsed'),'formatDateTime':_0x9d101b,'CommentView':_0x397b8e['get']('comments.CommentView')});}_getCommentEditorConfig(){if(!this['_commentEditorConfig']){const _0x4ddb1a=this['context']['config']['get']('comments.editorConfig');this['_commentEditorConfig']={..._0x4ddb1a,...this['_getCommentEditorOverlayConfig'](_0x4ddb1a),'licenseKey':this['context']['config']['get']('licenseKey')};}return this['_commentEditorConfig'];}_getCommentEditorOverlayConfig(_0x38616e){const _0x189285=this['context']['config'],_0x54dc21=_0x38616e?.['ui']?.['overlayContainer']||_0x189285['get']('sidebar.overlayContainer')||_0x189285['get']('ui.overlayContainer');return _0x54dc21?{'ui':{..._0x38616e?.['ui'],'overlayContainer':_0x54dc21}}:{};}_resolveCommentThread({threadId:_0x3ed3ca,channelId:_0x293711,resolvedAt:_0x43438f,resolvedBy:_0x51f592,isFromAdapter:_0x5409b5}){if(!this['hasCommentThread'](_0x3ed3ca))throw new _0x237693('commentsrepository-missing-comment-thread',null,{'threadId':_0x3ed3ca});const _0x39a3e2=this['getCommentThread'](_0x3ed3ca);if(_0x39a3e2['isResolved'])throw new _0x237693('commentsrepository-resolved-comment-thread',null,{'threadId':_0x3ed3ca});const _0x430319=this['context']['plugins']['get'](_0x227f13);if(_0x39a3e2['resolvedBy']=_0x430319['getUser'](_0x51f592),_0x39a3e2['resolvedAt']=_0x43438f,_0x5409b5||!this['adapter']||'function'!=typeof this['adapter']['resolveCommentThread'])return Promise['resolve']();const _0x2a4d46=this['context']['plugins']['get']('PendingActions'),_0x26de07=_0x2a4d46['add'](Vt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['resolveCommentThread']({'channelId':_0x293711,'threadId':_0x3ed3ca})['then'](({resolvedAt:_0x49fe04,resolvedBy:_0xd31f39})=>{_0x2a4d46['remove'](_0x26de07),_0x39a3e2['resolvedBy']['id']!==_0xd31f39&&(_0x39a3e2['resolvedBy']=_0x430319['getUser'](_0xd31f39)),_0x39a3e2['resolvedAt']=_0x49fe04;})['catch'](_0x2ad3e6=>{throw console['error'](_0x2ad3e6),new _0x237693('commentsrepository-resolve-comment-thread-internal-error',this);});}_reopenCommentThread({threadId:_0x2175e4,channelId:_0x5d4b8a,isFromAdapter:_0x34d960}){if(!this['hasCommentThread'](_0x2175e4))throw new _0x237693('commentsrepository-missing-comment-thread',null,{'threadId':_0x2175e4});const _0x4a7ef1=this['getCommentThread'](_0x2175e4);if(!_0x4a7ef1['isResolved'])throw new _0x237693('commentsrepository-reopen-comment-thread',null,{'threadId':_0x2175e4});if(_0x4a7ef1['resolvedBy']=null,_0x4a7ef1['resolvedAt']=null,_0x34d960||!this['adapter']||'function'!=typeof this['adapter']['reopenCommentThread'])return Promise['resolve']();const _0x12c237=this['context']['plugins']['get']('PendingActions'),_0x4487ac=_0x12c237['add'](Vt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['reopenCommentThread']({'channelId':_0x5d4b8a,'threadId':_0x2175e4})['then'](()=>_0x12c237['remove'](_0x4487ac))['catch'](_0x2b96e3=>{throw console['error'](_0x2b96e3),new _0x237693('commentsrepository-reopen-comment-thread-internal-error',this);});}_removeCommentThread({threadId:_0x2e5c31,isFromAdapter:_0x315fda}){const _0x1ab2e6=this['getCommentThread'](_0x2e5c31);if(!_0x1ab2e6)throw new _0x237693('commentsrepository-remove-missing-comment-thread',this);if(this['_detachCommentThread'](_0x2e5c31),this['_threads']['delete'](_0x2e5c31),!_0x1ab2e6['isSubmitted']||_0x315fda||!this['adapter']||'function'!=typeof this['adapter']['removeCommentThread'])return Promise['resolve']();const _0x48f10f=this['context']['plugins']['get']('PendingActions'),{channelId:_0x2803b5}=_0x1ab2e6,_0x19c750=_0x48f10f['add'](Vt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['removeCommentThread']({'channelId':_0x2803b5,'threadId':_0x2e5c31})['then'](()=>_0x48f10f['remove'](_0x19c750))['catch'](_0x24ea69=>{throw console['error'](_0x24ea69),new _0x237693('commentsrepository-remove-comment-thread-internal-error',this);});}_updateCommentThread({threadId:_0x17b0fe,unlinkedAt:_0x1b0612,context:_0x52ed3e,attributes:_0x4c45f1,isFromAdapter:_0x1124eb}){if('string'!=typeof _0x17b0fe)throw new _0x237693('commentsrepository-invalid-comment-thread-id',null,{'threadId':_0x17b0fe});if(!this['hasCommentThread'](_0x17b0fe))throw new _0x237693('commentsrepository-missing-comment-thread',null,{'threadId':_0x17b0fe});const _0x44d99e=this['getCommentThread'](_0x17b0fe);let _0x222c41=!0x1;if(void 0x0!==_0x52ed3e&&_0x44d99e['context']!==_0x52ed3e&&(_0x44d99e['context']=_0x52ed3e,_0x222c41=!0x0),void 0x0!==_0x1b0612&&_0x44d99e['unlinkedAt']!==_0x1b0612&&(_0x44d99e['unlinkedAt']=_0x1b0612,_0x222c41=!0x0),_0x4c45f1&&!_0x506725(_0x4c45f1,_0x44d99e['attributes'])&&(_0x44d99e['attributes']=_0x4c45f1,_0x222c41=!0x0),!_0x222c41)return Promise['resolve']();if(!_0x44d99e['isSubmitted']||_0x1124eb||!this['adapter']||'function'!=typeof this['adapter']['updateCommentThread'])return Promise['resolve']();const _0x4b7840=this['context']['plugins']['get']('PendingActions'),{channelId:_0x1d1fe0}=_0x44d99e,_0x1d7d96=_0x4b7840['add'](Vt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['updateCommentThread']({'channelId':_0x1d1fe0,'threadId':_0x17b0fe,'context':_0x52ed3e,'unlinkedAt':_0x1b0612,'attributes':_0x4c45f1})['then'](()=>_0x4b7840['remove'](_0x1d7d96))['catch'](_0x308ba5=>{throw console['error'](_0x308ba5),new _0x237693('commentsrepository-update-comment-thread-internal-error',this);});}_detachCommentThread(_0x289d05){const _0x521a31=this['context']['plugins']['get'](me),_0x5f52be=this['getCommentThread'](_0x289d05);if(_0x5f52be['_isAttached']=!0x1,this['_threadToController']['has'](_0x5f52be)){const _0x4c5522=this['_threadToController']['get'](_0x5f52be),_0x1b262e=_0x4c5522['view'],_0x49c175=_0x521a31['getByInnerView'](_0x1b262e);this['_threadToController']['delete'](_0x5f52be),this['_viewToController']['delete'](_0x1b262e),_0x49c175&&_0x521a31['remove'](_0x49c175),_0x4c5522['destroy'](),_0x1b262e['destroy']()['then'](()=>{this['_unbindEditors'](_0x1b262e);});}}_updateActiveAnnotation({threadId:_0x56ddd0,resolvedAt:_0x391b6e,unlinkedAt:_0x52db6a}){const _0x6ebea5=!!_0x391b6e,_0x4fc2d1=this['context']['plugins']['get'](me),_0x12b077=this['getCommentThread'](_0x56ddd0);if(this['_threadToController']['has'](_0x12b077)){const _0x3a7de0=this['_threadToController']['get'](_0x12b077)['view'],_0x8dc7ba=_0x4fc2d1['getByInnerView'](_0x3a7de0);_0x8dc7ba&&(_0x6ebea5&&_0x4fc2d1['_removeActiveAnnotation'](_0x8dc7ba),_0x52db6a?_0x8dc7ba['isVisible']=!0x1:_0x8dc7ba['refreshVisibility']());}}_getExternalAuthor(_0x5182d2){const _0x5b854b=this['context']['plugins']['get'](_0x227f13),_0xf15631=_0xca526b('external:'+_0x5182d2),_0x59ce18=_0x5b854b['getUser'](_0xf15631);return _0x59ce18||_0x5b854b['addUser']({'id':_0xf15631,'name':_0x5182d2});}_createNewComment({threadId:_0x28a926,commentId:_0x29aa54=_0x25cc7d(),content:_0xee37b4,authorId:_0x442ba9,createdAt:_0x2b3980,attributes:_0x3d89ef}){if('string'!=typeof _0x29aa54)throw new _0x237693('commentsrepository-invalid-commentid');if('string'!=typeof _0x442ba9)throw new _0x237693('commentsrepository-invalid-comment-authorid');if('string'!=typeof _0xee37b4||!_0xee37b4['trim']())throw new _0x237693('commentsrepository-invalid-comment-content');const _0x16206f=this['context']['plugins']['get'](_0x227f13)['getUser'](_0x442ba9);if(!_0x16206f)throw new _0x237693('commentsrepository-add-comment-user-not-exists',null,{'authorId':_0x442ba9});let _0x3a3ab9=null,_0x29cb77=_0x2b3980;return _0x3d89ef?.['@external']&&(_0x3a3ab9=this['_getExternalAuthor'](_0x3d89ef['@external']['authorName']),_0x29cb77=new Date(_0x3d89ef['@external']['createdAt'])),new Ae(this,{'threadId':_0x28a926,'id':_0x29aa54,'author':_0x3a3ab9||_0x16206f,'creator':_0x16206f,'content':_0xee37b4,'createdAt':_0x2b3980,'authoredAt':_0x29cb77,'attributes':_0x3d89ef});}_addComment(_0x2cb3fe){let {threadId:_0xef09aa,content:_0x2bced8,attributes:_0x1979fa,isFromAdapter:_0xab29bd}=_0x2cb3fe;const _0xe0650a=this['getCommentThread'](_0x2cb3fe['threadId']);if(!_0xe0650a)throw new _0x237693('commentsrepository-add-comment-to-missing-comment-thread',this);const _0x271811=this['_createNewComment'](_0x2cb3fe),{id:_0x3b5a65}=_0x271811;if(_0xe0650a['_add'](_0x271811),_0xab29bd||!this['adapter']||'function'!=typeof this['adapter']['addComment']||!_0xe0650a['isSubmitted'])return Promise['resolve']();const _0xf8bd00=this['context']['plugins']['get']('PendingActions'),{channelId:_0x3b3311}=_0xe0650a,_0x426600=_0xf8bd00['add'](Vt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return _0x1979fa||(_0x1979fa={}),this['adapter']['addComment']({'channelId':_0x3b3311,'threadId':_0xef09aa,'commentId':_0x3b5a65,'content':_0x2bced8,'attributes':_0x1979fa})['then'](_0x42e211=>{_0xf8bd00['remove'](_0x426600),_0x42e211&&this['_updateComment']({'channelId':_0x3b3311,'threadId':_0xef09aa,'commentId':_0x3b5a65,'createdAt':_0x42e211['createdAt'],'isFromAdapter':!0x0});})['catch'](_0x5edc63=>{throw console['error'](_0x5edc63),new _0x237693('commentsrepository-add-comment-internal-error',this);});}_updateComment({threadId:_0x6c43de,commentId:_0x27f7b0,content:_0x4a852d,createdAt:_0x258ec1,attributes:_0x2973b4,isFromAdapter:_0x4a9cf0}){if(void 0x0!==_0x4a852d&&('string'!=typeof _0x4a852d||!_0x4a852d['trim']()['length']))throw new _0x237693('commentsrepository-update-comment-invalid-content');const _0x4fb297=this['getCommentThread'](_0x6c43de),_0xf1ae37=_0x4fb297['getComment'](_0x27f7b0);if(!_0xf1ae37)throw new _0x237693('commentsrepository-update-missing-comment',this);let _0x1c0291=!0x1;if(_0x4a852d&&_0x4a852d!==_0xf1ae37['content']&&(_0xf1ae37['isEditable']||_0x4a9cf0)&&(_0xf1ae37['content']=_0x4a852d,_0x1c0291=!0x0),_0x258ec1&&_0x258ec1!==_0xf1ae37['createdAt']&&(_0xf1ae37['createdAt']=_0x258ec1,_0xf1ae37['isExternal']||(_0xf1ae37['authoredAt']=_0x258ec1),_0x1c0291=!0x0),_0x2973b4&&!_0x506725(_0x2973b4,_0xf1ae37['attributes'])&&(_0xf1ae37['attributes']=_0x2973b4,_0x1c0291=!0x0),!_0x1c0291)return Promise['resolve']();if(_0x4fb297['fire']('commentUpdated'),_0x4a9cf0||!this['adapter']||'function'!=typeof this['adapter']['updateComment'])return Promise['resolve']();const _0x57157c=this['context']['plugins']['get']('PendingActions'),{channelId:_0xd9feb4}=this['getCommentThread'](_0xf1ae37['threadId']),_0x49cffe=_0x57157c['add'](Vt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['updateComment']({'channelId':_0xd9feb4,'threadId':_0x6c43de,'commentId':_0x27f7b0,'content':_0x4a852d,'attributes':_0x2973b4})['then'](()=>_0x57157c['remove'](_0x49cffe))['catch'](_0x383d9f=>{throw console['error'](_0x383d9f),new _0x237693('commentsrepository-update-comment-internal-error',this);});}_removeComment({threadId:_0x441fce,commentId:_0x3b34d1,isFromAdapter:_0x25ab50}){const _0x92611b=this['getCommentThread'](_0x441fce),_0x3ef462=_0x92611b['getComment'](_0x3b34d1);if(!_0x3ef462)throw new _0x237693('commentsrepository-remove-missing-comment',this);if(_0x92611b['_remove'](_0x3ef462),_0x25ab50||!this['adapter']||'function'!=typeof this['adapter']['removeComment'])return Promise['resolve']();const _0x4f6732=this['context']['plugins']['get']('PendingActions'),{channelId:_0x1f50b2}=_0x92611b,_0x2a80e3=_0x4f6732['add'](Vt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['removeComment']({'channelId':_0x1f50b2,'threadId':_0x441fce,'commentId':_0x3b34d1})['then'](()=>_0x4f6732['remove'](_0x2a80e3))['catch'](_0x154c2f=>{throw console['error'](_0x154c2f),new _0x237693('commentsrepository-remove-comment-internal-error',this);});}},ge=class extends pe{['channelId'];['id'];_isAttached;_isSubmitted;comments;_repository;constructor(_0x540486,_0x386d7a){super();const _0x8ab9ca=_0x386d7a['isResolvable'];this['channelId']=_0x386d7a['channelId'],this['id']=_0x386d7a['id'],this['comments']=new _0x28de1d(),this['_repository']=_0x540486,this['_isAttached']=!0x1,this['_isSubmitted']=_0x386d7a['isSubmitted'],this['set']('_hasTargetInContent',!0x0),this['bind']('isReadOnly')['to'](_0x540486,'_permissions',_0x540486,'_readOnlyChannels',()=>_0x540486['isReadOnly'](this['channelId'])),this['bind']('isRemovable')['to'](_0x540486,'_permissions',()=>_0x540486['getPermissions'](this['channelId'])['admin']),this['bind']('canComment')['to'](_0x540486,'_permissions',()=>{const _0x2fb567=_0x540486['getPermissions'](this['channelId']);return _0x2fb567['write']||_0x2fb567['admin'];}),this['bind']('isResolvable')['to'](_0x540486,'_permissions',()=>_0x8ab9ca&&_0x540486['getPermissions'](this['channelId'])['resolve']),this['set']('context',_0x386d7a['context']),this['bind']('archivedAt')['to'](this,'resolvedAt',this,'unlinkedAt',(_0x35e775,_0x354a33)=>_0x35e775?_0x354a33?_0x35e775<_0x354a33?_0x35e775:_0x354a33:_0x35e775:_0x354a33),this['set']('unlinkedAt',_0x386d7a['unlinkedAt']||null),this['set']('resolvedAt',_0x386d7a['resolvedAt']||null),this['set']('resolvedBy',_0x386d7a['resolvedBy']||null),this['bind']('isResolved')['to'](this,'resolvedAt',_0x5e5d74=>!!_0x5e5d74),this['set']('attributes',_0x386d7a['attributes']||{});}get weight(){return Array['from'](this['comments'])['reduce']((_0x465fb0,_0x348892)=>_0x465fb0+_0x348892['weight'],0x0);}get length(){return this['comments']['length'];}get isAttached(){return this['_isAttached'];}get isSubmitted(){return this['_isSubmitted'];}submit(){const {channelId:_0x5f22b5,id:_0x2d6fb8}=this;this['_repository']['fire'](ve('submitCommentThread',_0x5f22b5),{'channelId':_0x5f22b5,'threadId':_0x2d6fb8});}setUnlinkedAt(_0x21031a){this['_update']({'unlinkedAt':_0x21031a});}['resolve']({resolvedAt:_0x389a34=new Date(),resolvedBy:_0x5d46a7='',isFromAdapter:_0x5f2070=!0x1}={}){const _0x420461=this['_repository']['context']['plugins']['get'](_0x227f13)['me'],{channelId:_0x3ae79a,id:_0xb9294e}=this;this['_repository']['fire'](ve('resolveCommentThread',_0x3ae79a),{'channelId':_0x3ae79a,'threadId':_0xb9294e,'resolvedAt':_0x389a34,'resolvedBy':_0x5d46a7||_0x420461['id'],'isFromAdapter':_0x5f2070});}['reopen']({isFromAdapter:_0x5cb32a=!0x1}={}){const {channelId:_0x585ca9,id:_0x1dbe05}=this;this['_repository']['fire'](ve('reopenCommentThread',_0x585ca9),{'channelId':_0x585ca9,'threadId':_0x1dbe05,'isFromAdapter':_0x5cb32a});}setContext(_0x4454c1){this['context']||this['_update']({'context':_0x4454c1});}setAttribute(_0x1ac7b7,_0x579e11){const _0xeecee9=_0x2adcdc(this['attributes']);_0x2c11df(_0xeecee9,_0x1ac7b7,_0x579e11),this['_update']({'attributes':_0xeecee9});}removeAttribute(_0x40cb4a){const _0x3c7454=_0x2adcdc(this['attributes']);_0xe0aa2b(_0x3c7454,_0x40cb4a),this['_update']({'attributes':_0x3c7454});}['remove']({isFromAdapter:_0x1096f2=!0x1}={}){const {channelId:_0xb41125,id:_0x7277be}=this;this['_repository']['fire'](ve('removeCommentThread',_0xb41125),{'channelId':_0xb41125,'threadId':_0x7277be,'isFromAdapter':_0x1096f2});}attachTo(_0x45f3ee){return this['_repository']['_attachCommentThread']({'threadId':this['id'],'target':_0x45f3ee});}addComment(_0xd9064a){const {channelId:_0x2a8e7a,id:_0x4737f2}=this;this['_repository']['fire'](ve('addComment',_0x2a8e7a,_0x4737f2),Object['assign']({'channelId':_0x2a8e7a,'threadId':_0x4737f2},_0xd9064a));}getComment(_0x48a014){if('string'!=typeof _0x48a014)throw new _0x237693('commentsrepository-get-comment-invalid-id',null,{'commentId':_0x48a014});return this['comments']['get'](_0x48a014);}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'](_0x3f402f=>_0x3f402f['toJSON']()),'attributes':this['attributes']};}['_add'](_0x5a9f5e){return this['listenTo'](_0x5a9f5e,'change:authoredAt',()=>{const _0x559d3c=this['_findOptimalIndex'](_0x5a9f5e),_0x47e82d=this['comments'];_0x559d3c-0x1!=_0x47e82d['getIndex'](_0x5a9f5e)&&_0x559d3c+0x1!=_0x47e82d['getIndex'](_0x5a9f5e)&&(this['_remove'](_0x5a9f5e),this['_add'](_0x5a9f5e));}),this['comments']['add'](_0x5a9f5e,this['_findOptimalIndex'](_0x5a9f5e));}_update(_0x17a7da){const {channelId:_0x11cb7b,id:_0x318641}=this;this['_repository']['fire'](ve('updateCommentThread',_0x11cb7b),{..._0x17a7da,'channelId':_0x11cb7b,'threadId':_0x318641});}['_remove'](_0x37759f){return this['stopListening'](_0x37759f),_0x37759f['destroy'](),this['comments']['remove'](_0x37759f);}_findOptimalIndex(_0x49c895){const _0x1098e3=this['comments']['find'](_0xd417b=>new Date(_0xd417b['authoredAt'])['getTime']()>new Date(_0x49c895['authoredAt'])['getTime']());return _0x1098e3?this['comments']['getIndex'](_0x1098e3):this['length'];}},Ae=class extends _e{['id'];threadId;author;creator;createdAt;_repository;constructor(_0x51507f,_0x2d77af){super();const _0x518db0=_0x51507f['context']['plugins']['get'](_0x227f13)['me'],_0x1557bf=_0x51507f['getCommentThread'](_0x2d77af['threadId']),_0x3aa017=0x0===_0x1557bf['comments']['length'],_0x43f222=_0x518db0===_0x2d77af['author'];this['id']=_0x2d77af['id'],this['threadId']=_0x2d77af['threadId'],this['author']=_0x2d77af['author'],this['creator']=_0x2d77af['creator'],this['set']('content',_0x2d77af['content']),this['createdAt']=_0x2d77af['createdAt']||new Date(),this['set']('authoredAt',_0x2d77af['authoredAt']||new Date()),this['bind']('resolvedAt')['to'](_0x1557bf,'resolvedAt'),this['set']('attributes',_0x2d77af['attributes']||{}),this['bind']('isEditable')['to'](_0x51507f,'_permissions',()=>{const _0x27f444=_0x51507f['getPermissions'](_0x1557bf['channelId'])['write'],_0xcfc2c1=_0x51507f['getPermissions'](_0x1557bf['channelId'])['modifyAll'];return _0x43f222&&_0x27f444||!_0x43f222&&_0xcfc2c1;}),this['bind']('isRemovable')['to'](_0x1557bf,'isRemovable',_0x51507f,'_permissions',_0x3096ff=>{const _0x19be26=_0x51507f['getPermissions'](_0x1557bf['channelId'])['write'],_0x1498d1=_0x51507f['getPermissions'](_0x1557bf['channelId'])['modifyAll'];return _0x43f222&&_0x19be26||_0x3096ff&&_0x3aa017||!_0x43f222&&_0x1498d1&&!_0x3aa017;}),this['bind']('isReadOnly')['to'](_0x1557bf,'isReadOnly'),this['_repository']=_0x51507f;}get isExternal(){return Boolean(this['attributes']&&this['attributes']['@external']);}get weight(){return Math['max'](function(_0x2b93c8){const _0x678055=document['createElement']('div');return _0x678055['innerHTML']=_0x2af1d3(_0x2b93c8),_0x678055['textContent']['length'];}(this['content']),0xc8);}update(_0x2ccc9f){const {threadId:_0x626a61,id:_0x609d1f}=this;if(!this['_repository']['hasCommentThread'](_0x626a61))throw new _0x237693('commentsrepository-update-comment-missing-comment-thread',this);const {channelId:_0x1b9853}=this['_repository']['getCommentThread'](_0x626a61);this['_repository']['fire'](ve('updateComment',_0x1b9853,_0x626a61),{'channelId':_0x1b9853,'threadId':_0x626a61,'commentId':_0x609d1f,..._0x2ccc9f});}setAttribute(_0x16ed6f,_0x9163d7){const _0x34ad12=_0x2adcdc(this['attributes']);_0x2c11df(_0x34ad12,_0x16ed6f,_0x9163d7),this['update']({'attributes':_0x34ad12});}removeAttribute(_0x1804a6){const _0x470352=_0x2adcdc(this['attributes']);_0xe0aa2b(_0x470352,_0x1804a6),this['update']({'attributes':_0x470352});}['remove'](_0x37e81b={}){if(!_0x37e81b['isFromAdapter']&&!this['isRemovable'])return;const {threadId:_0x24a4d9,id:_0x3580c1}=this;if(!this['_repository']['hasCommentThread'](_0x24a4d9))throw new _0x237693('commentsrepository-remove-comment-missing-comment-thread',this);const {channelId:_0x2f41a3}=this['_repository']['getCommentThread'](_0x24a4d9);this['_repository']['fire'](ve('removeComment',_0x2f41a3,_0x24a4d9),{'channelId':_0x2f41a3,'threadId':_0x24a4d9,'commentId':_0x3580c1,..._0x37e81b});}toJSON(){return{'commentId':this['id'],'content':this['content'],'createdAt':this['createdAt'],'authorId':this['creator']['id'],'attributes':this['attributes']};}destroy(){this['stopListening']();}};function ve(_0x4d1f53,..._0x13732a){for(const _0x1850a3 of _0x13732a)void 0x0!==_0x1850a3&&(_0x4d1f53+=':'+String(_0x1850a3));return _0x4d1f53;}var Te=class extends _0x3b611a{constructor(_0x10e04d){super(_0x10e04d),this['set']('hasContent',!0x1);}['refresh'](){const _0x178004=this['editor']['model']['document']['selection'];this['isEnabled']=!0x0,this['hasContent']=!0x1;for(const _0x3dd8b9 of _0x178004['getRanges']())if(this['_hasContent'](_0x3dd8b9))return void(this['hasContent']=!0x0);}execute({threadId:_0x304533=_0x25cc7d(),ranges:_0xdd588,comment:_0x2225d1}={}){const _0x3ea69a=this['editor']['model'],_0x5c3ac8=_0xdd588??Array['from'](_0x3ea69a['document']['selection']['getRanges']()),_0x1b9fac=[];for(const _0x2f9597 of _0x5c3ac8)this['_hasContent'](_0x2f9597)&&_0x1b9fac['push'](this['_trimToContent'](_0x2f9597));if(!_0x1b9fac['length'])throw new _0x237693('addcommentthreadcommand-incorrect-ranges',null);_0x2225d1&&this['_createCommentThread'](_0x304533,_0x2225d1),this['_createMarkersFromRanges'](_0x304533,_0x1b9fac,!!_0x2225d1);}_createMarkersFromRanges(_0x436ec4,_0x2fb7fb,_0x250d66){this['editor']['model']['change'](_0x15caf1=>{for(const _0xb88c3 of _0x2fb7fb){const _0x34152a='comment:'+_0x436ec4+':'+_0x25cc7d()['substr'](0x1,0x5);_0x15caf1['addMarker'](_0x34152a,{'range':_0xb88c3,'usingOperation':_0x250d66,'affectsData':_0x250d66});}});}_createCommentThread(_0x326f74,_0x11440d){const _0x20c1d5=this['editor']['plugins']['get']('CommentsRepository'),_0x4874f5=this['editor']['config']['get']('collaboration.channelId'),_0x1ef5d7=this['editor']['plugins']['get']('Users')['me'];if(!_0x1ef5d7)throw new _0x237693('addcommentthreadcommand-user-not-found',null);_0x20c1d5['addCommentThread']({'threadId':_0x326f74,'channelId':_0x4874f5,'comments':[{'authorId':_0x1ef5d7['id'],'content':_0x11440d,'createdAt':new Date(),'attributes':{}}]});}_hasContent(_0x5eac9c){for(const _0x81225b of _0x5eac9c['getItems']())if(this['_itemIsContent'](_0x81225b))return!0x0;return!0x1;}_itemIsContent(_0x3b010e){return _0x3b010e['is']('$textProxy')||this['editor']['model']['schema']['isObject'](_0x3b010e)&&!_0x3b010e['is']('element','tableCell');}_trimToContent(_0x999673){const _0x32ea4f=_0x5c2fe2=>!this['_itemIsContent'](_0x5c2fe2['item']),_0x418b92=_0x999673['start']['getLastMatchingPosition'](_0x32ea4f),_0x3bcb8d=_0x999673['end']['getLastMatchingPosition'](_0x32ea4f,{'direction':'backward'});return this['editor']['model']['createRange'](_0x418b92,_0x3bcb8d);}},ye=class extends _0x2422cd{_dataCollectors;_editorAnnotations;static get requires(){return[me];}static get['pluginName'](){return'EditorAnnotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2d31b2){super(_0x2d31b2),this['_dataCollectors']=new Set(),this['_editorAnnotations']=new Set();}init(){const _0xcca2c6=this['editor'],_0xd1d977=_0xcca2c6['model']['document']['selection'],_0x5ecfbf=_0x5d9b0a(()=>this['refreshSelectedViews'](),0xa);_0xd1d977['on']('change:range',(_0x4a8333,_0x246846)=>{_0x246846['directChange']&&(_0x5ecfbf['cancel'](),this['refreshSelectedViews']());}),this['listenTo'](_0xcca2c6['editing']['view']['document'],'change:isFocused',(_0x352615,_0x1705ae,_0x406739)=>{_0x406739&&_0x5ecfbf();}),this['listenTo'](_0xcca2c6['ui']['focusTracker'],'change:isFocused',(_0x428b19,_0x87544d,_0xa2e560)=>{_0xa2e560||this['fire']('blur',{'isAnnotationTracked':_0x3d8248=>this['_editorAnnotationsData']['has'](_0x3d8248['innerView'])});}),this['listenTo'](this['editor']['ui'],'update',()=>this['fire']('uiUpdate'));}registerAnnotation(_0x5874ea){if(this['_editorAnnotations']['has'](_0x5874ea['view']))return;this['_editorAnnotations']['add'](_0x5874ea['view']),this['editor']['ui']['focusTracker']['add'](_0x5874ea['view']['element']);const _0x367ba=this['editor']['plugins']['get'](me);this['listenTo'](_0x367ba['collection'],'remove',(_0x539e41,_0xcae84b)=>{this['editor']['ui']['focusTracker']['remove'](_0xcae84b['view']['element']),this['_editorAnnotations']['delete'](_0xcae84b['view']);});}hasDomSelection(){return this['editor']['editing']['view']['hasDomSelection'];}addSourceCollector(_0x188c87){if('function'!=typeof _0x188c87)throw new _0x237693('editorannotations-invalid-source-callback');this['_dataCollectors']['add'](_0x188c87);}refreshSelectedViews(){this['fire']('refresh');}getOrderedSelectedAnnotations({activeAnnotation:_0x4696fe,annotations:_0x294418}){const _0x477235=[],_0x19e6a4=this['editor']['model']['document']['selection'],_0x511cb0=Array['from'](_0x19e6a4['getRanges']());for(const [_0x2a7cfe,_0x18c598]of this['_editorAnnotationsData']){const _0x3c54be=_0x58f8fe(_0x18c598),_0x19db07=_0x294418['getByInnerView'](_0x2a7cfe);_0x3c54be&&_0x19db07&&_0x477235['push']({'annotation':_0x19db07,'range':_0x3c54be});}function _0x58f8fe(_0x5c125c){for(const _0xd22fe0 of _0x5c125c)for(const _0xcbdb5d of _0x511cb0)if(_0xd22fe0['containsRange'](_0xcbdb5d,!_0x19e6a4['isCollapsed']))return _0xd22fe0;return null;}const _0x273671=new Map(Array['from'](_0x294418,(_0x4f252d,_0x2239d3)=>[_0x4f252d,_0x2239d3]));return _0x477235['sort']((_0x33faf1,_0x4b1551)=>{const _0xa67ede=_0x33faf1['range'],_0x3cfd4f=_0x4b1551['range'];if(!_0xa67ede['start']['isTouching'](_0x3cfd4f['start'])||!_0xa67ede['end']['isTouching'](_0x3cfd4f['end'])){if(_0xa67ede['containsRange'](_0x3cfd4f,!0x0))return 0x1;if(_0x3cfd4f['containsRange'](_0xa67ede,!0x0))return-0x1;}return _0x33faf1['annotation']==_0x4696fe?-0x1:_0x4b1551['annotation']==_0x4696fe?0x1:(_0x273671['get'](_0x33faf1['annotation'])??0x0)-(_0x273671['get'](_0x4b1551['annotation'])??0x0);})['map'](_0x5de833=>_0x5de833['annotation']);}get _editorAnnotationsData(){const _0x2f50fa=new Map();for(const _0x1e0f99 of Array['from'](this['_dataCollectors']))for(const [_0x4fbb28,_0x351a8f]of _0x1e0f99())_0x2f50fa['set'](_0x4fbb28,_0x351a8f);return _0x2f50fa;}},Ce=class extends _0x2422cd{afterInit(){const _0xe7ef50=this['editor'];_0xe7ef50['plugins']['has']('RestrictedEditingModeEditing')&&_0xe7ef50['plugins']['get']('RestrictedEditingModeEditing')['enableCommand']('addCommentThread');}},Ie=class extends _0x2422cd{constructor(_0x5c5cbc){super(_0x5c5cbc),this['editor']['config']['define']('importWord.formatting.comments','basic');}afterInit(){const _0x49bc4a=this['editor'],_0x21d7a5=_0x49bc4a['commands']['get']('importWord'),_0x43e84f=_0x49bc4a['plugins']['get'](_0x227f13);_0x21d7a5&&(_0x21d7a5['on']('execute',(_0xcafc1b,[,_0x43c9de])=>{_0x43c9de['collaboration_features']={'comments':!0x0,'user_id':_0x43e84f['me']['id']};},{'priority':_0x7f7f49['high']+0xa}),this['listenTo'](_0x21d7a5,'dataInsert',this['_handleImportedData']));}_handleImportedData(_0x3789a1,_0x30b95c){const {comment_threads:_0x2e0d65}=_0x30b95c;_0x2e0d65&&_0x2e0d65['forEach'](({thread_id:_0xb573d2,comments:_0x2fd78b,is_resolved:_0x13c727})=>{const _0x29f8af=new Date(),_0x3e9c50=_0x2fd78b['map'](({author:_0x40bbdf,content:_0x13b5e5,created_at:_0x3de8fe})=>({'content':_0x13b5e5,'authorId':this['editor']['plugins']['get'](_0x227f13)['me']['id'],'createdAt':_0x29f8af,'attributes':{'@external':{'authorName':_0x40bbdf,'createdAt':_0x3de8fe?new Date(_0x3de8fe):new Date(),'source':'importWord'}}})),_0x261ee0=this['editor']['config']['get']('collaboration.channelId');this['editor']['plugins']['get'](we)['addCommentThread']({'channelId':_0x261ee0,'threadId':_0xb573d2,'comments':_0x3e9c50,'resolvedAt':_0x13c727?_0x29f8af:null});});}},be=class extends _0x2422cd{constructor(_0x484195){super(_0x484195),this['editor']['config']['define']('comments.copyMarkers','default');}static get requires(){return[Et,kt];}afterInit(){const _0x4cadab=this['editor']['plugins']['get']('ClipboardPipeline');this['_registerMarkerInClipboardPipeline'](),this['listenTo'](_0x4cadab,'contentInsertion',(_0x340836,_0x32467d)=>this['_removeMarkersWithoutThreads'](_0x32467d['content']['markers']),{'priority':'highest'});}_removeMarkersWithoutThreads(_0x318e68){if(!this['editor']['plugins']['has']('CommentsRepository'))return _0x318e68;const _0x55e757=this['editor']['plugins']['get']('CommentsRepository');for(const _0x36fef8 of _0x318e68['keys']()){const [_0xeb76c,_0x45cd7d]=_0x36fef8['split'](':');'comment'!=_0xeb76c||_0x55e757['hasCommentThread'](_0x45cd7d)||_0x318e68['delete'](_0x36fef8);}return _0x318e68;}_registerMarkerInClipboardPipeline(){const _0x355531=this['editor']['plugins']['get']('ClipboardMarkersUtils'),_0x350b85=this['_mapCommentsCopyConfigToRegisterConfiguration'](this['editor']['config']['get']('comments.copyMarkers'));_0x350b85&&_0x355531['_registerMarkerToCopy']('comment',_0x350b85);}_mapCommentsCopyConfigToRegisterConfiguration(_0x1a71e0){switch(_0x1a71e0){case'always':return{'allowedActions':'all','copyPartiallySelected':!0x1,'duplicateOnPaste':!0x0};case'default':return{'allowedActions':['cut','dragstart'],'copyPartiallySelected':!0x1,'duplicateOnPaste':!0x1};default:return null;}}};function Ee(_0x2edce3){const _0xd30bde=_0x2edce3['split'](':');return{'group':_0xd30bde[0x0],'id':_0xd30bde[0x1],'part':_0xd30bde[0x2]};}var ke=class extends _0x2422cd{init(){this['overrideMarkerConverters'](),this['overrideHorizontalRuleConverter'](),this['overrideImageInlineConverter'](),this['overrideMediaEmbedConverter']();}overrideMarkerConverters(){this['editor']['conversion']['for']('dataDowncast')['markerToHighlight']({'model':'comment','view':(_0x5ca22f,_0xc8b0b9)=>{if(!_0xc8b0b9['options']['showCommentHighlights'])return null;if(_0xc8b0b9['options']['ignoreResolvedComments']){const {id:_0x204e1d}=Ee(_0x5ca22f['markerName']);if(this['editor']['plugins']['get'](we)['getCommentThread'](_0x204e1d)?.['isResolved']&&_0x5ca22f['item'])return _0xc8b0b9['consumable']['consume'](_0x5ca22f['item'],'addMarker:'+_0x5ca22f['markerName']),_0xc8b0b9['consumable']['consume'](_0x5ca22f['item'],'removeMarker:'+_0x5ca22f['markerName']),null;}return{'classes':['ck-comment-marker']};}}),this['editor']['conversion']['for']('dataDowncast')['add'](_0x46531f=>{_0x46531f['on']('addMarker:comment',(_0x53d90d,_0x4090f3,_0x5d1489)=>{if(!_0x5d1489['options']['showCommentHighlights'])return;const _0x31ee72=_0x4090f3['item'];if(!_0x31ee72)return;const _0x35bd1e=_0x5d1489['mapper']['toViewElement'](_0x31ee72);this['editor']['model']['schema']['isObject'](_0x31ee72)&&_0x35bd1e&&!_0x35bd1e['getCustomProperty']('widget')&&_0x35bd1e['is']('containerElement')&&Pt(_0x35bd1e,_0x5d1489['writer']);},{'priority':'high'});});}overrideHorizontalRuleConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToStructure']({'model':'horizontalLine','view':(_0xf52798,{writer:_0x35c24a,options:_0x1197e9})=>{if(!_0x1197e9['showCommentHighlights'])return null;const _0x2b1c16=_0x35c24a['createContainerElement']('div'),_0x4dbdbf=_0x35c24a['createEmptyElement']('hr');return _0x35c24a['addClass']('ck-horizontal-line',_0x2b1c16),_0x35c24a['insert'](_0x35c24a['createPositionAt'](_0x2b1c16,0x0),_0x4dbdbf),_0x2b1c16;},'converterPriority':'high'});}overrideImageInlineConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToStructure']({'model':'imageInline','view':(_0x9bc9be,{writer:_0x57afd5,options:_0x12b928})=>{if(!_0x12b928['showCommentHighlights'])return null;const _0x5573ef=_0x57afd5['createContainerElement']('span'),_0x2a5e0b=_0x57afd5['createEmptyElement']('img');return _0x57afd5['addClass']('image-inline',_0x5573ef),_0x57afd5['insert'](_0x57afd5['createPositionAt'](_0x5573ef,0x0),_0x2a5e0b),_0x5573ef;},'converterPriority':'high'});}overrideMediaEmbedConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToElement']({'model':'media','view':(_0x4b9f8f,{writer:_0x5ac26e,options:_0x399070})=>{if(_0x399070['showCommentHighlights'])return _0x5ac26e['createEmptyElement']('div');},'converterPriority':'high'}),this['editor']['data']['downcastDispatcher']['on']('attribute:url:media',(_0x8ff91,_0x389368,_0x152612)=>{_0x152612['options']['showCommentHighlights']&&_0x8ff91['stop']();},{'priority':'high'});}},Ne=class extends _0x2422cd{static get requires(){return[we,ye,_0x227f13,Ce,Ie,be,ke];}static get['pluginName'](){return'CommentsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x31ac45){super(_0x31ac45),this['set']('isThreadsLoadingPaused',!0x0),_0x31ac45['data']['once']('ready',()=>this['isThreadsLoadingPaused']=!0x1),this['set']('activeMarker',null),this['on']('change:activeMarker',(_0x5455fa,_0x3edf18,_0x5a733e,_0x5f33b3)=>{const _0x18cc88=_0x31ac45['plugins']['get'](we),_0x135269=_0x5a733e?Ee(_0x5a733e)['id']:null;_0x31ac45['model']['change'](()=>{if(_0x135269){const _0x59f793=this['getAllMarkersForId'](_0x135269);for(const _0x46da2e of _0x59f793)_0x31ac45['editing']['reconvertMarker'](_0x46da2e);}if(_0x5f33b3){const {id:_0x21552b}=Ee(_0x5f33b3),_0x4f196b=_0x18cc88['getCommentThread'](_0x21552b);if(_0x4f196b&&_0x4f196b['unlinkedAt'])return;if(_0x4f196b&&!_0x4f196b['isAttached'])return;const _0x1a97a6=this['getAllMarkersForId'](_0x21552b);for(const _0x4102ba of _0x1a97a6)_0x31ac45['editing']['reconvertMarker'](_0x4102ba);}}),_0x135269&&this['scrollToThreadMarker'](_0x135269);}),this['_initAriaMarkerChangeAnnouncements']();}init(){const _0x2db81c=this['editor'],_0x2649f3=_0x2db81c['plugins']['get'](we),_0x474234=_0x2db81c['config']['get']('collaboration.channelId'),_0x13336e=_0x2649f3['getCommentThreads']()['filter'](_0xa3540a=>_0xa3540a['channelId']!==_0x474234);_0x2db81c['commands']['add']('addCommentThread',new Te(_0x2db81c)),this['listenTo'](_0x2db81c,'change:isReadOnly',(_0x3e77e2,_0x4a7739,_0x2184ef)=>{_0x2649f3['switchReadOnly'](_0x2184ef,_0x2db81c['config']['get']('collaboration.channelId'));}),this['listenTo'](_0x2649f3,Oe('addCommentThread',_0x474234),(_0x13ee74,{threadId:_0x5e9272})=>{this['editor']['plugins']['get'](we)['getCommentThread'](_0x5e9272)?.['unlinkedAt']&&this['_attachArchivedThread'](_0x5e9272);}),this['listenTo'](_0x2649f3,Oe('removeCommentThread',_0x474234),(_0x4a169d,{threadId:_0x267f7b})=>{_0x2db81c['model']['enqueueChange']({'isUndoable':!0x1},_0x23d344=>{const _0x2d5f81=this['getAllMarkersForId'](_0x267f7b);for(const _0x4f8b34 of _0x2d5f81)_0x23d344['removeMarker'](_0x4f8b34);});}),this['listenTo'](_0x2649f3,Oe('resolveCommentThread',_0x474234),(_0x26947a,{threadId:_0xca278a})=>{this['_reconvertMarkers'](_0xca278a);const _0x201c6d=this['editor']['plugins']['get'](me);(this['editor']['editing']['view']['hasDomSelection']||_0x201c6d['collection']['isFocused'])&&(this['editor']['plugins']['get'](we)['getCommentThread'](_0xca278a)['unlinkedAt']||this['editor']['editing']['view']['focus']());},{'priority':'low'}),this['listenTo'](_0x2649f3,Oe('reopenCommentThread',_0x474234),(_0x56de07,{threadId:_0x53f47b})=>{this['_reconvertMarkers'](_0x53f47b);},{'priority':'low'}),this['listenTo'](_0x2649f3,Oe('addComment',_0x474234),(_0x1376de,{threadId:_0xef7c4c,isFromAdapter:_0x32b180})=>{const _0x1229c6=this['getAllMarkersForId'](_0xef7c4c);!_0x32b180&&0x0!=_0x1229c6['length']&&_0x2649f3['hasCommentThread'](_0xef7c4c)&&0x1===_0x2649f3['getCommentThread'](_0xef7c4c)['length']&&_0x2db81c['model']['enqueueChange']({'isUndoable':!0x1},_0x2f86a8=>{for(const _0x74954a of _0x1229c6)_0x2f86a8['updateMarker'](_0x74954a,{'usingOperation':!0x0,'affectsData':!0x0});});},{'priority':'low'}),this['_initializeMarkerConverters'](),this['_handleMarkerAddAndRemove'](),this['_handleInitialThreads'](_0x13336e);}afterInit(){!async function(_0x12d1f3){const _0x1bc6c0='uizTdvyBIa4RKsnOYmEXGMfjehwJQqbPSCk7DtZgF58Lxl29Ho6cAUW1pV3Nr0',_0x36692c=0x799f8,_0x4bc972={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x52ee53(_0x2aebaf){const _0x3dcf34=new window['Promise'](_0x372b1b=>{_0x2aebaf['once']('ready',_0x372b1b);}),_0x3092ad=window['Date']['now'](),_0x5677f2=_0x2aebaf['config']['get']('licenseKey');async function _0x4462b0(){let _0x290cb4,_0x382712=null,_0x177f1a=null;try{return'GPL'==_0x5677f2?'NotAllowed':(_0x290cb4=_0x512390(),_0x290cb4?(_0x290cb4['usageEndpoint']&&(_0x177f1a=_0x3c2c83(_0x290cb4['usageEndpoint'],_0x290cb4['jti'])),await _0x51d6e7()?_0x33ccf7()?_0x4d648a()?'Expired':_0x2fdea0()?('evaluation'==_0x290cb4['licenseType']&&(_0x382712=_0x3f700e('EvaluationLimit')),await _0x10d13b()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x4d648a(){const _0xa6a770=['evaluation','trial']['includes'](_0x290cb4['licenseType'])?_0x3092ad/0x3e8:0xe10*_0x36692c;return _0x290cb4['exp']<_0xa6a770;}function _0x33ccf7(){const _0x4844d9=_0x290cb4['features'];if(!_0x4844d9)return!0x1;if(_0x4844d9['includes']('*'))return!0x0;if(_0x4844d9['includes']('CMT'))return!0x0;if(_0x4844d9['includes']('TRILIUM')&&_0x102ce6())return!0x0;if(_0x4844d9['includes']('RCMT')){if(_0x24b047())return!0x0;if(_0x39c314()||_0xe4266f())return!0x0;}return!0x1;}function _0x2fdea0(){const _0x502385=_0x290cb4['licensedHosts'];if(!_0x502385||0x0==_0x502385['length'])return!0x0;const {hostname:_0x2c210e}=new URL(window['location']['href']);if(_0x502385['includes'](_0x2c210e))return!0x0;const _0x312b88=_0x2c210e['split']('.');return _0x502385['filter'](_0x3b2037=>_0x3b2037['includes']('*'))['map'](_0x77ce33=>_0x77ce33['split']('.'))['filter'](_0x3d5aa3=>_0x3d5aa3['length']<=_0x312b88['length'])['map'](_0x3f6d1e=>Array(_0x312b88['length']-_0x3f6d1e['length'])['fill']('*'===_0x3f6d1e[0x0]?'*':'')['concat'](_0x3f6d1e))['some'](_0x3e59ba=>_0x312b88['every']((_0x1da46e,_0x3d30a1)=>_0x3e59ba[_0x3d30a1]===_0x1da46e||'*'===_0x3e59ba[_0x3d30a1]));}function _0x10d13b(){return _0x382712&&_0x177f1a?new window['Promise']((_0x571510,_0x36377f)=>{_0x382712['then'](_0x571510,_0x36377f),_0x177f1a['then'](_0x50a25b=>{'Valid'!=_0x50a25b&&_0x571510(_0x50a25b);},_0x36377f);}):_0x382712||_0x177f1a||'Valid';}}function _0x3c2c83(_0x163f99,_0x19e91b){return new window['Promise'](_0x2f89cb=>{if(_0x5fbf6b())return _0x2f89cb('Valid');_0x14f42d(),_0x2aebaf['decorate']('_sendUsageRequest');let _0xfac85f=!0x1;const _0x8116c4=_0x25cc7d();function _0x175fb5(_0x4ee356){return!!_0x4ee356&&('object'==typeof _0x4ee356||'function'==typeof _0x4ee356)&&'function'==typeof _0x4ee356['then']&&'function'==typeof _0x4ee356['catch'];}function _0x1b81e4(_0x28ec6b){_0x2c0e80(_0x28ec6b)['then'](_0x432e12=>_0x432e12&&'ok'==_0x432e12['status']?_0x4d6494(_0x5c20dc(_0x8116c4+_0x19e91b))!=_0x432e12['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x2e6c60=>(_0x191dfa(),_0x2e6c60),()=>{const _0xb2ad7=_0x176e1f();return null==_0xb2ad7?(_0x191dfa(),'Valid'):_0x3092ad-_0xb2ad7>0x240c8400?'UsageLimit':'Valid';})['then'](_0x2f89cb)['catch'](()=>{_0x2f89cb('UsageLimit');});const _0x2e2a5f=0x36ee80;function _0x191dfa(){const _0x396941='llct-'+_0x4d6494(_0x5c20dc(_0x163f99)),_0x4e1b07=_0x2fb3ac(_0x4d6494(window['Math']['ceil'](_0x3092ad/_0x2e2a5f)));window['localStorage']['setItem'](_0x396941,_0x4e1b07);}function _0x176e1f(){const _0x37d487='llct-'+_0x4d6494(_0x5c20dc(_0x163f99)),_0x43fb84=window['localStorage']['getItem'](_0x37d487);return _0x43fb84?window['parseInt'](_0x2fb3ac(_0x43fb84),0x10)*_0x2e2a5f:null;}function _0x2c0e80(_0x3d551c){return new window['Promise']((_0x275dac,_0x35c9d0)=>{_0x3d551c['then'](_0x275dac,_0x35c9d0),window['setTimeout'](_0x35c9d0,0x1d4c0);});}}_0x2aebaf['on']('_sendUsageRequest',(_0x3622b9,_0x58e3fe)=>{if(_0x58e3fe[0x0]!=_0x163f99)return _0x2f89cb('UsageLimit');_0x58e3fe[0x1]={..._0x58e3fe[0x1],'requestId':_0x8116c4};},{'priority':'high'}),_0x2aebaf['on']('_sendUsageRequest',_0x1cd8a2=>{_0x175fb5(_0x1cd8a2['return'])&&(_0xfac85f=!0x0,_0x1b81e4(_0x1cd8a2['return']));},{'priority':'low'}),_0x3dcf34['then'](()=>{_0xfac85f||_0x2f89cb('UsageLimit');});});function _0x5fbf6b(){return'auto'==_0x2aebaf['editing']['view']['_overlayModeHint'];}function _0x14f42d(){_0x2aebaf['editing']['view']['_overlayModeHint']='auto';}}function _0x3f700e(_0x1576f2){const _0x5e58b5=[new window['Promise'](_0x3cc97f=>setTimeout(_0x3cc97f,0x93ecc)),_0x3dcf34['then'](()=>new window['Promise'](_0x522417=>{let _0x815307=0x0;_0x2aebaf['model']['on']('applyOperation',(_0x2a69b8,_0x327527)=>{_0x327527[0x0]['isDocumentOperation']&&_0x815307++,0x5e8==_0x815307&&(_0x522417(),_0x2a69b8['off']());});}))];return window['Promise']['race'](_0x5e58b5)['then'](()=>_0x1576f2);}async function _0x5e91e1(){await _0x3dcf34,_0x2aebaf['model']['change']=_0x1cdb1b,_0x2aebaf['model']['enqueueChange']=_0x1cdb1b,_0x2aebaf['enableReadOnlyMode']('model');}function _0x102ce6(){return window['glob']&&window['glob']['triliumVersion'];}function _0x24b047(){return _0x492fc3('WebSocketGateway')&&'connected'==_0x1aa5b6('WebSocketGateway')['state'];}function _0x39c314(){return _0x492fc3('RevisionViewerIntegration');}function _0xe4266f(){return _0x492fc3('TrackChangesDataGetter');}function _0x5e490e(_0x7b76b2){const _0x554259=_0x1959d0();_0x2aebaf[_0x554259]='commentsLicenseKey'+_0x7b76b2,'Valid'!=_0x7b76b2&&_0x5e91e1();}function _0x1959d0(){const _0x5eba5e=window['String'](window['performance']['now']())['replace']('.','');let _0x31f5a4='u';for(let _0x584d04=0x0;_0x584d04<_0x5eba5e['length'];_0x584d04+=0x2){let _0x1ed550=window['parseInt'](_0x5eba5e['substring'](_0x584d04,_0x584d04+0x2));_0x1ed550>=0x3e&&(_0x1ed550-=0x3e),_0x31f5a4+=_0x1bc6c0[_0x1ed550];}return _0x31f5a4;}function _0x512390(){const _0x129896=_0x5677f2['split']('.');if(0x3!=_0x129896['length'])return null;return _0x133325(_0x129896[0x1]);function _0x133325(_0x211536){const _0x368fc1=_0x35dcbf(_0x211536);return _0x368fc1&&_0x37d116()?_0x368fc1:null;function _0x37d116(){const _0x21e6c8=_0x368fc1['jti'],_0x2c363a=window['parseInt'](_0x21e6c8['substring'](_0x21e6c8['length']-0x8),0x10),_0x477e6f={..._0x368fc1,'jti':_0x21e6c8['substring'](0x0,_0x21e6c8['length']-0x8)};return delete _0x477e6f['vc'],_0x5c20dc(_0x477e6f)==_0x2c363a;}}}async function _0x51d6e7(){let _0x5783bf=!0x0;try{const [_0x5d7686,_0x556408,_0x1cb3d1]=_0x5677f2['split']('.');return _0x4c57f7(_0x5d7686),await _0x52ac86(_0x5d7686,_0x556408,_0x1cb3d1),_0x5783bf;}catch{return!0x1;}function _0x4c57f7(_0x2e41b9){const _0x212943=_0x35dcbf(_0x2e41b9);_0x212943&&'ES256'==_0x212943['alg']||(_0x5783bf=!0x1);}async function _0x52ac86(_0x128c69,_0x3004a6,_0x550a2d){const _0x29c4e2=window['Uint8Array']['from'](_0x442ee3(_0x550a2d),_0x4e5d05=>_0x4e5d05['charCodeAt'](0x0)),_0x4d47f4=new window['TextEncoder']()['encode'](_0x128c69+'.'+_0x3004a6),_0x352d74=window['crypto']['subtle'];if(!_0x352d74)return;const _0x387228=await _0x352d74['importKey']('jwk',_0x4bc972,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x352d74['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x387228,_0x29c4e2,_0x4d47f4)||(_0x5783bf=!0x1);}}function _0x35dcbf(_0x159bbe){return _0x159bbe['startsWith']('ey')?JSON['parse'](_0x442ee3(_0x159bbe)):null;}function _0x442ee3(_0x2a09a5){return window['atob'](_0x2a09a5['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x5c20dc(_0x4641c4){let _0x2a2a54=0x1505;function _0x29c7cf(_0x126338){for(let _0x23a5ce=0x0;_0x23a5ce<_0x126338['length'];_0x23a5ce++){const _0x459f84=_0x126338['charCodeAt'](_0x23a5ce);_0x2a2a54=(_0x2a2a54<<0x5)+_0x2a2a54+_0x459f84,_0x2a2a54&=_0x2a2a54;}}function _0x528fc1(_0x1034d9){Array['isArray'](_0x1034d9)?_0x1034d9['forEach'](_0x528fc1):_0x1034d9&&'object'==typeof _0x1034d9?Object['entries'](_0x1034d9)['sort']()['forEach'](([_0x3ed253,_0x428e98])=>{_0x29c7cf(_0x3ed253),_0x528fc1(_0x428e98);}):_0x29c7cf(window['String'](_0x1034d9));}return _0x528fc1(_0x4641c4),_0x2a2a54>>>0x0;}function _0x4d6494(_0x243628){return _0x243628['toString'](0x10)['padStart'](0x8,'0');}function _0x2fb3ac(_0x2bb1ba){return _0x2bb1ba['split']('')['reverse']()['join']('');}function _0x492fc3(_0x34f523){return _0x2aebaf['plugins']['has'](_0x34f523);}function _0x1aa5b6(_0x43e04c){return _0x2aebaf['plugins']['get'](_0x43e04c);}function _0x1cdb1b(){}_0x5e490e(await _0x4462b0());}_0x52ee53(_0x12d1f3['editor']);}(this);}destroy(){const _0x2bee90=this['editor']['plugins']['get'](we),_0x1aea43=this['editor']['config']['get']('collaboration.channelId');for(const _0xa39f18 of _0x2bee90['getCommentThreads']({'channelId':_0x1aea43}))_0x2bee90['_detachCommentThread'](_0xa39f18['id']),_0x2bee90['_threads']['delete'](_0xa39f18['id']);super['destroy']();}['hasMarkerForId'](_0x1d9d43){return this['getAllMarkersForId'](_0x1d9d43)['length']>0x0;}getAllMarkersForId(_0x3aa773){const _0x9b30ed=[];for(const _0x1c9309 of this['editor']['model']['markers'])_0x1c9309['name']['startsWith']('comment:'+_0x3aa773)&&_0x9b30ed['push'](_0x1c9309);return _0x9b30ed;}['scrollToThreadMarker'](_0x464760){setTimeout(()=>{const _0x13b5e9=this['_getTargetForId'](_0x464760);_0x13b5e9&&this['activeMarker']&&Ee(this['activeMarker'])['id']===_0x464760&&_0x33a0d0({'target':_0x13b5e9[0x0],'viewportOffset':0x64,'alignToTop':!0x0});},0x32);}_reconvertMarkers(_0x201c51){this['editor']['model']['change'](()=>{for(const _0x2ad6a9 of this['getAllMarkersForId'](_0x201c51))this['editor']['editing']['reconvertMarker'](_0x2ad6a9);});}_attachArchivedThread(_0x5f301c){const _0x5f1164=this['editor']['plugins']['get'](we),_0x219bea=this['editor']['plugins']['get'](ye),_0x499e2b=_0x5f1164['getCommentThread'](_0x5f301c);if(!_0x499e2b['isAttached']){const _0x545db9=_0x499e2b['attachTo'](()=>this['_getTargetForId'](_0x499e2b['id']));_0x219bea['registerAnnotation'](_0x545db9),_0x499e2b['_hasTargetInContent']=!0x1;}}_initializeMarkerConverters(){const _0x1dad2a=this['editor'],_0x4c0030=_0x1dad2a['plugins']['get'](_0x227f13);_0x1dad2a['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'comment','view':(_0x5f2f87,_0x44949d)=>{const {id:_0x9d9d57}=Ee(_0x5f2f87['markerName']),_0x1fcc63=_0x1dad2a['plugins']['get'](we)['getCommentThread'](_0x9d9d57),_0x53aa35=this['activeMarker']&&Ee(this['activeMarker'])['id']===_0x9d9d57;let _0x104855;if(_0x1fcc63&&_0x1fcc63['isResolved']&&!_0x53aa35&&_0x5f2f87['item'])return _0x44949d['consumable']['consume'](_0x5f2f87['item'],'addMarker:'+_0x5f2f87['markerName']),_0x44949d['consumable']['consume'](_0x5f2f87['item'],'removeMarker:'+_0x5f2f87['markerName']),null;const _0x54b511=['ck-comment-marker'];return _0x53aa35&&_0x54b511['push']('ck-comment-marker--active'),_0x104855=_0x1fcc63?.['length']?_0x1fcc63['comments']['first']['author']['id']:_0x4c0030['me']['id'],{'classes':_0x54b511,'attributes':{'data-comment':_0x9d9d57,'data-author-id':_0x104855}};}}),_0x1dad2a['conversion']['for']('dataDowncast')['markerToData']({'model':'comment','view':(_0x3f2ada,{options:_0x4602c7})=>{if(_0x4602c7['showCommentHighlights'])return null;const _0x965250=_0x1dad2a['plugins']['get'](we),_0x1504a3=_0x1dad2a['model']['markers']['get'](_0x3f2ada),{id:_0xabdc44,part:_0x37d381}=Ee(_0x3f2ada);return _0x1504a3&&!_0x1504a3['affectsData']||_0x4602c7['ignoreResolvedComments']&&_0x965250['getCommentThread'](_0xabdc44)?.['isResolved']?null:{'group':'comment','name':_0x37d381?_0xabdc44+':'+_0x37d381:_0xabdc44};}}),_0x1dad2a['conversion']['for']('upcast')['elementToElement']({'view':{'name':'comment','attributes':{'id':/^\w/}},'model':(_0x1ea29f,{writer:_0x583faa})=>_0x583faa['createElement']('$marker',{'data-name':'comment:'+_0x1ea29f['getAttribute']('id')})}),_0x1dad2a['conversion']['for']('upcast')['dataToMarker']({'view':'comment'});}['_handleMarkerAddAndRemove'](){const _0x245d91=this['editor'],_0xbb7643=_0x245d91['plugins']['get'](we),_0x5844a9=new Set(),_0x118698=new Set();_0x245d91['model']['document']['registerPostFixer'](_0x4e2227=>{let _0x199e55=!0x1;for(const {name:_0x37dd06,data:_0x3bb21c}of _0x245d91['model']['document']['differ']['getChangedMarkers']()){const {group:_0x4915c1,id:_0x50e729}=Ee(_0x37dd06);let _0x175699=_0x3bb21c['newRange'];if('comment'!==_0x4915c1||!_0x175699)continue;const _0x233a6a='$graveyard'===_0x175699['root']['rootName'];_0x233a6a||(_0x175699=Me(_0x175699,_0x245d91['model']),!_0x175699||_0x175699['isCollapsed']||!_0x3bb21c['newRange']||_0x175699['isEqual'](_0x3bb21c['newRange']))?_0x245d91['model']['hasContent'](_0x175699)&&!_0x233a6a?this['isThreadsLoadingPaused']?_0x5844a9['add'](_0x37dd06):this['_handleThreadMarker'](_0x37dd06,_0x50e729):(_0x118698['add'](_0x37dd06),_0x5844a9['delete'](_0x37dd06),_0x4e2227['removeMarker'](_0x37dd06),_0x199e55=!0x0):(_0x4e2227['updateMarker'](_0x37dd06,{'range':_0x175699}),_0x199e55=!0x0);}return _0x199e55;}),this['on']('change:isThreadsLoadingPaused',(_0x37ed24,_0x380714,_0x9b7034)=>{if(!_0x9b7034&&_0x5844a9['size'])for(const _0x189927 of _0x5844a9){const {id:_0xcb0f64}=Ee(_0x189927);_0x5844a9['delete'](_0x189927),_0x245d91['model']['markers']['get'](_0x189927)&&this['_handleThreadMarker'](_0x189927,_0xcb0f64);}}),this['listenTo'](_0x245d91['model']['document'],'change',()=>{for(const {name:_0xd65eaf,data:{newRange:_0x27b783}}of _0x245d91['model']['document']['differ']['getChangedMarkers']()){const {group:_0x53f0bf,id:_0x20a6fb}=Ee(_0xd65eaf);if('comment'!==_0x53f0bf)continue;const _0x53f6ae=_0xbb7643['getCommentThread'](_0x20a6fb),_0x36b6da=this['hasMarkerForId'](_0x20a6fb);_0x53f6ae&&(!_0x53f6ae['_hasTargetInContent']&&_0x27b783&&_0x245d91['editing']['view']['once']('render',()=>{const _0x1d172d=_0x245d91['plugins']['get'](me),_0x5e4bf2=_0xbb7643['_threadToController']['get'](_0x53f6ae)['view'];_0x1d172d['getByInnerView'](_0x5e4bf2)['refreshVisibility']();},{'priority':'low'}),_0x53f6ae['_hasTargetInContent']=_0x36b6da||!!_0x27b783),_0x27b783||(_0x118698['add'](_0xd65eaf),_0x5844a9['delete'](_0xd65eaf));}for(const _0x4d0f98 of _0x118698){const {id:_0xe5ca1b}=Ee(_0x4d0f98),_0x1a5e5b=_0xbb7643['getCommentThread'](_0xe5ca1b);if(_0x5844a9['delete'](_0x4d0f98),!_0x1a5e5b)continue;const _0x180fa8=this['hasMarkerForId'](_0xe5ca1b);_0x180fa8||_0x1a5e5b['isSubmitted']?_0x180fa8||_0x1a5e5b['unlinkedAt']||_0x1a5e5b['setUnlinkedAt'](new Date()):_0x1a5e5b['remove']();}_0x118698['clear']();});}_handleInitialThreads(_0x2006a7){_0x2006a7['forEach'](_0x2be2c0=>{_0x2be2c0['unlinkedAt']&&this['_attachArchivedThread'](_0x2be2c0['id']);});}_getTargetForId(_0x375b4b){const _0x4cb005=this['editor'],_0x3350c9=this['getAllMarkersForId'](_0x375b4b);return _0xf67488(_0x4cb005['editing'],_0x3350c9);}_getTextContext(_0x2dda14){const _0x2171c4=this['getAllMarkersForId'](_0x2dda14);let _0x4ceb98='',_0x2aff47=!0x1;for(const _0x21d6f4 of _0x2171c4){const _0x3178a8=_0x21d6f4['getRange']();for(const _0x5d38a2 of Array['from'](_0x3178a8['getItems']()))_0x5d38a2['is']('$textProxy')?(_0x4ceb98&&_0x2aff47&&(_0x4ceb98+='\x20',_0x2aff47=!0x1),_0x4ceb98+=_0x5d38a2['data']):_0x2aff47=!0x0;_0x2aff47=!0x0;}return _0x4ceb98['substring'](0x0,0x96);}_attachMarkerToThread(_0x13a7ee,_0x51dfd7){const _0x381637=this['editor'],_0x496c0a=_0x381637['plugins']['get'](we);let _0x52105b=_0x496c0a['getCommentThread'](_0x51dfd7);const _0x5aed5b=_0x381637['config']['get']('collaboration.channelId'),_0x5171b6=_0x381637['plugins']['get'](ye);return _0x52105b&&(_0x52105b['unlinkedAt']&&_0x52105b['setUnlinkedAt'](null),_0x52105b['isAttached'])||(this['getAllMarkersForId'](_0x51dfd7)[0x0]['managedUsingOperations']?_0x496c0a['fetchCommentThread']({'channelId':_0x5aed5b,'threadId':_0x51dfd7})['then'](_0xc86aa3=>{if('destroyed'!==_0x381637['state']){if(_0x52105b=_0xc86aa3,_0x52105b&&!_0x52105b['isAttached']){const _0x4a0bae=_0x52105b['attachTo'](()=>this['_getTargetForId'](_0x51dfd7));_0x5171b6['registerAnnotation'](_0x4a0bae),_0x52105b['isResolved']&&this['_reconvertMarkers'](_0x51dfd7);}else{if(!_0x52105b){const _0x4c677f=this['getAllMarkersForId'](_0x51dfd7);_0x381637['model']['change'](_0x1809b9=>{for(const _0x1fa7cf of _0x4c677f)_0x1809b9['removeMarker'](_0x1fa7cf);});}}}}):_0x381637['editing']['view']['once']('render',()=>{if(_0x496c0a['getCommentThread'](_0x51dfd7))return;const _0x48c3f1=_0x381637['plugins']['get'](me);_0x52105b=_0x496c0a['openNewCommentThread']({'channelId':_0x5aed5b,'threadId':_0x51dfd7,'target':()=>this['_getTargetForId'](_0x51dfd7),'context':{'type':'text','value':this['_getTextContext'](_0x51dfd7)}});const _0x442963=_0x496c0a['_threadToController']['get'](_0x52105b)['view'],_0x51374d=_0x48c3f1['getByInnerView'](_0x442963);_0x51374d&&_0x5171b6['registerAnnotation'](_0x51374d);},{'priority':'low'})),_0x52105b;}['_handleThreadMarker'](_0x15aa5c,_0x5a3fb0){const _0x10da74=this['_attachMarkerToThread'](_0x15aa5c,_0x5a3fb0);_0x10da74&&!_0x10da74['context']&&_0x10da74['setContext']({'type':'text','value':this['_getTextContext'](_0x5a3fb0)});}_initAriaMarkerChangeAnnouncements(){const _0x422670=this['editor'];_0x4d43db(_0x422670['model'],({left:_0x3f8277,entered:_0x54f069})=>{for(const _0x408c0c of _0x3f8277)if(Re(_0x408c0c)){_0x422670['ui']['ariaLiveAnnouncer']['announce'](Vt(_0x422670['locale'],'LEAVE_COMMENT_ANNOUNCEMENT'));break;}for(const _0x3cbf0d of _0x54f069)if(Re(_0x3cbf0d)){_0x422670['ui']['ariaLiveAnnouncer']['announce'](Vt(_0x422670['locale'],'ENTER_COMMENT_ANNOUNCEMENT',_0x58915c(_0xf9ca0)));break;}});}};function Oe(_0x44f2c1,_0x5e44f0){return _0x5e44f0?_0x44f2c1+':'+_0x5e44f0:_0x44f2c1;}function Me(_0x543e18,_0x24f338){const _0x2dc839=_0x24f338['schema'],_0x48f88b=_0x24f338['createRange'](_0x543e18['start']);for(const _0x61e6ed of _0x543e18['getWalker']()){const {type:_0x3795e1,item:_0x12530a,nextPosition:_0x105b7a}=_0x61e6ed;if('text'===_0x3795e1||_0x2dc839['isObject'](_0x12530a)){const _0x31328e=_0x24f338['createPositionBefore'](_0x12530a);_0x48f88b['isCollapsed']&&(_0x48f88b['start']=_0x31328e),_0x48f88b['end']=_0x105b7a;}}return _0x48f88b;}function Re(_0x318242){return'comment'===Ee(_0x318242['name'])['group'];}var xe=class extends _0x2422cd{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'CommentsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[we,Ne,ye,me];}get CommentsListView(){return Xt;}get CommentThreadInputView(){return Gt;}init(){const _0x4981d=this['editor'],_0x22d5af=_0x4981d['plugins']['get'](we),_0x36e460=_0x4981d['plugins']['get'](Ne),_0x1ffa03=_0x4981d['plugins']['get'](me),_0xb2f49d=_0x4981d['plugins']['get'](ye);_0x4981d['ui']['componentFactory']['add']('comment',()=>{const _0x36eaad=this['_createUIButton'](nt);return _0x36eaad['tooltip']=!0x0,_0x36eaad;}),_0x4981d['ui']['componentFactory']['add']('menuBar:comment',()=>this['_createUIButton'](pt)),_0xb2f49d['addSourceCollector'](()=>{const _0x125f86=[];for(const [_0x51b7cc,_0x1b8015]of _0x22d5af['_threadToController']){const _0x473d89=_0x36e460['getAllMarkersForId'](_0x51b7cc['id']),_0x1ca307=_0x473d89['map'](_0x2d6413=>_0x2d6413['getRange']());_0x473d89['length']>0x0&&_0x125f86['push']([_0x1b8015['view'],_0x1ca307]);}return _0x125f86;}),this['listenTo'](_0x1ffa03,'change:activeAnnotations',(_0x3c07b1,_0x6b0528,_0x32c7be)=>{const _0x391f98=Array['from'](_0x32c7be)['map'](_0x2bc6fb=>_0x2bc6fb['innerView'])['find'](_0x1bf138=>_0x22d5af['_viewToController']['has'](_0x1bf138));if(!_0x391f98)return void(_0x36e460['activeMarker']=null);const _0x5e2ce0=_0x22d5af['_viewToController']['get'](_0x391f98)['model']['id'],_0x20d39d='comment:'+_0x5e2ce0;_0x5e2ce0&&_0x36e460['hasMarkerForId'](_0x5e2ce0)?_0x36e460['activeMarker']=_0x20d39d:_0x36e460['activeMarker']&&(_0x36e460['activeMarker']=null);}),this['listenTo'](_0x22d5af,'removeCommentThread',(_0x2344ae,{threadId:_0x15f19d,isFromAdapter:_0x82a47b})=>{!_0x82a47b&&_0x4981d['ui']['focusTracker']['isFocused']&&_0x36e460['hasMarkerForId'](_0x15f19d)&&_0x4981d['editing']['view']['focus']();},{'priority':'highest'}),this['listenTo'](_0x22d5af,'addComment',(_0x15e2b1,{threadId:_0x1e3d77,isFromAdapter:_0x1123fd})=>{!_0x1123fd&&_0x36e460['hasMarkerForId'](_0x1e3d77)&&_0x22d5af['hasCommentThread'](_0x1e3d77)&&0x1===_0x22d5af['getCommentThread'](_0x1e3d77)['length']&&(_0x4981d['editing']['view']['focus'](),_0x15e2b1['stop']());},{'priority':'low'}),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x1bdb75=[this['editor']];for(const _0x5007d8 of _0x1bdb75){let _0x5beb71;for(const _0x2db510 in _0x5007d8){const _0x4be0fa=_0x2db510,_0x27cd02=_0x5007d8[_0x4be0fa];if('commentsLicenseKeyValid'==_0x27cd02||'commentsLicenseKeyInvalid'==_0x27cd02||'commentsLicenseKeyExpired'==_0x27cd02||'commentsLicenseKeyDomainLimit'==_0x27cd02||'commentsLicenseKeyNotAllowed'==_0x27cd02||'commentsLicenseKeyEvaluationLimit'==_0x27cd02||'commentsLicenseKeyUsageLimit'==_0x27cd02){delete _0x5007d8[_0x4be0fa],_0x5beb71=_0x27cd02,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'commentsLicenseKeyInvalid'==_0x5beb71&&_0x5007d8['_showLicenseError']('invalid'),'commentsLicenseKeyExpired'==_0x5beb71&&_0x5007d8['_showLicenseError']('expired'),'commentsLicenseKeyDomainLimit'==_0x5beb71&&_0x5007d8['_showLicenseError']('domainLimit'),'commentsLicenseKeyNotAllowed'==_0x5beb71&&_0x5007d8['_showLicenseError']('featureNotAllowed','Comments'),'commentsLicenseKeyEvaluationLimit'==_0x5beb71&&_0x5007d8['_showLicenseError']('evaluationLimit'),'commentsLicenseKeyUsageLimit'==_0x5beb71&&_0x5007d8['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_createUIButton(_0x296a1a){const _0x517679=this['editor'],_0x89e8e3=new _0x296a1a(_0x517679['locale']),_0x244c67=_0x517679['commands']['get']('addCommentThread');return _0x89e8e3['set']({'label':Vt(_0x517679['locale'],'Comment'),'icon':_0x22c09c}),_0x89e8e3['bind']('isEnabled')['to'](_0x244c67,'isEnabled',_0x244c67,'hasContent',(_0x4c8f1a,_0x468b65)=>_0x4c8f1a&&_0x468b65),this['listenTo'](_0x89e8e3,'execute',()=>{_0x244c67['execute']();}),_0x89e8e3;}},Se=class extends _0x2422cd{static get['pluginName'](){return'CommentsOnly';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Ne];}constructor(_0xbfa343){super(_0xbfa343),this['set']('isEnabled',!0x1),this['on']('change:isEnabled',(_0x56020f,_0x2e0753,_0x13702b)=>{_0x13702b?this['_enableCommentsOnlyMode']():this['_disableCommentsOnlyMode']();});}afterInit(){!this['isEnabled']&&this['editor']['config']['get']('commentsOnly')&&(this['isEnabled']=!0x0);}_enableCommentsOnlyMode(){for(const [_0x296fdc,_0x21b0f5]of this['editor']['commands'])_0x21b0f5['affectsData']&&'addCommentThread'!==_0x296fdc&&_0x21b0f5['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 _0x1887d4=this['editor']['editing']['view']['document'];this['listenTo'](_0x1887d4,'cut',_0x31678b=>_0x31678b['stop'](),{'priority':'highest'}),this['listenTo'](_0x1887d4,'clipboardInput',_0x1c8f10=>_0x1c8f10['stop'](),{'priority':'highest'}),this['listenTo'](_0x1887d4,'delete',_0x16a9d1=>_0x16a9d1['stop'](),{'priority':'highest'});}_disableCommentsOnlyMode(){for(const [_0x2613c4,_0x51828c]of this['editor']['commands'])_0x51828c['affectsData']&&'addCommentThread'!==_0x2613c4&&_0x51828c['clearForceDisabled']('commentsOnlyMode');this['editor']['plugins']['has']('RevisionTracker')&&this['editor']['plugins']['get']('RevisionTracker')['clearForceDisabled']('commentsOnlyMode'),this['editor']['plugins']['has']('SourceEditing')&&this['editor']['plugins']['get']('SourceEditing')['clearForceDisabled']('commentsOnlyMode'),this['editor']['commands']['get']('editSource')?.['clearForceDisabled']('commentsOnlyMode'),this['stopListening'](this['editor']['editing']['view']['document']);}},Pe=class extends _0x44c171{activeUIs;uisData;['_uis'];static get requires(){return[me];}static get['pluginName'](){return'AnnotationsUIs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x54ea5){super(_0x54ea5),this['activeUIs']=new Set(),this['_uis']=new Map(),this['uisData']=new Map();}init(){const _0x4de381=this['context']['plugins']['get'](me);this['listenTo'](_0x4de381,'_activateAnnotation',(_0x16ad25,_0x23a1e5)=>{for(const _0x17d69a of this['activeUIs']){const _0x3cac5f=this['_uis']['get'](_0x17d69a);(0x0,this['uisData']['get'](_0x17d69a)['filter'])(_0x23a1e5)&&_0x3cac5f['setActiveAnnotation'](_0x23a1e5);}}),this['listenTo'](_0x4de381,'_deactivateAllAnnotations',()=>{for(const _0x3e2c0a of this['activeUIs'])this['_uis']['get'](_0x3e2c0a)['setActiveAnnotation'](null);}),this['listenTo'](_0x4de381['_visibleAnnotations'],'add',(_0x54d0fd,_0x483926)=>{this['_assertAnnotationDoesNotBelongToMultipleUIs'](_0x483926);});}hasActive(){return this['activeUIs']['size']>0x0;}isActive(_0x4c893b){return this['activeUIs']['has'](_0x4c893b);}activate(_0x255548,_0x5ab840=this['defaultFilter']){const _0x1ca616=this['context']['plugins']['get'](me);if(!this['_uis']['has'](_0x255548))throw new _0x237693('annotationsuis-missing-ui',this,{'uiName':_0x255548});this['isActive'](_0x255548)&&this['deactivate'](_0x255548),this['activeUIs']['add'](_0x255548);const _0x1e8b40=new ce();de({'source':_0x1ca616['_visibleAnnotations'],'target':_0x1e8b40,'filter':_0x5ab840}),this['uisData']['set'](_0x255548,{'collection':_0x1e8b40,'filter':_0x5ab840});const _0x305a95=this['_uis']['get'](_0x255548);_0x305a95['attach'](_0x1e8b40),this['listenTo'](_0x305a95,'change:activeAnnotation',(_0x34a675,_0x476cd6,_0x7037a,_0x1f924f)=>{_0x1f924f&&_0x1ca616['_removeActiveAnnotation'](_0x1f924f),_0x7037a&&_0x1ca616['_addActiveAnnotation'](_0x7037a);});}deactivate(_0x30d064){if(this['activeUIs']['delete'](_0x30d064),!this['_uis']['has'](_0x30d064))throw new _0x237693('annotationsuis-missing-ui',this,{'uiName':_0x30d064});const _0x17c683=this['_uis']['get'](_0x30d064);_0x17c683['detach'](),this['stopListening'](_0x17c683),this['uisData']['get'](_0x30d064)['collection']['destroy'](),this['uisData']['delete'](_0x30d064);}switchTo(_0x54c664){if(!this['_uis']['has'](_0x54c664))throw new _0x237693('annotationsuis-missing-ui',this,{'uiName':_0x54c664});const _0x3fbde0=this['context']['plugins']['get'](me),_0x467c7a=Array['from'](_0x3fbde0['activeAnnotations'])[0x0]||null;this['deactivateAll'](),this['activate'](_0x54c664);const _0x3a7876=this['_uis']['get'](_0x54c664);_0x3a7876['setActiveAnnotation'](_0x467c7a),_0x3a7876['_setSelectedAnnotations']&&_0x467c7a&&_0x3a7876['_setSelectedAnnotations']([_0x467c7a]);}deactivateAll(){for(const _0x23d3f4 of this['activeUIs'])this['deactivate'](_0x23d3f4);}register(_0xdccf44,_0x5f5488){if(this['_uis']['has'](_0xdccf44))throw new _0x237693('annotationsuis-register-already-registered');if('function'!=typeof _0x5f5488['attach']||'function'!=typeof _0x5f5488['detach']||'function'!=typeof _0x5f5488['setActiveAnnotation'])throw new _0x237693('annotationsuis-register-invalid-interface',null);this['_uis']['set'](_0xdccf44,_0x5f5488);}refilterAnnotations(){const _0x1d7251=this['context']['plugins']['get'](me)['collection'],_0x5337da=new Map(),_0x320782=Array['from'](this['activeUIs']);for(const _0xb16fd4 of this['activeUIs']){const _0x38bf4c=this['uisData']['get'](_0xb16fd4)['collection'];for(const _0x1586e4 of _0x38bf4c)_0x5337da['set'](_0x1586e4,_0xb16fd4);}for(const _0xa05b04 of _0x1d7251){const _0x44e6e7=_0x5337da['get'](_0xa05b04);this['_assertAnnotationDoesNotBelongToMultipleUIs'](_0xa05b04);const _0x36a500=_0x320782['find'](_0x4b9d36=>this['uisData']['get'](_0x4b9d36)['filter'](_0xa05b04));_0x44e6e7!==_0x36a500&&(_0x44e6e7&&this['uisData']['get'](_0x44e6e7)['collection']['remove'](_0xa05b04),_0x36a500&&this['uisData']['get'](_0x36a500)['collection']['add'](_0xa05b04));}}destroy(){this['deactivateAll'](),super['destroy']();}defaultFilter(){return!0x0;}_assertAnnotationDoesNotBelongToMultipleUIs(_0x1128cd){const _0x48e379=[];for(const _0x1765eb of this['activeUIs']){(0x0,this['uisData']['get'](_0x1765eb)['filter'])(_0x1128cd)&&_0x48e379['push'](_0x1765eb);}if(_0x48e379['length']>0x1)throw new _0x237693('annotationsuis-annotation-mismatch',null,{'matchedUIs':_0x48e379,'annotationType':_0x1128cd['type']});}};const Le=/* #__PURE__ -- @preserve */
|
|
32
|
-
|
|
33
|
-
_0x1f648e('px');var Be=class extends wt{content;_targetTop;_mutationObserver;constructor(_0x5e33c7){super(_0x5e33c7),this['set']('top',0x0),this['set']('height',0x0),this['bind']('bottom')['to'](this,'top',this,'height',(_0x41beb7,_0x4f029b)=>_0x41beb7+_0x4f029b),this['set']('isAnimationDisabled',!0x1),this['_mutationObserver']=ne(()=>this['updateHeight']()),this['_targetTop']=null,this['content']=this['createCollection'](),this['content']['delegate']('arrowup','arrowdown')['to'](this);const _0x551dfc=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-sidebar-item',_0x551dfc['to']('isAnimationDisabled',_0x480e9a=>_0x480e9a?'ck-sidebar-item--no-animation':'')],'style':{'top':_0x551dfc['to']('top',_0x4db876=>Ve(_0x4db876))},'role':'presentation'},'children':this['content']});}['render'](){super['render'](),this['_mutationObserver']['attach'](this['element']);}['focus'](){this['content']['first']&&this['content']['first']['focus']();}updateHeight(){const _0x4dcadb=this['element']['clientHeight'];_0x4dcadb&&(this['height']=_0x4dcadb);}destroy(){this['content']['clear'](),this['_mutationObserver']['detach'](),super['destroy']();}},He=class extends _0x44c171{['view'];_activeAnnotation;_annotations;_spaceBetweenItems;_sidebarItemViewToAnnotation;_annotationToSidebarItemView;_recalculateBuffer;static get['pluginName'](){return'Sidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x676ece){super(_0x676ece),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 _0x9a7b4b=this['context']['config']['get']('sidebar.container');_0x9a7b4b&&this['setContainer'](_0x9a7b4b);}setContainer(_0x511a62){if(!Fe(_0x511a62))throw new _0x237693('sidebar-setcontainer-invalid-element');this['container']=_0x511a62;}_attachToContainer({viewClass:_0x4f0ec9='',spaceBetweenItems:_0x567070=0x19}={}){if(!Fe(this['container']))throw new _0x237693('sidebar-attachtocontainer-missing-container',this);this['container']['appendChild'](this['view']['element']),this['view']['class']=_0x4f0ec9,this['_spaceBetweenItems']=_0x567070;}['rearrange']({removedAnnotation:_0xe3f545,previousAnnotation:_0x4897b4,nextAnnotation:_0x593755}){const _0x7d84a5=this['getSidebarItemView'](_0xe3f545);this['view']['list']['remove'](_0x7d84a5),this['_destroySidebarItemView'](_0xe3f545),_0x4897b4&&this['_alignToTargetRect'](this['getSidebarItemView'](_0x4897b4)),_0x593755&&this['_alignToTargetRect'](this['getSidebarItemView'](_0x593755)),this['_updateLastItem']();}['refresh']({blurredAnnotation:_0x5beb57,activatedAnnotation:_0x1905d0,disableAnimationOnActivatedAnnotation:_0x15ecdf}){if(this['_activeAnnotation']=_0x1905d0,_0x5beb57){_0x5beb57['isActive']=!0x1;const _0x456972=this['getSidebarItemView'](_0x5beb57);_0x456972&&_0x15ecdf&&(_0x456972['isAnimationDisabled']=!0x1);}if(_0x1905d0){const _0x4ba8fb=this['getSidebarItemView'](_0x1905d0);_0x4ba8fb&&(_0x1905d0['isActive']=!0x0,_0x15ecdf&&(_0x4ba8fb['isAnimationDisabled']=!0x0,_0x4ba8fb['top']+=0x1),this['_alignToTargetRect'](_0x4ba8fb));}}_detachFromContainer(_0x4d04b0){if(this['view']['element']['remove'](),_0x4d04b0){for(const _0xb942b3 of _0x4d04b0)this['_destroySidebarItemView'](_0xb942b3);}this['view']['list']['clear'](),this['view']['class']='',this['_lastItem']=null;}addAnnotation(_0x28e112,_0xc176a1){_0xc176a1||(_0xc176a1=_0x28e112['view']);const _0x34d2fd=new Be(this['context']['locale']);this['_sidebarItemViewToAnnotation']['set'](_0x34d2fd,_0x28e112),this['_annotationToSidebarItemView']['set'](_0x28e112,_0x34d2fd),_0x34d2fd['content']['add'](_0xc176a1),this['listenTo'](_0x28e112['view'],'change:targetRect',(_0x4f5a3b,_0x241026,_0x112cdd)=>{const _0x1cb7ad=this['_getTargetTop'](_0x28e112,_0x112cdd);_0x34d2fd['_targetTop']!=_0x1cb7ad&&(_0x34d2fd['_targetTop']=_0x1cb7ad,this['_setItemTop'](_0x34d2fd,_0x1cb7ad));}),this['listenTo'](_0x34d2fd,'change:top',()=>{this['_recalculate'](_0x34d2fd,'top');}),this['listenTo'](_0x34d2fd,'change:bottom',()=>{this['_recalculate'](_0x34d2fd,'bottom');}),this['_alignToTargetRect'](_0x34d2fd);const _0x139758=this['_getItemBefore'](_0x34d2fd);return _0x139758&&this['_alignAfterItem'](_0x139758,_0x34d2fd)||this['_alignToTargetRect'](_0x34d2fd),this['_updateLastItem'](),this['view']['list']['add'](_0x34d2fd),_0x34d2fd;}['_alignForTopChange'](_0x47e6ba){if(!_0x47e6ba['content']['length'])return;const _0x6003e0=this['_getItemBefore'](_0x47e6ba);if(!_0x6003e0)return;const _0x52c6c6=this['_sidebarItemViewToAnnotation']['get'](_0x6003e0),_0x77ee63=this['_activeAnnotation'];_0x77ee63&&_0x77ee63===_0x52c6c6?this['_alignAfterItem'](_0x6003e0,_0x47e6ba):this['_alignBeforeItem'](_0x47e6ba,_0x6003e0);}_alignForBottomChange(_0x307c80){if(!_0x307c80['content']['length'])return;const _0x46da7e=this['_getItemAfter'](_0x307c80);if(!_0x46da7e)return;const _0x386463=this['_sidebarItemViewToAnnotation']['get'](_0x46da7e),_0x3c582c=this['context']['config']['get']('sidebar.preventScrollOutOfView'),_0x559d1c=this['_activeAnnotation'];_0x559d1c&&_0x559d1c===_0x386463&&_0x3c582c?(this['_alignBeforeItem'](_0x46da7e,_0x307c80),this['_alignAfterItem'](_0x307c80,_0x46da7e)):_0x559d1c&&_0x559d1c===_0x386463?this['_alignBeforeItem'](_0x46da7e,_0x307c80):this['_alignAfterItem'](_0x307c80,_0x46da7e);}_recalculate(_0x167da0,_0x381ee7){0x0===this['_recalculateBuffer']['length']&&setTimeout(()=>{for(const {sidebarItemView:_0xa7fb8e,changedProp:_0x36106a}of this['_recalculateBuffer'])'top'===_0x36106a?this['_alignForTopChange'](_0xa7fb8e):this['_alignForBottomChange'](_0xa7fb8e);this['_recalculateBuffer']=[];},0xa),this['_recalculateBuffer']['push']({'sidebarItemView':_0x167da0,'changedProp':_0x381ee7});}getSidebarItemView(_0x1c0b37){return this['_annotationToSidebarItemView']['get'](_0x1c0b37);}destroy(){this['stopListening'](),this['view']['destroy']();}_destroySidebarItemView(_0x184c6c){const _0x2b799b=this['getSidebarItemView'](_0x184c6c);this['stopListening'](_0x2b799b),this['stopListening'](_0x184c6c['view']),_0x2b799b['destroy'](),this['_annotationToSidebarItemView']['delete'](_0x184c6c),this['_sidebarItemViewToAnnotation']['delete'](_0x2b799b);}_createSidebarView(){const _0x5efb8b=new De(this['context']['locale']);return _0x5efb8b['render'](),this['on']('change:_lastItem',(_0x288adf,_0x4759ef,_0x91b83a,_0x19b3b3)=>{_0x19b3b3&&_0x5efb8b['unbind']('minHeight'),_0x91b83a?_0x5efb8b['bind']('minHeight')['to'](_0x91b83a,'bottom'):_0x5efb8b['minHeight']=null;}),_0x5efb8b;}_updateLastItem(){this['_lastItem']=this['_annotations']?.['last']?this['getSidebarItemView'](this['_annotations']['last']):null;}_getItemBefore(_0xa0fb14){const _0x40d074=this['_sidebarItemViewToAnnotation']['get'](_0xa0fb14),_0x5a57bc=_0x40d074&&this['_annotations']?.['get'](this['_annotations']['getIndex'](_0x40d074)-0x1);return _0x5a57bc&&this['getSidebarItemView'](_0x5a57bc)||null;}_getItemAfter(_0x359803){const _0x2f4ba6=this['_sidebarItemViewToAnnotation']['get'](_0x359803),_0x279dc1=_0x2f4ba6&&this['_annotations']?.['get'](this['_annotations']['getIndex'](_0x2f4ba6)+0x1);return _0x279dc1&&this['getSidebarItemView'](_0x279dc1)||null;}_alignBeforeItem(_0x3c8c30,_0x53d2ea){_0x3c8c30['updateHeight']();const _0x11cfdf=Ue(_0x53d2ea['bottom']+this['_spaceBetweenItems'],_0x3c8c30['top']);return!!_0x11cfdf&&(this['_setItemTop'](_0x53d2ea,_0x53d2ea['top']-_0x11cfdf),!0x0);}_alignAfterItem(_0x313c4a,_0x228682){_0x313c4a['updateHeight']();const _0xb105f6=Ue(_0x313c4a['bottom']+this['_spaceBetweenItems'],_0x228682['top']);return!!_0xb105f6&&(this['_setItemTop'](_0x228682,_0x228682['top']+_0xb105f6,!0x1),!0x0);}_alignToTargetRect(_0x2423fa){const _0x566ac2=this['_sidebarItemViewToAnnotation']['get'](_0x2423fa);if(!_0x566ac2||!_0x566ac2['target']||!_0x566ac2['targetRect'])return;const _0x412e9a=this['_getTargetTop'](_0x566ac2,_0x566ac2['targetRect']);this['_setItemTop'](_0x2423fa,_0x412e9a);}_getTargetTop(_0x1b1639,_0x3c6e09){if(null===_0x3c6e09)return 0x0;if(_0x1b1639['target']instanceof _0x7454d6)return _0x3c6e09['top'];{const _0x37943b=new _0x7454d6(this['view']['element'])['top'];return _0x3c6e09['top']-_0x37943b;}}_setItemTop(_0x57e63c,_0x2f5e3a,_0x1b4d1f=this['context']['config']['get']('sidebar.preventScrollOutOfView')){_0x1b4d1f&&(_0x2f5e3a=Math['max'](_0x2f5e3a,this['_getMaxAvailableTop'](_0x57e63c))),_0x57e63c['top']=_0x2f5e3a;}_getMaxAvailableTop(_0x2dca32){let _0x4e0e61=this['_getItemBefore'](_0x2dca32),_0x3cd774=0x0;for(;_0x4e0e61;)_0x4e0e61['updateHeight'](),_0x3cd774+=this['_spaceBetweenItems']+_0x4e0e61['height'],_0x4e0e61=this['_getItemBefore'](_0x4e0e61);return _0x3cd774;}};function Ue(_0x36c789,_0x50bb15){return Math['max'](_0x36c789-_0x50bb15,0x0);}function Fe(_0x309e58){return null!==_0x309e58&&'object'==typeof _0x309e58&&0x1===_0x309e58['nodeType'];}var We=class extends _0x44c171{isAttached;annotations;_editorAnnotations;_refreshPositioningDebounced;static get requires(){return[He,Pe];}static get['pluginName'](){return'WideSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x49e292){super(_0x49e292),this['isAttached']=!0x1,this['set']('activeAnnotation',null),this['annotations']=null,this['_editorAnnotations']=new _0x28de1d(),this['_refreshPositioningDebounced']=_0x5d9b0a(()=>{_0x49e292['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning']();},0xfa,{'leading':!0x1});}init(){const _0x2c427b=this['context']['plugins']['get'](Pe),_0x317e1c=this['context']['plugins']['get'](He);_0x2c427b['register']('wideSidebar',this),_0x317e1c['container']&&_0x2c427b['switchTo']('wideSidebar');}setActiveAnnotation(_0x5efeda){if(_0x5efeda===this['activeAnnotation'])return;const _0x2620d7=this['context']['plugins']['get'](He);_0x2620d7['_activeAnnotation']=_0x5efeda;const _0x33f4ec=this['activeAnnotation'];_0x2620d7['refresh']({'blurredAnnotation':_0x33f4ec,'activatedAnnotation':_0x5efeda}),this['activeAnnotation']=_0x5efeda;}attach(_0x2675b5){this['annotations']=_0x2675b5;const _0x5045b4=this['context']['plugins']['get'](He);if(_0x5045b4['_annotations']=_0x2675b5,this['isAttached'])throw new _0x237693('widesidebar-attach-already-attached',this);this['isAttached']=!0x0,this['listenTo'](_0x5045b4,'set:container',()=>{this['detach'](),this['listenTo'](_0x5045b4,'change:container',_0x24f73f=>{_0x24f73f['off'](),this['attach'](_0x2675b5);});}),_0x5045b4['_attachToContainer']({'viewClass':'ck-sidebar--wide'});const _0x49edaa=_0x4404a6=>{_0x4404a6['updateTargetRect'](),_0x5045b4['addAnnotation'](_0x4404a6);};for(const _0x1d77f8 of _0x2675b5)_0x49edaa(_0x1d77f8);this['listenTo'](_0x2675b5,'add',(_0x54bacd,_0x2c6d13)=>{_0x49edaa(_0x2c6d13);}),this['listenTo'](_0x2675b5,'remove',(_0x505a95,_0xbeffff,_0x5808a1)=>{_0x5045b4['rearrange']({'removedAnnotation':_0xbeffff,'previousAnnotation':_0x2675b5['get'](_0x5808a1-0x1),'nextAnnotation':_0x2675b5['get'](_0x5808a1+0x1)}),_0xbeffff===this['activeAnnotation']&&this['setActiveAnnotation'](null);},{'priority':'high'}),this['listenTo'](_0x2675b5,'focus',(_0xbab78e,_0x45f93c)=>{this['setActiveAnnotation'](_0x45f93c);}),this['listenTo'](_0x2675b5,'blur',()=>{this['setActiveAnnotation'](null);});const _0xec62f3=this['context']instanceof _0x228509?this['context']['editors']:new _0x28de1d([this['context']]);for(const _0x4a6393 of _0xec62f3)this['_integrateWithEditorAnnotations'](_0x4a6393);this['listenTo'](_0xec62f3,'add',(_0x30bac5,_0x3e8358)=>{this['listenTo'](_0x3e8358,'ready',()=>{this['_integrateWithEditorAnnotations'](_0x3e8358);});}),this['listenTo'](_0xec62f3,'remove',(_0x28c149,_0x514093)=>{_0x514093['plugins']['has']('EditorAnnotations')&&this['_destroyEditorAnnotationsIntegration'](_0x514093['plugins']['get']('EditorAnnotations'));}),window['addEventListener']('resize',this['_refreshPositioningDebounced']),this['context']['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning']();}detach(){if(!this['isAttached'])throw new _0x237693('widesidebar-detach-not-attached',this);this['setActiveAnnotation'](null);const _0x463a96=this['context']['plugins']['get'](He);_0x463a96['_detachFromContainer'](this['annotations']),this['stopListening'](_0x463a96),this['stopListening'](this['annotations']),this['context']instanceof _0x228509&&this['stopListening'](this['context']['editors']);for(const _0x4d95af of Array['from'](this['_editorAnnotations']))this['_destroyEditorAnnotationsIntegration'](_0x4d95af);window['removeEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioningDebounced']['cancel'](),this['activeAnnotation']=null,this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach']();}_integrateWithEditorAnnotations(_0x188953){if(!_0x188953['plugins']['has']('EditorAnnotations'))return;const _0x364975=_0x188953['plugins']['get']('EditorAnnotations'),_0xd6e96b=()=>{const _0x41e4ed=_0x364975['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});this['setActiveAnnotation'](_0x41e4ed[0x0]||null);};this['listenTo'](_0x364975,'refresh',_0xd6e96b),this['listenTo'](_0x364975,'blur',(_0x4d3057,{isAnnotationTracked:_0xa12bdd})=>{this['activeAnnotation']&&_0xa12bdd(this['activeAnnotation'])&&this['setActiveAnnotation'](null);}),this['listenTo'](_0x364975,'uiUpdate',()=>{this['_refreshPositioningDebounced']();}),this['listenTo'](this['annotations'],'blur',_0x202656=>{_0x364975['hasDomSelection']()&&(_0xd6e96b(),_0x202656['stop']());},{'priority':'high'}),this['_editorAnnotations']['add'](_0x364975);}_destroyEditorAnnotationsIntegration(_0x2dcf7b){this['stopListening'](_0x2dcf7b),this['_editorAnnotations']['remove'](_0x2dcf7b);}},Ke=class extends nt{counterView;constructor(_0x4978c8){super(_0x4978c8);const _0x26481a=this['bindTemplate'];this['set']('isDirty',!0x1),this['set']('number',0x0),this['bind']('_badge')['to'](this,'isDirty',this,'number',(_0xaaefa6,_0x3ea6f7)=>_0xaaefa6?'…':_0x3ea6f7['toString']()),this['set']('annotationType',''),this['bind']('icon')['to'](this,'annotationType',_0x42bddf=>'comment'===_0x42bddf?_0x2efb27:tt),this['extendTemplate']({'attributes':{'class':['ck-annotation-counter']}}),this['counterView']=new wt(),this['counterView']['setTemplate']({'tag':'span','attributes':{'class':['ck-annotation-counter__badge',_0x26481a['to']('annotationType',_0x4aa0cc=>'ck-annotation-counter__badge--'+_0x4aa0cc),_0x26481a['if']('isDirty','ck-annotation-counter__badge--edit-mode')]},'children':[{'text':_0x26481a['to']('_badge')}]}),this['children']['add'](this['counterView']);}},Ge=class extends _0x44c171{isAttached;annotations;_manuallyClosedAnnotationViews;_domEmitter;_annotationToNarrowView;_selectedAnnotations;_editorAnnotations;_refreshPositioningDebounced;static get requires(){return[He,Pe];}static get['pluginName'](){return'NarrowSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2f688e){super(_0x2f688e),this['isAttached']=!0x1,this['_manuallyClosedAnnotationViews']=new Set(),this['_domEmitter']=new(_0x31f767())(),this['_annotationToNarrowView']=new Map(),this['set']('activeAnnotation',null),this['annotations']=null,this['_selectedAnnotations']=[],this['_editorAnnotations']=new _0x28de1d(),this['_refreshPositioningDebounced']=_0x5d9b0a(()=>{this['_refreshPositioning']();},0xfa,{'leading':!0x1});}init(){this['context']['plugins']['get'](Pe)['register']('narrowSidebar',this),this['_overlayHost']=new _t(this['context']['locale'],{'resolveMountTarget':()=>this['_resolveOverlayTarget'](),'resolveInlineContainer':()=>this['context']['plugins']['get'](He)['container']}),this['_overlayHost']['sync'](),this['bodyCollection']=this['_overlayHost']['bodyCollection'],this['balloonPanelView']=new st(this['context']['locale']),this['bodyCollection']['add'](this['balloonPanelView']);}attach(_0x3a6506){this['annotations']=_0x3a6506;const _0x133b29=this['context']['plugins']['get'](He),_0x4d2735=this['balloonPanelView'];if(_0x133b29['_annotations']=_0x3a6506,this['isAttached'])throw new _0x237693('narrowsidebar-attach-already-attached',this);this['isAttached']=!0x0,this['listenTo'](_0x133b29,'set:container',()=>{this['detach'](),this['listenTo'](_0x133b29,'change:container',_0x46c982=>{_0x46c982['off'](),this['attach'](_0x3a6506);});}),_0x133b29['_attachToContainer']({'viewClass':'ck-sidebar--narrow','spaceBetweenItems':0x5}),this['_overlayHost']['sync']();const _0x572c78=_0x5098a0=>{const _0x50517b=new Ke(this['context']['locale']);_0x133b29['addAnnotation'](_0x5098a0,_0x50517b),this['_annotationToNarrowView']['set'](_0x5098a0,_0x50517b),_0x50517b['bind']('isDirty','annotationType','number')['to'](_0x5098a0['view'],'isDirty','type','length'),_0x50517b['on']('execute',()=>{this['_manuallyClosedAnnotationViews']['clear'](),_0x4d2735['content']['first']!==_0x5098a0['view']?(this['_showBalloon'](_0x5098a0),_0x5098a0['view']['element']['focus'](),this['setActiveAnnotation'](_0x5098a0)):this['setActiveAnnotation'](null);});};for(const _0x37e105 of _0x3a6506)_0x572c78(_0x37e105);this['listenTo'](_0x3a6506,'add',(_0x159762,_0x477f37)=>{_0x572c78(_0x477f37);}),this['listenTo'](_0x3a6506,'remove',(_0x58278d,_0x46ac9b,_0x24b4db)=>{this['_annotationToNarrowView']['get'](_0x46ac9b)['destroy'](),this['_annotationToNarrowView']['delete'](_0x46ac9b),_0x133b29['rearrange']({'removedAnnotation':_0x46ac9b,'previousAnnotation':_0x3a6506['get'](_0x24b4db-0x1),'nextAnnotation':_0x3a6506['get'](_0x24b4db+0x1)}),_0x46ac9b===this['activeAnnotation']&&this['setActiveAnnotation'](null);},{'priority':'low'}),this['listenTo'](_0x3a6506,'focus',(_0x3511df,_0x2063a4)=>{this['setActiveAnnotation'](_0x2063a4);}),this['listenTo'](_0x3a6506,'blur',()=>{this['setActiveAnnotation'](null);}),this['_domEmitter']['listenTo'](document,'keydown',(_0x55556c,_0x27013b)=>{_0x27013b['keyCode']===_0x31b14d['esc']&&_0x4d2735['isVisible']&&(this['_manuallyClosedAnnotationViews']['add'](_0x4d2735['content']['first']),this['_hideBalloon'](),_0x27013b['stopPropagation'](),_0x27013b['preventDefault']());}),At({'emitter':this['_domEmitter'],'activator':()=>_0x4d2735['isVisible']&&!this['_hasEditorDomSelection'](),'contextElements':()=>{const _0x9dcc3b=[_0x133b29['view']['element']];return _0x4d2735['isVisible']&&_0x9dcc3b['push'](_0x4d2735['element']),this['activeAnnotation']&&_0x9dcc3b['push'](...this['activeAnnotation']['focusableElements']),_0x9dcc3b;},'callback':()=>{this['_manuallyClosedAnnotationViews']['clear'](),this['_hideBalloon'](),this['setActiveAnnotation'](null);}});const _0x56ed74=this['context']instanceof _0x228509?this['context']['editors']:new _0x28de1d([this['context']]);for(const _0x593baf of _0x56ed74)this['_integrateWithEditorAnnotations'](_0x593baf);this['listenTo'](_0x56ed74,'add',(_0x4eb95b,_0x2c2167)=>{this['listenTo'](_0x2c2167,'ready',()=>{this['_integrateWithEditorAnnotations'](_0x2c2167);});}),this['listenTo'](_0x56ed74,'remove',(_0x5303a3,_0x580431)=>{_0x580431['plugins']['has']('EditorAnnotations')&&this['_destroyEditorAnnotationsIntegration'](_0x580431['plugins']['get']('EditorAnnotations'));}),window['addEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioning']();}setActiveAnnotation(_0x4d94b2){if(_0x4d94b2===this['activeAnnotation'])return;const _0x15714f=this['context']['plugins']['get'](He);_0x15714f['refresh']({'blurredAnnotation':this['activeAnnotation'],'activatedAnnotation':_0x4d94b2,'disableAnimationOnActivatedAnnotation':!0x0}),_0x4d94b2&&_0x15714f['getSidebarItemView'](_0x4d94b2)?this['_showBalloon'](_0x4d94b2):this['_hideBalloon'](),this['activeAnnotation']=_0x4d94b2;}detach(){if(!this['isAttached'])throw new _0x237693('narrowsidebar-detach-not-attached',this);this['setActiveAnnotation'](null);const _0x2ce55a=this['context']['plugins']['get'](He);this['_hideBalloon'](),Array['from'](this['_annotationToNarrowView']['values'](),_0x26a888=>_0x26a888['destroy']()),this['_annotationToNarrowView']['clear'](),_0x2ce55a['_detachFromContainer'](this['annotations']),this['stopListening'](),this['_domEmitter']['stopListening'](),this['context']instanceof _0x228509&&this['stopListening'](this['context']['editors']);for(const _0x331025 of Array['from'](this['_editorAnnotations']))this['_destroyEditorAnnotationsIntegration'](_0x331025);window['removeEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioningDebounced']['cancel'](),this['_selectedAnnotations']=[],this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach'](),this['_overlayHost']['destroy']();}_integrateWithEditorAnnotations(_0x16e369){if(!_0x16e369['plugins']['has']('EditorAnnotations'))return;const _0xaf77ad=_0x16e369['plugins']['get']('EditorAnnotations'),_0x476837=this['context']['plugins']['get'](He),_0x5225a3=this['annotations'],_0x1bc610=this['balloonPanelView'],_0x125699=()=>{const _0x5b51af=_0xaf77ad['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});this['_setSelectedAnnotations'](_0x5b51af),this['setActiveAnnotation'](_0x5b51af[0x0]||null);};this['listenTo'](_0xaf77ad,'refresh',_0x125699),this['listenTo'](_0xaf77ad,'blur',(_0xf7abbd,{isAnnotationTracked:_0x16dab5})=>{this['activeAnnotation']&&_0x16dab5(this['activeAnnotation'])&&(this['_setSelectedAnnotations']([]),this['setActiveAnnotation'](null));}),this['listenTo'](_0xaf77ad,'uiUpdate',()=>{this['_refreshPositioningDebounced']();}),this['listenTo'](_0x5225a3,'blur',_0x7faecd=>{_0xaf77ad['hasDomSelection']()&&_0x7faecd['stop']();},{'priority':'high'}),At({'emitter':this['_domEmitter'],'activator':()=>!!this['activeAnnotation'],'contextElements':()=>{const _0x5dac8d=[_0x476837['view']['element']];return _0x1bc610['isVisible']&&_0x5dac8d['push'](_0x1bc610['element']),_0x5dac8d;},'callback':()=>{_0xaf77ad['hasDomSelection']()&&_0x125699();}}),this['_editorAnnotations']['add'](_0xaf77ad),this['_overlayHost']['sync']();}_destroyEditorAnnotationsIntegration(_0x5f3d0f){_0x5f3d0f&&(this['stopListening'](_0x5f3d0f),this['_editorAnnotations']['remove'](_0x5f3d0f));}_hasEditorDomSelection(){return Array['from'](this['_editorAnnotations'])['some'](_0x5562e0=>_0x5562e0['hasDomSelection']());}_setSelectedAnnotations(_0x1f3727){for(const _0x58d205 of this['_selectedAnnotations'])_0x1f3727['includes'](_0x58d205)||this['_manuallyClosedAnnotationViews']['delete'](_0x58d205['view']);this['_selectedAnnotations']=_0x1f3727;}_refreshPositioning(){const _0x59a045=this['balloonPanelView'];this['context']['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning'](),_0x59a045['isVisible']&&this['_updateBalloonPosition']();}_resolveOverlayTarget(){const _0x2b8f19=this['context']['config']['get']('sidebar.overlayContainer')||this['context']['config']['get']('ui.overlayContainer');if(_0x2b8f19)return _0x2b8f19;const _0x3eb9ae=this['context']['plugins']['get'](He)['container'];return _0x3eb9ae?_0x5c2ebf(_0x3eb9ae):null;}['_showBalloon'](_0x2ad912){if(this['_manuallyClosedAnnotationViews']['has'](_0x2ad912['view']))return;const _0xfdbd53=this['balloonPanelView']['content']['first'];_0xfdbd53!==_0x2ad912['view']?(_0xfdbd53&&this['_detachListeners'](_0xfdbd53),this['_overlayHost']['sync'](),this['_attachListeners'](_0x2ad912['view']),this['balloonPanelView']['content']['clear'](),this['balloonPanelView']['content']['add'](_0x2ad912['view']),this['_updateBalloonPosition']()):this['_updateBalloonPosition']();}_updateBalloonPosition(){const _0x34d9ea=this['balloonPanelView']['content']['first'],_0x365d11=_0x34d9ea&&this['annotations']['getByView'](_0x34d9ea);if(!_0x365d11||!this['_annotationToNarrowView']['has'](_0x365d11))return;const _0x769195=this['_annotationToNarrowView']['get'](_0x365d11)['element'],_0x202113=(function(){const _0x15536a=st['defaultPositions'];return[_0x15536a['southArrowNorthEast'],_0x15536a['northArrowSouthEast'],_0x15536a['southArrowNorth'],_0x15536a['northArrowSouth'],_0x15536a['southArrowNorthWest'],_0x15536a['northArrowSouthWest']];}());this['balloonPanelView']['pin']({'target':_0x769195,'positions':_0x202113});}['_hideBalloon'](){const _0x119282=this['balloonPanelView'],_0x552756=_0x119282['content']['first'];_0x552756&&(this['_detachListeners'](_0x552756),_0x119282['unpin'](),_0x119282['content']['clear']());}_attachListeners(_0x55f1a1){this['listenTo'](_0x55f1a1,'change:height',()=>this['_updateBalloonPosition']()),this['listenTo'](_0x55f1a1,'Esc',(_0xb08c07,_0x2e595a)=>{this['_manuallyClosedAnnotationViews']['add'](_0x55f1a1),this['_hideBalloon'](),_0x2e595a();});}_detachListeners(_0x4aefb3){this['stopListening'](_0x4aefb3);}},Ye=class extends _0x2422cd{isAttached;annotations;['_manuallyClosed'];['_balloon'];_addedAnnotations;_selectedAnnotations;['_forceRefresh'];_refreshVisibilityDebounced;static get requires(){return[ye,ot,Pe];}static get['pluginName'](){return'InlineAnnotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3bd952){super(_0x3bd952),_0x3bd952['editing']['view']['addObserver'](yt),this['isAttached']=!0x1,this['set']('activeAnnotation',null),this['annotations']=null,this['_manuallyClosed']=new Set(),this['_balloon']=_0x3bd952['plugins']['get'](ot),this['_addedAnnotations']=new Set(),this['_selectedAnnotations']=[],this['_forceRefresh']=!0x1,this['_refreshVisibilityDebounced']=_0x5d9b0a(()=>{this['editor']['plugins']['get']('Annotations')['refreshVisibility']();},0xfa,{'leading':!0x1});}init(){const _0x1f09df=this['editor']['plugins']['get'](Pe);_0x1f09df['context']===this['editor']&&(_0x1f09df['register']('inline',this),this['editor']['keystrokes']['set']('Esc',(_0x2ee103,_0x14992c)=>{const _0x330a31=this['_balloon'];if(this['isAttached']&&_0x330a31['visibleView']){const _0x22ef2c=this['annotations']['getByView'](_0x330a31['visibleView']);_0x22ef2c&&this['_closeAnnotation'](_0x22ef2c),_0x14992c();}}));}afterInit(){const _0x376cc9=this['editor']['plugins']['get'](Pe);_0x376cc9['context']===this['editor']&&(_0x376cc9['hasActive']()||_0x376cc9['switchTo']('inline'));}setActiveAnnotation(_0x268c5b){_0x268c5b!==this['activeAnnotation']&&(this['activeAnnotation']&&(this['activeAnnotation']['isActive']=!0x1),_0x268c5b&&this['editor']['ui']['focusTracker']['isFocused']&&(this['annotations']['has'](_0x268c5b)&&this['_addAnnotationToBalloon'](_0x268c5b,!0x0),_0x268c5b['isActive']=!0x0),_0x268c5b||this['_setSelectedAnnotations']([]),this['activeAnnotation']=_0x268c5b);}attach(_0x1e5221){this['annotations']=_0x1e5221;const _0x4ec702=this['editor']['plugins']['get'](Pe),_0x15ef38=this['_balloon'];if(this['isAttached'])throw new _0x237693('inlineannotations-attach-already-attached',this);if(_0x4ec702['context']!==this['editor'])throw new _0x237693('inlineannotations-not-allowed-with-context',this);const _0x5d4812=this['editor']['plugins']['get'](ye);this['listenTo'](_0x5d4812,'refresh',()=>{const _0x1e1838=_0x5d4812['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});var _0x138c87,_0x2b0964;!this['_forceRefresh']&&(_0x138c87=_0x1e1838,_0x2b0964=this['_selectedAnnotations'],_0x138c87['length']===_0x2b0964['length']&&_0x138c87['every'](_0x3feb09=>_0x2b0964['includes'](_0x3feb09)))||(this['_forceRefresh']=!0x1,this['_setSelectedAnnotations'](_0x1e1838),this['setActiveAnnotation'](_0x1e1838[0x0]||null));}),this['listenTo'](_0x5d4812,'blur',(_0x2b783b,{isAnnotationTracked:_0x1f99a9})=>{this['activeAnnotation']&&_0x1f99a9(this['activeAnnotation'])&&(this['_setSelectedAnnotations']([]),this['setActiveAnnotation'](null));}),this['listenTo'](_0x5d4812,'uiUpdate',()=>{this['_refreshVisibilityDebounced']();}),this['listenTo'](this['editor']['ui']['focusTracker'],'change:isFocused',(_0x3e9e92,_0x23f38f,_0x480379)=>{_0x480379||this['setActiveAnnotation'](null);}),this['listenTo'](_0x1e5221,'remove',(_0x2eaecc,_0x3b7c17)=>{this['_removeAnnotationFromBalloon'](_0x3b7c17),_0x3b7c17===this['activeAnnotation']&&this['setActiveAnnotation'](null);}),this['listenTo'](_0x15ef38,'change:visibleView',(_0x129c0e,_0x2ff972,_0x3fe69e,_0xbe01cd)=>{_0xbe01cd&&this['stopListening'](_0xbe01cd);const _0x38f164=_0x1e5221['getByView'](_0x3fe69e);_0x3fe69e&&_0x38f164&&(this['listenTo'](_0x3fe69e,'change:height',()=>{_0x15ef38['updatePosition']();}),this['listenTo'](_0x3fe69e,'Esc',()=>{this['_closeAnnotation'](_0x38f164),this['editor']['editing']['view']['focus']();}),this['activeAnnotation']!==_0x38f164&&this['setActiveAnnotation'](_0x38f164));}),this['listenTo'](this['editor']['ui'],'update',()=>{_0x15ef38['visibleView']&&_0x1e5221['getByView'](_0x15ef38['visibleView'])&&_0x15ef38['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 _0x237693('inlineannotations-detach-not-attached',this);this['setActiveAnnotation'](null);for(const _0x301b5d of this['_addedAnnotations'])this['_removeAnnotationFromBalloon'](_0x301b5d);this['_refreshVisibilityDebounced']['cancel'](),this['stopListening'](),this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach'](),this['_refreshVisibilityDebounced']['cancel']();}_setSelectedAnnotations(_0xdb3e0c){for(const _0xb9e297 of this['_selectedAnnotations'])_0xdb3e0c['includes'](_0xb9e297)||this['_manuallyClosed']['delete'](_0xb9e297);for(const _0x565faa of this['annotations'])_0xdb3e0c['includes'](_0x565faa)||this['_removeAnnotationFromBalloon'](_0x565faa);if(this['editor']['ui']['focusTracker']['isFocused']){for(const _0x46a3b9 of _0xdb3e0c)this['_addAnnotationToBalloon'](_0x46a3b9);}this['_selectedAnnotations']=_0xdb3e0c;}_addAnnotationToBalloon(_0x1b8fd2,_0x23dc3a=!0x1){this['_manuallyClosed']['has'](_0x1b8fd2)||(this['_addedAnnotations']['has'](_0x1b8fd2)||this['_balloon']['hasView'](_0x1b8fd2['view'])||(this['_addedAnnotations']['add'](_0x1b8fd2),this['_balloon']['add']({'stackId':_0x1b8fd2['view']['id'],'view':_0x1b8fd2['view'],'position':{'target':()=>this['_getBalloonTargetForAnnotation'](_0x1b8fd2)}})),_0x23dc3a&&this['_balloon']['showStack'](_0x1b8fd2['view']['id']));}_getBalloonTargetForAnnotation(_0x4524c4){const _0x3d224d=_0x4524c4['target'],_0x3431c6=this['editor']['editing']['view'],_0x4bc73b=_0x3431c6['document']['selection']['getFirstRange'](),_0x310d2a=_0x3431c6['domConverter']['viewRangeToDom'](_0x4bc73b);if(_0x310d2a['collapse'](!0x0),_0x3d224d){if(_0x3d224d instanceof _0x7454d6)return _0x3d224d;let _0x2c1ff2=[];for(const _0x2373d1 of _0x3d224d)_0x2c1ff2['push'](..._0x7454d6['getDomElementRects'](_0x2373d1));_0x2c1ff2=function(_0x119e02){const _0x560831=[];let _0x1c33f8=_0x119e02[0x0];for(let _0x48ee42=0x1;_0x48ee42<_0x119e02['length'];_0x48ee42++)if(Xe(_0x1c33f8,_0x119e02[_0x48ee42])){const _0x10a93d=_0x119e02[_0x48ee42]['width'];_0x1c33f8['width']+=_0x10a93d,_0x1c33f8['right']+=_0x10a93d;}else _0x560831['push'](_0x1c33f8),_0x1c33f8=_0x119e02[_0x48ee42];return _0x560831['push'](_0x1c33f8),_0x560831;}(_0x2c1ff2);const _0x1201e4=_0x310d2a['getBoundingClientRect']();return _0x2c1ff2['find'](_0x296a10=>_0x296a10['top']<=_0x1201e4['top']&&_0x296a10['bottom']>=_0x1201e4['bottom']&&_0x296a10['left']<=_0x1201e4['left']&&_0x296a10['right']>=_0x1201e4['right'])||_0x2c1ff2[0x0];}return _0x4524c4['targetRect']||_0x310d2a;}_removeAnnotationFromBalloon(_0xc320da){this['_addedAnnotations']['has'](_0xc320da)&&this['_balloon']['hasView'](_0xc320da['view'])&&(this['_addedAnnotations']['delete'](_0xc320da),this['_balloon']['remove'](_0xc320da['view']));}_closeAnnotation(_0x31fc21){this['_manuallyClosed']['add'](_0x31fc21),this['_removeAnnotationFromBalloon'](_0x31fc21);}};function Xe(_0x4d00bb,_0x2adc83){return _0x4d00bb['top']===_0x2adc83['top']&&_0x4d00bb['bottom']===_0x2adc83['bottom']&&_0x4d00bb['right']===_0x2adc83['left'];}var qe=class extends wt{['focusTracker'];['focusCycler'];_annotationViews;constructor(_0x261206,_0x4effa8){super(_0x261206),this['set']('isEmpty',!_0x4effa8['length']),this['focusTracker']=new _0xf91994(),this['_annotationViews']=_0x4effa8,this['_annotationViews']['delegate']('arrowup','arrowdown')['to'](this),this['on']('arrowup',()=>{this['focusCycler']['focusPrevious']();}),this['on']('arrowdown',()=>{this['focusCycler']['focusNext']();}),this['focusCycler']=new dt({'focusables':_0x4effa8,'focusTracker':this['focusTracker']}),this['listenTo'](_0x4effa8,'add',()=>{this['isEmpty']=!0x1;}),this['listenTo'](_0x4effa8,'remove',(_0x274221,_0x49366c)=>{_0x49366c['isActive']&&this['focus'](),_0x4effa8['length']||(this['isEmpty']=!0x0);});const _0x557236=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'dir':'auto','class':['ck','ck-comments-archive'],'tabindex':-0x1,'role':'list','aria-label':Vt(_0x261206,'COMMENTS_ARCHIVE_LIST_LABEL')},'children':[{'tag':'div','attributes':{'class':['ck-comments-archive__content'],'role':'presentation'},'children':[{'tag':'div','attributes':{'role':'presentation'},'children':_0x4effa8},{'tag':'p','attributes':{'class':['ck-comments-archive__info',_0x557236['if']('isEmpty','ck-hidden',_0x135010=>!_0x135010)]},'children':[{'text':Vt(_0x261206,'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 _0x256baf of this['_annotationViews'])this['focusTracker']['add'](_0x256baf['element']);this['_annotationViews']['on']('change',(_0x5c6e0e,{added:_0x25c712,removed:_0x537bb3})=>{for(const _0x474eb5 of _0x25c712)this['focusTracker']['add'](_0x474eb5['element']);for(const _0x10d6e4 of _0x537bb3)this['focusTracker']['remove'](_0x10d6e4['element']);});}},$e=class extends _0x44c171{static get['pluginName'](){return'CommentsArchive';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[we,me];}constructor(_0x57cea2){super(_0x57cea2),this['archivedThreads']=new _0x28de1d();}init(){const _0x3ddb05=this['context'],_0x38b1d8=_0x3ddb05['plugins']['get'](we),_0x43f165=_0x3ddb05['plugins']['get'](me);this['listenTo'](_0x38b1d8,'addCommentThread',(_0xa1a2b4,{threadId:_0x562f9d})=>{const _0x464295=_0x38b1d8['getCommentThread'](_0x562f9d);_0x464295['archivedAt']&&this['archivedThreads']['add'](_0x464295,this['_calculatePosition'](_0x464295['archivedAt'])),this['listenTo'](_0x464295,'change:archivedAt',(_0x51b2a2,_0x23697,_0x2c2837)=>{_0x2c2837?this['archivedThreads']['has'](_0x464295)||this['archivedThreads']['add'](_0x464295,this['_calculatePosition'](_0x464295['archivedAt'])):this['archivedThreads']['has'](_0x464295)&&this['archivedThreads']['remove'](_0x464295);});}),this['listenTo'](_0x38b1d8,'removeCommentThread',(_0x299ef8,{threadId:_0x248dde})=>{const _0x9d5f8e=_0x38b1d8['getCommentThread'](_0x248dde);this['stopListening'](_0x9d5f8e),this['archivedThreads']['has'](_0x9d5f8e)&&this['archivedThreads']['remove'](_0x9d5f8e);},{'priority':'highest'}),this['listenTo'](_0x43f165['collection'],'focus',(_0x1b3eaf,_0x5f5f3a)=>{_0x5f5f3a['isVisible']||(_0x5f5f3a['isActive']=!0x0,_0x43f165['activate'](_0x5f5f3a));});}_calculatePosition(_0x539e94){const _0x5e200b=[...this['archivedThreads']]['findIndex'](_0x10e4bc=>_0x10e4bc['archivedAt']<_0x539e94);return _0x5e200b>-0x1?_0x5e200b:this['archivedThreads']['length'];}},je=class extends _0x2422cd{commentsArchiveView;annotationViews;['_pendingThreads'];static get['pluginName'](){return'CommentsArchiveUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[$e,rt];}constructor(_0x1cb99e){super(_0x1cb99e),this['annotationViews']=new gt(),this['_pendingThreads']=[];}init(){const _0x27f7b4=this['editor'],_0x2e4c16=this['_hideDialogOnAnnotationEscape']['bind'](this);_0x27f7b4['ui']['componentFactory']['add']('commentsArchive',()=>this['_createCommentsArchiveButton'](nt,!0x0)),_0x27f7b4['ui']['componentFactory']['add']('menuBar:commentsArchive',()=>{const _0x494736=this['_createCommentsArchiveButton'](pt);return _0x494736['set']({'role':'menuitemcheckbox'}),_0x494736;});const _0x3f31e7=_0x27f7b4['plugins']['get']($e),_0x18b6f8=_0x27f7b4['plugins']['get']('Annotations'),_0x3f4940=_0x27f7b4['plugins']['get']('CommentsRepository');_0x3f31e7['archivedThreads']['forEach'](_0x275c88=>{this['_handleNewThread'](_0x275c88);}),this['listenTo'](_0x3f31e7['archivedThreads'],'add',(_0x3e79dd,_0x3f2779)=>{this['_handleNewThread'](_0x3f2779);}),this['listenTo'](_0x18b6f8['collection'],'add',(_0x2de791,_0x475ff8)=>{const _0x1f11ac=this['_pendingThreads']['find'](_0x3edf96=>{const _0x4d504e=_0x3f4940['_threadToController']['get'](_0x3edf96);return _0x4d504e&&_0x475ff8['innerView']===_0x4d504e['view'];});if(_0x1f11ac){const _0x226550=this['_calculatePosition'](_0x1f11ac['archivedAt']);this['_addAnnotationToArchive'](_0x475ff8,_0x226550),this['_pendingThreads']['splice'](this['_pendingThreads']['indexOf'](_0x1f11ac),0x1);}}),this['listenTo'](_0x3f31e7['archivedThreads'],'remove',(_0x1d527c,_0x1113e1)=>{const _0x11fe55=_0x27f7b4['config']['get']('collaboration.channelId');if(!_0x11fe55||_0x1113e1['channelId']===_0x11fe55){if(this['_pendingThreads']['includes'](_0x1113e1))this['_pendingThreads']['splice'](this['_pendingThreads']['indexOf'](_0x1113e1),0x1);else{const _0x3fcc90=_0x3f4940['_threadToController']['get'](_0x1113e1),_0x13a649=_0x18b6f8['getByInnerView'](_0x3fcc90['view']);this['annotationViews']['remove'](_0x13a649['view']),this['stopListening'](_0x13a649),this['stopListening'](_0x13a649['focusableElements']);}}}),this['listenTo'](_0x18b6f8['collection'],'add',(_0x39f867,_0x2b260b)=>{this['listenTo'](_0x2b260b,'escape',_0x2e4c16);}),this['listenTo'](_0x18b6f8['collection'],'remove',(_0x41649f,_0xfffef0)=>{this['stopListening'](_0xfffef0,'escape',_0x2e4c16);});}_addAnnotationToArchive(_0x482b88,_0xa822bb){this['listenTo'](_0x482b88,'set:isVisible',_0x2c27ed=>{_0x2c27ed['return']=!0x1,_0x2c27ed['stop']();}),this['annotationViews']['add'](_0x482b88['view'],_0xa822bb);}['_handleNewThread'](_0x179b2c){const _0x412112=this['editor']['plugins']['get']('CommentsRepository'),_0x43a444=this['editor']['plugins']['get']('Annotations'),_0x517d4f=this['editor']['config']['get']('collaboration.channelId');if(!_0x517d4f||_0x179b2c['channelId']===_0x517d4f){const _0x1b05e0=_0x412112['_threadToController']['get'](_0x179b2c);if(!_0x1b05e0)return void this['_pendingThreads']['push'](_0x179b2c);const _0x46493b=this['_calculatePosition'](_0x179b2c['archivedAt']),_0x3582a7=_0x43a444['getByInnerView'](_0x1b05e0['view']);_0x3582a7['isVisible']&&_0x43a444['_visibleAnnotations']['remove'](_0x3582a7),this['_addAnnotationToArchive'](_0x3582a7,_0x46493b);}}_calculatePosition(_0x121cc0){const _0x35fb70=this['editor']['config']['get']('collaboration.channelId'),_0x148eae=[...this['editor']['plugins']['get']($e)['archivedThreads']]['filter'](_0x186d04=>_0x186d04['channelId']===_0x35fb70)['findIndex'](_0x9d07c8=>_0x9d07c8['archivedAt']<_0x121cc0);return _0x148eae<0x0||_0x148eae>this['annotationViews']['length']?this['annotationViews']['length']:_0x148eae-0x1;}_toggleDialog(){const _0x1c574c=this['editor'],_0x2c6622=_0x1c574c['plugins']['get']('Dialog');this['commentsArchiveView']||(this['commentsArchiveView']=new qe(_0x1c574c['locale'],this['annotationViews'])),'commentsArchive'===_0x2c6622['id']?_0x2c6622['hide']():_0x2c6622['show']({'id':'commentsArchive','title':Vt(_0x1c574c['locale'],'COMMENTS_ARCHIVE'),'hasCloseButton':!0x0,'content':this['commentsArchiveView'],'position':ht['EDITOR_TOP_SIDE']});}_createCommentsArchiveButton(_0x1b77ef,_0x46b0a1=!0x1){const _0x2e0a37=this['editor']['locale'],_0x49e667=this['editor']['plugins']['get']('Dialog'),_0x4206e5=new _0x1b77ef(_0x2e0a37);return _0x4206e5['bind']('isEnabled')['to'](this,'isEnabled'),_0x4206e5['bind']('isOn')['to'](_0x49e667,'id',_0x54902c=>'commentsArchive'===_0x54902c),_0x4206e5['set']({'label':Vt(_0x2e0a37,'COMMENTS_ARCHIVE'),'icon':_0x6de929,'isToggleable':!0x0}),_0x46b0a1&&(_0x4206e5['tooltip']=!0x0),this['listenTo'](_0x4206e5,'execute',()=>this['_toggleDialog']()),_0x4206e5;}_hideDialogOnAnnotationEscape=_0x40f971=>{const _0x41ca12=_0x40f971['source'];if(!this['annotationViews']['has'](_0x41ca12['view']))return;const _0x4aa670=this['editor']['plugins']['get']('Dialog');_0x4aa670['isOpen']&&'commentsArchive'===_0x4aa670['id']&&(_0x4aa670['hide'](),_0x40f971['stop']());};},ze=class extends _0x2422cd{static get requires(){return[we,Ne,xe,$e,je,Se,We,Ge,Ye];}static get['pluginName'](){return'Comments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{Te as AddCommentThreadCommand,he as Annotation,ce as AnnotationCollection,Ke as AnnotationCounterButtonView,oe as AnnotationView,me as Annotations,Be as AnnotationsSidebarItemView,De as AnnotationsSidebarView,Pe as AnnotationsUIs,Jt as BaseCommentThreadView,ee as BaseCommentView,Ae as Comment,ge as CommentThread,Dt as CommentThreadController,Gt as CommentThreadInputView,Zt as CommentThreadView,se as CommentView,ze as Comments,$e as CommentsArchive,je as CommentsArchiveUI,Ne as CommentsEditing,Xt as CommentsListView,Se as CommentsOnly,we as CommentsRepository,xe as CommentsUI,ye as EditorAnnotations,Ye as InlineAnnotations,Ge as NarrowSidebar,He as Sidebar,We as WideSidebar,de as bindAnnotationCollections};
|
|
23
|
+
import{Command as _0x212797,Context as _0x3e7b8b,ContextPlugin as _0x1e3609,Editor as _0x24d303,PendingActions as _0x5e2b33,Plugin as _0x287b4d}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x53d35c,Collection as _0x4c91ff,DomEmitterMixin as _0x42ebb1,FocusTracker as _0x494444,KeystrokeHandler as _0x55993b,ObservableMixin as _0x5aa6b5,Rect as _0x5bd772,ResizeObserver as _0x84e955,containsNode as _0x381f75,diff as _0x4a8215,first as _0x1fdfb2,getActiveElement as _0x319a29,getEnvKeystrokeText as _0xed4ba7,getOverlayMountRoot as _0xe515f4,keyCodes as _0x49ec23,priorities as _0x50a307,scrollViewportToShowTarget as _0x4886c6,toUnit as _0x4fc79b,trustedHtml as _0x118aa0,uid as _0x3109c5}from'@ckeditor/ckeditor5-utils';import{AriaDescriptionView as _0x488756,ConfirmMixin as _0xcb9c17,FOCUS_ANNOTATION_KEYSTROKE as _0x277714,LateFocusButtonView as _0x11e49b,LateFocusDropdownButtonView as _0x292a5f,UserView as _0x58b1a5,Users as _0x1e93c2,getAllMarkersDomElementsSorted as _0x35fdd9,getDateTimeFormatter as _0x29a199,hashObject as _0x454306,setupThreadKeyboardNavigation as _0x24e4b2,surroundingMarkersDetector as _0x168bc5,trimHtml as _0x3ff4dd}from'@ckeditor/ckeditor5-collaboration-core';import{cloneDeep as _0x31900c,debounce as _0x52fb1a,isEqual as _0x1a79c4,set as _0x1976cd,throttle as _0x4fe97b,unset as _0x316b96}from'es-toolkit/compat';import{IconAddComment as _0x2db4bb,IconCheck as _0x3ecf6a,IconComments as _0x3f9088,IconCommentsArchive as _0x4d0228,IconDropdownArrow as _0x57bcf8,IconPencil as _0x4caeb4,IconRemoveComment as _0xac1bf4,IconThreeVerticalDots as _0x277813,IconTrackChanges as tt,IconUndo as et,IconUnlink as it}from'@ckeditor/ckeditor5-icons';import{BalloonPanelView as st,ButtonView as nt,ContextualBalloon as ot,Dialog as rt,DialogViewPosition as ht,EditorUI as at,EditorUIView as ct,FocusCycler as dt,IconView as lt,InlineEditableUIView as mt,ListItemView as ut,ListView as ft,MenuBarMenuListItemButtonView as pt,OverlayHost as _t,View as wt,ViewCollection as gt,clickOutsideHandler as At,createDropdown as vt,focusChildOnDropdownOpen as Tt}from'@ckeditor/ckeditor5-ui';import{MouseObserver as yt,disableViewPlaceholder as Ct,enableViewPlaceholder as It}from'@ckeditor/ckeditor5-engine';import{Clipboard as bt,ClipboardMarkersUtils as Et,ClipboardPipeline as kt}from'@ckeditor/ckeditor5-clipboard';import{Enter as Nt,ShiftEnter as Ot}from'@ckeditor/ckeditor5-enter';import{SelectAll as Mt}from'@ckeditor/ckeditor5-select-all';import{Typing as Rt}from'@ckeditor/ckeditor5-typing';import{Undo as xt}from'@ckeditor/ckeditor5-undo';import{Paragraph as St}from'@ckeditor/ckeditor5-paragraph';import{toWidget as Pt}from'@ckeditor/ckeditor5-widget';const Lt=/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x5aa6b5();var Dt=class extends Lt{['model'];['view'];constructor(_0x3c9940,_0x49f93c){super(),this['model']=_0x3c9940,this['model']['_isAttached']=!0x0,this['view']=_0x49f93c,this['listenTo'](_0x49f93c,'submitCommentThread',()=>this['submit']()),this['listenTo'](_0x49f93c,'removeCommentThread',()=>this['remove']()),this['listenTo'](_0x49f93c,'resolveCommentThread',()=>this['resolve']()),this['listenTo'](_0x49f93c,'reopenCommentThread',()=>this['reopen']()),this['listenTo'](_0x49f93c,'addComment',(_0x50a18b,_0x37aca3)=>this['addComment'](_0x37aca3)),this['listenTo'](_0x49f93c,'updateComment',(_0x27e51c,_0x3ba82c,_0x339e86)=>this['updateComment'](_0x3ba82c,_0x339e86)),this['listenTo'](_0x49f93c,'removeComment',(_0x5ad922,_0x4d7cc3)=>this['removeComment'](_0x4d7cc3));}submit(){this['model']['submit']();}['remove'](){this['model']['remove']();}['resolve'](){this['model']['isResolved']||this['model']['resolve']();}['reopen'](){this['model']['isResolved']&&this['model']['reopen']();}addComment(_0x12ed4a){this['model']['addComment']({'content':_0x12ed4a,'authorId':this['view']['_localUser']['id']});}updateComment(_0x5015c1,_0x271c8c){this['model']['getComment'](_0x5015c1)['update']({'content':_0x271c8c});}removeComment(_0x289512){this['model']['getComment'](_0x289512)['remove']();}destroy(){this['stopListening'](),this['model']['_isAttached']=!0x1;}};function Vt(_0x4bca14,_0x3f893e,_0x22dda0){const t=_0x4bca14['t'];switch(_0x3f893e){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'},_0x22dda0);case'THREAD_CONTEXT_UNLINKED_LABEL':return t({'string':'Thread\x20context\x20removed\x20from\x20the\x20document:\x20%0','id':'THREAD_CONTEXT_UNLINKED_LABEL'},_0x22dda0);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'},_0x22dda0);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'},_0x22dda0);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'},_0x22dda0);case'NUMBER_OF_COMMENTS':return t({'string':'Show\x20%0\x20comment','plural':'Show\x20%0\x20comments','id':'NUMBER_OF_COMMENTS'},_0x22dda0);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'},_0x22dda0);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'},_0x22dda0);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'},_0x22dda0);case'COMMENTS_ARCHIVE':return t({'string':'Comments\x20archive','id':'COMMENTS_ARCHIVE'});case'EMPTY_COMMENTS_ARCHIVE':return t({'string':'There\x20are\x20no\x20archived\x20comment\x20threads.','id':'EMPTY_COMMENTS_ARCHIVE'});case'COMMENTS_ARCHIVE_LIST_LABEL':return t({'string':'List\x20of\x20comments','id':'COMMENTS_ARCHIVE_LIST_LABEL'});case'ACCESSIBILITY_HELP_ANNOTATIONS_GROUP':return t({'string':'Keystrokes\x20for\x20interacting\x20with\x20annotation\x20threads\x20(e.g.\x20comments,\x20track\x20changes\x20suggestions)','id':'ACCESSIBILITY_HELP_ANNOTATIONS_GROUP'});case'ACCESSIBILITY_HELP_ANNOTATIONS_MOVE_TO':return t({'string':'Move\x20focus\x20to\x20the\x20thread\x20when\x20the\x20selection\x20is\x20anchored\x20in\x20its\x20marker','id':'ACCESSIBILITY_HELP_ANNOTATIONS_MOVE_TO'});case'ACCESSIBILITY_HELP_ANNOTATIONS_EXIT':return t({'string':'Exit\x20the\x20annotation\x20and\x20move\x20focus\x20back\x20to\x20the\x20edited\x20content','id':'ACCESSIBILITY_HELP_ANNOTATIONS_EXIT'});case'ACCESSIBILITY_HELP_ANNOTATIONS_ENTER':return t({'string':'Browse\x20the\x20focused\x20annotation\x20thread\x20or\x20thread\x20comment','id':'ACCESSIBILITY_HELP_ANNOTATIONS_ENTER'});case'ACCESSIBILITY_HELP_ANNOTATIONS_BROWSE_GROUPS':return t({'string':'Move\x20across\x20internals\x20of\x20the\x20annotation\x20thread','id':'ACCESSIBILITY_HELP_ANNOTATIONS_BROWSE_GROUPS'});case'ACCESSIBILITY_HELP_ANNOTATIONS_SUBMIT_COMMENT':return t({'string':'Submit\x20the\x20reply\x20while\x20writing\x20a\x20comment','id':'ACCESSIBILITY_HELP_ANNOTATIONS_SUBMIT_COMMENT'});case'ACCESSIBILITY_HELP_ANNOTATIONS_NAVIGATE_THREADS':return t({'string':'Move\x20to\x20the\x20previous\x20or\x20next\x20thread\x20in\x20the\x20annotations\x20sidebar\x20or\x20comments\x20archive','id':'ACCESSIBILITY_HELP_ANNOTATIONS_NAVIGATE_THREADS'});default:return'';}}var Bt=class extends ct{['main'];editable;constructor(_0x5d6404,_0x53efd8){super(_0x5d6404);const _0x54916a=_0x3109c5();this['main']=this['createCollection'](),this['editable']=new mt(_0x5d6404,_0x53efd8,void 0x0,{'label':()=>Vt(_0x5d6404,'Comment\x20editor')}),this['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-editor','ck-rounded-corners','ck-comment__input'],'dir':_0x5d6404['uiLanguageDirection'],'lang':_0x5d6404['uiLanguage'],'aria-labelledby':'cke-editor__aria-label_'+_0x54916a},'children':[{'tag':'div','attributes':{'class':'ck-editor__main','role':'presentation'},'children':this['main']}]});}['render'](){super['render'](),this['main']['add'](this['editable']);}['focus'](){this['editable']['element']['focus']();}},Ht=class extends at{['view'];constructor(_0xa0449c){super(_0xa0449c),this['view']=new Bt(_0xa0449c['locale'],_0xa0449c['editing']['view']);}get element(){return this['view']['element'];}init(){const _0x1a3d14=this['editor']['editing']['view'],_0x326a81=this['view']['editable'];_0x326a81['name']=_0x1a3d14['document']['getRoot']()['rootName'],this['view']['render']();const _0x3625be=_0x326a81['element'];this['setEditableElement'](_0x326a81['name'],_0x3625be),this['view']['editable']['bind']('isFocused')['to'](this['focusTracker']),_0x1a3d14['attachDomRoot'](_0x3625be),this['fire']('ready');}destroy(){super['destroy'](),this['view']['destroy']();}};const Ut=[bt,Nt,Ot,Mt,Rt,xt,St],Ft=/* #__PURE__ -- @preserve */
|
|
25
|
+
_0x5aa6b5(_0x24d303);var Wt=class CommentEditor extends Ft{static defaultPlugins=/* #__PURE__ -- @preserve */
|
|
26
|
+
((()=>Ut)());constructor(_0x4b7597={}){(_0x4b7597=Object['assign']({},_0x4b7597))['plugins']||(_0x4b7597['plugins']=CommentEditor['defaultPlugins']),super(_0x4b7597),this['ui']=new Ht(this),this['set']('placeholder',''),this['model']['document']['on']('change',()=>this['_updatePlaceholder'](),{'priority':'low'}),this['on']('change:placeholder',()=>this['_updatePlaceholder']()),this['model']['document']['createRoot'](),this['editing']['view']['_overlayModeHint']='auto',this['_sendUsageRequest']=()=>window['Promise']['resolve']({'status':'ok'});}create(){const _0x213f0c=this['config']['get']('initialData')||'';return this['initPlugins']()['then'](()=>this['ui']['init']())['then'](()=>this['data']['init'](_0x213f0c))['then'](()=>this['fire']('ready'));}destroy(){return super['destroy']()['then'](()=>this['ui']['destroy']());}['focus'](){this['model']['change'](_0x4bbe97=>{const _0xbb1e30=this['model']['document']['getRoot'](),_0x1703f9=_0xbb1e30&&_0xbb1e30['getChild'](_0xbb1e30['childCount']-0x1);_0x4bbe97['setSelection'](_0x1703f9,'end'),this['editing']['view']['focus']();});}_updatePlaceholder(){const _0x557859=this['editing']['view'],_0x3a9452=_0x557859['document']['getRoot'](),_0x292253=_0x3a9452['getChild'](0x0);_0x3a9452['childCount']>0x1||!_0x292253||'p'!=_0x292253['name']?this['placeholderElement']&&this['placeholderElement']['placeholder']&&(Ct(_0x557859,this['placeholderElement']),this['placeholderElement']=void 0x0):(this['placeholder']&&(_0x292253['placeholder']=this['placeholder']),It({'view':_0x557859,'element':_0x292253,'keepOnFocus':!0x0}),this['placeholderElement']=_0x292253);}},Kt=class extends wt{keystrokes;['focusTracker'];['focusables'];['focusCycler'];submitButtonView;cancelButtonView;_editorConfig;constructor(_0x39c2df,_0x122ff0={}){super(_0x39c2df),this['editor']=null,this['_editorConfig']=_0x122ff0,this['set']('value',_0x122ff0['initialData']||''),this['set']('disabledSubmit',!0x1),this['set']('showButtons',!0x0),this['set']('placeholder',Vt(_0x39c2df,'Reply...')),this['set']('submitLabel',Vt(_0x39c2df,'Reply')),this['submitButtonView']=this['_createSubmitButton'](),this['cancelButtonView']=this['_createCancelButton'](),this['focusables']=this['createCollection']([this['cancelButtonView'],this['submitButtonView']]),this['keystrokes']=new _0x55993b(),this['focusTracker']=new _0x494444(),this['focusCycler']=new dt({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x812dce=>!_0x812dce['defaultPrevented']},'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['setTemplate']({'tag':'div','attributes':{'class':['ck-comment__input-wrapper']},'children':[{'tag':'div','attributes':{'class':['ck-comment__input-actions',this['bindTemplate']['if']('showButtons','ck-comment__input-actions--active')]},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),this['keystrokes']['set']('Esc',(_0x1e026d,_0x2aceb6)=>{this['cancelButtonView']['fire']('execute'),_0x2aceb6();}),this['keystrokes']['set']('Ctrl+Enter',(_0x2bb36b,_0x558d7c)=>{this['submitButtonView']['isEnabled']&&(this['submitButtonView']['fire']('execute'),_0x558d7c());}),this['on']('submit',(_0x32e7d2,_0x2640cf)=>{_0x2640cf['length']>0xfde8?(alert(Vt(_0x39c2df,'TOO_LONG_COMMENT_ALERT',[_0x2640cf['length'],0xfde8])),_0x32e7d2['stop']()):this['editor']['setData']('');},{'priority':'high'});}['render'](){super['render'](),this['_setupKeyboardNavigation']();}createEditor(){return this['editor']||(this['editor']=new Wt(this['_editorConfig']),this['_editorCreationPromise']=this['editor']['create']()['then'](()=>{if(this['_isDestroyed'])return;const _0x57d043=this['editor'];this['element']['insertBefore'](_0x57d043['ui']['element'],this['element']['firstChild']),_0x57d043['model']['document']['on']('change',()=>this['value']=_0x57d043['getData']()),_0x57d043['bind']('placeholder')['to'](this),this['focusables']['add'](_0x57d043['ui']['view'],0x0),this['fire']('editorReady',this['editor']);})),this['_editorCreationPromise'];}['focus'](_0x696315){-0x1===_0x696315?(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:_0x131c5b}=this,_0x2c8502=new nt(_0x131c5b);return _0x2c8502['extendTemplate']({'attributes':{'class':['ck-button-action','ck-button_small','ck-comment__input-actions--submit']}}),_0x2c8502['withText']=!0x0,_0x2c8502['bind']('label')['to'](this,'submitLabel'),_0x2c8502['on']('execute',()=>{this['fire']('submit',this['value']);}),_0x2c8502['bind']('isEnabled')['to'](this,'value',this,'disabledSubmit',(_0xedf1d9,_0x47ffbb)=>!_0x47ffbb&&!!_0xedf1d9['trim']()),_0x2c8502;}_createCancelButton(){const {locale:_0x5bc508}=this,_0x269788=new nt(_0x5bc508);return _0x269788['extendTemplate']({'attributes':{'class':['ck-button_small','ck-comment__input-actions--cancel']}}),_0x269788['label']=Vt(_0x5bc508,'Cancel'),_0x269788['withText']=!0x0,_0x269788['on']('execute',()=>{this['editor']['setData'](''),this['fire']('cancel');}),_0x269788;}_setupKeyboardNavigation(){this['keystrokes']['listenTo'](this['element']),this['focusables']['forEach'](_0xe8aea1=>{this['focusTracker']['add'](_0xe8aea1['element']);}),this['focusables']['on']('change',(_0x27d6d5,_0x5c6125)=>{for(const _0x2df14e of Array['from'](_0x5c6125['added'])['reverse']())this['focusTracker']['add'](_0x2df14e['element']);});}},Gt=class extends wt{constructor(_0x24b218,_0x245989,_0x13adc3){super(_0x24b218),this['commentInputView']=new Kt(_0x24b218,_0x13adc3),this['focusCycler']=this['commentInputView']['focusCycler'],this['commentInputView']['bind']('showButtons')['to'](this['commentInputView']['focusTracker'],'isFocused',this['commentInputView'],'value',(_0xb9af90,_0x4534b0)=>_0xb9af90||!!_0x4534b0),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 _0x58b1a5(_0x24b218,_0x245989),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','ck-reset_all-excluded',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'](_0x35bb7d){this['commentInputView']['focus'](_0x35bb7d);}_focusOnNonInteractiveMouseDown(){this['listenTo'](this['element'],'mousedown',(_0x8d16a8,_0x48a6e1)=>{const {submitButtonView:_0x153c0b,cancelButtonView:_0x25fa90,editor:_0x5455a5}=this['commentInputView'];[_0x153c0b['element'],_0x25fa90['element'],_0x5455a5?_0x5455a5['editing']['view']['getDomRoot']():null]['filter'](_0x50f7c5=>_0x50f7c5)['some'](_0x584390=>_0x381f75(_0x584390,_0x48a6e1['target']))||(this['focus'](),_0x48a6e1['preventDefault']());});}},Yt=class extends wt{revealButtonView;constructor(_0x450b06){super(_0x450b06),this['set']('count',void 0x0);const _0x275a7d=this['revealButtonView']=new nt(_0x450b06);_0x275a7d['icon']=_0x57bcf8,_0x275a7d['withText']=!0x0,_0x275a7d['bind']('label')['to'](this,'count',_0x499fb8=>Vt(_0x450b06,'NUMBER_OF_COMMENTS',_0x499fb8)),_0x275a7d['extendTemplate']({'attributes':{'class':'ck-button_small'}}),this['setTemplate']({'tag':'li','attributes':{'class':'ck-thread__comment-count'},'children':[_0x275a7d]});}},Xt=class extends wt{commentViews;resolvedCommentView;['focusTracker'];keystrokes;['focusCycler'];['_model'];['_config'];_collapsedCommentsView;constructor(_0x46226c,_0x1c7ed6,_0x214fbc){super(_0x46226c);const _0x533771=this['bindTemplate'];this['set']('hasDirtyComment',!0x1),this['set']('length',_0x1c7ed6['comments']['length']),this['set']('isActive',!0x1),this['set']('isExpandedByUser',!0x1),this['_model']=_0x1c7ed6,this['_config']=_0x214fbc,this['commentViews']=this['createCollection'](),this['visibleViews']=this['createCollection'](),this['resolvedCommentView']=null,this['focusTracker']=new _0x494444(),this['keystrokes']=new _0x55993b(),this['focusCycler']=new dt({'focusables':this['commentViews'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x17c7f6=>this['commentViews']['map'](_0x441ac6=>_0x441ac6['element'])['includes'](_0x17c7f6['target'])},'actions':{'focusPrevious':'arrowup','focusNext':'arrowdown'}}),this['_collapsedCommentsView']=new Yt(_0x46226c),this['_collapsedCommentsView']['bind']('count')['to'](this,'length',_0x48bfcf=>_0x48bfcf-this['_config']['maxCommentsWhenCollapsed']),this['listenTo'](this['_collapsedCommentsView']['revealButtonView'],'execute',()=>{this['isExpandedByUser']=!0x0;});for(const _0x4419ee of _0x1c7ed6['comments'])this['_handleNewCommentModel'](_0x4419ee);this['_handleInfoComment'](),this['listenTo'](_0x1c7ed6['comments'],'add',(_0x54cbc0,_0x4f6e4f)=>{const _0x3c698a=this['_calculatePosition'](_0x4f6e4f);this['length']++,this['_handleNewCommentModel'](_0x4f6e4f,_0x3c698a),this['refreshVisibleViews']();}),this['listenTo'](_0x1c7ed6['comments'],'remove',(_0x3fe6ce,_0x2832ef)=>{this['length']--,this['_handleRemoveCommentModel'](_0x2832ef),this['refreshVisibleViews']();}),this['listenTo'](_0x1c7ed6,'commentUpdated',()=>this['refreshVisibleViews']()),this['listenTo'](_0x1c7ed6,'change:isResolved',()=>this['_handleInfoComment']()),this['on']('change:isActive',(_0x14e8f3,_0x487927,_0x34886b)=>{_0x34886b||(this['isExpandedByUser']=!0x1),this['refreshVisibleViews']();}),this['on']('change:hasDirtyComment',()=>this['refreshVisibleViews']()),this['on']('change:isExpandedByUser',()=>this['refreshVisibleViews']()),this['setTemplate']({'tag':'ul','attributes':{'class':['ck-thread__comments','ck-reset_all-excluded',_0x533771['if']('length','ck-hidden',_0x1708e1=>!_0x1708e1)],'aria-label':Vt(_0x46226c,'Thread\x20comments')},'children':this['visibleViews']});}get['_shouldCollapse'](){return this['_model']['weight']>this['_config']['maxThreadTotalWeight']&&!this['isActive']&&!this['hasDirtyComment']&&!this['isExpandedByUser'];}['render'](){super['render'](),this['refreshVisibleViews'](),this['_setupKeyboardNavigation']();}['focus'](_0x51538f){-0x1===_0x51538f?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}destroy(){this['_collapsedCommentsView']['destroy']();for(const _0x1ea12f of this['commentViews'])_0x1ea12f['destroy']();super['destroy']();}['refreshVisibleViews'](){this['_shouldCollapse']?this['_rearrangeCollapse']():this['_rearrangeExpand']();}_handleNewCommentModel(_0x1ac69d,_0x1a02ab){const _0x26d5f7=new this['_config']['CommentView'](this['locale'],_0x1ac69d,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig']});_0x26d5f7['viewUid']=_0x1ac69d['id'],_0x26d5f7['delegate']('removeComment')['to'](this),_0x26d5f7['delegate']('updateComment')['to'](this),_0x26d5f7['delegate']('resolveCommentThread')['to'](this),_0x26d5f7['delegate']('editorReady')['to'](this),_0x26d5f7['delegate']('editorDestroyed')['to'](this),this['listenTo'](_0x26d5f7,'change:isEditMode',()=>this['_updateHasDirtyComment']()),this['commentViews']['add'](_0x26d5f7,_0x1a02ab);}_calculatePosition(_0x2cfd76){const _0x408f73=this['_model']['_findOptimalIndex'](_0x2cfd76);return this['resolvedCommentView']?this['resolvedCommentView']['authoredAt']>_0x2cfd76['authoredAt']?_0x408f73-0x1:_0x408f73:_0x408f73-0x1;}_handleInfoComment(){if(this['_model']['resolvedBy']&&this['_model']['resolvedAt']){const _0x38bd4f={'id':'resolved','author':this['_model']['resolvedBy'],'authoredAt':this['_model']['resolvedAt'],'content':Vt(this['locale'],'Marked\x20as\x20resolved'),'attributes':{}};this['resolvedCommentView']=new this['_config']['CommentView'](this['locale'],_0x38bd4f,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig'],'isSystemComment':!0x0}),this['commentViews']['add'](this['resolvedCommentView'],this['_model']['_findOptimalIndex'](_0x38bd4f));}else this['resolvedCommentView']&&(this['commentViews']['remove'](this['resolvedCommentView']),this['resolvedCommentView']['destroy'](),this['resolvedCommentView']=null);this['refreshVisibleViews']();}_handleRemoveCommentModel(_0x5b97fb){const _0x5090f2=this['commentViews']['remove'](_0x5b97fb['id']);this['stopListening'](_0x5090f2),_0x5090f2['isEditMode']&&this['_updateHasDirtyComment'](),_0x5090f2['destroy']();}_updateHasDirtyComment(){this['hasDirtyComment']=Array['from'](this['commentViews'])['some'](_0x27de09=>_0x27de09['isEditMode']);}['_rearrangeCollapse'](){const _0x295916=function(_0x66533a){const _0x4dd019=new _0x4c91ff();for(const _0x2bfb12 of _0x66533a)_0x4dd019['add'](_0x2bfb12);return _0x4dd019;}(this['commentViews']),_0x2b9cc1=this['_collapsedCommentsView']['count'];for(let _0x6497b0=0x1;_0x6497b0<=_0x2b9cc1;_0x6497b0++)_0x295916['remove'](0x1);for(const _0x165db7 of _0x295916)_0x165db7['collapse']();_0x2b9cc1>0x0&&_0x295916['add'](this['_collapsedCommentsView'],0x1),qt(_0x4a8215(Array['from'](this['visibleViews']),Array['from'](_0x295916)),this['visibleViews'],_0x295916);}['_rearrangeExpand'](){const _0x400195=this['_collapsedCommentsView']['revealButtonView']['element'],_0x2a5556=!!_0x400195&&_0x400195['contains'](_0x319a29(_0x400195));qt(_0x4a8215(Array['from'](this['visibleViews']),Array['from'](this['commentViews'])),this['visibleViews'],this['commentViews']);for(const _0x38555e of this['visibleViews'])_0x38555e['expand']();_0x2a5556&&this['commentViews']['get'](0x1)['focus']();}_setupKeyboardNavigation(){this['commentViews']['forEach'](_0x267bc7=>{this['focusTracker']['add'](_0x267bc7['element']),this['keystrokes']['listenTo'](_0x267bc7['element']);}),this['commentViews']['on']('change',(_0xcafd98,_0x2d2450)=>{for(const _0x3da594 of _0x2d2450['removed'])this['focusTracker']['remove'](_0x3da594['element']),this['keystrokes']['stopListening'](_0x3da594['element']);for(const _0x115f9a of Array['from'](_0x2d2450['added'])['reverse']())this['focusTracker']['add'](_0x115f9a['element']),this['keystrokes']['listenTo'](_0x115f9a['element']);});const _0x3786b6=_0x5edfb3=>{const _0x337ac3=this['_collapsedCommentsView']['revealButtonView']['element'];_0x337ac3&&(_0x5edfb3?(this['focusTracker']['add'](_0x337ac3),this['keystrokes']['listenTo'](_0x337ac3)):(this['focusTracker']['remove'](_0x337ac3),this['keystrokes']['stopListening'](_0x337ac3)));};this['listenTo'](this['visibleViews'],'add',(_0x1e38e0,_0x944337)=>{_0x944337===this['_collapsedCommentsView']&&_0x3786b6(!0x0);}),this['listenTo'](this['visibleViews'],'remove',(_0x1f96fc,_0x55943e)=>{_0x55943e===this['_collapsedCommentsView']&&_0x3786b6(!0x1);}),this['visibleViews']['has'](this['_collapsedCommentsView'])&&_0x3786b6(!0x0);}};function qt(_0x19e9f5,_0x3d7ab0,_0x2c1ba6){let _0x25acee=0x0;for(const _0xb83820 of _0x19e9f5)switch(_0xb83820){case'insert':_0x3d7ab0['add'](_0x2c1ba6['get'](_0x25acee),_0x25acee),_0x25acee++;break;case'delete':_0x3d7ab0['remove'](_0x25acee);break;case'equal':_0x25acee++;}}function $t(_0x3d4f1c,_0x13ceea=0x96){const _0x289510=_0x13ceea-0x1;if(_0x3d4f1c['length']<_0x13ceea)return _0x3d4f1c;const _0x7c15c8=_0x3d4f1c['lastIndexOf']('\x20',_0x289510);return _0x3d4f1c['substring'](0x0,_0x7c15c8>-0x1?_0x7c15c8:_0x289510)+'…';}var jt=class extends wt{constructor(_0x56a186){super(_0x56a186);const _0x42fecd=this['bindTemplate'];this['set']('contextValue',''),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-context__value'],'aria-label':_0x42fecd['to']('contextValue',_0xca1389=>Vt(_0x56a186,'THREAD_CONTEXT_LABEL',_0xca1389)),'tabindex':-0x1},'children':[{'text':_0x42fecd['to']('contextValue')}]});}['focus'](){this['element']['focus']();}},zt=class extends wt{['_model'];reopenButtonView;contextView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];constructor(_0xba573a,_0x4a2907){super(_0xba573a);const _0xb23170=this['bindTemplate'];this['_model']=_0x4a2907,this['reopenButtonView']=this['_createReopenButton'](),this['contextView']=this['_createContextView'](),this['focusables']=this['createCollection']([this['contextView'],this['reopenButtonView']]),this['focusTracker']=new _0x494444(),this['keystrokes']=new _0x55993b(),this['focusCycler']=new dt({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['bind']('hasContext')['to'](this['_model'],'context',_0x58bac6=>!!_0x58bac6),this['bind']('contextValue')['to'](this['_model'],'context',_0x27a294=>_0x27a294&&_0x27a294['value']?$t(_0x27a294['value']):Vt(this['locale'],'Comment\x20was\x20made\x20on\x20an\x20element')),this['setTemplate']({'tag':'div','attributes':{'class':['ck-thread__header']},'children':[{'tag':'div','attributes':{'class':['ck-context-wrapper']},'children':[{'tag':'div','attributes':{'class':['ck-context',_0xb23170['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 _0x56f684=new nt(this['locale']);return _0x56f684['label']=Vt(this['locale'],'Reopen'),_0x56f684['tooltip']=Vt(this['locale'],'Reopen'),_0x56f684['icon']=et,_0x56f684['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x119177=>!_0x119177),_0x56f684['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x1ff714,_0x5e9e0a)=>_0x1ff714&&_0x5e9e0a),_0x56f684['on']('execute',()=>{this['fire']('reopenCommentThread',this['_model']['id']);}),_0x56f684;}_attachContextActions(){const _0x38ba4a=this['element']['querySelector']('.ck-context'),_0x2bbe7f=_0x38ba4a['querySelector']('.ck-context__value');this['listenTo'](_0x38ba4a,'mouseenter',()=>{_0x2bbe7f['offsetWidth']<_0x2bbe7f['scrollWidth']&&_0x38ba4a['classList']['add']('overlay');}),this['listenTo'](_0x38ba4a,'mouseleave',()=>{_0x38ba4a['classList']['remove']('overlay');});}_setupKeyboardNavigation(){this['keystrokes']['listenTo'](this['element']);for(const _0x8b2d7a of this['focusables'])this['focusTracker']['add'](_0x8b2d7a['element']),this['keystrokes']['listenTo'](_0x8b2d7a['element']);}_createContextView(){const _0x3e3af3=new jt(this['locale']);return _0x3e3af3['bind']('contextValue')['to'](this),_0x3e3af3;}},Jt=class extends wt{['_model'];['_config'];commentThreadHeaderView;commentThreadInputView;ariaDescriptionView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];constructor(_0x50e3c0,_0x24453e,_0x5093a2,_0x290803){super(_0x50e3c0),this['set']('isActive',!0x1),this['set']('isDirty',!0x1),this['_model']=_0x24453e,this['_localUser']=_0x5093a2,this['_config']=_0x290803,this['commentThreadHeaderView']=new zt(_0x50e3c0,_0x24453e),this['commentThreadHeaderView']['delegate']('reopenCommentThread')['to'](this),this['ariaDescriptionView']=new _0x488756(_0x50e3c0,Vt(_0x50e3c0,'COMMENT_THREAD_DESCRIPTION')),this['listenTo'](this,'reopenCommentThread',()=>{this['focus']();}),this['commentsListView']=new Xt(_0x50e3c0,_0x24453e,Object['assign']({'CommentView':this['_config']['CommentView']},_0x290803)),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',(_0x1e8174,_0x1caac0)=>_0x1e8174||!!_0x1caac0),this['bind']('isUnlinked')['to'](_0x24453e,'unlinkedAt',_0x5803d5=>!!_0x5803d5);let _0x185660=null;const _0x814131=()=>{const _0x3e1b4d=this['_model']['comments']['first']||null;_0x3e1b4d!==_0x185660&&(_0x185660&&this['stopListening'](_0x185660,'change:content'),_0x185660=_0x3e1b4d,_0x3e1b4d&&this['listenTo'](_0x3e1b4d,'change:content',_0x814131));const _0x1ed155=_0x3e1b4d?_0x3e1b4d['author']['name']:this['_localUser']['name'],_0x5cae8e=_0x3e1b4d?new DOMParser()['parseFromString'](_0x118aa0(_0x3ff4dd(_0x3e1b4d['content'],{'limit':this['_config']['maxCommentCharsWhenCollapsed']})),'text/html')['body']['textContent']:'',_0x413e44=Vt(this['locale'],'COMMENT_THREAD_LABEL',[this['length'],_0x1ed155]);this['set']('ariaLabel',_0x5cae8e?_0x413e44+'\x20'+_0x5cae8e:_0x413e44);};this['listenTo'](this['_model']['comments'],'change',_0x814131),_0x814131(),this['focusables']=this['createCollection']([this['commentsListView'],this['commentThreadInputView']]),this['focusTracker']=new _0x494444(),this['keystrokes']=new _0x55993b(),this['focusCycler']=new dt({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x175236=>_0x175236['target']!==this['element']},'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}});}['focus'](){this['element']['focus']();}['render'](){super['render'](),_0x24e4b2(this,this['focusables']);}async destroy(){this['isDirty']=!0x1,this['commentsListView']['destroy'](),this['commentThreadHeaderView']['destroy'](),await this['commentThreadInputView']['destroy'](),super['destroy']();}_createCommentThreadInputView(){const _0x15745b=new Gt(this['locale'],this['_localUser'],this['_config']['editorConfig']),_0x48bb17=_0x15745b['commentInputView'];return _0x15745b['bind']('showInput')['to'](this,'isActive',this['_model'],'isReadOnly',this['_model'],'canComment',this['_model'],'archivedAt',_0x48bb17,'value',(_0x2f37f2,_0x10d825,_0x391588,_0x224899,_0x2ffe71)=>!!_0x2ffe71||!!_0x224899&&_0x391588&&!_0x10d825||_0x2f37f2&&_0x391588&&!_0x10d825),_0x48bb17['bind']('placeholder')['to'](this,'length',this['_model'],'isResolvable',this['_model'],'isResolved',(_0x1dc7e4,_0x5c76a7,_0x4b0911)=>{let _0x5794b1;return _0x5794b1=_0x4b0911&&_0x5c76a7?'Reply\x20to\x20reopen\x20discussion...':_0x1dc7e4?'Reply...':'Write\x20a\x20comment...',Vt(this['locale'],_0x5794b1);}),_0x48bb17['bind']('submitLabel')['to'](this,'length',_0x4b58ce=>Vt(this['locale'],_0x4b58ce?'Reply':'Comment')),_0x48bb17['on']('submit',(_0x3ed395,_0x5e4434)=>{this['fire']('addComment',_0x5e4434),this['_model']['isResolved']&&this['_model']['isResolvable']&&this['fire']('reopenCommentThread',this['_model']['id']),this['_model']['isSubmitted']||this['fire']('submitCommentThread');}),_0x48bb17['on']('cancel',()=>{this['focus']();}),_0x48bb17['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0x48bb17['on']('cancel',_0x56d654=>{0x0==this['length']&&(this['fire']('removeCommentThread'),_0x56d654['stop']());}),this['on']('change:isActive',(_0x4d1f1c,_0x14669e,_0x4e6718)=>{_0x4e6718||this['length']||_0x48bb17['value']||this['fire']('removeCommentThread');}),_0x15745b;}};const Qt=/* #__PURE__ -- @preserve */
|
|
27
|
+
_0xcb9c17(Jt);var Zt=class extends Qt{commentThreadChildren;containerElement;resolveButton;reopenButton;_boundFirstCommentView;constructor(_0x5d4d80,_0x44fd7f,_0x231b56,_0x3ea3ba){super(_0x5d4d80,_0x44fd7f,_0x231b56,_0x3ea3ba),this['commentThreadChildren']=this['createCollection']([this['commentsListView'],this['commentThreadInputView'],this['ariaDescriptionView']]),this['set']('actionIndicator',null),this['containerElement']=null,this['_boundFirstCommentView']=null,this['locale']=_0x5d4d80,this['resolveButton']=this['_createResolveButton'](),this['reopenButton']=this['_createReopenButton'](),this['setTemplate'](this['getTemplate']()),this['on']('change:isActive',(_0xfdf5ba,_0x5d9b58,_0x593ff3)=>{_0x593ff3||this['_cancelAllConfirms']();}),this['listenTo'](this['_model'],'change:isReadOnly',(_0x34e954,_0x441ce2,_0x2ae54c)=>{_0x2ae54c&&this['_cancelAllConfirms']();}),this['length']>0x0&&this['_bindFirstCommentView'](),this['listenTo'](this['commentsListView']['commentViews'],'add',()=>{this['_bindFirstCommentView']();});}getTemplate(){const _0x5c26a4=this['bindTemplate'];return{'tag':'div','attributes':{'class':['ck','ck-thread','ck-reset_all-excluded','ck-rounded-corners',_0x5c26a4['if']('isActive','ck-thread--active'),_0x5c26a4['if']('isUnlinked','ck-thread--unlinked'),_0x5c26a4['to']('actionIndicator',_0x126f8c=>_0x126f8c?'ck-thread--'+_0x126f8c:'')],'data-thread-id':this['_model']['id'],'tabindex':0x0,'role':'listitem','aria-label':_0x5c26a4['to']('ariaLabel'),'aria-describedby':this['ariaDescriptionView']['id']},'children':[{'tag':'div','attributes':{'class':'ck-thread__container'},'children':this['commentThreadChildren']}]};}['render'](){super['render'](),this['containerElement']=this['element']['querySelector']('.ck-thread__container');}['_cancelAllConfirms'](){this['cancelConfirm']();for(const _0x3c4f44 of this['commentsListView']['commentViews'])_0x3c4f44['cancelConfirm']();}_bindFirstCommentView(){const {locale:_0x2ce361}=this,_0x524271=this['commentsListView']['commentViews']['get'](0x0);_0x524271===this['_boundFirstCommentView']||_0x524271['isSystemComment']||(this['_boundFirstCommentView']=_0x524271,this['unbind']('actionIndicator'),this['bind']('actionIndicator')['to'](_0x524271,'actionIndicator',_0x525086=>'remove'===_0x525086?'remove':null),_0x524271['placeholder']=Vt(_0x2ce361,'Write\x20a\x20comment...'),_0x524271['bind']('contextValue')['to'](this['_model'],'context',_0xc16598=>_0xc16598?'string'==typeof _0xc16598['value']&&_0xc16598['value']?$t(_0xc16598['value']):Vt(_0x2ce361,'Comment\x20was\x20made\x20on\x20an\x20element'):null),_0x524271['bind']('isThreadArchived')['to'](this['_model'],'archivedAt',_0x108823=>!!_0x108823),_0x524271['bind']('isThreadUnlinked')['to'](this['_model'],'unlinkedAt',_0x5d748d=>!!_0x5d748d),_0x524271['removeButton']['on']('execute',_0x492e88=>{_0x492e88['stop'](),this['showConfirm'](Vt(_0x2ce361,'Delete\x20comment\x20thread?'),this['containerElement'])['then'](()=>{this['fire']('removeCommentThread');});},{'priority':'high'}),this['on']('removeConfirm',()=>{_0x524271['focus']();}),_0x524271['actionBar']['add'](this['reopenButton'],0x0),_0x524271['focusables']['add'](this['reopenButton'],0x0),_0x524271['actionBar']['add'](this['resolveButton'],0x0),_0x524271['focusables']['add'](this['resolveButton'],0x0));}_createResolveButton(){const _0x68507d=new _0x11e49b(this['locale']);return _0x68507d['label']=Vt(this['locale'],'Resolve'),_0x68507d['tooltip']=Vt(this['locale'],'Resolve'),_0x68507d['icon']=_0x3ecf6a,_0x68507d['extendTemplate']({'attributes':{'class':['ck-comment--resolve','ck-button_small']}}),_0x68507d['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x52a267=>!_0x52a267),_0x68507d['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x46689a,_0x40d3d0)=>_0x46689a&&!_0x40d3d0),_0x68507d['on']('execute',()=>{this['fire']('resolveCommentThread',this['_model']['id']);}),_0x68507d;}_createReopenButton(){const _0x36c3c0=new _0x11e49b(this['locale']);return _0x36c3c0['label']=Vt(this['locale'],'Reopen'),_0x36c3c0['tooltip']=Vt(this['locale'],'Reopen'),_0x36c3c0['icon']=et,_0x36c3c0['extendTemplate']({'attributes':{'class':['ck-comment--reopen','ck-button_small']}}),_0x36c3c0['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x45f5dd=>!_0x45f5dd),_0x36c3c0['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x32ad5e,_0x3dd182)=>_0x32ad5e&&_0x3dd182),_0x36c3c0['on']('execute',()=>{this['fire']('reopenCommentThread',this['_model']['id']);}),_0x36c3c0;}},te=class extends wt{_contextUnlinkedIconView;_contextResizeObserver=null;constructor(_0x44d5c2){super(_0x44d5c2),this['set']('content',''),this['set']('contextValue',null),this['set']('isThreadArchived',!0x1),this['set']('isThreadUnlinked',!0x1),this['_contextUnlinkedIconView']=new lt(),this['_contextUnlinkedIconView']['content']=it,this['registerChild'](this['_contextUnlinkedIconView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck-content','ck-comment__content','ck-annotation__content']}});}['render'](){super['render'](),this['on']('change:content',()=>this['_renderContent']()),this['on']('change:contextValue',()=>this['_renderContent']()),this['on']('change:isThreadArchived',()=>this['_renderContent']()),this['on']('change:isThreadUnlinked',()=>this['_renderContent']()),this['_renderContent']();}destroy(){super['destroy'](),this['_destroyContextResizeObserver']();}_renderContent(){const _0x108868=this['element'];this['_destroyContextResizeObserver'](),_0x108868['innerHTML']=_0x118aa0(this['content']);const _0x234e2d=this['contextValue']?.['trim']();if(_0x234e2d){const _0x501659=document['createElement']('div'),_0x566788=document['createElement']('p');_0x501659['classList']['add']('ck-comment__context'),_0x566788['textContent']=_0x234e2d,_0x501659['append'](_0x566788),this['isThreadUnlinked']&&(_0x501659['classList']['add']('ck-comment__context_unlinked'),_0x501659['prepend'](this['_contextUnlinkedIconView']['element'])),_0x108868['prepend'](_0x501659),this['isThreadArchived']&&this['_attachContextTooltip'](_0x501659,_0x566788,_0x234e2d);}}_attachContextTooltip(_0x668a5b,_0x4f1dcb,_0x3dfcbd){_0x668a5b['dataset']['ckeTooltipText']=_0x3dfcbd,_0x668a5b['dataset']['ckeTooltipClass']='ck-tooltip_multi-line\x20ck-comment__context-tooltip',_0x668a5b['dataset']['ckeTooltipDisabled']='true',this['_contextResizeObserver']=new _0x84e955(_0x4f1dcb,()=>{_0x4f1dcb['scrollWidth']>_0x4f1dcb['clientWidth']?delete _0x668a5b['dataset']['ckeTooltipDisabled']:_0x668a5b['dataset']['ckeTooltipDisabled']='true';});}_destroyContextResizeObserver(){this['_contextResizeObserver']&&(this['_contextResizeObserver']['destroy'](),this['_contextResizeObserver']=null);}},ee=class extends wt{['visibleView'];ariaDescriptionView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];['_model'];['_config'];constructor(_0x2db73a,_0x267cd4,_0x1f3449){super(_0x2db73a),this['_model']=_0x267cd4,this['_config']=_0x1f3449,this['isSystemComment']=!!this['_config']['isSystemComment'],this['set']('isEditMode',!0x1),this['set']('isCollapsed',!0x0),this['set']('contextValue',null),this['set']('isThreadArchived',!0x1),this['set']('isThreadUnlinked',!0x1),this['bind']('ariaLabel')['to'](_0x267cd4,'content',_0x267cd4,'authoredAt',this,'contextValue',this,'isThreadUnlinked',(_0x4d176a,_0x396059,_0x3f119b,_0x210c60)=>{const _0x8e2f7e=new DOMParser()['parseFromString'](_0x118aa0(_0x4d176a),'text/html')['body']['textContent'],_0x6f9215=Vt(_0x2db73a,'COMMENT_ARIA_LABEL',[_0x267cd4['author']['name'],_0x1f3449['formatDateTime'](_0x396059),_0x8e2f7e,_0x267cd4['isExternal']?this['getExternalCommentNote']():'']),_0x280cc0=_0x3f119b?.['trim']();if(!_0x280cc0)return _0x6f9215;const _0x288b28=Vt(_0x2db73a,_0x210c60?'THREAD_CONTEXT_UNLINKED_LABEL':'THREAD_CONTEXT_LABEL',_0x280cc0);return _0x6f9215['trimEnd']()['replace'](/\.$/,'')+'.\x20'+_0x288b28;}),this['ariaDescriptionView']=new _0x488756(_0x2db73a,Vt(_0x2db73a,'COMMENT_THREAD_DESCRIPTION')),this['visibleView']=this['createCollection'](),this['visibleView']['add'](this['_createCommentContentView']()),this['focusables']=new gt(),this['focusTracker']=new _0x494444(),this['keystrokes']=new _0x55993b(),this['focusCycler']=new dt({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x49ea4a=>_0x49ea4a['target']!==this['element']},'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}});}['expand'](){this['isCollapsed']=!0x1;}['collapse'](){this['isEditMode']||(this['isCollapsed']=!0x0);}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['_setupKeyboardNavigation']();}async destroy(){await this['visibleView']['get'](0x0)['destroy'](),super['destroy']();}switchToEditMode(){this['isEditMode']||(this['isEditMode']=!0x0,this['visibleView']['remove'](0x0)['destroy'](),this['visibleView']['add'](this['_createCommentInputView']()));}switchToDisplayMode(){this['isEditMode']&&(this['isEditMode']=!0x1,this['visibleView']['remove'](0x0)['destroy'](),this['visibleView']['add'](this['_createCommentContentView']()));}getExternalCommentNote(){return'importWord'===this['_model']['attributes']['@external']['source']?Vt(this['locale'],'EXTERNAL_IMPORT_WORD_COMMENT'):Vt(this['locale'],'EXTERNAL_COMMENT');}getUserViewNotificationText(){return this['_model']['isExternal']?'importWord'===this['_model']['attributes']['@external']['source']?Vt(this['locale'],'EXTERNAL_IMPORT_WORD_AVATAR',this['_model']['creator']['name']):Vt(this['locale'],'EXTERNAL_AVATAR',this['_model']['creator']['name']):null;}_createCommentContentView(){const _0x1eedbd=new te(this['locale']);return _0x1eedbd['bind']('contextValue','isThreadArchived','isThreadUnlinked')['to'](this),_0x1eedbd['bind']('content')['to'](this['_model'],'content',this,'isCollapsed',(_0x709054,_0xe8a908)=>_0xe8a908?_0x3ff4dd(_0x709054,{'limit':this['_config']['maxCommentCharsWhenCollapsed']}):_0x709054),_0x1eedbd;}_createCommentInputView(){this['_config']['editorConfig']||(this['_config']['editorConfig']={}),this['_config']['editorConfig']['initialData']=this['_model']['content'];const _0x1a4d3a=new Kt(this['locale'],this['_config']['editorConfig']);return _0x1a4d3a['value']=this['_model']['content'],_0x1a4d3a['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0x1a4d3a['submitLabel']=Vt(this['locale'],'Save'),_0x1a4d3a['on']('submit',(_0x104397,_0x5e6c07)=>{this['fire']('updateComment',this['_model']['id'],_0x5e6c07),this['switchToDisplayMode'](),this['focus']();}),_0x1a4d3a['on']('cancel',()=>{this['switchToDisplayMode'](),this['focus']();}),_0x1a4d3a['once']('editorReady',()=>{_0x1a4d3a['focus']();}),_0x1a4d3a['createEditor'](),_0x1a4d3a['delegate']('editorReady')['to'](this),_0x1a4d3a['delegate']('editorDestroyed')['to'](this),_0x1a4d3a;}_setupKeyboardNavigation(){const _0x5768c9=this['element'];this['keystrokes']['listenTo'](_0x5768c9);for(const _0x1f33b4 of this['focusables'])this['focusTracker']['add'](_0x1f33b4['element']),this['keystrokes']['listenTo'](_0x1f33b4['element']);this['focusables']['on']('change',(_0x279e23,_0x11b267)=>{for(const _0x12818b of _0x11b267['removed'])this['focusTracker']['remove'](_0x12818b['element']),this['keystrokes']['stopListening'](_0x12818b['element']);for(const _0x4fb3a6 of _0x11b267['added'])this['focusTracker']['add'](_0x4fb3a6['element']),this['keystrokes']['listenTo'](_0x4fb3a6['element']);}),this['keystrokes']['set']('enter',(_0x2b9c20,_0x2a2f43)=>{_0x5768c9===_0x2b9c20['target']&&(this['focusCycler']['focusFirst'](),_0x2a2f43());}),this['keystrokes']['set']('esc',(_0x3d95da,_0x5f3744)=>{_0x5768c9!==_0x3d95da['target']&&(this['focus'](),_0x5f3744());});}};const ie=/* #__PURE__ -- @preserve */
|
|
28
|
+
_0xcb9c17(ee);var se=class extends ie{actionBar;['userView'];constructor(_0x4f8844,_0x46a5b0,_0x160835){super(_0x4f8844,_0x46a5b0,_0x160835),this['set']('actionIndicator',null),this['set']('placeholder',Vt(_0x4f8844,'Reply...')),this['bind']('authoredAt')['to'](_0x46a5b0),this['bind']('resolvedAt')['to'](_0x46a5b0),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 _0x58b1a5(_0x4f8844,_0x46a5b0['author'],this['getUserViewNotificationText']()),this['userView']['extendTemplate']({'attributes':{'class':['ck-comment__user','ck-annotation__user'],'aria-hidden':!0x0}}),this['listenTo'](_0x46a5b0,'change:isRemovable',()=>this['cancelConfirm']()),this['setTemplate'](this['getTemplate']());}getTemplate(){const _0x1b88ce=this['bindTemplate'],_0x501cce=[{'tag':'div','attributes':{'class':['ck-comment__info','ck-annotation__info']},'children':[{'tag':'span','children':[{'text':this['userView']['name']}],'attributes':{'class':['ck-comment__info-name','ck-annotation__info-name']}},{'tag':'time','attributes':{'datetime':_0x1b88ce['to']('authoredAt'),'class':['ck-comment__info-time','ck-annotation__info-time']},'children':[{'text':_0x1b88ce['to']('authoredAt',_0x4f0e64=>this['_config']['formatDateTime'](_0x4f0e64))}]}]},{'tag':'div','attributes':{'class':['ck-comment__actions','ck-annotation__actions',_0x1b88ce['if']('isEditMode','ck-comment__actions--hidden'),_0x1b88ce['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']&&_0x501cce['push']({'tag':'div','attributes':{'class':['ck-comment__external']},'children':[{'text':this['getExternalCommentNote']()}]}),{'tag':'li','attributes':{'class':['ck-comment__wrapper'],'tabindex':-0x1,'aria-label':_0x1b88ce['to']('ariaLabel'),'aria-describedby':this['ariaDescriptionView']['id'],'role':'listitem'},'children':[{'tag':'div','attributes':{'class':['ck-comment','ck-annotation',_0x1b88ce['if']('isEditMode','ck-comment--edit'),_0x1b88ce['if']('isSystemComment','ck-comment--info'),_0x1b88ce['to']('actionIndicator',_0x1cfb50=>_0x1cfb50?'ck-comment--'+_0x1cfb50:'')],'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':_0x501cce}]}]};}_createEditButton(){const _0xd1b44a=new nt(this['locale']);return _0xd1b44a['label']=Vt(this['locale'],'Edit'),_0xd1b44a['icon']=_0x4caeb4,_0xd1b44a['withText']=!0x0,_0xd1b44a['extendTemplate']({'attributes':{'class':'ck-comment--edit'}}),_0xd1b44a['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x489609=>!_0x489609),_0xd1b44a['bind']('isVisible')['to'](this['_model'],'isEditable'),_0xd1b44a['on']('execute',()=>this['switchToEditMode']()),_0xd1b44a;}_createRemoveButton(){const _0xdc5177=new nt(this['locale']);return _0xdc5177['label']=Vt(this['locale'],'Remove'),_0xdc5177['icon']=_0xac1bf4,_0xdc5177['withText']=!0x0,_0xdc5177['extendTemplate']({'attributes':{'class':'ck-comment--remove'}}),_0xdc5177['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x3a5ce1=>!_0x3a5ce1),_0xdc5177['bind']('isVisible')['to'](this['_model'],'isRemovable'),_0xdc5177['on']('execute',()=>{this['showConfirm'](Vt(this['locale'],'Delete\x20comment?'),this['element'])['then'](()=>{this['fire']('removeComment',this['_model']['id']);});}),_0xdc5177;}_createDropdown(){const _0x22a2bb=vt(this['locale'],_0x292a5f),_0x19bba9=_0x22a2bb['panelView']['children'],_0x26a22a=new ft(this['locale']),_0x5344ef=_0x22a2bb['bindTemplate'];Tt(_0x22a2bb,()=>this['items']['find'](_0x2502bc=>_0x2502bc['isVisible'])),_0x22a2bb['extendTemplate']({'attributes':{'class':[_0x5344ef['if']('isVisible','ck-hidden',_0x50576e=>!_0x50576e)]}});const _0x3b1e7e=(_0x339bf1,_0x5aaf94=-0x1)=>{const _0x3f4b63=new ut(this['locale']);_0x3f4b63['children']['add'](_0x339bf1);const _0x4fc4e6=_0x5aaf94>-0x1?_0x5aaf94:_0x26a22a['items']['length'];_0x26a22a['items']['add'](_0x3f4b63,_0x4fc4e6);const _0x317fd8=Array['from'](this['items']);_0x22a2bb['unbind']('isEnabled','isVisible'),_0x22a2bb['bind']('isEnabled')['toMany'](_0x317fd8,'isEnabled',(..._0x45580a)=>_0x45580a['some'](_0x41519a=>_0x41519a)),_0x22a2bb['bind']('isVisible')['toMany'](_0x317fd8,'isVisible',(..._0x3a200e)=>_0x3a200e['some'](_0x2cc0ff=>_0x2cc0ff));};_0x22a2bb['panelPosition']='sw',_0x22a2bb['buttonView']['set']({'label':Vt(this['locale'],'Show\x20more\x20items'),'icon':_0x277813}),_0x22a2bb['buttonView']['extendTemplate']({'attributes':{'class':'ck-button_small'}});for(const _0x37da36 of this['items'])_0x3b1e7e(_0x37da36);return _0x19bba9['add'](_0x26a22a),_0x22a2bb['listenTo'](this['items'],'add',(_0x42878f,_0x41d525,_0xd1edf2)=>{_0x3b1e7e(_0x41d525,_0xd1edf2);}),_0x22a2bb['listenTo'](this['items'],'remove',(_0x41db2c,_0x4a556b,_0x475b18)=>{_0x26a22a['items']['remove'](_0x475b18);}),_0x22a2bb;}_attachActions(_0x7a5f48,_0x452c92){const _0x20dc07=_0x7a5f48&&_0x7a5f48['element'];_0x20dc07&&(this['listenTo'](_0x20dc07,'mouseenter',()=>this['actionIndicator']=_0x452c92),this['listenTo'](_0x20dc07,'focus',()=>this['actionIndicator']=_0x452c92),this['listenTo'](_0x20dc07,'mouseleave',()=>this['actionIndicator']=null),this['listenTo'](_0x20dc07,'blur',()=>this['actionIndicator']=null));}_createCommentInputView(){const _0x45ed56=super['_createCommentInputView']();return _0x45ed56['bind']('placeholder')['to'](this),_0x45ed56;}['render'](){super['render'](),this['_attachActions'](this['editButton'],'edit'),this['_attachActions'](this['removeButton'],'remove');}};function ne(_0x2c40ae){const _0x3abb8f=_0x4fe97b(_0x2c40ae,0x1e),_0x929283=new MutationObserver(_0x24f08d=>{for(const _0x4bbe24 of _0x24f08d)('attributes'==_0x4bbe24['type']&&'class'==_0x4bbe24['attributeName']||'childList'==_0x4bbe24['type']||'characterData'==_0x4bbe24['type'])&&_0x3abb8f();});return{'attach'(_0x316c22){_0x929283['observe'](_0x316c22,{'attributes':!0x0,'childList':!0x0,'subtree':!0x0,'characterData':!0x0});},'detach'(){_0x929283['disconnect'](),_0x3abb8f['cancel']();}};}var oe=class extends wt{['focusTracker'];['id'];keystrokes;content;['mainView'];_mutationObserver;constructor(_0x166176,_0x4f5400){super(_0x166176),this['id']=_0x3109c5(),this['focusTracker']=new _0x494444(),this['keystrokes']=new _0x55993b(),this['keystrokes']['set']('Esc',(_0x3bb12e,_0x29e0c8)=>this['fire']('Esc',_0x29e0c8)),this['set']('targetRect',{'top':0x0,'right':0x0,'bottom':0x0,'left':0x0}),this['set']('height',0x0),this['set']('isActive',!0x1),this['set']('isDirty',!0x1),this['set']('length',0x0),this['set']('type',''),this['_mutationObserver']=ne(()=>this['_updateHeight']()),this['content']=this['createCollection'](),this['content']['delegate']('arrowup','arrowdown')['to'](this),this['content']['add'](_0x4f5400),this['mainView']=_0x4f5400;const _0x2cc2bb=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-annotation-wrapper','ck-rounded-corners',_0x2cc2bb['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 _0x4f8ab2=this['element']['clientHeight'];_0x4f8ab2&&(this['height']=_0x4f8ab2);}};const re=/* #__PURE__ -- @preserve */
|
|
29
|
+
_0x5aa6b5();var he=class Annotation extends re{['view'];focusableElements;_type;_target;constructor({view:_0x39f899,target:_0x1ed687,type:_0x1419c8,isVisible:_0x35a4bf=!0x0}){super(),this['view']=_0x39f899,this['view']['element']||this['view']['render'](),this['_type']=_0x1419c8,this['_target']=_0x1ed687,Annotation['_assertCorrectTarget'](this['_getNormalizedTarget']()),this['focusableElements']=new _0x4c91ff([this['view']['element']],{'idProperty':'_id'}),this['focusableElements']['on']('add',(_0x991ab6,_0x332d18)=>{this['view']['focusTracker']['add'](_0x332d18);}),this['focusableElements']['on']('remove',(_0x2737db,_0x3acc89)=>{this['view']['focusTracker']['remove'](_0x3acc89);}),this['set']('isVisible',_0x35a4bf);}get type(){return'function'==typeof this['_type']?this['_type']():this['_type'];}get['innerView'](){return this['view']['mainView'];}get target(){const _0x505f34=this['_getNormalizedTarget']();return Annotation['_assertCorrectTarget'](_0x505f34),_0x505f34;}get targetRect(){const _0x20bd9e=this['target'];if(null===_0x20bd9e)return null;if(_0x20bd9e instanceof _0x5bd772)return _0x20bd9e;const _0x429b7a=_0x20bd9e['filter'](_0x208d68=>function(_0x1cccb1){return!!_0x1cccb1['offsetParent']||!!_0x1cccb1['getClientRects']()['item'](0x0);}(_0x208d68));return 0x0===_0x429b7a['length']?null:_0x5bd772['getDomElementRects'](_0x429b7a[0x0])[0x0];}get isActive(){return this['view']['isActive'];}set isActive(_0x31b517){this['view']['isActive']=_0x31b517,this['view']['mainView']['isActive']=_0x31b517;}updateTargetRect(){this['view']['targetRect']=this['targetRect'];}destroy(){this['focusableElements']['stopListening'](),this['focusableElements']['clear'](),this['stopListening']();}refreshVisibility(){this['isVisible']=!!this['targetRect'];}static _assertCorrectTarget(_0x2c049d){if(!(null===_0x2c049d||_0x2c049d instanceof _0x5bd772||Array['isArray'](_0x2c049d)&&_0x2c049d['every'](_0x39719b=>ae(_0x39719b))))throw new _0x53d35c('annotation-invalid-target',null,{'target':_0x2c049d});}_getNormalizedTarget(){const _0x2b3255='function'==typeof this['_target']?this['_target']():this['_target'];return ae(_0x2b3255)?[_0x2b3255]:_0x2b3255;}};function ae(_0x2816af){return null!==_0x2816af&&'object'==typeof _0x2816af&&'nodeType'in _0x2816af&&0x1===_0x2816af['nodeType'];}var ce=class extends _0x4c91ff{_innerViewToAnnotation;_viewToAnnotation;['_focusTracker'];constructor(_0x5d96d5=[]){super(),this['_innerViewToAnnotation']=new Map(),this['_viewToAnnotation']=new Map(),this['_focusTracker']=new _0x494444(),this['_focusTracker']['on']('change:isFocused',(_0x16c812,_0x41a60d,_0x186f50)=>{_0x186f50||this['fire']('blur');});for(const _0x5a0652 of _0x5d96d5)this['add'](_0x5a0652);}get['isFocused'](){return this['_focusTracker']['isFocused'];}['add'](_0x207bd4){if(this['has'](_0x207bd4))throw new _0x53d35c('annotationcollection-duplicated-item',null);this['_innerViewToAnnotation']['set'](_0x207bd4['innerView'],_0x207bd4),this['_viewToAnnotation']['set'](_0x207bd4['view'],_0x207bd4);for(const _0x3fe3f0 of _0x207bd4['focusableElements'])this['_focusTracker']['add'](_0x3fe3f0);if(this['listenTo'](_0x207bd4['focusableElements'],'add',(_0x223a1a,_0x3d8626)=>{this['_focusTracker']['add'](_0x3d8626);}),this['listenTo'](_0x207bd4['focusableElements'],'remove',(_0x459228,_0x16cc7e)=>{this['_focusTracker']['remove'](_0x16cc7e);}),this['listenTo'](_0x207bd4['view']['focusTracker'],'change:isFocused',(_0x431896,_0x592a26,_0x1c4b68)=>{_0x1c4b68&&this['fire']('focus',_0x207bd4);}),_0x207bd4['updateTargetRect'](),this['_areCachedRectsStale']()){for(const _0x52b9a1 of this)_0x52b9a1['updateTargetRect']();}const _0x365fc4=this['_getOrderInContent'](_0x207bd4['view']['targetRect']);return super['add'](_0x207bd4,_0x365fc4);}['remove'](_0x5e87d7){if(!this['has'](_0x5e87d7))throw new _0x53d35c('annotationcollection-not-existing-item',null);this['stopListening'](_0x5e87d7['view']['focusTracker']),this['stopListening'](_0x5e87d7['focusableElements']);for(const _0x302eba of _0x5e87d7['focusableElements'])this['_focusTracker']['remove'](_0x302eba);return this['_viewToAnnotation']['delete'](_0x5e87d7['view']),this['_innerViewToAnnotation']['delete'](_0x5e87d7['innerView']),super['remove'](_0x5e87d7);}getByInnerView(_0x2ef9ce){return this['_innerViewToAnnotation']['get'](_0x2ef9ce);}getByView(_0x9ad57b){return this['_viewToAnnotation']['get'](_0x9ad57b);}destroy(){super['clear'](),this['stopListening'](),this['_innerViewToAnnotation']['clear'](),this['_viewToAnnotation']['clear'](),this['_focusTracker']['destroy']();}refreshPositioning(){for(const _0x258f94 of this)_0x258f94['updateTargetRect']();this['_sort']();}_sort(){const _0x21ce6a=Array['from'](this)['sort']((_0x11cee4,_0xd57c65)=>le(_0x11cee4['view']['targetRect'],_0xd57c65['view']['targetRect']));for(let _0x371b1a=_0x21ce6a['length']-0x1;_0x371b1a>0x0;_0x371b1a--){const _0x479bb9=_0x21ce6a[_0x371b1a];_0x371b1a!==this['getIndex'](_0x479bb9)&&(this['remove'](_0x479bb9),this['add'](_0x479bb9));}}_getOrderInContent(_0x2cbc84){let _0x3c38a3=0x0;if(!_0x2cbc84)return this['length'];for(const _0x1b50ba of this){const _0x405225=_0x1b50ba['view']['targetRect'];if(_0x405225){if(le(_0x2cbc84,_0x405225)<0x0)return _0x3c38a3;_0x3c38a3++;}}return _0x3c38a3;}_areCachedRectsStale(){const _0xc76ac3=this['get'](0x0);if(!_0xc76ac3)return!0x1;const _0x441d51=_0xc76ac3['view']['targetRect'],_0x450d8f=_0xc76ac3['targetRect'];return!(!_0x441d51||!_0x450d8f)&&(_0x441d51['top']!==_0x450d8f['top']||_0x441d51['left']!==_0x450d8f['left']);}};function de({source:_0x3fd26d,target:_0x47eed7,filter:_0x425b75}){for(const _0x140e0b of _0x3fd26d)_0x425b75(_0x140e0b)&&_0x47eed7['add'](_0x140e0b);_0x47eed7['listenTo'](_0x3fd26d,'add',(_0x29a24b,_0x1cf507)=>{_0x425b75(_0x1cf507)&&_0x47eed7['add'](_0x1cf507);}),_0x47eed7['listenTo'](_0x3fd26d,'remove',(_0x31156f,_0x1e4b1c)=>{_0x47eed7['has'](_0x1e4b1c)&&_0x47eed7['remove'](_0x1e4b1c);});}function le(_0x1a8fe0,_0x333f2d){if(null===_0x1a8fe0&&null===_0x333f2d)return 0x0;if(null===_0x1a8fe0)return-0x1;if(null===_0x333f2d)return 0x1;const _0x48628d=_0x1a8fe0['top']-_0x333f2d['top'];return 0x0==_0x48628d?_0x1a8fe0['left']-_0x333f2d['left']:_0x48628d;}var me=class extends _0x1e3609{collection;_visibleAnnotations;static get['pluginName'](){return'Annotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1cfee6){if(super(_0x1cfee6),this['collection']=new ce(),this['_visibleAnnotations']=new ce(),this['set']('activeAnnotations',new Set()),this['_bindAnnotationsToVisibleAnnotations'](),_0x1cfee6 instanceof _0x24d303){const _0x5b90ea=_0x1cfee6['locale'];_0x1cfee6['accessibility']['addKeystrokeInfoGroup']({'id':'annotations','label':Vt(_0x5b90ea,'ACCESSIBILITY_HELP_ANNOTATIONS_GROUP'),'keystrokes':[{'label':Vt(_0x5b90ea,'ACCESSIBILITY_HELP_ANNOTATIONS_MOVE_TO'),'keystroke':'Ctrl+Shift+E'},{'label':Vt(_0x5b90ea,'ACCESSIBILITY_HELP_ANNOTATIONS_EXIT'),'keystroke':'Esc'},{'label':Vt(_0x5b90ea,'ACCESSIBILITY_HELP_ANNOTATIONS_ENTER'),'keystroke':'Enter'},{'label':Vt(_0x5b90ea,'ACCESSIBILITY_HELP_ANNOTATIONS_BROWSE_GROUPS'),'keystroke':[['Tab'],['Shift+Tab']]},{'label':Vt(_0x5b90ea,'ACCESSIBILITY_HELP_ANNOTATIONS_SUBMIT_COMMENT'),'keystroke':['Ctrl+Enter']},{'label':Vt(_0x5b90ea,'ACCESSIBILITY_HELP_ANNOTATIONS_NAVIGATE_THREADS'),'keystroke':[['Arrowup'],['Arrowdown']]}]});}this['_setupEnterAnnotationKeystroke'](),this['_setupEscapeAnnotationHandling']();}['add'](_0x1dca83){this['collection']['add'](_0x1dca83);}['remove'](_0x1b9217){this['collection']['remove'](_0x1b9217),_0x1b9217['destroy']();}refreshVisibility(){for(const _0x141e88 of this['collection'])_0x141e88['refreshVisibility']();}refreshPositioning(){this['_visibleAnnotations']['refreshPositioning']();}getByInnerView(_0x3aaaee){return this['collection']['getByInnerView'](_0x3aaaee);}deactivateAll(){this['fire']('_deactivateAllAnnotations');}destroy(){for(const _0x276215 of this['collection'])_0x276215['destroy']();this['_visibleAnnotations']['destroy'](),this['collection']['destroy'](),super['destroy']();}activate(_0x3d57fa){this['fire']('_activateAnnotation',_0x3d57fa);}createAnnotation(_0x2b33d4){return new he(_0x2b33d4);}createAnnotationView(_0x319cba,_0x3165ac){return new oe(_0x319cba,_0x3165ac);}_addActiveAnnotation(_0x28dd09){const _0x4bfd77=new Set(this['activeAnnotations']);_0x4bfd77['add'](_0x28dd09),this['activeAnnotations']=_0x4bfd77;}_removeActiveAnnotation(_0xa36123){const _0x12c5eb=new Set(this['activeAnnotations']);_0x12c5eb['delete'](_0xa36123),this['activeAnnotations']=_0x12c5eb;}_bindAnnotationsToVisibleAnnotations(){const _0xf22ddd=this['collection'],_0x42ea72=this['_visibleAnnotations'];function _0xad0b26(_0x52ae52){const _0x2ba351=_0x52ae52['source'];_0x2ba351['isVisible']&&!_0x42ea72['has'](_0x2ba351)?_0x42ea72['add'](_0x2ba351):!_0x2ba351['isVisible']&&_0x42ea72['has'](_0x2ba351)&&_0x42ea72['remove'](_0x2ba351),_0x2ba351['view']['focusTracker']['remove'](_0x2ba351['view']['element']),_0x2ba351['view']['focusTracker']['add'](_0x2ba351['view']['element']);}this['listenTo'](_0xf22ddd,'add',(_0x4a851f,_0x3f41b2)=>{_0x3f41b2['isVisible']&&_0x42ea72['add'](_0x3f41b2),this['listenTo'](_0x3f41b2,'change:isVisible',_0xad0b26);}),this['listenTo'](_0xf22ddd,'remove',(_0x11ce8f,_0x2f403d)=>{_0x42ea72['has'](_0x2f403d)&&_0x42ea72['remove'](_0x2f403d),this['stopListening'](_0x2f403d,'change:isVisible',_0xad0b26);});}_setupEnterAnnotationKeystroke(){const _0x459273=_0x130d49=>{_0x130d49['on']('ready',()=>{_0x130d49['keystrokes']['set'](_0x277714,(_0x3c2f9e,_0xd9374d)=>{const _0x5b0d34=_0x1fdfb2(this['activeAnnotations']['values']());_0x5b0d34&&(_0x5b0d34['view']['focus'](),_0xd9374d());});});};this['context']instanceof _0x24d303?_0x459273(this['context']):this['context']['editors']&&this['context']['editors']['on']('add',(_0x121f0a,_0x1f5aba)=>{_0x459273(_0x1f5aba);});}_setupEscapeAnnotationHandling(){const _0x262b4c=_0x58e134=>{const _0x52bd89=_0x58e134['source'],_0x17cf56=[];let _0x326212;if(Array['isArray'](_0x52bd89['target'])){_0x326212=_0x52bd89['target'][0x0],this['context']instanceof _0x24d303?_0x17cf56['push'](this['context']):this['context']['editors']&&_0x17cf56['push'](...this['context']['editors']);for(const _0x526010 of _0x17cf56)for(const _0x579dbf of _0x526010['editing']['view']['domRoots']['values']())if(_0x381f75(_0x579dbf,_0x326212))return void _0x526010['editing']['view']['focus']();_0x326212['focus']();}};this['listenTo'](this['collection'],'add',(_0x10e99a,_0x42535b)=>{this['listenTo'](_0x42535b,'escape',_0x262b4c,{'priority':'low'});}),this['listenTo'](this['collection'],'remove',(_0x55265c,_0x359287)=>{this['stopListening'](_0x359287,'escape',_0x262b4c);});}};const ue=Symbol('noChannel'),fe={'admin':!0x0,'modifyAll':!0x1,'write':!0x0,'resolve':!0x0},pe=/* #__PURE__ -- @preserve */
|
|
30
|
+
_0x5aa6b5(),_e=/* #__PURE__ -- @preserve */
|
|
31
|
+
_0x5aa6b5();var we=class extends _0x1e3609{_threads;_threadToController;_viewToController;_commentEditorConfig=null;static get requires(){return[me,_0x5e2b33,_0x1e93c2];}static get['pluginName'](){return'CommentsRepository';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xc0f5fc){super(_0xc0f5fc),this['_threads']=new Map(),this['_threadToController']=new Map(),this['_viewToController']=new Map(),this['set']('_readOnlyChannels',new Set()),this['set']('_permissions',new Map());const _0xccaf31=this['context']['config'];_0xccaf31['define']('comments.maxCommentsWhenCollapsed',0x2),_0xccaf31['define']('comments.maxThreadTotalWeight',0x1f4),_0xccaf31['define']('comments.maxCommentCharsWhenCollapsed',0x8c),_0xccaf31['define']('comments.CommentThreadView',Zt),_0xccaf31['define']('comments.CommentView',se),_0xccaf31['get']('comments.editorConfig')||console['warn']('Missing\x20comments\x20editor\x20configuration\x20(`comments.editorConfig`).\x20Default\x20configuration\x20will\x20be\x20used\x20instead.');}init(){const _0x345657=this['context']['plugins']['get'](me);this['set']('activeCommentThread',null),this['on']('addCommentThread',(_0x49f870,_0x3b6f79)=>this['_addCommentThread'](_0x3b6f79)),this['on']('submitCommentThread',(_0x2ec95b,_0x27402c)=>this['_submitCommentThread'](_0x27402c)),this['on']('resolveCommentThread',(_0x63fd24,_0x5432c7)=>this['_resolveCommentThread'](_0x5432c7)),this['on']('resolveCommentThread',(_0x2d0020,_0x51c616)=>this['_updateActiveAnnotation'](_0x51c616),{'priority':'lowest'}),this['on']('reopenCommentThread',(_0x38cae5,_0x565741)=>this['_reopenCommentThread'](_0x565741)),this['on']('reopenCommentThread',(_0x2f44ee,_0xd6c51f)=>this['_updateActiveAnnotation'](_0xd6c51f),{'priority':'lowest'}),this['on']('removeCommentThread',(_0x4fcc26,_0x445b44)=>this['_removeCommentThread'](_0x445b44)),this['on']('updateCommentThread',(_0x5a80e4,_0x93e365)=>this['_updateCommentThread'](_0x93e365)),this['on']('updateCommentThread',(_0x1880cb,_0x367833)=>this['_updateActiveAnnotation'](_0x367833),{'priority':'lowest'}),this['on']('addComment',(_0x579c21,_0x3ea802)=>this['_addComment'](_0x3ea802)),this['on']('updateComment',(_0x491be1,_0x37ea3b)=>this['_updateComment'](_0x37ea3b)),this['on']('removeComment',(_0x59dcb0,_0x28ca60)=>this['_removeComment'](_0x28ca60)),this['on']('addComment',(_0xbace8a,{threadId:_0x43dd59,isFromAdapter:_0x2bc2c7})=>{if(_0x2bc2c7)return;const _0x5695d2=this['getCommentThread'](_0x43dd59),_0x53b91f=_0x5695d2&&this['_threadToController']['get'](_0x5695d2);_0x53b91f&&_0x53b91f['view']['commentsListView']['focus'](-0x1);},{'priority':'lowest'}),this['listenTo'](_0x345657,'change:activeAnnotations',(_0x323261,_0x20b7c5,_0xd74b3e)=>{const _0x537fa4=Array['from'](_0xd74b3e)['map'](_0x18a13f=>this['_viewToController']['get'](_0x18a13f['innerView']))['filter'](Boolean)[0x0];this['activeCommentThread']=_0x537fa4?_0x537fa4['model']:null;});}set adapter(_0x28f7ff){if(this['_adapter'])throw new _0x53d35c('commentsrepository-adapter-already-set');this['_adapter']=_0x28f7ff;}get adapter(){return this['_adapter'];}addCommentThread({channelId:_0x41876a=ue,threadId:_0x58cc23=_0x3109c5(),comments:_0x3b8f54=[],unlinkedAt:_0x238860=null,resolvedAt:_0x1d5703=null,resolvedBy:_0x1cdffd=null,target:_0x15787f=null,context:_0x46eeb2=null,attributes:_0x3199db={},isResolvable:_0x2f4cec=!0x0,isSubmitted:_0x48d8f1=!0x1,isFromAdapter:_0x6a7fc2=!0x1}={}){return this['fire'](ve('addCommentThread',_0x41876a),{'channelId':_0x41876a,'threadId':_0x58cc23,'comments':_0x3b8f54,'unlinkedAt':_0x238860,'resolvedAt':_0x1d5703,'resolvedBy':_0x1cdffd,'target':_0x15787f,'context':_0x46eeb2,'attributes':_0x3199db,'isFromAdapter':_0x6a7fc2,'isResolvable':_0x2f4cec,'isSubmitted':_0x48d8f1}),this['getCommentThread'](_0x58cc23);}openNewCommentThread({channelId:_0x58b921=ue,threadId:_0x4b515d=_0x3109c5(),target:_0x1f4112,context:_0x3be233=null,isResolvable:_0x5f5472=!0x0}){if(this['_readOnlyChannels']['has'](_0x58b921)||this['_readOnlyChannels']['has'](void 0x0))return null;if(!_0x1f4112)throw new _0x53d35c('commentsrepository-missing-target');const _0x2bd8de=this['addCommentThread']({'channelId':_0x58b921,'threadId':_0x4b515d,'target':_0x1f4112,'context':_0x3be233,'isResolvable':_0x5f5472});if(!_0x2bd8de)return null;const _0x2b2caa=this['_threadToController']['get'](_0x2bd8de),_0xc8fa9b=_0x2b2caa['view']['commentThreadInputView']['commentInputView'],_0x5d6bab=this['context']['plugins']['get'](me),_0x35ed55=_0x5d6bab['getByInnerView'](_0x2b2caa['view']);return _0x5d6bab['activate'](_0x35ed55),_0xc8fa9b['once']('editorReady',()=>_0xc8fa9b['focus']()),_0x2bd8de;}hasCommentThread(_0x2a3c30){if('string'!=typeof _0x2a3c30)throw new _0x53d35c('commentsrepository-invalid-comment-thread-id');return this['_threads']['has'](_0x2a3c30);}updateCommentThread({channelId:_0x4dbe38=ue,threadId:_0x13e601,context:_0xa432ad,unlinkedAt:_0x2fb3f6,attributes:_0x1434fd,isFromAdapter:_0x4bdf3b=!0x1}){return this['fire'](ve('updateCommentThread',_0x4dbe38),{'channelId':_0x4dbe38,'threadId':_0x13e601,'context':_0xa432ad,'unlinkedAt':_0x2fb3f6,'attributes':_0x1434fd,'isFromAdapter':_0x4bdf3b}),this['getCommentThread'](_0x13e601);}getCommentThread(_0x1de593){if('string'!=typeof _0x1de593)throw new _0x53d35c('commentsrepository-invalid-comment-thread-id');return this['_threads']['get'](_0x1de593);}fetchCommentThread({channelId:_0x592190,threadId:_0x4b3f7b}={}){const _0x38c364=this['getCommentThread'](_0x4b3f7b);if(_0x38c364)return Promise['resolve'](_0x38c364);if(!this['adapter'])return Promise['resolve'](void 0x0);if('function'!=typeof this['adapter']['getCommentThread'])throw new _0x53d35c('commentsrepository-missing-thread-and-adapter-method',this['context']);return this['adapter']['getCommentThread']({'channelId':_0x592190,'threadId':_0x4b3f7b})['then'](_0x1b2bdd=>this['hasCommentThread'](_0x4b3f7b)?this['getCommentThread'](_0x4b3f7b):_0x1b2bdd?this['addCommentThread'](Object['assign']({'isFromAdapter':!0x0,'channelId':_0x592190},_0x1b2bdd)):void 0x0)['catch'](_0x203998=>{throw console['error'](_0x203998),new _0x53d35c('commentsrepository-fetch-comment-thread',this['context']);});}getCommentThreads({channelId:_0xc0e1c8,skipNotAttached:_0x523573=!0x1,skipEmpty:_0x165fb1=!0x1,toJSON:_0x48171c=!0x1}={}){const _0x23e70e=[];for(const _0x448b98 of this['_threads']['values']())_0xc0e1c8&&_0x448b98['channelId']!==_0xc0e1c8||_0x523573&&!_0x448b98['isAttached']||_0x165fb1&&0x0===_0x448b98['length']||_0x23e70e['push'](_0x448b98);return _0x48171c?_0x23e70e['map'](_0x2eff3d=>_0x2eff3d['toJSON']()):_0x23e70e;}getAnnotationForCommentThread(_0x4b6cd4){const _0x5962be=this['_threadToController']['get'](_0x4b6cd4);return _0x5962be&&this['context']['plugins']['get'](me)['getByInnerView'](_0x5962be['view'])||null;}getCommentThreadForAnnotation(_0x53f0e9){const _0x458941=this['_viewToController']['get'](_0x53f0e9['innerView']);return _0x458941?_0x458941['model']:null;}setActiveCommentThread(_0xe22a85){const _0x1f343e=this['context']['plugins']['get'](me);if(!_0xe22a85)return void(this['activeCommentThread']&&_0x1f343e['deactivateAll']());const _0x3dc80d=this['getCommentThread'](_0xe22a85);if(!_0x3dc80d)throw new _0x53d35c('commentsrepository-active-missing-comment-thread',null,{'threadId':_0xe22a85});if(!this['_threadToController']['has'](_0x3dc80d))throw new _0x53d35c('commentsrepository-active-not-attached',null,{'threadId':_0xe22a85});const _0x21833c=_0x1f343e['getByInnerView'](this['_threadToController']['get'](_0x3dc80d)['view']);_0x1f343e['activate'](_0x21833c);}switchReadOnly(_0x3a4780,_0x3f64b8){_0x3a4780?this['_readOnlyChannels']['add'](_0x3f64b8):this['_readOnlyChannels']['delete'](_0x3f64b8),this['fire']('change:_readOnlyChannels','_readOnlyChannels',this['_readOnlyChannels'],this['_readOnlyChannels']);}['isReadOnly'](_0x344cd3){return this['_readOnlyChannels']['has'](_0x344cd3)||this['_readOnlyChannels']['has'](void 0x0);}createCommentThreadController(_0x4a8517,_0x566d70){return new Dt(_0x4a8517,_0x566d70);}setPermissions(_0x19ed2c,_0x38195f=ue){this['_permissions']['set'](_0x38195f,_0x19ed2c),this['fire']('change:_permissions','_permissions',this['_permissions'],this['_permissions']);}getPermissions(_0x3233c3=ue){return this['_permissions']['has'](_0x3233c3)?this['_permissions']['get'](_0x3233c3):fe;}_addCommentThread({channelId:_0x16d596,threadId:_0x4727d4,comments:_0x2f4309,unlinkedAt:_0x3d0165,resolvedAt:_0x31284f,resolvedBy:_0x1773a4,target:_0x7f82c9,context:_0x5606b9,attributes:_0x4b4f45,isFromAdapter:_0x150c91,isResolvable:_0x11be81,isSubmitted:_0x312491}){if('string'!=typeof _0x4727d4)throw new _0x53d35c('commentsrepository-invalid-comment-thread-id',null,{'threadId':_0x4727d4});if(this['hasCommentThread'](_0x4727d4))throw new _0x53d35c('commentsrepository-duplicated-comment-thread-id',null,{'threadId':_0x4727d4});const _0x217ee3=new ge(this,{'channelId':_0x16d596,'id':_0x4727d4,'context':_0x5606b9,'attributes':_0x4b4f45,'unlinkedAt':_0x3d0165,'resolvedAt':_0x31284f,'resolvedBy':_0x1773a4?this['context']['plugins']['get'](_0x1e93c2)['getUser'](_0x1773a4):null,'isResolvable':_0x11be81,'isSubmitted':_0x312491||_0x150c91});this['_threads']['set'](_0x4727d4,_0x217ee3);for(const _0x2b3f34 of _0x2f4309)_0x217ee3['_add'](this['_createNewComment']({'threadId':_0x4727d4,..._0x2b3f34}));return _0x7f82c9&&_0x217ee3['attachTo'](_0x7f82c9),_0x150c91||!_0x217ee3['length']?Promise['resolve']():this['_submitCommentThread']({'channelId':_0x16d596,'threadId':_0x4727d4});}_submitCommentThread({channelId:_0x20d84a,threadId:_0x40ff4c}){if(!this['hasCommentThread'](_0x40ff4c))throw new _0x53d35c('commentsrepository-missing-comment-thread',this);const _0x15873a=this['getCommentThread'](_0x40ff4c);if(_0x15873a['_isSubmitted']=!0x0,!this['adapter']||'function'!=typeof this['adapter']['addCommentThread'])return Promise['resolve']();const {id:_0x95a566,comments:_0x39c140,resolvedAt:_0x398f75,resolvedBy:_0x5b93de,context:_0x4c72c5,attributes:_0x29f2ff}=_0x15873a,_0x24940=this['context']['plugins']['get']('PendingActions'),_0xab5e17=_0x24940['add'](Vt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['addCommentThread']({'channelId':_0x20d84a,'threadId':_0x95a566,'comments':_0x39c140['map'](_0x43dca6=>_0x43dca6['toJSON']()),'resolvedAt':_0x398f75,'resolvedBy':_0x5b93de?_0x5b93de['id']:_0x5b93de,'context':_0x4c72c5,'attributes':_0x29f2ff})['then'](({comments:_0x5025ef})=>{_0x24940['remove'](_0xab5e17);for(const _0x246f20 of _0x5025ef)this['_updateComment']({'channelId':_0x20d84a,'threadId':_0x40ff4c,'commentId':_0x246f20['commentId'],'createdAt':_0x246f20['createdAt'],'isFromAdapter':!0x0});})['catch'](_0x48392d=>{throw console['error'](_0x48392d),new _0x53d35c('commentsrepository-add-comment-thread-internal-error',this);});}_attachCommentThread({threadId:_0x8d6703,target:_0x1d98a3}){const _0x5b34dd=this['getCommentThread'](_0x8d6703);if(!_0x5b34dd)throw new _0x53d35c('commentsrepository-attach-missing-comment-thread',this);const _0x418b29=this['context']['plugins']['get']('PendingActions'),_0x5aedc0=this['context']['plugins']['get'](me),_0x1af948=this['_createCommentThreadView'](_0x5b34dd),_0x1d331e=new Dt(_0x5b34dd,_0x1af948);let _0x5e3395=null;_0x1af948['on']('change:isDirty',(_0x498b2c,_0x570739,_0x5d071e)=>{_0x5d071e?_0x5e3395=_0x418b29['add'](Vt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD')):_0x5e3395&&(_0x418b29['remove'](_0x5e3395),_0x5e3395=null);}),this['_threadToController']['set'](_0x5b34dd,_0x1d331e),this['_viewToController']['set'](_0x1af948,_0x1d331e);const _0x4d68ac=new oe(this['context']['locale'],_0x1af948);_0x4d68ac['bind']('length')['to'](_0x1af948),_0x4d68ac['bind']('isDirty')['to'](_0x1af948,'isDirty',_0x1af948,'length',(_0x33fac2,_0x29bae8)=>_0x33fac2||!_0x29bae8),_0x4d68ac['bind']('isActive')['to'](_0x1af948),_0x4d68ac['type']='comment';const _0x4f489f=new he({'view':_0x4d68ac,'target':_0x1d98a3,'type':'comment','isVisible':!_0x5b34dd['archivedAt']&&!!('function'==typeof _0x1d98a3?_0x1d98a3():_0x1d98a3)});return _0x1af948['on']('escape',()=>{_0x4f489f['fire']('escape');}),this['_bindAnnotationToEditors'](_0x1af948,_0x4f489f),_0x5aedc0['add'](_0x4f489f),_0x4f489f;}_bindAnnotationToEditors(_0x26cf6b,_0x574418){this['listenTo'](_0x26cf6b,'editorReady',(_0x29fada,_0xa36f15)=>{const _0xa19777=_0xa36f15['ui']['view']['body']['bodyCollectionContainer'];_0x574418['focusableElements']['add'](_0xa19777),this['context']instanceof _0x24d303&&this['context']['ui']['focusTracker']['add'](_0xa19777);},{'priority':'highest'}),this['listenTo'](_0x26cf6b,'editorDestroyed',(_0x400fb8,_0x6e8528)=>{const _0x82ccdf=_0x6e8528['ui']['view']['body']['bodyCollectionContainer'];_0x574418['focusableElements']['has'](_0x82ccdf)&&_0x574418['focusableElements']['remove'](_0x82ccdf),this['context']instanceof _0x24d303&&this['context']['ui']['focusTracker']['remove'](_0x82ccdf);});}_unbindEditors(_0x30b3d6){this['stopListening'](_0x30b3d6,'editorReady'),this['stopListening'](_0x30b3d6,'editorDestroyed');}_createCommentThreadView(_0x3f2c89){const _0x3ae429=this['context']['plugins']['get'](_0x1e93c2),{config:_0x443a0d,locale:_0x47abdc}=this['context'],_0x37bbc1=_0x29a199(_0x443a0d['get']('locale'),_0x47abdc);return new(_0x443a0d['get']('comments.CommentThreadView'))(_0x47abdc,_0x3f2c89,_0x3ae429['me'],{'editorConfig':{...this['_getCommentEditorConfig']()},'copyMarkers':_0x443a0d['get']('comments.copyMarkers'),'maxCommentsWhenCollapsed':_0x443a0d['get']('comments.maxCommentsWhenCollapsed'),'maxThreadTotalWeight':_0x443a0d['get']('comments.maxThreadTotalWeight'),'maxCommentCharsWhenCollapsed':_0x443a0d['get']('comments.maxCommentCharsWhenCollapsed'),'formatDateTime':_0x37bbc1,'CommentView':_0x443a0d['get']('comments.CommentView')});}_getCommentEditorConfig(){if(!this['_commentEditorConfig']){const _0x1e5b1a=this['context']['config']['get']('comments.editorConfig');this['_commentEditorConfig']={..._0x1e5b1a,...this['_getCommentEditorOverlayConfig'](_0x1e5b1a),'licenseKey':this['context']['config']['get']('licenseKey')};}return this['_commentEditorConfig'];}_getCommentEditorOverlayConfig(_0x49ab52){const _0x52cec7=this['context']['config'],_0xb750fd=_0x49ab52?.['ui']?.['overlayContainer']||_0x52cec7['get']('sidebar.overlayContainer')||_0x52cec7['get']('ui.overlayContainer');return _0xb750fd?{'ui':{..._0x49ab52?.['ui'],'overlayContainer':_0xb750fd}}:{};}_resolveCommentThread({threadId:_0x3891f1,channelId:_0x47a99a,resolvedAt:_0x224a5d,resolvedBy:_0x21cc3a,isFromAdapter:_0x2b691c}){if(!this['hasCommentThread'](_0x3891f1))throw new _0x53d35c('commentsrepository-missing-comment-thread',null,{'threadId':_0x3891f1});const _0x1962e0=this['getCommentThread'](_0x3891f1);if(_0x1962e0['isResolved'])throw new _0x53d35c('commentsrepository-resolved-comment-thread',null,{'threadId':_0x3891f1});const _0x211828=this['context']['plugins']['get'](_0x1e93c2);if(_0x1962e0['resolvedBy']=_0x211828['getUser'](_0x21cc3a),_0x1962e0['resolvedAt']=_0x224a5d,_0x2b691c||!this['adapter']||'function'!=typeof this['adapter']['resolveCommentThread'])return Promise['resolve']();const _0x44befd=this['context']['plugins']['get']('PendingActions'),_0x37233a=_0x44befd['add'](Vt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['resolveCommentThread']({'channelId':_0x47a99a,'threadId':_0x3891f1})['then'](({resolvedAt:_0x10aa5d,resolvedBy:_0x24a5f7})=>{_0x44befd['remove'](_0x37233a),_0x1962e0['resolvedBy']['id']!==_0x24a5f7&&(_0x1962e0['resolvedBy']=_0x211828['getUser'](_0x24a5f7)),_0x1962e0['resolvedAt']=_0x10aa5d;})['catch'](_0x3a0adc=>{throw console['error'](_0x3a0adc),new _0x53d35c('commentsrepository-resolve-comment-thread-internal-error',this);});}_reopenCommentThread({threadId:_0x2467d1,channelId:_0x431be2,isFromAdapter:_0x2871d0}){if(!this['hasCommentThread'](_0x2467d1))throw new _0x53d35c('commentsrepository-missing-comment-thread',null,{'threadId':_0x2467d1});const _0x2bd579=this['getCommentThread'](_0x2467d1);if(!_0x2bd579['isResolved'])throw new _0x53d35c('commentsrepository-reopen-comment-thread',null,{'threadId':_0x2467d1});if(_0x2bd579['resolvedBy']=null,_0x2bd579['resolvedAt']=null,_0x2871d0||!this['adapter']||'function'!=typeof this['adapter']['reopenCommentThread'])return Promise['resolve']();const _0x4de94e=this['context']['plugins']['get']('PendingActions'),_0x3b0847=_0x4de94e['add'](Vt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['reopenCommentThread']({'channelId':_0x431be2,'threadId':_0x2467d1})['then'](()=>_0x4de94e['remove'](_0x3b0847))['catch'](_0x19d741=>{throw console['error'](_0x19d741),new _0x53d35c('commentsrepository-reopen-comment-thread-internal-error',this);});}_removeCommentThread({threadId:_0x41bf85,isFromAdapter:_0xb1c9cb}){const _0x343402=this['getCommentThread'](_0x41bf85);if(!_0x343402)throw new _0x53d35c('commentsrepository-remove-missing-comment-thread',this);if(this['_detachCommentThread'](_0x41bf85),this['_threads']['delete'](_0x41bf85),!_0x343402['isSubmitted']||_0xb1c9cb||!this['adapter']||'function'!=typeof this['adapter']['removeCommentThread'])return Promise['resolve']();const _0xa9b909=this['context']['plugins']['get']('PendingActions'),{channelId:_0x2bdf4d}=_0x343402,_0x1d12ea=_0xa9b909['add'](Vt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['removeCommentThread']({'channelId':_0x2bdf4d,'threadId':_0x41bf85})['then'](()=>_0xa9b909['remove'](_0x1d12ea))['catch'](_0x448517=>{throw console['error'](_0x448517),new _0x53d35c('commentsrepository-remove-comment-thread-internal-error',this);});}_updateCommentThread({threadId:_0x4c9e2e,unlinkedAt:_0xdd29f7,context:_0x480e67,attributes:_0x24d20d,isFromAdapter:_0x5a18c3}){if('string'!=typeof _0x4c9e2e)throw new _0x53d35c('commentsrepository-invalid-comment-thread-id',null,{'threadId':_0x4c9e2e});if(!this['hasCommentThread'](_0x4c9e2e))throw new _0x53d35c('commentsrepository-missing-comment-thread',null,{'threadId':_0x4c9e2e});const _0x46dac8=this['getCommentThread'](_0x4c9e2e);let _0x4e0ffb=!0x1;if(void 0x0!==_0x480e67&&_0x46dac8['context']!==_0x480e67&&(_0x46dac8['context']=_0x480e67,_0x4e0ffb=!0x0),void 0x0!==_0xdd29f7&&_0x46dac8['unlinkedAt']!==_0xdd29f7&&(_0x46dac8['unlinkedAt']=_0xdd29f7,_0x4e0ffb=!0x0),_0x24d20d&&!_0x1a79c4(_0x24d20d,_0x46dac8['attributes'])&&(_0x46dac8['attributes']=_0x24d20d,_0x4e0ffb=!0x0),!_0x4e0ffb)return Promise['resolve']();if(!_0x46dac8['isSubmitted']||_0x5a18c3||!this['adapter']||'function'!=typeof this['adapter']['updateCommentThread'])return Promise['resolve']();const _0x21ed1e=this['context']['plugins']['get']('PendingActions'),{channelId:_0x3d5d40}=_0x46dac8,_0x500113=_0x21ed1e['add'](Vt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['updateCommentThread']({'channelId':_0x3d5d40,'threadId':_0x4c9e2e,'context':_0x480e67,'unlinkedAt':_0xdd29f7,'attributes':_0x24d20d})['then'](()=>_0x21ed1e['remove'](_0x500113))['catch'](_0x5dfbd2=>{throw console['error'](_0x5dfbd2),new _0x53d35c('commentsrepository-update-comment-thread-internal-error',this);});}_detachCommentThread(_0x3873ef){const _0x138e1f=this['context']['plugins']['get'](me),_0xe9784a=this['getCommentThread'](_0x3873ef);if(_0xe9784a['_isAttached']=!0x1,this['_threadToController']['has'](_0xe9784a)){const _0x2194b5=this['_threadToController']['get'](_0xe9784a),_0x492452=_0x2194b5['view'],_0x211300=_0x138e1f['getByInnerView'](_0x492452);this['_threadToController']['delete'](_0xe9784a),this['_viewToController']['delete'](_0x492452),_0x211300&&_0x138e1f['remove'](_0x211300),_0x2194b5['destroy'](),_0x492452['destroy']()['then'](()=>{this['_unbindEditors'](_0x492452);});}}_updateActiveAnnotation({threadId:_0x152720,resolvedAt:_0x2afe27,unlinkedAt:_0x444c6f}){const _0x1cd785=!!_0x2afe27,_0x2bdd21=this['context']['plugins']['get'](me),_0x4718ce=this['getCommentThread'](_0x152720);if(this['_threadToController']['has'](_0x4718ce)){const _0x522ad1=this['_threadToController']['get'](_0x4718ce)['view'],_0xe1fe66=_0x2bdd21['getByInnerView'](_0x522ad1);_0xe1fe66&&(_0x1cd785&&_0x2bdd21['_removeActiveAnnotation'](_0xe1fe66),_0x444c6f?_0xe1fe66['isVisible']=!0x1:_0xe1fe66['refreshVisibility']());}}_getExternalAuthor(_0x37a235){const _0x2b5f41=this['context']['plugins']['get'](_0x1e93c2),_0x4386ca=_0x454306('external:'+_0x37a235),_0x22c93f=_0x2b5f41['getUser'](_0x4386ca);return _0x22c93f||_0x2b5f41['addUser']({'id':_0x4386ca,'name':_0x37a235});}_createNewComment({threadId:_0x2b494e,commentId:_0x2a9d04=_0x3109c5(),content:_0x30de2a,authorId:_0x498424,createdAt:_0x193d1b,attributes:_0x213bc9}){if('string'!=typeof _0x2a9d04)throw new _0x53d35c('commentsrepository-invalid-commentid');if('string'!=typeof _0x498424)throw new _0x53d35c('commentsrepository-invalid-comment-authorid');if('string'!=typeof _0x30de2a||!_0x30de2a['trim']())throw new _0x53d35c('commentsrepository-invalid-comment-content');const _0x4ab804=this['context']['plugins']['get'](_0x1e93c2)['getUser'](_0x498424);if(!_0x4ab804)throw new _0x53d35c('commentsrepository-add-comment-user-not-exists',null,{'authorId':_0x498424});let _0x1d1668=null,_0x1eda6e=_0x193d1b;return _0x213bc9?.['@external']&&(_0x1d1668=this['_getExternalAuthor'](_0x213bc9['@external']['authorName']),_0x1eda6e=new Date(_0x213bc9['@external']['createdAt'])),new Ae(this,{'threadId':_0x2b494e,'id':_0x2a9d04,'author':_0x1d1668||_0x4ab804,'creator':_0x4ab804,'content':_0x30de2a,'createdAt':_0x193d1b,'authoredAt':_0x1eda6e,'attributes':_0x213bc9});}_addComment(_0x32a6b8){let {threadId:_0x479662,content:_0x3d2c58,attributes:_0x2baa1,isFromAdapter:_0x65f2aa}=_0x32a6b8;const _0x4fb2d6=this['getCommentThread'](_0x32a6b8['threadId']);if(!_0x4fb2d6)throw new _0x53d35c('commentsrepository-add-comment-to-missing-comment-thread',this);const _0x20b16f=this['_createNewComment'](_0x32a6b8),{id:_0x480286}=_0x20b16f;if(_0x4fb2d6['_add'](_0x20b16f),_0x65f2aa||!this['adapter']||'function'!=typeof this['adapter']['addComment']||!_0x4fb2d6['isSubmitted'])return Promise['resolve']();const _0xde17ac=this['context']['plugins']['get']('PendingActions'),{channelId:_0x4ae1ba}=_0x4fb2d6,_0x56ef0b=_0xde17ac['add'](Vt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return _0x2baa1||(_0x2baa1={}),this['adapter']['addComment']({'channelId':_0x4ae1ba,'threadId':_0x479662,'commentId':_0x480286,'content':_0x3d2c58,'attributes':_0x2baa1})['then'](_0x478dd2=>{_0xde17ac['remove'](_0x56ef0b),_0x478dd2&&this['_updateComment']({'channelId':_0x4ae1ba,'threadId':_0x479662,'commentId':_0x480286,'createdAt':_0x478dd2['createdAt'],'isFromAdapter':!0x0});})['catch'](_0x4de7ee=>{throw console['error'](_0x4de7ee),new _0x53d35c('commentsrepository-add-comment-internal-error',this);});}_updateComment({threadId:_0x3b8776,commentId:_0x655655,content:_0x6ef23,createdAt:_0x3c0563,attributes:_0x44dd19,isFromAdapter:_0x25ffbe}){if(void 0x0!==_0x6ef23&&('string'!=typeof _0x6ef23||!_0x6ef23['trim']()['length']))throw new _0x53d35c('commentsrepository-update-comment-invalid-content');const _0x1aceda=this['getCommentThread'](_0x3b8776),_0x46c03e=_0x1aceda['getComment'](_0x655655);if(!_0x46c03e)throw new _0x53d35c('commentsrepository-update-missing-comment',this);let _0x580e44=!0x1;if(_0x6ef23&&_0x6ef23!==_0x46c03e['content']&&(_0x46c03e['isEditable']||_0x25ffbe)&&(_0x46c03e['content']=_0x6ef23,_0x580e44=!0x0),_0x3c0563&&_0x3c0563!==_0x46c03e['createdAt']&&(_0x46c03e['createdAt']=_0x3c0563,_0x46c03e['isExternal']||(_0x46c03e['authoredAt']=_0x3c0563),_0x580e44=!0x0),_0x44dd19&&!_0x1a79c4(_0x44dd19,_0x46c03e['attributes'])&&(_0x46c03e['attributes']=_0x44dd19,_0x580e44=!0x0),!_0x580e44)return Promise['resolve']();if(_0x1aceda['fire']('commentUpdated'),_0x25ffbe||!this['adapter']||'function'!=typeof this['adapter']['updateComment'])return Promise['resolve']();const _0x1a2f29=this['context']['plugins']['get']('PendingActions'),{channelId:_0x54a81c}=this['getCommentThread'](_0x46c03e['threadId']),_0x9bc8bf=_0x1a2f29['add'](Vt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['updateComment']({'channelId':_0x54a81c,'threadId':_0x3b8776,'commentId':_0x655655,'content':_0x6ef23,'attributes':_0x44dd19})['then'](()=>_0x1a2f29['remove'](_0x9bc8bf))['catch'](_0xbbceda=>{throw console['error'](_0xbbceda),new _0x53d35c('commentsrepository-update-comment-internal-error',this);});}_removeComment({threadId:_0xcd26b8,commentId:_0x50eb06,isFromAdapter:_0x57184e}){const _0x5dd3bc=this['getCommentThread'](_0xcd26b8),_0x5e1442=_0x5dd3bc['getComment'](_0x50eb06);if(!_0x5e1442)throw new _0x53d35c('commentsrepository-remove-missing-comment',this);if(_0x5dd3bc['_remove'](_0x5e1442),_0x57184e||!this['adapter']||'function'!=typeof this['adapter']['removeComment'])return Promise['resolve']();const _0x37e6ca=this['context']['plugins']['get']('PendingActions'),{channelId:_0x14311c}=_0x5dd3bc,_0x538238=_0x37e6ca['add'](Vt(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['removeComment']({'channelId':_0x14311c,'threadId':_0xcd26b8,'commentId':_0x50eb06})['then'](()=>_0x37e6ca['remove'](_0x538238))['catch'](_0xf0c804=>{throw console['error'](_0xf0c804),new _0x53d35c('commentsrepository-remove-comment-internal-error',this);});}},ge=class extends pe{['channelId'];['id'];_isAttached;_isSubmitted;comments;_repository;constructor(_0x3506d3,_0x408db6){super();const _0x17b793=_0x408db6['isResolvable'];this['channelId']=_0x408db6['channelId'],this['id']=_0x408db6['id'],this['comments']=new _0x4c91ff(),this['_repository']=_0x3506d3,this['_isAttached']=!0x1,this['_isSubmitted']=_0x408db6['isSubmitted'],this['set']('_hasTargetInContent',!0x0),this['bind']('isReadOnly')['to'](_0x3506d3,'_permissions',_0x3506d3,'_readOnlyChannels',()=>_0x3506d3['isReadOnly'](this['channelId'])),this['bind']('isRemovable')['to'](_0x3506d3,'_permissions',()=>_0x3506d3['getPermissions'](this['channelId'])['admin']),this['bind']('canComment')['to'](_0x3506d3,'_permissions',()=>{const _0x4a3428=_0x3506d3['getPermissions'](this['channelId']);return _0x4a3428['write']||_0x4a3428['admin'];}),this['bind']('isResolvable')['to'](_0x3506d3,'_permissions',()=>_0x17b793&&_0x3506d3['getPermissions'](this['channelId'])['resolve']),this['set']('context',_0x408db6['context']),this['bind']('archivedAt')['to'](this,'resolvedAt',this,'unlinkedAt',(_0x1d02c8,_0x2de6b8)=>_0x1d02c8?_0x2de6b8?_0x1d02c8<_0x2de6b8?_0x1d02c8:_0x2de6b8:_0x1d02c8:_0x2de6b8),this['set']('unlinkedAt',_0x408db6['unlinkedAt']||null),this['set']('resolvedAt',_0x408db6['resolvedAt']||null),this['set']('resolvedBy',_0x408db6['resolvedBy']||null),this['bind']('isResolved')['to'](this,'resolvedAt',_0x1e50f0=>!!_0x1e50f0),this['set']('attributes',_0x408db6['attributes']||{});}get weight(){return Array['from'](this['comments'])['reduce']((_0x34843f,_0x489b0a)=>_0x34843f+_0x489b0a['weight'],0x0);}get length(){return this['comments']['length'];}get isAttached(){return this['_isAttached'];}get isSubmitted(){return this['_isSubmitted'];}submit(){const {channelId:_0x3e15aa,id:_0x3f72c2}=this;this['_repository']['fire'](ve('submitCommentThread',_0x3e15aa),{'channelId':_0x3e15aa,'threadId':_0x3f72c2});}setUnlinkedAt(_0x293563){this['_update']({'unlinkedAt':_0x293563});}['resolve']({resolvedAt:_0x28e42c=new Date(),resolvedBy:_0x4e248f='',isFromAdapter:_0x4144d9=!0x1}={}){const _0x202fb9=this['_repository']['context']['plugins']['get'](_0x1e93c2)['me'],{channelId:_0x3ef7e6,id:_0x185b8c}=this;this['_repository']['fire'](ve('resolveCommentThread',_0x3ef7e6),{'channelId':_0x3ef7e6,'threadId':_0x185b8c,'resolvedAt':_0x28e42c,'resolvedBy':_0x4e248f||_0x202fb9['id'],'isFromAdapter':_0x4144d9});}['reopen']({isFromAdapter:_0x70714d=!0x1}={}){const {channelId:_0x27cb24,id:_0x4f2d9e}=this;this['_repository']['fire'](ve('reopenCommentThread',_0x27cb24),{'channelId':_0x27cb24,'threadId':_0x4f2d9e,'isFromAdapter':_0x70714d});}setContext(_0x3ad655){this['context']||this['_update']({'context':_0x3ad655});}setAttribute(_0x3c11e7,_0x3aecf7){const _0x2c5e62=_0x31900c(this['attributes']);_0x1976cd(_0x2c5e62,_0x3c11e7,_0x3aecf7),this['_update']({'attributes':_0x2c5e62});}removeAttribute(_0x173fc7){const _0x3cd0cd=_0x31900c(this['attributes']);_0x316b96(_0x3cd0cd,_0x173fc7),this['_update']({'attributes':_0x3cd0cd});}['remove']({isFromAdapter:_0x35aa9d=!0x1}={}){const {channelId:_0x136e51,id:_0xfdeb6d}=this;this['_repository']['fire'](ve('removeCommentThread',_0x136e51),{'channelId':_0x136e51,'threadId':_0xfdeb6d,'isFromAdapter':_0x35aa9d});}attachTo(_0x5d4183){return this['_repository']['_attachCommentThread']({'threadId':this['id'],'target':_0x5d4183});}addComment(_0x197f3e){const {channelId:_0x4c5805,id:_0x4359c0}=this;this['_repository']['fire'](ve('addComment',_0x4c5805,_0x4359c0),Object['assign']({'channelId':_0x4c5805,'threadId':_0x4359c0},_0x197f3e));}getComment(_0x1701bc){if('string'!=typeof _0x1701bc)throw new _0x53d35c('commentsrepository-get-comment-invalid-id',null,{'commentId':_0x1701bc});return this['comments']['get'](_0x1701bc);}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'](_0x215993=>_0x215993['toJSON']()),'attributes':this['attributes']};}['_add'](_0x43adcd){return this['listenTo'](_0x43adcd,'change:authoredAt',()=>{const _0x1f760b=this['_findOptimalIndex'](_0x43adcd),_0x3917f6=this['comments'];_0x1f760b-0x1!=_0x3917f6['getIndex'](_0x43adcd)&&_0x1f760b+0x1!=_0x3917f6['getIndex'](_0x43adcd)&&(this['_remove'](_0x43adcd),this['_add'](_0x43adcd));}),this['comments']['add'](_0x43adcd,this['_findOptimalIndex'](_0x43adcd));}_update(_0x15910a){const {channelId:_0x359212,id:_0x3ffc61}=this;this['_repository']['fire'](ve('updateCommentThread',_0x359212),{..._0x15910a,'channelId':_0x359212,'threadId':_0x3ffc61});}['_remove'](_0x51d572){return this['stopListening'](_0x51d572),_0x51d572['destroy'](),this['comments']['remove'](_0x51d572);}_findOptimalIndex(_0x2f285b){const _0x289b90=this['comments']['find'](_0x427a9d=>new Date(_0x427a9d['authoredAt'])['getTime']()>new Date(_0x2f285b['authoredAt'])['getTime']());return _0x289b90?this['comments']['getIndex'](_0x289b90):this['length'];}},Ae=class extends _e{['id'];threadId;author;creator;createdAt;_repository;constructor(_0x582639,_0x163ce7){super();const _0x358cb2=_0x582639['context']['plugins']['get'](_0x1e93c2)['me'],_0x233187=_0x582639['getCommentThread'](_0x163ce7['threadId']),_0x3ff4b6=0x0===_0x233187['comments']['length'],_0x27fbf4=_0x358cb2===_0x163ce7['author'];this['id']=_0x163ce7['id'],this['threadId']=_0x163ce7['threadId'],this['author']=_0x163ce7['author'],this['creator']=_0x163ce7['creator'],this['set']('content',_0x163ce7['content']),this['createdAt']=_0x163ce7['createdAt']||new Date(),this['set']('authoredAt',_0x163ce7['authoredAt']||new Date()),this['bind']('resolvedAt')['to'](_0x233187,'resolvedAt'),this['set']('attributes',_0x163ce7['attributes']||{}),this['bind']('isEditable')['to'](_0x582639,'_permissions',()=>{const _0x514cd2=_0x582639['getPermissions'](_0x233187['channelId'])['write'],_0x491e19=_0x582639['getPermissions'](_0x233187['channelId'])['modifyAll'];return _0x27fbf4&&_0x514cd2||!_0x27fbf4&&_0x491e19;}),this['bind']('isRemovable')['to'](_0x233187,'isRemovable',_0x582639,'_permissions',_0x10b1db=>{const _0x4943e5=_0x582639['getPermissions'](_0x233187['channelId'])['write'],_0x2e9531=_0x582639['getPermissions'](_0x233187['channelId'])['modifyAll'];return _0x27fbf4&&_0x4943e5||_0x10b1db&&_0x3ff4b6||!_0x27fbf4&&_0x2e9531&&!_0x3ff4b6;}),this['bind']('isReadOnly')['to'](_0x233187,'isReadOnly'),this['_repository']=_0x582639;}get isExternal(){return Boolean(this['attributes']&&this['attributes']['@external']);}get weight(){return Math['max'](function(_0x112af3){const _0xd546ca=document['createElement']('div');return _0xd546ca['innerHTML']=_0x118aa0(_0x112af3),_0xd546ca['textContent']['length'];}(this['content']),0xc8);}update(_0x4ffb43){const {threadId:_0x17cb95,id:_0x28fbe1}=this;if(!this['_repository']['hasCommentThread'](_0x17cb95))throw new _0x53d35c('commentsrepository-update-comment-missing-comment-thread',this);const {channelId:_0x220215}=this['_repository']['getCommentThread'](_0x17cb95);this['_repository']['fire'](ve('updateComment',_0x220215,_0x17cb95),{'channelId':_0x220215,'threadId':_0x17cb95,'commentId':_0x28fbe1,..._0x4ffb43});}setAttribute(_0x10b961,_0x216127){const _0x224a66=_0x31900c(this['attributes']);_0x1976cd(_0x224a66,_0x10b961,_0x216127),this['update']({'attributes':_0x224a66});}removeAttribute(_0x3fca9c){const _0x14286c=_0x31900c(this['attributes']);_0x316b96(_0x14286c,_0x3fca9c),this['update']({'attributes':_0x14286c});}['remove'](_0x2df850={}){if(!_0x2df850['isFromAdapter']&&!this['isRemovable'])return;const {threadId:_0x3e1dc3,id:_0x364064}=this;if(!this['_repository']['hasCommentThread'](_0x3e1dc3))throw new _0x53d35c('commentsrepository-remove-comment-missing-comment-thread',this);const {channelId:_0x1f6d9f}=this['_repository']['getCommentThread'](_0x3e1dc3);this['_repository']['fire'](ve('removeComment',_0x1f6d9f,_0x3e1dc3),{'channelId':_0x1f6d9f,'threadId':_0x3e1dc3,'commentId':_0x364064,..._0x2df850});}toJSON(){return{'commentId':this['id'],'content':this['content'],'createdAt':this['createdAt'],'authorId':this['creator']['id'],'attributes':this['attributes']};}destroy(){this['stopListening']();}};function ve(_0x4c94fd,..._0x12120e){for(const _0x577e52 of _0x12120e)void 0x0!==_0x577e52&&(_0x4c94fd+=':'+String(_0x577e52));return _0x4c94fd;}var Te=class extends _0x212797{constructor(_0x4c352c){super(_0x4c352c),this['set']('hasContent',!0x1);}['refresh'](){const _0xfcb737=this['editor']['model']['document']['selection'];this['isEnabled']=!0x0,this['hasContent']=!0x1;for(const _0x5991a4 of _0xfcb737['getRanges']())if(this['_hasContent'](_0x5991a4))return void(this['hasContent']=!0x0);}execute({threadId:_0x4763a6=_0x3109c5(),ranges:_0x445f72,comment:_0x332949}={}){const _0x2a9648=this['editor']['model'],_0x7b782=_0x445f72??Array['from'](_0x2a9648['document']['selection']['getRanges']()),_0x55c2f5=[];for(const _0x2a754e of _0x7b782)this['_hasContent'](_0x2a754e)&&_0x55c2f5['push'](this['_trimToContent'](_0x2a754e));if(!_0x55c2f5['length'])throw new _0x53d35c('addcommentthreadcommand-incorrect-ranges',null);_0x332949&&this['_createCommentThread'](_0x4763a6,_0x332949),this['_createMarkersFromRanges'](_0x4763a6,_0x55c2f5,!!_0x332949);}_createMarkersFromRanges(_0x3f8b39,_0x3eae2f,_0x5602d6){this['editor']['model']['change'](_0x3ea030=>{for(const _0x3f6250 of _0x3eae2f){const _0x3e8b97='comment:'+_0x3f8b39+':'+_0x3109c5()['substr'](0x1,0x5);_0x3ea030['addMarker'](_0x3e8b97,{'range':_0x3f6250,'usingOperation':_0x5602d6,'affectsData':_0x5602d6});}});}_createCommentThread(_0x57a521,_0x3b4d8f){const _0xa43e69=this['editor']['plugins']['get']('CommentsRepository'),_0x774552=this['editor']['config']['get']('collaboration.channelId'),_0x4c5759=this['editor']['plugins']['get']('Users')['me'];if(!_0x4c5759)throw new _0x53d35c('addcommentthreadcommand-user-not-found',null);_0xa43e69['addCommentThread']({'threadId':_0x57a521,'channelId':_0x774552,'comments':[{'authorId':_0x4c5759['id'],'content':_0x3b4d8f,'createdAt':new Date(),'attributes':{}}]});}_hasContent(_0x215c06){for(const _0x2ecddc of _0x215c06['getItems']())if(this['_itemIsContent'](_0x2ecddc))return!0x0;return!0x1;}_itemIsContent(_0x3b570b){return _0x3b570b['is']('$textProxy')||this['editor']['model']['schema']['isObject'](_0x3b570b)&&!_0x3b570b['is']('element','tableCell');}_trimToContent(_0x173c4f){const _0x431e6a=_0x538c38=>!this['_itemIsContent'](_0x538c38['item']),_0x14ebd8=_0x173c4f['start']['getLastMatchingPosition'](_0x431e6a),_0x15d78d=_0x173c4f['end']['getLastMatchingPosition'](_0x431e6a,{'direction':'backward'});return this['editor']['model']['createRange'](_0x14ebd8,_0x15d78d);}},ye=class extends _0x287b4d{_dataCollectors;_editorAnnotations;static get requires(){return[me];}static get['pluginName'](){return'EditorAnnotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x531ec3){super(_0x531ec3),this['_dataCollectors']=new Set(),this['_editorAnnotations']=new Set();}init(){const _0x4337c7=this['editor'],_0x5a62be=_0x4337c7['model']['document']['selection'],_0x3d7c03=_0x52fb1a(()=>this['refreshSelectedViews'](),0xa);_0x5a62be['on']('change:range',(_0x19b428,_0x3fef22)=>{_0x3fef22['directChange']&&(_0x3d7c03['cancel'](),this['refreshSelectedViews']());}),this['listenTo'](_0x4337c7['editing']['view']['document'],'change:isFocused',(_0x5a782c,_0x14296f,_0x1d66c2)=>{_0x1d66c2&&_0x3d7c03();}),this['listenTo'](_0x4337c7['ui']['focusTracker'],'change:isFocused',(_0x3cd82d,_0x2f2ce3,_0x59e826)=>{_0x59e826||this['fire']('blur',{'isAnnotationTracked':_0x33d52e=>this['_editorAnnotationsData']['has'](_0x33d52e['innerView'])});}),this['listenTo'](this['editor']['ui'],'update',()=>this['fire']('uiUpdate'));}registerAnnotation(_0x442c46){if(this['_editorAnnotations']['has'](_0x442c46['view']))return;this['_editorAnnotations']['add'](_0x442c46['view']),this['editor']['ui']['focusTracker']['add'](_0x442c46['view']['element']);const _0x373dcb=this['editor']['plugins']['get'](me);this['listenTo'](_0x373dcb['collection'],'remove',(_0xc4313b,_0x2bc385)=>{this['editor']['ui']['focusTracker']['remove'](_0x2bc385['view']['element']),this['_editorAnnotations']['delete'](_0x2bc385['view']);});}hasDomSelection(){return this['editor']['editing']['view']['hasDomSelection'];}addSourceCollector(_0x59f003){if('function'!=typeof _0x59f003)throw new _0x53d35c('editorannotations-invalid-source-callback');this['_dataCollectors']['add'](_0x59f003);}refreshSelectedViews(){this['fire']('refresh');}getOrderedSelectedAnnotations({activeAnnotation:_0x29f6fd,annotations:_0x51d55f}){const _0x2d5040=[],_0x1cebda=this['editor']['model']['document']['selection'],_0x2cc9fe=Array['from'](_0x1cebda['getRanges']());for(const [_0x6d5fe0,_0xefe21c]of this['_editorAnnotationsData']){const _0x216029=_0x14ce8e(_0xefe21c),_0x10ec89=_0x51d55f['getByInnerView'](_0x6d5fe0);_0x216029&&_0x10ec89&&_0x2d5040['push']({'annotation':_0x10ec89,'range':_0x216029});}function _0x14ce8e(_0x149cb4){for(const _0x3751be of _0x149cb4)for(const _0x42601d of _0x2cc9fe)if(_0x3751be['containsRange'](_0x42601d,!_0x1cebda['isCollapsed']))return _0x3751be;return null;}const _0x4482dd=new Map(Array['from'](_0x51d55f,(_0x151a1e,_0x563db)=>[_0x151a1e,_0x563db]));return _0x2d5040['sort']((_0xaae384,_0x30a00a)=>{const _0x5e4889=_0xaae384['range'],_0x554d13=_0x30a00a['range'];if(!_0x5e4889['start']['isTouching'](_0x554d13['start'])||!_0x5e4889['end']['isTouching'](_0x554d13['end'])){if(_0x5e4889['containsRange'](_0x554d13,!0x0))return 0x1;if(_0x554d13['containsRange'](_0x5e4889,!0x0))return-0x1;}return _0xaae384['annotation']==_0x29f6fd?-0x1:_0x30a00a['annotation']==_0x29f6fd?0x1:(_0x4482dd['get'](_0xaae384['annotation'])??0x0)-(_0x4482dd['get'](_0x30a00a['annotation'])??0x0);})['map'](_0x2dd39e=>_0x2dd39e['annotation']);}get _editorAnnotationsData(){const _0x3a8037=new Map();for(const _0x2bff0b of Array['from'](this['_dataCollectors']))for(const [_0x51b138,_0x35d209]of _0x2bff0b())_0x3a8037['set'](_0x51b138,_0x35d209);return _0x3a8037;}},Ce=class extends _0x287b4d{afterInit(){const _0x411097=this['editor'];_0x411097['plugins']['has']('RestrictedEditingModeEditing')&&_0x411097['plugins']['get']('RestrictedEditingModeEditing')['enableCommand']('addCommentThread');}},Ie=class extends _0x287b4d{constructor(_0x18eb1b){super(_0x18eb1b),this['editor']['config']['define']('importWord.formatting.comments','basic');}afterInit(){const _0x3e713f=this['editor'],_0xa4951c=_0x3e713f['commands']['get']('importWord'),_0x452f2d=_0x3e713f['plugins']['get'](_0x1e93c2);_0xa4951c&&(_0xa4951c['on']('execute',(_0x5e76f4,[,_0x1eccb7])=>{_0x1eccb7['collaboration_features']={'comments':!0x0,'user_id':_0x452f2d['me']['id']};},{'priority':_0x50a307['high']+0xa}),this['listenTo'](_0xa4951c,'dataInsert',this['_handleImportedData']));}_handleImportedData(_0x433df4,_0x378317){const {comment_threads:_0x318414}=_0x378317;_0x318414&&_0x318414['forEach'](({thread_id:_0x376104,comments:_0x38fbf6,is_resolved:_0x5cf673})=>{const _0x4e7a15=new Date(),_0x3cb72c=_0x38fbf6['map'](({author:_0xe045c9,content:_0x1296d3,created_at:_0x1f9882})=>({'content':_0x1296d3,'authorId':this['editor']['plugins']['get'](_0x1e93c2)['me']['id'],'createdAt':_0x4e7a15,'attributes':{'@external':{'authorName':_0xe045c9,'createdAt':_0x1f9882?new Date(_0x1f9882):new Date(),'source':'importWord'}}})),_0x18b125=this['editor']['config']['get']('collaboration.channelId');this['editor']['plugins']['get'](we)['addCommentThread']({'channelId':_0x18b125,'threadId':_0x376104,'comments':_0x3cb72c,'resolvedAt':_0x5cf673?_0x4e7a15:null});});}},be=class extends _0x287b4d{constructor(_0x254df9){super(_0x254df9),this['editor']['config']['define']('comments.copyMarkers','default');}static get requires(){return[Et,kt];}afterInit(){const _0x4b0497=this['editor']['plugins']['get']('ClipboardPipeline');this['_registerMarkerInClipboardPipeline'](),this['listenTo'](_0x4b0497,'contentInsertion',(_0x2ff218,_0x171a12)=>this['_removeMarkersWithoutThreads'](_0x171a12['content']['markers']),{'priority':'highest'});}_removeMarkersWithoutThreads(_0x1355e5){if(!this['editor']['plugins']['has']('CommentsRepository'))return _0x1355e5;const _0x1d13c1=this['editor']['plugins']['get']('CommentsRepository');for(const _0x3d64e0 of _0x1355e5['keys']()){const [_0x59a6a3,_0x265b1e]=_0x3d64e0['split'](':');'comment'!=_0x59a6a3||_0x1d13c1['hasCommentThread'](_0x265b1e)||_0x1355e5['delete'](_0x3d64e0);}return _0x1355e5;}_registerMarkerInClipboardPipeline(){const _0x3396f0=this['editor']['plugins']['get']('ClipboardMarkersUtils'),_0x3e489e=this['_mapCommentsCopyConfigToRegisterConfiguration'](this['editor']['config']['get']('comments.copyMarkers'));_0x3e489e&&_0x3396f0['_registerMarkerToCopy']('comment',_0x3e489e);}_mapCommentsCopyConfigToRegisterConfiguration(_0x2e4d57){switch(_0x2e4d57){case'always':return{'allowedActions':'all','copyPartiallySelected':!0x1,'duplicateOnPaste':!0x0};case'default':return{'allowedActions':['cut','dragstart'],'copyPartiallySelected':!0x1,'duplicateOnPaste':!0x1};default:return null;}}};function Ee(_0x311b83){const _0x115f10=_0x311b83['split'](':');return{'group':_0x115f10[0x0],'id':_0x115f10[0x1],'part':_0x115f10[0x2]};}var ke=class extends _0x287b4d{init(){this['overrideMarkerConverters'](),this['overrideHorizontalRuleConverter'](),this['overrideImageInlineConverter'](),this['overrideMediaEmbedConverter']();}overrideMarkerConverters(){this['editor']['conversion']['for']('dataDowncast')['markerToHighlight']({'model':'comment','view':(_0x447485,_0x443df0)=>{if(!_0x443df0['options']['showCommentHighlights'])return null;if(_0x443df0['options']['ignoreResolvedComments']){const {id:_0x1df9d4}=Ee(_0x447485['markerName']);if(this['editor']['plugins']['get'](we)['getCommentThread'](_0x1df9d4)?.['isResolved']&&_0x447485['item'])return _0x443df0['consumable']['consume'](_0x447485['item'],'addMarker:'+_0x447485['markerName']),_0x443df0['consumable']['consume'](_0x447485['item'],'removeMarker:'+_0x447485['markerName']),null;}return{'classes':['ck-comment-marker']};}}),this['editor']['conversion']['for']('dataDowncast')['add'](_0x424bf=>{_0x424bf['on']('addMarker:comment',(_0x474026,_0x608934,_0x3efb93)=>{if(!_0x3efb93['options']['showCommentHighlights'])return;const _0x5a5a34=_0x608934['item'];if(!_0x5a5a34)return;const _0x4aedb4=_0x3efb93['mapper']['toViewElement'](_0x5a5a34);this['editor']['model']['schema']['isObject'](_0x5a5a34)&&_0x4aedb4&&!_0x4aedb4['getCustomProperty']('widget')&&_0x4aedb4['is']('containerElement')&&Pt(_0x4aedb4,_0x3efb93['writer']);},{'priority':'high'});});}overrideHorizontalRuleConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToStructure']({'model':'horizontalLine','view':(_0x281345,{writer:_0x20b77a,options:_0x2a7c27})=>{if(!_0x2a7c27['showCommentHighlights'])return null;const _0x3a23d0=_0x20b77a['createContainerElement']('div'),_0x4fcb2a=_0x20b77a['createEmptyElement']('hr');return _0x20b77a['addClass']('ck-horizontal-line',_0x3a23d0),_0x20b77a['insert'](_0x20b77a['createPositionAt'](_0x3a23d0,0x0),_0x4fcb2a),_0x3a23d0;},'converterPriority':'high'});}overrideImageInlineConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToStructure']({'model':'imageInline','view':(_0x1b0de1,{writer:_0x116930,options:_0x155a73})=>{if(!_0x155a73['showCommentHighlights'])return null;const _0x51a90c=_0x116930['createContainerElement']('span'),_0x8bb973=_0x116930['createEmptyElement']('img');return _0x116930['addClass']('image-inline',_0x51a90c),_0x116930['insert'](_0x116930['createPositionAt'](_0x51a90c,0x0),_0x8bb973),_0x51a90c;},'converterPriority':'high'});}overrideMediaEmbedConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToElement']({'model':'media','view':(_0x120579,{writer:_0x1ab622,options:_0x11aa9e})=>{if(_0x11aa9e['showCommentHighlights'])return _0x1ab622['createEmptyElement']('div');},'converterPriority':'high'}),this['editor']['data']['downcastDispatcher']['on']('attribute:url:media',(_0x32109d,_0x2be36e,_0x65be56)=>{_0x65be56['options']['showCommentHighlights']&&_0x32109d['stop']();},{'priority':'high'});}},Ne=class extends _0x287b4d{static get requires(){return[we,ye,_0x1e93c2,Ce,Ie,be,ke];}static get['pluginName'](){return'CommentsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2c0214){super(_0x2c0214),this['set']('isThreadsLoadingPaused',!0x0),_0x2c0214['data']['once']('ready',()=>this['isThreadsLoadingPaused']=!0x1),this['set']('activeMarker',null),this['on']('change:activeMarker',(_0x58fbc3,_0x135d2f,_0x85acbc,_0x2b907e)=>{const _0x16fa18=_0x2c0214['plugins']['get'](we),_0x3719c4=_0x85acbc?Ee(_0x85acbc)['id']:null;_0x2c0214['model']['change'](()=>{if(_0x3719c4){const _0x2cdb79=this['getAllMarkersForId'](_0x3719c4);for(const _0x4323f1 of _0x2cdb79)_0x2c0214['editing']['reconvertMarker'](_0x4323f1);}if(_0x2b907e){const {id:_0x2f18b5}=Ee(_0x2b907e),_0x5cd2b3=_0x16fa18['getCommentThread'](_0x2f18b5);if(_0x5cd2b3&&_0x5cd2b3['unlinkedAt'])return;if(_0x5cd2b3&&!_0x5cd2b3['isAttached'])return;const _0x113a90=this['getAllMarkersForId'](_0x2f18b5);for(const _0x208045 of _0x113a90)_0x2c0214['editing']['reconvertMarker'](_0x208045);}}),_0x3719c4&&this['scrollToThreadMarker'](_0x3719c4);}),this['_initAriaMarkerChangeAnnouncements']();}init(){const _0x1db1f2=this['editor'],_0x2e832a=_0x1db1f2['plugins']['get'](we),_0x13b003=_0x1db1f2['config']['get']('collaboration.channelId'),_0x2689ed=_0x2e832a['getCommentThreads']()['filter'](_0x4b4735=>_0x4b4735['channelId']!==_0x13b003);_0x1db1f2['commands']['add']('addCommentThread',new Te(_0x1db1f2)),this['listenTo'](_0x1db1f2,'change:isReadOnly',(_0x52477b,_0x6b732,_0x165cc2)=>{_0x2e832a['switchReadOnly'](_0x165cc2,_0x1db1f2['config']['get']('collaboration.channelId'));}),this['listenTo'](_0x2e832a,Oe('addCommentThread',_0x13b003),(_0x5b2d56,{threadId:_0x103afe})=>{this['editor']['plugins']['get'](we)['getCommentThread'](_0x103afe)?.['unlinkedAt']&&this['_attachArchivedThread'](_0x103afe);}),this['listenTo'](_0x2e832a,Oe('removeCommentThread',_0x13b003),(_0x527826,{threadId:_0x1a0e26})=>{_0x1db1f2['model']['enqueueChange']({'isUndoable':!0x1},_0x5b2bbd=>{const _0x244994=this['getAllMarkersForId'](_0x1a0e26);for(const _0x2a5a02 of _0x244994)_0x5b2bbd['removeMarker'](_0x2a5a02);});}),this['listenTo'](_0x2e832a,Oe('resolveCommentThread',_0x13b003),(_0x234284,{threadId:_0x47421d})=>{this['_reconvertMarkers'](_0x47421d);const _0x203da1=this['editor']['plugins']['get'](me);(this['editor']['editing']['view']['hasDomSelection']||_0x203da1['collection']['isFocused'])&&(this['editor']['plugins']['get'](we)['getCommentThread'](_0x47421d)['unlinkedAt']||this['editor']['editing']['view']['focus']());},{'priority':'low'}),this['listenTo'](_0x2e832a,Oe('reopenCommentThread',_0x13b003),(_0x4c6cf6,{threadId:_0x53cdb4})=>{this['_reconvertMarkers'](_0x53cdb4);},{'priority':'low'}),this['listenTo'](_0x2e832a,Oe('addComment',_0x13b003),(_0x56c537,{threadId:_0x107c4f,isFromAdapter:_0x2f1a33})=>{const _0x5d9538=this['getAllMarkersForId'](_0x107c4f);!_0x2f1a33&&0x0!=_0x5d9538['length']&&_0x2e832a['hasCommentThread'](_0x107c4f)&&0x1===_0x2e832a['getCommentThread'](_0x107c4f)['length']&&_0x1db1f2['model']['enqueueChange']({'isUndoable':!0x1},_0x707b1f=>{for(const _0x2c7a33 of _0x5d9538)_0x707b1f['updateMarker'](_0x2c7a33,{'usingOperation':!0x0,'affectsData':!0x0});});},{'priority':'low'}),this['_initializeMarkerConverters'](),this['_handleMarkerAddAndRemove'](),this['_handleInitialThreads'](_0x2689ed);}afterInit(){!async function(_0x102268){const _0x2a72a3='uizTdvyBIa4RKsnOYmEXGMfjehwJQqbPSCk7DtZgF58Lxl29Ho6cAUW1pV3Nr0',_0x452fc0=0x79a28,_0xfe6039={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x553066(_0x5cd68a){const _0x2347fd=new window['Promise'](_0x444556=>{_0x5cd68a['once']('ready',_0x444556);}),_0x39747c=window['Date']['now'](),_0x46c876=_0x5cd68a['config']['get']('licenseKey');async function _0x5aaec9(){let _0x45e17d,_0xff6af7=null,_0x51aa1c=null;try{return'GPL'==_0x46c876?'NotAllowed':(_0x45e17d=_0x3981dd(),_0x45e17d?(_0x45e17d['usageEndpoint']&&(_0x51aa1c=_0x5b2228(_0x45e17d['usageEndpoint'],_0x45e17d['jti'])),await _0x134796()?_0x12cc42()?_0x104fdd()?'Expired':_0x3fbe50()?('evaluation'==_0x45e17d['licenseType']&&(_0xff6af7=_0x4ba4d6('EvaluationLimit')),await _0xfa450b()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x104fdd(){const _0x56208c=['evaluation','trial']['includes'](_0x45e17d['licenseType'])?_0x39747c/0x3e8:0xe10*_0x452fc0;return _0x45e17d['exp']<_0x56208c;}function _0x12cc42(){const _0x14158e=_0x45e17d['features'];if(!_0x14158e)return!0x1;if(_0x14158e['includes']('*'))return!0x0;if(_0x14158e['includes']('CMT'))return!0x0;if(_0x14158e['includes']('TRILIUM')&&_0xcdd826())return!0x0;if(_0x14158e['includes']('RCMT')){if(_0x348e19())return!0x0;if(_0x25a89a()||_0xaedc35())return!0x0;}return!0x1;}function _0x3fbe50(){const _0x176cc6=_0x45e17d['licensedHosts'];if(!_0x176cc6||0x0==_0x176cc6['length'])return!0x0;const {hostname:_0x1e08d4}=new URL(window['location']['href']);if(_0x176cc6['includes'](_0x1e08d4))return!0x0;const _0x580883=_0x1e08d4['split']('.');return _0x176cc6['filter'](_0x365957=>_0x365957['includes']('*'))['map'](_0x4f69b4=>_0x4f69b4['split']('.'))['filter'](_0x3d4760=>_0x3d4760['length']<=_0x580883['length'])['map'](_0x427b89=>Array(_0x580883['length']-_0x427b89['length'])['fill']('*'===_0x427b89[0x0]?'*':'')['concat'](_0x427b89))['some'](_0x49da97=>_0x580883['every']((_0x569ff4,_0x1223df)=>_0x49da97[_0x1223df]===_0x569ff4||'*'===_0x49da97[_0x1223df]));}function _0xfa450b(){return _0xff6af7&&_0x51aa1c?new window['Promise']((_0x539b1a,_0x4c3dbf)=>{_0xff6af7['then'](_0x539b1a,_0x4c3dbf),_0x51aa1c['then'](_0x1627a1=>{'Valid'!=_0x1627a1&&_0x539b1a(_0x1627a1);},_0x4c3dbf);}):_0xff6af7||_0x51aa1c||'Valid';}}function _0x5b2228(_0x40698,_0x415e4e){return new window['Promise'](_0x115c7e=>{if(_0xff0cdb())return _0x115c7e('Valid');_0x340aaf(),_0x5cd68a['decorate']('_sendUsageRequest');let _0x5b4d27=!0x1;const _0x5eb1c3=_0x3109c5();function _0x532ee1(_0x91a33a){return!!_0x91a33a&&('object'==typeof _0x91a33a||'function'==typeof _0x91a33a)&&'function'==typeof _0x91a33a['then']&&'function'==typeof _0x91a33a['catch'];}function _0x1f99c9(_0xe31f90){_0x4a62da(_0xe31f90)['then'](_0x574e61=>_0x574e61&&'ok'==_0x574e61['status']?_0x26962a(_0x1ddbb3(_0x5eb1c3+_0x415e4e))!=_0x574e61['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x32e72b=>(_0x35f8c6(),_0x32e72b),()=>{const _0x1e802a=_0x164999();return null==_0x1e802a?(_0x35f8c6(),'Valid'):_0x39747c-_0x1e802a>0x240c8400?'UsageLimit':'Valid';})['then'](_0x115c7e)['catch'](()=>{_0x115c7e('UsageLimit');});const _0xf37e91=0x36ee80;function _0x35f8c6(){const _0x54a24f='llct-'+_0x26962a(_0x1ddbb3(_0x40698)),_0x45e887=_0x2a7ce6(_0x26962a(window['Math']['ceil'](_0x39747c/_0xf37e91)));window['localStorage']['setItem'](_0x54a24f,_0x45e887);}function _0x164999(){const _0x12aecc='llct-'+_0x26962a(_0x1ddbb3(_0x40698)),_0x21e4a1=window['localStorage']['getItem'](_0x12aecc);return _0x21e4a1?window['parseInt'](_0x2a7ce6(_0x21e4a1),0x10)*_0xf37e91:null;}function _0x4a62da(_0x5dc45c){return new window['Promise']((_0x15ac2b,_0x1679c8)=>{_0x5dc45c['then'](_0x15ac2b,_0x1679c8),window['setTimeout'](_0x1679c8,0x1d4c0);});}}_0x5cd68a['on']('_sendUsageRequest',(_0x5a826b,_0x124374)=>{if(_0x124374[0x0]!=_0x40698)return _0x115c7e('UsageLimit');_0x124374[0x1]={..._0x124374[0x1],'requestId':_0x5eb1c3};},{'priority':'high'}),_0x5cd68a['on']('_sendUsageRequest',_0x5eeedf=>{_0x532ee1(_0x5eeedf['return'])&&(_0x5b4d27=!0x0,_0x1f99c9(_0x5eeedf['return']));},{'priority':'low'}),_0x2347fd['then'](()=>{_0x5b4d27||_0x115c7e('UsageLimit');});});function _0xff0cdb(){return'auto'==_0x5cd68a['editing']['view']['_overlayModeHint'];}function _0x340aaf(){_0x5cd68a['editing']['view']['_overlayModeHint']='auto';}}function _0x4ba4d6(_0x13d448){const _0x39c85b=[new window['Promise'](_0x5398e2=>setTimeout(_0x5398e2,0x93ecc)),_0x2347fd['then'](()=>new window['Promise'](_0x222ed8=>{let _0x218835=0x0;_0x5cd68a['model']['on']('applyOperation',(_0x13a8dc,_0x1f6356)=>{_0x1f6356[0x0]['isDocumentOperation']&&_0x218835++,0x5e8==_0x218835&&(_0x222ed8(),_0x13a8dc['off']());});}))];return window['Promise']['race'](_0x39c85b)['then'](()=>_0x13d448);}async function _0x40ffde(){await _0x2347fd,_0x5cd68a['model']['change']=_0x17f306,_0x5cd68a['model']['enqueueChange']=_0x17f306,_0x5cd68a['enableReadOnlyMode']('model');}function _0xcdd826(){return window['glob']&&window['glob']['triliumVersion'];}function _0x348e19(){return _0xd13c9e('WebSocketGateway')&&'connected'==_0x725ff3('WebSocketGateway')['state'];}function _0x25a89a(){return _0xd13c9e('RevisionViewerIntegration');}function _0xaedc35(){return _0xd13c9e('TrackChangesDataGetter');}function _0x4a78af(_0x415c7c){const _0x59286a=_0x142ebb();_0x5cd68a[_0x59286a]='commentsLicenseKey'+_0x415c7c,'Valid'!=_0x415c7c&&_0x40ffde();}function _0x142ebb(){const _0x4485f9=window['String'](window['performance']['now']())['replace']('.','');let _0x45bcf4='u';for(let _0x15a104=0x0;_0x15a104<_0x4485f9['length'];_0x15a104+=0x2){let _0x4396b7=window['parseInt'](_0x4485f9['substring'](_0x15a104,_0x15a104+0x2));_0x4396b7>=0x3e&&(_0x4396b7-=0x3e),_0x45bcf4+=_0x2a72a3[_0x4396b7];}return _0x45bcf4;}function _0x3981dd(){const _0x5990ed=_0x46c876['split']('.');if(0x3!=_0x5990ed['length'])return null;return _0x54afdb(_0x5990ed[0x1]);function _0x54afdb(_0x7162d0){const _0x12a13b=_0x5d3922(_0x7162d0);return _0x12a13b&&_0x2d7e1f()?_0x12a13b:null;function _0x2d7e1f(){const _0x2a02b9=_0x12a13b['jti'],_0x48f329=window['parseInt'](_0x2a02b9['substring'](_0x2a02b9['length']-0x8),0x10),_0x411402={..._0x12a13b,'jti':_0x2a02b9['substring'](0x0,_0x2a02b9['length']-0x8)};return delete _0x411402['vc'],_0x1ddbb3(_0x411402)==_0x48f329;}}}async function _0x134796(){let _0x119457=!0x0;try{const [_0x11daa3,_0x138a93,_0x2d37e1]=_0x46c876['split']('.');return _0x26bb3a(_0x11daa3),await _0x6e9ddc(_0x11daa3,_0x138a93,_0x2d37e1),_0x119457;}catch{return!0x1;}function _0x26bb3a(_0x5ee196){const _0x3b35e6=_0x5d3922(_0x5ee196);_0x3b35e6&&'ES256'==_0x3b35e6['alg']||(_0x119457=!0x1);}async function _0x6e9ddc(_0x325acf,_0x5d9a56,_0x1ff08a){const _0x516d82=window['Uint8Array']['from'](_0x4c9501(_0x1ff08a),_0x4487c5=>_0x4487c5['charCodeAt'](0x0)),_0x5f19d9=new window['TextEncoder']()['encode'](_0x325acf+'.'+_0x5d9a56),_0x21f9d4=window['crypto']['subtle'];if(!_0x21f9d4)return;const _0x474029=await _0x21f9d4['importKey']('jwk',_0xfe6039,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x21f9d4['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x474029,_0x516d82,_0x5f19d9)||(_0x119457=!0x1);}}function _0x5d3922(_0x33e816){return _0x33e816['startsWith']('ey')?JSON['parse'](_0x4c9501(_0x33e816)):null;}function _0x4c9501(_0x4daa1a){return window['atob'](_0x4daa1a['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x1ddbb3(_0x52ce2d){let _0x33b6a8=0x1505;function _0x4a0b42(_0x3b3fb7){for(let _0x49acbb=0x0;_0x49acbb<_0x3b3fb7['length'];_0x49acbb++){const _0x4912a6=_0x3b3fb7['charCodeAt'](_0x49acbb);_0x33b6a8=(_0x33b6a8<<0x5)+_0x33b6a8+_0x4912a6,_0x33b6a8&=_0x33b6a8;}}function _0x100566(_0x5b06ca){Array['isArray'](_0x5b06ca)?_0x5b06ca['forEach'](_0x100566):_0x5b06ca&&'object'==typeof _0x5b06ca?Object['entries'](_0x5b06ca)['sort']()['forEach'](([_0x56946d,_0x3815f3])=>{_0x4a0b42(_0x56946d),_0x100566(_0x3815f3);}):_0x4a0b42(window['String'](_0x5b06ca));}return _0x100566(_0x52ce2d),_0x33b6a8>>>0x0;}function _0x26962a(_0x4913a2){return _0x4913a2['toString'](0x10)['padStart'](0x8,'0');}function _0x2a7ce6(_0x457b81){return _0x457b81['split']('')['reverse']()['join']('');}function _0xd13c9e(_0x570313){return _0x5cd68a['plugins']['has'](_0x570313);}function _0x725ff3(_0x5bae47){return _0x5cd68a['plugins']['get'](_0x5bae47);}function _0x17f306(){}_0x4a78af(await _0x5aaec9());}_0x553066(_0x102268['editor']);}(this);}destroy(){const _0x395c42=this['editor']['plugins']['get'](we),_0x2b11c9=this['editor']['config']['get']('collaboration.channelId');for(const _0x354c60 of _0x395c42['getCommentThreads']({'channelId':_0x2b11c9}))_0x395c42['_detachCommentThread'](_0x354c60['id']),_0x395c42['_threads']['delete'](_0x354c60['id']);super['destroy']();}['hasMarkerForId'](_0x253ba1){return this['getAllMarkersForId'](_0x253ba1)['length']>0x0;}getAllMarkersForId(_0xfc5488){const _0x2a041e=[];for(const _0x205fd9 of this['editor']['model']['markers'])_0x205fd9['name']['startsWith']('comment:'+_0xfc5488)&&_0x2a041e['push'](_0x205fd9);return _0x2a041e;}['scrollToThreadMarker'](_0x4c83b9){setTimeout(()=>{const _0x23c266=this['_getTargetForId'](_0x4c83b9);_0x23c266&&this['activeMarker']&&Ee(this['activeMarker'])['id']===_0x4c83b9&&_0x4886c6({'target':_0x23c266[0x0],'viewportOffset':0x64,'alignToTop':!0x0});},0x32);}_reconvertMarkers(_0x59aac4){this['editor']['model']['change'](()=>{for(const _0x27bd06 of this['getAllMarkersForId'](_0x59aac4))this['editor']['editing']['reconvertMarker'](_0x27bd06);});}_attachArchivedThread(_0x292f92){const _0x3cb8b5=this['editor']['plugins']['get'](we),_0x4891ff=this['editor']['plugins']['get'](ye),_0x27177e=_0x3cb8b5['getCommentThread'](_0x292f92);if(!_0x27177e['isAttached']){const _0x3c06a6=_0x27177e['attachTo'](()=>this['_getTargetForId'](_0x27177e['id']));_0x4891ff['registerAnnotation'](_0x3c06a6),_0x27177e['_hasTargetInContent']=!0x1;}}_initializeMarkerConverters(){const _0x24bb25=this['editor'],_0x11f355=_0x24bb25['plugins']['get'](_0x1e93c2);_0x24bb25['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'comment','view':(_0x4a3a1b,_0x4de71b)=>{const {id:_0x4eb39c}=Ee(_0x4a3a1b['markerName']),_0x2dd34e=_0x24bb25['plugins']['get'](we)['getCommentThread'](_0x4eb39c),_0x29bc6b=this['activeMarker']&&Ee(this['activeMarker'])['id']===_0x4eb39c;let _0xcb191b;if(_0x2dd34e&&_0x2dd34e['isResolved']&&!_0x29bc6b&&_0x4a3a1b['item'])return _0x4de71b['consumable']['consume'](_0x4a3a1b['item'],'addMarker:'+_0x4a3a1b['markerName']),_0x4de71b['consumable']['consume'](_0x4a3a1b['item'],'removeMarker:'+_0x4a3a1b['markerName']),null;const _0x51c361=['ck-comment-marker'];return _0x29bc6b&&_0x51c361['push']('ck-comment-marker--active'),_0xcb191b=_0x2dd34e?.['length']?_0x2dd34e['comments']['first']['author']['id']:_0x11f355['me']['id'],{'classes':_0x51c361,'attributes':{'data-comment':_0x4eb39c,'data-author-id':_0xcb191b}};}}),_0x24bb25['conversion']['for']('dataDowncast')['markerToData']({'model':'comment','view':(_0x5a23c4,{options:_0x4aa800})=>{if(_0x4aa800['showCommentHighlights'])return null;const _0x4cbdf4=_0x24bb25['plugins']['get'](we),_0xe7b095=_0x24bb25['model']['markers']['get'](_0x5a23c4),{id:_0x75bf2,part:_0x2a384f}=Ee(_0x5a23c4);return _0xe7b095&&!_0xe7b095['affectsData']||_0x4aa800['ignoreResolvedComments']&&_0x4cbdf4['getCommentThread'](_0x75bf2)?.['isResolved']?null:{'group':'comment','name':_0x2a384f?_0x75bf2+':'+_0x2a384f:_0x75bf2};}}),_0x24bb25['conversion']['for']('upcast')['elementToElement']({'view':{'name':'comment','attributes':{'id':/^\w/}},'model':(_0x2870b4,{writer:_0x497fd7})=>_0x497fd7['createElement']('$marker',{'data-name':'comment:'+_0x2870b4['getAttribute']('id')})}),_0x24bb25['conversion']['for']('upcast')['dataToMarker']({'view':'comment'});}['_handleMarkerAddAndRemove'](){const _0x2b3dcb=this['editor'],_0xa5ebc0=_0x2b3dcb['plugins']['get'](we),_0x3b55b7=new Set(),_0x2fb429=new Set();_0x2b3dcb['model']['document']['registerPostFixer'](_0x10273c=>{let _0x467d80=!0x1;for(const {name:_0x4e185e,data:_0x198f91}of _0x2b3dcb['model']['document']['differ']['getChangedMarkers']()){const {group:_0x347500,id:_0x3921e1}=Ee(_0x4e185e);let _0xfd6abd=_0x198f91['newRange'];if('comment'!==_0x347500||!_0xfd6abd)continue;const _0x18a26c='$graveyard'===_0xfd6abd['root']['rootName'];_0x18a26c||(_0xfd6abd=Me(_0xfd6abd,_0x2b3dcb['model']),!_0xfd6abd||_0xfd6abd['isCollapsed']||!_0x198f91['newRange']||_0xfd6abd['isEqual'](_0x198f91['newRange']))?_0x2b3dcb['model']['hasContent'](_0xfd6abd)&&!_0x18a26c?this['isThreadsLoadingPaused']?_0x3b55b7['add'](_0x4e185e):this['_handleThreadMarker'](_0x4e185e,_0x3921e1):(_0x2fb429['add'](_0x4e185e),_0x3b55b7['delete'](_0x4e185e),_0x10273c['removeMarker'](_0x4e185e),_0x467d80=!0x0):(_0x10273c['updateMarker'](_0x4e185e,{'range':_0xfd6abd}),_0x467d80=!0x0);}return _0x467d80;}),this['on']('change:isThreadsLoadingPaused',(_0x5b295a,_0x3244c2,_0x56d635)=>{if(!_0x56d635&&_0x3b55b7['size'])for(const _0x46523c of _0x3b55b7){const {id:_0x3a5d32}=Ee(_0x46523c);_0x3b55b7['delete'](_0x46523c),_0x2b3dcb['model']['markers']['get'](_0x46523c)&&this['_handleThreadMarker'](_0x46523c,_0x3a5d32);}}),this['listenTo'](_0x2b3dcb['model']['document'],'change',()=>{for(const {name:_0x20d973,data:{newRange:_0x5c48f2}}of _0x2b3dcb['model']['document']['differ']['getChangedMarkers']()){const {group:_0x16f19b,id:_0x184167}=Ee(_0x20d973);if('comment'!==_0x16f19b)continue;const _0x3c9786=_0xa5ebc0['getCommentThread'](_0x184167),_0x56758f=this['hasMarkerForId'](_0x184167);_0x3c9786&&(!_0x3c9786['_hasTargetInContent']&&_0x5c48f2&&_0x2b3dcb['editing']['view']['once']('render',()=>{const _0x3cfa88=_0x2b3dcb['plugins']['get'](me),_0x1b2e93=_0xa5ebc0['_threadToController']['get'](_0x3c9786)['view'];_0x3cfa88['getByInnerView'](_0x1b2e93)['refreshVisibility']();},{'priority':'low'}),_0x3c9786['_hasTargetInContent']=_0x56758f||!!_0x5c48f2),_0x5c48f2||(_0x2fb429['add'](_0x20d973),_0x3b55b7['delete'](_0x20d973));}for(const _0x1befac of _0x2fb429){const {id:_0x2e7281}=Ee(_0x1befac),_0x57b5c6=_0xa5ebc0['getCommentThread'](_0x2e7281);if(_0x3b55b7['delete'](_0x1befac),!_0x57b5c6)continue;const _0x181852=this['hasMarkerForId'](_0x2e7281);_0x181852||_0x57b5c6['isSubmitted']?_0x181852||_0x57b5c6['unlinkedAt']||_0x57b5c6['setUnlinkedAt'](new Date()):_0x57b5c6['remove']();}_0x2fb429['clear']();});}_handleInitialThreads(_0x557425){_0x557425['forEach'](_0x5baf2d=>{_0x5baf2d['unlinkedAt']&&this['_attachArchivedThread'](_0x5baf2d['id']);});}_getTargetForId(_0x81d2d){const _0x2c601c=this['editor'],_0x22e962=this['getAllMarkersForId'](_0x81d2d);return _0x35fdd9(_0x2c601c['editing'],_0x22e962);}_getTextContext(_0xd7ca53){const _0x1a4e15=this['getAllMarkersForId'](_0xd7ca53);let _0x11d2df='',_0x1ff83a=!0x1;for(const _0x2dbd06 of _0x1a4e15){const _0x12ae58=_0x2dbd06['getRange']();for(const _0x203902 of Array['from'](_0x12ae58['getItems']()))_0x203902['is']('$textProxy')?(_0x11d2df&&_0x1ff83a&&(_0x11d2df+='\x20',_0x1ff83a=!0x1),_0x11d2df+=_0x203902['data']):_0x1ff83a=!0x0;_0x1ff83a=!0x0;}return _0x11d2df['substring'](0x0,0x96);}_attachMarkerToThread(_0x53308c,_0x5d0e12){const _0x51cdb1=this['editor'],_0x5aa4c1=_0x51cdb1['plugins']['get'](we);let _0x2b7673=_0x5aa4c1['getCommentThread'](_0x5d0e12);const _0x427036=_0x51cdb1['config']['get']('collaboration.channelId'),_0xd33e11=_0x51cdb1['plugins']['get'](ye);return _0x2b7673&&(_0x2b7673['unlinkedAt']&&_0x2b7673['setUnlinkedAt'](null),_0x2b7673['isAttached'])||(this['getAllMarkersForId'](_0x5d0e12)[0x0]['managedUsingOperations']?_0x5aa4c1['fetchCommentThread']({'channelId':_0x427036,'threadId':_0x5d0e12})['then'](_0x3efcf0=>{if('destroyed'!==_0x51cdb1['state']){if(_0x2b7673=_0x3efcf0,_0x2b7673&&!_0x2b7673['isAttached']){const _0x255dcc=_0x2b7673['attachTo'](()=>this['_getTargetForId'](_0x5d0e12));_0xd33e11['registerAnnotation'](_0x255dcc),_0x2b7673['isResolved']&&this['_reconvertMarkers'](_0x5d0e12);}else{if(!_0x2b7673){const _0x4862c8=this['getAllMarkersForId'](_0x5d0e12);_0x51cdb1['model']['change'](_0x5e49ff=>{for(const _0x184fae of _0x4862c8)_0x5e49ff['removeMarker'](_0x184fae);});}}}}):_0x51cdb1['editing']['view']['once']('render',()=>{if(_0x5aa4c1['getCommentThread'](_0x5d0e12))return;const _0xc621ec=_0x51cdb1['plugins']['get'](me);_0x2b7673=_0x5aa4c1['openNewCommentThread']({'channelId':_0x427036,'threadId':_0x5d0e12,'target':()=>this['_getTargetForId'](_0x5d0e12),'context':{'type':'text','value':this['_getTextContext'](_0x5d0e12)}});const _0x549bb5=_0x5aa4c1['_threadToController']['get'](_0x2b7673)['view'],_0x4fd729=_0xc621ec['getByInnerView'](_0x549bb5);_0x4fd729&&_0xd33e11['registerAnnotation'](_0x4fd729);},{'priority':'low'})),_0x2b7673;}['_handleThreadMarker'](_0x3d44c1,_0x350c23){const _0x52aec3=this['_attachMarkerToThread'](_0x3d44c1,_0x350c23);_0x52aec3&&!_0x52aec3['context']&&_0x52aec3['setContext']({'type':'text','value':this['_getTextContext'](_0x350c23)});}_initAriaMarkerChangeAnnouncements(){const _0x2d1cbc=this['editor'];_0x168bc5(_0x2d1cbc['model'],({left:_0x1337dd,entered:_0x596b7b})=>{for(const _0x578b88 of _0x1337dd)if(Re(_0x578b88)){_0x2d1cbc['ui']['ariaLiveAnnouncer']['announce'](Vt(_0x2d1cbc['locale'],'LEAVE_COMMENT_ANNOUNCEMENT'));break;}for(const _0xb4585c of _0x596b7b)if(Re(_0xb4585c)){_0x2d1cbc['ui']['ariaLiveAnnouncer']['announce'](Vt(_0x2d1cbc['locale'],'ENTER_COMMENT_ANNOUNCEMENT',_0xed4ba7(_0x277714)));break;}});}};function Oe(_0x1ea961,_0x35fcbb){return _0x35fcbb?_0x1ea961+':'+_0x35fcbb:_0x1ea961;}function Me(_0x3543ee,_0x2ac232){const _0x46a3e7=_0x2ac232['schema'],_0x1b45f9=_0x2ac232['createRange'](_0x3543ee['start']);for(const _0x8f1bf2 of _0x3543ee['getWalker']()){const {type:_0x3170bd,item:_0x60b4f8,nextPosition:_0x2a10c8}=_0x8f1bf2;if('text'===_0x3170bd||_0x46a3e7['isObject'](_0x60b4f8)){const _0x244273=_0x2ac232['createPositionBefore'](_0x60b4f8);_0x1b45f9['isCollapsed']&&(_0x1b45f9['start']=_0x244273),_0x1b45f9['end']=_0x2a10c8;}}return _0x1b45f9;}function Re(_0x34e04b){return'comment'===Ee(_0x34e04b['name'])['group'];}var xe=class extends _0x287b4d{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'CommentsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[we,Ne,ye,me];}get CommentsListView(){return Xt;}get CommentThreadInputView(){return Gt;}init(){const _0x41b66f=this['editor'],_0x2ef433=_0x41b66f['plugins']['get'](we),_0x2058c0=_0x41b66f['plugins']['get'](Ne),_0x204e1d=_0x41b66f['plugins']['get'](me),_0x4284ff=_0x41b66f['plugins']['get'](ye);_0x41b66f['ui']['componentFactory']['add']('comment',()=>{const _0x38c187=this['_createUIButton'](nt);return _0x38c187['tooltip']=!0x0,_0x38c187;}),_0x41b66f['ui']['componentFactory']['add']('menuBar:comment',()=>this['_createUIButton'](pt)),_0x4284ff['addSourceCollector'](()=>{const _0x565e2b=[];for(const [_0x1d0295,_0x2d3237]of _0x2ef433['_threadToController']){const _0x4f0136=_0x2058c0['getAllMarkersForId'](_0x1d0295['id']),_0x41f885=_0x4f0136['map'](_0x4664dd=>_0x4664dd['getRange']());_0x4f0136['length']>0x0&&_0x565e2b['push']([_0x2d3237['view'],_0x41f885]);}return _0x565e2b;}),this['listenTo'](_0x204e1d,'change:activeAnnotations',(_0x414f1c,_0x1cbbed,_0x33a7df)=>{const _0x4454d9=Array['from'](_0x33a7df)['map'](_0x385175=>_0x385175['innerView'])['find'](_0x2d0aa3=>_0x2ef433['_viewToController']['has'](_0x2d0aa3));if(!_0x4454d9)return void(_0x2058c0['activeMarker']=null);const _0x364b2c=_0x2ef433['_viewToController']['get'](_0x4454d9)['model']['id'],_0x350aed='comment:'+_0x364b2c;_0x364b2c&&_0x2058c0['hasMarkerForId'](_0x364b2c)?_0x2058c0['activeMarker']=_0x350aed:_0x2058c0['activeMarker']&&(_0x2058c0['activeMarker']=null);}),this['listenTo'](_0x2ef433,'removeCommentThread',(_0x4b917b,{threadId:_0x4503a6,isFromAdapter:_0x254ebb})=>{!_0x254ebb&&_0x41b66f['ui']['focusTracker']['isFocused']&&_0x2058c0['hasMarkerForId'](_0x4503a6)&&_0x41b66f['editing']['view']['focus']();},{'priority':'highest'}),this['listenTo'](_0x2ef433,'addComment',(_0x113697,{threadId:_0x4f7210,isFromAdapter:_0x32d026})=>{!_0x32d026&&_0x2058c0['hasMarkerForId'](_0x4f7210)&&_0x2ef433['hasCommentThread'](_0x4f7210)&&0x1===_0x2ef433['getCommentThread'](_0x4f7210)['length']&&(_0x41b66f['editing']['view']['focus'](),_0x113697['stop']());},{'priority':'low'}),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x14795d=[this['editor']];for(const _0x2faa60 of _0x14795d){let _0xc2e3d2;for(const _0x5c7139 in _0x2faa60){const _0x440204=_0x5c7139,_0x3e9d12=_0x2faa60[_0x440204];if('commentsLicenseKeyValid'==_0x3e9d12||'commentsLicenseKeyInvalid'==_0x3e9d12||'commentsLicenseKeyExpired'==_0x3e9d12||'commentsLicenseKeyDomainLimit'==_0x3e9d12||'commentsLicenseKeyNotAllowed'==_0x3e9d12||'commentsLicenseKeyEvaluationLimit'==_0x3e9d12||'commentsLicenseKeyUsageLimit'==_0x3e9d12){delete _0x2faa60[_0x440204],_0xc2e3d2=_0x3e9d12,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'commentsLicenseKeyInvalid'==_0xc2e3d2&&_0x2faa60['_showLicenseError']('invalid'),'commentsLicenseKeyExpired'==_0xc2e3d2&&_0x2faa60['_showLicenseError']('expired'),'commentsLicenseKeyDomainLimit'==_0xc2e3d2&&_0x2faa60['_showLicenseError']('domainLimit'),'commentsLicenseKeyNotAllowed'==_0xc2e3d2&&_0x2faa60['_showLicenseError']('featureNotAllowed','Comments'),'commentsLicenseKeyEvaluationLimit'==_0xc2e3d2&&_0x2faa60['_showLicenseError']('evaluationLimit'),'commentsLicenseKeyUsageLimit'==_0xc2e3d2&&_0x2faa60['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_createUIButton(_0x28171c){const _0xe6a4fb=this['editor'],_0x396421=new _0x28171c(_0xe6a4fb['locale']),_0xe5e2f0=_0xe6a4fb['commands']['get']('addCommentThread');return _0x396421['set']({'label':Vt(_0xe6a4fb['locale'],'Comment'),'icon':_0x2db4bb}),_0x396421['bind']('isEnabled')['to'](_0xe5e2f0,'isEnabled',_0xe5e2f0,'hasContent',(_0x5798db,_0x283dca)=>_0x5798db&&_0x283dca),this['listenTo'](_0x396421,'execute',()=>{_0xe5e2f0['execute']();}),_0x396421;}},Se=class extends _0x287b4d{static get['pluginName'](){return'CommentsOnly';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Ne];}constructor(_0x1b70a7){super(_0x1b70a7),this['set']('isEnabled',!0x1),this['on']('change:isEnabled',(_0x1510d9,_0x3a90a5,_0x52fd1f)=>{_0x52fd1f?this['_enableCommentsOnlyMode']():this['_disableCommentsOnlyMode']();});}afterInit(){!this['isEnabled']&&this['editor']['config']['get']('commentsOnly')&&(this['isEnabled']=!0x0);}_enableCommentsOnlyMode(){for(const [_0x593abc,_0x56479e]of this['editor']['commands'])_0x56479e['affectsData']&&'addCommentThread'!==_0x593abc&&_0x56479e['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 _0x454635=this['editor']['editing']['view']['document'];this['listenTo'](_0x454635,'cut',_0x524b5d=>_0x524b5d['stop'](),{'priority':'highest'}),this['listenTo'](_0x454635,'clipboardInput',_0x279014=>_0x279014['stop'](),{'priority':'highest'}),this['listenTo'](_0x454635,'delete',_0x36f36a=>_0x36f36a['stop'](),{'priority':'highest'});}_disableCommentsOnlyMode(){for(const [_0x329bf3,_0x141b16]of this['editor']['commands'])_0x141b16['affectsData']&&'addCommentThread'!==_0x329bf3&&_0x141b16['clearForceDisabled']('commentsOnlyMode');this['editor']['plugins']['has']('RevisionTracker')&&this['editor']['plugins']['get']('RevisionTracker')['clearForceDisabled']('commentsOnlyMode'),this['editor']['plugins']['has']('SourceEditing')&&this['editor']['plugins']['get']('SourceEditing')['clearForceDisabled']('commentsOnlyMode'),this['editor']['commands']['get']('editSource')?.['clearForceDisabled']('commentsOnlyMode'),this['stopListening'](this['editor']['editing']['view']['document']);}},Pe=class extends _0x1e3609{activeUIs;uisData;['_uis'];static get requires(){return[me];}static get['pluginName'](){return'AnnotationsUIs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x57e3fb){super(_0x57e3fb),this['activeUIs']=new Set(),this['_uis']=new Map(),this['uisData']=new Map();}init(){const _0x11b674=this['context']['plugins']['get'](me);this['listenTo'](_0x11b674,'_activateAnnotation',(_0x7963ea,_0xd38a84)=>{for(const _0x3eeb0e of this['activeUIs']){const _0x36bc14=this['_uis']['get'](_0x3eeb0e);(0x0,this['uisData']['get'](_0x3eeb0e)['filter'])(_0xd38a84)&&_0x36bc14['setActiveAnnotation'](_0xd38a84);}}),this['listenTo'](_0x11b674,'_deactivateAllAnnotations',()=>{for(const _0x58afe2 of this['activeUIs'])this['_uis']['get'](_0x58afe2)['setActiveAnnotation'](null);}),this['listenTo'](_0x11b674['_visibleAnnotations'],'add',(_0x34d442,_0xda6cf7)=>{this['_assertAnnotationDoesNotBelongToMultipleUIs'](_0xda6cf7);});}hasActive(){return this['activeUIs']['size']>0x0;}isActive(_0xb9b35e){return this['activeUIs']['has'](_0xb9b35e);}activate(_0x55b471,_0x58ad5=this['defaultFilter']){const _0x22f9a3=this['context']['plugins']['get'](me);if(!this['_uis']['has'](_0x55b471))throw new _0x53d35c('annotationsuis-missing-ui',this,{'uiName':_0x55b471});this['isActive'](_0x55b471)&&this['deactivate'](_0x55b471),this['activeUIs']['add'](_0x55b471);const _0x3bf166=new ce();de({'source':_0x22f9a3['_visibleAnnotations'],'target':_0x3bf166,'filter':_0x58ad5}),this['uisData']['set'](_0x55b471,{'collection':_0x3bf166,'filter':_0x58ad5});const _0x168523=this['_uis']['get'](_0x55b471);_0x168523['attach'](_0x3bf166),this['listenTo'](_0x168523,'change:activeAnnotation',(_0x34c242,_0x5a266c,_0x3c28a3,_0x49c180)=>{_0x49c180&&_0x22f9a3['_removeActiveAnnotation'](_0x49c180),_0x3c28a3&&_0x22f9a3['_addActiveAnnotation'](_0x3c28a3);});}deactivate(_0x14a4ff){if(this['activeUIs']['delete'](_0x14a4ff),!this['_uis']['has'](_0x14a4ff))throw new _0x53d35c('annotationsuis-missing-ui',this,{'uiName':_0x14a4ff});const _0x33e828=this['_uis']['get'](_0x14a4ff);_0x33e828['detach'](),this['stopListening'](_0x33e828),this['uisData']['get'](_0x14a4ff)['collection']['destroy'](),this['uisData']['delete'](_0x14a4ff);}switchTo(_0x51d160){if(!this['_uis']['has'](_0x51d160))throw new _0x53d35c('annotationsuis-missing-ui',this,{'uiName':_0x51d160});const _0x38e37f=this['context']['plugins']['get'](me),_0x492b71=Array['from'](_0x38e37f['activeAnnotations'])[0x0]||null;this['deactivateAll'](),this['activate'](_0x51d160);const _0x2a3f56=this['_uis']['get'](_0x51d160);_0x2a3f56['setActiveAnnotation'](_0x492b71),_0x2a3f56['_setSelectedAnnotations']&&_0x492b71&&_0x2a3f56['_setSelectedAnnotations']([_0x492b71]);}deactivateAll(){for(const _0x5117c8 of this['activeUIs'])this['deactivate'](_0x5117c8);}register(_0x45f8a5,_0x5848f5){if(this['_uis']['has'](_0x45f8a5))throw new _0x53d35c('annotationsuis-register-already-registered');if('function'!=typeof _0x5848f5['attach']||'function'!=typeof _0x5848f5['detach']||'function'!=typeof _0x5848f5['setActiveAnnotation'])throw new _0x53d35c('annotationsuis-register-invalid-interface',null);this['_uis']['set'](_0x45f8a5,_0x5848f5);}refilterAnnotations(){const _0x2abdd7=this['context']['plugins']['get'](me)['collection'],_0x2d224f=new Map(),_0x11cc81=Array['from'](this['activeUIs']);for(const _0x3b9a54 of this['activeUIs']){const _0x4a482f=this['uisData']['get'](_0x3b9a54)['collection'];for(const _0xd2355a of _0x4a482f)_0x2d224f['set'](_0xd2355a,_0x3b9a54);}for(const _0x50a2ab of _0x2abdd7){const _0x43ba13=_0x2d224f['get'](_0x50a2ab);this['_assertAnnotationDoesNotBelongToMultipleUIs'](_0x50a2ab);const _0x140e2f=_0x11cc81['find'](_0x3c3ccb=>this['uisData']['get'](_0x3c3ccb)['filter'](_0x50a2ab));_0x43ba13!==_0x140e2f&&(_0x43ba13&&this['uisData']['get'](_0x43ba13)['collection']['remove'](_0x50a2ab),_0x140e2f&&this['uisData']['get'](_0x140e2f)['collection']['add'](_0x50a2ab));}}destroy(){this['deactivateAll'](),super['destroy']();}defaultFilter(){return!0x0;}_assertAnnotationDoesNotBelongToMultipleUIs(_0x628ffc){const _0x473e21=[];for(const _0x231ae7 of this['activeUIs']){(0x0,this['uisData']['get'](_0x231ae7)['filter'])(_0x628ffc)&&_0x473e21['push'](_0x231ae7);}if(_0x473e21['length']>0x1)throw new _0x53d35c('annotationsuis-annotation-mismatch',null,{'matchedUIs':_0x473e21,'annotationType':_0x628ffc['type']});}};const Le=/* #__PURE__ -- @preserve */
|
|
32
|
+
_0x4fc79b('px');var De=class extends wt{list;['focusables'];['focusTracker'];['focusCycler'];constructor(_0x3e2466){super(_0x3e2466);const _0xd43f18=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 _0x494444(),this['focusCycler']=new dt({'focusables':this['focusables'],'focusTracker':this['focusTracker']}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-sidebar','ck-reset',_0xd43f18['to']('class')],'style':{'minHeight':_0xd43f18['to']('minHeight',_0x350303=>'number'==typeof _0x350303?Le(_0x350303+0xa):null)},'dir':_0x3e2466['uiLanguageDirection'],'role':'application','aria-label':Vt(_0x3e2466,'Annotations\x20sidebar'),'tabindex':0x0},'children':[{'tag':'div','attributes':{'role':'list','aria-label':Vt(_0x3e2466,'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',_0x5eeaf3=>{this['_updateItemPositionInFocusables'](_0x5eeaf3['source']);}),this['list']['forEach'](_0x213c13=>{this['focusTracker']['add'](_0x213c13['element']),this['_updateItemPositionInFocusables'](_0x213c13);}),this['list']['on']('change',(_0xb81e56,_0x1c0a53)=>{for(const _0x115013 of _0x1c0a53['removed'])this['focusTracker']['remove'](_0x115013['element']),this['focusables']['remove'](_0x115013);for(const _0x22174c of _0x1c0a53['added'])this['focusTracker']['add'](_0x22174c['element']),this['_updateItemPositionInFocusables'](_0x22174c);}),this['on']('arrowup',()=>{this['focusCycler']['focusPrevious']();}),this['on']('arrowdown',()=>{this['focusCycler']['focusNext']();}),this['listenTo'](this['element'],'focus',()=>{this['focus']();});}_updateItemPositionInFocusables(_0x550607){const _0x523b95=this['focusables']['getIndex'](_0x550607);let _0x251f7d,_0x3e7d20;for(const _0xd5fd28 of this['focusables'])if(_0x550607['top']<_0xd5fd28['top']){_0x251f7d=_0xd5fd28;break;}if(_0x3e7d20=_0x251f7d?this['focusables']['getIndex'](_0x251f7d):this['focusables']['length'],-0x1!==_0x523b95){if(_0x523b95===_0x3e7d20-0x1)return;this['focusables']['remove'](_0x550607),_0x3e7d20=_0x251f7d?this['focusables']['getIndex'](_0x251f7d):this['focusables']['length'];}this['focusables']['add'](_0x550607,_0x3e7d20);}};const Ve=/* #__PURE__ -- @preserve */
|
|
33
|
+
_0x4fc79b('px');var Be=class extends wt{content;_targetTop;_mutationObserver;constructor(_0x4cf58e){super(_0x4cf58e),this['set']('top',0x0),this['set']('height',0x0),this['bind']('bottom')['to'](this,'top',this,'height',(_0x39b995,_0x598519)=>_0x39b995+_0x598519),this['set']('isAnimationDisabled',!0x1),this['_mutationObserver']=ne(()=>this['updateHeight']()),this['_targetTop']=null,this['content']=this['createCollection'](),this['content']['delegate']('arrowup','arrowdown')['to'](this);const _0x88878a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-sidebar-item',_0x88878a['to']('isAnimationDisabled',_0x4b31b1=>_0x4b31b1?'ck-sidebar-item--no-animation':'')],'style':{'top':_0x88878a['to']('top',_0x36825e=>Ve(_0x36825e))},'role':'presentation'},'children':this['content']});}['render'](){super['render'](),this['_mutationObserver']['attach'](this['element']);}['focus'](){this['content']['first']&&this['content']['first']['focus']();}updateHeight(){const _0x2d0088=this['element']['clientHeight'];_0x2d0088&&(this['height']=_0x2d0088);}destroy(){this['content']['clear'](),this['_mutationObserver']['detach'](),super['destroy']();}},He=class extends _0x1e3609{['view'];_activeAnnotation;_annotations;_spaceBetweenItems;_sidebarItemViewToAnnotation;_annotationToSidebarItemView;_recalculateBuffer;static get['pluginName'](){return'Sidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x450f6b){super(_0x450f6b),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 _0x123586=this['context']['config']['get']('sidebar.container');_0x123586&&this['setContainer'](_0x123586);}setContainer(_0x283bb7){if(!Fe(_0x283bb7))throw new _0x53d35c('sidebar-setcontainer-invalid-element');this['container']=_0x283bb7;}_attachToContainer({viewClass:_0x546f40='',spaceBetweenItems:_0x4ef5f8=0x19}={}){if(!Fe(this['container']))throw new _0x53d35c('sidebar-attachtocontainer-missing-container',this);this['container']['appendChild'](this['view']['element']),this['view']['class']=_0x546f40,this['_spaceBetweenItems']=_0x4ef5f8;}['rearrange']({removedAnnotation:_0x19cd21,previousAnnotation:_0x4b19fb,nextAnnotation:_0x25b938}){const _0x497f22=this['getSidebarItemView'](_0x19cd21);this['view']['list']['remove'](_0x497f22),this['_destroySidebarItemView'](_0x19cd21),_0x4b19fb&&this['_alignToTargetRect'](this['getSidebarItemView'](_0x4b19fb)),_0x25b938&&this['_alignToTargetRect'](this['getSidebarItemView'](_0x25b938)),this['_updateLastItem']();}['refresh']({blurredAnnotation:_0xd67c6f,activatedAnnotation:_0x35f292,disableAnimationOnActivatedAnnotation:_0x59ee56}){if(this['_activeAnnotation']=_0x35f292,_0xd67c6f){_0xd67c6f['isActive']=!0x1;const _0xfc050=this['getSidebarItemView'](_0xd67c6f);_0xfc050&&_0x59ee56&&(_0xfc050['isAnimationDisabled']=!0x1);}if(_0x35f292){const _0x4c4322=this['getSidebarItemView'](_0x35f292);_0x4c4322&&(_0x35f292['isActive']=!0x0,_0x59ee56&&(_0x4c4322['isAnimationDisabled']=!0x0,_0x4c4322['top']+=0x1),this['_alignToTargetRect'](_0x4c4322));}}_detachFromContainer(_0x41f7e8){if(this['view']['element']['remove'](),_0x41f7e8){for(const _0xeafdab of _0x41f7e8)this['_destroySidebarItemView'](_0xeafdab);}this['view']['list']['clear'](),this['view']['class']='',this['_lastItem']=null;}addAnnotation(_0x5bba3b,_0x496c4b){_0x496c4b||(_0x496c4b=_0x5bba3b['view']);const _0x31a8f2=new Be(this['context']['locale']);this['_sidebarItemViewToAnnotation']['set'](_0x31a8f2,_0x5bba3b),this['_annotationToSidebarItemView']['set'](_0x5bba3b,_0x31a8f2),_0x31a8f2['content']['add'](_0x496c4b),this['listenTo'](_0x5bba3b['view'],'change:targetRect',(_0x5ac6f4,_0xa785dd,_0x2effb7)=>{const _0x24ab37=this['_getTargetTop'](_0x5bba3b,_0x2effb7);_0x31a8f2['_targetTop']!=_0x24ab37&&(_0x31a8f2['_targetTop']=_0x24ab37,this['_setItemTop'](_0x31a8f2,_0x24ab37));}),this['listenTo'](_0x31a8f2,'change:top',()=>{this['_recalculate'](_0x31a8f2,'top');}),this['listenTo'](_0x31a8f2,'change:bottom',()=>{this['_recalculate'](_0x31a8f2,'bottom');}),this['_alignToTargetRect'](_0x31a8f2);const _0x496336=this['_getItemBefore'](_0x31a8f2);return _0x496336&&this['_alignAfterItem'](_0x496336,_0x31a8f2)||this['_alignToTargetRect'](_0x31a8f2),this['_updateLastItem'](),this['view']['list']['add'](_0x31a8f2),_0x31a8f2;}['_alignForTopChange'](_0x4b51c6){if(!_0x4b51c6['content']['length'])return;const _0x17e43f=this['_getItemBefore'](_0x4b51c6);if(!_0x17e43f)return;const _0x439baf=this['_sidebarItemViewToAnnotation']['get'](_0x17e43f),_0x111940=this['_activeAnnotation'];_0x111940&&_0x111940===_0x439baf?this['_alignAfterItem'](_0x17e43f,_0x4b51c6):this['_alignBeforeItem'](_0x4b51c6,_0x17e43f);}_alignForBottomChange(_0x212f05){if(!_0x212f05['content']['length'])return;const _0x4d6d51=this['_getItemAfter'](_0x212f05);if(!_0x4d6d51)return;const _0x46a275=this['_sidebarItemViewToAnnotation']['get'](_0x4d6d51),_0x24a36b=this['context']['config']['get']('sidebar.preventScrollOutOfView'),_0x2da37f=this['_activeAnnotation'];_0x2da37f&&_0x2da37f===_0x46a275&&_0x24a36b?(this['_alignBeforeItem'](_0x4d6d51,_0x212f05),this['_alignAfterItem'](_0x212f05,_0x4d6d51)):_0x2da37f&&_0x2da37f===_0x46a275?this['_alignBeforeItem'](_0x4d6d51,_0x212f05):this['_alignAfterItem'](_0x212f05,_0x4d6d51);}_recalculate(_0x59352f,_0x408f59){0x0===this['_recalculateBuffer']['length']&&setTimeout(()=>{for(const {sidebarItemView:_0x5b8a37,changedProp:_0x40fd79}of this['_recalculateBuffer'])'top'===_0x40fd79?this['_alignForTopChange'](_0x5b8a37):this['_alignForBottomChange'](_0x5b8a37);this['_recalculateBuffer']=[];},0xa),this['_recalculateBuffer']['push']({'sidebarItemView':_0x59352f,'changedProp':_0x408f59});}getSidebarItemView(_0x18f315){return this['_annotationToSidebarItemView']['get'](_0x18f315);}destroy(){this['stopListening'](),this['view']['destroy']();}_destroySidebarItemView(_0x4faf7c){const _0x16657a=this['getSidebarItemView'](_0x4faf7c);this['stopListening'](_0x16657a),this['stopListening'](_0x4faf7c['view']),_0x16657a['destroy'](),this['_annotationToSidebarItemView']['delete'](_0x4faf7c),this['_sidebarItemViewToAnnotation']['delete'](_0x16657a);}_createSidebarView(){const _0x15a34a=new De(this['context']['locale']);return _0x15a34a['render'](),this['on']('change:_lastItem',(_0x5652a1,_0x261976,_0x689dae,_0x98b005)=>{_0x98b005&&_0x15a34a['unbind']('minHeight'),_0x689dae?_0x15a34a['bind']('minHeight')['to'](_0x689dae,'bottom'):_0x15a34a['minHeight']=null;}),_0x15a34a;}_updateLastItem(){this['_lastItem']=this['_annotations']?.['last']?this['getSidebarItemView'](this['_annotations']['last']):null;}_getItemBefore(_0x406e5f){const _0x5c0f27=this['_sidebarItemViewToAnnotation']['get'](_0x406e5f),_0x6f1e03=_0x5c0f27&&this['_annotations']?.['get'](this['_annotations']['getIndex'](_0x5c0f27)-0x1);return _0x6f1e03&&this['getSidebarItemView'](_0x6f1e03)||null;}_getItemAfter(_0x5cd99d){const _0x84fbcd=this['_sidebarItemViewToAnnotation']['get'](_0x5cd99d),_0x1e9454=_0x84fbcd&&this['_annotations']?.['get'](this['_annotations']['getIndex'](_0x84fbcd)+0x1);return _0x1e9454&&this['getSidebarItemView'](_0x1e9454)||null;}_alignBeforeItem(_0x1678cd,_0x415dc7){_0x1678cd['updateHeight']();const _0x1fae27=Ue(_0x415dc7['bottom']+this['_spaceBetweenItems'],_0x1678cd['top']);return!!_0x1fae27&&(this['_setItemTop'](_0x415dc7,_0x415dc7['top']-_0x1fae27),!0x0);}_alignAfterItem(_0x49c21c,_0x6868f1){_0x49c21c['updateHeight']();const _0x5e842b=Ue(_0x49c21c['bottom']+this['_spaceBetweenItems'],_0x6868f1['top']);return!!_0x5e842b&&(this['_setItemTop'](_0x6868f1,_0x6868f1['top']+_0x5e842b,!0x1),!0x0);}_alignToTargetRect(_0x53690f){const _0x230be6=this['_sidebarItemViewToAnnotation']['get'](_0x53690f);if(!_0x230be6||!_0x230be6['target']||!_0x230be6['targetRect'])return;const _0x14efaf=this['_getTargetTop'](_0x230be6,_0x230be6['targetRect']);this['_setItemTop'](_0x53690f,_0x14efaf);}_getTargetTop(_0x2098af,_0x542b88){if(null===_0x542b88)return 0x0;if(_0x2098af['target']instanceof _0x5bd772)return _0x542b88['top'];{const _0x5ecf4f=new _0x5bd772(this['view']['element'])['top'];return _0x542b88['top']-_0x5ecf4f;}}_setItemTop(_0x429ced,_0x359e72,_0x257e11=this['context']['config']['get']('sidebar.preventScrollOutOfView')){_0x257e11&&(_0x359e72=Math['max'](_0x359e72,this['_getMaxAvailableTop'](_0x429ced))),_0x429ced['top']=_0x359e72;}_getMaxAvailableTop(_0x1ebf5){let _0x5603cb=this['_getItemBefore'](_0x1ebf5),_0x4d4355=0x0;for(;_0x5603cb;)_0x5603cb['updateHeight'](),_0x4d4355+=this['_spaceBetweenItems']+_0x5603cb['height'],_0x5603cb=this['_getItemBefore'](_0x5603cb);return _0x4d4355;}};function Ue(_0x1488de,_0x541005){return Math['max'](_0x1488de-_0x541005,0x0);}function Fe(_0x46e8f6){return null!==_0x46e8f6&&'object'==typeof _0x46e8f6&&0x1===_0x46e8f6['nodeType'];}var We=class extends _0x1e3609{isAttached;annotations;_editorAnnotations;_refreshPositioningDebounced;static get requires(){return[He,Pe];}static get['pluginName'](){return'WideSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x148bbf){super(_0x148bbf),this['isAttached']=!0x1,this['set']('activeAnnotation',null),this['annotations']=null,this['_editorAnnotations']=new _0x4c91ff(),this['_refreshPositioningDebounced']=_0x52fb1a(()=>{_0x148bbf['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning']();},0xfa,{'leading':!0x1});}init(){const _0x50eb7e=this['context']['plugins']['get'](Pe),_0x25f22b=this['context']['plugins']['get'](He);_0x50eb7e['register']('wideSidebar',this),_0x25f22b['container']&&_0x50eb7e['switchTo']('wideSidebar');}setActiveAnnotation(_0x4746bc){if(_0x4746bc===this['activeAnnotation'])return;const _0x16f389=this['context']['plugins']['get'](He);_0x16f389['_activeAnnotation']=_0x4746bc;const _0x2cd98e=this['activeAnnotation'];_0x16f389['refresh']({'blurredAnnotation':_0x2cd98e,'activatedAnnotation':_0x4746bc}),this['activeAnnotation']=_0x4746bc;}attach(_0x376a69){this['annotations']=_0x376a69;const _0x49cd51=this['context']['plugins']['get'](He);if(_0x49cd51['_annotations']=_0x376a69,this['isAttached'])throw new _0x53d35c('widesidebar-attach-already-attached',this);this['isAttached']=!0x0,this['listenTo'](_0x49cd51,'set:container',()=>{this['detach'](),this['listenTo'](_0x49cd51,'change:container',_0x4210c7=>{_0x4210c7['off'](),this['attach'](_0x376a69);});}),_0x49cd51['_attachToContainer']({'viewClass':'ck-sidebar--wide'});const _0x992ab2=_0x124cac=>{_0x124cac['updateTargetRect'](),_0x49cd51['addAnnotation'](_0x124cac);};for(const _0x51b4ee of _0x376a69)_0x992ab2(_0x51b4ee);this['listenTo'](_0x376a69,'add',(_0x310be3,_0x1dbbed)=>{_0x992ab2(_0x1dbbed);}),this['listenTo'](_0x376a69,'remove',(_0x14d372,_0x17287b,_0x43104a)=>{_0x49cd51['rearrange']({'removedAnnotation':_0x17287b,'previousAnnotation':_0x376a69['get'](_0x43104a-0x1),'nextAnnotation':_0x376a69['get'](_0x43104a+0x1)}),_0x17287b===this['activeAnnotation']&&this['setActiveAnnotation'](null);},{'priority':'high'}),this['listenTo'](_0x376a69,'focus',(_0x187053,_0x51b0fd)=>{this['setActiveAnnotation'](_0x51b0fd);}),this['listenTo'](_0x376a69,'blur',()=>{this['setActiveAnnotation'](null);});const _0x258803=this['context']instanceof _0x3e7b8b?this['context']['editors']:new _0x4c91ff([this['context']]);for(const _0xece7c of _0x258803)this['_integrateWithEditorAnnotations'](_0xece7c);this['listenTo'](_0x258803,'add',(_0x180d39,_0x1e9b13)=>{this['listenTo'](_0x1e9b13,'ready',()=>{this['_integrateWithEditorAnnotations'](_0x1e9b13);});}),this['listenTo'](_0x258803,'remove',(_0x27df51,_0x301750)=>{_0x301750['plugins']['has']('EditorAnnotations')&&this['_destroyEditorAnnotationsIntegration'](_0x301750['plugins']['get']('EditorAnnotations'));}),window['addEventListener']('resize',this['_refreshPositioningDebounced']),this['context']['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning']();}detach(){if(!this['isAttached'])throw new _0x53d35c('widesidebar-detach-not-attached',this);this['setActiveAnnotation'](null);const _0x1f078e=this['context']['plugins']['get'](He);_0x1f078e['_detachFromContainer'](this['annotations']),this['stopListening'](_0x1f078e),this['stopListening'](this['annotations']),this['context']instanceof _0x3e7b8b&&this['stopListening'](this['context']['editors']);for(const _0x20eb8e of Array['from'](this['_editorAnnotations']))this['_destroyEditorAnnotationsIntegration'](_0x20eb8e);window['removeEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioningDebounced']['cancel'](),this['activeAnnotation']=null,this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach']();}_integrateWithEditorAnnotations(_0x270560){if(!_0x270560['plugins']['has']('EditorAnnotations'))return;const _0x3f6aea=_0x270560['plugins']['get']('EditorAnnotations'),_0x33cbe7=()=>{const _0x199cb7=_0x3f6aea['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});this['setActiveAnnotation'](_0x199cb7[0x0]||null);};this['listenTo'](_0x3f6aea,'refresh',_0x33cbe7),this['listenTo'](_0x3f6aea,'blur',(_0x5bb80f,{isAnnotationTracked:_0x20bf24})=>{this['activeAnnotation']&&_0x20bf24(this['activeAnnotation'])&&this['setActiveAnnotation'](null);}),this['listenTo'](_0x3f6aea,'uiUpdate',()=>{this['_refreshPositioningDebounced']();}),this['listenTo'](this['annotations'],'blur',_0x3780be=>{_0x3f6aea['hasDomSelection']()&&(_0x33cbe7(),_0x3780be['stop']());},{'priority':'high'}),this['_editorAnnotations']['add'](_0x3f6aea);}_destroyEditorAnnotationsIntegration(_0x326141){this['stopListening'](_0x326141),this['_editorAnnotations']['remove'](_0x326141);}},Ke=class extends nt{counterView;constructor(_0x2e93f2){super(_0x2e93f2);const _0x273e97=this['bindTemplate'];this['set']('isDirty',!0x1),this['set']('number',0x0),this['bind']('_badge')['to'](this,'isDirty',this,'number',(_0x239579,_0x51f7b2)=>_0x239579?'…':_0x51f7b2['toString']()),this['set']('annotationType',''),this['bind']('icon')['to'](this,'annotationType',_0x1e70aa=>'comment'===_0x1e70aa?_0x3f9088:tt),this['extendTemplate']({'attributes':{'class':['ck-annotation-counter']}}),this['counterView']=new wt(),this['counterView']['setTemplate']({'tag':'span','attributes':{'class':['ck-annotation-counter__badge',_0x273e97['to']('annotationType',_0x307b96=>'ck-annotation-counter__badge--'+_0x307b96),_0x273e97['if']('isDirty','ck-annotation-counter__badge--edit-mode')]},'children':[{'text':_0x273e97['to']('_badge')}]}),this['children']['add'](this['counterView']);}},Ge=class extends _0x1e3609{isAttached;annotations;_manuallyClosedAnnotationViews;_domEmitter;_annotationToNarrowView;_selectedAnnotations;_editorAnnotations;_refreshPositioningDebounced;static get requires(){return[He,Pe];}static get['pluginName'](){return'NarrowSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xa52d3f){super(_0xa52d3f),this['isAttached']=!0x1,this['_manuallyClosedAnnotationViews']=new Set(),this['_domEmitter']=new(_0x42ebb1())(),this['_annotationToNarrowView']=new Map(),this['set']('activeAnnotation',null),this['annotations']=null,this['_selectedAnnotations']=[],this['_editorAnnotations']=new _0x4c91ff(),this['_refreshPositioningDebounced']=_0x52fb1a(()=>{this['_refreshPositioning']();},0xfa,{'leading':!0x1});}init(){this['context']['plugins']['get'](Pe)['register']('narrowSidebar',this),this['_overlayHost']=new _t(this['context']['locale'],{'resolveMountTarget':()=>this['_resolveOverlayTarget'](),'resolveInlineContainer':()=>this['context']['plugins']['get'](He)['container']}),this['_overlayHost']['sync'](),this['bodyCollection']=this['_overlayHost']['bodyCollection'],this['balloonPanelView']=new st(this['context']['locale']),this['bodyCollection']['add'](this['balloonPanelView']);}attach(_0x5af1d6){this['annotations']=_0x5af1d6;const _0x1e073b=this['context']['plugins']['get'](He),_0x2fed12=this['balloonPanelView'];if(_0x1e073b['_annotations']=_0x5af1d6,this['isAttached'])throw new _0x53d35c('narrowsidebar-attach-already-attached',this);this['isAttached']=!0x0,this['listenTo'](_0x1e073b,'set:container',()=>{this['detach'](),this['listenTo'](_0x1e073b,'change:container',_0x560948=>{_0x560948['off'](),this['attach'](_0x5af1d6);});}),_0x1e073b['_attachToContainer']({'viewClass':'ck-sidebar--narrow','spaceBetweenItems':0x5}),this['_overlayHost']['sync']();const _0x2ff504=_0x3df654=>{const _0x550f3a=new Ke(this['context']['locale']);_0x1e073b['addAnnotation'](_0x3df654,_0x550f3a),this['_annotationToNarrowView']['set'](_0x3df654,_0x550f3a),_0x550f3a['bind']('isDirty','annotationType','number')['to'](_0x3df654['view'],'isDirty','type','length'),_0x550f3a['on']('execute',()=>{this['_manuallyClosedAnnotationViews']['clear'](),_0x2fed12['content']['first']!==_0x3df654['view']?(this['_showBalloon'](_0x3df654),_0x3df654['view']['element']['focus'](),this['setActiveAnnotation'](_0x3df654)):this['setActiveAnnotation'](null);});};for(const _0x4d65b9 of _0x5af1d6)_0x2ff504(_0x4d65b9);this['listenTo'](_0x5af1d6,'add',(_0x44bf75,_0x18b93d)=>{_0x2ff504(_0x18b93d);}),this['listenTo'](_0x5af1d6,'remove',(_0x578cb4,_0x56bf02,_0x100c3c)=>{this['_annotationToNarrowView']['get'](_0x56bf02)['destroy'](),this['_annotationToNarrowView']['delete'](_0x56bf02),_0x1e073b['rearrange']({'removedAnnotation':_0x56bf02,'previousAnnotation':_0x5af1d6['get'](_0x100c3c-0x1),'nextAnnotation':_0x5af1d6['get'](_0x100c3c+0x1)}),_0x56bf02===this['activeAnnotation']&&this['setActiveAnnotation'](null);},{'priority':'low'}),this['listenTo'](_0x5af1d6,'focus',(_0x338ee,_0x296384)=>{this['setActiveAnnotation'](_0x296384);}),this['listenTo'](_0x5af1d6,'blur',()=>{this['setActiveAnnotation'](null);}),this['_domEmitter']['listenTo'](document,'keydown',(_0x2d1193,_0x16e2be)=>{_0x16e2be['keyCode']===_0x49ec23['esc']&&_0x2fed12['isVisible']&&(this['_manuallyClosedAnnotationViews']['add'](_0x2fed12['content']['first']),this['_hideBalloon'](),_0x16e2be['stopPropagation'](),_0x16e2be['preventDefault']());}),At({'emitter':this['_domEmitter'],'activator':()=>_0x2fed12['isVisible']&&!this['_hasEditorDomSelection'](),'contextElements':()=>{const _0x389b52=[_0x1e073b['view']['element']];return _0x2fed12['isVisible']&&_0x389b52['push'](_0x2fed12['element']),this['activeAnnotation']&&_0x389b52['push'](...this['activeAnnotation']['focusableElements']),_0x389b52;},'callback':()=>{this['_manuallyClosedAnnotationViews']['clear'](),this['_hideBalloon'](),this['setActiveAnnotation'](null);}});const _0x3dc736=this['context']instanceof _0x3e7b8b?this['context']['editors']:new _0x4c91ff([this['context']]);for(const _0x140ac5 of _0x3dc736)this['_integrateWithEditorAnnotations'](_0x140ac5);this['listenTo'](_0x3dc736,'add',(_0x4e3f60,_0x11c7bc)=>{this['listenTo'](_0x11c7bc,'ready',()=>{this['_integrateWithEditorAnnotations'](_0x11c7bc);});}),this['listenTo'](_0x3dc736,'remove',(_0x39e721,_0x1a1da8)=>{_0x1a1da8['plugins']['has']('EditorAnnotations')&&this['_destroyEditorAnnotationsIntegration'](_0x1a1da8['plugins']['get']('EditorAnnotations'));}),window['addEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioning']();}setActiveAnnotation(_0x139c79){if(_0x139c79===this['activeAnnotation'])return;const _0x7c550=this['context']['plugins']['get'](He);_0x7c550['refresh']({'blurredAnnotation':this['activeAnnotation'],'activatedAnnotation':_0x139c79,'disableAnimationOnActivatedAnnotation':!0x0}),_0x139c79&&_0x7c550['getSidebarItemView'](_0x139c79)?this['_showBalloon'](_0x139c79):this['_hideBalloon'](),this['activeAnnotation']=_0x139c79;}detach(){if(!this['isAttached'])throw new _0x53d35c('narrowsidebar-detach-not-attached',this);this['setActiveAnnotation'](null);const _0x17daaf=this['context']['plugins']['get'](He);this['_hideBalloon'](),Array['from'](this['_annotationToNarrowView']['values'](),_0x475b3e=>_0x475b3e['destroy']()),this['_annotationToNarrowView']['clear'](),_0x17daaf['_detachFromContainer'](this['annotations']),this['stopListening'](),this['_domEmitter']['stopListening'](),this['context']instanceof _0x3e7b8b&&this['stopListening'](this['context']['editors']);for(const _0x48d03e of Array['from'](this['_editorAnnotations']))this['_destroyEditorAnnotationsIntegration'](_0x48d03e);window['removeEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioningDebounced']['cancel'](),this['_selectedAnnotations']=[],this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach'](),this['_overlayHost']['destroy']();}_integrateWithEditorAnnotations(_0x30ffeb){if(!_0x30ffeb['plugins']['has']('EditorAnnotations'))return;const _0x621c4b=_0x30ffeb['plugins']['get']('EditorAnnotations'),_0x3eaffd=this['context']['plugins']['get'](He),_0x3e79ec=this['annotations'],_0x2151ee=this['balloonPanelView'],_0x316166=()=>{const _0x356b71=_0x621c4b['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});this['_setSelectedAnnotations'](_0x356b71),this['setActiveAnnotation'](_0x356b71[0x0]||null);};this['listenTo'](_0x621c4b,'refresh',_0x316166),this['listenTo'](_0x621c4b,'blur',(_0x19de18,{isAnnotationTracked:_0xa269a1})=>{this['activeAnnotation']&&_0xa269a1(this['activeAnnotation'])&&(this['_setSelectedAnnotations']([]),this['setActiveAnnotation'](null));}),this['listenTo'](_0x621c4b,'uiUpdate',()=>{this['_refreshPositioningDebounced']();}),this['listenTo'](_0x3e79ec,'blur',_0x20449b=>{_0x621c4b['hasDomSelection']()&&_0x20449b['stop']();},{'priority':'high'}),At({'emitter':this['_domEmitter'],'activator':()=>!!this['activeAnnotation'],'contextElements':()=>{const _0x413350=[_0x3eaffd['view']['element']];return _0x2151ee['isVisible']&&_0x413350['push'](_0x2151ee['element']),_0x413350;},'callback':()=>{_0x621c4b['hasDomSelection']()&&_0x316166();}}),this['_editorAnnotations']['add'](_0x621c4b),this['_overlayHost']['sync']();}_destroyEditorAnnotationsIntegration(_0x1d33f4){_0x1d33f4&&(this['stopListening'](_0x1d33f4),this['_editorAnnotations']['remove'](_0x1d33f4));}_hasEditorDomSelection(){return Array['from'](this['_editorAnnotations'])['some'](_0x1fb982=>_0x1fb982['hasDomSelection']());}_setSelectedAnnotations(_0x486e75){for(const _0x4d7bf7 of this['_selectedAnnotations'])_0x486e75['includes'](_0x4d7bf7)||this['_manuallyClosedAnnotationViews']['delete'](_0x4d7bf7['view']);this['_selectedAnnotations']=_0x486e75;}_refreshPositioning(){const _0x9310cb=this['balloonPanelView'];this['context']['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning'](),_0x9310cb['isVisible']&&this['_updateBalloonPosition']();}_resolveOverlayTarget(){const _0x53266b=this['context']['config']['get']('sidebar.overlayContainer')||this['context']['config']['get']('ui.overlayContainer');if(_0x53266b)return _0x53266b;const _0x31d93b=this['context']['plugins']['get'](He)['container'];return _0x31d93b?_0xe515f4(_0x31d93b):null;}['_showBalloon'](_0x24ee3e){if(this['_manuallyClosedAnnotationViews']['has'](_0x24ee3e['view']))return;const _0x8a8ac6=this['balloonPanelView']['content']['first'];_0x8a8ac6!==_0x24ee3e['view']?(_0x8a8ac6&&this['_detachListeners'](_0x8a8ac6),this['_overlayHost']['sync'](),this['_attachListeners'](_0x24ee3e['view']),this['balloonPanelView']['content']['clear'](),this['balloonPanelView']['content']['add'](_0x24ee3e['view']),this['_updateBalloonPosition']()):this['_updateBalloonPosition']();}_updateBalloonPosition(){const _0x32fd89=this['balloonPanelView']['content']['first'],_0x22cc78=_0x32fd89&&this['annotations']['getByView'](_0x32fd89);if(!_0x22cc78||!this['_annotationToNarrowView']['has'](_0x22cc78))return;const _0x61401a=this['_annotationToNarrowView']['get'](_0x22cc78)['element'],_0xd000f7=(function(){const _0x34a2d6=st['defaultPositions'];return[_0x34a2d6['southArrowNorthEast'],_0x34a2d6['northArrowSouthEast'],_0x34a2d6['southArrowNorth'],_0x34a2d6['northArrowSouth'],_0x34a2d6['southArrowNorthWest'],_0x34a2d6['northArrowSouthWest']];}());this['balloonPanelView']['pin']({'target':_0x61401a,'positions':_0xd000f7});}['_hideBalloon'](){const _0x5afe3d=this['balloonPanelView'],_0x1b5f79=_0x5afe3d['content']['first'];_0x1b5f79&&(this['_detachListeners'](_0x1b5f79),_0x5afe3d['unpin'](),_0x5afe3d['content']['clear']());}_attachListeners(_0xc0885d){this['listenTo'](_0xc0885d,'change:height',()=>this['_updateBalloonPosition']()),this['listenTo'](_0xc0885d,'Esc',(_0x44c722,_0x16da66)=>{this['_manuallyClosedAnnotationViews']['add'](_0xc0885d),this['_hideBalloon'](),_0x16da66();});}_detachListeners(_0x144b3f){this['stopListening'](_0x144b3f);}},Ye=class extends _0x287b4d{isAttached;annotations;['_manuallyClosed'];['_balloon'];_addedAnnotations;_selectedAnnotations;['_forceRefresh'];_refreshVisibilityDebounced;static get requires(){return[ye,ot,Pe];}static get['pluginName'](){return'InlineAnnotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5acb5e){super(_0x5acb5e),_0x5acb5e['editing']['view']['addObserver'](yt),this['isAttached']=!0x1,this['set']('activeAnnotation',null),this['annotations']=null,this['_manuallyClosed']=new Set(),this['_balloon']=_0x5acb5e['plugins']['get'](ot),this['_addedAnnotations']=new Set(),this['_selectedAnnotations']=[],this['_forceRefresh']=!0x1,this['_refreshVisibilityDebounced']=_0x52fb1a(()=>{this['editor']['plugins']['get']('Annotations')['refreshVisibility']();},0xfa,{'leading':!0x1});}init(){const _0x2ebb37=this['editor']['plugins']['get'](Pe);_0x2ebb37['context']===this['editor']&&(_0x2ebb37['register']('inline',this),this['editor']['keystrokes']['set']('Esc',(_0x4d41b0,_0x304e31)=>{const _0xe84fce=this['_balloon'];if(this['isAttached']&&_0xe84fce['visibleView']){const _0x53abd4=this['annotations']['getByView'](_0xe84fce['visibleView']);_0x53abd4&&this['_closeAnnotation'](_0x53abd4),_0x304e31();}}));}afterInit(){const _0x1895a1=this['editor']['plugins']['get'](Pe);_0x1895a1['context']===this['editor']&&(_0x1895a1['hasActive']()||_0x1895a1['switchTo']('inline'));}setActiveAnnotation(_0x40b442){_0x40b442!==this['activeAnnotation']&&(this['activeAnnotation']&&(this['activeAnnotation']['isActive']=!0x1),_0x40b442&&this['editor']['ui']['focusTracker']['isFocused']&&(this['annotations']['has'](_0x40b442)&&this['_addAnnotationToBalloon'](_0x40b442,!0x0),_0x40b442['isActive']=!0x0),_0x40b442||this['_setSelectedAnnotations']([]),this['activeAnnotation']=_0x40b442);}attach(_0x4751e3){this['annotations']=_0x4751e3;const _0x3a236d=this['editor']['plugins']['get'](Pe),_0x4ae580=this['_balloon'];if(this['isAttached'])throw new _0x53d35c('inlineannotations-attach-already-attached',this);if(_0x3a236d['context']!==this['editor'])throw new _0x53d35c('inlineannotations-not-allowed-with-context',this);const _0x31b96a=this['editor']['plugins']['get'](ye);this['listenTo'](_0x31b96a,'refresh',()=>{const _0x551fcd=_0x31b96a['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});var _0x537f07,_0x5854d9;!this['_forceRefresh']&&(_0x537f07=_0x551fcd,_0x5854d9=this['_selectedAnnotations'],_0x537f07['length']===_0x5854d9['length']&&_0x537f07['every'](_0x9c3934=>_0x5854d9['includes'](_0x9c3934)))||(this['_forceRefresh']=!0x1,this['_setSelectedAnnotations'](_0x551fcd),this['setActiveAnnotation'](_0x551fcd[0x0]||null));}),this['listenTo'](_0x31b96a,'blur',(_0x31524f,{isAnnotationTracked:_0x4d551c})=>{this['activeAnnotation']&&_0x4d551c(this['activeAnnotation'])&&(this['_setSelectedAnnotations']([]),this['setActiveAnnotation'](null));}),this['listenTo'](_0x31b96a,'uiUpdate',()=>{this['_refreshVisibilityDebounced']();}),this['listenTo'](this['editor']['ui']['focusTracker'],'change:isFocused',(_0x48f774,_0xb12e14,_0x12356d)=>{_0x12356d||this['setActiveAnnotation'](null);}),this['listenTo'](_0x4751e3,'remove',(_0x4cc24d,_0x4fd25f)=>{this['_removeAnnotationFromBalloon'](_0x4fd25f),_0x4fd25f===this['activeAnnotation']&&this['setActiveAnnotation'](null);}),this['listenTo'](_0x4ae580,'change:visibleView',(_0x3d311a,_0x359c53,_0x48025c,_0x4721eb)=>{_0x4721eb&&this['stopListening'](_0x4721eb);const _0x3869d3=_0x4751e3['getByView'](_0x48025c);_0x48025c&&_0x3869d3&&(this['listenTo'](_0x48025c,'change:height',()=>{_0x4ae580['updatePosition']();}),this['listenTo'](_0x48025c,'Esc',()=>{this['_closeAnnotation'](_0x3869d3),this['editor']['editing']['view']['focus']();}),this['activeAnnotation']!==_0x3869d3&&this['setActiveAnnotation'](_0x3869d3));}),this['listenTo'](this['editor']['ui'],'update',()=>{_0x4ae580['visibleView']&&_0x4751e3['getByView'](_0x4ae580['visibleView'])&&_0x4ae580['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 _0x53d35c('inlineannotations-detach-not-attached',this);this['setActiveAnnotation'](null);for(const _0x2b55b7 of this['_addedAnnotations'])this['_removeAnnotationFromBalloon'](_0x2b55b7);this['_refreshVisibilityDebounced']['cancel'](),this['stopListening'](),this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach'](),this['_refreshVisibilityDebounced']['cancel']();}_setSelectedAnnotations(_0x3c1366){for(const _0x57d634 of this['_selectedAnnotations'])_0x3c1366['includes'](_0x57d634)||this['_manuallyClosed']['delete'](_0x57d634);for(const _0x16df14 of this['annotations'])_0x3c1366['includes'](_0x16df14)||this['_removeAnnotationFromBalloon'](_0x16df14);if(this['editor']['ui']['focusTracker']['isFocused']){for(const _0x3e73dc of _0x3c1366)this['_addAnnotationToBalloon'](_0x3e73dc);}this['_selectedAnnotations']=_0x3c1366;}_addAnnotationToBalloon(_0x51aab4,_0x20dfc5=!0x1){this['_manuallyClosed']['has'](_0x51aab4)||(this['_addedAnnotations']['has'](_0x51aab4)||this['_balloon']['hasView'](_0x51aab4['view'])||(this['_addedAnnotations']['add'](_0x51aab4),this['_balloon']['add']({'stackId':_0x51aab4['view']['id'],'view':_0x51aab4['view'],'position':{'target':()=>this['_getBalloonTargetForAnnotation'](_0x51aab4)}})),_0x20dfc5&&this['_balloon']['showStack'](_0x51aab4['view']['id']));}_getBalloonTargetForAnnotation(_0x3f1c7a){const _0x219ce5=_0x3f1c7a['target'],_0x77f55e=this['editor']['editing']['view'],_0x30733e=_0x77f55e['document']['selection']['getFirstRange'](),_0x37649e=_0x77f55e['domConverter']['viewRangeToDom'](_0x30733e);if(_0x37649e['collapse'](!0x0),_0x219ce5){if(_0x219ce5 instanceof _0x5bd772)return _0x219ce5;let _0xbc5974=[];for(const _0x4e7fd5 of _0x219ce5)_0xbc5974['push'](..._0x5bd772['getDomElementRects'](_0x4e7fd5));_0xbc5974=function(_0x287701){const _0x5e46c0=[];let _0x27559e=_0x287701[0x0];for(let _0x5670fd=0x1;_0x5670fd<_0x287701['length'];_0x5670fd++)if(Xe(_0x27559e,_0x287701[_0x5670fd])){const _0x53828d=_0x287701[_0x5670fd]['width'];_0x27559e['width']+=_0x53828d,_0x27559e['right']+=_0x53828d;}else _0x5e46c0['push'](_0x27559e),_0x27559e=_0x287701[_0x5670fd];return _0x5e46c0['push'](_0x27559e),_0x5e46c0;}(_0xbc5974);const _0x5b3934=_0x37649e['getBoundingClientRect']();return _0xbc5974['find'](_0x55951c=>_0x55951c['top']<=_0x5b3934['top']&&_0x55951c['bottom']>=_0x5b3934['bottom']&&_0x55951c['left']<=_0x5b3934['left']&&_0x55951c['right']>=_0x5b3934['right'])||_0xbc5974[0x0];}return _0x3f1c7a['targetRect']||_0x37649e;}_removeAnnotationFromBalloon(_0x216c84){this['_addedAnnotations']['has'](_0x216c84)&&this['_balloon']['hasView'](_0x216c84['view'])&&(this['_addedAnnotations']['delete'](_0x216c84),this['_balloon']['remove'](_0x216c84['view']));}_closeAnnotation(_0x31612e){this['_manuallyClosed']['add'](_0x31612e),this['_removeAnnotationFromBalloon'](_0x31612e);}};function Xe(_0x235379,_0x3d4da7){return _0x235379['top']===_0x3d4da7['top']&&_0x235379['bottom']===_0x3d4da7['bottom']&&_0x235379['right']===_0x3d4da7['left'];}var qe=class extends wt{['focusTracker'];['focusCycler'];_annotationViews;constructor(_0x16a968,_0x5fe146){super(_0x16a968),this['set']('isEmpty',!_0x5fe146['length']),this['focusTracker']=new _0x494444(),this['_annotationViews']=_0x5fe146,this['_annotationViews']['delegate']('arrowup','arrowdown')['to'](this),this['on']('arrowup',()=>{this['focusCycler']['focusPrevious']();}),this['on']('arrowdown',()=>{this['focusCycler']['focusNext']();}),this['focusCycler']=new dt({'focusables':_0x5fe146,'focusTracker':this['focusTracker']}),this['listenTo'](_0x5fe146,'add',()=>{this['isEmpty']=!0x1;}),this['listenTo'](_0x5fe146,'remove',(_0x1c2cff,_0x50d43c)=>{_0x50d43c['isActive']&&this['focus'](),_0x5fe146['length']||(this['isEmpty']=!0x0);});const _0x28abc3=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'dir':'auto','class':['ck','ck-comments-archive'],'tabindex':-0x1,'role':'list','aria-label':Vt(_0x16a968,'COMMENTS_ARCHIVE_LIST_LABEL')},'children':[{'tag':'div','attributes':{'class':['ck-comments-archive__content'],'role':'presentation'},'children':[{'tag':'div','attributes':{'role':'presentation'},'children':_0x5fe146},{'tag':'p','attributes':{'class':['ck-comments-archive__info',_0x28abc3['if']('isEmpty','ck-hidden',_0xf3406c=>!_0xf3406c)]},'children':[{'text':Vt(_0x16a968,'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 _0xc00f52 of this['_annotationViews'])this['focusTracker']['add'](_0xc00f52['element']);this['_annotationViews']['on']('change',(_0x19e8d0,{added:_0x3be5c4,removed:_0x5e8b58})=>{for(const _0x14c9aa of _0x3be5c4)this['focusTracker']['add'](_0x14c9aa['element']);for(const _0x3be1db of _0x5e8b58)this['focusTracker']['remove'](_0x3be1db['element']);});}},$e=class extends _0x1e3609{static get['pluginName'](){return'CommentsArchive';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[we,me];}constructor(_0x11ba91){super(_0x11ba91),this['archivedThreads']=new _0x4c91ff();}init(){const _0x4adb31=this['context'],_0x9b8c8e=_0x4adb31['plugins']['get'](we),_0x290c4d=_0x4adb31['plugins']['get'](me);this['listenTo'](_0x9b8c8e,'addCommentThread',(_0xb862a2,{threadId:_0x2b1c9b})=>{const _0x3b124d=_0x9b8c8e['getCommentThread'](_0x2b1c9b);_0x3b124d['archivedAt']&&this['archivedThreads']['add'](_0x3b124d,this['_calculatePosition'](_0x3b124d['archivedAt'])),this['listenTo'](_0x3b124d,'change:archivedAt',(_0x566ad3,_0xc34850,_0x479cc8)=>{_0x479cc8?this['archivedThreads']['has'](_0x3b124d)||this['archivedThreads']['add'](_0x3b124d,this['_calculatePosition'](_0x3b124d['archivedAt'])):this['archivedThreads']['has'](_0x3b124d)&&this['archivedThreads']['remove'](_0x3b124d);});}),this['listenTo'](_0x9b8c8e,'removeCommentThread',(_0x3905ca,{threadId:_0x1c2fb1})=>{const _0x41c724=_0x9b8c8e['getCommentThread'](_0x1c2fb1);this['stopListening'](_0x41c724),this['archivedThreads']['has'](_0x41c724)&&this['archivedThreads']['remove'](_0x41c724);},{'priority':'highest'}),this['listenTo'](_0x290c4d['collection'],'focus',(_0x13d40c,_0x3c25bc)=>{_0x3c25bc['isVisible']||(_0x3c25bc['isActive']=!0x0,_0x290c4d['activate'](_0x3c25bc));});}_calculatePosition(_0x138993){const _0x13db50=[...this['archivedThreads']]['findIndex'](_0xd73987=>_0xd73987['archivedAt']<_0x138993);return _0x13db50>-0x1?_0x13db50:this['archivedThreads']['length'];}},je=class extends _0x287b4d{commentsArchiveView;annotationViews;['_pendingThreads'];static get['pluginName'](){return'CommentsArchiveUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[$e,rt];}constructor(_0x554e37){super(_0x554e37),this['annotationViews']=new gt(),this['_pendingThreads']=[];}init(){const _0x3083bf=this['editor'],_0x6242c9=this['_hideDialogOnAnnotationEscape']['bind'](this);_0x3083bf['ui']['componentFactory']['add']('commentsArchive',()=>this['_createCommentsArchiveButton'](nt,!0x0)),_0x3083bf['ui']['componentFactory']['add']('menuBar:commentsArchive',()=>{const _0x18eee6=this['_createCommentsArchiveButton'](pt);return _0x18eee6['set']({'role':'menuitemcheckbox'}),_0x18eee6;});const _0x157e10=_0x3083bf['plugins']['get']($e),_0x46ad1c=_0x3083bf['plugins']['get']('Annotations'),_0x6c0677=_0x3083bf['plugins']['get']('CommentsRepository');_0x157e10['archivedThreads']['forEach'](_0x50b66c=>{this['_handleNewThread'](_0x50b66c);}),this['listenTo'](_0x157e10['archivedThreads'],'add',(_0xeecfd1,_0x27388a)=>{this['_handleNewThread'](_0x27388a);}),this['listenTo'](_0x46ad1c['collection'],'add',(_0x13c962,_0x451a7a)=>{const _0x33e01f=this['_pendingThreads']['find'](_0x5f25ae=>{const _0xcbba30=_0x6c0677['_threadToController']['get'](_0x5f25ae);return _0xcbba30&&_0x451a7a['innerView']===_0xcbba30['view'];});if(_0x33e01f){const _0x34de94=this['_calculatePosition'](_0x33e01f['archivedAt']);this['_addAnnotationToArchive'](_0x451a7a,_0x34de94),this['_pendingThreads']['splice'](this['_pendingThreads']['indexOf'](_0x33e01f),0x1);}}),this['listenTo'](_0x157e10['archivedThreads'],'remove',(_0x242c1d,_0x4b0811)=>{const _0x152aff=_0x3083bf['config']['get']('collaboration.channelId');if(!_0x152aff||_0x4b0811['channelId']===_0x152aff){if(this['_pendingThreads']['includes'](_0x4b0811))this['_pendingThreads']['splice'](this['_pendingThreads']['indexOf'](_0x4b0811),0x1);else{const _0x5ee340=_0x6c0677['_threadToController']['get'](_0x4b0811),_0x17fbd6=_0x46ad1c['getByInnerView'](_0x5ee340['view']);this['annotationViews']['remove'](_0x17fbd6['view']),this['stopListening'](_0x17fbd6),this['stopListening'](_0x17fbd6['focusableElements']);}}}),this['listenTo'](_0x46ad1c['collection'],'add',(_0x41c640,_0x131457)=>{this['listenTo'](_0x131457,'escape',_0x6242c9);}),this['listenTo'](_0x46ad1c['collection'],'remove',(_0x38701d,_0x5e4a43)=>{this['stopListening'](_0x5e4a43,'escape',_0x6242c9);});}_addAnnotationToArchive(_0x55db1d,_0x459047){this['listenTo'](_0x55db1d,'set:isVisible',_0x14a852=>{_0x14a852['return']=!0x1,_0x14a852['stop']();}),this['annotationViews']['add'](_0x55db1d['view'],_0x459047);}['_handleNewThread'](_0x96bcf8){const _0x49cada=this['editor']['plugins']['get']('CommentsRepository'),_0x549dfd=this['editor']['plugins']['get']('Annotations'),_0x5f38fa=this['editor']['config']['get']('collaboration.channelId');if(!_0x5f38fa||_0x96bcf8['channelId']===_0x5f38fa){const _0x5e2a75=_0x49cada['_threadToController']['get'](_0x96bcf8);if(!_0x5e2a75)return void this['_pendingThreads']['push'](_0x96bcf8);const _0xa0b631=this['_calculatePosition'](_0x96bcf8['archivedAt']),_0x7c2ee0=_0x549dfd['getByInnerView'](_0x5e2a75['view']);_0x7c2ee0['isVisible']&&_0x549dfd['_visibleAnnotations']['remove'](_0x7c2ee0),this['_addAnnotationToArchive'](_0x7c2ee0,_0xa0b631);}}_calculatePosition(_0x570a5a){const _0x525695=this['editor']['config']['get']('collaboration.channelId'),_0xc815f2=[...this['editor']['plugins']['get']($e)['archivedThreads']]['filter'](_0x16b7c4=>_0x16b7c4['channelId']===_0x525695)['findIndex'](_0x2d2299=>_0x2d2299['archivedAt']<_0x570a5a);return _0xc815f2<0x0||_0xc815f2>this['annotationViews']['length']?this['annotationViews']['length']:_0xc815f2-0x1;}_toggleDialog(){const _0x11a69d=this['editor'],_0x2ac6ff=_0x11a69d['plugins']['get']('Dialog');this['commentsArchiveView']||(this['commentsArchiveView']=new qe(_0x11a69d['locale'],this['annotationViews'])),'commentsArchive'===_0x2ac6ff['id']?_0x2ac6ff['hide']():_0x2ac6ff['show']({'id':'commentsArchive','title':Vt(_0x11a69d['locale'],'COMMENTS_ARCHIVE'),'hasCloseButton':!0x0,'content':this['commentsArchiveView'],'position':ht['EDITOR_TOP_SIDE']});}_createCommentsArchiveButton(_0x1b0b53,_0x5eca13=!0x1){const _0x360918=this['editor']['locale'],_0x2eb50d=this['editor']['plugins']['get']('Dialog'),_0x4e2c5c=new _0x1b0b53(_0x360918);return _0x4e2c5c['bind']('isEnabled')['to'](this,'isEnabled'),_0x4e2c5c['bind']('isOn')['to'](_0x2eb50d,'id',_0x407286=>'commentsArchive'===_0x407286),_0x4e2c5c['set']({'label':Vt(_0x360918,'COMMENTS_ARCHIVE'),'icon':_0x4d0228,'isToggleable':!0x0}),_0x5eca13&&(_0x4e2c5c['tooltip']=!0x0),this['listenTo'](_0x4e2c5c,'execute',()=>this['_toggleDialog']()),_0x4e2c5c;}_hideDialogOnAnnotationEscape=_0xa12e13=>{const _0x35eea4=_0xa12e13['source'];if(!this['annotationViews']['has'](_0x35eea4['view']))return;const _0x34f264=this['editor']['plugins']['get']('Dialog');_0x34f264['isOpen']&&'commentsArchive'===_0x34f264['id']&&(_0x34f264['hide'](),_0xa12e13['stop']());};},ze=class extends _0x287b4d{static get requires(){return[we,Ne,xe,$e,je,Se,We,Ge,Ye];}static get['pluginName'](){return'Comments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{Te as AddCommentThreadCommand,he as Annotation,ce as AnnotationCollection,Ke as AnnotationCounterButtonView,oe as AnnotationView,me as Annotations,Be as AnnotationsSidebarItemView,De as AnnotationsSidebarView,Pe as AnnotationsUIs,Jt as BaseCommentThreadView,ee as BaseCommentView,Ae as Comment,ge as CommentThread,Dt as CommentThreadController,Gt as CommentThreadInputView,Zt as CommentThreadView,se as CommentView,ze as Comments,$e as CommentsArchive,je as CommentsArchiveUI,Ne as CommentsEditing,Xt as CommentsListView,Se as CommentsOnly,we as CommentsRepository,xe as CommentsUI,ye as EditorAnnotations,Ye as InlineAnnotations,Ge as NarrowSidebar,He as Sidebar,We as WideSidebar,de as bindAnnotationCollections};
|