@univerjs-pro/collaboration-client-ui 0.21.1 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +33 -7
  2. package/lib/cjs/facade.js +1 -1
  3. package/lib/cjs/index.js +1 -1
  4. package/lib/cjs/locale/ca-ES.js +1 -1
  5. package/lib/cjs/locale/en-US.js +1 -1
  6. package/lib/cjs/locale/es-ES.js +1 -1
  7. package/lib/cjs/locale/fa-IR.js +1 -1
  8. package/lib/cjs/locale/fr-FR.js +1 -1
  9. package/lib/cjs/locale/ja-JP.js +1 -1
  10. package/lib/cjs/locale/ko-KR.js +1 -1
  11. package/lib/cjs/locale/ru-RU.js +1 -1
  12. package/lib/cjs/locale/sk-SK.js +1 -1
  13. package/lib/cjs/locale/vi-VN.js +1 -1
  14. package/lib/cjs/locale/zh-CN.js +1 -1
  15. package/lib/cjs/locale/zh-TW.js +1 -1
  16. package/lib/es/facade.js +1 -1
  17. package/lib/es/index.js +1 -1
  18. package/lib/es/locale/ca-ES.js +1 -1
  19. package/lib/es/locale/en-US.js +1 -1
  20. package/lib/es/locale/es-ES.js +1 -1
  21. package/lib/es/locale/fa-IR.js +1 -1
  22. package/lib/es/locale/fr-FR.js +1 -1
  23. package/lib/es/locale/ja-JP.js +1 -1
  24. package/lib/es/locale/ko-KR.js +1 -1
  25. package/lib/es/locale/ru-RU.js +1 -1
  26. package/lib/es/locale/sk-SK.js +1 -1
  27. package/lib/es/locale/vi-VN.js +1 -1
  28. package/lib/es/locale/zh-CN.js +1 -1
  29. package/lib/es/locale/zh-TW.js +1 -1
  30. package/lib/facade.js +1 -1
  31. package/lib/index.js +1 -1
  32. package/lib/locale/ca-ES.js +1 -1
  33. package/lib/locale/en-US.js +1 -1
  34. package/lib/locale/es-ES.js +1 -1
  35. package/lib/locale/fa-IR.js +1 -1
  36. package/lib/locale/fr-FR.js +1 -1
  37. package/lib/locale/ja-JP.js +1 -1
  38. package/lib/locale/ko-KR.js +1 -1
  39. package/lib/locale/ru-RU.js +1 -1
  40. package/lib/locale/sk-SK.js +1 -1
  41. package/lib/locale/vi-VN.js +1 -1
  42. package/lib/locale/zh-CN.js +1 -1
  43. package/lib/locale/zh-TW.js +1 -1
  44. package/lib/umd/facade.js +1 -1
  45. package/lib/umd/index.js +1 -1
  46. package/lib/umd/locale/ca-ES.js +1 -1
  47. package/lib/umd/locale/en-US.js +1 -1
  48. package/lib/umd/locale/es-ES.js +1 -1
  49. package/lib/umd/locale/fa-IR.js +1 -1
  50. package/lib/umd/locale/fr-FR.js +1 -1
  51. package/lib/umd/locale/ja-JP.js +1 -1
  52. package/lib/umd/locale/ko-KR.js +1 -1
  53. package/lib/umd/locale/ru-RU.js +1 -1
  54. package/lib/umd/locale/sk-SK.js +1 -1
  55. package/lib/umd/locale/vi-VN.js +1 -1
  56. package/lib/umd/locale/zh-CN.js +1 -1
  57. package/lib/umd/locale/zh-TW.js +1 -1
  58. package/package.json +26 -20
package/lib/index.js CHANGED
@@ -1 +1 @@
1
- const _0x13b516=_0xd732;(function(_0x420009,_0xdf4b51){const _0x5842be=_0xd732,_0x314285=_0x420009();while(!![]){try{const _0x15c9a2=parseInt(_0x5842be(0x15f))/0x1+-parseInt(_0x5842be(0x1af))/0x2+-parseInt(_0x5842be(0xe0))/0x3*(parseInt(_0x5842be(0x18b))/0x4)+-parseInt(_0x5842be(0x141))/0x5+-parseInt(_0x5842be(0x147))/0x6*(-parseInt(_0x5842be(0x23c))/0x7)+-parseInt(_0x5842be(0x199))/0x8*(-parseInt(_0x5842be(0x12a))/0x9)+parseInt(_0x5842be(0x289))/0xa;if(_0x15c9a2===_0xdf4b51)break;else _0x314285['push'](_0x314285['shift']());}catch(_0x3c90c0){_0x314285['push'](_0x314285['shift']());}}}(_0x2fa9,0x2f029));import{COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY,CollaborationController,CollaborationSessionService,CollaborationSocketService,CollaborationStatus,CollaborationUIEventId,CollaborationUIEventService,DEFAULT_REMOTE_UNISCRIPT_EXECUTION_ENDPOINT,DEFAULT_WS_SESSION_TICKET_URL,DataLoaderService,DocCollaborationEntity,ILocalCacheService,LOCAL_CACHE_INTERVAL,LOCAL_CACHE_INTERVAL_KEY,MemberService,REMOTE_UNISCRIPT_EXECUTION_ENDPOINT_KEY,SessionStatus,UnitStatus,UniverCollaborationClientPlugin,getLocalCacheKey}from'@univerjs-pro/collaboration-client';import{COLORS,CanceledError,ColorKit,CommandType,DOC_RANGE_TYPE,DependentOn,Disposable,DisposableCollection,ICommandService,IConfigService,ILocalStorageService,ILogService,IUniverInstanceService,Inject,Injector,LocaleService,Optional,Plugin,Rectangle,RxDisposable,ThemeService,Tools,UniverInstanceType,Workbook,createIdentifier,debounce,fromEventSubject,generateRandomId,isFormulaId,isFormulaString,merge,mergeOverrideWithDependencies,registerDependencies,toDisposable,touchDependencies}from'@univerjs/core';import{BuiltInUIPart,IBeforeCloseService,IMessageService,INotificationService,IUIPartsService,connectInjector,useDependency,useObservable}from'@univerjs/ui';import{BehaviorSubject,Subject,combineLatest,debounceTime,distinctUntilChanged,filter,fromEvent,mapTo,merge as _0x3a00a0,of,shareReplay,switchMap,takeUntil}from'rxjs';import{MessageType,Tooltip,clsx}from'@univerjs/design';import{LoadingMultiIcon,OffLineIcon,OnLineIcon}from'@univerjs/icons';import{useCallback,useMemo}from'react';import{jsx}from'react/jsx-runtime';import{IRemoteInstanceService}from'@univerjs/rpc';import{EffectRefRangId,RefRangeService,SetSelectionsOperation,SetWorksheetActivateCommand,SheetsSelectionsService,handleDeleteRangeMoveLeft,handleDeleteRangeMoveUp,handleIRemoveCol,handleIRemoveRow,handleInsertCol,handleInsertRangeMoveDown,handleInsertRangeMoveRight,handleInsertRow,handleMoveRange,runRefRangeMutations}from'@univerjs/sheets';import{IRenderManagerService,Rect,RegularPolygon,SHEET_VIEWPORT_KEY,Shape,TRANSFORM_CHANGE_OBSERVABLE_TYPE,Vector2,getColor}from'@univerjs/engine-render';import{HTTPService,ISocketService,WebSocketService}from'@univerjs/network';function _0xd732(_0x19577e,_0x478fb4){_0x19577e=_0x19577e-0xd5;const _0x2fa9ce=_0x2fa9();let _0xd732f0=_0x2fa9ce[_0x19577e];return _0xd732f0;}import{DocIMEInputManagerService,DocStateChangeManagerService,IDocClipboardService,NodePositionConvertToCursor,NodePositionConvertToRectRange,SetDocZoomRatioOperation,TEXT_RANGE_LAYER_INDEX}from'@univerjs/docs-ui';import{IImageIoService}from'@univerjs/drawing';import{CollaborationEvent,ISnapshotServerService,ITransformService,RevisionService,isTransformMutationFailure,isTransformMutationsWithChangesetSuccess}from'@univerjs-pro/collaboration';import{DocSelectionManagerService,DocSkeletonManagerService,RichTextEditingMutation,SetTextSelectionsOperation}from'@univerjs/docs';import{FormulaExecuteStageType,FormulaExecutedStateType,SetFormulaCalculationNotificationMutation,SetFormulaCalculationStartMutation,deserializeRangeWithSheet,serializeRangeWithSheet}from'@univerjs/engine-formula';import{filter as _0x354a47,map,switchMap as _0x39da34,takeUntil as _0x27f82a,throttleTime}from'rxjs/operators';import{SheetSkeletonManagerService,getCoordByCell,getSheetObject}from'@univerjs/sheets-ui';import{ErrorCode}from'@univerjs/protocol';function getStatusConfig(_0x1ba5a2){const _0x1ca601=_0xd732;switch(_0x1ba5a2){case CollaborationStatus['OFFLINE']:return{'icon':jsx(OffLineIcon,{}),'colorClass':'univer-text-red-500','i18nKey':_0x1ca601(0xf9),'tooltipKey':_0x1ca601(0x170),'clickable':!![],'indicator':_0x1ca601(0x2f4)};case CollaborationStatus[_0x1ca601(0x15a)]:return{'icon':jsx(OffLineIcon,{}),'colorClass':_0x1ca601(0x15e),'i18nKey':_0x1ca601(0x1df),'clickable':![],'indicator':'static'};case CollaborationStatus[_0x1ca601(0x2a4)]:return{'icon':jsx(LoadingMultiIcon,{}),'colorClass':_0x1ca601(0x1bf),'i18nKey':_0x1ca601(0x2da),'clickable':![],'indicator':_0x1ca601(0x2d0)};case CollaborationStatus[_0x1ca601(0x248)]:return{'icon':jsx(OnLineIcon,{}),'colorClass':_0x1ca601(0xfd),'i18nKey':_0x1ca601(0x11b),'clickable':![],'indicator':_0x1ca601(0x2f4)};case CollaborationStatus['AWAITING']:case CollaborationStatus[_0x1ca601(0x238)]:return{'icon':jsx(LoadingMultiIcon,{}),'colorClass':_0x1ca601(0x1bf),'i18nKey':'collabStatus.syncing','clickable':![],'indicator':_0x1ca601(0x2d0)};case CollaborationStatus['SYNCED']:case CollaborationStatus['PENDING']:return{'icon':jsx(OnLineIcon,{}),'colorClass':'univer-text-green-500','i18nKey':_0x1ca601(0x157),'clickable':![],'indicator':_0x1ca601(0x2f4)};}}function CollaborationStatusDisplay(_0x175e4e){const _0xbb65f3=_0xd732,{status$:_0x35e6d8}=_0x175e4e,_0x30b4df=useObservable(_0x35e6d8,CollaborationStatus['NOT_COLLAB']),_0x37c28b=useDependency(LocaleService),_0x7a3069=useDependency(CollaborationSessionService),_0x4405e3=useMemo(()=>getStatusConfig(_0x30b4df),[_0x30b4df]),_0x1d2d15=_0x30b4df!==CollaborationStatus[_0xbb65f3(0x29b)],_0x44fa2e=_0x37c28b['t'](_0x4405e3[_0xbb65f3(0x2e9)]),_0x43a220=_0x4405e3[_0xbb65f3(0xec)]?_0x37c28b['t'](_0x4405e3[_0xbb65f3(0xec)]):_0x44fa2e,_0x4bfb6a=useCallback(()=>{if(!_0x1d2d15)_0x7a3069['reconnect']();},[_0x1d2d15,_0x7a3069]),_0xb6113f=useCallback(_0x37ff82=>{const _0xe327dc=_0xbb65f3;!_0x1d2d15&&(_0x37ff82[_0xe327dc(0x2b8)]===_0xe327dc(0x2d2)||_0x37ff82[_0xe327dc(0x2b8)]==='\x20')&&(_0x37ff82['preventDefault'](),_0x7a3069['reconnect']());},[_0x1d2d15,_0x7a3069]),_0x17d95b=jsx(_0xbb65f3(0x2b0),{'className':clsx('univer-flex\x20univer-items-center\x20univer-justify-center',_0xbb65f3(0x18f),_0x4405e3['colorClass'],{'univer-animate-spin':_0x4405e3[_0xbb65f3(0x2c6)]===_0xbb65f3(0x2d0),'univer-animate-pulse':_0x4405e3['indicator']===_0xbb65f3(0x274)}),'aria-hidden':'true','children':_0x4405e3['icon']}),_0x4202d3=jsx('span',{'className':clsx(_0xbb65f3(0x1b9),_0xbb65f3(0xdb),_0xbb65f3(0x213),_0xbb65f3(0x185),_0xbb65f3(0x1a8),{'univer-cursor-pointer\x20hover:univer-bg-gray-100\x20dark:hover:univer-bg-gray-700':_0x4405e3[_0xbb65f3(0x191)],'univer-cursor-default':!_0x4405e3[_0xbb65f3(0x191)]}),'children':_0x17d95b});if(_0x4405e3['clickable'])return jsx(Tooltip,{'title':_0x43a220,'placement':_0xbb65f3(0x212),'children':jsx(_0xbb65f3(0x1b0),{'type':_0xbb65f3(0x1b0),'onClick':_0x4bfb6a,'onKeyDown':_0xb6113f,'className':clsx(_0xbb65f3(0x214),'univer-border-none\x20univer-bg-transparent',_0xbb65f3(0x266),'univer-appearance-none'),'aria-label':_0x44fa2e+_0xbb65f3(0x262)+_0x43a220,'role':_0xbb65f3(0x18e),'aria-live':'polite','aria-atomic':_0xbb65f3(0xd9),'children':_0x4202d3})});return jsx(Tooltip,{'title':_0x43a220,'placement':_0xbb65f3(0x212),'children':jsx(_0xbb65f3(0x1da),{'className':clsx(_0xbb65f3(0x214),_0xbb65f3(0x2a9),_0xbb65f3(0x266)),'aria-label':_0x44fa2e,'role':_0xbb65f3(0x18e),'aria-live':_0xbb65f3(0x164),'aria-atomic':_0xbb65f3(0xd9),'children':_0x4202d3})});}function _typeof(_0x37a536){'@babel/helpers - typeof';const _0x48cd0d=_0xd732;return _typeof='function'==typeof Symbol&&_0x48cd0d(0x1ed)==typeof Symbol[_0x48cd0d(0x16c)]?function(_0x53a886){return typeof _0x53a886;}:function(_0x3b5962){const _0xb14eba=_0x48cd0d;return _0x3b5962&&_0xb14eba(0x25a)==typeof Symbol&&_0x3b5962[_0xb14eba(0x26d)]===Symbol&&_0x3b5962!==Symbol['prototype']?_0xb14eba(0x1ed):typeof _0x3b5962;},_typeof(_0x37a536);}function toPrimitive(_0x5318e1,_0x14f73a){const _0x2fff15=_0xd732;if(_0x2fff15(0xef)!=_typeof(_0x5318e1)||!_0x5318e1)return _0x5318e1;var _0x4c548e=_0x5318e1[Symbol['toPrimitive']];if(void 0x0!==_0x4c548e){var _0xc6c917=_0x4c548e[_0x2fff15(0x280)](_0x5318e1,_0x14f73a||_0x2fff15(0x14d));if(_0x2fff15(0xef)!=_typeof(_0xc6c917))return _0xc6c917;throw new TypeError('@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.');}return(_0x2fff15(0x26b)===_0x14f73a?String:Number)(_0x5318e1);}function toPropertyKey(_0x4f7893){const _0x9eab4c=_0xd732;var _0x13339e=toPrimitive(_0x4f7893,_0x9eab4c(0x26b));return _0x9eab4c(0x1ed)==_typeof(_0x13339e)?_0x13339e:_0x13339e+'';}function _defineProperty(_0x2dd4b5,_0x542b93,_0x4b4051){const _0x162be1=_0xd732;return(_0x542b93=toPropertyKey(_0x542b93))in _0x2dd4b5?Object[_0x162be1(0x104)](_0x2dd4b5,_0x542b93,{'value':_0x4b4051,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x2dd4b5[_0x542b93]=_0x4b4051,_0x2dd4b5;}function __decorateParam(_0xd58a92,_0x335a0a){return function(_0x49a5d1,_0x53cc4){_0x335a0a(_0x49a5d1,_0x53cc4,_0xd58a92);};}function __decorate(_0x37b42d,_0x2d4b7e,_0x33c227,_0x16ae30){const _0x481587=_0xd732;var _0x27d0cd=arguments['length'],_0x5bce2f=_0x27d0cd<0x3?_0x2d4b7e:_0x16ae30===null?_0x16ae30=Object[_0x481587(0x2ab)](_0x2d4b7e,_0x33c227):_0x16ae30,_0x3f882d;if(typeof Reflect===_0x481587(0xef)&&typeof Reflect[_0x481587(0x193)]==='function')_0x5bce2f=Reflect[_0x481587(0x193)](_0x37b42d,_0x2d4b7e,_0x33c227,_0x16ae30);else{for(var _0x4675b6=_0x37b42d['length']-0x1;_0x4675b6>=0x0;_0x4675b6--)if(_0x3f882d=_0x37b42d[_0x4675b6])_0x5bce2f=(_0x27d0cd<0x3?_0x3f882d(_0x5bce2f):_0x27d0cd>0x3?_0x3f882d(_0x2d4b7e,_0x33c227,_0x5bce2f):_0x3f882d(_0x2d4b7e,_0x33c227))||_0x5bce2f;}return _0x27d0cd>0x3&&_0x5bce2f&&Object[_0x481587(0x104)](_0x2d4b7e,_0x33c227,_0x5bce2f),_0x5bce2f;}let DesktopCollaborationStatusDisplayController=class DesktopCollaborationStatusDisplayController extends Disposable{constructor(_0x1b003f,_0x212f07,_0x55ae06,_0x5742f8){const _0x5c3cfe=_0xd732;super(),this[_0x5c3cfe(0x2a7)]=_0x1b003f,this[_0x5c3cfe(0x21e)]=_0x212f07,this[_0x5c3cfe(0x178)]=_0x55ae06,this[_0x5c3cfe(0x158)]=_0x5742f8,_defineProperty(this,_0x5c3cfe(0x155),new BehaviorSubject(CollaborationStatus[_0x5c3cfe(0x248)])),this[_0x5c3cfe(0x136)](),this['_initStatusListener']();}[_0x13b516(0x160)](){const _0x21bfab=_0x13b516;this['disposeWithMe'](this[_0x21bfab(0x2a7)][_0x21bfab(0xdd)][_0x21bfab(0x202)](switchMap(()=>{const _0x111b77=_0x21bfab,_0x59a66b=this['_univerInstanceService'][_0x111b77(0x2dd)]();if(_0x59a66b)return this['_collaborationController'][_0x111b77(0xe3)](_0x59a66b[_0x111b77(0x1c6)]());return of(null);}),switchMap(_0x57d31f=>{const _0x1268ed=_0x21bfab;if(_0x57d31f)return _0x57d31f[_0x1268ed(0x1dd)];return of(CollaborationStatus[_0x1268ed(0x248)]);}))[_0x21bfab(0x192)](_0x851df6=>{const _0x15ae95=_0x21bfab;this['_status$'][_0x15ae95(0x107)](_0x851df6);}));}[_0x13b516(0x136)](){const _0xee8518=_0x13b516;this[_0xee8518(0x227)](this[_0xee8518(0x158)][_0xee8518(0xe8)](BuiltInUIPart[_0xee8518(0x13a)],()=>connectInjector(passProps({'status$':this['_status$'][_0xee8518(0x1ad)]()}),this[_0xee8518(0x21e)])));}};DesktopCollaborationStatusDisplayController=__decorate([__decorateParam(0x0,IUniverInstanceService),__decorateParam(0x1,Inject(Injector)),__decorateParam(0x2,Inject(CollaborationController)),__decorateParam(0x3,IUIPartsService)],DesktopCollaborationStatusDisplayController);function passProps(_0x4dba56){const {status$:_0x125af4}=_0x4dba56;return function _0x42e393(){return jsx(CollaborationStatusDisplay,{'status$':_0x125af4});};}const IURLService=createIdentifier(_0x13b516(0x28a));let CollaborationDataLoaderController=class CollaborationDataLoaderController extends RxDisposable{constructor(_0x56f466,_0x58577b,_0x450368,_0x1eca19,_0x58d22c){const _0x2ca561=_0x13b516;super(),this[_0x2ca561(0xda)]=_0x56f466,this[_0x2ca561(0x194)]=_0x58577b,this[_0x2ca561(0x220)]=_0x450368,this[_0x2ca561(0x252)]=_0x1eca19;if(_0x58d22c)_0x58d22c===null||_0x58d22c===void 0x0||_0x58d22c['whenReady']()[_0x2ca561(0x2c9)](()=>this[_0x2ca561(0x1e2)]());else this[_0x2ca561(0x194)][_0x2ca561(0x15d)](_0x2ca561(0x235),_0x2ca561(0x292)),this[_0x2ca561(0x1e2)]();}async[_0x13b516(0x1e2)](){const _0x3065e4=_0x13b516,_0x25459c=this['_urlService']['getParam'](_0x3065e4(0x144)),_0xc55095=this[_0x3065e4(0xda)]['getParam'](_0x3065e4(0x1f2)),_0x52f1f7=this[_0x3065e4(0xda)][_0x3065e4(0x224)](_0x3065e4(0x143));if(!_0x25459c||!_0xc55095){this[_0x3065e4(0x194)][_0x3065e4(0x15d)](_0x3065e4(0x235),'No\x20unitID\x20or\x20type\x20in\x20URL.\x20Will\x20not\x20load\x20files\x20from\x20remote\x20address.');return;}const _0x47fdb2=await this['_dataLoaderService'][_0x3065e4(0x207)](_0x25459c,Number(_0xc55095),_0x52f1f7);if(_0x47fdb2&&_0x47fdb2 instanceof Workbook)this[_0x3065e4(0x1b8)](_0x47fdb2);}async[_0x13b516(0x1b8)](_0xbabcfc){const _0x4a56a8=_0x13b516;await this[_0x4a56a8(0x2ea)](_0xbabcfc),_0xbabcfc['activeSheet$'][_0x4a56a8(0x202)](takeUntil(this[_0x4a56a8(0x156)]))[_0x4a56a8(0x192)](_0xc58906=>{const _0x1dc909=_0x4a56a8;if(_0xc58906)this[_0x1dc909(0x240)](_0xc58906);}),this[_0x4a56a8(0xda)][_0x4a56a8(0x1b1)][_0x4a56a8(0x202)](takeUntil(this['dispose$']))[_0x4a56a8(0x192)](()=>this['_updateSubUnitFromURLParams'](_0xbabcfc));}[_0x13b516(0x240)](_0x15ce3d,_0x1d9a05=![]){const _0x2762ac=_0x13b516,_0x5a6136=this[_0x2762ac(0xda)]['getParam'](_0x2762ac(0x143));if(_0x15ce3d[_0x2762ac(0x1ee)]()!==_0x5a6136)this[_0x2762ac(0xda)][_0x2762ac(0x1ff)](_0x2762ac(0x143),_0x15ce3d[_0x2762ac(0x1ee)](),_0x1d9a05);}async['_updateSubUnitFromURLParams'](_0x17fe25){const _0x1af93e=_0x13b516;var _0x3b44ef;const _0xbf3af1=this['_urlService']['getParam'](_0x1af93e(0x143));if(!_0xbf3af1||!_0x17fe25[_0x1af93e(0x298)](_0xbf3af1)){const _0x365abc=_0x17fe25[_0x1af93e(0x108)]()[0x0],_0x5192cc=_0x17fe25[_0x1af93e(0x298)](_0x365abc);if(!_0x5192cc)return;this[_0x1af93e(0x240)](_0x5192cc,!![]),await this['_commandService'][_0x1af93e(0x24a)](SetWorksheetActivateCommand['id'],{'unitId':_0x17fe25[_0x1af93e(0x1c6)](),'subUnitId':_0x365abc});return;}if(((_0x3b44ef=_0x17fe25['getActiveSheet']())===null||_0x3b44ef===void 0x0?void 0x0:_0x3b44ef[_0x1af93e(0x1ee)]())===_0xbf3af1)return;await this[_0x1af93e(0x220)][_0x1af93e(0x24a)](SetWorksheetActivateCommand['id'],{'unitId':_0x17fe25['getUnitId'](),'subUnitId':_0xbf3af1});}};CollaborationDataLoaderController=__decorate([__decorateParam(0x0,IURLService),__decorateParam(0x1,ILogService),__decorateParam(0x2,ICommandService),__decorateParam(0x3,Inject(DataLoaderService)),__decorateParam(0x4,Optional(IRemoteInstanceService))],CollaborationDataLoaderController);var name=_0x13b516(0x2ca),version=_0x13b516(0x203);let ImagePasteController=class ImagePasteController extends RxDisposable{constructor(_0x539245,_0x26130a){const _0x4ccb10=_0x13b516;super(),this[_0x4ccb10(0x2d1)]=_0x539245,this[_0x4ccb10(0x2cf)]=_0x26130a,this[_0x4ccb10(0x1e2)]();}[_0x13b516(0x1e2)](){const _0x397b60=_0x13b516,_0x1332d2=this;this[_0x397b60(0x227)](this[_0x397b60(0x2d1)]['addClipboardHook']({'onBeforePasteImage':async _0x1533e9=>{const _0x520525=_0x397b60,_0x1fbc98=await _0x1332d2[_0x520525(0x2cf)]['saveImage'](_0x1533e9);if(_0x1fbc98)return{'source':_0x1fbc98[_0x520525(0x1d7)],'imageSourceType':_0x1fbc98[_0x520525(0x255)]};return null;}}));}};ImagePasteController=__decorate([__decorateParam(0x0,IDocClipboardService),__decorateParam(0x1,IImageIoService)],ImagePasteController);const BACKGROUND_TOKENS=[_0x13b516(0xf8),_0x13b516(0x188),_0x13b516(0x121),'red.300','blue.400',_0x13b516(0x247)];var ColorAssignService=class extends Disposable{constructor(..._0x247b7d){const _0x2b9524=_0x13b516;super(..._0x247b7d),_defineProperty(this,'_assignedColors',new Map()),_defineProperty(this,_0x2b9524(0x233),0x0);}[_0x13b516(0x179)](_0x31be30){const _0x45c8a9=_0x13b516;if(this[_0x45c8a9(0x2e7)][_0x45c8a9(0x17d)](_0x31be30))return this[_0x45c8a9(0x2e7)]['get'](_0x31be30);const _0x1f37c2=BACKGROUND_TOKENS[this[_0x45c8a9(0x233)]];return this[_0x45c8a9(0x233)]=(this['_colorIndex']+0x1)%BACKGROUND_TOKENS[_0x45c8a9(0x196)],this[_0x45c8a9(0x2e7)][_0x45c8a9(0x1a5)](_0x31be30,_0x1f37c2),_0x1f37c2;}},TextRangeActiveStatus=function(_0x55a262){const _0x3566fc=_0x13b516;return _0x55a262[_0x3566fc(0x1cb)]='1',_0x55a262[_0x3566fc(0x1a2)]='0',_0x55a262;}(TextRangeActiveStatus||{});function serializeDocTextRanges(_0x2fd11b){const _0x226024=_0x13b516;let _0x42ec07='';for(const _0x395645 of _0x2fd11b){const {startOffset:_0x12e192,endOffset:_0x174fad,isActive:_0x2207c1,rangeType:_0x5b2fd9,segmentId:_0xe17f83,segmentPage:_0x54b3c7}=_0x395645;if(_0x42ec07[_0x226024(0x196)])_0x42ec07+=',';_0x42ec07+=_0x12e192+':'+_0x174fad+':'+(_0x2207c1?TextRangeActiveStatus[_0x226024(0x1cb)]:TextRangeActiveStatus['Inactive'])+':'+_0x5b2fd9+':'+_0xe17f83+':'+_0x54b3c7;}return _0x42ec07;}function deserializeDocTextRanges(_0x4013a4){const _0x1e4387=_0x13b516,_0x103122=_0x4013a4['split'](','),_0xc4f8b3=[];for(const _0x9ffc2 of _0x103122){const [_0xe14d22,_0x30e0c6,_0xfe1919,_0x232a76,_0x3b1371,_0xf38ed6]=_0x9ffc2[_0x1e4387(0x234)](':');_0xc4f8b3[_0x1e4387(0x21c)]({'startOffset':Number(_0xe14d22),'endOffset':Number(_0x30e0c6),'collapsed':_0xe14d22===_0x30e0c6,'isActive':_0xfe1919===TextRangeActiveStatus[_0x1e4387(0x1cb)],'rangeType':_0x232a76===DOC_RANGE_TYPE[_0x1e4387(0x275)]?DOC_RANGE_TYPE[_0x1e4387(0x275)]:DOC_RANGE_TYPE['RECT'],'segmentId':typeof _0x3b1371==='string'?String(_0x3b1371):'','segmentPage':Number(_0xf38ed6!==null&&_0xf38ed6!==void 0x0?_0xf38ed6:-0x1)});}if(!_0xc4f8b3['some'](_0x5d3cf4=>_0x5d3cf4[_0x1e4387(0x1eb)]))_0xc4f8b3[0x0][_0x1e4387(0x1eb)]=!![];return _0xc4f8b3;}var DocSyncEditingCollabCursorService=class extends RxDisposable{constructor(..._0x34410e){const _0x371608=_0x13b516;super(..._0x34410e),_defineProperty(this,_0x371608(0x29e),new BehaviorSubject(null)),_defineProperty(this,_0x371608(0x2d9),this[_0x371608(0x29e)]['asObservable']());}[_0x13b516(0x27a)](_0x5fc10b){const _0x864fb4=_0x13b516,{unitID:_0x37a05b,memberID:_0x5ad157,textRanges:_0x280377}=_0x5fc10b,_0x263056=serializeDocTextRanges(_0x280377);if(_0x263056==='')return;const _0x481487={'unitID':_0x37a05b,'memberID':_0x5ad157,'selection':_0x263056};this[_0x864fb4(0x29e)][_0x864fb4(0x107)](_0x481487);}};const DEBOUNCE_TIME$1=0x12c,SHARE_LOCAL_DEBOUNCE_TIME$1=0x64;let DocCollabCursorEntity=class DocCollabCursorEntity extends RxDisposable{get['cursorInfo'](){const _0xed50fd=_0x13b516;return this[_0xed50fd(0x24b)][_0xed50fd(0x1c2)]();}get[_0x13b516(0x14f)](){const _0x34cbfa=_0x13b516;return this[_0x34cbfa(0x2b7)][_0x34cbfa(0x1c2)]();}constructor(_0xc1cf5d,_0x524f96,_0x2c0a08,_0x23418e,_0x52771a,_0x40ea80,_0x13d90e,_0x4fd633,_0x47c53f){const _0x11b808=_0x13b516;super(),this[_0x11b808(0x209)]=_0xc1cf5d,this[_0x11b808(0x2b2)]=_0x524f96,this['_injector']=_0x2c0a08,this[_0x11b808(0x1c8)]=_0x23418e,this[_0x11b808(0x11d)]=_0x52771a,this[_0x11b808(0x122)]=_0x40ea80,this['_transformService']=_0x13d90e,this['_univerInstanceService']=_0x4fd633,this['_commandService']=_0x47c53f,_defineProperty(this,'_online',![]),_defineProperty(this,_0x11b808(0x1e2),![]),_defineProperty(this,_0x11b808(0x24b),new BehaviorSubject(new Map())),_defineProperty(this,'cursorInfo$',this['_cursorInfo$'][_0x11b808(0x1ad)]()),_defineProperty(this,'_roomMembers$',new BehaviorSubject([])),_defineProperty(this,_0x11b808(0x115),this[_0x11b808(0x2b7)][_0x11b808(0x202)](debounceTime(DEBOUNCE_TIME$1))),_defineProperty(this,_0x11b808(0x1d0),debounce(_0x157110=>{const _0x5eefee=_0x11b808,_0x420c5a={'eventID':CollaborationEvent['UPDATE_CURSOR'],'data':{'unitID':this[_0x5eefee(0x209)],'memberID':this['_session'][_0x5eefee(0x12c)](),'selection':serializeDocTextRanges(_0x157110)}};this[_0x5eefee(0x2b2)][_0x5eefee(0x2a6)](_0x420c5a,this[_0x5eefee(0x209)]);},SHARE_LOCAL_DEBOUNCE_TIME$1));}[_0x13b516(0x217)](){const _0xae90a1=_0x13b516;super[_0xae90a1(0x217)](),this[_0xae90a1(0x24b)][_0xae90a1(0x107)](new Map()),this[_0xae90a1(0x24b)][_0xae90a1(0x228)](),this['_roomMembers$'][_0xae90a1(0x107)]([]),this[_0xae90a1(0x2b7)]['complete']();}[_0x13b516(0x25d)](){const _0x5d1097=_0x13b516;if(this[_0x5d1097(0x1e2)])return;this['_init']=!![],this['_session'][_0x5d1097(0x25c)][_0x5d1097(0x202)](takeUntil(this['dispose$']))[_0x5d1097(0x192)](_0xc7d883=>{const _0x1fb66a=_0x5d1097;if(_0xc7d883===SessionStatus['ONLINE'])this[_0x1fb66a(0x265)]();else this[_0x1fb66a(0x242)]();}),this['_session'][_0x5d1097(0x25f)][_0x5d1097(0x202)](takeUntil(this['dispose$']))[_0x5d1097(0x192)](_0x29f2b8=>{const _0x5a0a73=_0x5d1097,_0x2c9bbe=_0x29f2b8['eventID'];if(_0x2c9bbe===CollaborationEvent['UPDATE_CURSOR'])this[_0x5a0a73(0x159)](_0x29f2b8);if(_0x2c9bbe===CollaborationEvent[_0x5a0a73(0x1f9)])this['_onCursorDelete'](_0x29f2b8);}),this['disposeWithMe'](this[_0x5d1097(0x220)][_0x5d1097(0x25b)](_0x2cd3d8=>{const _0x37f4e5=_0x5d1097,_0x1097e4=_0x2cd3d8['params'];if(_0x1097e4==null)return;if(this[_0x37f4e5(0x268)]&&_0x2cd3d8['id']===SetTextSelectionsOperation['id']&&_0x1097e4[_0x37f4e5(0x2b9)]===this[_0x37f4e5(0x209)]&&_0x1097e4[_0x37f4e5(0x16e)]===![]&&_0x1097e4[_0x37f4e5(0x13d)][_0x37f4e5(0x196)]>0x0)this['_updateLocalCursor'](_0x1097e4[_0x37f4e5(0x13d)]);})),this[_0x5d1097(0x122)][_0x5d1097(0x2d9)][_0x5d1097(0x202)](takeUntil(this['dispose$']))[_0x5d1097(0x192)](_0x569fcb=>{const _0x58186a=_0x5d1097;if((_0x569fcb===null||_0x569fcb===void 0x0?void 0x0:_0x569fcb['unitID'])!==this[_0x58186a(0x209)])return;const _0x2f7787={'eventID':CollaborationEvent[_0x58186a(0x2ec)],'data':_0x569fcb};this[_0x58186a(0x159)](_0x2f7787);}),this[_0x5d1097(0x227)](this[_0x5d1097(0x220)][_0x5d1097(0x25b)](_0x54151c=>{const _0x4d662a=_0x5d1097;if(_0x54151c[_0x4d662a(0x206)]==null)return;const _0x977d36=_0x54151c[_0x4d662a(0x206)];if(_0x54151c['id']!==RichTextEditingMutation['id']||_0x977d36[_0x4d662a(0x2b9)]!==this['unitID'])return;const _0x4e8597={'id':'doc.mutation.rich-text-editing','params':_0x977d36},_0x50899b=this['cursorInfo'];for(const [_0x5d5241,_0xe4a795]of _0x50899b){const _0x33d173={'id':_0x4d662a(0x183),'params':{'unitId':this[_0x4d662a(0x209)],'actions':null,'textRanges':_0xe4a795['ranges']}},_0x2af25e=this[_0x4d662a(0x26c)][_0x4d662a(0x284)](_0x4e8597,_0x33d173,![]);if(isTransformMutationFailure(_0x2af25e))throw _0x2af25e[_0x4d662a(0xd5)];_0x50899b['set'](_0x5d5241,{..._0xe4a795,'ranges':_0x2af25e[_0x4d662a(0x105)][_0x4d662a(0x206)][_0x4d662a(0x20e)]});}queueMicrotask(()=>{const _0xdf8cc0=_0x4d662a;this['_cursorInfo$'][_0xdf8cc0(0x107)](_0x50899b);});}));}[_0x13b516(0x159)](_0x68ba22){const _0x8e929a=_0x13b516;var _0x172dd7,_0x3faac3;const {memberID:_0x3ebef6,selection:_0x4ef5c9}=_0x68ba22[_0x8e929a(0x21f)],_0x33b2ae=deserializeDocTextRanges(_0x4ef5c9),_0x47143a=(_0x172dd7=(_0x3faac3=this[_0x8e929a(0x11d)]['getMember'](this[_0x8e929a(0x209)],_0x3ebef6))===null||_0x3faac3===void 0x0?void 0x0:_0x3faac3[_0x8e929a(0x13f)])!==null&&_0x172dd7!==void 0x0?_0x172dd7:'Unknown\x20user',_0x505e03={'color':this['_colorAssignService'][_0x8e929a(0x179)](_0x3ebef6),'name':_0x47143a,'ranges':_0x33b2ae},_0x16755d=this[_0x8e929a(0xdf)];_0x16755d[_0x8e929a(0x1a5)](_0x3ebef6,_0x505e03),this[_0x8e929a(0x24b)][_0x8e929a(0x107)](_0x16755d);}[_0x13b516(0x173)](_0x3e4d8e){const _0x22b9cf=_0x13b516,{memberID:_0x30f42d}=_0x3e4d8e['data'],_0x43030f=this['cursorInfo'];_0x43030f['delete'](_0x30f42d),this[_0x22b9cf(0x24b)][_0x22b9cf(0x107)](_0x43030f);}[_0x13b516(0x265)](){const _0x3468bb=_0x13b516;var _0x2baa02;this[_0x3468bb(0x268)]=!![];if(((_0x2baa02=this[_0x3468bb(0x2a7)][_0x3468bb(0x2dd)]())===null||_0x2baa02===void 0x0?void 0x0:_0x2baa02[_0x3468bb(0x1c6)]())!==this[_0x3468bb(0x209)])return;const _0x3804b0=this[_0x3468bb(0x21e)][_0x3468bb(0x103)](DocSelectionManagerService)[_0x3468bb(0x184)]();if(Array[_0x3468bb(0x2ee)](_0x3804b0)&&_0x3804b0[_0x3468bb(0x196)]>0x0)this[_0x3468bb(0x1d0)](_0x3804b0);}[_0x13b516(0x242)](){const _0x3e3dcb=_0x13b516;this[_0x3e3dcb(0x268)]=![];}};DocCollabCursorEntity=__decorate([__decorateParam(0x2,Inject(Injector)),__decorateParam(0x3,Inject(ColorAssignService)),__decorateParam(0x4,Inject(MemberService)),__decorateParam(0x5,Inject(DocSyncEditingCollabCursorService)),__decorateParam(0x6,ITransformService),__decorateParam(0x7,IUniverInstanceService),__decorateParam(0x8,ICommandService)],DocCollabCursorEntity);function _0x2fa9(){const _0x752741=['beginPath','moveTo','bold\x2013px\x20Source\x20Han\x20Sans\x20CN','iterator','popstate','isEditing','rgba(','collab-client.tooltip.reconnect','getVpScrollXYInfoByPosToVp','_registerRenderDependencies','_onCursorDelete','executionId','_collabSessionService','history','pluginName','_collaborationController','assignAColorForMemberID','_onRefRangeChange','_highlight','stage','has','_anchorDot','_checkAndWaitForCalculationPermission','add','_sheetSkeletonManagerService','currentSkeleton$','doc.mutation.rich-text-editing','getDocRanges','focus:univer-outline-none\x20focus:univer-ring-2\x20focus:univer-ring-primary-500\x20focus:univer-ring-offset-2','_transformHistoryAndStateStack','from','jiqing.500','getItem','registerBeforeClose','4tAyWuP','subscribeEvent','_anchor','status','univer-text-xl\x20univer-transition-colors\x20univer-duration-200','_eventUnsubscribe','clickable','subscribe','decorate','_logService','_docTransformStateCacheService','length','override','_monkeyPatchLogService','1636328QJuavV','_memberID','_hovered','getCurrentRevOfUnit','_docTransformIMECacheService','packageName','href','collaboration.offline-data-not-saved','DeleteRangeMoveLeftCommandId','Inactive','cursorInfo$','_config','set','_localCacheService','saveOfflineData','dark:focus:univer-ring-offset-gray-800','_heartbeatTimer','_startBlinking','_initCommandExecutedListener','redoState','asObservable','removeEventListener','664462pfAmur','button','urlChange$','_getSaveTimeout','unsubscribe','_offsetY','formula.calculation.started','shift','lineTo','_setupSubUnitSync','univer-flex\x20univer-items-center\x20univer-justify-center','_unitStatus','registerRenderModule','UNIVER_DOC','session.connection-failed','_hasFormulaInDirtyRanges','univer-text-blue-500','getActiveSheet','result','getValue','transformIMECache','_scheduleHeartbeat','with','getUnitId','_saveTaskMap','_colorAssignService','editingUnit','_unitOnClients','Active','startFormulaLimitUrl','getUnitStatus$','getUndoRedoMutationParamsCache','createInstance','_updateLocalCursor','_localStorageService','unhandledrejection','restore','docStateChange$','SOCKET_FAILED_RETRY','_render','source','_ensureSubject',',\x200.2)','div','START_CALCULATION','post','status$','m1Prime','collabStatus.conflict','_removeClearOtherTimer','column','_init','UNIVER_SHEET','hide','session.will-retry','OTHER_CLIENT_EDITING','getTypeOfUnitDisposed$','\x20at\x20','removeParam','...','isActive','totalFormulasToCalculate','symbol','getSheetId','highlightSecond','_range','stageInfo','type','selection','_initEvent','setInterval','addObject','delete','unload','USERS_LEAVE','find','_pollingInterval','_beforeCloseService','endRow','_initDependencies','setParam','getCurrentSkeleton','createSocket','pipe','0.21.1','_initWindowErrorListener','slice','params','loadUnit','getCollabCursors$','unitID','_shapes','FromArray','_disabled','onMouseMove','textRanges','[Unhandled\x20Rejection]:\x20','range','formula.calculation.unable','bottom','univer-transition-all\x20univer-duration-200','univer-inline-flex\x20univer-items-center\x20univer-justify-center','undefined','labelPosition','dispose','enableLocalCache','startRow','_context','toRgbString','push','rgb','_injector','data','_commandService','getFormulaLimitStatusUrl','runId','InsertColCommandId','getParam','getMember','_textBubble','disposeWithMe','complete','updateOfflineData','_handleEvent','_scheduleSaving','NO_OTHER_CLIENTS_EDITING','join','Warning','transformRemoteChangeset','addHandlerCallback','onPointerEnter$','wsSessionTicketUrl','_colorIndex','split','[CollaborationDataLoaderController]','fillStyle','LEAVE','AWAITING_WITH_PENDING','ONLINE','_localeService','_collaborationUIEventService','7cvjoKu','startColumn','_backgroundColor','_messageService','_updateURLWithCurrentState','InsertRangeMoveDownCommandId','_toggleOffline','application/json','_showGuardMessage','toString','_cursors','yellow.400','NOT_COLLAB','contains','executeCommand','_cursorInfo$','_releaseCalculationLimit','_transformUndoRedoStack','getRelativeToViewportCoord','eventID','_initUserListener','text','_dataLoaderService','_hideTimer','DeleteRangeMoveUpCommandId','imageSourceType','map','black','show','_handleLeaveEvent','function','onCommandExecuted','sessionStatus$','init','addEventListener','event$','_entityInit$','actions','\x20-\x20','findNodePositionByCharIndex','SOCKET_FAILED','_toggleOnline','univer-m-0\x20univer-p-0','_clearPolling','_online','_collabCursorController','_handleJoinEvent','string','_transformService','constructor','_startDocCollabCursor','getColorFromTheme','getCurrentUnitForType','offsetY','search','_initEntityListener','pulse','TEXT','_showText','row','0.2)','transformSelections','syncEditingCollabCursor','currentTheme$','fillText','measureText','ACTIVE_UNIT_EVENT_CHANNEL','transformStateCache','call','limitInfo','getSkeleton','now','transformMutation','RemoveRowCommandId','getRangePointData','showText','getMergeData','806780iXWRvy','uni.network.url-service','fill','stack','HEARTBEAT','enableFrontendLog','_docSkeletonManagerService','_updateCollabCursors','_scheduleClearOtherTimer','No\x20remote\x20instance\x20service\x20injected.\x20May\x20not\x20syncing\x20edits\x20to\x20the\x20web\x20worker.','RemoveColCommandId','_collaborationSessionService','_getFormulaLimitStatus','forEach','_getLighterColor','getSheetBySheetId','InsertRangeMoveRightCommandId','_blinkIntervalTimer','OFFLINE','getCellPositionByOffset','_revisionService','_collabCursorState$','_setFormulaLimitStatus','_lastPointer','Error','arc','getTypeOfUnitAdded$','FETCH_MISS','_handleHeartbeatEvent','send','_univerInstanceService','_themeService','univer-border-none\x20univer-bg-transparent','min','getOwnPropertyDescriptor','Loading','onPointerLeave$','_maxFormulaLimit','version','span','onLocalMutation','_session','Unknown\x20user','getOffsetConfig','filename','onStarting','_roomMembers$','key','unitId','setTimeout','engine','entityInit$','runOnServer','size','searchParams','_setupBeforeClosingHandler','_selfUnitIDs','replace','_handleHover','_hover','_cursorShapes','indicator','startsWith','collab-text-range-','then','@univerjs-pro/collaboration-client-ui','transformMutationsWithChangeset','makeDirty','newValue','_refRangeService','_imageIoService','spin','_docClipboardService','Enter','subUnitId','closePath','OTHER_CLIENTS_EDITING','endColumn','getUniverSheetInstance','parseInt','collabCursorState$','collabStatus.fetchMiss','width','undoState','getFocusedUnit','_getSheetObject','_notificationService','_createSocketURL','fillRule','exhaustSavingTask','setStateCache','color','replaceState','disableLocalCache','_assignedColors','pushState','i18nKey','_updateSubUnitFromURLParams','releaseFormulaLimitUrl','UPDATE_CURSOR','collaboration.closeRoom','isArray','stringify','_uploadLog','/universer-api/license/formula/limit/start','rgba','maxFormulaLimit','static','error','_docStateChangeManagerService','sheetID','body','true','_urlService','univer-h-8\x20univer-w-8\x20univer-rounded-lg','getStateCache','focused$','_scene','cursorInfo','867660WhOjYK','hovered','_applyCommand','getCollabEntity$','permission.title','_getMergeRange','beforeCommandExecuted','clearInterval','registerComponent','CLOSE_ROOM','flatMap','_initResize','tooltipKey','_docSyncEditingCollabCursorService','code','object','_drawAnchor','_registerDependencies','_stopBlinking','functionsExecutedState','_highlightSecond','_saveCache','registerRefRange','_clearOtherTimers','purple.300','collabStatus.offline','UNIVER_COLLABORATION_CLIENT_WEB_PLUGIN','_cachedData','getAncestorScale','univer-text-gray-400','highlight','_httpService','clearTimeout','currentUsage','socket$','get','defineProperty','m2Prime','_configService','next','getUnhiddenWorksheets','_docTransformSelectionsService','onTransformChange$','#FFF','_initUnhandledRejectionListener','_labelPosition','getRenderById','PERMISSION_DENIED','_refreshCollabCursors','selections','Failed','location','onRendered','roomMembers$','unshift','_blinkTimer','getUnit','dirtyRanges','getConfig','collabStatus.notCollab','/universer-api/license/formula/limit/done','_memberService','deepClone','Success','_taskIds','green.600','_syncEditingCollabCursorService','_drawTextRange','JOIN','values','MoveRangeCommandId','VIEW_MAIN','_draw','_entities','9qXpcWk','rgba(255,\x20255,\x20255,\x200.01)','getMemberID','requireSession','collaboration.single-unit.warning','_isBlinkVisible','getActiveRange','_color','setUndoRedoMutationParamsCache','_transformPreviousActiveRange','drawWith','onPointerMove$','_initStatusComponent','SUCCESS','backgroundColor','_send','HEADER_MENU','catch','_getSessionTicket','ranges','loadOfflineData','name','colno','386580NCUcxY','_checkCalculationAvailable','subunit','unit','setItem','_name','2134668RRHJYv','reason','_lastResponseTimestamp','height','setShapeProps','invokeId','default','triggerDblclick','roomMembers','collab-text-anchor-','_renderManagerService','_currentUsage','evenodd','mutations','_status$','dispose$','collabStatus.synced','_uiPartsService','_onCursorUpdate','CONFLICT','_id','_cursor','debug','univer-text-orange-500','250323ZMRRIa','_initStatusListener','save','_getAnchorBounding','_initCommandInterceptor','polite','_drawRectRange','font','_removeCollabCursors','resize'];_0x2fa9=function(){return _0x752741;};return _0x2fa9();}const DEBOUNCE_TIME=0x12c,SHARE_LOCAL_DEBOUNCE_TIME=0x64,createNextTick=()=>{let _0x53ad43=[],_0x366add=![];return _0x13d323=>{_0x53ad43['push'](_0x13d323),!_0x366add&&(_0x366add=!![],setTimeout(()=>{const _0xf5bf44=_0xd732;_0x53ad43[_0xf5bf44(0x296)](_0x59d643=>_0x59d643()),_0x53ad43=[],_0x366add=![];}));};};let SheetCollabCursorEntity=class SheetCollabCursorEntity extends RxDisposable{get[_0x13b516(0xdf)](){const _0xa35f8b=_0x13b516;return this[_0xa35f8b(0x24b)][_0xa35f8b(0x1c2)]();}get['roomMembers'](){const _0x1fa3e0=_0x13b516;return this[_0x1fa3e0(0x2b7)][_0x1fa3e0(0x1c2)]();}constructor(_0x5cfffa,_0x589346,_0x44977d,_0x34944e,_0x1ae6fd,_0xe0705e,_0x34e019,_0x4919fa){const _0x7ca2ff=_0x13b516;super(),this[_0x7ca2ff(0x209)]=_0x5cfffa,this['_session']=_0x589346,this[_0x7ca2ff(0x21e)]=_0x44977d,this['_colorAssignService']=_0x34944e,this['_memberService']=_0x1ae6fd,this[_0x7ca2ff(0x2a7)]=_0xe0705e,this[_0x7ca2ff(0x220)]=_0x34e019,this[_0x7ca2ff(0x2ce)]=_0x4919fa,_defineProperty(this,'_online',![]),_defineProperty(this,_0x7ca2ff(0x1e2),![]),_defineProperty(this,_0x7ca2ff(0x24b),new BehaviorSubject(new Map())),_defineProperty(this,'cursorInfo$',this[_0x7ca2ff(0x24b)][_0x7ca2ff(0x1ad)]()),_defineProperty(this,'_roomMembers$',new BehaviorSubject([])),_defineProperty(this,_0x7ca2ff(0x115),this['_roomMembers$'][_0x7ca2ff(0x202)](debounceTime(DEBOUNCE_TIME))),_defineProperty(this,_0x7ca2ff(0x1d0),debounce((_0x2c61e9,_0x34cbd6)=>{const _0x59277f=_0x7ca2ff,_0x2f6e86={'eventID':CollaborationEvent[_0x59277f(0x2ec)],'data':{'unitID':this[_0x59277f(0x209)],'memberID':this[_0x59277f(0x2b2)][_0x59277f(0x12c)](),'selection':serializeRangeWithSheet(_0x2c61e9,_0x34cbd6[_0x59277f(0x210)])}};this[_0x59277f(0x2b2)][_0x59277f(0x2a6)](_0x2f6e86,this[_0x59277f(0x209)]);},SHARE_LOCAL_DEBOUNCE_TIME));}['dispose'](){const _0x49e3df=_0x13b516;super[_0x49e3df(0x217)](),this['_cursorInfo$'][_0x49e3df(0x107)](new Map()),this[_0x49e3df(0x24b)][_0x49e3df(0x228)](),this[_0x49e3df(0x2b7)][_0x49e3df(0x107)]([]),this[_0x49e3df(0x2b7)]['complete']();}[_0x13b516(0x25d)](){const _0x3aab34=_0x13b516;if(this[_0x3aab34(0x1e2)])return;this[_0x3aab34(0x1e2)]=!![],this[_0x3aab34(0x2b2)][_0x3aab34(0x25c)][_0x3aab34(0x202)](takeUntil(this[_0x3aab34(0x156)]))[_0x3aab34(0x192)](_0x48a9b4=>{const _0x1587f1=_0x3aab34;if(_0x48a9b4===SessionStatus[_0x1587f1(0x239)])this[_0x1587f1(0x265)]();else this[_0x1587f1(0x242)]();}),this[_0x3aab34(0x2b2)][_0x3aab34(0x25f)]['pipe'](takeUntil(this['dispose$']))[_0x3aab34(0x192)](_0x3aa7df=>{const _0x5d31d8=_0x3aab34,_0x3a64ba=_0x3aa7df[_0x5d31d8(0x24f)];if(_0x3a64ba===CollaborationEvent['UPDATE_CURSOR'])this[_0x5d31d8(0x159)](_0x3aa7df);if(_0x3a64ba===CollaborationEvent[_0x5d31d8(0x1f9)])this[_0x5d31d8(0x173)](_0x3aa7df);}),this[_0x3aab34(0x17a)](),this['disposeWithMe'](this[_0x3aab34(0x220)]['onCommandExecuted'](_0xd93d=>{const _0x2c2ab9=_0x3aab34;if(this['_online']&&_0xd93d['id']===SetSelectionsOperation['id']&&_0xd93d['params'][_0x2c2ab9(0x2b9)]===this['unitID']){const _0x3b87ac=_0xd93d[_0x2c2ab9(0x206)];this['_updateLocalCursor'](_0x3b87ac[_0x2c2ab9(0x2d3)],_0x3b87ac[_0x2c2ab9(0x111)][0x0]);}}));}[_0x13b516(0x159)](_0x2366bc){const _0x2ea050=_0x13b516;var _0x2d5afa,_0x4bee4a;const {memberID:_0x41a352,selection:_0x1a534e}=_0x2366bc[_0x2ea050(0x21f)],{sheetName:_0x1784b3,range:_0x372db3}=deserializeRangeWithSheet(_0x1a534e),_0x96313d={'name':(_0x2d5afa=(_0x4bee4a=this[_0x2ea050(0x11d)][_0x2ea050(0x225)](this[_0x2ea050(0x209)],_0x41a352))===null||_0x4bee4a===void 0x0?void 0x0:_0x4bee4a['name'])!==null&&_0x2d5afa!==void 0x0?_0x2d5afa:_0x2ea050(0x2b3),'range':this[_0x2ea050(0xe5)](_0x1784b3,_0x372db3),'sheetID':_0x1784b3,'color':this[_0x2ea050(0x1c8)][_0x2ea050(0x179)](_0x41a352),'selection':_0x1a534e},_0x47af5a=this[_0x2ea050(0xdf)];_0x47af5a[_0x2ea050(0x1a5)](_0x41a352,_0x96313d),this['_cursorInfo$'][_0x2ea050(0x107)](_0x47af5a);}[_0x13b516(0x173)](_0x4b1347){const _0x5d22d9=_0x13b516,{memberID:_0x735297}=_0x4b1347[_0x5d22d9(0x21f)],_0x4d7856=this['cursorInfo'];_0x4d7856[_0x5d22d9(0x1f7)](_0x735297),this['_cursorInfo$'][_0x5d22d9(0x107)](_0x4d7856);}[_0x13b516(0xe5)](_0x56f70f,_0x9be06e){const _0x5bf284=_0x13b516;var _0x28f90c;const _0xeb443d=(_0x28f90c=this[_0x5bf284(0x2a7)][_0x5bf284(0x2d7)](this['unitID']))===null||_0x28f90c===void 0x0||(_0x28f90c=_0x28f90c[_0x5bf284(0x298)](_0x56f70f))===null||_0x28f90c===void 0x0?void 0x0:_0x28f90c[_0x5bf284(0x288)]();return(_0xeb443d===null||_0xeb443d===void 0x0?void 0x0:_0xeb443d[_0x5bf284(0x1fa)](_0x310c1f=>Rectangle[_0x5bf284(0x249)](_0x310c1f,_0x9be06e)))||_0x9be06e;}[_0x13b516(0x17a)](){const _0x1e4d27=_0x13b516,_0x238c0c=new DisposableCollection(),_0x2ecf40=createNextTick(),_0x143cc0=()=>{const _0x4e2381=_0xd732;_0x238c0c[_0x4e2381(0x217)]();const _0x366ce1=(_0xe7523c,_0x3874a0,_0x47ad67,_0xe990b3)=>{const _0x4e7af3=_0x4e2381;let _0x4d6892=[];switch(_0xe7523c['id']){case EffectRefRangId[_0x4e7af3(0x1a1)]:_0x4d6892=handleDeleteRangeMoveLeft(_0xe7523c,_0xe990b3);break;case EffectRefRangId[_0x4e7af3(0x254)]:_0x4d6892=handleDeleteRangeMoveUp(_0xe7523c,_0xe990b3);break;case EffectRefRangId[_0x4e7af3(0x223)]:_0x4d6892=handleInsertCol(_0xe7523c,_0xe990b3);break;case EffectRefRangId[_0x4e7af3(0x241)]:_0x4d6892=handleInsertRangeMoveDown(_0xe7523c,_0xe990b3);break;case EffectRefRangId[_0x4e7af3(0x299)]:_0x4d6892=handleInsertRangeMoveRight(_0xe7523c,_0xe990b3);break;case EffectRefRangId['InsertRowCommandId']:_0x4d6892=handleInsertRow(_0xe7523c,_0xe990b3);break;case EffectRefRangId[_0x4e7af3(0x126)]:_0x4d6892=handleMoveRange(_0xe7523c,_0xe990b3);break;case EffectRefRangId[_0x4e7af3(0x293)]:_0x4d6892=handleIRemoveCol(_0xe7523c,_0xe990b3);break;case EffectRefRangId[_0x4e7af3(0x285)]:_0x4d6892=handleIRemoveRow(_0xe7523c,_0xe990b3);break;}const _0x5aebd3=runRefRangeMutations(_0x4d6892,_0xe990b3),_0x3010a9=this[_0x4e7af3(0xdf)][_0x4e7af3(0x103)](_0x3874a0);if(_0x3010a9&&_0x5aebd3){const _0x5b77a6={..._0x3010a9,'range':_0x5aebd3};this[_0x4e7af3(0xdf)][_0x4e7af3(0x1a5)](_0x3874a0,_0x5b77a6),_0x2ecf40(()=>{const _0x1a2606=_0x4e7af3,_0x2d0d9e=this[_0x1a2606(0x2ce)][_0x1a2606(0xf6)](_0x5aebd3,_0x33ed43=>{const _0x540919=_0x1a2606;return _0x2d0d9e[_0x540919(0x217)](),_0x366ce1(_0x33ed43,_0x3874a0,_0x47ad67,_0x5aebd3);});_0x238c0c[_0x1a2606(0x180)](_0x2d0d9e);});}return{'redos':[],'undos':[]};};this[_0x4e2381(0xdf)][_0x4e2381(0x296)]((_0x4887ec,_0x341501)=>{const _0x1976fc=_0x4e2381,{range:_0x284863,sheetID:_0x53a97d}=_0x4887ec,_0x5e0ffd=this[_0x1976fc(0x2ce)]['registerRefRange'](_0x284863,_0xbd5abe=>{const _0x20e884=_0x1976fc;return _0x5e0ffd[_0x20e884(0x217)](),_0x366ce1(_0xbd5abe,_0x341501,_0x53a97d,_0x284863);});_0x238c0c[_0x1976fc(0x180)](_0x5e0ffd);});};this[_0x1e4d27(0x227)](toDisposable(this[_0x1e4d27(0x24b)]['subscribe'](()=>{_0x143cc0();})));}[_0x13b516(0x265)](){const _0xe19fb6=_0x13b516;var _0x4677ad,_0x57bb27;this[_0xe19fb6(0x268)]=!![];if(((_0x4677ad=this[_0xe19fb6(0x2a7)][_0xe19fb6(0x2dd)]())===null||_0x4677ad===void 0x0?void 0x0:_0x4677ad['getUnitId']())!==this['unitID'])return;const _0x483110=(_0x57bb27=this[_0xe19fb6(0x21e)][_0xe19fb6(0x103)](SheetsSelectionsService)['getCurrentSelections']())===null||_0x57bb27===void 0x0?void 0x0:_0x57bb27[0x0],_0x927562=this[_0xe19fb6(0x2a7)][_0xe19fb6(0x270)](UniverInstanceType[_0xe19fb6(0x1e3)])[_0xe19fb6(0x1c0)]();if(_0x483110&&_0x927562)this[_0xe19fb6(0x1d0)](_0x927562[_0xe19fb6(0x1ee)](),_0x483110);}[_0x13b516(0x242)](){const _0x224632=_0x13b516;this[_0x224632(0x268)]=![];}};SheetCollabCursorEntity=__decorate([__decorateParam(0x2,Inject(Injector)),__decorateParam(0x3,Inject(ColorAssignService)),__decorateParam(0x4,Inject(MemberService)),__decorateParam(0x5,IUniverInstanceService),__decorateParam(0x6,ICommandService),__decorateParam(0x7,Inject(RefRangeService))],SheetCollabCursorEntity);let CollabCursorController=class CollabCursorController extends RxDisposable{constructor(_0x2c4068,_0x2abcab,_0x1a8e86){const _0x22f300=_0x13b516;super(),this['_univerInstanceService']=_0x2c4068,this[_0x22f300(0x21e)]=_0x2abcab,this[_0x22f300(0x175)]=_0x1a8e86,_defineProperty(this,_0x22f300(0x129),new Map()),_defineProperty(this,_0x22f300(0x260),new Subject()),this[_0x22f300(0x1e2)]();}['dispose'](){const _0x566d6a=_0x13b516;super[_0x566d6a(0x217)](),this[_0x566d6a(0x260)][_0x566d6a(0x228)](),this[_0x566d6a(0x129)][_0x566d6a(0x296)](_0x18c290=>_0x18c290[_0x566d6a(0x217)]());}['getCollabCursors$'](_0x4aff58){const _0x2087de=_0x13b516;if(this[_0x2087de(0x129)][_0x2087de(0x17d)](_0x4aff58))return this[_0x2087de(0x129)][_0x2087de(0x103)](_0x4aff58)[_0x2087de(0x1a3)];return this['_entityInit$'][_0x2087de(0x202)](filter(_0x18a2af=>_0x18a2af[_0x2087de(0x209)]===_0x4aff58),switchMap(_0x205367=>_0x205367['cursorInfo$']));}[_0x13b516(0x1e2)](){const _0x1dc1a5=_0x13b516;this[_0x1dc1a5(0x2a7)][_0x1dc1a5(0x2a3)](UniverInstanceType[_0x1dc1a5(0x1e3)])[_0x1dc1a5(0x202)](takeUntil(this['dispose$']))[_0x1dc1a5(0x192)](async _0x4f5734=>{const _0x3a6ce5=_0x1dc1a5,_0x2bb5bb=_0x4f5734[_0x3a6ce5(0x144)][_0x3a6ce5(0x1c6)](),_0x2e6784=await this['_startSheetCollabCursor'](_0x2bb5bb);this[_0x3a6ce5(0x260)][_0x3a6ce5(0x107)](_0x2e6784),this[_0x3a6ce5(0x129)][_0x3a6ce5(0x1a5)](_0x2bb5bb,_0x2e6784);}),this[_0x1dc1a5(0x2a7)][_0x1dc1a5(0x2a3)](UniverInstanceType[_0x1dc1a5(0x1bc)])[_0x1dc1a5(0x202)](takeUntil(this[_0x1dc1a5(0x156)]))[_0x1dc1a5(0x202)](filter(_0x548329=>{const _0x4dcffc=_0x1dc1a5;return!_0x548329['unit'][_0x4dcffc(0x1c6)]()[_0x4dcffc(0x2c7)]('__');}))[_0x1dc1a5(0x192)](async _0x554ea2=>{const _0x592828=_0x1dc1a5,{unit:_0x2ab3f3}=_0x554ea2,_0x74150c=_0x2ab3f3['getUnitId'](),_0x7d0922=await this['_startDocCollabCursor'](_0x74150c);this[_0x592828(0x260)][_0x592828(0x107)](_0x7d0922),this[_0x592828(0x129)][_0x592828(0x1a5)](_0x74150c,_0x7d0922);}),_0x3a00a0(this['_univerInstanceService'][_0x1dc1a5(0x1e7)](UniverInstanceType[_0x1dc1a5(0x1bc)]),this['_univerInstanceService'][_0x1dc1a5(0x1e7)](UniverInstanceType[_0x1dc1a5(0x1e3)]))[_0x1dc1a5(0x202)](takeUntil(this['dispose$']))[_0x1dc1a5(0x192)](_0x5a2553=>{const _0x34929f=_0x1dc1a5,_0x8e0837=_0x5a2553['getUnitId'](),_0x33dc88=this[_0x34929f(0x129)]['get'](_0x8e0837);_0x33dc88&&(_0x33dc88[_0x34929f(0x217)](),this[_0x34929f(0x129)][_0x34929f(0x1f7)](_0x8e0837));});}async['_startSheetCollabCursor'](_0x5808d7){const _0x2e9106=_0x13b516,_0x329ca3=await this[_0x2e9106(0x175)][_0x2e9106(0x12d)](_0x5808d7),_0x4edf10=this[_0x2e9106(0x21e)][_0x2e9106(0x1cf)](SheetCollabCursorEntity,_0x5808d7,_0x329ca3);return _0x4edf10[_0x2e9106(0x25d)](),_0x4edf10;}async[_0x13b516(0x26e)](_0x266045){const _0x4719f3=_0x13b516,_0x31d9c0=await this[_0x4719f3(0x175)]['requireSession'](_0x266045),_0x1fc071=this['_injector'][_0x4719f3(0x1cf)](DocCollabCursorEntity,_0x266045,_0x31d9c0);return _0x1fc071['init'](),_0x1fc071;}};CollabCursorController=__decorate([__decorateParam(0x0,IUniverInstanceService),__decorateParam(0x1,Inject(Injector)),__decorateParam(0x2,Inject(CollaborationSessionService))],CollabCursorController);const COLLAB_CURSOR_LABEL_HEIGHT=0x14,COLLAB_CURSOR_LABEL_MAX_WIDTH=0xc8,COLLAB_CURSOR_LABEL_TEXT_PADDING_LR=0x4,COLLAB_CURSOR_LABEL_TEXT_PADDING_TB=0x5;function drawBubble(_0x102ed8,_0x4518eb){const _0x20356c=_0x13b516;var _0x248f91,_0x18c441,_0x1e737f;let {radius:_0x504d5c,width:_0x786da7,height:_0x1a74fb}=_0x4518eb;_0x504d5c=(_0x248f91=_0x504d5c)!==null&&_0x248f91!==void 0x0?_0x248f91:0x0,_0x786da7=(_0x18c441=_0x786da7)!==null&&_0x18c441!==void 0x0?_0x18c441:0x1e,_0x1a74fb=(_0x1e737f=_0x1a74fb)!==null&&_0x1e737f!==void 0x0?_0x1e737f:0x1e;let _0xae5685=0x0,_0x140a46=0x0,_0x3cf1e1=0x0;_0xae5685=_0x140a46=_0x3cf1e1=Math[_0x20356c(0x2aa)](_0x504d5c,_0x786da7/0x2,_0x1a74fb/0x2),_0x102ed8[_0x20356c(0x169)](),_0x102ed8[_0x20356c(0x16a)](_0xae5685,0x0),_0x102ed8[_0x20356c(0x1b7)](_0x786da7-_0x140a46,0x0),_0x102ed8[_0x20356c(0x2a2)](_0x786da7-_0x140a46,_0x140a46,_0x140a46,Math['PI']*0x3/0x2,0x0,![]),_0x102ed8['lineTo'](_0x786da7,_0x1a74fb-_0x3cf1e1),_0x102ed8[_0x20356c(0x2a2)](_0x786da7-_0x3cf1e1,_0x1a74fb-_0x3cf1e1,_0x3cf1e1,0x0,Math['PI']/0x2,![]),_0x102ed8[_0x20356c(0x1b7)](0x0,_0x1a74fb),_0x102ed8[_0x20356c(0x1b7)](0x0,_0xae5685),_0x102ed8[_0x20356c(0x2a2)](_0xae5685,_0xae5685,_0xae5685,Math['PI'],Math['PI']*0x3/0x2,![]),_0x102ed8[_0x20356c(0x2d4)]();if(_0x4518eb['fill']){_0x102ed8[_0x20356c(0x161)](),_0x102ed8['fillStyle']=_0x4518eb['fill'];if(_0x4518eb[_0x20356c(0x2e1)]===_0x20356c(0x153))_0x102ed8['fill'](_0x20356c(0x153));else _0x102ed8[_0x20356c(0x28b)]();_0x102ed8[_0x20356c(0x1d3)]();}}var TextBubbleShape=class TextBubbleShape extends Shape{constructor(_0x466284,_0x9bf74d){const _0x127647=_0x13b516;super(_0x466284,_0x9bf74d),_defineProperty(this,'color',void 0x0),_defineProperty(this,_0x127647(0x251),void 0x0),this[_0x127647(0x2e4)]=_0x9bf74d===null||_0x9bf74d===void 0x0?void 0x0:_0x9bf74d[_0x127647(0x2e4)],this['text']=_0x9bf74d===null||_0x9bf74d===void 0x0?void 0x0:_0x9bf74d['text'];}static[_0x13b516(0x134)](_0x230cfc,_0x9a4362){const _0x428029=_0x13b516,{text:_0xaea703,color:_0x44d945}=_0x9a4362;_0x230cfc[_0x428029(0x161)](),_0x230cfc[_0x428029(0x166)]=_0x428029(0x16b);const _0x53aaf2=_0x230cfc['measureText'](_0xaea703)['width'];drawBubble(_0x230cfc,{'height':0x14,'radius':0x4,'width':Math[_0x428029(0x2aa)](_0x53aaf2+0x2*0x4,0xc8),'fill':_0x44d945,'evented':![]}),_0x230cfc[_0x428029(0x236)]=_0x428029(0x10b);const _0x3b55f5=0x4,_0x5b8f4c=0x14-0x5,_0x5386c2=0xc8-0x2*0x4;if(_0x53aaf2>_0x5386c2){let _0x40e982='',_0x568f1f=0x0;for(const _0x790d9b of _0xaea703){const _0x2e6ce8=_0x230cfc[_0x428029(0x27d)](_0x790d9b)['width'];if(_0x568f1f+_0x2e6ce8<=_0x5386c2-_0x230cfc['measureText'](_0x428029(0x1ea))[_0x428029(0x2db)])_0x40e982+=_0x790d9b,_0x568f1f+=_0x2e6ce8;else{_0x40e982+=_0x428029(0x1ea);break;}}_0x230cfc[_0x428029(0x27c)](_0x40e982,_0x3b55f5,_0x5b8f4c);}else _0x230cfc[_0x428029(0x27c)](_0xaea703,_0x3b55f5,_0x5b8f4c);_0x230cfc[_0x428029(0x1d3)]();}[_0x13b516(0x128)](_0x5abded){const _0x37a5cc=_0x13b516;TextBubbleShape[_0x37a5cc(0x134)](_0x5abded,this);}};const COLLAB_TEXT_ANCHOR_KEY_PREFIX=_0x13b516(0x150),COLLAB_TEXT_RANGE_KEY_PREFIX=_0x13b516(0x2c8),COLLAB_RECT_RANGE_KEY_PREFIX='collab-rect-range-',ID_LENGTH=0x6,COLLAB_TEXT_ANCHOR_WIDTH=1.5,COLLAB_TEXT_ANCHOR_DOT_WIDTH=0x4,SELECTION_CONTROL_BORDER_BUFFER_WIDTH=1.5,SELECTION_CONTROL_BORDER_BUFFER_COLOR=_0x13b516(0x12b);var DocCollabCursor=class{constructor(_0x4fcd29,_0x52c17c,_0x4bcd0c,_0x3d369b){const _0x42d684=_0x13b516;this[_0x42d684(0x15c)]=_0x4fcd29,this[_0x42d684(0xde)]=_0x52c17c,this['_docSkeleton']=_0x4bcd0c,this['_document']=_0x3d369b,_defineProperty(this,_0x42d684(0x20a),[]),_defineProperty(this,_0x42d684(0x18d),null),_defineProperty(this,_0x42d684(0x226),null),_defineProperty(this,'_anchorDot',null),_defineProperty(this,_0x42d684(0x253),null),_defineProperty(this,_0x42d684(0x190),null),this['_render']();}set[_0x13b516(0x2c4)](_0xae082d){const _0x1c0037=_0x13b516;_0xae082d?(this['_anchorDot']&&this[_0x1c0037(0x17e)][_0x1c0037(0x1e4)](),this[_0x1c0037(0x226)]&&this[_0x1c0037(0x226)][_0x1c0037(0x258)]()):(this[_0x1c0037(0x17e)]&&this[_0x1c0037(0x17e)][_0x1c0037(0x258)](),this[_0x1c0037(0x226)]&&this[_0x1c0037(0x226)][_0x1c0037(0x1e4)]());}[_0x13b516(0x217)](){const _0x59748d=_0x13b516;for(const _0x34f025 of this[_0x59748d(0x20a)])_0x34f025[_0x59748d(0x217)]();if(this[_0x59748d(0x226)])this['_textBubble']['dispose']();if(this[_0x59748d(0x17e)])this[_0x59748d(0x17e)][_0x59748d(0x217)]();if(this[_0x59748d(0x18d)])this[_0x59748d(0x18d)][_0x59748d(0x217)]();if(this[_0x59748d(0x190)])this['_eventUnsubscribe']();}[_0x13b516(0x1d6)](){const _0x1f1132=_0x13b516,{_docSkeleton:_0x4df525,_document:_0x4cd4e7}=this,{color:_0x14a1a9,name:_0x346ffc,ranges:_0x357f9b}=this[_0x1f1132(0x15c)],_0x4aa217=_0x4cd4e7[_0x1f1132(0x2b4)](),{docsLeft:_0x5b1d2d,docsTop:_0x437f32}=_0x4aa217,_0x4f9943=new NodePositionConvertToCursor(_0x4aa217,_0x4df525);for(const {startOffset:_0x4b463a,endOffset:_0x2e63f3,rangeType:_0x2f04bd,segmentId:_0x3003fa,segmentPage:_0x41b5a7,collapsed:_0x683703,isActive:_0x25c49d}of _0x357f9b){const _0x4985be=_0x4df525['findNodePositionByCharIndex'](_0x4b463a,!![],_0x3003fa,_0x41b5a7);let _0xf77a1b=_0x4df525['findNodePositionByCharIndex'](_0x2e63f3,!![],_0x3003fa,_0x41b5a7);if(_0xf77a1b==null)_0xf77a1b=_0x4df525[_0x1f1132(0x263)](_0x2e63f3-0x1,![],_0x3003fa,_0x41b5a7);if(_0x25c49d){const {contentBoxPointGroup:_0x41b063}=_0x4f9943[_0x1f1132(0x286)](_0xf77a1b,_0xf77a1b);if(_0x41b063[_0x1f1132(0x196)]===0x0)continue;this['_drawAnchor'](_0x14a1a9,_0x41b063,_0x5b1d2d,_0x437f32,_0x346ffc),this['_eventUnsubscribe']=this[_0x1f1132(0x2c3)]();}if(_0x4985be&&_0xf77a1b){if(_0x2f04bd===DOC_RANGE_TYPE['RECT']){var _0x11b1a1;const {pointGroup:_0x211ef5}=(_0x11b1a1=new NodePositionConvertToRectRange(_0x4aa217,_0x4df525)[_0x1f1132(0x286)](_0x4985be,_0xf77a1b))!==null&&_0x11b1a1!==void 0x0?_0x11b1a1:{};if(_0x211ef5==null||_0x211ef5['length']===0x0)continue;this[_0x1f1132(0x165)](_0x14a1a9,_0x211ef5,_0x5b1d2d,_0x437f32);}else{if(!_0x683703){const {borderBoxPointGroup:_0x5c72e7}=_0x4f9943[_0x1f1132(0x286)](_0x4985be,_0xf77a1b);if(_0x5c72e7['length']===0x0)continue;this['_drawTextRange'](_0x14a1a9,_0x5c72e7,_0x5b1d2d,_0x437f32);}}}}}[_0x13b516(0xf0)](_0x2ae1f6,_0x9013b5,_0x35c0ed,_0x18417b,_0x869ce9){const _0x5c5255=_0x13b516,{left:_0x5b510b,top:_0x3d5f03,height:_0x18c353}=this[_0x5c5255(0x162)](_0x9013b5),_0x2e8869=SELECTION_CONTROL_BORDER_BUFFER_WIDTH/this['_getScale'](),_0x32b24e=new Rect(COLLAB_TEXT_ANCHOR_KEY_PREFIX+generateRandomId(ID_LENGTH),{'left':_0x5b510b+_0x35c0ed-_0x2e8869,'top':_0x3d5f03+_0x18417b,'height':_0x18c353,'width':COLLAB_TEXT_ANCHOR_WIDTH,'fill':_0x2ae1f6||getColor(COLORS[_0x5c5255(0x257)],0x0),'strokeWidth':_0x2e8869,'stroke':SELECTION_CONTROL_BORDER_BUFFER_COLOR,'evented':!![]});this[_0x5c5255(0x18d)]=_0x32b24e,this[_0x5c5255(0xde)]['addObject'](_0x32b24e,TEXT_RANGE_LAYER_INDEX);const _0x4fa509=new Rect(COLLAB_TEXT_ANCHOR_KEY_PREFIX+generateRandomId(ID_LENGTH),{'left':_0x5b510b+_0x35c0ed-_0x2e8869,'top':_0x3d5f03+_0x18417b-COLLAB_TEXT_ANCHOR_DOT_WIDTH/0x2,'height':COLLAB_TEXT_ANCHOR_DOT_WIDTH,'width':COLLAB_TEXT_ANCHOR_DOT_WIDTH,'fill':_0x2ae1f6||getColor(COLORS[_0x5c5255(0x257)],0x0),'strokeWidth':0x0,'stroke':_0x2ae1f6||getColor(COLORS[_0x5c5255(0x257)],0x0),'evented':![]});this['_anchorDot']=_0x4fa509,this['_scene'][_0x5c5255(0x1f6)](_0x4fa509,TEXT_RANGE_LAYER_INDEX);const _0x1f5b16=new TextBubbleShape(COLLAB_TEXT_ANCHOR_KEY_PREFIX+generateRandomId(ID_LENGTH),{'left':_0x5b510b+_0x35c0ed-_0x2e8869,'top':_0x3d5f03+_0x18417b-0x14,'text':_0x869ce9,'color':_0x2ae1f6});this[_0x5c5255(0x226)]=_0x1f5b16,this[_0x5c5255(0xde)][_0x5c5255(0x1f6)](_0x1f5b16,TEXT_RANGE_LAYER_INDEX),this['_hover']=![];}['_handleHover'](){const _0x3e86b5=_0x13b516,_0x5597a9=this['_anchor'][_0x3e86b5(0x231)][_0x3e86b5(0x18c)](()=>{const _0x1ab487=_0x3e86b5;this[_0x1ab487(0x2c4)]=!![];}),_0x681efa=this[_0x3e86b5(0x18d)][_0x3e86b5(0x2ad)][_0x3e86b5(0x18c)](()=>{const _0x126b28=_0x3e86b5;if(this[_0x126b28(0x253)])clearTimeout(this[_0x126b28(0x253)]);this[_0x126b28(0x253)]=setTimeout(()=>{const _0x58f7c8=_0x126b28;this[_0x58f7c8(0x2c4)]=![];},0x7d0);});return()=>{const _0x1c5ddf=_0x3e86b5;_0x5597a9[_0x1c5ddf(0x1b3)](),_0x681efa[_0x1c5ddf(0x1b3)]();};}[_0x13b516(0x123)](_0x1f82fd,_0x3f91f4,_0x542351,_0x1d2e36){const _0x41513c=_0x13b516,_0x319561=0.2,_0x31c703=new ColorKit(_0x1f82fd)['setAlpha'](_0x319561)[_0x41513c(0x21b)](),_0x3e813b=new RegularPolygon(COLLAB_TEXT_RANGE_KEY_PREFIX+generateRandomId(ID_LENGTH),{'pointsGroup':_0x3f91f4,'fill':_0x31c703||getColor(COLORS['black'],_0x319561),'left':_0x542351,'top':_0x1d2e36,'evented':![],'debounceParentDirty':![]});this[_0x41513c(0x20a)][_0x41513c(0x21c)](_0x3e813b),this['_scene']['addObject'](_0x3e813b,TEXT_RANGE_LAYER_INDEX);}['_drawRectRange'](_0x5c18ee,_0x24ee0d,_0x122e9b,_0x1966cb){const _0x3ffc81=_0x13b516,_0x1eb092=0.2,_0x28bcab=new ColorKit(_0x5c18ee)['setAlpha'](_0x1eb092)[_0x3ffc81(0x21b)](),_0xeba48c=new RegularPolygon(COLLAB_RECT_RANGE_KEY_PREFIX+generateRandomId(ID_LENGTH),{'pointsGroup':_0x24ee0d,'fill':_0x28bcab||getColor(COLORS['black'],_0x1eb092),'left':_0x122e9b,'top':_0x1966cb,'evented':![],'debounceParentDirty':![]});this[_0x3ffc81(0x20a)][_0x3ffc81(0x21c)](_0xeba48c),this['_scene'][_0x3ffc81(0x1f6)](_0xeba48c,TEXT_RANGE_LAYER_INDEX);}['_getAnchorBounding'](_0x25c946){const _0xbcd8d0=_0x25c946[0x0],_0x3bfdba=_0xbcd8d0[0x0],_0xb58a36=_0xbcd8d0[0x2],{x:_0x4876b2,y:_0x373d97}=_0x3bfdba,{x:_0x51667e,y:_0x493a99}=_0xb58a36;return{'left':_0x4876b2,'top':_0x373d97,'width':_0x51667e-_0x4876b2,'height':_0x493a99-_0x373d97};}['_getScale'](){const {scaleX:_0x2f14c6,scaleY:_0x27e4c6}=this['_scene']['getAncestorScale']();return Math['max'](_0x2f14c6,_0x27e4c6);}};let DocCollabCursorRenderController=class DocCollabCursorRenderController extends RxDisposable{constructor(_0x11a1be,_0x4305f3,_0x183330,_0x44b2ef,_0x1a293a){const _0x342b1f=_0x13b516;super(),this[_0x342b1f(0x21a)]=_0x11a1be,this[_0x342b1f(0x28f)]=_0x4305f3,this[_0x342b1f(0x269)]=_0x183330,this[_0x342b1f(0x220)]=_0x44b2ef,this[_0x342b1f(0x2a8)]=_0x1a293a,_defineProperty(this,_0x342b1f(0x2c5),[]),_defineProperty(this,_0x342b1f(0x246),[]),this['_init']();}[_0x13b516(0x1e2)](){const _0x2fc2ca=_0x13b516,_0x48dc81=this['_context'][_0x2fc2ca(0x2b9)],_0x4741fd=this[_0x2fc2ca(0x28f)];this[_0x2fc2ca(0x227)](combineLatest([this[_0x2fc2ca(0x269)][_0x2fc2ca(0x208)](_0x48dc81),this[_0x2fc2ca(0x2a8)][_0x2fc2ca(0x27b)]])[_0x2fc2ca(0x202)](map(([_0x8eb6e9,_0x30be67])=>({'skeleton':_0x4741fd[_0x2fc2ca(0x282)](),'cursors':[..._0x8eb6e9[_0x2fc2ca(0x125)]()][_0x2fc2ca(0xea)](_0xc9f7eb=>({..._0xc9f7eb,'color':this['_themeService'][_0x2fc2ca(0x26f)](_0xc9f7eb[_0x2fc2ca(0x2e4)])}))})))['subscribe'](_0x5a2868=>{const _0x1ffe2b=_0x2fc2ca;this[_0x1ffe2b(0x167)]();if(_0x5a2868){const {skeleton:_0x10a4b9,cursors:_0x1f8557}=_0x5a2868;this[_0x1ffe2b(0x290)](_0x10a4b9,_0x1f8557);}})),this[_0x2fc2ca(0xeb)](),this['_initCommandExecutedListener']();}[_0x13b516(0x290)](_0x224aed,_0x109bf0){const _0x29aad8=_0x13b516,{scene:_0x5ae1a3,mainComponent:_0x40dc7c}=this[_0x29aad8(0x21a)];this[_0x29aad8(0x2c5)]=_0x109bf0[_0x29aad8(0x256)](_0x12470a=>new DocCollabCursor(_0x12470a,_0x5ae1a3,_0x224aed,_0x40dc7c)),this[_0x29aad8(0x246)]=_0x109bf0;}[_0x13b516(0x110)](){const _0x297c0c=_0x13b516;this[_0x297c0c(0x167)]();const {scene:_0x220c04,mainComponent:_0x3e7ba7}=this[_0x297c0c(0x21a)],_0x212e78=this[_0x297c0c(0x28f)][_0x297c0c(0x282)]();this[_0x297c0c(0x2c5)]=this[_0x297c0c(0x246)]['map'](_0xf5519b=>new DocCollabCursor(_0xf5519b,_0x220c04,_0x212e78,_0x3e7ba7));}[_0x13b516(0x167)](){const _0x38e1cc=_0x13b516;this['_cursorShapes'][_0x38e1cc(0x296)](_0xd0d18b=>_0xd0d18b[_0x38e1cc(0x217)]()),this[_0x38e1cc(0x2c5)]=[];}[_0x13b516(0x1ab)](){const _0x3db084=_0x13b516,_0x9a0429=[SetDocZoomRatioOperation['id']];this[_0x3db084(0x227)](this[_0x3db084(0x220)]['onCommandExecuted'](_0x50c100=>{const _0x500ac1=_0x3db084;if(_0x9a0429['includes'](_0x50c100['id'])&&_0x50c100[_0x500ac1(0x206)][_0x500ac1(0x2b9)]===this[_0x500ac1(0x21a)][_0x500ac1(0x2b9)])this[_0x500ac1(0x110)]();}));}[_0x13b516(0xeb)](){const _0x23ac53=_0x13b516;this[_0x23ac53(0x227)](fromEventSubject(this[_0x23ac53(0x21a)][_0x23ac53(0x2bb)][_0x23ac53(0x10a)])['pipe'](_0x354a47(_0x7b3666=>_0x7b3666[_0x23ac53(0x1f2)]===TRANSFORM_CHANGE_OBSERVABLE_TYPE[_0x23ac53(0x168)]),throttleTime(0x10))[_0x23ac53(0x192)](()=>{const _0x42d0d9=_0x23ac53;this[_0x42d0d9(0x110)]();}));}};DocCollabCursorRenderController=__decorate([__decorateParam(0x1,Inject(DocSkeletonManagerService)),__decorateParam(0x2,Inject(CollabCursorController)),__decorateParam(0x3,ICommandService),__decorateParam(0x4,Inject(ThemeService))],DocCollabCursorRenderController);const SHEET_COLLAB_CURSOR_BORDER_WIDTH=1.5;var SheetCollabCursorShape=class extends Shape{constructor(_0x5b878b,_0x474e7f){const _0x3e9227=_0x13b516;super(_0x5b878b,_0x474e7f),_defineProperty(this,_0x3e9227(0x131),void 0x0),_defineProperty(this,_0x3e9227(0x19b),![]),_defineProperty(this,'_range',void 0x0),_defineProperty(this,_0x3e9227(0x146),''),_defineProperty(this,_0x3e9227(0x10d),'top'),_defineProperty(this,_0x3e9227(0x23e),void 0x0),_defineProperty(this,_0x3e9227(0x276),void 0x0),_defineProperty(this,_0x3e9227(0x17b),void 0x0),_defineProperty(this,'_highlightSecond',0x4),_defineProperty(this,_0x3e9227(0x117),void 0x0),_defineProperty(this,_0x3e9227(0x29a),void 0x0),_defineProperty(this,_0x3e9227(0x12f),!![]),_defineProperty(this,_0x3e9227(0x1b4),0x0);if(_0x474e7f){var _0x3043c8;this[_0x3e9227(0x14b)](_0x474e7f);if(_0x474e7f[_0x3e9227(0xfe)]&&((_0x3043c8=_0x474e7f[_0x3e9227(0x1ef)])!==null&&_0x3043c8!==void 0x0?_0x3043c8:this[_0x3e9227(0xf4)])){var _0x1bf3bd;this['_startBlinking']((_0x1bf3bd=_0x474e7f[_0x3e9227(0x1ef)])!==null&&_0x1bf3bd!==void 0x0?_0x1bf3bd:this[_0x3e9227(0xf4)]);}}this[_0x3e9227(0x231)][_0x3e9227(0x18c)](()=>this[_0x3e9227(0x14b)]({'hovered':!![]})),this[_0x3e9227(0x2ad)]['subscribeEvent'](()=>this['setShapeProps']({'hovered':![]}));}['setOffsetY'](_0x447fc){const _0x27068a=_0x13b516;this[_0x27068a(0x1b4)]=_0x447fc;}[_0x13b516(0x14b)](_0x6e86fa){const _0x3d7677=_0x13b516;var _0x103304,_0x2e9b90,_0x55ae44,_0x4a761f,_0x44ff1b,_0x24e35f,_0x273738;this[_0x3d7677(0x131)]=(_0x103304=_0x6e86fa['color'])!==null&&_0x103304!==void 0x0?_0x103304:this[_0x3d7677(0x131)],this[_0x3d7677(0x19b)]=(_0x2e9b90=_0x6e86fa[_0x3d7677(0xe1)])!==null&&_0x2e9b90!==void 0x0?_0x2e9b90:this[_0x3d7677(0x19b)],this[_0x3d7677(0x1f0)]=(_0x55ae44=_0x6e86fa[_0x3d7677(0x210)])!==null&&_0x55ae44!==void 0x0?_0x55ae44:this['_range'],this[_0x3d7677(0x146)]=(_0x4a761f=_0x6e86fa[_0x3d7677(0x13f)])!==null&&_0x4a761f!==void 0x0?_0x4a761f:this[_0x3d7677(0x146)],this[_0x3d7677(0x10d)]=(_0x44ff1b=_0x6e86fa[_0x3d7677(0x216)])!==null&&_0x44ff1b!==void 0x0?_0x44ff1b:this[_0x3d7677(0x10d)],this['_backgroundColor']=(_0x24e35f=_0x6e86fa[_0x3d7677(0x138)])!==null&&_0x24e35f!==void 0x0?_0x24e35f:this['_backgroundColor'],this[_0x3d7677(0x276)]=(_0x273738=_0x6e86fa[_0x3d7677(0x287)])!==null&&_0x273738!==void 0x0?_0x273738:this[_0x3d7677(0x276)];if(_0x6e86fa[_0x3d7677(0x1ef)]!==void 0x0)this[_0x3d7677(0xf4)]=_0x6e86fa[_0x3d7677(0x1ef)];if(_0x6e86fa[_0x3d7677(0xfe)]!==void 0x0)this[_0x3d7677(0x17b)]=_0x6e86fa[_0x3d7677(0xfe)];if(_0x6e86fa[_0x3d7677(0x271)]!==void 0x0)this[_0x3d7677(0x1b4)]=_0x6e86fa[_0x3d7677(0x271)];this['transformByState']({'width':_0x6e86fa[_0x3d7677(0x2db)],'height':_0x6e86fa[_0x3d7677(0x14a)]});}[_0x13b516(0x20d)](_0x59047d){const _0x1ddf4e=_0x13b516,{row:_0x28e93c,column:_0x1f09b}=_0x59047d;if(_0x28e93c>=this[_0x1ddf4e(0x1f0)]['startRow']&&_0x28e93c<=this['_range']['endRow']&&_0x1f09b>=this[_0x1ddf4e(0x1f0)][_0x1ddf4e(0x23d)]&&_0x1f09b<=this[_0x1ddf4e(0x1f0)][_0x1ddf4e(0x2d6)]){this[_0x1ddf4e(0x14b)]({'hovered':!![]});return;}this[_0x1ddf4e(0x14b)]({'hovered':![]});}[_0x13b516(0x1aa)](_0x4a14bf){const _0x1a56c3=_0x13b516;this['_stopBlinking'](),this['_isBlinkVisible']=!![],this[_0x1a56c3(0x29a)]=window[_0x1a56c3(0x1f5)](()=>{const _0x254518=_0x1a56c3;this[_0x254518(0x12f)]=!this['_isBlinkVisible'],this[_0x254518(0x2cc)](!![]);},0x1f4),this[_0x1a56c3(0x117)]=window[_0x1a56c3(0x2ba)](()=>{const _0x1f259e=_0x1a56c3;this[_0x1f259e(0xf2)](),this['_isBlinkVisible']=!![],this[_0x1f259e(0x2cc)](!![]);},_0x4a14bf*0x3e8);}['_stopBlinking'](){const _0x4e4ad4=_0x13b516;this[_0x4e4ad4(0x29a)]&&(window['clearInterval'](this[_0x4e4ad4(0x29a)]),this[_0x4e4ad4(0x29a)]=void 0x0),this['_blinkTimer']&&(window['clearTimeout'](this['_blinkTimer']),this[_0x4e4ad4(0x117)]=void 0x0);}[_0x13b516(0x14e)](_0x16023e){return![];}[_0x13b516(0x217)](){this['_stopBlinking'](),super['dispose']();}[_0x13b516(0x128)](_0x414035){const _0x55e0bf=_0x13b516;let _0x5b9605=this['_color'],_0x398887=this[_0x55e0bf(0x23e)];this[_0x55e0bf(0x17b)]&&!this['_isBlinkVisible']&&(_0x5b9605=this['_getLighterColor'](this['_color']),_0x398887=this[_0x55e0bf(0x23e)]?this[_0x55e0bf(0x297)](this['_backgroundColor']):void 0x0);Rect[_0x55e0bf(0x134)](_0x414035,{'width':this[_0x55e0bf(0x2db)],'height':this['height'],'strokeWidth':this['strokeWidth']||1.5,'stroke':_0x5b9605,'evented':![],'fill':_0x398887});if(this[_0x55e0bf(0x19b)]||this[_0x55e0bf(0x276)]){var _0x6dd9d;_0x414035['save'](),_0x414035['transform'](0x1,0x0,0x0,0x1,this[_0x55e0bf(0x2db)],(this['_labelPosition']==='bottom'?0x0:-0x14)+((_0x6dd9d=this[_0x55e0bf(0x1b4)])!==null&&_0x6dd9d!==void 0x0?_0x6dd9d:0x0)),TextBubbleShape[_0x55e0bf(0x134)](_0x414035,{'text':this['_name'],'color':_0x5b9605}),_0x414035[_0x55e0bf(0x1d3)]();}}['_getLighterColor'](_0x982438){const _0x47cae1=_0x13b516;if(_0x982438[_0x47cae1(0x2c7)]('#'))return _0x47cae1(0x16f)+Number[_0x47cae1(0x2d8)](_0x982438[_0x47cae1(0x205)](0x1,0x3),0x10)+',\x20'+Number[_0x47cae1(0x2d8)](_0x982438[_0x47cae1(0x205)](0x3,0x5),0x10)+',\x20'+Number['parseInt'](_0x982438[_0x47cae1(0x205)](0x5,0x7),0x10)+',\x200.2)';if(_0x982438[_0x47cae1(0x2c7)]('rgba'))return _0x982438[_0x47cae1(0x2c2)](/[\d.]+\)$/g,_0x47cae1(0x278));if(_0x982438[_0x47cae1(0x2c7)](_0x47cae1(0x21d)))return _0x982438[_0x47cae1(0x2c2)](_0x47cae1(0x21d),_0x47cae1(0x2f2))[_0x47cae1(0x2c2)](')',_0x47cae1(0x1d9));return _0x982438;}};const SHEETS_COLLABORATION_CURSOR_Z_INDEX=0x1389;let SheetCollabCursorRenderController=class SheetCollabCursorRenderController extends RxDisposable{constructor(_0x59fbbc,_0x227700,_0x5cc31d,_0x16be0f){const _0xa0dc48=_0x13b516;super(),this[_0xa0dc48(0x21a)]=_0x59fbbc,this[_0xa0dc48(0x181)]=_0x227700,this[_0xa0dc48(0x269)]=_0x5cc31d,this[_0xa0dc48(0x2a8)]=_0x16be0f,_defineProperty(this,_0xa0dc48(0x246),new Set()),_defineProperty(this,_0xa0dc48(0x2a0),null),this[_0xa0dc48(0x1e2)]();}['_init'](){const _0x3153da=_0x13b516;this[_0x3153da(0x181)]['currentSkeleton$'][_0x3153da(0x202)](_0x27f82a(this[_0x3153da(0x156)]),_0x39da34(_0xc8f402=>{const _0x5ddf6d=_0x3153da;if(_0xc8f402){const _0xc89fba=_0xc8f402['sheetId'];return combineLatest(this[_0x5ddf6d(0x269)][_0x5ddf6d(0x208)](this[_0x5ddf6d(0x21a)][_0x5ddf6d(0x2b9)]),this['_themeService'][_0x5ddf6d(0x27b)])[_0x5ddf6d(0x202)](map(([_0x2932e,_0x102fab])=>{const _0x14db36=_0x5ddf6d,_0xbb3a49=new Map();return _0x2932e[_0x14db36(0x296)]((_0x5c5c56,_0x3a61e9)=>{const _0x3f3677=_0x14db36;if(_0x5c5c56[_0x3f3677(0xd7)]===_0xc89fba){const _0x2eabe0={..._0x5c5c56};_0x2eabe0['color']=this[_0x3f3677(0x2a8)][_0x3f3677(0x26f)](_0x5c5c56['color']),_0xbb3a49[_0x3f3677(0x1a5)](_0x3a61e9,_0x2eabe0);}}),{'skeleton':_0xc8f402,'cursors':_0xbb3a49};}));}return of({'skeleton':null,'cursors':new Map()});}))[_0x3153da(0x192)](({skeleton:_0x14f83e,cursors:_0x175f66})=>{const _0x48f357=_0x3153da;this['_removeCollabCursors']();if(_0x14f83e)this[_0x48f357(0x290)](_0x14f83e,_0x175f66);}),this[_0x3153da(0x181)][_0x3153da(0x182)][_0x3153da(0x192)](_0x4876b4=>{const _0x9e0688=_0x3153da;if(_0x4876b4==null)return;const {skeleton:_0x5e9a23}=_0x4876b4,{scene:_0x599f47}=this[_0x9e0688(0x21a)];_0x599f47[_0x9e0688(0x135)]['subscribeEvent'](debounce(_0x4ebadd=>{const _0x43314c=_0x9e0688;var _0x2f5c9a,_0x5c62b9;const {offsetX:_0x49a8dd,offsetY:_0x1a5c89}=_0x4ebadd,{x:_0x54fd2c,y:_0x425cbf}=_0x599f47[_0x43314c(0x24e)](Vector2[_0x43314c(0x20b)]([_0x49a8dd,_0x1a5c89])),{scaleX:_0x5b114b,scaleY:_0x1a170c}=_0x599f47[_0x43314c(0xfc)](),_0x2a86c2=_0x599f47['getViewport'](SHEET_VIEWPORT_KEY[_0x43314c(0x127)]),_0x158f9b=_0x599f47[_0x43314c(0x171)](Vector2[_0x43314c(0x20b)]([_0x54fd2c,_0x425cbf]),_0x2a86c2),_0x41b915=_0x5e9a23[_0x43314c(0x29c)](_0x49a8dd,_0x1a5c89,_0x5b114b,_0x1a170c,_0x158f9b);if(((_0x2f5c9a=this[_0x43314c(0x2a0)])===null||_0x2f5c9a===void 0x0?void 0x0:_0x2f5c9a['column'])===_0x41b915[_0x43314c(0x1e1)]&&((_0x5c62b9=this['_lastPointer'])===null||_0x5c62b9===void 0x0?void 0x0:_0x5c62b9[_0x43314c(0x277)])===_0x41b915[_0x43314c(0x277)])return;this[_0x43314c(0x246)][_0x43314c(0x296)](_0x38d6b6=>{const _0xd06cf5=_0x43314c;_0x38d6b6[_0xd06cf5(0x20d)](_0x41b915);});},0x64));});}[_0x13b516(0x290)](_0x28788b,_0x3be2d5){const _0x12724f=_0x13b516,_0x8bb007=this['_sheetSkeletonManagerService'][_0x12724f(0x200)]();if(!_0x8bb007)return;const _0x2c4bbb=this[_0x12724f(0x2de)]();if(!_0x2c4bbb)return;this['_cursors'][_0x12724f(0x296)](_0x58662d=>{const _0x23ee2a=_0x12724f;_0x58662d[_0x23ee2a(0x2cc)]();});const {scene:_0x1adfa8}=_0x2c4bbb,_0x278067=mergeCollabCursors(Array[_0x12724f(0x187)](_0x3be2d5[_0x12724f(0x125)]()))['map'](_0x3ab922=>{const {color:_0x817d20,range:_0xd6a520,name:_0x2fd688,selection:_0x2538c4,sheetID:_0x5941d2}=_0x3ab922,{startColumn:_0x47e1f1,startRow:_0x22a7de,endColumn:_0x3711d6,endRow:_0x4298f5}=_0xd6a520,_0x50b540=getCoordByCell(_0x22a7de,_0x47e1f1,_0x1adfa8,_0x8bb007),_0x4eb919=getCoordByCell(_0x4298f5,_0x3711d6,_0x1adfa8,_0x8bb007),{columnHeaderHeightAndMarginTop:_0x2fc63c}=_0x8bb007,{startX:_0x3e1bfc,startY:_0x4fc8c7}=_0x50b540,{endX:_0x516838,endY:_0x2c7a62}=_0x4eb919,_0x2fd318=_0x516838-_0x3e1bfc,_0x5dd72b=_0x2c7a62-_0x4fc8c7;return new SheetCollabCursorShape(_0x2fd688,{'labelPosition':_0x4fc8c7-_0x2fc63c>=0x14?'top':'bottom','sheetID':_0x5941d2,'range':_0xd6a520,'color':_0x817d20,'name':_0x2fd688,'selection':_0x2538c4,'left':_0x3e1bfc,'top':_0x4fc8c7,'width':_0x2fd318,'height':_0x5dd72b,'evented':![],'zIndex':SHEETS_COLLABORATION_CURSOR_Z_INDEX});});_0x1adfa8['addObjects'](_0x278067,0x1),this['_cursors']=new Set(_0x278067);}[_0x13b516(0x167)](){var _0xe0818f;(_0xe0818f=this['_cursors'])===null||_0xe0818f===void 0x0||_0xe0818f['forEach'](_0x5102f9=>_0x5102f9['dispose']());}['_getSheetObject'](){const _0xdf9efc=_0x13b516;return getSheetObject(this[_0xdf9efc(0x21a)][_0xdf9efc(0x144)],this[_0xdf9efc(0x21a)]);}};SheetCollabCursorRenderController=__decorate([__decorateParam(0x1,Inject(SheetSkeletonManagerService)),__decorateParam(0x2,Inject(CollabCursorController)),__decorateParam(0x3,Inject(ThemeService))],SheetCollabCursorRenderController);function mergeCollabCursors(_0x1518e6){const _0x67b09c=_0x13b516,_0x595038=new Map();return _0x1518e6[_0x67b09c(0x296)](_0x1c51ea=>{const _0x499e8e=_0x67b09c;if(_0x595038['has'](_0x1c51ea['selection'])){const _0x510c9f=_0x595038[_0x499e8e(0x103)](_0x1c51ea[_0x499e8e(0x1f3)]);_0x510c9f[_0x499e8e(0x13f)]+=',\x20'+_0x1c51ea['name'];}else _0x595038[_0x499e8e(0x1a5)](_0x1c51ea[_0x499e8e(0x1f3)],_0x1c51ea);}),Array[_0x67b09c(0x187)](_0x595038[_0x67b09c(0x125)]());}let CollaborationClientUIController=class CollaborationClientUIController extends Disposable{constructor(_0xe72bb0,_0x2b6b4f,_0x78ac8c,_0x5a9d6d,_0x1c0422,_0x2d5fbb){const _0x19f4ee=_0x13b516;super(),this[_0x19f4ee(0x1fc)]=_0xe72bb0,this[_0x19f4ee(0x1a6)]=_0x2b6b4f,this['_collaborationUIEventService']=_0x78ac8c,this[_0x19f4ee(0x23f)]=_0x5a9d6d,this[_0x19f4ee(0x2df)]=_0x1c0422,this[_0x19f4ee(0x23a)]=_0x2d5fbb,this[_0x19f4ee(0x2c0)](),this[_0x19f4ee(0x1f4)]();}[_0x13b516(0x2c0)](){const _0x593a56=_0x13b516;this[_0x593a56(0x227)](this['_beforeCloseService'][_0x593a56(0x18a)](()=>{const _0x153ddd=_0x593a56;if(this[_0x153ddd(0x1a6)]['saveTaskMap'][_0x153ddd(0x2be)])return this[_0x153ddd(0x23a)]['t'](_0x153ddd(0x1a0));}));}[_0x13b516(0x1f4)](){const _0x5855c0=_0x13b516;this[_0x5855c0(0x227)](this[_0x5855c0(0x23b)][_0x5855c0(0x25f)][_0x5855c0(0x192)](_0x27d49d=>{const _0x5d2402=_0x5855c0;if(_0x27d49d['id']===CollaborationUIEventId[_0x5d2402(0x1e6)])this[_0x5d2402(0x23f)][_0x5d2402(0x258)]({'type':MessageType[_0x5d2402(0x22e)],'content':this[_0x5d2402(0x23a)]['t'](_0x5d2402(0x12e))});if(_0x27d49d['id']===CollaborationUIEventId[_0x5d2402(0xe9)])this[_0x5d2402(0x23f)][_0x5d2402(0x258)]({'type':MessageType[_0x5d2402(0x22e)],'content':this[_0x5d2402(0x23a)]['t']('collaboration.closeRoom')});if(_0x27d49d['id']===CollaborationUIEventId[_0x5d2402(0x10f)])this[_0x5d2402(0x2df)][_0x5d2402(0x258)]({'title':this[_0x5d2402(0x23a)]['t'](_0x5d2402(0xe4)),'content':this[_0x5d2402(0x23a)]['t']('permission.content'),'type':_0x5d2402(0xd5),'duration':0x0});if(_0x27d49d['id']===CollaborationUIEventId[_0x5d2402(0x15a)])this[_0x5d2402(0x23f)][_0x5d2402(0x258)]({'type':MessageType[_0x5d2402(0x2a1)],'content':this[_0x5d2402(0x23a)]['t'](_0x5d2402(0x2ed))+'('+_0x27d49d['data']+')'});if(_0x27d49d['id']===CollaborationUIEventId['JOIN_ROOM_FAILED'])this[_0x5d2402(0x23f)]['show']({'type':MessageType[_0x5d2402(0x22e)],'content':this['_localeService']['t'](_0x27d49d[_0x5d2402(0x21f)]||'')});if(_0x27d49d['id']===CollaborationUIEventId[_0x5d2402(0x1d5)])this[_0x5d2402(0x23f)]['show']({'type':MessageType['Warning'],'content':this[_0x5d2402(0x23a)]['t'](_0x5d2402(0x1e5))});if(_0x27d49d['id']===CollaborationUIEventId[_0x5d2402(0x264)])this[_0x5d2402(0x23f)][_0x5d2402(0x258)]({'type':MessageType[_0x5d2402(0x2a1)],'content':this['_localeService']['t'](_0x5d2402(0x1bd))});if(_0x27d49d['id']===CollaborationUIEventId['SUBMIT_CHANGESET_TIMEOUT'])this['_messageService'][_0x5d2402(0x258)]({'type':MessageType[_0x5d2402(0x2a1)],'content':this['_localeService']['t']('session.collaboration-timeout')});}));}};CollaborationClientUIController=__decorate([__decorateParam(0x0,IBeforeCloseService),__decorateParam(0x1,ILocalCacheService),__decorateParam(0x2,Inject(CollaborationUIEventService)),__decorateParam(0x3,IMessageService),__decorateParam(0x4,INotificationService),__decorateParam(0x5,Inject(LocaleService))],CollaborationClientUIController);const PLUGIN_CONFIG_KEY='collaboration-client-ui.config',configSymbol=Symbol(PLUGIN_CONFIG_KEY),defaultPluginConfig={};let DocTransformIMECacheService=class DocTransformIMECacheService{constructor(_0x510a71,_0xdbb9dc){const _0x4f6bfb=_0x13b516;this[_0x4f6bfb(0x26c)]=_0x510a71,this['_renderManagerService']=_0xdbb9dc;}[_0x13b516(0x1c3)](_0x2f9f03){const _0x168d3c=_0x13b516;this[_0x168d3c(0x24d)](_0x2f9f03),this['_transformPreviousActiveRange'](_0x2f9f03);}['transformRemoteChangeset'](_0x20f97d){const _0x540b84=_0x13b516,{unitID:_0x351bf2}=_0x20f97d,{redoCache:_0x7a0888}=this[_0x540b84(0x151)][_0x540b84(0x10e)](_0x351bf2)[_0x540b84(0x1c5)](DocIMEInputManagerService)[_0x540b84(0x1ce)]();if(_0x7a0888[_0x540b84(0x196)]===0x0)return _0x20f97d;let _0x58954e=Tools[_0x540b84(0x11e)](_0x20f97d['mutations'][0x0]);for(let _0x144ad8=0x0;_0x144ad8<_0x7a0888['length'];_0x144ad8++){const _0x53dbb2={'id':_0x540b84(0x183),'params':{..._0x7a0888[_0x144ad8]}},_0x5a7a8f=this[_0x540b84(0x26c)]['transformMutation'](_0x58954e,_0x53dbb2,![]);if(isTransformMutationFailure(_0x5a7a8f))throw _0x5a7a8f[_0x540b84(0xd5)];_0x58954e=_0x5a7a8f[_0x540b84(0x1de)];}return{...Tools[_0x540b84(0x11e)](_0x20f97d),'mutations':[_0x58954e]};}[_0x13b516(0x24d)](_0x335b2b){const _0x2d0e98=_0x13b516,{unitID:_0x2a02ea}=_0x335b2b,_0x527b55=this['_renderManagerService'][_0x2d0e98(0x10e)](_0x2a02ea)[_0x2d0e98(0x1c5)](DocIMEInputManagerService),{undoCache:_0x43698b,redoCache:_0x114e94}=_0x527b55['getUndoRedoMutationParamsCache']();if(_0x43698b[_0x2d0e98(0x196)]===0x0||_0x114e94['length']===0x0)return;const _0x541916=[],_0x39d2be=[];let _0x8a6771=Tools[_0x2d0e98(0x11e)](_0x335b2b[_0x2d0e98(0x154)][0x0]),_0x4484ae=Tools[_0x2d0e98(0x11e)](_0x335b2b[_0x2d0e98(0x154)][0x0]);for(let _0x2555ea=_0x43698b[_0x2d0e98(0x196)]-0x1;_0x2555ea>=0x0;_0x2555ea--){const _0x142ad2={'id':_0x2d0e98(0x183),'params':{..._0x43698b[_0x2555ea]}},_0x200643={'id':_0x2d0e98(0x183),'params':{..._0x114e94[_0x2555ea]}},_0x4b273c=this[_0x2d0e98(0x26c)][_0x2d0e98(0x284)](_0x8a6771,_0x142ad2,![]),_0x334152=this[_0x2d0e98(0x26c)][_0x2d0e98(0x284)](_0x4484ae,_0x200643,![]);if(isTransformMutationFailure(_0x4b273c))throw _0x4b273c[_0x2d0e98(0xd5)];if(isTransformMutationFailure(_0x334152))throw _0x334152[_0x2d0e98(0xd5)];_0x541916[_0x2d0e98(0x116)](_0x4b273c[_0x2d0e98(0x105)]['params']),_0x39d2be[_0x2d0e98(0x116)](_0x334152[_0x2d0e98(0x105)][_0x2d0e98(0x206)]),_0x8a6771=_0x4b273c[_0x2d0e98(0x1de)],_0x4484ae=_0x334152[_0x2d0e98(0x1de)];}_0x527b55[_0x2d0e98(0x132)]({'undoCache':_0x541916,'redoCache':_0x39d2be});}[_0x13b516(0x133)](_0x52fc1c){const _0x33a119=_0x13b516,{unitID:_0x379f81}=_0x52fc1c,_0x36fed8=this[_0x33a119(0x151)][_0x33a119(0x10e)](_0x379f81)[_0x33a119(0x1c5)](DocIMEInputManagerService),_0x2f9516=_0x36fed8[_0x33a119(0x130)]();if(_0x2f9516==null)return;const _0x171dfc=[{'id':_0x33a119(0x183),'params':{'unitId':_0x52fc1c[_0x33a119(0x209)],'actions':null,'textRanges':[_0x2f9516]}}],_0xed1769=this['_transformService'][_0x33a119(0x2cb)](_0x52fc1c,_0x171dfc);if(!isTransformMutationsWithChangesetSuccess(_0xed1769))throw _0xed1769[_0x33a119(0xd5)];const _0x2d895b=_0xed1769[_0x33a119(0x105)][0x0][_0x33a119(0x206)]['textRanges'];if(Array[_0x33a119(0x2ee)](_0x2d895b)&&_0x2d895b[_0x33a119(0x196)])_0x36fed8['setActiveRange'](_0x2d895b[0x0]);}};DocTransformIMECacheService=__decorate([__decorateParam(0x0,ITransformService),__decorateParam(0x1,IRenderManagerService)],DocTransformIMECacheService);let DocTransformStateCacheService=class DocTransformStateCacheService{constructor(_0x3a3910,_0x380fe8,_0x1c8805){const _0x317d17=_0x13b516;this[_0x317d17(0x21e)]=_0x3a3910,this['_transformService']=_0x380fe8,this['_docStateChangeManagerService']=_0x1c8805;}['transformStateCache'](_0x3800d5){const _0x33db1f=_0x13b516;this[_0x33db1f(0x186)](_0x3800d5);}['transformRemoteChangeset'](_0x4b8749){const _0x4347ec=_0x13b516,{unitID:_0x51f4a3}=_0x4b8749,{collaboration:_0x186f52}=this[_0x4347ec(0xd6)][_0x4347ec(0xdc)](_0x51f4a3);if(_0x186f52[_0x4347ec(0x196)]===0x0)return _0x4b8749;let _0x1f3014=Tools['deepClone'](_0x4b8749[_0x4347ec(0x154)][0x0]);for(let _0x17096c=0x0;_0x17096c<_0x186f52[_0x4347ec(0x196)];_0x17096c++){const _0x44c475={'id':_0x4347ec(0x183),'params':{'unitId':_0x186f52[_0x17096c][_0x4347ec(0x2b9)],..._0x186f52[_0x17096c]['redoState']}},_0x228f81=this['_transformService'][_0x4347ec(0x284)](_0x1f3014,_0x44c475,![]);if(isTransformMutationFailure(_0x228f81))throw _0x228f81[_0x4347ec(0xd5)];_0x1f3014=_0x228f81[_0x4347ec(0x1de)];}return{...Tools[_0x4347ec(0x11e)](_0x4b8749),'mutations':[_0x1f3014]};}[_0x13b516(0x186)](_0x3faf69){const _0x3f22f2=_0x13b516,{unitID:_0x514bf5}=_0x3faf69,{history:_0x29ac05,collaboration:_0xe4f3a7}=this[_0x3f22f2(0xd6)][_0x3f22f2(0xdc)](_0x514bf5);if(_0x29ac05[_0x3f22f2(0x196)]===0x0&&_0xe4f3a7['length']===0x0)return;const _0x170aaa=[],_0x2a9aa2=[];let _0x1b8da4=Tools[_0x3f22f2(0x11e)](_0x3faf69['mutations'][0x0]),_0x2b54b5=Tools[_0x3f22f2(0x11e)](_0x3faf69[_0x3f22f2(0x154)][0x0]);for(let _0x577934=_0x29ac05['length']-0x1;_0x577934>=0x0;_0x577934--){const _0x53857c={'id':'doc.mutation.rich-text-editing','params':{'unitId':_0x29ac05[_0x577934][_0x3f22f2(0x2b9)],..._0x29ac05[_0x577934][_0x3f22f2(0x2dc)]}},_0x351816={'id':_0x3f22f2(0x183),'params':{'unitId':_0x29ac05[_0x577934][_0x3f22f2(0x2b9)],..._0x29ac05[_0x577934]['redoState']}},_0x1b7bc0=this[_0x3f22f2(0x26c)]['transformMutation'](_0x1b8da4,_0x53857c,![]),_0x33ee61=this[_0x3f22f2(0x26c)][_0x3f22f2(0x284)](_0x2b54b5,_0x351816,![]);if(isTransformMutationFailure(_0x1b7bc0))throw _0x1b7bc0['error'];if(isTransformMutationFailure(_0x33ee61))throw _0x33ee61[_0x3f22f2(0xd5)];_0x170aaa[_0x3f22f2(0x116)]({..._0x29ac05[_0x577934],'undoState':_0x1b7bc0['m2Prime'][_0x3f22f2(0x206)],'redoState':_0x33ee61[_0x3f22f2(0x105)][_0x3f22f2(0x206)]}),_0x1b8da4=_0x1b7bc0[_0x3f22f2(0x1de)],_0x2b54b5=_0x33ee61[_0x3f22f2(0x1de)];}_0x1b8da4=Tools['deepClone'](_0x3faf69[_0x3f22f2(0x154)][0x0]),_0x2b54b5=Tools[_0x3f22f2(0x11e)](_0x3faf69[_0x3f22f2(0x154)][0x0]);for(let _0x2c4b85=_0xe4f3a7[_0x3f22f2(0x196)]-0x1;_0x2c4b85>=0x0;_0x2c4b85--){const _0x5dd62a={'id':_0x3f22f2(0x183),'params':{'unitId':_0xe4f3a7[_0x2c4b85][_0x3f22f2(0x2b9)],..._0xe4f3a7[_0x2c4b85]['undoState']}},_0x215da6={'id':_0x3f22f2(0x183),'params':{'unitId':_0xe4f3a7[_0x2c4b85]['unitId'],..._0xe4f3a7[_0x2c4b85][_0x3f22f2(0x1ac)]}},_0x27f7ca=this['_transformService']['transformMutation'](_0x1b8da4,_0x5dd62a,![]),_0x5426a2=this[_0x3f22f2(0x26c)][_0x3f22f2(0x284)](_0x2b54b5,_0x215da6,![]);if(isTransformMutationFailure(_0x27f7ca))throw _0x27f7ca[_0x3f22f2(0xd5)];if(isTransformMutationFailure(_0x5426a2))throw _0x5426a2[_0x3f22f2(0xd5)];_0x2a9aa2[_0x3f22f2(0x116)]({..._0xe4f3a7[_0x2c4b85],'undoState':_0x27f7ca['m2Prime'][_0x3f22f2(0x206)],'redoState':_0x5426a2['m2Prime']['params']}),_0x1b8da4=_0x27f7ca[_0x3f22f2(0x1de)],_0x2b54b5=_0x5426a2[_0x3f22f2(0x1de)];}this['_docStateChangeManagerService'][_0x3f22f2(0x2e3)](_0x514bf5,{'history':_0x170aaa,'collaboration':_0x2a9aa2});}};DocTransformStateCacheService=__decorate([__decorateParam(0x0,Inject(Injector)),__decorateParam(0x1,ITransformService),__decorateParam(0x2,Inject(DocStateChangeManagerService))],DocTransformStateCacheService);let DocTransformSelectionsService=class DocTransformSelectionsService{constructor(_0x416e93,_0x41a821){const _0x2ee93c=_0x13b516;this['_injector']=_0x416e93,this[_0x2ee93c(0x26c)]=_0x41a821;}[_0x13b516(0x279)](_0x79a376){const _0x3d61f7=_0x13b516;var _0x3f25ac;const _0x385aad=this[_0x3d61f7(0x21e)]['get'](DocSelectionManagerService),_0x4f7051=(_0x3f25ac=_0x385aad[_0x3d61f7(0x184)]())!==null&&_0x3f25ac!==void 0x0?_0x3f25ac:[];if(_0x4f7051[_0x3d61f7(0x196)]===0x0)return;const _0x1f91b2=_0x79a376['unitID'],_0x51c33d=[{'id':'doc.mutation.rich-text-editing','params':{'unitId':_0x1f91b2,'actions':null,'textRanges':_0x4f7051}}],_0x35b957=this[_0x3d61f7(0x26c)][_0x3d61f7(0x2cb)](_0x79a376,_0x51c33d);if(!isTransformMutationsWithChangesetSuccess(_0x35b957))throw _0x35b957[_0x3d61f7(0xd5)];const _0xb5ebf3=_0x35b957[_0x3d61f7(0x105)][0x0][_0x3d61f7(0x206)]['textRanges'];if(Array[_0x3d61f7(0x2ee)](_0xb5ebf3)&&_0xb5ebf3['length'])_0x385aad['replaceDocRanges'](_0xb5ebf3,{'unitId':_0x1f91b2,'subUnitId':_0x1f91b2},![]);}};DocTransformSelectionsService=__decorate([__decorateParam(0x0,Inject(Injector)),__decorateParam(0x1,ITransformService)],DocTransformSelectionsService);let CollaborationEntityUIController=class CollaborationEntityUIController extends Disposable{constructor(_0x5dc959,_0x1bf8d8,_0x36feb7,_0x46a8f2,_0x160294,_0xaa2493,_0x166128,_0x549a20){const _0x24cff6=_0x13b516;super(),this['_docStateChangeManagerService']=_0x5dc959,this[_0x24cff6(0x178)]=_0x1bf8d8,this[_0x24cff6(0x19d)]=_0x36feb7,this[_0x24cff6(0x195)]=_0x46a8f2,this[_0x24cff6(0x109)]=_0x160294,this['_docSyncEditingCollabCursorService']=_0xaa2493,this[_0x24cff6(0x23f)]=_0x166128,this['_localeService']=_0x549a20,_defineProperty(this,_0x24cff6(0x155),new BehaviorSubject(CollaborationStatus[_0x24cff6(0x248)])),this[_0x24cff6(0x273)]();}[_0x13b516(0x273)](){const _0x1bedb1=_0x13b516;this[_0x1bedb1(0x227)](this[_0x1bedb1(0x178)][_0x1bedb1(0x2bc)]['subscribe'](_0x4238d7=>{const _0x1f0bbb=_0x1bedb1,_0x5980a7=this['_docStateChangeManagerService'][_0x1f0bbb(0x1d4)][_0x1f0bbb(0x192)](_0x597b60=>{const _0x2d888e=_0x1f0bbb;if(_0x597b60==null)return;const {unitId:_0x569145,redoState:_0x19f350,commandId:_0x8e890e}=_0x597b60;if(_0x569145!==_0x4238d7[_0x2d888e(0x209)])return;const _0x32d842={'id':_0x8e890e,'type':CommandType['MUTATION'],'params':{'unitId':_0x569145,'actions':_0x19f350[_0x2d888e(0x261)],'textRanges':null}};_0x4238d7[_0x2d888e(0x2b1)](_0x32d842);});_0x4238d7['disposeWithMe'](_0x5980a7);if(_0x4238d7 instanceof DocCollaborationEntity)_0x4238d7[_0x1f0bbb(0x230)]({'onTransformIME':_0x3c098e=>this[_0x1f0bbb(0x19d)]['transformIMECache'](_0x3c098e),'onTransformState':_0x1127e9=>this[_0x1f0bbb(0x195)][_0x1f0bbb(0x27f)](_0x1127e9),'onTransformSelections':_0x460b8e=>this[_0x1f0bbb(0x109)][_0x1f0bbb(0x279)](_0x460b8e),'onSyncEditingCollabCursor':_0x201b8e=>this[_0x1f0bbb(0xed)][_0x1f0bbb(0x27a)](_0x201b8e),'onTransformRemoteChangesetByIMECache':_0x5ea222=>this[_0x1f0bbb(0x19d)][_0x1f0bbb(0x22f)](_0x5ea222),'onTransformRemoteChangesetByStateCache':_0x4c65dd=>this[_0x1f0bbb(0x195)]['transformRemoteChangeset'](_0x4c65dd)});}));}};CollaborationEntityUIController=__decorate([__decorateParam(0x0,Inject(DocStateChangeManagerService)),__decorateParam(0x1,Inject(CollaborationController)),__decorateParam(0x2,Inject(DocTransformIMECacheService)),__decorateParam(0x3,Inject(DocTransformStateCacheService)),__decorateParam(0x4,Inject(DocTransformSelectionsService)),__decorateParam(0x5,Inject(DocSyncEditingCollabCursorService)),__decorateParam(0x6,IMessageService),__decorateParam(0x7,Inject(LocaleService))],CollaborationEntityUIController);let FrontendLogController=class FrontendLogController extends Disposable{constructor(_0x316217,_0x11fabe,_0x383b51,_0x268f65){const _0x55ace1=_0x13b516;super(),this['_injector']=_0x316217,this['_httpService']=_0x11fabe,this[_0x55ace1(0x194)]=_0x383b51,this[_0x55ace1(0x294)]=_0x268f65,_defineProperty(this,_0x55ace1(0x19a),void 0x0),this[_0x55ace1(0x1e2)]();}['_init'](){const _0x3c266b=_0x13b516;this['_initWindowErrorListener'](),this[_0x3c266b(0x10c)](),this[_0x3c266b(0x198)](),this[_0x3c266b(0x250)]();}[_0x13b516(0x250)](){const _0x190af6=_0x13b516;this[_0x190af6(0x227)](this[_0x190af6(0x294)][_0x190af6(0x102)][_0x190af6(0x192)](_0x180c9=>{const _0x2e759c=_0x190af6;this[_0x2e759c(0x19a)]=_0x180c9===null||_0x180c9===void 0x0?void 0x0:_0x180c9['memberID'];}));}[_0x13b516(0x204)](){const _0x282034=_0x13b516,_0x4294a1=_0x51651a=>{const _0x3bac55=_0xd732;var _0x4e1cd6;this[_0x3bac55(0x2f0)](_0x3bac55(0xd5),'[Window\x20Error]:\x20'+_0x51651a['message']+_0x3bac55(0x1e8)+_0x51651a[_0x3bac55(0x2b5)]+':'+_0x51651a['lineno']+':'+_0x51651a[_0x3bac55(0x140)]+'\x0a'+(((_0x4e1cd6=_0x51651a[_0x3bac55(0xd5)])===null||_0x4e1cd6===void 0x0?void 0x0:_0x4e1cd6['stack'])||''));};window[_0x282034(0x25e)](_0x282034(0xd5),_0x4294a1),this[_0x282034(0x227)](()=>{const _0x577523=_0x282034;window[_0x577523(0x1ae)](_0x577523(0xd5),_0x4294a1);});}['_initUnhandledRejectionListener'](){const _0x18ee74=_0x13b516,_0x51d20c=_0x167cc7=>{const _0x185969=_0xd732;this[_0x185969(0x2f0)](_0x185969(0xd5),_0x185969(0x20f)+_0x167cc7[_0x185969(0x148)]);};window[_0x18ee74(0x25e)](_0x18ee74(0x1d2),_0x51d20c),this[_0x18ee74(0x227)](()=>{const _0x2e893f=_0x18ee74;window['removeEventListener'](_0x2e893f(0x1d2),_0x51d20c);});}[_0x13b516(0x198)](){const _0x561a03=_0x13b516,_0x45f3e8=this[_0x561a03(0x194)]['error']['bind'](this[_0x561a03(0x194)]);this[_0x561a03(0x194)][_0x561a03(0xd5)]=(..._0x406cb0)=>{const _0x573ec1=_0x561a03,_0x3bb2c9=_0x406cb0[_0x573ec1(0x256)](_0x32038d=>_0x32038d instanceof Error?_0x32038d['message']+'\x0a'+_0x32038d[_0x573ec1(0x28c)]:String(_0x32038d))[_0x573ec1(0x22d)]('\x20');this[_0x573ec1(0x2f0)]('error','[LogService\x20Error]:\x20'+_0x3bb2c9),_0x45f3e8(..._0x406cb0);},this[_0x561a03(0x227)](()=>{this['_logService']['error']=_0x45f3e8;});}[_0x13b516(0x2f0)](_0x114a66,_0x32107f){const _0x1979dc=_0x13b516;try{const _0x4a0525={'userId':this[_0x1979dc(0x19a)],'logLabel':_0x114a66,'content':_0x32107f};this['_httpService'][_0x1979dc(0x1dc)]('/universer-api/frontend/logs',{'body':_0x4a0525})[_0x1979dc(0x13b)](()=>{});}catch{}}};FrontendLogController=__decorate([__decorateParam(0x0,Inject(Injector)),__decorateParam(0x1,Inject(HTTPService)),__decorateParam(0x2,ILogService),__decorateParam(0x3,Inject(CollaborationSessionService))],FrontendLogController);function isCalculationStart(_0x3f3160){const _0x21873d=_0x13b516;var _0x1761f9,_0x59f1f4;const _0xf8f494=(_0x1761f9=_0x3f3160[_0x21873d(0x1f1)])===null||_0x1761f9===void 0x0?void 0x0:_0x1761f9[_0x21873d(0x17c)],_0x1c4764=((_0x59f1f4=_0x3f3160[_0x21873d(0x1f1)])===null||_0x59f1f4===void 0x0?void 0x0:_0x59f1f4[_0x21873d(0x1ec)])||0x0;return _0xf8f494===FormulaExecuteStageType[_0x21873d(0x1db)]&&_0x1c4764>0x0;}function isCalculationComplete(_0x23fed6){const _0x4b9322=_0x13b516;return _0x23fed6[_0x4b9322(0xf3)]===FormulaExecutedStateType[_0x4b9322(0x137)];}const DEFAULT_FORMULA_CALCULATION_LIMIT_STATUS_URL='/universer-api/license/formula/limit/status',DEFAULT_FORMULA_CALCULATION_LIMIT_START_URL=_0x13b516(0x2f1),DEFAULT_FORMULA_CALCULATION_LIMIT_DONE_URL=_0x13b516(0x11c);let FormulaCalculationGuardService=class FormulaCalculationGuardService extends Disposable{constructor(_0xe1c54c,_0x471e21,_0xc749fc,_0x154c77,_0x3d29b5,_0x45d43d,_0x37a95a){const _0x1f7066=_0x13b516;super(),this['_messageService']=_0xe1c54c,this['_commandService']=_0x471e21,this[_0x1f7066(0x106)]=_0xc749fc,this[_0x1f7066(0xff)]=_0x154c77,this[_0x1f7066(0x2a7)]=_0x3d29b5,this[_0x1f7066(0x194)]=_0x45d43d,this[_0x1f7066(0x23a)]=_0x37a95a,_defineProperty(this,_0x1f7066(0x1fb),null),_defineProperty(this,_0x1f7066(0x2ae),0x0),_defineProperty(this,_0x1f7066(0x152),0x0),_defineProperty(this,_0x1f7066(0x120),[]),_defineProperty(this,_0x1f7066(0x149),0x0),this[_0x1f7066(0x163)]();}[_0x13b516(0x163)](){const _0x233805=_0x13b516;this[_0x233805(0x227)](this[_0x233805(0x220)][_0x233805(0xe6)]((_0x347040,_0x1010cf)=>{const _0x2939e1=_0x233805;var _0x2999d5;if(_0x347040['id']!==SetFormulaCalculationStartMutation['id'])return;const _0x77d7c5=_0x347040[_0x2939e1(0x206)];if(!this[_0x2939e1(0x1be)]((_0x2999d5=_0x77d7c5[_0x2939e1(0x119)])!==null&&_0x2999d5!==void 0x0?_0x2999d5:[]))return;if(!this[_0x2939e1(0x142)]()){this[_0x2939e1(0x17f)](_0x347040,_0x1010cf),this[_0x2939e1(0x244)]();throw new CanceledError();}})),this[_0x233805(0x227)](this[_0x233805(0x220)]['onCommandExecuted']((_0xad7e31,_0x48b88a)=>{const _0x3fd3d6=_0x233805;if(_0xad7e31['id']!==SetFormulaCalculationNotificationMutation['id'])return;const _0x33af72=_0xad7e31[_0x3fd3d6(0x206)];if(isCalculationStart(_0x33af72)){const _0x5c7431=generateRandomId();this['_taskIds'][_0x3fd3d6(0x21c)](_0x5c7431),this['_startCalculationLimit'](_0x5c7431);}else{if(isCalculationComplete(_0x33af72)){if(this[_0x3fd3d6(0x120)][_0x3fd3d6(0x196)]>0x0){const _0xa993a9=this[_0x3fd3d6(0x120)][_0x3fd3d6(0x1b6)]();this[_0x3fd3d6(0x24c)](_0xa993a9);}}}}));}[_0x13b516(0x217)](){const _0x36448f=_0x13b516;super['dispose'](),this[_0x36448f(0x267)](),this[_0x36448f(0x120)]=[],this[_0x36448f(0x152)]=0x0,this[_0x36448f(0x2ae)]=0x0,this['_lastResponseTimestamp']=0x0;}async['_checkAndWaitForCalculationPermission'](_0x25d78b,_0x4e916d){const _0xbf7044=_0x13b516,_0x2f3b35=0x1e,_0x2e6264=0x3e8;for(let _0x21dfaa=0x0;_0x21dfaa<_0x2f3b35;_0x21dfaa++)try{await this[_0xbf7044(0x295)]();if(this[_0xbf7044(0x142)]()){this[_0xbf7044(0xe2)](_0x25d78b,_0x4e916d),this['_messageService']['show']({'content':this[_0xbf7044(0x23a)]['t'](_0xbf7044(0x1b5)),'type':MessageType[_0xbf7044(0x11f)]});return;}await new Promise(_0x4f4db3=>{const _0x47ee4d=_0xbf7044;this[_0x47ee4d(0x1fb)]=window[_0x47ee4d(0x2ba)](_0x4f4db3,_0x2e6264);});}catch(_0x3d4800){this[_0xbf7044(0x194)]['error'](_0x3d4800);}this[_0xbf7044(0x23f)][_0xbf7044(0x258)]({'content':this[_0xbf7044(0x23a)]['t'](_0xbf7044(0x211)),'type':MessageType['Error']});}[_0x13b516(0xe2)](_0x5113a4,_0x3582d2){const _0x36e05b=_0x13b516;try{this[_0x36e05b(0x220)][_0x36e05b(0x24a)](_0x5113a4['id'],_0x5113a4[_0x36e05b(0x206)],_0x3582d2);}catch(_0x5e607b){this[_0x36e05b(0x194)][_0x36e05b(0xd5)](_0x5e607b);}}['_setFormulaLimitStatus'](_0x18af9f,_0x38f79e){const _0x37a256=_0x13b516;if(_0x38f79e<this['_lastResponseTimestamp'])return;this['_lastResponseTimestamp']=_0x38f79e,this[_0x37a256(0x2ae)]=Number[_0x37a256(0x2d8)](_0x18af9f[_0x37a256(0x2f3)]),this[_0x37a256(0x152)]=Number[_0x37a256(0x2d8)](_0x18af9f[_0x37a256(0x101)]);}async['_startCalculationLimit'](_0x5eb3cb){const _0x4c679d=_0x13b516,_0x285d61=Date[_0x4c679d(0x283)]();try{var _0x2dcd12,_0x5b2324;const _0xce3d44=((_0x2dcd12=this[_0x4c679d(0x106)][_0x4c679d(0x11a)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY))===null||_0x2dcd12===void 0x0?void 0x0:_0x2dcd12[_0x4c679d(0x1cc)])||DEFAULT_FORMULA_CALCULATION_LIMIT_START_URL,_0x304530=(await this[_0x4c679d(0xff)][_0x4c679d(0x1dc)](_0xce3d44,{'body':JSON['stringify']({'taskId':_0x5eb3cb})}))[_0x4c679d(0xd8)];if(((_0x5b2324=_0x304530[_0x4c679d(0xd5)])===null||_0x5b2324===void 0x0?void 0x0:_0x5b2324['code'])!==ErrorCode['OK'])return;this['_setFormulaLimitStatus'](_0x304530[_0x4c679d(0x281)],_0x285d61);}catch(_0x38c647){this['_logService'][_0x4c679d(0xd5)](_0x38c647);}}async[_0x13b516(0x295)](_0x1dbebd){const _0x4e6c95=_0x13b516,_0x3b3ba0=Date[_0x4e6c95(0x283)]();try{var _0x480d95,_0x5dfb82;const _0x40d621=((_0x480d95=this[_0x4e6c95(0x106)]['getConfig'](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY))===null||_0x480d95===void 0x0?void 0x0:_0x480d95[_0x4e6c95(0x221)])||DEFAULT_FORMULA_CALCULATION_LIMIT_STATUS_URL,_0x2157cc=_0x1dbebd?_0x40d621+'?taskId='+encodeURIComponent(_0x1dbebd):_0x40d621,_0x58e402=(await this['_httpService'][_0x4e6c95(0x103)](_0x2157cc))['body'];if(((_0x5dfb82=_0x58e402['error'])===null||_0x5dfb82===void 0x0?void 0x0:_0x5dfb82[_0x4e6c95(0xee)])!==ErrorCode['OK'])return;this[_0x4e6c95(0x29f)](_0x58e402[_0x4e6c95(0x281)],_0x3b3ba0);}catch(_0x147e06){this['_logService'][_0x4e6c95(0xd5)](_0x147e06);}}async[_0x13b516(0x24c)](_0x46ce45){const _0x31ca6e=_0x13b516,_0x47b56e=Date[_0x31ca6e(0x283)]();try{var _0x50ab3e,_0x15bbab;const _0x5beee8=((_0x50ab3e=this[_0x31ca6e(0x106)]['getConfig'](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY))===null||_0x50ab3e===void 0x0?void 0x0:_0x50ab3e[_0x31ca6e(0x2eb)])||DEFAULT_FORMULA_CALCULATION_LIMIT_DONE_URL,_0x36d29e=(await this[_0x31ca6e(0xff)][_0x31ca6e(0x1dc)](_0x5beee8,{'body':JSON[_0x31ca6e(0x2ef)]({'taskId':_0x46ce45})}))[_0x31ca6e(0xd8)];if(((_0x15bbab=_0x36d29e[_0x31ca6e(0xd5)])===null||_0x15bbab===void 0x0?void 0x0:_0x15bbab['code'])!==ErrorCode['OK'])return;this['_setFormulaLimitStatus'](_0x36d29e[_0x31ca6e(0x281)],_0x47b56e);}catch(_0x44b4cf){this[_0x31ca6e(0x194)][_0x31ca6e(0xd5)](_0x44b4cf);}}[_0x13b516(0x142)](){const _0x35bfb1=_0x13b516;if(this[_0x35bfb1(0x2ae)]===0x0)return!![];return this[_0x35bfb1(0x2ae)]-this['_currentUsage']>0x0;}[_0x13b516(0x267)](){const _0x1b1965=_0x13b516;this[_0x1b1965(0x1fb)]&&(clearTimeout(this[_0x1b1965(0x1fb)]),this[_0x1b1965(0x1fb)]=null);}['_showGuardMessage'](){const _0x2243c4=_0x13b516;this['_messageService'][_0x2243c4(0x258)]({'content':this[_0x2243c4(0x23a)]['t']('formula.calculation.waiting'),'type':MessageType[_0x2243c4(0x2ac)]});}[_0x13b516(0x1be)](_0x439bb0){const _0xf52f1c=_0x13b516;for(const _0x23319e of _0x439bb0){const {unitId:_0x41eb71,sheetId:_0x357369,range:_0x4a21fd}=_0x23319e,_0x51c3a6=this[_0xf52f1c(0x2a7)][_0xf52f1c(0x118)](_0x41eb71);if(!_0x51c3a6)continue;const _0x339e1e=_0x51c3a6[_0xf52f1c(0x298)](_0x357369);if(!_0x339e1e)continue;const _0x10c80f=_0x339e1e['getCellMatrix']();for(let _0x40e849=_0x4a21fd[_0xf52f1c(0x219)];_0x40e849<=_0x4a21fd[_0xf52f1c(0x1fd)];_0x40e849++)for(let _0x2680c1=_0x4a21fd['startColumn'];_0x2680c1<=_0x4a21fd[_0xf52f1c(0x2d6)];_0x2680c1++){const _0xd92aad=_0x10c80f['getValue'](_0x40e849,_0x2680c1);if(_0xd92aad&&(isFormulaString(_0xd92aad['f'])||isFormulaId(_0xd92aad['si'])))return!![];}}return![];}};FormulaCalculationGuardService=__decorate([__decorateParam(0x0,Inject(IMessageService)),__decorateParam(0x1,ICommandService),__decorateParam(0x2,IConfigService),__decorateParam(0x3,Inject(HTTPService)),__decorateParam(0x4,IUniverInstanceService),__decorateParam(0x5,ILogService),__decorateParam(0x6,Inject(LocaleService))],FormulaCalculationGuardService);let WebLocalCacheService=class WebLocalCacheService extends Disposable{constructor(_0x5de20d,_0x1f9231,_0x25dc9c){const _0x119f4c=_0x13b516;super(),this[_0x119f4c(0x106)]=_0x5de20d,this[_0x119f4c(0x1d1)]=_0x1f9231,this['_revisionService']=_0x25dc9c,_defineProperty(this,_0x119f4c(0xfb),new Map()),_defineProperty(this,_0x119f4c(0x1c7),new Map()),_defineProperty(this,'_disabled',![]);}[_0x13b516(0x2e6)](){const _0x38392b=_0x13b516;this[_0x38392b(0x20c)]=!![];}[_0x13b516(0x218)](){const _0x2dac2c=_0x13b516;this[_0x2dac2c(0x20c)]=![];}get['saveTaskMap'](){const _0x3fb9fb=_0x13b516;return this[_0x3fb9fb(0x1c7)];}[_0x13b516(0x217)](){const _0x41bcd3=_0x13b516;this[_0x41bcd3(0x2e2)]()[_0x41bcd3(0x2c9)](()=>super[_0x41bcd3(0x217)]());}async[_0x13b516(0x13e)](_0x40c306){const _0x306133=_0x13b516;if(this[_0x306133(0x20c)])return null;return this[_0x306133(0x1d1)][_0x306133(0x189)](getLocalCacheKey(_0x40c306));}async[_0x13b516(0x1a7)](_0x45e097,_0x30934b){const _0x139edb=_0x13b516;return!!this[_0x139edb(0x1d1)]['setItem'](_0x45e097,_0x30934b);}[_0x13b516(0x229)](_0x9aec8,_0x21c03e,_0x492ebf,_0x5739dd){const _0x4818b7=_0x13b516,_0x58c2de=this[_0x4818b7(0x29d)][_0x4818b7(0x19c)](_0x9aec8);this[_0x4818b7(0xfb)][_0x4818b7(0x1a5)](_0x9aec8,{'unitID':_0x9aec8,'type':_0x21c03e,'awaitingChangeset':_0x492ebf,'mutations':_0x5739dd,'rev':_0x58c2de});if(!this['_saveTaskMap']['has'](_0x9aec8))this[_0x4818b7(0x22b)](_0x9aec8);}[_0x13b516(0x22b)](_0x23effd){const _0x29670d=_0x13b516,_0x4e8cbd=this[_0x29670d(0x1b2)]();if(_0x4e8cbd===0x0)this['_saveCache'](_0x23effd);else this[_0x29670d(0x1c7)][_0x29670d(0x1a5)](_0x23effd,setTimeout(()=>this[_0x29670d(0xf5)](_0x23effd),_0x4e8cbd));}['_getSaveTimeout'](){const _0x4cf0d1=_0x13b516;var _0x46cfc6;return(_0x46cfc6=this[_0x4cf0d1(0x106)][_0x4cf0d1(0x11a)](LOCAL_CACHE_INTERVAL_KEY))!==null&&_0x46cfc6!==void 0x0?_0x46cfc6:LOCAL_CACHE_INTERVAL;}['_saveCache'](_0x302b1a){const _0x4505ee=_0x13b516,_0x56abd4=this['_saveTaskMap'][_0x4505ee(0x103)](_0x302b1a);if(_0x56abd4!==void 0x0)window[_0x4505ee(0x100)](_0x56abd4);return this[_0x4505ee(0x1d1)][_0x4505ee(0x145)](getLocalCacheKey(_0x302b1a),this[_0x4505ee(0xfb)]['get'](_0x302b1a))[_0x4505ee(0x2c9)](()=>this['_saveTaskMap'][_0x4505ee(0x1f7)](_0x302b1a));}async[_0x13b516(0x2e2)](){const _0x28c964=_0x13b516,_0x561fa7=[];this[_0x28c964(0x1c7)][_0x28c964(0x296)]((_0x3c94d4,_0x473be8)=>{const _0x26d53f=_0x28c964;window[_0x26d53f(0x100)](_0x3c94d4),_0x561fa7[_0x26d53f(0x21c)](this[_0x26d53f(0xf5)](_0x473be8)[_0x26d53f(0x2c9)](()=>{const _0x572b86=_0x26d53f;this[_0x572b86(0x1c7)]['delete'](_0x473be8);}));}),await Promise['all'](_0x561fa7);}};WebLocalCacheService=__decorate([__decorateParam(0x0,IConfigService),__decorateParam(0x1,ILocalStorageService),__decorateParam(0x2,Inject(RevisionService))],WebLocalCacheService);var WebURLService=class extends RxDisposable{constructor(){const _0x215b06=_0x13b516;super(),_defineProperty(this,'urlChange$',void 0x0),this[_0x215b06(0x1b1)]=fromEvent(window,_0x215b06(0x16d))[_0x215b06(0x202)](takeUntil(this['dispose$']),shareReplay(0x1),mapTo(void 0x0));}[_0x13b516(0x1ff)](_0x565fc1,_0x5b74ce,_0x5de6fa=![]){const _0x4a0fe0=_0x13b516,_0x57634b=new URL(window['location']['href']);_0x57634b[_0x4a0fe0(0x2bf)]['set'](_0x565fc1,_0x5b74ce);if(_0x5de6fa)window[_0x4a0fe0(0x176)][_0x4a0fe0(0x2e5)]('','',_0x57634b[_0x4a0fe0(0x245)]());else window[_0x4a0fe0(0x176)]['pushState']('','',_0x57634b[_0x4a0fe0(0x245)]());}[_0x13b516(0x1e9)](_0x4ec3fc,_0x2585a9=![]){const _0x304725=_0x13b516,_0x31304d=new URL(window[_0x304725(0x113)][_0x304725(0x19f)]);_0x31304d[_0x304725(0x2bf)][_0x304725(0x1f7)](_0x4ec3fc);if(_0x2585a9)window[_0x304725(0x176)][_0x304725(0x2e5)]('','',_0x31304d[_0x304725(0x245)]());else window[_0x304725(0x176)][_0x304725(0x2e8)]('','',_0x31304d[_0x304725(0x245)]());}[_0x13b516(0x224)](_0x1a2a78){const _0x501121=_0x13b516;var _0x46139f;return(_0x46139f=new URL(window[_0x501121(0x113)][_0x501121(0x19f)])[_0x501121(0x2bf)][_0x501121(0x103)](_0x1a2a78))!==null&&_0x46139f!==void 0x0?_0x46139f:void 0x0;}};let UniverCollaborationClientUIPlugin=class UniverCollaborationClientUIPlugin extends Plugin{constructor(_0x3e629d=defaultPluginConfig,_0x1e3fba,_0x45408d,_0x5e83cc){const _0x3c5eaf=_0x13b516;super(),this[_0x3c5eaf(0x1a4)]=_0x3e629d,this[_0x3c5eaf(0x151)]=_0x1e3fba,this[_0x3c5eaf(0x21e)]=_0x45408d,this['_configService']=_0x5e83cc;const {..._0x1ebf90}=merge({},defaultPluginConfig,this[_0x3c5eaf(0x1a4)]);this[_0x3c5eaf(0x106)]['setConfig'](PLUGIN_CONFIG_KEY,_0x1ebf90);}[_0x13b516(0x2b6)](){const _0x1f3473=_0x13b516;this[_0x1f3473(0xf1)](),this[_0x1f3473(0x1fe)]();}[_0x13b516(0x114)](){const _0x184bc2=_0x13b516;this[_0x184bc2(0x172)]();}['_registerDependencies'](){const _0x13aae3=_0x13b516;var _0x423916;const _0x3d4ecf=[[ColorAssignService],[FormulaCalculationGuardService],[DocTransformSelectionsService],[DocTransformIMECacheService],[DocTransformStateCacheService],[DocSyncEditingCollabCursorService],[IURLService,{'useClass':WebURLService}],[ISocketService,{'useClass':WebSocketService}],[ILocalCacheService,{'useClass':WebLocalCacheService}],[DesktopCollaborationStatusDisplayController],[CollaborationEntityUIController],[CollaborationClientUIController],[CollabCursorController],[ImagePasteController],[CollaborationDataLoaderController]];if(this['_config'][_0x13aae3(0x28e)])_0x3d4ecf[_0x13aae3(0x21c)]([FrontendLogController]);registerDependencies(this[_0x13aae3(0x21e)],mergeOverrideWithDependencies(_0x3d4ecf,(_0x423916=this[_0x13aae3(0x1a4)])===null||_0x423916===void 0x0?void 0x0:_0x423916[_0x13aae3(0x197)]));}[_0x13b516(0x172)](){const _0x40c874=_0x13b516;this[_0x40c874(0x227)](this[_0x40c874(0x151)][_0x40c874(0x1bb)](UniverInstanceType[_0x40c874(0x1bc)],[DocCollabCursorRenderController])),this[_0x40c874(0x227)](this[_0x40c874(0x151)][_0x40c874(0x1bb)](UniverInstanceType[_0x40c874(0x1e3)],[SheetCollabCursorRenderController]));}[_0x13b516(0x1fe)](){const _0xdcfdcd=_0x13b516;touchDependencies(this[_0xdcfdcd(0x21e)],[[CollabCursorController],[DesktopCollaborationStatusDisplayController],[CollaborationEntityUIController],[CollaborationClientUIController],[CollaborationDataLoaderController],[FormulaCalculationGuardService]]);if(this['_config'][_0xdcfdcd(0x28e)])touchDependencies(this[_0xdcfdcd(0x21e)],[[FrontendLogController]]);}};_defineProperty(UniverCollaborationClientUIPlugin,_0x13b516(0x177),_0x13b516(0xfa)),_defineProperty(UniverCollaborationClientUIPlugin,_0x13b516(0x19e),name),_defineProperty(UniverCollaborationClientUIPlugin,_0x13b516(0x2af),version),UniverCollaborationClientUIPlugin=__decorate([DependentOn(UniverCollaborationClientPlugin),__decorateParam(0x1,IRenderManagerService),__decorateParam(0x2,Inject(Injector)),__decorateParam(0x3,IConfigService)],UniverCollaborationClientUIPlugin);let BrowserCollaborationSocketService=class BrowserCollaborationSocketService extends CollaborationSocketService{constructor(_0x48862f,_0xe314,_0x3a6eda,_0x2b232a,_0x2dae54){super(_0x48862f,_0xe314,_0x3a6eda,_0x2b232a,_0x2dae54);}async[_0x13b516(0x201)](_0x496ed0){const _0x518bd4=_0x13b516,_0x34868c=await this[_0x518bd4(0x13c)](),_0x5f582a=this[_0x518bd4(0x2e0)](_0x496ed0,_0x34868c);return this['_doCreateSocket'](_0x5f582a);}['_createSocketURL'](_0x274acb,_0x330bb8){const _0x2564e8=_0x13b516,_0x38e162=typeof window===_0x2564e8(0x215)?new URL(_0x274acb):new URL(_0x274acb,window[_0x2564e8(0x113)]['origin']);_0x38e162[_0x2564e8(0x2bf)][_0x2564e8(0x1a5)]('sessionTicket',_0x330bb8);const _0x2978f7=typeof window===_0x2564e8(0x215)?new URLSearchParams():new URLSearchParams(window[_0x2564e8(0x113)][_0x2564e8(0x272)]);return _0x2978f7[_0x2564e8(0x103)](_0x2564e8(0x222))&&_0x38e162[_0x2564e8(0x2bf)][_0x2564e8(0x1a5)]('runId',_0x2978f7[_0x2564e8(0x103)]('runId')),_0x38e162[_0x2564e8(0x245)]();}async[_0x13b516(0x13c)](){const _0x18cc36=_0x13b516;var _0x4fee60,_0x1e0f7b,_0x54d7bd;const _0x5ba4c0=this['_configService'][_0x18cc36(0x11a)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY),_0x52bb95=(_0x4fee60=_0x5ba4c0===null||_0x5ba4c0===void 0x0?void 0x0:_0x5ba4c0[_0x18cc36(0x232)])!==null&&_0x4fee60!==void 0x0?_0x4fee60:DEFAULT_WS_SESSION_TICKET_URL;return(_0x1e0f7b=(_0x54d7bd=(await this[_0x18cc36(0xff)][_0x18cc36(0x103)](_0x52bb95,{'headers':{'Content-Type':_0x18cc36(0x243)}}))[_0x18cc36(0xd8)])===null||_0x54d7bd===void 0x0?void 0x0:_0x54d7bd['ticket'])!==null&&_0x1e0f7b!==void 0x0?_0x1e0f7b:'';}};BrowserCollaborationSocketService=__decorate([__decorateParam(0x0,Inject(Injector)),__decorateParam(0x1,Inject(HTTPService)),__decorateParam(0x2,IConfigService),__decorateParam(0x3,ILogService),__decorateParam(0x4,ISnapshotServerService)],BrowserCollaborationSocketService);let RemoteUniscriptService=class RemoteUniscriptService extends Disposable{constructor(_0x5ea69d,_0x347b44,_0x18ecfc){const _0x34bc32=_0x13b516;super(),this['_instanceService']=_0x5ea69d,this[_0x34bc32(0xff)]=_0x347b44,this['_configService']=_0x18ecfc;}async[_0x13b516(0x2bd)](_0x32a121,_0x5e4ce2,_0x365bd4,..._0x330bec){const _0x5d49bd=_0x13b516;var _0x317bca,_0x111200,_0x19545d,_0x5bd42a;const _0x279401=this['_instanceService'][_0x5d49bd(0x2dd)]();if(!_0x279401)throw new Error('[RemoteUniscriptService]:\x20no\x20focused\x20unit');const _0x93ab03=((_0x317bca=this[_0x5d49bd(0x106)]['getConfig'](REMOTE_UNISCRIPT_EXECUTION_ENDPOINT_KEY))!==null&&_0x317bca!==void 0x0?_0x317bca:DEFAULT_REMOTE_UNISCRIPT_EXECUTION_ENDPOINT)+'/'+_0x32a121+'/run/'+_0x5e4ce2,_0x6d0389={'scriptId':_0x32a121,'runId':(_0x111200=new URL(window['location'][_0x5d49bd(0x19f)])['searchParams'][_0x5d49bd(0x103)]('runId'))!==null&&_0x111200!==void 0x0?_0x111200:'','function':_0x5e4ce2,'unitId':_0x279401[_0x5d49bd(0x1c6)](),'argsOfFunction':JSON[_0x5d49bd(0x2ef)](_0x330bec),'invokeId':(_0x19545d=_0x365bd4[_0x5d49bd(0x14c)])!==null&&_0x19545d!==void 0x0?_0x19545d:'','executionId':(_0x5bd42a=_0x365bd4[_0x5d49bd(0x174)])!==null&&_0x5bd42a!==void 0x0?_0x5bd42a:''};try{const _0x4fb033=await this['_httpService'][_0x5d49bd(0x1dc)](_0x93ab03,{'body':_0x6d0389});if(_0x4fb033['body'][_0x5d49bd(0xd5)]&&_0x4fb033[_0x5d49bd(0xd8)]['error'][_0x5d49bd(0xee)]!==ErrorCode['OK'])return _0x5d49bd(0x112);return _0x4fb033[_0x5d49bd(0xd8)][_0x5d49bd(0x1c1)];}catch{return _0x5d49bd(0x112);}}};RemoteUniscriptService=__decorate([__decorateParam(0x0,IUniverInstanceService),__decorateParam(0x1,Inject(HTTPService)),__decorateParam(0x2,IConfigService)],RemoteUniscriptService);var SingleActiveUnitEventType=function(_0x5d8a38){const _0x2f897a=_0x13b516;return _0x5d8a38[_0x5d8a38['JOIN']=0x0]=_0x2f897a(0x124),_0x5d8a38[_0x5d8a38['LEAVE']=0x1]=_0x2f897a(0x237),_0x5d8a38[_0x5d8a38[_0x2f897a(0x28d)]=0x2]=_0x2f897a(0x28d),_0x5d8a38;}(SingleActiveUnitEventType||{});const HEARTBEAT_INTERVAL=0x7530,ACTIVE_UNIT_EVENT_CHANNEL=_0x13b516(0x27e);var WebBrowserSingleActiveUnitService=class extends Disposable{constructor(){const _0x47413e=_0x13b516;super(),_defineProperty(this,_0x47413e(0x15b),generateRandomId()),_defineProperty(this,_0x47413e(0x2c1),new Set()),_defineProperty(this,_0x47413e(0x1ca),new Map()),_defineProperty(this,_0x47413e(0x1a9),null),_defineProperty(this,'_clearOtherTimers',new Map()),_defineProperty(this,_0x47413e(0x1ba),new Map()),this[_0x47413e(0x1e2)]();}['dispose'](){const _0x20367a=_0x13b516;super[_0x20367a(0x217)](),this[_0x20367a(0xf7)][_0x20367a(0x296)]((_0x532467,_0x14bb66)=>this[_0x20367a(0x1e0)](_0x14bb66));if(this[_0x20367a(0x1a9)])window['clearInterval'](this['_heartbeatTimer']);}[_0x13b516(0x1cd)](_0x260e00){const _0x472ce=_0x13b516;return this[_0x472ce(0x1d8)](_0x260e00)['pipe'](distinctUntilChanged());}[_0x13b516(0x1c9)](_0x8ddeb5){const _0x1ca87e=_0x13b516;if(this[_0x1ca87e(0x2c1)][_0x1ca87e(0x2be)]===0x0)this[_0x1ca87e(0x1c4)]();this[_0x1ca87e(0x2c1)]['add'](_0x8ddeb5),this[_0x1ca87e(0x139)]({'type':SingleActiveUnitEventType[_0x1ca87e(0x124)],'memberID':this[_0x1ca87e(0x15b)],'unitIDs':[_0x8ddeb5],'isForwarded':![]});}['disposeUnit'](_0x20bc1a){const _0x5a32cb=_0x13b516;this[_0x5a32cb(0x2c1)][_0x5a32cb(0x1f7)](_0x20bc1a);if(this[_0x5a32cb(0x2c1)][_0x5a32cb(0x2be)]===0x0&&this[_0x5a32cb(0x1a9)])window[_0x5a32cb(0xe7)](this['_heartbeatTimer']);}['_init'](){const _0xf305f3=_0x13b516;this['disposeWithMe'](toDisposable(fromEvent(window,'storage')['subscribe'](_0x21dd3d=>{const _0x5d20bb=_0xd732;if(_0x21dd3d[_0x5d20bb(0x2b8)]!==ACTIVE_UNIT_EVENT_CHANNEL||!_0x21dd3d[_0x5d20bb(0x2cd)])return;const _0x5d401b=JSON['parse'](_0x21dd3d['newValue']);this[_0x5d20bb(0x22a)](_0x5d401b);}))),window['addEventListener'](_0xf305f3(0x1f8),()=>this[_0xf305f3(0x139)]({'type':SingleActiveUnitEventType[_0xf305f3(0x237)],'memberID':this[_0xf305f3(0x15b)],'unitIDs':Array['from'](this[_0xf305f3(0x2c1)])}));}[_0x13b516(0x22a)](_0x4b4d4b){const _0x3649d3=_0x13b516;switch(_0x4b4d4b[_0x3649d3(0x1f2)]){case SingleActiveUnitEventType[_0x3649d3(0x124)]:this[_0x3649d3(0x26a)](_0x4b4d4b);break;case SingleActiveUnitEventType['LEAVE']:this[_0x3649d3(0x259)](_0x4b4d4b);break;case SingleActiveUnitEventType[_0x3649d3(0x28d)]:this[_0x3649d3(0x2a5)](_0x4b4d4b);break;}}['_handleJoinEvent'](_0x3ed150){const _0x30c59f=_0x13b516,{unitIDs:_0x2ba773,memberID:_0xb80ac0,isForwarded:_0x48e8ec}=_0x3ed150;_0x2ba773[_0x30c59f(0x296)](_0x4769c1=>{const _0x320a14=_0x30c59f;if(!_0x48e8ec&&this[_0x320a14(0x1ca)][_0x320a14(0x17d)](_0x4769c1))this[_0x320a14(0x1d8)](_0x4769c1)[_0x320a14(0x107)](UnitStatus[_0x320a14(0x2d5)]);if(!this['_unitOnClients'][_0x320a14(0x17d)](_0x4769c1)||!this['_unitOnClients'][_0x320a14(0x103)](_0x4769c1)['has'](_0xb80ac0)){const _0x3e9627=this[_0x320a14(0x1ca)]['get'](_0x4769c1)||new Set();_0x3e9627['add'](_0xb80ac0),this[_0x320a14(0x1ca)][_0x320a14(0x1a5)](_0x4769c1,_0x3e9627),this[_0x320a14(0x291)](_0xb80ac0);}});if(!_0x48e8ec)this['_send']({'type':SingleActiveUnitEventType[_0x30c59f(0x124)],'memberID':this[_0x30c59f(0x15b)],'unitIDs':[...this[_0x30c59f(0x2c1)]],'isForwarded':!![]});}[_0x13b516(0x291)](_0x8a9554){const _0x3dd1fc=_0x13b516;this[_0x3dd1fc(0x1e0)](_0x8a9554);const _0x2bb782=window[_0x3dd1fc(0x2ba)](()=>{const _0x1dd2b7=_0x3dd1fc;this[_0x1dd2b7(0x1ca)][_0x1dd2b7(0x296)](_0x11c4ac=>{const _0x4140a0=_0x1dd2b7;_0x11c4ac[_0x4140a0(0x1f7)](_0x8a9554);});},HEARTBEAT_INTERVAL*0x2);this[_0x3dd1fc(0xf7)][_0x3dd1fc(0x1a5)](_0x8a9554,_0x2bb782);}[_0x13b516(0x1e0)](_0x302d93){const _0x444ecb=_0x13b516;if(this[_0x444ecb(0xf7)]['has'](_0x302d93)){const _0xbfaa24=this[_0x444ecb(0xf7)]['get'](_0x302d93);if(_0xbfaa24)window[_0x444ecb(0x100)](_0xbfaa24);this[_0x444ecb(0xf7)]['set'](_0x302d93,null);}}[_0x13b516(0x259)](_0x1dfd2d){const _0x15e28b=_0x13b516,{memberID:_0x4405d6,unitIDs:_0x198bd6}=_0x1dfd2d;_0x198bd6[_0x15e28b(0x296)](_0x570c49=>{const _0x281929=_0x15e28b;var _0x3eacfd;const _0x5d5392=this['_unitOnClients'][_0x281929(0x103)](_0x570c49);if(!_0x5d5392)return;_0x5d5392['delete'](_0x4405d6),(_0x3eacfd=this[_0x281929(0x1d8)](_0x570c49))===null||_0x3eacfd===void 0x0||_0x3eacfd['next'](_0x5d5392[_0x281929(0x2be)]===0x0?UnitStatus[_0x281929(0x22c)]:UnitStatus[_0x281929(0x2d5)]);}),this[_0x15e28b(0x1e0)](_0x4405d6);}[_0x13b516(0x2a5)](_0x273a81){const _0x53ef08=_0x13b516;this[_0x53ef08(0x291)](_0x273a81['memberID']);}[_0x13b516(0x139)](_0x4dfe41){const _0xa8368b=_0x13b516;localStorage[_0xa8368b(0x145)](ACTIVE_UNIT_EVENT_CHANNEL,JSON[_0xa8368b(0x2ef)](_0x4dfe41));}[_0x13b516(0x1c4)](){const _0x64bf0e=_0x13b516;this[_0x64bf0e(0x1a9)]=window[_0x64bf0e(0x1f5)](()=>{const _0x4503a8=_0x64bf0e;this['_send']({'type':SingleActiveUnitEventType[_0x4503a8(0x28d)],'memberID':this[_0x4503a8(0x15b)]});},HEARTBEAT_INTERVAL);}['_ensureSubject'](_0x26fa75){const _0x3f0181=_0x13b516;if(!this[_0x3f0181(0x1ba)]['has'](_0x26fa75))this['_unitStatus'][_0x3f0181(0x1a5)](_0x26fa75,new BehaviorSubject(UnitStatus[_0x3f0181(0x22c)]));return this[_0x3f0181(0x1ba)][_0x3f0181(0x103)](_0x26fa75);}};export{BrowserCollaborationSocketService,CollaborationDataLoaderController,DesktopCollaborationStatusDisplayController,IURLService,RemoteUniscriptService,SheetCollabCursorShape,UniverCollaborationClientUIPlugin,WebBrowserSingleActiveUnitService,WebURLService};
1
+ const _0x1222a9=_0x2f58;(function(_0xa981a3,_0x10919f){const _0x37fee1=_0x2f58,_0x4656b4=_0xa981a3();while(!![]){try{const _0x992ae9=parseInt(_0x37fee1(0x335))/0x1*(parseInt(_0x37fee1(0x349))/0x2)+parseInt(_0x37fee1(0x375))/0x3+-parseInt(_0x37fee1(0x22b))/0x4*(parseInt(_0x37fee1(0x283))/0x5)+-parseInt(_0x37fee1(0x27a))/0x6*(parseInt(_0x37fee1(0x2f3))/0x7)+-parseInt(_0x37fee1(0x23e))/0x8*(parseInt(_0x37fee1(0x2e7))/0x9)+parseInt(_0x37fee1(0x2ba))/0xa*(parseInt(_0x37fee1(0x2b7))/0xb)+parseInt(_0x37fee1(0x1f0))/0xc*(parseInt(_0x37fee1(0x3ff))/0xd);if(_0x992ae9===_0x10919f)break;else _0x4656b4['push'](_0x4656b4['shift']());}catch(_0x37eba5){_0x4656b4['push'](_0x4656b4['shift']());}}}(_0x1895,0x7cc4e));import{COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY,CollaborationController,CollaborationSessionService,CollaborationSocketService,CollaborationStatus,CollaborationUIEventId,CollaborationUIEventService,DEFAULT_REMOTE_UNISCRIPT_EXECUTION_ENDPOINT,DEFAULT_WS_SESSION_TICKET_URL,DataLoaderService,DocCollaborationEntity,ILocalCacheService,LOCAL_CACHE_INTERVAL,LOCAL_CACHE_INTERVAL_KEY,MemberService,REMOTE_UNISCRIPT_EXECUTION_ENDPOINT_KEY,SessionStatus,UnitStatus,UniverCollaborationClientPlugin,getLocalCacheKey}from'@univerjs-pro/collaboration-client';import{COLORS,CanceledError,ColorKit,CommandType,DOC_RANGE_TYPE,DependentOn,Disposable,DisposableCollection,ICommandService,IConfigService,ILocalStorageService,ILogService,IUniverInstanceService,Inject,Injector,LocaleService,Optional,Plugin,Rectangle,RxDisposable,ThemeService,Tools,UniverInstanceType,Workbook,createIdentifier,debounce,fromEventSubject,generateRandomId,isFormulaId,isFormulaString,merge,mergeOverrideWithDependencies,registerDependencies,toDisposable,touchDependencies}from'@univerjs/core';import{BuiltInUIPart,IBeforeCloseService,IMessageService,INotificationService,IUIPartsService,connectInjector,useDependency,useObservable}from'@univerjs/ui';import{BehaviorSubject,Subject,combineLatest,debounceTime,distinctUntilChanged,filter,fromEvent,mapTo,merge as _0x47a541,of,shareReplay,switchMap,takeUntil}from'rxjs';import{MessageType,Tooltip,clsx}from'@univerjs/design';import{LoadingMultiIcon,OffLineIcon,OnLineIcon}from'@univerjs/icons';import{useCallback,useMemo}from'react';import{jsx}from'react/jsx-runtime';import{IRemoteInstanceService}from'@univerjs/rpc';import{EffectRefRangId,RefRangeService,SetSelectionsOperation,SetWorksheetActivateCommand,SheetsSelectionsService,handleDeleteRangeMoveLeft,handleDeleteRangeMoveUp,handleIRemoveCol,handleIRemoveRow,handleInsertCol,handleInsertRangeMoveDown,handleInsertRangeMoveRight,handleInsertRow,handleMoveRange,runRefRangeMutations}from'@univerjs/sheets';import{IRenderManagerService,Rect,RegularPolygon,SHEET_VIEWPORT_KEY,Shape,TRANSFORM_CHANGE_OBSERVABLE_TYPE,Vector2,getColor}from'@univerjs/engine-render';import{HTTPService,ISocketService,WebSocketService}from'@univerjs/network';import{DocIMEInputManagerService,DocStateChangeManagerService,IDocClipboardService,NodePositionConvertToCursor,NodePositionConvertToRectRange,SetDocZoomRatioOperation,TEXT_RANGE_LAYER_INDEX}from'@univerjs/docs-ui';import{IImageIoService}from'@univerjs/drawing';import{CollaborationEvent,ISnapshotServerService,ITransformService,RevisionService,isTransformMutationFailure,isTransformMutationsWithChangesetSuccess}from'@univerjs-pro/collaboration';import{DocSelectionManagerService,DocSkeletonManagerService,RichTextEditingMutation,SetTextSelectionsOperation}from'@univerjs/docs';import{FormulaExecuteStageType,FormulaExecutedStateType,SetFormulaCalculationNotificationMutation,SetFormulaCalculationStartMutation,deserializeRangeWithSheet,serializeRangeWithSheet}from'@univerjs/engine-formula';import{filter as _0x454b35,map,switchMap as _0x5f06ec,takeUntil as _0x4f9116,throttleTime}from'rxjs/operators';import{SheetSkeletonManagerService,getCoordByCell,getSheetObject}from'@univerjs/sheets-ui';import{ErrorCode}from'@univerjs/protocol';function getStatusConfig(_0x26c933){const _0x3669a5=_0x2f58;switch(_0x26c933){case CollaborationStatus['OFFLINE']:return{'icon':jsx(OffLineIcon,{}),'colorClass':_0x3669a5(0x362),'i18nKey':'collabStatus.offline','tooltipKey':_0x3669a5(0x2f8),'clickable':!![],'indicator':_0x3669a5(0x3f6)};case CollaborationStatus[_0x3669a5(0x254)]:return{'icon':jsx(OffLineIcon,{}),'colorClass':_0x3669a5(0x3b1),'i18nKey':_0x3669a5(0x399),'clickable':![],'indicator':_0x3669a5(0x3f6)};case CollaborationStatus['FETCH_MISS']:return{'icon':jsx(LoadingMultiIcon,{}),'colorClass':_0x3669a5(0x3a9),'i18nKey':_0x3669a5(0x30f),'clickable':![],'indicator':_0x3669a5(0x350)};case CollaborationStatus['NOT_COLLAB']:return{'icon':jsx(OnLineIcon,{}),'colorClass':'univer-text-gray-400','i18nKey':_0x3669a5(0x3f5),'clickable':![],'indicator':_0x3669a5(0x3f6)};case CollaborationStatus[_0x3669a5(0x405)]:case CollaborationStatus[_0x3669a5(0x337)]:return{'icon':jsx(LoadingMultiIcon,{}),'colorClass':_0x3669a5(0x3a9),'i18nKey':_0x3669a5(0x221),'clickable':![],'indicator':'spin'};case CollaborationStatus[_0x3669a5(0x312)]:case CollaborationStatus[_0x3669a5(0x2c7)]:return{'icon':jsx(OnLineIcon,{}),'colorClass':_0x3669a5(0x365),'i18nKey':_0x3669a5(0x34c),'clickable':![],'indicator':'static'};}}function CollaborationStatusDisplay(_0x3254a5){const _0x4b662c=_0x2f58,{status$:_0x4f9e46}=_0x3254a5,_0x20f776=useObservable(_0x4f9e46,CollaborationStatus[_0x4b662c(0x207)]),_0x334675=useDependency(LocaleService),_0x2a0b2f=useDependency(CollaborationSessionService),_0x398af1=useMemo(()=>getStatusConfig(_0x20f776),[_0x20f776]),_0x5d66e3=_0x20f776!==CollaborationStatus[_0x4b662c(0x3e6)],_0x3576ea=_0x334675['t'](_0x398af1['i18nKey']),_0x58912e=_0x398af1[_0x4b662c(0x274)]?_0x334675['t'](_0x398af1['tooltipKey']):_0x3576ea,_0x5ac4ea=useCallback(()=>{if(!_0x5d66e3)_0x2a0b2f['reconnect']();},[_0x5d66e3,_0x2a0b2f]),_0x4bd1c8=useCallback(_0x3f8a43=>{const _0x3bd424=_0x4b662c;!_0x5d66e3&&(_0x3f8a43[_0x3bd424(0x3cc)]==='Enter'||_0x3f8a43[_0x3bd424(0x3cc)]==='\x20')&&(_0x3f8a43[_0x3bd424(0x3ab)](),_0x2a0b2f[_0x3bd424(0x244)]());},[_0x5d66e3,_0x2a0b2f]),_0x42f6e0=jsx(_0x4b662c(0x249),{'className':clsx('univer-flex\x20univer-items-center\x20univer-justify-center',_0x4b662c(0x3a0),_0x398af1[_0x4b662c(0x412)],{'univer-animate-spin':_0x398af1[_0x4b662c(0x3f9)]===_0x4b662c(0x350),'univer-animate-pulse':_0x398af1[_0x4b662c(0x3f9)]==='pulse'}),'aria-hidden':_0x4b662c(0x37b),'children':_0x398af1[_0x4b662c(0x358)]}),_0x4737ef=jsx(_0x4b662c(0x249),{'className':clsx(_0x4b662c(0x20e),_0x4b662c(0x217),_0x4b662c(0x314),_0x4b662c(0x3ae),_0x4b662c(0x3a8),{'univer-cursor-pointer\x20hover:univer-bg-gray-100\x20dark:hover:univer-bg-gray-700':_0x398af1[_0x4b662c(0x363)],'univer-cursor-default':!_0x398af1[_0x4b662c(0x363)]}),'children':_0x42f6e0});if(_0x398af1['clickable'])return jsx(Tooltip,{'title':_0x58912e,'placement':_0x4b662c(0x3d2),'children':jsx('button',{'type':_0x4b662c(0x2b1),'onClick':_0x5ac4ea,'onKeyDown':_0x4bd1c8,'className':clsx(_0x4b662c(0x411),_0x4b662c(0x3e1),_0x4b662c(0x33e),'univer-appearance-none'),'aria-label':_0x3576ea+_0x4b662c(0x34a)+_0x58912e,'role':_0x4b662c(0x23a),'aria-live':_0x4b662c(0x2ff),'aria-atomic':'true','children':_0x4737ef})});return jsx(Tooltip,{'title':_0x58912e,'placement':_0x4b662c(0x3d2),'children':jsx('div',{'className':clsx(_0x4b662c(0x411),_0x4b662c(0x3e1),_0x4b662c(0x33e)),'aria-label':_0x3576ea,'role':_0x4b662c(0x23a),'aria-live':'polite','aria-atomic':_0x4b662c(0x37b),'children':_0x4737ef})});}function _typeof(_0x175ae2){'@babel/helpers - typeof';const _0x2343fe=_0x2f58;return _typeof='function'==typeof Symbol&&_0x2343fe(0x260)==typeof Symbol[_0x2343fe(0x292)]?function(_0x2eba3f){return typeof _0x2eba3f;}:function(_0x41fdeb){const _0x332512=_0x2343fe;return _0x41fdeb&&_0x332512(0x250)==typeof Symbol&&_0x41fdeb[_0x332512(0x220)]===Symbol&&_0x41fdeb!==Symbol['prototype']?'symbol':typeof _0x41fdeb;},_typeof(_0x175ae2);}function toPrimitive(_0x585bc5,_0x364ad0){const _0x55a40d=_0x2f58;if(_0x55a40d(0x203)!=_typeof(_0x585bc5)||!_0x585bc5)return _0x585bc5;var _0xce16f7=_0x585bc5[Symbol[_0x55a40d(0x2b9)]];if(void 0x0!==_0xce16f7){var _0x5b28a9=_0xce16f7[_0x55a40d(0x33f)](_0x585bc5,_0x364ad0||_0x55a40d(0x2c3));if(_0x55a40d(0x203)!=_typeof(_0x5b28a9))return _0x5b28a9;throw new TypeError(_0x55a40d(0x24b));}return(_0x55a40d(0x309)===_0x364ad0?String:Number)(_0x585bc5);}function toPropertyKey(_0x3dda3f){const _0x5baf96=_0x2f58;var _0x14793f=toPrimitive(_0x3dda3f,_0x5baf96(0x309));return _0x5baf96(0x260)==_typeof(_0x14793f)?_0x14793f:_0x14793f+'';}function _defineProperty(_0x167149,_0xc89ccc,_0x4c2ab2){return(_0xc89ccc=toPropertyKey(_0xc89ccc))in _0x167149?Object['defineProperty'](_0x167149,_0xc89ccc,{'value':_0x4c2ab2,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x167149[_0xc89ccc]=_0x4c2ab2,_0x167149;}function __decorateParam(_0x14a185,_0xa82173){return function(_0x4e6366,_0x41e4fb){_0xa82173(_0x4e6366,_0x41e4fb,_0x14a185);};}function __decorate(_0x47251b,_0x5e2233,_0xb3354d,_0x984cf9){const _0x287f84=_0x2f58;var _0x3a695a=arguments[_0x287f84(0x2c1)],_0x521a5e=_0x3a695a<0x3?_0x5e2233:_0x984cf9===null?_0x984cf9=Object[_0x287f84(0x336)](_0x5e2233,_0xb3354d):_0x984cf9,_0x45d760;if(typeof Reflect==='object'&&typeof Reflect[_0x287f84(0x285)]===_0x287f84(0x250))_0x521a5e=Reflect[_0x287f84(0x285)](_0x47251b,_0x5e2233,_0xb3354d,_0x984cf9);else{for(var _0x598a43=_0x47251b[_0x287f84(0x2c1)]-0x1;_0x598a43>=0x0;_0x598a43--)if(_0x45d760=_0x47251b[_0x598a43])_0x521a5e=(_0x3a695a<0x3?_0x45d760(_0x521a5e):_0x3a695a>0x3?_0x45d760(_0x5e2233,_0xb3354d,_0x521a5e):_0x45d760(_0x5e2233,_0xb3354d))||_0x521a5e;}return _0x3a695a>0x3&&_0x521a5e&&Object[_0x287f84(0x409)](_0x5e2233,_0xb3354d,_0x521a5e),_0x521a5e;}let DesktopCollaborationStatusDisplayController=class DesktopCollaborationStatusDisplayController extends Disposable{constructor(_0x1545ff,_0x59d528,_0x390bb4,_0x14edc8){const _0x214bd7=_0x2f58;super(),this['_univerInstanceService']=_0x1545ff,this[_0x214bd7(0x21b)]=_0x59d528,this['_collaborationController']=_0x390bb4,this[_0x214bd7(0x276)]=_0x14edc8,_defineProperty(this,'_status$',new BehaviorSubject(CollaborationStatus[_0x214bd7(0x207)])),this['_initStatusComponent'](),this[_0x214bd7(0x31c)]();}[_0x1222a9(0x31c)](){const _0x570060=_0x1222a9;this[_0x570060(0x3e4)](this[_0x570060(0x239)][_0x570060(0x386)]['pipe'](switchMap(()=>{const _0x3b9f39=_0x570060,_0x3c4197=this[_0x3b9f39(0x239)][_0x3b9f39(0x24d)]();if(_0x3c4197)return this[_0x3b9f39(0x3d6)][_0x3b9f39(0x3dc)](_0x3c4197[_0x3b9f39(0x22a)]());return of(null);}),switchMap(_0x315902=>{const _0x18d90d=_0x570060;if(_0x315902)return _0x315902[_0x18d90d(0x398)];return of(CollaborationStatus[_0x18d90d(0x207)]);}))['subscribe'](_0x4a9590=>{const _0x2ecadf=_0x570060;this[_0x2ecadf(0x2e6)][_0x2ecadf(0x266)](_0x4a9590);}));}[_0x1222a9(0x2a8)](){const _0x2388e1=_0x1222a9;this['disposeWithMe'](this[_0x2388e1(0x276)][_0x2388e1(0x26e)](BuiltInUIPart['HEADER_MENU'],()=>connectInjector(passProps({'status$':this[_0x2388e1(0x2e6)][_0x2388e1(0x2d2)]()}),this[_0x2388e1(0x21b)])));}};DesktopCollaborationStatusDisplayController=__decorate([__decorateParam(0x0,IUniverInstanceService),__decorateParam(0x1,Inject(Injector)),__decorateParam(0x2,Inject(CollaborationController)),__decorateParam(0x3,IUIPartsService)],DesktopCollaborationStatusDisplayController);function passProps(_0x253b85){const {status$:_0x549b00}=_0x253b85;return function _0x1275e0(){return jsx(CollaborationStatusDisplay,{'status$':_0x549b00});};}const IURLService=createIdentifier(_0x1222a9(0x2c0));let CollaborationDataLoaderController=class CollaborationDataLoaderController extends RxDisposable{constructor(_0x5d5c36,_0x4e2708,_0x235f88,_0x2d2692,_0xec8199){const _0x300f6f=_0x1222a9;super(),this['_urlService']=_0x5d5c36,this['_logService']=_0x4e2708,this[_0x300f6f(0x23f)]=_0x235f88,this[_0x300f6f(0x36b)]=_0x2d2692;if(_0xec8199)_0xec8199===null||_0xec8199===void 0x0||_0xec8199['whenReady']()['then'](()=>this[_0x300f6f(0x338)]());else this[_0x300f6f(0x38a)]['debug'](_0x300f6f(0x3fc),_0x300f6f(0x1ef)),this[_0x300f6f(0x338)]();}async[_0x1222a9(0x338)](){const _0xac5244=_0x1222a9,_0x16f202=this[_0xac5244(0x36e)]['getParam']('unit'),_0x456aa9=this[_0xac5244(0x36e)][_0xac5244(0x370)](_0xac5244(0x24e)),_0x194860=this['_urlService'][_0xac5244(0x370)](_0xac5244(0x228));if(!_0x16f202||!_0x456aa9){this[_0xac5244(0x38a)][_0xac5244(0x1e1)](_0xac5244(0x3fc),'No\x20unitID\x20or\x20type\x20in\x20URL.\x20Will\x20not\x20load\x20files\x20from\x20remote\x20address.');return;}const _0x223692=await this['_dataLoaderService'][_0xac5244(0x258)](_0x16f202,Number(_0x456aa9),_0x194860);if(_0x223692&&_0x223692 instanceof Workbook)this[_0xac5244(0x261)](_0x223692);}async['_setupSubUnitSync'](_0xffafe6){const _0x2ffaae=_0x1222a9;await this[_0x2ffaae(0x22d)](_0xffafe6),_0xffafe6[_0x2ffaae(0x307)]['pipe'](takeUntil(this[_0x2ffaae(0x381)]))['subscribe'](_0x4e7ff5=>{const _0x47b001=_0x2ffaae;if(_0x4e7ff5)this[_0x47b001(0x2f1)](_0x4e7ff5);}),this[_0x2ffaae(0x36e)]['urlChange$']['pipe'](takeUntil(this[_0x2ffaae(0x381)]))[_0x2ffaae(0x3a1)](()=>this['_updateSubUnitFromURLParams'](_0xffafe6));}[_0x1222a9(0x2f1)](_0xc1a4b1,_0x229296=![]){const _0x1e8d17=_0x1222a9,_0x28a75e=this[_0x1e8d17(0x36e)][_0x1e8d17(0x370)](_0x1e8d17(0x228));if(_0xc1a4b1[_0x1e8d17(0x286)]()!==_0x28a75e)this['_urlService'][_0x1e8d17(0x2fb)](_0x1e8d17(0x228),_0xc1a4b1[_0x1e8d17(0x286)](),_0x229296);}async[_0x1222a9(0x22d)](_0x838711){const _0x9909d1=_0x1222a9;var _0x4fb1a7;const _0x786514=this[_0x9909d1(0x36e)][_0x9909d1(0x370)](_0x9909d1(0x228));if(!_0x786514||!_0x838711['getSheetBySheetId'](_0x786514)){const _0x468fb2=_0x838711['getUnhiddenWorksheets']()[0x0],_0x447d03=_0x838711[_0x9909d1(0x3dd)](_0x468fb2);if(!_0x447d03)return;this['_updateURLWithCurrentState'](_0x447d03,!![]),await this[_0x9909d1(0x23f)][_0x9909d1(0x3de)](SetWorksheetActivateCommand['id'],{'unitId':_0x838711[_0x9909d1(0x22a)](),'subUnitId':_0x468fb2});return;}if(((_0x4fb1a7=_0x838711[_0x9909d1(0x3e7)]())===null||_0x4fb1a7===void 0x0?void 0x0:_0x4fb1a7[_0x9909d1(0x286)]())===_0x786514)return;await this[_0x9909d1(0x23f)]['executeCommand'](SetWorksheetActivateCommand['id'],{'unitId':_0x838711[_0x9909d1(0x22a)](),'subUnitId':_0x786514});}};CollaborationDataLoaderController=__decorate([__decorateParam(0x0,IURLService),__decorateParam(0x1,ILogService),__decorateParam(0x2,ICommandService),__decorateParam(0x3,Inject(DataLoaderService)),__decorateParam(0x4,Optional(IRemoteInstanceService))],CollaborationDataLoaderController);var name='@univerjs-pro/collaboration-client-ui',version=_0x1222a9(0x3c7);let ImagePasteController=class ImagePasteController extends RxDisposable{constructor(_0x37522d,_0x569c40){const _0x1c9191=_0x1222a9;super(),this[_0x1c9191(0x3a4)]=_0x37522d,this['_imageIoService']=_0x569c40,this[_0x1c9191(0x338)]();}['_init'](){const _0x3342c4=_0x1222a9,_0x387312=this;this['disposeWithMe'](this[_0x3342c4(0x3a4)][_0x3342c4(0x2e2)]({'onBeforePasteImage':async _0x1977bb=>{const _0x1f5167=_0x3342c4,_0x1d5f8c=await _0x387312[_0x1f5167(0x21d)][_0x1f5167(0x330)](_0x1977bb);if(_0x1d5f8c)return{'source':_0x1d5f8c[_0x1f5167(0x263)],'imageSourceType':_0x1d5f8c[_0x1f5167(0x3ea)]};return null;}}));}};ImagePasteController=__decorate([__decorateParam(0x0,IDocClipboardService),__decorateParam(0x1,IImageIoService)],ImagePasteController);const BACKGROUND_TOKENS=[_0x1222a9(0x1e2),_0x1222a9(0x3e3),_0x1222a9(0x3e8),_0x1222a9(0x39a),'blue.400','yellow.400'];var ColorAssignService=class extends Disposable{constructor(..._0x1f58f3){const _0x586a62=_0x1222a9;super(..._0x1f58f3),_defineProperty(this,_0x586a62(0x248),new Map()),_defineProperty(this,_0x586a62(0x3e9),0x0);}['assignAColorForMemberID'](_0x2560f5){const _0x4802f8=_0x1222a9;if(this[_0x4802f8(0x248)][_0x4802f8(0x3fd)](_0x2560f5))return this[_0x4802f8(0x248)]['get'](_0x2560f5);const _0x29f1b0=BACKGROUND_TOKENS[this[_0x4802f8(0x3e9)]];return this[_0x4802f8(0x3e9)]=(this[_0x4802f8(0x3e9)]+0x1)%BACKGROUND_TOKENS[_0x4802f8(0x2c1)],this['_assignedColors']['set'](_0x2560f5,_0x29f1b0),_0x29f1b0;}};function serializeDocTextRanges(_0x274bea){const _0x213a67=_0x1222a9;let _0x32f53f='';for(const _0x324a7e of _0x274bea){const {startOffset:_0x215b93,endOffset:_0x505c44,isActive:_0x57a602,rangeType:_0x34d03d,segmentId:_0xae0dd3,segmentPage:_0x258b5f}=_0x324a7e;if(_0x32f53f[_0x213a67(0x2c1)])_0x32f53f+=',';_0x32f53f+=_0x215b93+':'+_0x505c44+':'+(_0x57a602?'1':'0')+':'+_0x34d03d+':'+_0xae0dd3+':'+_0x258b5f;}return _0x32f53f;}function deserializeDocTextRanges(_0x184562){const _0x40d2c2=_0x1222a9,_0x2a1aef=_0x184562[_0x40d2c2(0x39f)](','),_0x5c2eaa=[];for(const _0x516ee0 of _0x2a1aef){const [_0x3b3f19,_0xa4ad0b,_0x1c2560,_0x161416,_0x5df5fd,_0xf1f9d5]=_0x516ee0[_0x40d2c2(0x39f)](':');_0x5c2eaa[_0x40d2c2(0x29a)]({'startOffset':Number(_0x3b3f19),'endOffset':Number(_0xa4ad0b),'collapsed':_0x3b3f19===_0xa4ad0b,'isActive':_0x1c2560==='1','rangeType':_0x161416===DOC_RANGE_TYPE['TEXT']?DOC_RANGE_TYPE[_0x40d2c2(0x20c)]:DOC_RANGE_TYPE['RECT'],'segmentId':typeof _0x5df5fd===_0x40d2c2(0x309)?String(_0x5df5fd):'','segmentPage':Number(_0xf1f9d5!==null&&_0xf1f9d5!==void 0x0?_0xf1f9d5:-0x1)});}if(!_0x5c2eaa[_0x40d2c2(0x2cd)](_0x463d5f=>_0x463d5f[_0x40d2c2(0x3e0)]))_0x5c2eaa[0x0]['isActive']=!![];return _0x5c2eaa;}var DocSyncEditingCollabCursorService=class extends RxDisposable{constructor(..._0x43cd19){const _0x24659a=_0x1222a9;super(..._0x43cd19),_defineProperty(this,'_collabCursorState$',new BehaviorSubject(null)),_defineProperty(this,_0x24659a(0x216),this[_0x24659a(0x1fb)][_0x24659a(0x2d2)]());}[_0x1222a9(0x2ae)](_0xe5a0a5){const _0x5303bb=_0x1222a9,{unitID:_0x210e39,memberID:_0x58caee,textRanges:_0x487650}=_0xe5a0a5,_0x105f02=serializeDocTextRanges(_0x487650);if(_0x105f02==='')return;const _0x6886cd={'unitID':_0x210e39,'memberID':_0x58caee,'selection':_0x105f02};this[_0x5303bb(0x1fb)][_0x5303bb(0x266)](_0x6886cd);}};const DEBOUNCE_TIME$1=0x12c,SHARE_LOCAL_DEBOUNCE_TIME$1=0x64;let DocCollabCursorEntity=class DocCollabCursorEntity extends RxDisposable{get[_0x1222a9(0x331)](){const _0x3bd117=_0x1222a9;return this['_cursorInfo$'][_0x3bd117(0x1e5)]();}get[_0x1222a9(0x342)](){const _0xaa1a73=_0x1222a9;return this[_0xaa1a73(0x40b)][_0xaa1a73(0x1e5)]();}constructor(_0x4f6ed0,_0x4a9051,_0x5a8b6a,_0xf63a96,_0x2f5649,_0xdb755c,_0x28329f,_0xbd3baf,_0x39e155){const _0x16136e=_0x1222a9;super(),this[_0x16136e(0x3eb)]=_0x4f6ed0,this[_0x16136e(0x2bb)]=_0x4a9051,this[_0x16136e(0x21b)]=_0x5a8b6a,this['_colorAssignService']=_0xf63a96,this[_0x16136e(0x2ed)]=_0x2f5649,this['_syncEditingCollabCursorService']=_0xdb755c,this[_0x16136e(0x352)]=_0x28329f,this[_0x16136e(0x239)]=_0xbd3baf,this['_commandService']=_0x39e155,_defineProperty(this,_0x16136e(0x1e8),![]),_defineProperty(this,_0x16136e(0x338),![]),_defineProperty(this,'_cursorInfo$',new BehaviorSubject(new Map())),_defineProperty(this,_0x16136e(0x2b0),this[_0x16136e(0x3ce)][_0x16136e(0x2d2)]()),_defineProperty(this,_0x16136e(0x40b),new BehaviorSubject([])),_defineProperty(this,_0x16136e(0x297),this[_0x16136e(0x40b)][_0x16136e(0x31b)](debounceTime(DEBOUNCE_TIME$1))),_defineProperty(this,_0x16136e(0x2ab),debounce(_0x37a38b=>{const _0x6348c0=_0x16136e,_0x27e26d={'eventID':CollaborationEvent[_0x6348c0(0x2cc)],'data':{'unitID':this[_0x6348c0(0x3eb)],'memberID':this[_0x6348c0(0x2bb)][_0x6348c0(0x33b)](),'selection':serializeDocTextRanges(_0x37a38b)}};this[_0x6348c0(0x2bb)][_0x6348c0(0x38f)](_0x27e26d,this['unitID']);},SHARE_LOCAL_DEBOUNCE_TIME$1));}[_0x1222a9(0x23d)](){const _0x1a30c9=_0x1222a9;super[_0x1a30c9(0x23d)](),this['_cursorInfo$']['next'](new Map()),this['_cursorInfo$'][_0x1a30c9(0x40d)](),this['_roomMembers$'][_0x1a30c9(0x266)]([]),this['_roomMembers$'][_0x1a30c9(0x40d)]();}[_0x1222a9(0x2a3)](){const _0x187783=_0x1222a9;if(this[_0x187783(0x338)])return;this[_0x187783(0x338)]=!![],this[_0x187783(0x2bb)]['sessionStatus$']['pipe'](takeUntil(this[_0x187783(0x381)]))[_0x187783(0x3a1)](_0x20b960=>{const _0x221d9e=_0x187783;if(_0x20b960===SessionStatus[_0x221d9e(0x1fa)])this[_0x221d9e(0x3b9)]();else this[_0x221d9e(0x30e)]();}),this['_session']['event$'][_0x187783(0x31b)](takeUntil(this['dispose$']))[_0x187783(0x3a1)](_0x2b072a=>{const _0x4289a0=_0x187783,_0x5cbcf8=_0x2b072a[_0x4289a0(0x34e)];if(_0x5cbcf8===CollaborationEvent[_0x4289a0(0x2cc)])this['_onCursorUpdate'](_0x2b072a);if(_0x5cbcf8===CollaborationEvent[_0x4289a0(0x1f2)])this[_0x4289a0(0x30c)](_0x2b072a);}),this[_0x187783(0x3e4)](this[_0x187783(0x23f)]['onCommandExecuted'](_0x1a6c00=>{const _0x5db2ba=_0x187783,_0x316892=_0x1a6c00[_0x5db2ba(0x3ec)];if(_0x316892==null)return;if(this[_0x5db2ba(0x1e8)]&&_0x1a6c00['id']===SetTextSelectionsOperation['id']&&_0x316892['unitId']===this['unitID']&&_0x316892[_0x5db2ba(0x39e)]===![]&&_0x316892['ranges'][_0x5db2ba(0x2c1)]>0x0)this['_updateLocalCursor'](_0x316892['ranges']);})),this[_0x187783(0x281)]['collabCursorState$'][_0x187783(0x31b)](takeUntil(this['dispose$']))[_0x187783(0x3a1)](_0x53e603=>{const _0x5be045=_0x187783;if((_0x53e603===null||_0x53e603===void 0x0?void 0x0:_0x53e603[_0x5be045(0x3eb)])!==this['unitID'])return;const _0x1edea5={'eventID':CollaborationEvent[_0x5be045(0x2cc)],'data':_0x53e603};this['_onCursorUpdate'](_0x1edea5);}),this[_0x187783(0x3e4)](this['_commandService'][_0x187783(0x37c)](_0x1d5a85=>{const _0x3096da=_0x187783;if(_0x1d5a85[_0x3096da(0x3ec)]==null)return;const _0x5e97a6=_0x1d5a85[_0x3096da(0x3ec)];if(_0x1d5a85['id']!==RichTextEditingMutation['id']||_0x5e97a6['unitId']!==this[_0x3096da(0x3eb)])return;const _0x2e8e5d={'id':'doc.mutation.rich-text-editing','params':_0x5e97a6},_0x375b99=this[_0x3096da(0x331)];for(const [_0xfeff6,_0x56857b]of _0x375b99){const _0x3b7b40={'id':_0x3096da(0x2e0),'params':{'unitId':this[_0x3096da(0x3eb)],'actions':null,'textRanges':_0x56857b[_0x3096da(0x27d)]}},_0x498bb1=this[_0x3096da(0x352)][_0x3096da(0x3f4)](_0x2e8e5d,_0x3b7b40,![]);if(isTransformMutationFailure(_0x498bb1))throw _0x498bb1[_0x3096da(0x3c0)];_0x375b99[_0x3096da(0x37a)](_0xfeff6,{..._0x56857b,'ranges':_0x498bb1[_0x3096da(0x359)][_0x3096da(0x3ec)][_0x3096da(0x290)]});}queueMicrotask(()=>{const _0x295e7c=_0x3096da;this[_0x295e7c(0x3ce)][_0x295e7c(0x266)](_0x375b99);});}));}[_0x1222a9(0x22c)](_0x2aa957){const _0x5d2b8d=_0x1222a9;var _0x543d01,_0x48b0d5;const {memberID:_0x485000,selection:_0x417834}=_0x2aa957[_0x5d2b8d(0x2c9)],_0xdc3118=deserializeDocTextRanges(_0x417834),_0x2daa1c=(_0x543d01=(_0x48b0d5=this[_0x5d2b8d(0x2ed)][_0x5d2b8d(0x28d)](this[_0x5d2b8d(0x3eb)],_0x485000))===null||_0x48b0d5===void 0x0?void 0x0:_0x48b0d5['name'])!==null&&_0x543d01!==void 0x0?_0x543d01:_0x5d2b8d(0x282),_0x1234eb={'color':this['_colorAssignService'][_0x5d2b8d(0x2a4)](_0x485000),'name':_0x2daa1c,'ranges':_0xdc3118},_0xecc9f2=this[_0x5d2b8d(0x331)];_0xecc9f2[_0x5d2b8d(0x37a)](_0x485000,_0x1234eb),this[_0x5d2b8d(0x3ce)][_0x5d2b8d(0x266)](_0xecc9f2);}[_0x1222a9(0x30c)](_0x59a11d){const _0x29f0c8=_0x1222a9,{memberID:_0x469b2a}=_0x59a11d['data'],_0x21951c=this['cursorInfo'];_0x21951c[_0x29f0c8(0x24f)](_0x469b2a),this[_0x29f0c8(0x3ce)]['next'](_0x21951c);}[_0x1222a9(0x3b9)](){const _0x26cdb0=_0x1222a9;var _0xae738b;this[_0x26cdb0(0x1e8)]=!![];if(((_0xae738b=this[_0x26cdb0(0x239)][_0x26cdb0(0x24d)]())===null||_0xae738b===void 0x0?void 0x0:_0xae738b[_0x26cdb0(0x22a)]())!==this['unitID'])return;const _0x1f27ef=this['_injector'][_0x26cdb0(0x232)](DocSelectionManagerService)['getDocRanges']();if(Array[_0x26cdb0(0x1e6)](_0x1f27ef)&&_0x1f27ef[_0x26cdb0(0x2c1)]>0x0)this[_0x26cdb0(0x2ab)](_0x1f27ef);}[_0x1222a9(0x30e)](){const _0x313153=_0x1222a9;this[_0x313153(0x1e8)]=![];}};DocCollabCursorEntity=__decorate([__decorateParam(0x2,Inject(Injector)),__decorateParam(0x3,Inject(ColorAssignService)),__decorateParam(0x4,Inject(MemberService)),__decorateParam(0x5,Inject(DocSyncEditingCollabCursorService)),__decorateParam(0x6,ITransformService),__decorateParam(0x7,IUniverInstanceService),__decorateParam(0x8,ICommandService)],DocCollabCursorEntity);const DEBOUNCE_TIME=0x12c,SHARE_LOCAL_DEBOUNCE_TIME=0x64,createNextTick=()=>{let _0x4fc828=[],_0xd6d2da=![];return _0x4bb419=>{const _0x349944=_0x2f58;_0x4fc828[_0x349944(0x29a)](_0x4bb419),!_0xd6d2da&&(_0xd6d2da=!![],setTimeout(()=>{const _0x4d3457=_0x349944;_0x4fc828[_0x4d3457(0x2bc)](_0x47ea39=>_0x47ea39()),_0x4fc828=[],_0xd6d2da=![];}));};};let SheetCollabCursorEntity=class SheetCollabCursorEntity extends RxDisposable{get['cursorInfo'](){const _0xb83077=_0x1222a9;return this['_cursorInfo$'][_0xb83077(0x1e5)]();}get[_0x1222a9(0x342)](){const _0x2558d0=_0x1222a9;return this[_0x2558d0(0x40b)][_0x2558d0(0x1e5)]();}constructor(_0x5bb3ce,_0x1a846a,_0x393d2a,_0x32f5af,_0x31de02,_0x13eb9a,_0x3840c2,_0x38de5e){const _0x32a5f4=_0x1222a9;super(),this[_0x32a5f4(0x3eb)]=_0x5bb3ce,this[_0x32a5f4(0x2bb)]=_0x1a846a,this[_0x32a5f4(0x21b)]=_0x393d2a,this['_colorAssignService']=_0x32f5af,this['_memberService']=_0x31de02,this['_univerInstanceService']=_0x13eb9a,this[_0x32a5f4(0x23f)]=_0x3840c2,this[_0x32a5f4(0x225)]=_0x38de5e,_defineProperty(this,_0x32a5f4(0x1e8),![]),_defineProperty(this,_0x32a5f4(0x338),![]),_defineProperty(this,_0x32a5f4(0x3ce),new BehaviorSubject(new Map())),_defineProperty(this,'cursorInfo$',this[_0x32a5f4(0x3ce)][_0x32a5f4(0x2d2)]()),_defineProperty(this,_0x32a5f4(0x40b),new BehaviorSubject([])),_defineProperty(this,'roomMembers$',this['_roomMembers$'][_0x32a5f4(0x31b)](debounceTime(DEBOUNCE_TIME))),_defineProperty(this,_0x32a5f4(0x2ab),debounce((_0x3e54ad,_0x33733d)=>{const _0x34c871=_0x32a5f4,_0x319505={'eventID':CollaborationEvent[_0x34c871(0x2cc)],'data':{'unitID':this[_0x34c871(0x3eb)],'memberID':this[_0x34c871(0x2bb)][_0x34c871(0x33b)](),'selection':serializeRangeWithSheet(_0x3e54ad,_0x33733d[_0x34c871(0x298)])}};this[_0x34c871(0x2bb)][_0x34c871(0x38f)](_0x319505,this[_0x34c871(0x3eb)]);},SHARE_LOCAL_DEBOUNCE_TIME));}[_0x1222a9(0x23d)](){const _0x5441af=_0x1222a9;super[_0x5441af(0x23d)](),this[_0x5441af(0x3ce)]['next'](new Map()),this['_cursorInfo$'][_0x5441af(0x40d)](),this[_0x5441af(0x40b)]['next']([]),this[_0x5441af(0x40b)][_0x5441af(0x40d)]();}[_0x1222a9(0x2a3)](){const _0x33c0e3=_0x1222a9;if(this[_0x33c0e3(0x338)])return;this[_0x33c0e3(0x338)]=!![],this[_0x33c0e3(0x2bb)]['sessionStatus$'][_0x33c0e3(0x31b)](takeUntil(this['dispose$']))[_0x33c0e3(0x3a1)](_0x1a5810=>{const _0x388e2b=_0x33c0e3;if(_0x1a5810===SessionStatus[_0x388e2b(0x1fa)])this[_0x388e2b(0x3b9)]();else this[_0x388e2b(0x30e)]();}),this[_0x33c0e3(0x2bb)]['event$'][_0x33c0e3(0x31b)](takeUntil(this[_0x33c0e3(0x381)]))[_0x33c0e3(0x3a1)](_0x1797d8=>{const _0x515679=_0x33c0e3,_0x54f588=_0x1797d8['eventID'];if(_0x54f588===CollaborationEvent['UPDATE_CURSOR'])this[_0x515679(0x22c)](_0x1797d8);if(_0x54f588===CollaborationEvent[_0x515679(0x1f2)])this['_onCursorDelete'](_0x1797d8);}),this[_0x33c0e3(0x211)](),this[_0x33c0e3(0x3e4)](this['_commandService'][_0x33c0e3(0x37c)](_0x30bdfb=>{const _0x2d8484=_0x33c0e3;if(this[_0x2d8484(0x1e8)]&&_0x30bdfb['id']===SetSelectionsOperation['id']&&_0x30bdfb[_0x2d8484(0x3ec)]['unitId']===this[_0x2d8484(0x3eb)]){const _0xb16ab1=_0x30bdfb[_0x2d8484(0x3ec)];this[_0x2d8484(0x2ab)](_0xb16ab1[_0x2d8484(0x28c)],_0xb16ab1[_0x2d8484(0x34f)][0x0]);}}));}['_onCursorUpdate'](_0x52028b){const _0x20434e=_0x1222a9;var _0x1b975c,_0x2e341c;const {memberID:_0x18b8ae,selection:_0x313c11}=_0x52028b[_0x20434e(0x2c9)],{sheetName:_0x140305,range:_0x4e6d05}=deserializeRangeWithSheet(_0x313c11),_0x57b19c={'name':(_0x1b975c=(_0x2e341c=this['_memberService']['getMember'](this['unitID'],_0x18b8ae))===null||_0x2e341c===void 0x0?void 0x0:_0x2e341c[_0x20434e(0x35c)])!==null&&_0x1b975c!==void 0x0?_0x1b975c:'Unknown\x20user','range':this['_getMergeRange'](_0x140305,_0x4e6d05),'sheetID':_0x140305,'color':this['_colorAssignService'][_0x20434e(0x2a4)](_0x18b8ae),'selection':_0x313c11},_0x51b89b=this[_0x20434e(0x331)];_0x51b89b[_0x20434e(0x37a)](_0x18b8ae,_0x57b19c),this['_cursorInfo$'][_0x20434e(0x266)](_0x51b89b);}[_0x1222a9(0x30c)](_0x5deb4d){const _0xb298a8=_0x1222a9,{memberID:_0x1ee8aa}=_0x5deb4d[_0xb298a8(0x2c9)],_0x106b6e=this['cursorInfo'];_0x106b6e[_0xb298a8(0x24f)](_0x1ee8aa),this[_0xb298a8(0x3ce)][_0xb298a8(0x266)](_0x106b6e);}[_0x1222a9(0x404)](_0x840f5f,_0x546fe5){const _0x804cf8=_0x1222a9;var _0x2094d0;const _0x51a9da=(_0x2094d0=this[_0x804cf8(0x239)][_0x804cf8(0x214)](this[_0x804cf8(0x3eb)]))===null||_0x2094d0===void 0x0||(_0x2094d0=_0x2094d0[_0x804cf8(0x3dd)](_0x840f5f))===null||_0x2094d0===void 0x0?void 0x0:_0x2094d0[_0x804cf8(0x30a)]();return(_0x51a9da===null||_0x51a9da===void 0x0?void 0x0:_0x51a9da['find'](_0x5e4153=>Rectangle['contains'](_0x5e4153,_0x546fe5)))||_0x546fe5;}['_onRefRangeChange'](){const _0x317251=_0x1222a9,_0x386874=new DisposableCollection(),_0x39738e=createNextTick(),_0x1b9349=()=>{const _0x413fc3=_0x2f58;_0x386874['dispose']();const _0x35d427=(_0x19879,_0x54f599,_0x5e0ee2,_0x17031d)=>{const _0x2e0b06=_0x2f58;let _0x4f0a6c=[];switch(_0x19879['id']){case EffectRefRangId[_0x2e0b06(0x2ec)]:_0x4f0a6c=handleDeleteRangeMoveLeft(_0x19879,_0x17031d);break;case EffectRefRangId[_0x2e0b06(0x355)]:_0x4f0a6c=handleDeleteRangeMoveUp(_0x19879,_0x17031d);break;case EffectRefRangId[_0x2e0b06(0x202)]:_0x4f0a6c=handleInsertCol(_0x19879,_0x17031d);break;case EffectRefRangId['InsertRangeMoveDownCommandId']:_0x4f0a6c=handleInsertRangeMoveDown(_0x19879,_0x17031d);break;case EffectRefRangId['InsertRangeMoveRightCommandId']:_0x4f0a6c=handleInsertRangeMoveRight(_0x19879,_0x17031d);break;case EffectRefRangId[_0x2e0b06(0x323)]:_0x4f0a6c=handleInsertRow(_0x19879,_0x17031d);break;case EffectRefRangId[_0x2e0b06(0x333)]:_0x4f0a6c=handleMoveRange(_0x19879,_0x17031d);break;case EffectRefRangId[_0x2e0b06(0x2a9)]:_0x4f0a6c=handleIRemoveCol(_0x19879,_0x17031d);break;case EffectRefRangId[_0x2e0b06(0x231)]:_0x4f0a6c=handleIRemoveRow(_0x19879,_0x17031d);break;}const _0x37b7af=runRefRangeMutations(_0x4f0a6c,_0x17031d),_0x2eb86e=this['cursorInfo'][_0x2e0b06(0x232)](_0x54f599);if(_0x2eb86e&&_0x37b7af){const _0x103f1a={..._0x2eb86e,'range':_0x37b7af};this[_0x2e0b06(0x331)][_0x2e0b06(0x37a)](_0x54f599,_0x103f1a),_0x39738e(()=>{const _0x33635d=_0x2e0b06,_0x1ebdb9=this['_refRangeService']['registerRefRange'](_0x37b7af,_0x518db7=>{const _0x486be0=_0x2f58;return _0x1ebdb9[_0x486be0(0x23d)](),_0x35d427(_0x518db7,_0x54f599,_0x5e0ee2,_0x37b7af);});_0x386874[_0x33635d(0x2e3)](_0x1ebdb9);});}return{'redos':[],'undos':[]};};this[_0x413fc3(0x331)][_0x413fc3(0x2bc)]((_0x32d054,_0x544a1c)=>{const _0x34ccc6=_0x413fc3,{range:_0x534fe2,sheetID:_0x1a24c4}=_0x32d054,_0xeb5269=this[_0x34ccc6(0x225)][_0x34ccc6(0x256)](_0x534fe2,_0x19482b=>{const _0x43c2af=_0x34ccc6;return _0xeb5269[_0x43c2af(0x23d)](),_0x35d427(_0x19482b,_0x544a1c,_0x1a24c4,_0x534fe2);});_0x386874[_0x34ccc6(0x2e3)](_0xeb5269);});};this[_0x317251(0x3e4)](toDisposable(this['_cursorInfo$'][_0x317251(0x3a1)](()=>{_0x1b9349();})));}[_0x1222a9(0x3b9)](){const _0x201dc9=_0x1222a9;var _0x205c0f,_0x541ac4;this['_online']=!![];if(((_0x205c0f=this[_0x201dc9(0x239)][_0x201dc9(0x24d)]())===null||_0x205c0f===void 0x0?void 0x0:_0x205c0f[_0x201dc9(0x22a)]())!==this[_0x201dc9(0x3eb)])return;const _0x3e6ca3=(_0x541ac4=this[_0x201dc9(0x21b)]['get'](SheetsSelectionsService)[_0x201dc9(0x237)]())===null||_0x541ac4===void 0x0?void 0x0:_0x541ac4[0x0],_0x43d317=this[_0x201dc9(0x239)][_0x201dc9(0x35b)](UniverInstanceType[_0x201dc9(0x23c)])['getActiveSheet']();if(_0x3e6ca3&&_0x43d317)this[_0x201dc9(0x2ab)](_0x43d317[_0x201dc9(0x286)](),_0x3e6ca3);}['_toggleOffline'](){this['_online']=![];}};SheetCollabCursorEntity=__decorate([__decorateParam(0x2,Inject(Injector)),__decorateParam(0x3,Inject(ColorAssignService)),__decorateParam(0x4,Inject(MemberService)),__decorateParam(0x5,IUniverInstanceService),__decorateParam(0x6,ICommandService),__decorateParam(0x7,Inject(RefRangeService))],SheetCollabCursorEntity);let CollabCursorController=class CollabCursorController extends RxDisposable{constructor(_0x27b7b9,_0x3da3ad,_0x1ead2c){const _0x1be94f=_0x1222a9;super(),this['_univerInstanceService']=_0x27b7b9,this['_injector']=_0x3da3ad,this[_0x1be94f(0x29d)]=_0x1ead2c,_defineProperty(this,_0x1be94f(0x2fe),new Map()),_defineProperty(this,_0x1be94f(0x2bd),new Subject()),this[_0x1be94f(0x338)]();}[_0x1222a9(0x23d)](){const _0x41b5e9=_0x1222a9;super[_0x41b5e9(0x23d)](),this[_0x41b5e9(0x2bd)][_0x41b5e9(0x40d)](),this[_0x41b5e9(0x2fe)]['forEach'](_0x3ed973=>_0x3ed973[_0x41b5e9(0x23d)]());}['getCollabCursors$'](_0xd71ec3){const _0x5e9e65=_0x1222a9;if(this['_entities'][_0x5e9e65(0x3fd)](_0xd71ec3))return this[_0x5e9e65(0x2fe)]['get'](_0xd71ec3)[_0x5e9e65(0x2b0)];return this[_0x5e9e65(0x2bd)][_0x5e9e65(0x31b)](filter(_0x179c56=>_0x179c56['unitID']===_0xd71ec3),switchMap(_0x2cfc8d=>_0x2cfc8d[_0x5e9e65(0x2b0)]));}[_0x1222a9(0x338)](){const _0x2fec67=_0x1222a9;this[_0x2fec67(0x239)][_0x2fec67(0x3bd)](UniverInstanceType[_0x2fec67(0x23c)])['pipe'](takeUntil(this['dispose$']))[_0x2fec67(0x3a1)](async _0x376d51=>{const _0x7fe7ae=_0x2fec67,_0x131820=_0x376d51[_0x7fe7ae(0x29b)][_0x7fe7ae(0x22a)](),_0xc63d27=await this[_0x7fe7ae(0x21e)](_0x131820);this['_entityInit$'][_0x7fe7ae(0x266)](_0xc63d27),this[_0x7fe7ae(0x2fe)][_0x7fe7ae(0x37a)](_0x131820,_0xc63d27);}),this['_univerInstanceService'][_0x2fec67(0x3bd)](UniverInstanceType[_0x2fec67(0x329)])['pipe'](takeUntil(this['dispose$']))['pipe'](filter(_0x1bee71=>{const _0x5b45e4=_0x2fec67;return!_0x1bee71[_0x5b45e4(0x29b)][_0x5b45e4(0x22a)]()[_0x5b45e4(0x392)]('__');}))[_0x2fec67(0x3a1)](async _0x1fe90e=>{const _0x2d857b=_0x2fec67,{unit:_0x22723e}=_0x1fe90e,_0x1fe821=_0x22723e[_0x2d857b(0x22a)](),_0x55544e=await this[_0x2d857b(0x376)](_0x1fe821);this[_0x2d857b(0x2bd)][_0x2d857b(0x266)](_0x55544e),this[_0x2d857b(0x2fe)][_0x2d857b(0x37a)](_0x1fe821,_0x55544e);}),_0x47a541(this[_0x2fec67(0x239)]['getTypeOfUnitDisposed$'](UniverInstanceType['UNIVER_DOC']),this[_0x2fec67(0x239)][_0x2fec67(0x306)](UniverInstanceType[_0x2fec67(0x23c)]))[_0x2fec67(0x31b)](takeUntil(this[_0x2fec67(0x381)]))[_0x2fec67(0x3a1)](_0x1a2a1e=>{const _0x4eca53=_0x2fec67,_0x2c5697=_0x1a2a1e['getUnitId'](),_0x3ca2f0=this[_0x4eca53(0x2fe)][_0x4eca53(0x232)](_0x2c5697);_0x3ca2f0&&(_0x3ca2f0['dispose'](),this[_0x4eca53(0x2fe)]['delete'](_0x2c5697));});}async[_0x1222a9(0x21e)](_0xf4c407){const _0x358c64=_0x1222a9,_0x1b901c=await this[_0x358c64(0x29d)]['requireSession'](_0xf4c407),_0xb78591=this[_0x358c64(0x21b)][_0x358c64(0x391)](SheetCollabCursorEntity,_0xf4c407,_0x1b901c);return _0xb78591[_0x358c64(0x2a3)](),_0xb78591;}async[_0x1222a9(0x376)](_0x154596){const _0x11db20=_0x1222a9,_0x8def6c=await this[_0x11db20(0x29d)][_0x11db20(0x21f)](_0x154596),_0x56dde9=this[_0x11db20(0x21b)][_0x11db20(0x391)](DocCollabCursorEntity,_0x154596,_0x8def6c);return _0x56dde9[_0x11db20(0x2a3)](),_0x56dde9;}};CollabCursorController=__decorate([__decorateParam(0x0,IUniverInstanceService),__decorateParam(0x1,Inject(Injector)),__decorateParam(0x2,Inject(CollaborationSessionService))],CollabCursorController);function _0x2f58(_0x4c40c7,_0x4556e6){_0x4c40c7=_0x4c40c7-0x1e1;const _0x189583=_0x1895();let _0x2f58a5=_0x189583[_0x4c40c7];return _0x2f58a5;}const COLLAB_CURSOR_LABEL_HEIGHT=0x14,COLLAB_CURSOR_LABEL_MAX_WIDTH=0xc8,COLLAB_CURSOR_LABEL_TEXT_PADDING_LR=0x4,COLLAB_CURSOR_LABEL_TEXT_PADDING_TB=0x5;function drawBubble(_0x51b1e4,_0x1ad9f5){const _0xe9b236=_0x1222a9;var _0x5c7e5d,_0x2a794b,_0x4c3b24;let {radius:_0x55f43,width:_0x3f5dad,height:_0x2d2dde}=_0x1ad9f5;_0x55f43=(_0x5c7e5d=_0x55f43)!==null&&_0x5c7e5d!==void 0x0?_0x5c7e5d:0x0,_0x3f5dad=(_0x2a794b=_0x3f5dad)!==null&&_0x2a794b!==void 0x0?_0x2a794b:0x1e,_0x2d2dde=(_0x4c3b24=_0x2d2dde)!==null&&_0x4c3b24!==void 0x0?_0x4c3b24:0x1e;let _0x56538a=0x0,_0x2efbb4=0x0,_0x1e7fda=0x0;_0x56538a=_0x2efbb4=_0x1e7fda=Math['min'](_0x55f43,_0x3f5dad/0x2,_0x2d2dde/0x2),_0x51b1e4[_0xe9b236(0x2b4)](),_0x51b1e4[_0xe9b236(0x308)](_0x56538a,0x0),_0x51b1e4[_0xe9b236(0x223)](_0x3f5dad-_0x2efbb4,0x0),_0x51b1e4['arc'](_0x3f5dad-_0x2efbb4,_0x2efbb4,_0x2efbb4,Math['PI']*0x3/0x2,0x0,![]),_0x51b1e4[_0xe9b236(0x223)](_0x3f5dad,_0x2d2dde-_0x1e7fda),_0x51b1e4[_0xe9b236(0x2d6)](_0x3f5dad-_0x1e7fda,_0x2d2dde-_0x1e7fda,_0x1e7fda,0x0,Math['PI']/0x2,![]),_0x51b1e4[_0xe9b236(0x223)](0x0,_0x2d2dde),_0x51b1e4[_0xe9b236(0x223)](0x0,_0x56538a),_0x51b1e4[_0xe9b236(0x2d6)](_0x56538a,_0x56538a,_0x56538a,Math['PI'],Math['PI']*0x3/0x2,![]),_0x51b1e4[_0xe9b236(0x20f)]();if(_0x1ad9f5[_0xe9b236(0x334)]){_0x51b1e4[_0xe9b236(0x1e3)](),_0x51b1e4[_0xe9b236(0x302)]=_0x1ad9f5[_0xe9b236(0x334)];if(_0x1ad9f5[_0xe9b236(0x326)]===_0xe9b236(0x3cf))_0x51b1e4[_0xe9b236(0x334)](_0xe9b236(0x3cf));else _0x51b1e4[_0xe9b236(0x334)]();_0x51b1e4[_0xe9b236(0x341)]();}}var TextBubbleShape=class TextBubbleShape extends Shape{constructor(_0x1506e0,_0x55ec37){const _0x3fb100=_0x1222a9;super(_0x1506e0,_0x55ec37),_defineProperty(this,'color',void 0x0),_defineProperty(this,_0x3fb100(0x40c),void 0x0),this[_0x3fb100(0x304)]=_0x55ec37===null||_0x55ec37===void 0x0?void 0x0:_0x55ec37[_0x3fb100(0x304)],this['text']=_0x55ec37===null||_0x55ec37===void 0x0?void 0x0:_0x55ec37[_0x3fb100(0x40c)];}static[_0x1222a9(0x218)](_0x3b44a8,_0x9c2dfd){const _0x275c88=_0x1222a9,{text:_0x2d04f4,color:_0x2360b5}=_0x9c2dfd;_0x3b44a8['save'](),_0x3b44a8[_0x275c88(0x3b0)]=_0x275c88(0x384);const _0x59416d=_0x3b44a8[_0x275c88(0x3ee)](_0x2d04f4)[_0x275c88(0x31e)];drawBubble(_0x3b44a8,{'height':0x14,'radius':0x4,'width':Math[_0x275c88(0x402)](_0x59416d+0x2*0x4,0xc8),'fill':_0x2360b5,'evented':![]}),_0x3b44a8[_0x275c88(0x302)]=_0x275c88(0x2ee);const _0x57a8f9=0x4,_0x1c5065=0x14-0x5,_0x5e9a84=0xc8-0x2*0x4;if(_0x59416d>_0x5e9a84){let _0x333fd0='',_0x4d838c=0x0;for(const _0x28f104 of _0x2d04f4){const _0x406a56=_0x3b44a8[_0x275c88(0x3ee)](_0x28f104)[_0x275c88(0x31e)];if(_0x4d838c+_0x406a56<=_0x5e9a84-_0x3b44a8[_0x275c88(0x3ee)](_0x275c88(0x2b5))[_0x275c88(0x31e)])_0x333fd0+=_0x28f104,_0x4d838c+=_0x406a56;else{_0x333fd0+=_0x275c88(0x2b5);break;}}_0x3b44a8[_0x275c88(0x3c6)](_0x333fd0,_0x57a8f9,_0x1c5065);}else _0x3b44a8['fillText'](_0x2d04f4,_0x57a8f9,_0x1c5065);_0x3b44a8[_0x275c88(0x341)]();}[_0x1222a9(0x300)](_0x52943c){const _0x5aaf5d=_0x1222a9;TextBubbleShape[_0x5aaf5d(0x218)](_0x52943c,this);}};const COLLAB_TEXT_ANCHOR_KEY_PREFIX='collab-text-anchor-',COLLAB_TEXT_RANGE_KEY_PREFIX=_0x1222a9(0x3a5),COLLAB_RECT_RANGE_KEY_PREFIX=_0x1222a9(0x294),ID_LENGTH=0x6,COLLAB_TEXT_ANCHOR_WIDTH=1.5,COLLAB_TEXT_ANCHOR_DOT_WIDTH=0x4,SELECTION_CONTROL_BORDER_BUFFER_WIDTH=1.5,SELECTION_CONTROL_BORDER_BUFFER_COLOR='rgba(255,\x20255,\x20255,\x200.01)';function _0x1895(){const _0x42bd30=['permission.content','_dataLoaderService','catch','_hideTimer','_urlService','highlightSecond','getParam','_renderManagerService','_instanceService','socket$','_selfUnitIDs','1585218WWENOI','_startDocCollabCursor','pluginName','_taskIds','_revisionService','set','true','onCommandExecuted','onRendered','post','findNodePositionByCharIndex','disableLocalCache','dispose$','_currentUsage','dirtyRanges','bold\x2013px\x20Source\x20Han\x20Sans\x20CN','transformStateCache','focused$','_collabCursorController','triggerDblclick','_saveCache','_logService','MUTATION','_config','_hasFormulaInDirtyRanges','_getAnchorBounding','send','releaseFormulaLimitUrl','createInstance','startsWith','SUCCESS','VIEW_MAIN','?taskId=','deepClone','_initResize','status$','collabStatus.conflict','red.300','href','_sheetSkeletonManagerService','stageInfo','isEditing','split','univer-text-xl\x20univer-transition-colors\x20univer-duration-200','subscribe','getUnit','_hovered','_docClipboardService','collab-text-range-','FromArray','top','dark:focus:univer-ring-offset-gray-800','univer-text-blue-500','getVpScrollXYInfoByPosToVp','preventDefault','beforeCommandExecuted','undoState','focus:univer-outline-none\x20focus:univer-ring-2\x20focus:univer-ring-primary-500\x20focus:univer-ring-offset-2','with','font','univer-text-orange-500','formula.calculation.started','getCellPositionByOffset','_initUnhandledRejectionListener','search','_themeService','toString','map','_toggleOnline','message','labelPosition','offsetY','getTypeOfUnitAdded$','lineno','session.collaboration-timeout','error','invokeId','_id','OTHER_CLIENTS_EDITING','exhaustSavingTask','startFormulaLimitUrl','fillText','0.22.0','enableFrontendLog','storage','history','newValue','key','_cursor','_cursorInfo$','evenodd','updateOfflineData','registerBeforeClose','bottom','_hover','currentTheme$','getViewport','_collaborationController','onPointerEnter$','parseInt','onStarting','_cursorShapes','clearTimeout','getCollabEntity$','getSheetBySheetId','executeCommand','maxFormulaLimit','isActive','univer-border-none\x20univer-bg-transparent','_localCacheService','jiqing.500','disposeWithMe','JOIN_ROOM_FAILED','OFFLINE','getActiveSheet','green.600','_colorIndex','imageSourceType','unitID','params','_lastResponseTimestamp','measureText','parse','_textBubble','Failed','registerRenderModule','collaboration.closeRoom','transformMutation','collabStatus.notCollab','static','_render','undefined','indicator','_initEvent','black','[CollaborationDataLoaderController]','has','_monkeyPatchLogService','403eauHcQ','onLocalMutation','_pollingInterval','min','rgba(','_getMergeRange','AWAITING','_scheduleClearOtherTimer','_heartbeatTimer','replaceDocRanges','defineProperty','_checkCalculationAvailable','_roomMembers$','text','complete','_localeService','getSkeleton','transformIMECache','univer-inline-flex\x20univer-items-center\x20univer-justify-center','colorClass','debug','purple.300','save','_releaseCalculationLimit','getValue','isArray','SOCKET_FAILED','_online','hovered','includes','_initEntityListener','_collaborationSessionService','[LogService\x20Error]:\x20','m1Prime','No\x20remote\x20instance\x20service\x20injected.\x20May\x20not\x20syncing\x20edits\x20to\x20the\x20web\x20worker.','281364tuUAYt','unsubscribe','USERS_LEAVE','docStateChange$','_initCommandInterceptor','addEventListener','collaboration.offline-data-not-saved','size','RECT','getCurrentRevOfUnit','ONLINE','_collabCursorState$','setAlpha','totalFormulasToCalculate','actions','getUnitStatus$','_highlight','_getSheetObject','InsertColCommandId','object','searchParams','setUndoRedoMutationParamsCache','entityInit$','NOT_COLLAB','_lastPointer','code','setInterval','getCollabCursors$','TEXT','_scheduleSaving','univer-flex\x20univer-items-center\x20univer-justify-center','closePath','addHandlerCallback','_onRefRangeChange','_color','getAncestorScale','getUniverSheetInstance','addObject','collabCursorState$','univer-h-8\x20univer-w-8\x20univer-rounded-lg','drawWith','limitInfo','_docTransformSelectionsService','_injector','_maxFormulaLimit','_imageIoService','_startSheetCollabCursor','requireSession','constructor','collabStatus.syncing','_unitOnClients','lineTo','_eventUnsubscribe','_refRangeService','_notificationService','getRangePointData','subunit','makeDirty','getUnitId','678916MdEFlC','_onCursorUpdate','_updateSubUnitFromURLParams','_initCommandExecutedListener','/universer-api/license/formula/limit/start','_getLighterColor','RemoveRowCommandId','get','stringify','onTransformChange$','_localStorageService','_applyCommand','getCurrentSelections','_initDependencies','_univerInstanceService','status','_getSessionTicket','UNIVER_SHEET','dispose','120ZkLpCu','_commandService','unshift','_docSkeleton','_handleLeaveEvent','_context','reconnect','_labelPosition','Success','result','_assignedColors','span','show','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','redoState','getFocusedUnit','type','delete','function','_range','_name','permission.title','CONFLICT','max','registerRefRange','_blinkTimer','loadUnit','location','addObjects','_getScale',',\x200.2)','toRgbString','[Unhandled\x20Rejection]:\x20','_clearOtherTimers','symbol','_setupSubUnitSync','_cachedData','source','removeEventListener','_handleEvent','next','_setupBeforeClosingHandler','getConfig','_getFormulaLimitStatus','session.connection-failed','getColorFromTheme','flatMap','START_CALCULATION','registerComponent','_stopBlinking','slice','override','_anchorDot','unitId','tooltipKey','setStateCache','_uiPartsService','_shapes','_drawRectRange','subscribeEvent','6EZbBVF','_docTransformIMECacheService','_anchor','ranges','rgba','_disabled','_getSaveTimeout','_syncEditingCollabCursorService','Unknown\x20user','5rFBBjL','engine','decorate','getSheetId','ACTIVE_UNIT_EVENT_CHANNEL','showText','replace','_transformPreviousActiveRange','_startCalculationLimit','subUnitId','getMember','onPointerMove$','all','textRanges','currentSkeleton$','iterator','values','collab-rect-range-','getOffsetConfig','rgb','roomMembers$','range','wsSessionTicketUrl','push','unit','then','_collabSessionService','_initUserListener','_memberID','getStateCache','from','setOffsetY','init','assignAColorForMemberID','endRow','_docStateChangeManagerService','_beforeCloseService','_initStatusComponent','RemoveColCommandId','event$','_updateLocalCursor','setShapeProps','loadOfflineData','syncEditingCollabCursor','row','cursorInfo$','button','origin','runOnServer','beginPath','...','_checkAndWaitForCalculationPermission','11CDbHgN','formula.calculation.waiting','toPrimitive','3379790UgivdF','_session','forEach','_entityInit$','highlight','selection','uni.network.url-service','length','endColumn','default','stack','_removeCollabCursors','removeParam','PENDING','transformRemoteChangeset','data','column','_unitStatus','UPDATE_CURSOR','some','_transformUndoRedoStack','application/json','PERMISSION_DENIED','_uploadLog','asObservable','OTHER_CLIENT_EDITING','functionsExecutedState','_send','arc','_ensureSubject','height','_docSkeletonManagerService','getCurrentSkeleton','packageName','startRow','_httpService','body','clearInterval','doc.mutation.rich-text-editing','collaboration.single-unit.warning','addClipboardHook','add','version','replaceState','_status$','417537LWsmbl','_highlightSecond','getUndoRedoMutationParamsCache','getRenderById','strokeWidth','DeleteRangeMoveLeftCommandId','_memberService','#FFF','0.2)','sheetID','_updateURLWithCurrentState','_scheduleHeartbeat','1769278NaZpmO','_showText','stage','/run/','now','collab-client.tooltip.reconnect','_blinkIntervalTimer','_handleHover','setParam','colno','_handleJoinEvent','_entities','polite','_draw','_initWindowErrorListener','fillStyle','getFormulaLimitStatusUrl','color','_docSyncEditingCollabCursorService','getTypeOfUnitDisposed$','activeSheet$','moveTo','string','getMergeData','getCellMatrix','_onCursorDelete','formula.calculation.unable','_toggleOffline','collabStatus.fetchMiss','mutations','_showGuardMessage','SYNCED','hide','univer-transition-all\x20univer-duration-200','_isBlinkVisible','onPointerLeave$','_updateCollabCursors','_createSocketURL','_document','_collaborationUIEventService','pipe','_initStatusListener','_saveTaskMap','width','_transformHistoryAndStateStack','backgroundColor','Error','shift','InsertRowCommandId','join','_docTransformStateCacheService','fillRule','NO_OTHER_CLIENTS_EDITING','_setFormulaLimitStatus','UNIVER_DOC','unhandledrejection','transformSelections','_registerDependencies','_doCreateSocket','\x20at\x20','sessionTicket','saveImage','cursorInfo','onMouseMove','MoveRangeCommandId','fill','385RynYuF','getOwnPropertyDescriptor','AWAITING_WITH_PENDING','_init','CLOSE_ROOM','setItem','getMemberID','saveTaskMap','startColumn','univer-m-0\x20univer-p-0','call','transformMutationsWithChangeset','restore','roomMembers','_offsetY','executionId','_registerRenderDependencies','runId','_removeClearOtherTimer','_drawAnchor','188DoOfTC','\x20-\x20','currentUsage','collabStatus.synced','urlChange$','eventID','selections','spin','setTimeout','_transformService','_backgroundColor','_clearPolling','DeleteRangeMoveUpCommandId','_configService','/universer-api/license/formula/limit/status','icon','m2Prime','_cursors','getCurrentUnitForType','name','UNIVER_COLLABORATION_CLIENT_WEB_PLUGIN','memberID','getRelativeToViewportCoord','collaboration-client-ui.config','Warning','univer-text-red-500','clickable','_messageService','univer-text-green-500','_refreshCollabCursors','_handleHeartbeatEvent','transform','_scene'];_0x1895=function(){return _0x42bd30;};return _0x1895();}var DocCollabCursor=class{constructor(_0x3ea2c5,_0x36e228,_0x47775f,_0xa59263){const _0x5d297c=_0x1222a9;this['_cursor']=_0x3ea2c5,this[_0x5d297c(0x369)]=_0x36e228,this[_0x5d297c(0x241)]=_0x47775f,this[_0x5d297c(0x319)]=_0xa59263,_defineProperty(this,_0x5d297c(0x277),[]),_defineProperty(this,_0x5d297c(0x27c),null),_defineProperty(this,_0x5d297c(0x3f0),null),_defineProperty(this,_0x5d297c(0x272),null),_defineProperty(this,_0x5d297c(0x36d),null),_defineProperty(this,_0x5d297c(0x224),null),this[_0x5d297c(0x3f7)]();}set[_0x1222a9(0x3d3)](_0x1a153b){const _0x132c5e=_0x1222a9;_0x1a153b?(this[_0x132c5e(0x272)]&&this[_0x132c5e(0x272)][_0x132c5e(0x313)](),this[_0x132c5e(0x3f0)]&&this['_textBubble'][_0x132c5e(0x24a)]()):(this[_0x132c5e(0x272)]&&this[_0x132c5e(0x272)][_0x132c5e(0x24a)](),this[_0x132c5e(0x3f0)]&&this[_0x132c5e(0x3f0)][_0x132c5e(0x313)]());}[_0x1222a9(0x23d)](){const _0xccea93=_0x1222a9;for(const _0x570a15 of this[_0xccea93(0x277)])_0x570a15[_0xccea93(0x23d)]();if(this[_0xccea93(0x3f0)])this['_textBubble'][_0xccea93(0x23d)]();if(this[_0xccea93(0x272)])this['_anchorDot']['dispose']();if(this[_0xccea93(0x27c)])this[_0xccea93(0x27c)][_0xccea93(0x23d)]();if(this['_eventUnsubscribe'])this[_0xccea93(0x224)]();}[_0x1222a9(0x3f7)](){const _0x3a889f=_0x1222a9,{_docSkeleton:_0x23cd03,_document:_0x59d886}=this,{color:_0x5f1fa3,name:_0x43fbbe,ranges:_0xa505e9}=this[_0x3a889f(0x3cd)],_0xe59d93=_0x59d886[_0x3a889f(0x295)](),{docsLeft:_0x27d576,docsTop:_0xf9c10f}=_0xe59d93,_0x2a0800=new NodePositionConvertToCursor(_0xe59d93,_0x23cd03);for(const {startOffset:_0x2f3c8e,endOffset:_0xc7e7a4,rangeType:_0x2199e1,segmentId:_0x32870d,segmentPage:_0x404e96,collapsed:_0x5245da,isActive:_0x50f6f4}of _0xa505e9){const _0x2a1b50=_0x23cd03[_0x3a889f(0x37f)](_0x2f3c8e,!![],_0x32870d,_0x404e96);let _0x3d992f=_0x23cd03[_0x3a889f(0x37f)](_0xc7e7a4,!![],_0x32870d,_0x404e96);if(_0x3d992f==null)_0x3d992f=_0x23cd03['findNodePositionByCharIndex'](_0xc7e7a4-0x1,![],_0x32870d,_0x404e96);if(_0x50f6f4){const {contentBoxPointGroup:_0x411164}=_0x2a0800[_0x3a889f(0x227)](_0x3d992f,_0x3d992f);if(_0x411164['length']===0x0)continue;this[_0x3a889f(0x348)](_0x5f1fa3,_0x411164,_0x27d576,_0xf9c10f,_0x43fbbe),this['_eventUnsubscribe']=this[_0x3a889f(0x2fa)]();}if(_0x2a1b50&&_0x3d992f){if(_0x2199e1===DOC_RANGE_TYPE[_0x3a889f(0x1f8)]){var _0x2eebb9;const {pointGroup:_0x203891}=(_0x2eebb9=new NodePositionConvertToRectRange(_0xe59d93,_0x23cd03)[_0x3a889f(0x227)](_0x2a1b50,_0x3d992f))!==null&&_0x2eebb9!==void 0x0?_0x2eebb9:{};if(_0x203891==null||_0x203891[_0x3a889f(0x2c1)]===0x0)continue;this['_drawRectRange'](_0x5f1fa3,_0x203891,_0x27d576,_0xf9c10f);}else{if(!_0x5245da){const {borderBoxPointGroup:_0x3f07e6}=_0x2a0800[_0x3a889f(0x227)](_0x2a1b50,_0x3d992f);if(_0x3f07e6[_0x3a889f(0x2c1)]===0x0)continue;this['_drawTextRange'](_0x5f1fa3,_0x3f07e6,_0x27d576,_0xf9c10f);}}}}}[_0x1222a9(0x348)](_0x36d3b1,_0xb62ed3,_0x30522a,_0x51c70a,_0x2f1047){const _0x1148dc=_0x1222a9,{left:_0x386ef4,top:_0x47dd69,height:_0x5982ed}=this['_getAnchorBounding'](_0xb62ed3),_0x53d408=SELECTION_CONTROL_BORDER_BUFFER_WIDTH/this[_0x1148dc(0x25b)](),_0x3fb6bb=new Rect(COLLAB_TEXT_ANCHOR_KEY_PREFIX+generateRandomId(ID_LENGTH),{'left':_0x386ef4+_0x30522a-_0x53d408,'top':_0x47dd69+_0x51c70a,'height':_0x5982ed,'width':COLLAB_TEXT_ANCHOR_WIDTH,'fill':_0x36d3b1||getColor(COLORS[_0x1148dc(0x3fb)],0x0),'strokeWidth':_0x53d408,'stroke':SELECTION_CONTROL_BORDER_BUFFER_COLOR,'evented':!![]});this[_0x1148dc(0x27c)]=_0x3fb6bb,this[_0x1148dc(0x369)][_0x1148dc(0x215)](_0x3fb6bb,TEXT_RANGE_LAYER_INDEX);const _0x1c4ba8=new Rect(COLLAB_TEXT_ANCHOR_KEY_PREFIX+generateRandomId(ID_LENGTH),{'left':_0x386ef4+_0x30522a-_0x53d408,'top':_0x47dd69+_0x51c70a-COLLAB_TEXT_ANCHOR_DOT_WIDTH/0x2,'height':COLLAB_TEXT_ANCHOR_DOT_WIDTH,'width':COLLAB_TEXT_ANCHOR_DOT_WIDTH,'fill':_0x36d3b1||getColor(COLORS[_0x1148dc(0x3fb)],0x0),'strokeWidth':0x0,'stroke':_0x36d3b1||getColor(COLORS[_0x1148dc(0x3fb)],0x0),'evented':![]});this[_0x1148dc(0x272)]=_0x1c4ba8,this['_scene'][_0x1148dc(0x215)](_0x1c4ba8,TEXT_RANGE_LAYER_INDEX);const _0xec8cda=new TextBubbleShape(COLLAB_TEXT_ANCHOR_KEY_PREFIX+generateRandomId(ID_LENGTH),{'left':_0x386ef4+_0x30522a-_0x53d408,'top':_0x47dd69+_0x51c70a-0x14,'text':_0x2f1047,'color':_0x36d3b1});this[_0x1148dc(0x3f0)]=_0xec8cda,this[_0x1148dc(0x369)]['addObject'](_0xec8cda,TEXT_RANGE_LAYER_INDEX),this['_hover']=![];}[_0x1222a9(0x2fa)](){const _0x2044f6=_0x1222a9,_0x443fc9=this[_0x2044f6(0x27c)][_0x2044f6(0x3d7)]['subscribeEvent'](()=>{const _0x616740=_0x2044f6;this[_0x616740(0x3d3)]=!![];}),_0x3c5a0e=this[_0x2044f6(0x27c)]['onPointerLeave$'][_0x2044f6(0x279)](()=>{const _0x4ba33d=_0x2044f6;if(this[_0x4ba33d(0x36d)])clearTimeout(this[_0x4ba33d(0x36d)]);this[_0x4ba33d(0x36d)]=setTimeout(()=>{const _0x1905cc=_0x4ba33d;this[_0x1905cc(0x3d3)]=![];},0x7d0);});return()=>{const _0x297a73=_0x2044f6;_0x443fc9[_0x297a73(0x1f1)](),_0x3c5a0e[_0x297a73(0x1f1)]();};}['_drawTextRange'](_0x45c967,_0x423e7a,_0x4f21c6,_0x1281bd){const _0x569096=_0x1222a9,_0x169e08=0.2,_0x40733c=new ColorKit(_0x45c967)[_0x569096(0x1fc)](_0x169e08)[_0x569096(0x25d)](),_0x175d3d=new RegularPolygon(COLLAB_TEXT_RANGE_KEY_PREFIX+generateRandomId(ID_LENGTH),{'pointsGroup':_0x423e7a,'fill':_0x40733c||getColor(COLORS[_0x569096(0x3fb)],_0x169e08),'left':_0x4f21c6,'top':_0x1281bd,'evented':![],'debounceParentDirty':![]});this['_shapes'][_0x569096(0x29a)](_0x175d3d),this[_0x569096(0x369)][_0x569096(0x215)](_0x175d3d,TEXT_RANGE_LAYER_INDEX);}[_0x1222a9(0x278)](_0x3117d1,_0x113a49,_0x1ad51b,_0x455fa8){const _0x26e7b4=_0x1222a9,_0x2a9966=0.2,_0x1ce95f=new ColorKit(_0x3117d1)[_0x26e7b4(0x1fc)](_0x2a9966)['toRgbString'](),_0x29ca2a=new RegularPolygon(COLLAB_RECT_RANGE_KEY_PREFIX+generateRandomId(ID_LENGTH),{'pointsGroup':_0x113a49,'fill':_0x1ce95f||getColor(COLORS[_0x26e7b4(0x3fb)],_0x2a9966),'left':_0x1ad51b,'top':_0x455fa8,'evented':![],'debounceParentDirty':![]});this[_0x26e7b4(0x277)]['push'](_0x29ca2a),this['_scene'][_0x26e7b4(0x215)](_0x29ca2a,TEXT_RANGE_LAYER_INDEX);}[_0x1222a9(0x38e)](_0x138ac9){const _0x260b33=_0x138ac9[0x0],_0x58c6c0=_0x260b33[0x0],_0x3e12c3=_0x260b33[0x2],{x:_0x943c8f,y:_0xb9b67e}=_0x58c6c0,{x:_0x15bfb5,y:_0x197bf4}=_0x3e12c3;return{'left':_0x943c8f,'top':_0xb9b67e,'width':_0x15bfb5-_0x943c8f,'height':_0x197bf4-_0xb9b67e};}[_0x1222a9(0x25b)](){const _0x4df53a=_0x1222a9,{scaleX:_0x7a5cc6,scaleY:_0x53a572}=this['_scene'][_0x4df53a(0x213)]();return Math[_0x4df53a(0x255)](_0x7a5cc6,_0x53a572);}};let DocCollabCursorRenderController=class DocCollabCursorRenderController extends RxDisposable{constructor(_0x344c35,_0x3b4459,_0x84c111,_0x35b1e3,_0x4b9291){const _0x3c6051=_0x1222a9;super(),this[_0x3c6051(0x243)]=_0x344c35,this['_docSkeletonManagerService']=_0x3b4459,this['_collabCursorController']=_0x84c111,this[_0x3c6051(0x23f)]=_0x35b1e3,this[_0x3c6051(0x3b6)]=_0x4b9291,_defineProperty(this,_0x3c6051(0x3da),[]),_defineProperty(this,_0x3c6051(0x35a),[]),this[_0x3c6051(0x338)]();}[_0x1222a9(0x338)](){const _0x51b0dc=_0x1222a9,_0x2edcf4=this[_0x51b0dc(0x243)][_0x51b0dc(0x273)],_0x5cf8d7=this[_0x51b0dc(0x2d9)];this[_0x51b0dc(0x3e4)](combineLatest([this['_collabCursorController']['getCollabCursors$'](_0x2edcf4),this[_0x51b0dc(0x3b6)][_0x51b0dc(0x3d4)]])[_0x51b0dc(0x31b)](map(([_0x557f69,_0x1f43ee])=>({'skeleton':_0x5cf8d7[_0x51b0dc(0x40f)](),'cursors':[..._0x557f69[_0x51b0dc(0x293)]()][_0x51b0dc(0x26c)](_0x8e166b=>({..._0x8e166b,'color':this[_0x51b0dc(0x3b6)]['getColorFromTheme'](_0x8e166b[_0x51b0dc(0x304)])}))})))[_0x51b0dc(0x3a1)](_0x55fecc=>{const _0x2948c2=_0x51b0dc;this[_0x2948c2(0x2c5)]();if(_0x55fecc){const {skeleton:_0x1d3906,cursors:_0x447718}=_0x55fecc;this[_0x2948c2(0x317)](_0x1d3906,_0x447718);}})),this[_0x51b0dc(0x397)](),this[_0x51b0dc(0x22e)]();}[_0x1222a9(0x317)](_0x135511,_0x2ecd57){const _0x2ade5e=_0x1222a9,{scene:_0x32de59,mainComponent:_0x7a55fe}=this[_0x2ade5e(0x243)],_0x4e9056=_0x2ecd57['map'](_0x3c8d14=>new DocCollabCursor(_0x3c8d14,_0x32de59,_0x135511,_0x7a55fe));this[_0x2ade5e(0x3da)]=_0x4e9056,this[_0x2ade5e(0x35a)]=_0x2ecd57;}[_0x1222a9(0x366)](){const _0x2d57c9=_0x1222a9;this['_removeCollabCursors']();const {scene:_0x4453d5,mainComponent:_0x5a3b8a}=this['_context'],_0x111a85=this[_0x2d57c9(0x2d9)]['getSkeleton'](),_0x4efd43=this[_0x2d57c9(0x35a)]['map'](_0x7a5ace=>new DocCollabCursor(_0x7a5ace,_0x4453d5,_0x111a85,_0x5a3b8a));this[_0x2d57c9(0x3da)]=_0x4efd43;}[_0x1222a9(0x2c5)](){const _0x2f33c0=_0x1222a9;this[_0x2f33c0(0x3da)][_0x2f33c0(0x2bc)](_0x4abb61=>_0x4abb61[_0x2f33c0(0x23d)]()),this[_0x2f33c0(0x3da)]=[];}[_0x1222a9(0x22e)](){const _0x18da8a=_0x1222a9,_0x176f87=[SetDocZoomRatioOperation['id']];this[_0x18da8a(0x3e4)](this[_0x18da8a(0x23f)][_0x18da8a(0x37c)](_0x111788=>{const _0x24e76e=_0x18da8a;if(_0x176f87[_0x24e76e(0x1ea)](_0x111788['id'])&&_0x111788[_0x24e76e(0x3ec)]['unitId']===this['_context'][_0x24e76e(0x273)])this[_0x24e76e(0x366)]();}));}[_0x1222a9(0x397)](){const _0x2ea744=_0x1222a9;this[_0x2ea744(0x3e4)](fromEventSubject(this[_0x2ea744(0x243)][_0x2ea744(0x284)][_0x2ea744(0x234)])['pipe'](_0x454b35(_0x3a8312=>_0x3a8312[_0x2ea744(0x24e)]===TRANSFORM_CHANGE_OBSERVABLE_TYPE['resize']),throttleTime(0x10))[_0x2ea744(0x3a1)](()=>{const _0x15471b=_0x2ea744;this[_0x15471b(0x366)]();}));}};DocCollabCursorRenderController=__decorate([__decorateParam(0x1,Inject(DocSkeletonManagerService)),__decorateParam(0x2,Inject(CollabCursorController)),__decorateParam(0x3,ICommandService),__decorateParam(0x4,Inject(ThemeService))],DocCollabCursorRenderController);const SHEET_COLLAB_CURSOR_BORDER_WIDTH=1.5;var SheetCollabCursorShape=class extends Shape{constructor(_0x2bd91f,_0x394283){const _0x49510b=_0x1222a9;super(_0x2bd91f,_0x394283),_defineProperty(this,_0x49510b(0x212),void 0x0),_defineProperty(this,_0x49510b(0x3a3),![]),_defineProperty(this,_0x49510b(0x251),void 0x0),_defineProperty(this,_0x49510b(0x252),''),_defineProperty(this,'_labelPosition',_0x49510b(0x3a7)),_defineProperty(this,_0x49510b(0x353),void 0x0),_defineProperty(this,'_showText',void 0x0),_defineProperty(this,_0x49510b(0x200),void 0x0),_defineProperty(this,_0x49510b(0x2e8),0x4),_defineProperty(this,_0x49510b(0x257),void 0x0),_defineProperty(this,_0x49510b(0x2f9),void 0x0),_defineProperty(this,_0x49510b(0x315),!![]),_defineProperty(this,_0x49510b(0x343),0x0);if(_0x394283){var _0x60d40d;this[_0x49510b(0x2ac)](_0x394283);if(_0x394283[_0x49510b(0x2be)]&&((_0x60d40d=_0x394283[_0x49510b(0x36f)])!==null&&_0x60d40d!==void 0x0?_0x60d40d:this[_0x49510b(0x2e8)])){var _0x40c82e;this['_startBlinking']((_0x40c82e=_0x394283[_0x49510b(0x36f)])!==null&&_0x40c82e!==void 0x0?_0x40c82e:this[_0x49510b(0x2e8)]);}}this[_0x49510b(0x3d7)]['subscribeEvent'](()=>this[_0x49510b(0x2ac)]({'hovered':!![]})),this[_0x49510b(0x316)][_0x49510b(0x279)](()=>this[_0x49510b(0x2ac)]({'hovered':![]}));}[_0x1222a9(0x2a2)](_0x35c808){this['_offsetY']=_0x35c808;}[_0x1222a9(0x2ac)](_0x527e3e){const _0x20f129=_0x1222a9;var _0x7ed917,_0x5404f0,_0x2f7893,_0x3a49ac,_0x285985,_0x1f7449,_0xe65893;this[_0x20f129(0x212)]=(_0x7ed917=_0x527e3e[_0x20f129(0x304)])!==null&&_0x7ed917!==void 0x0?_0x7ed917:this[_0x20f129(0x212)],this[_0x20f129(0x3a3)]=(_0x5404f0=_0x527e3e[_0x20f129(0x1e9)])!==null&&_0x5404f0!==void 0x0?_0x5404f0:this[_0x20f129(0x3a3)],this[_0x20f129(0x251)]=(_0x2f7893=_0x527e3e[_0x20f129(0x298)])!==null&&_0x2f7893!==void 0x0?_0x2f7893:this[_0x20f129(0x251)],this['_name']=(_0x3a49ac=_0x527e3e['name'])!==null&&_0x3a49ac!==void 0x0?_0x3a49ac:this[_0x20f129(0x252)],this[_0x20f129(0x245)]=(_0x285985=_0x527e3e[_0x20f129(0x3bb)])!==null&&_0x285985!==void 0x0?_0x285985:this['_labelPosition'],this[_0x20f129(0x353)]=(_0x1f7449=_0x527e3e[_0x20f129(0x320)])!==null&&_0x1f7449!==void 0x0?_0x1f7449:this[_0x20f129(0x353)],this['_showText']=(_0xe65893=_0x527e3e[_0x20f129(0x288)])!==null&&_0xe65893!==void 0x0?_0xe65893:this[_0x20f129(0x2f4)];if(_0x527e3e['highlightSecond']!==void 0x0)this['_highlightSecond']=_0x527e3e['highlightSecond'];if(_0x527e3e[_0x20f129(0x2be)]!==void 0x0)this['_highlight']=_0x527e3e[_0x20f129(0x2be)];if(_0x527e3e[_0x20f129(0x3bc)]!==void 0x0)this['_offsetY']=_0x527e3e[_0x20f129(0x3bc)];this['transformByState']({'width':_0x527e3e[_0x20f129(0x31e)],'height':_0x527e3e[_0x20f129(0x2d8)]});}[_0x1222a9(0x332)](_0x2d064a){const _0xdc8c4=_0x1222a9,{row:_0x4acffe,column:_0x497f60}=_0x2d064a;if(_0x4acffe>=this[_0xdc8c4(0x251)][_0xdc8c4(0x2dc)]&&_0x4acffe<=this['_range'][_0xdc8c4(0x2a5)]&&_0x497f60>=this[_0xdc8c4(0x251)][_0xdc8c4(0x33d)]&&_0x497f60<=this[_0xdc8c4(0x251)][_0xdc8c4(0x2c2)]){this[_0xdc8c4(0x2ac)]({'hovered':!![]});return;}this[_0xdc8c4(0x2ac)]({'hovered':![]});}['_startBlinking'](_0x28a76a){const _0x6bb20a=_0x1222a9;this[_0x6bb20a(0x26f)](),this[_0x6bb20a(0x315)]=!![],this[_0x6bb20a(0x2f9)]=window[_0x6bb20a(0x20a)](()=>{const _0x59e08d=_0x6bb20a;this[_0x59e08d(0x315)]=!this[_0x59e08d(0x315)],this['makeDirty'](!![]);},0x1f4),this['_blinkTimer']=window[_0x6bb20a(0x351)](()=>{const _0x4d4acd=_0x6bb20a;this[_0x4d4acd(0x26f)](),this[_0x4d4acd(0x315)]=!![],this['makeDirty'](!![]);},_0x28a76a*0x3e8);}['_stopBlinking'](){const _0xf942=_0x1222a9;this[_0xf942(0x2f9)]&&(window[_0xf942(0x2df)](this[_0xf942(0x2f9)]),this['_blinkIntervalTimer']=void 0x0),this[_0xf942(0x257)]&&(window[_0xf942(0x3db)](this['_blinkTimer']),this[_0xf942(0x257)]=void 0x0);}[_0x1222a9(0x388)](_0x2199e2){return![];}[_0x1222a9(0x23d)](){const _0x545b72=_0x1222a9;this['_stopBlinking'](),super[_0x545b72(0x23d)]();}[_0x1222a9(0x300)](_0x3a8ebf){const _0xd4eeb=_0x1222a9;let _0x3f7ffb=this[_0xd4eeb(0x212)],_0xa2e376=this[_0xd4eeb(0x353)];this[_0xd4eeb(0x200)]&&!this[_0xd4eeb(0x315)]&&(_0x3f7ffb=this[_0xd4eeb(0x230)](this[_0xd4eeb(0x212)]),_0xa2e376=this[_0xd4eeb(0x353)]?this['_getLighterColor'](this['_backgroundColor']):void 0x0);Rect[_0xd4eeb(0x218)](_0x3a8ebf,{'width':this['width'],'height':this[_0xd4eeb(0x2d8)],'strokeWidth':this[_0xd4eeb(0x2eb)]||1.5,'stroke':_0x3f7ffb,'evented':![],'fill':_0xa2e376});if(this[_0xd4eeb(0x3a3)]||this[_0xd4eeb(0x2f4)]){var _0x40aa28;_0x3a8ebf[_0xd4eeb(0x1e3)](),_0x3a8ebf[_0xd4eeb(0x368)](0x1,0x0,0x0,0x1,this[_0xd4eeb(0x31e)],(this[_0xd4eeb(0x245)]===_0xd4eeb(0x3d2)?0x0:-0x14)+((_0x40aa28=this[_0xd4eeb(0x343)])!==null&&_0x40aa28!==void 0x0?_0x40aa28:0x0)),TextBubbleShape['drawWith'](_0x3a8ebf,{'text':this[_0xd4eeb(0x252)],'color':_0x3f7ffb}),_0x3a8ebf[_0xd4eeb(0x341)]();}}[_0x1222a9(0x230)](_0x17d309){const _0x188a47=_0x1222a9;if(_0x17d309['startsWith']('#'))return _0x188a47(0x403)+Number[_0x188a47(0x3d8)](_0x17d309[_0x188a47(0x270)](0x1,0x3),0x10)+',\x20'+Number['parseInt'](_0x17d309[_0x188a47(0x270)](0x3,0x5),0x10)+',\x20'+Number[_0x188a47(0x3d8)](_0x17d309[_0x188a47(0x270)](0x5,0x7),0x10)+_0x188a47(0x25c);if(_0x17d309[_0x188a47(0x392)](_0x188a47(0x27e)))return _0x17d309[_0x188a47(0x289)](/[\d.]+\)$/g,_0x188a47(0x2ef));if(_0x17d309[_0x188a47(0x392)](_0x188a47(0x296)))return _0x17d309[_0x188a47(0x289)](_0x188a47(0x296),'rgba')[_0x188a47(0x289)](')',_0x188a47(0x25c));return _0x17d309;}};const SHEETS_COLLABORATION_CURSOR_Z_INDEX=0x1389;let SheetCollabCursorRenderController=class SheetCollabCursorRenderController extends RxDisposable{constructor(_0x441d3d,_0x1ff14b,_0x3e0ee8,_0x58c2a4){const _0x1f548c=_0x1222a9;super(),this['_context']=_0x441d3d,this[_0x1f548c(0x39c)]=_0x1ff14b,this[_0x1f548c(0x387)]=_0x3e0ee8,this['_themeService']=_0x58c2a4,_defineProperty(this,'_cursors',new Set()),_defineProperty(this,'_lastPointer',null),this['_init']();}[_0x1222a9(0x338)](){const _0x50c6bd=_0x1222a9;this[_0x50c6bd(0x39c)][_0x50c6bd(0x291)][_0x50c6bd(0x31b)](_0x4f9116(this[_0x50c6bd(0x381)]),_0x5f06ec(_0xd56fee=>{const _0x30dd2e=_0x50c6bd;if(_0xd56fee){const _0x150df9=_0xd56fee['sheetId'];return combineLatest(this[_0x30dd2e(0x387)][_0x30dd2e(0x20b)](this['_context']['unitId']),this[_0x30dd2e(0x3b6)]['currentTheme$'])['pipe'](map(([_0x220ab8,_0x326444])=>{const _0x1f2ff6=_0x30dd2e,_0x3b7cd0=new Map();return _0x220ab8[_0x1f2ff6(0x2bc)]((_0xfac682,_0x3546f4)=>{const _0xc773c0=_0x1f2ff6;if(_0xfac682[_0xc773c0(0x2f0)]===_0x150df9){const _0x271975={..._0xfac682};_0x271975[_0xc773c0(0x304)]=this[_0xc773c0(0x3b6)][_0xc773c0(0x26b)](_0xfac682[_0xc773c0(0x304)]),_0x3b7cd0[_0xc773c0(0x37a)](_0x3546f4,_0x271975);}}),{'skeleton':_0xd56fee,'cursors':_0x3b7cd0};}));}return of({'skeleton':null,'cursors':new Map()});}))['subscribe'](({skeleton:_0x56afd8,cursors:_0x1e9159})=>{const _0x1f5269=_0x50c6bd;this[_0x1f5269(0x2c5)]();if(_0x56afd8)this[_0x1f5269(0x317)](_0x56afd8,_0x1e9159);}),this[_0x50c6bd(0x39c)]['currentSkeleton$'][_0x50c6bd(0x3a1)](_0x4e2cd5=>{const _0x7fb969=_0x50c6bd;if(_0x4e2cd5==null)return;const {skeleton:_0x22cb37}=_0x4e2cd5,{scene:_0x2390a6}=this[_0x7fb969(0x243)];_0x2390a6[_0x7fb969(0x28e)]['subscribeEvent'](debounce(_0x3358bb=>{const _0x47d03d=_0x7fb969;var _0x596303,_0x43a711;const {offsetX:_0x596a8a,offsetY:_0x5314d8}=_0x3358bb,{x:_0x36ca42,y:_0x418e55}=_0x2390a6[_0x47d03d(0x35f)](Vector2[_0x47d03d(0x3a6)]([_0x596a8a,_0x5314d8])),{scaleX:_0x416723,scaleY:_0x535108}=_0x2390a6[_0x47d03d(0x213)](),_0x101432=_0x2390a6[_0x47d03d(0x3d5)](SHEET_VIEWPORT_KEY[_0x47d03d(0x394)]),_0x5186b0=_0x2390a6[_0x47d03d(0x3aa)](Vector2[_0x47d03d(0x3a6)]([_0x36ca42,_0x418e55]),_0x101432),_0x42db5e=_0x22cb37[_0x47d03d(0x3b3)](_0x596a8a,_0x5314d8,_0x416723,_0x535108,_0x5186b0);if(((_0x596303=this[_0x47d03d(0x208)])===null||_0x596303===void 0x0?void 0x0:_0x596303[_0x47d03d(0x2ca)])===_0x42db5e[_0x47d03d(0x2ca)]&&((_0x43a711=this[_0x47d03d(0x208)])===null||_0x43a711===void 0x0?void 0x0:_0x43a711[_0x47d03d(0x2af)])===_0x42db5e['row'])return;this[_0x47d03d(0x35a)][_0x47d03d(0x2bc)](_0x29d3c1=>{_0x29d3c1['onMouseMove'](_0x42db5e);});},0x64));});}[_0x1222a9(0x317)](_0x45fce3,_0x4936c2){const _0x3a7aff=_0x1222a9,_0x332cc4=this[_0x3a7aff(0x39c)][_0x3a7aff(0x2da)]();if(!_0x332cc4)return;const _0x3469fd=this[_0x3a7aff(0x201)]();if(!_0x3469fd)return;this['_cursors'][_0x3a7aff(0x2bc)](_0x158364=>{const _0x39d6d3=_0x3a7aff;_0x158364[_0x39d6d3(0x229)]();});const {scene:_0x465eaf}=_0x3469fd,_0x5f1d8d=mergeCollabCursors(Array[_0x3a7aff(0x2a1)](_0x4936c2[_0x3a7aff(0x293)]()))[_0x3a7aff(0x3b8)](_0x1b5fee=>{const _0x549d29=_0x3a7aff,{color:_0x5cd80a,range:_0x59dc80,name:_0x2415a3,selection:_0xd7433d,sheetID:_0x331079}=_0x1b5fee,{startColumn:_0x1b7214,startRow:_0x400a9f,endColumn:_0x3864f4,endRow:_0x39a976}=_0x59dc80,_0x4f1b33=getCoordByCell(_0x400a9f,_0x1b7214,_0x465eaf,_0x332cc4),_0x58d963=getCoordByCell(_0x39a976,_0x3864f4,_0x465eaf,_0x332cc4),{columnHeaderHeightAndMarginTop:_0x3ff865}=_0x332cc4,{startX:_0x2dc885,startY:_0x552ffd}=_0x4f1b33,{endX:_0x256a0e,endY:_0x28b9bc}=_0x58d963,_0x3decb2=_0x256a0e-_0x2dc885,_0x143228=_0x28b9bc-_0x552ffd;return new SheetCollabCursorShape(_0x2415a3,{'labelPosition':_0x552ffd-_0x3ff865>=0x14?_0x549d29(0x3a7):_0x549d29(0x3d2),'sheetID':_0x331079,'range':_0x59dc80,'color':_0x5cd80a,'name':_0x2415a3,'selection':_0xd7433d,'left':_0x2dc885,'top':_0x552ffd,'width':_0x3decb2,'height':_0x143228,'evented':![],'zIndex':SHEETS_COLLABORATION_CURSOR_Z_INDEX});});_0x465eaf[_0x3a7aff(0x25a)](_0x5f1d8d,0x1),this[_0x3a7aff(0x35a)]=new Set(_0x5f1d8d);}[_0x1222a9(0x2c5)](){const _0x578388=_0x1222a9;var _0x178b01;(_0x178b01=this[_0x578388(0x35a)])===null||_0x178b01===void 0x0||_0x178b01['forEach'](_0x2a6c26=>_0x2a6c26[_0x578388(0x23d)]());}[_0x1222a9(0x201)](){const _0x52bd25=_0x1222a9;return getSheetObject(this[_0x52bd25(0x243)][_0x52bd25(0x29b)],this[_0x52bd25(0x243)]);}};SheetCollabCursorRenderController=__decorate([__decorateParam(0x1,Inject(SheetSkeletonManagerService)),__decorateParam(0x2,Inject(CollabCursorController)),__decorateParam(0x3,Inject(ThemeService))],SheetCollabCursorRenderController);function mergeCollabCursors(_0x48de02){const _0x442c54=new Map();return _0x48de02['forEach'](_0xe3c246=>{const _0x524394=_0x2f58;if(_0x442c54[_0x524394(0x3fd)](_0xe3c246[_0x524394(0x2bf)])){const _0x10c813=_0x442c54[_0x524394(0x232)](_0xe3c246['selection']);_0x10c813[_0x524394(0x35c)]+=',\x20'+_0xe3c246['name'];}else _0x442c54['set'](_0xe3c246[_0x524394(0x2bf)],_0xe3c246);}),Array['from'](_0x442c54['values']());}let CollaborationClientUIController=class CollaborationClientUIController extends Disposable{constructor(_0x5e44aa,_0x36e3b2,_0x4d444a,_0x4be7c8,_0x132063,_0x2364cc){const _0x44aea6=_0x1222a9;super(),this[_0x44aea6(0x2a7)]=_0x5e44aa,this[_0x44aea6(0x3e2)]=_0x36e3b2,this[_0x44aea6(0x31a)]=_0x4d444a,this[_0x44aea6(0x364)]=_0x4be7c8,this[_0x44aea6(0x226)]=_0x132063,this['_localeService']=_0x2364cc,this[_0x44aea6(0x267)](),this[_0x44aea6(0x3fa)]();}[_0x1222a9(0x267)](){const _0xa4a6b7=_0x1222a9;this[_0xa4a6b7(0x3e4)](this[_0xa4a6b7(0x2a7)][_0xa4a6b7(0x3d1)](()=>{const _0x2176bf=_0xa4a6b7;if(this[_0x2176bf(0x3e2)][_0x2176bf(0x33c)]['size'])return this[_0x2176bf(0x40e)]['t'](_0x2176bf(0x1f6));}));}[_0x1222a9(0x3fa)](){const _0x4bf714=_0x1222a9;this[_0x4bf714(0x3e4)](this['_collaborationUIEventService'][_0x4bf714(0x2aa)][_0x4bf714(0x3a1)](_0x50e8af=>{const _0x523c5d=_0x4bf714;if(_0x50e8af['id']===CollaborationUIEventId[_0x523c5d(0x2d3)])this['_messageService']['show']({'type':MessageType[_0x523c5d(0x361)],'content':this[_0x523c5d(0x40e)]['t'](_0x523c5d(0x2e1))});if(_0x50e8af['id']===CollaborationUIEventId[_0x523c5d(0x339)])this[_0x523c5d(0x364)][_0x523c5d(0x24a)]({'type':MessageType[_0x523c5d(0x361)],'content':this[_0x523c5d(0x40e)]['t'](_0x523c5d(0x3f3))});if(_0x50e8af['id']===CollaborationUIEventId[_0x523c5d(0x2d0)])this['_notificationService'][_0x523c5d(0x24a)]({'title':this[_0x523c5d(0x40e)]['t'](_0x523c5d(0x253)),'content':this['_localeService']['t'](_0x523c5d(0x36a)),'type':_0x523c5d(0x3c0),'duration':0x0});if(_0x50e8af['id']===CollaborationUIEventId['CONFLICT'])this['_messageService'][_0x523c5d(0x24a)]({'type':MessageType['Error'],'content':this[_0x523c5d(0x40e)]['t']('collaboration.closeRoom')+'('+_0x50e8af[_0x523c5d(0x2c9)]+')'});if(_0x50e8af['id']===CollaborationUIEventId[_0x523c5d(0x3e5)])this[_0x523c5d(0x364)]['show']({'type':MessageType[_0x523c5d(0x361)],'content':this[_0x523c5d(0x40e)]['t'](_0x50e8af[_0x523c5d(0x2c9)]||'')});if(_0x50e8af['id']===CollaborationUIEventId['SOCKET_FAILED_RETRY'])this[_0x523c5d(0x364)]['show']({'type':MessageType[_0x523c5d(0x361)],'content':this[_0x523c5d(0x40e)]['t']('session.will-retry')});if(_0x50e8af['id']===CollaborationUIEventId[_0x523c5d(0x1e7)])this['_messageService']['show']({'type':MessageType[_0x523c5d(0x321)],'content':this['_localeService']['t'](_0x523c5d(0x26a))});if(_0x50e8af['id']===CollaborationUIEventId['SUBMIT_CHANGESET_TIMEOUT'])this[_0x523c5d(0x364)]['show']({'type':MessageType[_0x523c5d(0x321)],'content':this[_0x523c5d(0x40e)]['t'](_0x523c5d(0x3bf))});}));}};CollaborationClientUIController=__decorate([__decorateParam(0x0,IBeforeCloseService),__decorateParam(0x1,ILocalCacheService),__decorateParam(0x2,Inject(CollaborationUIEventService)),__decorateParam(0x3,IMessageService),__decorateParam(0x4,INotificationService),__decorateParam(0x5,Inject(LocaleService))],CollaborationClientUIController);const PLUGIN_CONFIG_KEY=_0x1222a9(0x360),configSymbol=Symbol(PLUGIN_CONFIG_KEY),defaultPluginConfig={};let DocTransformIMECacheService=class DocTransformIMECacheService{constructor(_0x102cc5,_0x589545){const _0x73313b=_0x1222a9;this[_0x73313b(0x352)]=_0x102cc5,this[_0x73313b(0x371)]=_0x589545;}[_0x1222a9(0x410)](_0x2557ba){const _0x159f44=_0x1222a9;this[_0x159f44(0x2ce)](_0x2557ba),this[_0x159f44(0x28a)](_0x2557ba);}[_0x1222a9(0x2c8)](_0x53a87f){const _0x563bd4=_0x1222a9,{unitID:_0x35bbd7}=_0x53a87f,{redoCache:_0x2c68d1}=this['_renderManagerService'][_0x563bd4(0x2ea)](_0x35bbd7)[_0x563bd4(0x3af)](DocIMEInputManagerService)[_0x563bd4(0x2e9)]();if(_0x2c68d1[_0x563bd4(0x2c1)]===0x0)return _0x53a87f;let _0x5a56ad=Tools[_0x563bd4(0x396)](_0x53a87f[_0x563bd4(0x310)][0x0]);for(let _0x29352b=0x0;_0x29352b<_0x2c68d1['length'];_0x29352b++){const _0x3946fd={'id':_0x563bd4(0x2e0),'params':{..._0x2c68d1[_0x29352b]}},_0x1b1abc=this[_0x563bd4(0x352)][_0x563bd4(0x3f4)](_0x5a56ad,_0x3946fd,![]);if(isTransformMutationFailure(_0x1b1abc))throw _0x1b1abc[_0x563bd4(0x3c0)];_0x5a56ad=_0x1b1abc[_0x563bd4(0x1ee)];}return{...Tools[_0x563bd4(0x396)](_0x53a87f),'mutations':[_0x5a56ad]};}[_0x1222a9(0x2ce)](_0x33f673){const _0x471b6d=_0x1222a9,{unitID:_0x16c3d7}=_0x33f673,_0x46e6bd=this[_0x471b6d(0x371)][_0x471b6d(0x2ea)](_0x16c3d7)['with'](DocIMEInputManagerService),{undoCache:_0x146eec,redoCache:_0x4a4662}=_0x46e6bd[_0x471b6d(0x2e9)]();if(_0x146eec['length']===0x0||_0x4a4662[_0x471b6d(0x2c1)]===0x0)return;const _0x23c87c=[],_0x20c6e9=[];let _0x758a5e=Tools['deepClone'](_0x33f673['mutations'][0x0]),_0x2f17c4=Tools[_0x471b6d(0x396)](_0x33f673[_0x471b6d(0x310)][0x0]);for(let _0x3bd1a1=_0x146eec[_0x471b6d(0x2c1)]-0x1;_0x3bd1a1>=0x0;_0x3bd1a1--){const _0x18cfa7={'id':_0x471b6d(0x2e0),'params':{..._0x146eec[_0x3bd1a1]}},_0x2a37d0={'id':_0x471b6d(0x2e0),'params':{..._0x4a4662[_0x3bd1a1]}},_0x988c98=this[_0x471b6d(0x352)][_0x471b6d(0x3f4)](_0x758a5e,_0x18cfa7,![]),_0x50f509=this[_0x471b6d(0x352)][_0x471b6d(0x3f4)](_0x2f17c4,_0x2a37d0,![]);if(isTransformMutationFailure(_0x988c98))throw _0x988c98[_0x471b6d(0x3c0)];if(isTransformMutationFailure(_0x50f509))throw _0x50f509[_0x471b6d(0x3c0)];_0x23c87c[_0x471b6d(0x240)](_0x988c98['m2Prime'][_0x471b6d(0x3ec)]),_0x20c6e9[_0x471b6d(0x240)](_0x50f509[_0x471b6d(0x359)]['params']),_0x758a5e=_0x988c98['m1Prime'],_0x2f17c4=_0x50f509['m1Prime'];}_0x46e6bd[_0x471b6d(0x205)]({'undoCache':_0x23c87c,'redoCache':_0x20c6e9});}['_transformPreviousActiveRange'](_0x219a7f){const _0xb184ee=_0x1222a9,{unitID:_0x466f31}=_0x219a7f,_0x239061=this[_0xb184ee(0x371)][_0xb184ee(0x2ea)](_0x466f31)[_0xb184ee(0x3af)](DocIMEInputManagerService),_0x47c1cd=_0x239061['getActiveRange']();if(_0x47c1cd==null)return;const _0xa7c842=[{'id':_0xb184ee(0x2e0),'params':{'unitId':_0x219a7f[_0xb184ee(0x3eb)],'actions':null,'textRanges':[_0x47c1cd]}}],_0x4bb891=this[_0xb184ee(0x352)][_0xb184ee(0x340)](_0x219a7f,_0xa7c842);if(!isTransformMutationsWithChangesetSuccess(_0x4bb891))throw _0x4bb891[_0xb184ee(0x3c0)];const _0x2659d8=_0x4bb891['m2Prime'][0x0][_0xb184ee(0x3ec)]['textRanges'];if(Array['isArray'](_0x2659d8)&&_0x2659d8[_0xb184ee(0x2c1)])_0x239061['setActiveRange'](_0x2659d8[0x0]);}};DocTransformIMECacheService=__decorate([__decorateParam(0x0,ITransformService),__decorateParam(0x1,IRenderManagerService)],DocTransformIMECacheService);let DocTransformStateCacheService=class DocTransformStateCacheService{constructor(_0xe019ee,_0x17149f,_0x123560){const _0xa2969e=_0x1222a9;this[_0xa2969e(0x21b)]=_0xe019ee,this[_0xa2969e(0x352)]=_0x17149f,this[_0xa2969e(0x2a6)]=_0x123560;}['transformStateCache'](_0x3e4cd0){const _0x13c87a=_0x1222a9;this[_0x13c87a(0x31f)](_0x3e4cd0);}['transformRemoteChangeset'](_0x2313f1){const _0x2293e5=_0x1222a9,{unitID:_0x5281bf}=_0x2313f1,{collaboration:_0x250e6e}=this[_0x2293e5(0x2a6)][_0x2293e5(0x2a0)](_0x5281bf);if(_0x250e6e[_0x2293e5(0x2c1)]===0x0)return _0x2313f1;let _0x5593a2=Tools['deepClone'](_0x2313f1[_0x2293e5(0x310)][0x0]);for(let _0x3492c1=0x0;_0x3492c1<_0x250e6e[_0x2293e5(0x2c1)];_0x3492c1++){const _0x33882={'id':'doc.mutation.rich-text-editing','params':{'unitId':_0x250e6e[_0x3492c1][_0x2293e5(0x273)],..._0x250e6e[_0x3492c1][_0x2293e5(0x24c)]}},_0xa81be=this['_transformService'][_0x2293e5(0x3f4)](_0x5593a2,_0x33882,![]);if(isTransformMutationFailure(_0xa81be))throw _0xa81be[_0x2293e5(0x3c0)];_0x5593a2=_0xa81be['m1Prime'];}return{...Tools[_0x2293e5(0x396)](_0x2313f1),'mutations':[_0x5593a2]};}[_0x1222a9(0x31f)](_0x286edf){const _0x4892e6=_0x1222a9,{unitID:_0x586554}=_0x286edf,{history:_0xbe9ed5,collaboration:_0x31f4f1}=this[_0x4892e6(0x2a6)][_0x4892e6(0x2a0)](_0x586554);if(_0xbe9ed5[_0x4892e6(0x2c1)]===0x0&&_0x31f4f1[_0x4892e6(0x2c1)]===0x0)return;const _0x14b56a=[],_0x1dd2c3=[];let _0x543286=Tools[_0x4892e6(0x396)](_0x286edf[_0x4892e6(0x310)][0x0]),_0x56102b=Tools[_0x4892e6(0x396)](_0x286edf['mutations'][0x0]);for(let _0x2af9e2=_0xbe9ed5[_0x4892e6(0x2c1)]-0x1;_0x2af9e2>=0x0;_0x2af9e2--){const _0x24cd87={'id':_0x4892e6(0x2e0),'params':{'unitId':_0xbe9ed5[_0x2af9e2][_0x4892e6(0x273)],..._0xbe9ed5[_0x2af9e2]['undoState']}},_0x1854d0={'id':_0x4892e6(0x2e0),'params':{'unitId':_0xbe9ed5[_0x2af9e2][_0x4892e6(0x273)],..._0xbe9ed5[_0x2af9e2][_0x4892e6(0x24c)]}},_0x140854=this[_0x4892e6(0x352)][_0x4892e6(0x3f4)](_0x543286,_0x24cd87,![]),_0x4e57bc=this['_transformService'][_0x4892e6(0x3f4)](_0x56102b,_0x1854d0,![]);if(isTransformMutationFailure(_0x140854))throw _0x140854['error'];if(isTransformMutationFailure(_0x4e57bc))throw _0x4e57bc[_0x4892e6(0x3c0)];_0x14b56a[_0x4892e6(0x240)]({..._0xbe9ed5[_0x2af9e2],'undoState':_0x140854['m2Prime'][_0x4892e6(0x3ec)],'redoState':_0x4e57bc[_0x4892e6(0x359)][_0x4892e6(0x3ec)]}),_0x543286=_0x140854[_0x4892e6(0x1ee)],_0x56102b=_0x4e57bc['m1Prime'];}_0x543286=Tools['deepClone'](_0x286edf[_0x4892e6(0x310)][0x0]),_0x56102b=Tools[_0x4892e6(0x396)](_0x286edf[_0x4892e6(0x310)][0x0]);for(let _0x30cd43=_0x31f4f1[_0x4892e6(0x2c1)]-0x1;_0x30cd43>=0x0;_0x30cd43--){const _0xfa6ec2={'id':'doc.mutation.rich-text-editing','params':{'unitId':_0x31f4f1[_0x30cd43][_0x4892e6(0x273)],..._0x31f4f1[_0x30cd43][_0x4892e6(0x3ad)]}},_0x26babb={'id':'doc.mutation.rich-text-editing','params':{'unitId':_0x31f4f1[_0x30cd43][_0x4892e6(0x273)],..._0x31f4f1[_0x30cd43][_0x4892e6(0x24c)]}},_0x1065a4=this[_0x4892e6(0x352)][_0x4892e6(0x3f4)](_0x543286,_0xfa6ec2,![]),_0x3e493b=this[_0x4892e6(0x352)][_0x4892e6(0x3f4)](_0x56102b,_0x26babb,![]);if(isTransformMutationFailure(_0x1065a4))throw _0x1065a4[_0x4892e6(0x3c0)];if(isTransformMutationFailure(_0x3e493b))throw _0x3e493b['error'];_0x1dd2c3['unshift']({..._0x31f4f1[_0x30cd43],'undoState':_0x1065a4[_0x4892e6(0x359)][_0x4892e6(0x3ec)],'redoState':_0x3e493b[_0x4892e6(0x359)][_0x4892e6(0x3ec)]}),_0x543286=_0x1065a4['m1Prime'],_0x56102b=_0x3e493b['m1Prime'];}this[_0x4892e6(0x2a6)][_0x4892e6(0x275)](_0x586554,{'history':_0x14b56a,'collaboration':_0x1dd2c3});}};DocTransformStateCacheService=__decorate([__decorateParam(0x0,Inject(Injector)),__decorateParam(0x1,ITransformService),__decorateParam(0x2,Inject(DocStateChangeManagerService))],DocTransformStateCacheService);let DocTransformSelectionsService=class DocTransformSelectionsService{constructor(_0x295a8d,_0x58629e){const _0x214ca7=_0x1222a9;this[_0x214ca7(0x21b)]=_0x295a8d,this[_0x214ca7(0x352)]=_0x58629e;}[_0x1222a9(0x32b)](_0x3a7e3a){const _0x79da65=_0x1222a9;var _0x1d5ec5;const _0x2a4e68=this[_0x79da65(0x21b)][_0x79da65(0x232)](DocSelectionManagerService),_0x322bd4=(_0x1d5ec5=_0x2a4e68['getDocRanges']())!==null&&_0x1d5ec5!==void 0x0?_0x1d5ec5:[];if(_0x322bd4[_0x79da65(0x2c1)]===0x0)return;const _0x131b62=_0x3a7e3a[_0x79da65(0x3eb)],_0x5834b0=[{'id':_0x79da65(0x2e0),'params':{'unitId':_0x131b62,'actions':null,'textRanges':_0x322bd4}}],_0x4c7029=this[_0x79da65(0x352)]['transformMutationsWithChangeset'](_0x3a7e3a,_0x5834b0);if(!isTransformMutationsWithChangesetSuccess(_0x4c7029))throw _0x4c7029['error'];const _0x2ee11e=_0x4c7029[_0x79da65(0x359)][0x0][_0x79da65(0x3ec)][_0x79da65(0x290)];if(Array[_0x79da65(0x1e6)](_0x2ee11e)&&_0x2ee11e[_0x79da65(0x2c1)])_0x2a4e68[_0x79da65(0x408)](_0x2ee11e,{'unitId':_0x131b62,'subUnitId':_0x131b62},![]);}};DocTransformSelectionsService=__decorate([__decorateParam(0x0,Inject(Injector)),__decorateParam(0x1,ITransformService)],DocTransformSelectionsService);let CollaborationEntityUIController=class CollaborationEntityUIController extends Disposable{constructor(_0x481810,_0x5c402b,_0x10b515,_0x18c9cf,_0x181590,_0xaa4b49,_0x40be34,_0x4d6c0c){const _0x2b10c2=_0x1222a9;super(),this[_0x2b10c2(0x2a6)]=_0x481810,this[_0x2b10c2(0x3d6)]=_0x5c402b,this[_0x2b10c2(0x27b)]=_0x10b515,this[_0x2b10c2(0x325)]=_0x18c9cf,this[_0x2b10c2(0x21a)]=_0x181590,this[_0x2b10c2(0x305)]=_0xaa4b49,this[_0x2b10c2(0x364)]=_0x40be34,this[_0x2b10c2(0x40e)]=_0x4d6c0c,_defineProperty(this,_0x2b10c2(0x2e6),new BehaviorSubject(CollaborationStatus['NOT_COLLAB'])),this['_initEntityListener']();}[_0x1222a9(0x1eb)](){const _0x3e2cf4=_0x1222a9;this[_0x3e2cf4(0x3e4)](this[_0x3e2cf4(0x3d6)][_0x3e2cf4(0x206)][_0x3e2cf4(0x3a1)](_0x326eca=>{const _0x140b60=_0x3e2cf4,_0x40a8b9=this['_docStateChangeManagerService'][_0x140b60(0x1f3)][_0x140b60(0x3a1)](_0x3b6deb=>{const _0x47194a=_0x140b60;if(_0x3b6deb==null)return;const {unitId:_0x2ae191,redoState:_0xcef46,commandId:_0x3ab0d7}=_0x3b6deb;if(_0x2ae191!==_0x326eca[_0x47194a(0x3eb)])return;const _0x54ed25={'id':_0x3ab0d7,'type':CommandType[_0x47194a(0x38b)],'params':{'unitId':_0x2ae191,'actions':_0xcef46[_0x47194a(0x1fe)],'textRanges':null}};_0x326eca[_0x47194a(0x400)](_0x54ed25);});_0x326eca[_0x140b60(0x3e4)](_0x40a8b9);if(_0x326eca instanceof DocCollaborationEntity)_0x326eca[_0x140b60(0x210)]({'onTransformIME':_0x1a45eb=>this[_0x140b60(0x27b)][_0x140b60(0x410)](_0x1a45eb),'onTransformState':_0x5d580b=>this[_0x140b60(0x325)][_0x140b60(0x385)](_0x5d580b),'onTransformSelections':_0x32c147=>this['_docTransformSelectionsService'][_0x140b60(0x32b)](_0x32c147),'onSyncEditingCollabCursor':_0x3ffd26=>this[_0x140b60(0x305)][_0x140b60(0x2ae)](_0x3ffd26),'onTransformRemoteChangesetByIMECache':_0x1df20f=>this['_docTransformIMECacheService'][_0x140b60(0x2c8)](_0x1df20f),'onTransformRemoteChangesetByStateCache':_0xf5409b=>this[_0x140b60(0x325)][_0x140b60(0x2c8)](_0xf5409b)});}));}};CollaborationEntityUIController=__decorate([__decorateParam(0x0,Inject(DocStateChangeManagerService)),__decorateParam(0x1,Inject(CollaborationController)),__decorateParam(0x2,Inject(DocTransformIMECacheService)),__decorateParam(0x3,Inject(DocTransformStateCacheService)),__decorateParam(0x4,Inject(DocTransformSelectionsService)),__decorateParam(0x5,Inject(DocSyncEditingCollabCursorService)),__decorateParam(0x6,IMessageService),__decorateParam(0x7,Inject(LocaleService))],CollaborationEntityUIController);let FrontendLogController=class FrontendLogController extends Disposable{constructor(_0x2d6ba3,_0x3774e5,_0xf12879,_0x1998d5){const _0x5c3f96=_0x1222a9;super(),this[_0x5c3f96(0x21b)]=_0x2d6ba3,this[_0x5c3f96(0x2dd)]=_0x3774e5,this[_0x5c3f96(0x38a)]=_0xf12879,this[_0x5c3f96(0x1ec)]=_0x1998d5,_defineProperty(this,_0x5c3f96(0x29f),void 0x0),this['_init']();}['_init'](){const _0x30b0ed=_0x1222a9;this[_0x30b0ed(0x301)](),this['_initUnhandledRejectionListener'](),this[_0x30b0ed(0x3fe)](),this[_0x30b0ed(0x29e)]();}[_0x1222a9(0x29e)](){const _0x1848d4=_0x1222a9;this[_0x1848d4(0x3e4)](this['_collaborationSessionService'][_0x1848d4(0x373)][_0x1848d4(0x3a1)](_0xe2eb51=>{const _0x2bfb71=_0x1848d4;this[_0x2bfb71(0x29f)]=_0xe2eb51===null||_0xe2eb51===void 0x0?void 0x0:_0xe2eb51[_0x2bfb71(0x35e)];}));}['_initWindowErrorListener'](){const _0x2c1b29=_0x1222a9,_0x9c88b8=_0x2e3e55=>{const _0x248023=_0x2f58;var _0x55cc03;this[_0x248023(0x2d1)](_0x248023(0x3c0),'[Window\x20Error]:\x20'+_0x2e3e55[_0x248023(0x3ba)]+_0x248023(0x32e)+_0x2e3e55['filename']+':'+_0x2e3e55[_0x248023(0x3be)]+':'+_0x2e3e55[_0x248023(0x2fc)]+'\x0a'+(((_0x55cc03=_0x2e3e55[_0x248023(0x3c0)])===null||_0x55cc03===void 0x0?void 0x0:_0x55cc03[_0x248023(0x2c4)])||''));};window[_0x2c1b29(0x1f5)](_0x2c1b29(0x3c0),_0x9c88b8),this[_0x2c1b29(0x3e4)](()=>{const _0x2016bb=_0x2c1b29;window[_0x2016bb(0x264)](_0x2016bb(0x3c0),_0x9c88b8);});}[_0x1222a9(0x3b4)](){const _0x5b547a=_0x1222a9,_0x563f21=_0x4c4494=>{const _0x4c9c41=_0x2f58;this['_uploadLog'](_0x4c9c41(0x3c0),_0x4c9c41(0x25e)+_0x4c4494['reason']);};window[_0x5b547a(0x1f5)](_0x5b547a(0x32a),_0x563f21),this[_0x5b547a(0x3e4)](()=>{const _0x49dc29=_0x5b547a;window[_0x49dc29(0x264)](_0x49dc29(0x32a),_0x563f21);});}[_0x1222a9(0x3fe)](){const _0x37228e=_0x1222a9,_0x9fd22d=this[_0x37228e(0x38a)]['error']['bind'](this[_0x37228e(0x38a)]);this[_0x37228e(0x38a)][_0x37228e(0x3c0)]=(..._0x3348c2)=>{const _0x42bc22=_0x37228e,_0x598e62=_0x3348c2[_0x42bc22(0x3b8)](_0x53e918=>_0x53e918 instanceof Error?_0x53e918[_0x42bc22(0x3ba)]+'\x0a'+_0x53e918[_0x42bc22(0x2c4)]:String(_0x53e918))[_0x42bc22(0x324)]('\x20');this['_uploadLog'](_0x42bc22(0x3c0),_0x42bc22(0x1ed)+_0x598e62),_0x9fd22d(..._0x3348c2);},this[_0x37228e(0x3e4)](()=>{const _0x2e4d19=_0x37228e;this[_0x2e4d19(0x38a)]['error']=_0x9fd22d;});}['_uploadLog'](_0x37cb0c,_0x34dbff){const _0x4b92f5=_0x1222a9;try{const _0x55c21a={'userId':this['_memberID'],'logLabel':_0x37cb0c,'content':_0x34dbff};this[_0x4b92f5(0x2dd)][_0x4b92f5(0x37e)]('/universer-api/frontend/logs',{'body':_0x55c21a})[_0x4b92f5(0x36c)](()=>{});}catch{}}};FrontendLogController=__decorate([__decorateParam(0x0,Inject(Injector)),__decorateParam(0x1,Inject(HTTPService)),__decorateParam(0x2,ILogService),__decorateParam(0x3,Inject(CollaborationSessionService))],FrontendLogController);function isCalculationStart(_0x3fc4fc){const _0x422f2b=_0x1222a9;var _0x52a3df,_0x2d72d5;const _0x275cf5=(_0x52a3df=_0x3fc4fc[_0x422f2b(0x39d)])===null||_0x52a3df===void 0x0?void 0x0:_0x52a3df[_0x422f2b(0x2f5)],_0x7010e9=((_0x2d72d5=_0x3fc4fc[_0x422f2b(0x39d)])===null||_0x2d72d5===void 0x0?void 0x0:_0x2d72d5[_0x422f2b(0x1fd)])||0x0;return _0x275cf5===FormulaExecuteStageType[_0x422f2b(0x26d)]&&_0x7010e9>0x0;}function isCalculationComplete(_0x50fa61){const _0x57e95f=_0x1222a9;return _0x50fa61[_0x57e95f(0x2d4)]===FormulaExecutedStateType[_0x57e95f(0x393)];}const DEFAULT_FORMULA_CALCULATION_LIMIT_STATUS_URL=_0x1222a9(0x357),DEFAULT_FORMULA_CALCULATION_LIMIT_START_URL=_0x1222a9(0x22f),DEFAULT_FORMULA_CALCULATION_LIMIT_DONE_URL='/universer-api/license/formula/limit/done';let FormulaCalculationGuardService=class FormulaCalculationGuardService extends Disposable{constructor(_0x2dfdca,_0x130853,_0x461704,_0x493ba5,_0x3f1a9f,_0x17ff05,_0x48299d){const _0x5f46eb=_0x1222a9;super(),this['_messageService']=_0x2dfdca,this[_0x5f46eb(0x23f)]=_0x130853,this[_0x5f46eb(0x356)]=_0x461704,this[_0x5f46eb(0x2dd)]=_0x493ba5,this['_univerInstanceService']=_0x3f1a9f,this[_0x5f46eb(0x38a)]=_0x17ff05,this[_0x5f46eb(0x40e)]=_0x48299d,_defineProperty(this,'_pollingInterval',null),_defineProperty(this,'_maxFormulaLimit',0x0),_defineProperty(this,_0x5f46eb(0x382),0x0),_defineProperty(this,_0x5f46eb(0x378),[]),_defineProperty(this,'_lastResponseTimestamp',0x0),this[_0x5f46eb(0x1f4)]();}[_0x1222a9(0x1f4)](){const _0x2f6596=_0x1222a9;this['disposeWithMe'](this[_0x2f6596(0x23f)][_0x2f6596(0x3ac)]((_0x3d0f88,_0x5bc0b3)=>{const _0x4fb787=_0x2f6596;var _0x190757;if(_0x3d0f88['id']!==SetFormulaCalculationStartMutation['id'])return;const _0x34465d=_0x3d0f88[_0x4fb787(0x3ec)];if(!this[_0x4fb787(0x38d)]((_0x190757=_0x34465d[_0x4fb787(0x383)])!==null&&_0x190757!==void 0x0?_0x190757:[]))return;if(!this[_0x4fb787(0x40a)]()){this['_checkAndWaitForCalculationPermission'](_0x3d0f88,_0x5bc0b3),this[_0x4fb787(0x311)]();throw new CanceledError();}})),this[_0x2f6596(0x3e4)](this[_0x2f6596(0x23f)][_0x2f6596(0x37c)]((_0xa1b9ea,_0x35aa14)=>{const _0x124418=_0x2f6596;if(_0xa1b9ea['id']!==SetFormulaCalculationNotificationMutation['id'])return;const _0x388793=_0xa1b9ea['params'];if(isCalculationStart(_0x388793)){const _0x216a9e=generateRandomId();this[_0x124418(0x378)][_0x124418(0x29a)](_0x216a9e),this[_0x124418(0x28b)](_0x216a9e);}else{if(isCalculationComplete(_0x388793)){if(this['_taskIds']['length']>0x0){const _0x5c10c8=this['_taskIds'][_0x124418(0x322)]();this['_releaseCalculationLimit'](_0x5c10c8);}}}}));}['dispose'](){const _0xa601e8=_0x1222a9;super[_0xa601e8(0x23d)](),this[_0xa601e8(0x354)](),this['_taskIds']=[],this['_currentUsage']=0x0,this[_0xa601e8(0x21c)]=0x0,this[_0xa601e8(0x3ed)]=0x0;}async[_0x1222a9(0x2b6)](_0x3aad94,_0x235582){const _0x2588bc=_0x1222a9,_0x29d34a=0x1e,_0x27cfbb=0x3e8;for(let _0x343ee7=0x0;_0x343ee7<_0x29d34a;_0x343ee7++)try{await this['_getFormulaLimitStatus']();if(this[_0x2588bc(0x40a)]()){this[_0x2588bc(0x236)](_0x3aad94,_0x235582),this['_messageService'][_0x2588bc(0x24a)]({'content':this[_0x2588bc(0x40e)]['t'](_0x2588bc(0x3b2)),'type':MessageType[_0x2588bc(0x246)]});return;}await new Promise(_0x42112d=>{const _0x3cf5b0=_0x2588bc;this[_0x3cf5b0(0x401)]=window[_0x3cf5b0(0x351)](_0x42112d,_0x27cfbb);});}catch(_0x26a4a9){this[_0x2588bc(0x38a)][_0x2588bc(0x3c0)](_0x26a4a9);}this[_0x2588bc(0x364)]['show']({'content':this['_localeService']['t'](_0x2588bc(0x30d)),'type':MessageType[_0x2588bc(0x321)]});}[_0x1222a9(0x236)](_0x2e0d80,_0x33240){const _0x2ef765=_0x1222a9;try{this['_commandService']['executeCommand'](_0x2e0d80['id'],_0x2e0d80[_0x2ef765(0x3ec)],_0x33240);}catch(_0x468f82){this[_0x2ef765(0x38a)][_0x2ef765(0x3c0)](_0x468f82);}}[_0x1222a9(0x328)](_0x2edc19,_0x3c1b51){const _0x41f651=_0x1222a9;if(_0x3c1b51<this[_0x41f651(0x3ed)])return;this[_0x41f651(0x3ed)]=_0x3c1b51,this['_maxFormulaLimit']=Number[_0x41f651(0x3d8)](_0x2edc19[_0x41f651(0x3df)]),this[_0x41f651(0x382)]=Number['parseInt'](_0x2edc19[_0x41f651(0x34b)]);}async[_0x1222a9(0x28b)](_0x4dcdc4){const _0xc11dc4=_0x1222a9,_0x504b17=Date[_0xc11dc4(0x2f7)]();try{var _0xab9c11,_0x3ecbf2;const _0x1f464c=((_0xab9c11=this[_0xc11dc4(0x356)][_0xc11dc4(0x268)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY))===null||_0xab9c11===void 0x0?void 0x0:_0xab9c11[_0xc11dc4(0x3c5)])||DEFAULT_FORMULA_CALCULATION_LIMIT_START_URL,_0x4117b7=(await this[_0xc11dc4(0x2dd)]['post'](_0x1f464c,{'body':JSON[_0xc11dc4(0x233)]({'taskId':_0x4dcdc4})}))['body'];if(((_0x3ecbf2=_0x4117b7[_0xc11dc4(0x3c0)])===null||_0x3ecbf2===void 0x0?void 0x0:_0x3ecbf2[_0xc11dc4(0x209)])!==ErrorCode['OK'])return;this[_0xc11dc4(0x328)](_0x4117b7[_0xc11dc4(0x219)],_0x504b17);}catch(_0x3d7f24){this[_0xc11dc4(0x38a)]['error'](_0x3d7f24);}}async[_0x1222a9(0x269)](_0x465392){const _0x42045a=_0x1222a9,_0x50cb9f=Date['now']();try{var _0x3df64e,_0x45ad65;const _0x4bf490=((_0x3df64e=this['_configService'][_0x42045a(0x268)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY))===null||_0x3df64e===void 0x0?void 0x0:_0x3df64e[_0x42045a(0x303)])||DEFAULT_FORMULA_CALCULATION_LIMIT_STATUS_URL,_0x33fe0b=_0x465392?_0x4bf490+_0x42045a(0x395)+encodeURIComponent(_0x465392):_0x4bf490,_0xd4a077=(await this['_httpService'][_0x42045a(0x232)](_0x33fe0b))[_0x42045a(0x2de)];if(((_0x45ad65=_0xd4a077[_0x42045a(0x3c0)])===null||_0x45ad65===void 0x0?void 0x0:_0x45ad65['code'])!==ErrorCode['OK'])return;this['_setFormulaLimitStatus'](_0xd4a077[_0x42045a(0x219)],_0x50cb9f);}catch(_0x1b5062){this[_0x42045a(0x38a)][_0x42045a(0x3c0)](_0x1b5062);}}async[_0x1222a9(0x1e4)](_0x167bc3){const _0x31e867=_0x1222a9,_0x150327=Date[_0x31e867(0x2f7)]();try{var _0x7b2764,_0x15658d;const _0x328984=((_0x7b2764=this[_0x31e867(0x356)]['getConfig'](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY))===null||_0x7b2764===void 0x0?void 0x0:_0x7b2764[_0x31e867(0x390)])||DEFAULT_FORMULA_CALCULATION_LIMIT_DONE_URL,_0xa05c82=(await this[_0x31e867(0x2dd)]['post'](_0x328984,{'body':JSON[_0x31e867(0x233)]({'taskId':_0x167bc3})}))[_0x31e867(0x2de)];if(((_0x15658d=_0xa05c82['error'])===null||_0x15658d===void 0x0?void 0x0:_0x15658d['code'])!==ErrorCode['OK'])return;this['_setFormulaLimitStatus'](_0xa05c82[_0x31e867(0x219)],_0x150327);}catch(_0x27e926){this[_0x31e867(0x38a)][_0x31e867(0x3c0)](_0x27e926);}}[_0x1222a9(0x40a)](){const _0x51a564=_0x1222a9;if(this[_0x51a564(0x21c)]===0x0)return!![];return this[_0x51a564(0x21c)]-this[_0x51a564(0x382)]>0x0;}['_clearPolling'](){const _0x401416=_0x1222a9;this[_0x401416(0x401)]&&(clearTimeout(this[_0x401416(0x401)]),this[_0x401416(0x401)]=null);}[_0x1222a9(0x311)](){const _0xa041f1=_0x1222a9;this[_0xa041f1(0x364)]['show']({'content':this[_0xa041f1(0x40e)]['t'](_0xa041f1(0x2b8)),'type':MessageType['Loading']});}['_hasFormulaInDirtyRanges'](_0x3d9803){const _0x400019=_0x1222a9;for(const _0xb09331 of _0x3d9803){const {unitId:_0x6fdce7,sheetId:_0x239ceb,range:_0x313dcb}=_0xb09331,_0x3ef01f=this[_0x400019(0x239)][_0x400019(0x3a2)](_0x6fdce7);if(!_0x3ef01f)continue;const _0x4da0dd=_0x3ef01f['getSheetBySheetId'](_0x239ceb);if(!_0x4da0dd)continue;const _0x58af7a=_0x4da0dd[_0x400019(0x30b)]();for(let _0x121c13=_0x313dcb[_0x400019(0x2dc)];_0x121c13<=_0x313dcb[_0x400019(0x2a5)];_0x121c13++)for(let _0x46ff31=_0x313dcb[_0x400019(0x33d)];_0x46ff31<=_0x313dcb['endColumn'];_0x46ff31++){const _0x26ff4b=_0x58af7a[_0x400019(0x1e5)](_0x121c13,_0x46ff31);if(_0x26ff4b&&(isFormulaString(_0x26ff4b['f'])||isFormulaId(_0x26ff4b['si'])))return!![];}}return![];}};FormulaCalculationGuardService=__decorate([__decorateParam(0x0,Inject(IMessageService)),__decorateParam(0x1,ICommandService),__decorateParam(0x2,IConfigService),__decorateParam(0x3,Inject(HTTPService)),__decorateParam(0x4,IUniverInstanceService),__decorateParam(0x5,ILogService),__decorateParam(0x6,Inject(LocaleService))],FormulaCalculationGuardService);let WebLocalCacheService=class WebLocalCacheService extends Disposable{constructor(_0x423f06,_0x320977,_0x54d792){const _0x4d8ccc=_0x1222a9;super(),this['_configService']=_0x423f06,this['_localStorageService']=_0x320977,this[_0x4d8ccc(0x379)]=_0x54d792,_defineProperty(this,_0x4d8ccc(0x262),new Map()),_defineProperty(this,_0x4d8ccc(0x31d),new Map()),_defineProperty(this,_0x4d8ccc(0x27f),![]);}[_0x1222a9(0x380)](){const _0x14e86b=_0x1222a9;this[_0x14e86b(0x27f)]=!![];}['enableLocalCache'](){const _0x184a2c=_0x1222a9;this[_0x184a2c(0x27f)]=![];}get['saveTaskMap'](){const _0x12a60b=_0x1222a9;return this[_0x12a60b(0x31d)];}['dispose'](){const _0x1ef8f2=_0x1222a9;this['exhaustSavingTask']()[_0x1ef8f2(0x29c)](()=>super[_0x1ef8f2(0x23d)]());}async[_0x1222a9(0x2ad)](_0x306d7f){const _0x5cf514=_0x1222a9;if(this['_disabled'])return null;return this[_0x5cf514(0x235)]['getItem'](getLocalCacheKey(_0x306d7f));}async['saveOfflineData'](_0x366ee9,_0x2cb515){const _0x4812e7=_0x1222a9;return!!this[_0x4812e7(0x235)][_0x4812e7(0x33a)](_0x366ee9,_0x2cb515);}[_0x1222a9(0x3d0)](_0x3dae11,_0x15765e,_0x7458ca,_0x1358b5){const _0x5ccf94=_0x1222a9,_0x477262=this[_0x5ccf94(0x379)][_0x5ccf94(0x1f9)](_0x3dae11);this[_0x5ccf94(0x262)][_0x5ccf94(0x37a)](_0x3dae11,{'unitID':_0x3dae11,'type':_0x15765e,'awaitingChangeset':_0x7458ca,'mutations':_0x1358b5,'rev':_0x477262});if(!this['_saveTaskMap'][_0x5ccf94(0x3fd)](_0x3dae11))this[_0x5ccf94(0x20d)](_0x3dae11);}[_0x1222a9(0x20d)](_0x5ef6bd){const _0x2ec825=_0x1222a9,_0x3f4974=this[_0x2ec825(0x280)]();if(_0x3f4974===0x0)this[_0x2ec825(0x389)](_0x5ef6bd);else this[_0x2ec825(0x31d)][_0x2ec825(0x37a)](_0x5ef6bd,setTimeout(()=>this[_0x2ec825(0x389)](_0x5ef6bd),_0x3f4974));}[_0x1222a9(0x280)](){const _0x499baf=_0x1222a9;var _0x3ef6b6;return(_0x3ef6b6=this[_0x499baf(0x356)]['getConfig'](LOCAL_CACHE_INTERVAL_KEY))!==null&&_0x3ef6b6!==void 0x0?_0x3ef6b6:LOCAL_CACHE_INTERVAL;}[_0x1222a9(0x389)](_0x208ebf){const _0x21217c=_0x1222a9,_0x514e9d=this[_0x21217c(0x31d)][_0x21217c(0x232)](_0x208ebf);if(_0x514e9d!==void 0x0)window[_0x21217c(0x3db)](_0x514e9d);return this[_0x21217c(0x235)]['setItem'](getLocalCacheKey(_0x208ebf),this[_0x21217c(0x262)][_0x21217c(0x232)](_0x208ebf))[_0x21217c(0x29c)](()=>this[_0x21217c(0x31d)][_0x21217c(0x24f)](_0x208ebf));}async[_0x1222a9(0x3c4)](){const _0x2d8d05=_0x1222a9,_0x50e5ca=[];this['_saveTaskMap']['forEach']((_0x40a306,_0x3951fc)=>{const _0x446491=_0x2f58;window['clearTimeout'](_0x40a306),_0x50e5ca[_0x446491(0x29a)](this[_0x446491(0x389)](_0x3951fc)[_0x446491(0x29c)](()=>{const _0x1c4530=_0x446491;this[_0x1c4530(0x31d)][_0x1c4530(0x24f)](_0x3951fc);}));}),await Promise[_0x2d8d05(0x28f)](_0x50e5ca);}};WebLocalCacheService=__decorate([__decorateParam(0x0,IConfigService),__decorateParam(0x1,ILocalStorageService),__decorateParam(0x2,Inject(RevisionService))],WebLocalCacheService);var WebURLService=class extends RxDisposable{constructor(){const _0x1f5384=_0x1222a9;super(),_defineProperty(this,_0x1f5384(0x34d),void 0x0),this[_0x1f5384(0x34d)]=fromEvent(window,'popstate')[_0x1f5384(0x31b)](takeUntil(this[_0x1f5384(0x381)]),shareReplay(0x1),mapTo(void 0x0));}[_0x1222a9(0x2fb)](_0x5b2618,_0x23cee0,_0x14ee23=![]){const _0x5f559e=_0x1222a9,_0x381aef=new URL(window['location'][_0x5f559e(0x39b)]);_0x381aef[_0x5f559e(0x204)]['set'](_0x5b2618,_0x23cee0);if(_0x14ee23)window[_0x5f559e(0x3ca)][_0x5f559e(0x2e5)]('','',_0x381aef['toString']());else window[_0x5f559e(0x3ca)]['pushState']('','',_0x381aef[_0x5f559e(0x3b7)]());}[_0x1222a9(0x2c6)](_0x233b53,_0x1d6fb7=![]){const _0x52ffa9=_0x1222a9,_0x2fec4e=new URL(window['location'][_0x52ffa9(0x39b)]);_0x2fec4e['searchParams']['delete'](_0x233b53);if(_0x1d6fb7)window['history']['replaceState']('','',_0x2fec4e['toString']());else window[_0x52ffa9(0x3ca)]['pushState']('','',_0x2fec4e[_0x52ffa9(0x3b7)]());}[_0x1222a9(0x370)](_0x556f34){const _0x28ab6a=_0x1222a9;var _0x3456e0;return(_0x3456e0=new URL(window[_0x28ab6a(0x259)]['href'])[_0x28ab6a(0x204)]['get'](_0x556f34))!==null&&_0x3456e0!==void 0x0?_0x3456e0:void 0x0;}};let UniverCollaborationClientUIPlugin=class UniverCollaborationClientUIPlugin extends Plugin{constructor(_0xaa99cf=defaultPluginConfig,_0x1f698e,_0x158978,_0x5102fa){const _0x382e2=_0x1222a9;super(),this['_config']=_0xaa99cf,this[_0x382e2(0x371)]=_0x1f698e,this[_0x382e2(0x21b)]=_0x158978,this[_0x382e2(0x356)]=_0x5102fa;const {..._0x442003}=merge({},defaultPluginConfig,this['_config']);this[_0x382e2(0x356)]['setConfig'](PLUGIN_CONFIG_KEY,_0x442003);}[_0x1222a9(0x3d9)](){const _0xf22a44=_0x1222a9;this['_registerDependencies'](),this[_0xf22a44(0x238)]();}[_0x1222a9(0x37d)](){const _0x34dbce=_0x1222a9;this[_0x34dbce(0x345)]();}[_0x1222a9(0x32c)](){const _0x1280ac=_0x1222a9;var _0x400334;const _0x44682c=[[ColorAssignService],[FormulaCalculationGuardService],[DocTransformSelectionsService],[DocTransformIMECacheService],[DocTransformStateCacheService],[DocSyncEditingCollabCursorService],[IURLService,{'useClass':WebURLService}],[ISocketService,{'useClass':WebSocketService}],[ILocalCacheService,{'useClass':WebLocalCacheService}],[DesktopCollaborationStatusDisplayController],[CollaborationEntityUIController],[CollaborationClientUIController],[CollabCursorController],[ImagePasteController],[CollaborationDataLoaderController]];if(this[_0x1280ac(0x38c)][_0x1280ac(0x3c8)])_0x44682c[_0x1280ac(0x29a)]([FrontendLogController]);registerDependencies(this[_0x1280ac(0x21b)],mergeOverrideWithDependencies(_0x44682c,(_0x400334=this[_0x1280ac(0x38c)])===null||_0x400334===void 0x0?void 0x0:_0x400334[_0x1280ac(0x271)]));}[_0x1222a9(0x345)](){const _0x3db580=_0x1222a9;this['disposeWithMe'](this[_0x3db580(0x371)][_0x3db580(0x3f2)](UniverInstanceType[_0x3db580(0x329)],[DocCollabCursorRenderController])),this['disposeWithMe'](this[_0x3db580(0x371)][_0x3db580(0x3f2)](UniverInstanceType[_0x3db580(0x23c)],[SheetCollabCursorRenderController]));}[_0x1222a9(0x238)](){const _0x25932f=_0x1222a9;touchDependencies(this[_0x25932f(0x21b)],[[CollabCursorController],[DesktopCollaborationStatusDisplayController],[CollaborationEntityUIController],[CollaborationClientUIController],[CollaborationDataLoaderController],[FormulaCalculationGuardService]]);if(this[_0x25932f(0x38c)][_0x25932f(0x3c8)])touchDependencies(this['_injector'],[[FrontendLogController]]);}};_defineProperty(UniverCollaborationClientUIPlugin,_0x1222a9(0x377),_0x1222a9(0x35d)),_defineProperty(UniverCollaborationClientUIPlugin,_0x1222a9(0x2db),name),_defineProperty(UniverCollaborationClientUIPlugin,_0x1222a9(0x2e4),version),UniverCollaborationClientUIPlugin=__decorate([DependentOn(UniverCollaborationClientPlugin),__decorateParam(0x1,IRenderManagerService),__decorateParam(0x2,Inject(Injector)),__decorateParam(0x3,IConfigService)],UniverCollaborationClientUIPlugin);let BrowserCollaborationSocketService=class BrowserCollaborationSocketService extends CollaborationSocketService{constructor(_0x5a5dce,_0x1cb266,_0x112d3a,_0x11f192,_0xaadad){super(_0x5a5dce,_0x1cb266,_0x112d3a,_0x11f192,_0xaadad);}async['createSocket'](_0x48ae58){const _0xbcdefb=_0x1222a9,_0x4b289f=await this[_0xbcdefb(0x23b)](),_0x358138=this[_0xbcdefb(0x318)](_0x48ae58,_0x4b289f);return this[_0xbcdefb(0x32d)](_0x358138);}['_createSocketURL'](_0x2b5f3f,_0x16daeb){const _0x19b86d=_0x1222a9,_0x1d1c5b=typeof window===_0x19b86d(0x3f8)?new URL(_0x2b5f3f):new URL(_0x2b5f3f,window['location'][_0x19b86d(0x2b2)]);_0x1d1c5b['searchParams'][_0x19b86d(0x37a)](_0x19b86d(0x32f),_0x16daeb);const _0x143fc5=typeof window===_0x19b86d(0x3f8)?new URLSearchParams():new URLSearchParams(window[_0x19b86d(0x259)][_0x19b86d(0x3b5)]);return _0x143fc5[_0x19b86d(0x232)](_0x19b86d(0x346))&&_0x1d1c5b['searchParams'][_0x19b86d(0x37a)](_0x19b86d(0x346),_0x143fc5['get'](_0x19b86d(0x346))),_0x1d1c5b[_0x19b86d(0x3b7)]();}async['_getSessionTicket'](){const _0x210643=_0x1222a9;var _0x4ec6c9,_0x28c3b5,_0xb6bdbf;const _0x4cc809=this[_0x210643(0x356)][_0x210643(0x268)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY),_0x4ce798=(_0x4ec6c9=_0x4cc809===null||_0x4cc809===void 0x0?void 0x0:_0x4cc809[_0x210643(0x299)])!==null&&_0x4ec6c9!==void 0x0?_0x4ec6c9:DEFAULT_WS_SESSION_TICKET_URL;return(_0x28c3b5=(_0xb6bdbf=(await this[_0x210643(0x2dd)][_0x210643(0x232)](_0x4ce798,{'headers':{'Content-Type':_0x210643(0x2cf)}}))[_0x210643(0x2de)])===null||_0xb6bdbf===void 0x0?void 0x0:_0xb6bdbf['ticket'])!==null&&_0x28c3b5!==void 0x0?_0x28c3b5:'';}};BrowserCollaborationSocketService=__decorate([__decorateParam(0x0,Inject(Injector)),__decorateParam(0x1,Inject(HTTPService)),__decorateParam(0x2,IConfigService),__decorateParam(0x3,ILogService),__decorateParam(0x4,ISnapshotServerService)],BrowserCollaborationSocketService);let RemoteUniscriptService=class RemoteUniscriptService extends Disposable{constructor(_0x28f65d,_0x314a4f,_0x1a5696){const _0x4799b9=_0x1222a9;super(),this[_0x4799b9(0x372)]=_0x28f65d,this[_0x4799b9(0x2dd)]=_0x314a4f,this[_0x4799b9(0x356)]=_0x1a5696;}async[_0x1222a9(0x2b3)](_0x472869,_0x224d12,_0x34ecf0,..._0x25e9c5){const _0x4ef69c=_0x1222a9;var _0x3afea5,_0x439c26,_0x14bdf7,_0x5a7794;const _0x17a72f=this[_0x4ef69c(0x372)][_0x4ef69c(0x24d)]();if(!_0x17a72f)throw new Error('[RemoteUniscriptService]:\x20no\x20focused\x20unit');const _0x4a6d1e=((_0x3afea5=this[_0x4ef69c(0x356)][_0x4ef69c(0x268)](REMOTE_UNISCRIPT_EXECUTION_ENDPOINT_KEY))!==null&&_0x3afea5!==void 0x0?_0x3afea5:DEFAULT_REMOTE_UNISCRIPT_EXECUTION_ENDPOINT)+'/'+_0x472869+_0x4ef69c(0x2f6)+_0x224d12,_0x4bf4f5={'scriptId':_0x472869,'runId':(_0x439c26=new URL(window[_0x4ef69c(0x259)][_0x4ef69c(0x39b)])[_0x4ef69c(0x204)][_0x4ef69c(0x232)]('runId'))!==null&&_0x439c26!==void 0x0?_0x439c26:'','function':_0x224d12,'unitId':_0x17a72f['getUnitId'](),'argsOfFunction':JSON['stringify'](_0x25e9c5),'invokeId':(_0x14bdf7=_0x34ecf0[_0x4ef69c(0x3c1)])!==null&&_0x14bdf7!==void 0x0?_0x14bdf7:'','executionId':(_0x5a7794=_0x34ecf0[_0x4ef69c(0x344)])!==null&&_0x5a7794!==void 0x0?_0x5a7794:''};try{const _0x1a1b10=await this[_0x4ef69c(0x2dd)][_0x4ef69c(0x37e)](_0x4a6d1e,{'body':_0x4bf4f5});if(_0x1a1b10[_0x4ef69c(0x2de)][_0x4ef69c(0x3c0)]&&_0x1a1b10[_0x4ef69c(0x2de)][_0x4ef69c(0x3c0)]['code']!==ErrorCode['OK'])return _0x4ef69c(0x3f1);return _0x1a1b10[_0x4ef69c(0x2de)][_0x4ef69c(0x247)];}catch{return _0x4ef69c(0x3f1);}}};RemoteUniscriptService=__decorate([__decorateParam(0x0,IUniverInstanceService),__decorateParam(0x1,Inject(HTTPService)),__decorateParam(0x2,IConfigService)],RemoteUniscriptService);const HEARTBEAT_INTERVAL=0x7530,ACTIVE_UNIT_EVENT_CHANNEL=_0x1222a9(0x287);var WebBrowserSingleActiveUnitService=class extends Disposable{constructor(){const _0x5bf9d2=_0x1222a9;super(),_defineProperty(this,'_id',generateRandomId()),_defineProperty(this,_0x5bf9d2(0x374),new Set()),_defineProperty(this,'_unitOnClients',new Map()),_defineProperty(this,'_heartbeatTimer',null),_defineProperty(this,'_clearOtherTimers',new Map()),_defineProperty(this,_0x5bf9d2(0x2cb),new Map()),this[_0x5bf9d2(0x338)]();}[_0x1222a9(0x23d)](){const _0x27d6b8=_0x1222a9;super[_0x27d6b8(0x23d)](),this[_0x27d6b8(0x25f)][_0x27d6b8(0x2bc)]((_0x3eddd8,_0x397b3b)=>this[_0x27d6b8(0x347)](_0x397b3b));if(this[_0x27d6b8(0x407)])window[_0x27d6b8(0x2df)](this['_heartbeatTimer']);}[_0x1222a9(0x1ff)](_0x2c1666){const _0xc869a5=_0x1222a9;return this['_ensureSubject'](_0x2c1666)[_0xc869a5(0x31b)](distinctUntilChanged());}['editingUnit'](_0x4b5509){const _0x167f1a=_0x1222a9;if(this['_selfUnitIDs'][_0x167f1a(0x1f7)]===0x0)this[_0x167f1a(0x2f2)]();this['_selfUnitIDs'][_0x167f1a(0x2e3)](_0x4b5509),this['_send']({'type':0x0,'memberID':this[_0x167f1a(0x3c2)],'unitIDs':[_0x4b5509],'isForwarded':![]});}['disposeUnit'](_0x129a94){const _0x293ec7=_0x1222a9;this[_0x293ec7(0x374)][_0x293ec7(0x24f)](_0x129a94);if(this['_selfUnitIDs'][_0x293ec7(0x1f7)]===0x0&&this[_0x293ec7(0x407)])window[_0x293ec7(0x2df)](this['_heartbeatTimer']);}[_0x1222a9(0x338)](){const _0x455a8e=_0x1222a9;this[_0x455a8e(0x3e4)](toDisposable(fromEvent(window,_0x455a8e(0x3c9))[_0x455a8e(0x3a1)](_0x387c46=>{const _0x23738e=_0x455a8e;if(_0x387c46['key']!==ACTIVE_UNIT_EVENT_CHANNEL||!_0x387c46[_0x23738e(0x3cb)])return;const _0x1d6005=JSON[_0x23738e(0x3ef)](_0x387c46[_0x23738e(0x3cb)]);this[_0x23738e(0x265)](_0x1d6005);}))),window[_0x455a8e(0x1f5)]('unload',()=>this[_0x455a8e(0x2d5)]({'type':0x1,'memberID':this[_0x455a8e(0x3c2)],'unitIDs':Array[_0x455a8e(0x2a1)](this[_0x455a8e(0x374)])}));}[_0x1222a9(0x265)](_0x1c4d70){const _0x240e30=_0x1222a9;switch(_0x1c4d70[_0x240e30(0x24e)]){case 0x0:this[_0x240e30(0x2fd)](_0x1c4d70);break;case 0x1:this[_0x240e30(0x242)](_0x1c4d70);break;case 0x2:this['_handleHeartbeatEvent'](_0x1c4d70);break;}}[_0x1222a9(0x2fd)](_0x265f81){const _0x531f72=_0x1222a9,{unitIDs:_0x5a0e44,memberID:_0x1ee681,isForwarded:_0x21f0be}=_0x265f81;_0x5a0e44[_0x531f72(0x2bc)](_0x4ede8a=>{const _0xdd5b73=_0x531f72;if(!_0x21f0be&&this['_unitOnClients'][_0xdd5b73(0x3fd)](_0x4ede8a))this[_0xdd5b73(0x2d7)](_0x4ede8a)['next'](UnitStatus[_0xdd5b73(0x3c3)]);if(!this[_0xdd5b73(0x222)]['has'](_0x4ede8a)||!this[_0xdd5b73(0x222)][_0xdd5b73(0x232)](_0x4ede8a)[_0xdd5b73(0x3fd)](_0x1ee681)){const _0x5b00ac=this[_0xdd5b73(0x222)]['get'](_0x4ede8a)||new Set();_0x5b00ac[_0xdd5b73(0x2e3)](_0x1ee681),this[_0xdd5b73(0x222)][_0xdd5b73(0x37a)](_0x4ede8a,_0x5b00ac),this[_0xdd5b73(0x406)](_0x1ee681);}});if(!_0x21f0be)this[_0x531f72(0x2d5)]({'type':0x0,'memberID':this[_0x531f72(0x3c2)],'unitIDs':[...this[_0x531f72(0x374)]],'isForwarded':!![]});}['_scheduleClearOtherTimer'](_0x459143){const _0x496990=_0x1222a9;this['_removeClearOtherTimer'](_0x459143);const _0x313a8f=window[_0x496990(0x351)](()=>{const _0x448869=_0x496990;this[_0x448869(0x222)][_0x448869(0x2bc)](_0x300e9a=>{_0x300e9a['delete'](_0x459143);});},HEARTBEAT_INTERVAL*0x2);this[_0x496990(0x25f)][_0x496990(0x37a)](_0x459143,_0x313a8f);}['_removeClearOtherTimer'](_0x223ac4){const _0x596a2d=_0x1222a9;if(this[_0x596a2d(0x25f)][_0x596a2d(0x3fd)](_0x223ac4)){const _0xa1623a=this[_0x596a2d(0x25f)]['get'](_0x223ac4);if(_0xa1623a)window[_0x596a2d(0x3db)](_0xa1623a);this[_0x596a2d(0x25f)][_0x596a2d(0x37a)](_0x223ac4,null);}}[_0x1222a9(0x242)](_0xf4b4d8){const _0x1d4f31=_0x1222a9,{memberID:_0x117667,unitIDs:_0x578b77}=_0xf4b4d8;_0x578b77['forEach'](_0xaf8eae=>{const _0x4424f6=_0x2f58;var _0x3ef690;const _0x419774=this[_0x4424f6(0x222)][_0x4424f6(0x232)](_0xaf8eae);if(!_0x419774)return;_0x419774[_0x4424f6(0x24f)](_0x117667),(_0x3ef690=this[_0x4424f6(0x2d7)](_0xaf8eae))===null||_0x3ef690===void 0x0||_0x3ef690[_0x4424f6(0x266)](_0x419774[_0x4424f6(0x1f7)]===0x0?UnitStatus['NO_OTHER_CLIENTS_EDITING']:UnitStatus[_0x4424f6(0x3c3)]);}),this[_0x1d4f31(0x347)](_0x117667);}[_0x1222a9(0x367)](_0x2acd5d){const _0x15ac8c=_0x1222a9;this[_0x15ac8c(0x406)](_0x2acd5d[_0x15ac8c(0x35e)]);}[_0x1222a9(0x2d5)](_0x4a9b59){const _0x2c6f21=_0x1222a9;localStorage[_0x2c6f21(0x33a)](ACTIVE_UNIT_EVENT_CHANNEL,JSON[_0x2c6f21(0x233)](_0x4a9b59));}[_0x1222a9(0x2f2)](){const _0x4978ba=_0x1222a9;this[_0x4978ba(0x407)]=window[_0x4978ba(0x20a)](()=>{const _0x5e01f4=_0x4978ba;this[_0x5e01f4(0x2d5)]({'type':0x2,'memberID':this[_0x5e01f4(0x3c2)]});},HEARTBEAT_INTERVAL);}[_0x1222a9(0x2d7)](_0x330df7){const _0x20e194=_0x1222a9;if(!this['_unitStatus'][_0x20e194(0x3fd)](_0x330df7))this[_0x20e194(0x2cb)][_0x20e194(0x37a)](_0x330df7,new BehaviorSubject(UnitStatus[_0x20e194(0x327)]));return this[_0x20e194(0x2cb)][_0x20e194(0x232)](_0x330df7);}};export{BrowserCollaborationSocketService,CollaborationDataLoaderController,DesktopCollaborationStatusDisplayController,IURLService,RemoteUniscriptService,SheetCollabCursorShape,UniverCollaborationClientUIPlugin,WebBrowserSingleActiveUnitService,WebURLService};