@univerjs-pro/sheets-shape 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.
package/lib/es/facade.js CHANGED
@@ -1 +1 @@
1
- const _0x50bc8b=_0x12e7;function _0x12e7(_0x593a5b,_0xdff764){_0x593a5b=_0x593a5b-0x17b;const _0x3bc4be=_0x3bc4();let _0x12e751=_0x3bc4be[_0x593a5b];return _0x12e751;}(function(_0x5aa37f,_0x507fd6){const _0x427187=_0x12e7,_0x4cda8b=_0x5aa37f();while(!![]){try{const _0x5364cb=parseInt(_0x427187(0x193))/0x1+parseInt(_0x427187(0x1a3))/0x2+-parseInt(_0x427187(0x1b3))/0x3*(parseInt(_0x427187(0x1e5))/0x4)+-parseInt(_0x427187(0x1e8))/0x5+parseInt(_0x427187(0x192))/0x6*(parseInt(_0x427187(0x1ee))/0x7)+parseInt(_0x427187(0x1ec))/0x8*(-parseInt(_0x427187(0x1e2))/0x9)+-parseInt(_0x427187(0x1a6))/0xa*(-parseInt(_0x427187(0x1e3))/0xb);if(_0x5364cb===_0x507fd6)break;else _0x4cda8b['push'](_0x4cda8b['shift']());}catch(_0x3e4f78){_0x4cda8b['push'](_0x4cda8b['shift']());}}}(_0x3bc4,0x621d0));import{ConnectorCoordinateTransform,ShapeArrowSizeEnum,ShapeArrowTypeEnum,ShapeFillEnum,ShapeGradientTypeEnum,ShapeLineCapEnum,ShapeLineDashEnum,ShapeLineJoinEnum,ShapeLineTypeEnum,ShapeTypeEnum,computeConnectorRouteLayout,getBasicShapeRotateBound,isConnectorShape,routeConnectorLineShape}from'@univerjs-pro/engine-shape';import{FEnum}from'@univerjs/core/facade';import{DEFAULT_SHAPE_HEIGHT,DEFAULT_SHAPE_WIDTH,InsertShapeCommand,SetShapeDrawingDataCommand,SheetsShapeService,UpdateConnectorRelationCommand}from'@univerjs-pro/sheets-shape';import{DrawingTypeEnum,generateRandomId}from'@univerjs/core';import{IDrawingManagerService}from'@univerjs/drawing';import{SheetSkeletonService,convertPositionCellToSheetOverGrid}from'@univerjs/sheets';import{ISheetDrawingService,RemoveSheetDrawingCommand}from'@univerjs/sheets-drawing';import{FWorksheet}from'@univerjs/sheets/facade';var FSheetsShapeEnumMixin=class extends FEnum{get['ShapeTypeEnum'](){return ShapeTypeEnum;}get[_0x50bc8b(0x1db)](){return ShapeFillEnum;}get[_0x50bc8b(0x1fd)](){return ShapeGradientTypeEnum;}get['ShapeLineTypeEnum'](){return ShapeLineTypeEnum;}get[_0x50bc8b(0x1ea)](){return ShapeLineDashEnum;}get[_0x50bc8b(0x1ac)](){return ShapeLineCapEnum;}get['ShapeLineJoinEnum'](){return ShapeLineJoinEnum;}get['ShapeArrowTypeEnum'](){return ShapeArrowTypeEnum;}get[_0x50bc8b(0x1d8)](){return ShapeArrowSizeEnum;}};function _0x3bc4(){const _0x25b3b2=['updateShape','getUnitId','setStrokeWidth','ShapeArrowSizeEnum','getPosition','Skeleton\x20for\x20unitId\x20','ShapeFillEnum','getShapeType','removeShape','\x20and\x20subUnitId\x20','width','setStrokeOpacity','get','3436605anVCVS','727474VSrDPB','push','4708EHNXSB','build','getAdjustValueByName','290730AoRjet','point','ShapeLineDashEnum','parse','8GPmseY','rotation','413OkBbVW','drawingType','getDrawingPoints','SolidFill','stroke','gradientAngle','extend','Invalid\x20shape\x20type\x20for\x20connector.\x20Received\x20','_preloadShapeProperties','executeCommand','adjustValues','Shape\x20type\x20is\x20required.\x20Please\x20call\x20setShapeType()\x20before\x20build().','getStartConnectInfo','_injector','symbol','ShapeGradientTypeEnum','shapeData','default','ensureSkeleton','_resolveEndpoints','connectionSiteIndex','opacity','capType','connectShapes',',\x20but\x20expected\x20a\x20connector\x20shape\x20type.','getShapes','getAdjustNames','getShapeId','startArrow','updateContext','relation','endArrow','setShapeGradientFill','getDrawingData','drawId','_resolveExistingOrFreeEndpoint','shape','localToWorld','setNoneFill','29838fsxnha','127731YkOgVP','getShapeModel','defineProperty','_commandService','toPrimitive','unitId','getDrawingByParam','call','GradientFill','colorStops\x20is\x20required\x20and\x20should\x20contain\x20at\x20least\x20one\x20color\x20stop.','object','setStartArrowSize','index','getShapeData','getWorkbook','transform','190682oWQGWk','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','setHeight','130KKoacT','\x20not\x20found','setAbsolutePosition','fill','function','length','ShapeLineCapEnum','setStrokeLineDashType','getEndConnectInfo','setStrokeColor','setEndArrowType','setWidth','entries','1362ytqIbt','setStartArrowType','fillType','size','subUnitId','iterator','setStrokeLineType','DRAWING_SHAPE','color','string','newConnector','left','isLineShape','getShapeRelation','insertShape','getConnectorLinePoints','type','sin','from','flipY','find','getConnectionSiteList','newShape','setStrokeLineCapType','worldRect','ang','getSize','top','getSheetId','setShapeType','getAdjustPoints','setEndArrowSize','shapeType','height'];_0x3bc4=function(){return _0x25b3b2;};return _0x3bc4();}FEnum[_0x50bc8b(0x1f4)](FSheetsShapeEnumMixin);function _typeof(_0x114419){'@babel/helpers - typeof';const _0x2c9fff=_0x50bc8b;return _typeof=_0x2c9fff(0x1aa)==typeof Symbol&&_0x2c9fff(0x1fc)==typeof Symbol[_0x2c9fff(0x1b8)]?function(_0x1c8b1d){return typeof _0x1c8b1d;}:function(_0x1098b8){const _0x5a545e=_0x2c9fff;return _0x1098b8&&_0x5a545e(0x1aa)==typeof Symbol&&_0x1098b8['constructor']===Symbol&&_0x1098b8!==Symbol['prototype']?_0x5a545e(0x1fc):typeof _0x1098b8;},_typeof(_0x114419);}function toPrimitive(_0x4da8c3,_0x166389){const _0x30ff75=_0x50bc8b;if(_0x30ff75(0x19d)!=_typeof(_0x4da8c3)||!_0x4da8c3)return _0x4da8c3;var _0x4b7b5a=_0x4da8c3[Symbol[_0x30ff75(0x197)]];if(void 0x0!==_0x4b7b5a){var _0x29f0b5=_0x4b7b5a[_0x30ff75(0x19a)](_0x4da8c3,_0x166389||_0x30ff75(0x17c));if('object'!=_typeof(_0x29f0b5))return _0x29f0b5;throw new TypeError(_0x30ff75(0x1a4));}return(_0x30ff75(0x1bc)===_0x166389?String:Number)(_0x4da8c3);}function toPropertyKey(_0x45ffea){const _0x2998c4=_0x50bc8b;var _0x4d9fed=toPrimitive(_0x45ffea,_0x2998c4(0x1bc));return _0x2998c4(0x1fc)==_typeof(_0x4d9fed)?_0x4d9fed:_0x4d9fed+'';}function _defineProperty(_0x2408ef,_0xffb922,_0x2363c3){const _0x3ad3be=_0x50bc8b;return(_0xffb922=toPropertyKey(_0xffb922))in _0x2408ef?Object[_0x3ad3be(0x195)](_0x2408ef,_0xffb922,{'value':_0x2363c3,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x2408ef[_0xffb922]=_0x2363c3,_0x2408ef;}var FShape=class{constructor(_0x3b62d2,_0x50b7e9,_0x686bd2,_0x5ac45c){const _0x41b8e0=_0x50bc8b;_defineProperty(this,_0x41b8e0(0x198),void 0x0),_defineProperty(this,_0x41b8e0(0x1b7),void 0x0),_defineProperty(this,_0x41b8e0(0x18d),void 0x0),_defineProperty(this,'x',0x0),_defineProperty(this,'y',0x0),_defineProperty(this,_0x41b8e0(0x1df),DEFAULT_SHAPE_WIDTH),_defineProperty(this,_0x41b8e0(0x1d4),DEFAULT_SHAPE_HEIGHT),_defineProperty(this,_0x41b8e0(0x1d3),void 0x0),_defineProperty(this,_0x41b8e0(0x17b),{}),_defineProperty(this,_0x41b8e0(0x1fb),void 0x0),this[_0x41b8e0(0x198)]=_0x3b62d2,this['subUnitId']=_0x50b7e9,this[_0x41b8e0(0x18d)]=_0x686bd2||generateRandomId(),this[_0x41b8e0(0x1fb)]=_0x5ac45c;}['setPosition'](_0x2192f1,_0x8fbf6d,_0x13d028,_0x5a487a){const _0x2715c8=_0x50bc8b,_0xa6211f=this[_0x2715c8(0x1fb)][_0x2715c8(0x1e1)](SheetSkeletonService)['ensureSkeleton'](this[_0x2715c8(0x198)],this[_0x2715c8(0x1b7)]);if(!_0xa6211f)throw new Error(_0x2715c8(0x1da)+this[_0x2715c8(0x198)]+_0x2715c8(0x1de)+this[_0x2715c8(0x1b7)]+_0x2715c8(0x1a7));const {transform:_0x30460c}=convertPositionCellToSheetOverGrid(this[_0x2715c8(0x198)],this['subUnitId'],{'row':_0x2192f1,'column':_0x8fbf6d,'rowOffset':_0x13d028,'columnOffset':_0x5a487a},0x1,0x1,_0xa6211f);return this['x']=_0x30460c[_0x2715c8(0x1be)],this['y']=_0x30460c[_0x2715c8(0x1ce)],this;}[_0x50bc8b(0x1a8)](_0x2c21b7,_0x431ac4){return this['x']=_0x2c21b7,this['y']=_0x431ac4,this;}['setShapeType'](_0x31b384){return this['shapeType']=_0x31b384,this;}['setShapeSolidFill'](_0x378caf,_0x4e2ee8){const _0x227273=_0x50bc8b;if(!this[_0x227273(0x17b)][_0x227273(0x1a9)])this[_0x227273(0x17b)][_0x227273(0x1a9)]={};this[_0x227273(0x17b)]['fill']['fillType']=ShapeFillEnum[_0x227273(0x1f1)];if(_0x378caf!==void 0x0)this[_0x227273(0x17b)]['fill'][_0x227273(0x1bb)]=_0x378caf;if(_0x4e2ee8!==void 0x0)this[_0x227273(0x17b)]['fill'][_0x227273(0x180)]=_0x4e2ee8;return this;}[_0x50bc8b(0x18b)](_0x5c3cc7,_0x563823,_0x4ebb0e){const _0x3bcad1=_0x50bc8b;if(_0x563823===void 0x0||_0x563823['length']===0x0)throw new Error(_0x3bcad1(0x19c));if(!this[_0x3bcad1(0x17b)][_0x3bcad1(0x1a9)])this[_0x3bcad1(0x17b)][_0x3bcad1(0x1a9)]={};this[_0x3bcad1(0x17b)][_0x3bcad1(0x1a9)]['gradientStops']=_0x563823,this['shapeData']['fill'][_0x3bcad1(0x1b5)]=ShapeFillEnum[_0x3bcad1(0x19b)],this[_0x3bcad1(0x17b)][_0x3bcad1(0x1a9)]['gradientType']=_0x5c3cc7;if(_0x4ebb0e!==void 0x0)this[_0x3bcad1(0x17b)]['fill'][_0x3bcad1(0x1f3)]=_0x4ebb0e;return this;}[_0x50bc8b(0x191)](){const _0x29e546=_0x50bc8b;return this[_0x29e546(0x17b)]['fill']={'fillType':ShapeFillEnum['NoFill']},this;}[_0x50bc8b(0x1af)](_0x558dad){const _0x35bb4f=_0x50bc8b;if(!this[_0x35bb4f(0x17b)][_0x35bb4f(0x1f2)])this[_0x35bb4f(0x17b)][_0x35bb4f(0x1f2)]={};return this[_0x35bb4f(0x17b)]['stroke']['color']=_0x558dad,this;}[_0x50bc8b(0x1d7)](_0x12b67e){const _0x3e1a02=_0x50bc8b;if(!this[_0x3e1a02(0x17b)]['stroke'])this[_0x3e1a02(0x17b)][_0x3e1a02(0x1f2)]={};return this[_0x3e1a02(0x17b)][_0x3e1a02(0x1f2)][_0x3e1a02(0x1df)]=_0x12b67e,this;}[_0x50bc8b(0x1ad)](_0x2d8269){const _0x55d0ad=_0x50bc8b;if(!this[_0x55d0ad(0x17b)]['stroke'])this[_0x55d0ad(0x17b)]['stroke']={};return this[_0x55d0ad(0x17b)][_0x55d0ad(0x1f2)]['dashType']=_0x2d8269,this;}['setStrokeLineJoinType'](_0x5765f5){const _0x575948=_0x50bc8b;if(!this['shapeData'][_0x575948(0x1f2)])this[_0x575948(0x17b)][_0x575948(0x1f2)]={};return this[_0x575948(0x17b)][_0x575948(0x1f2)]['lineJoinType']=_0x5765f5,this;}[_0x50bc8b(0x1ca)](_0x1582ef){const _0x374edf=_0x50bc8b;if(!this['shapeData']['stroke'])this[_0x374edf(0x17b)][_0x374edf(0x1f2)]={};return this['shapeData'][_0x374edf(0x1f2)][_0x374edf(0x181)]=_0x1582ef,this;}[_0x50bc8b(0x1e0)](_0x5493f9){const _0x54bb96=_0x50bc8b;if(!this[_0x54bb96(0x17b)][_0x54bb96(0x1f2)])this[_0x54bb96(0x17b)][_0x54bb96(0x1f2)]={};return this[_0x54bb96(0x17b)][_0x54bb96(0x1f2)][_0x54bb96(0x180)]=_0x5493f9,this;}[_0x50bc8b(0x1b9)](_0x1f26a7){const _0x12fe46=_0x50bc8b;if(!this[_0x12fe46(0x17b)][_0x12fe46(0x1f2)])this[_0x12fe46(0x17b)]['stroke']={};return this['shapeData']['stroke']['lineStrokeType']=_0x1f26a7,this;}[_0x50bc8b(0x1b1)](_0x369a54){const _0x22096f=_0x50bc8b;return this[_0x22096f(0x1df)]=_0x369a54,this;}[_0x50bc8b(0x1a5)](_0x41edab){const _0x34714d=_0x50bc8b;return this[_0x34714d(0x1d4)]=_0x41edab,this;}[_0x50bc8b(0x1bf)](){const _0x1ec1b4=_0x50bc8b,_0x4dc04c=this[_0x1ec1b4(0x1fb)][_0x1ec1b4(0x1e1)](SheetsShapeService)[_0x1ec1b4(0x194)](this['unitId'],this[_0x1ec1b4(0x1b7)],this[_0x1ec1b4(0x18d)]);if(_0x4dc04c)return isConnectorShape(_0x4dc04c[_0x1ec1b4(0x1dc)]());if(this['shapeType'])return isConnectorShape(this[_0x1ec1b4(0x1d3)]);return![];}['getConnectionSites'](){const _0x1df0d1=_0x50bc8b,_0x1b346c=this['_injector']['get'](SheetsShapeService)[_0x1df0d1(0x194)](this[_0x1df0d1(0x198)],this['subUnitId'],this['drawId']);if(!_0x1b346c)return[];const _0x3c2565=this['_injector'][_0x1df0d1(0x1e1)](IDrawingManagerService)[_0x1df0d1(0x199)]({'unitId':this[_0x1df0d1(0x198)],'subUnitId':this['subUnitId'],'drawingId':this[_0x1df0d1(0x18d)]});if(!(_0x3c2565===null||_0x3c2565===void 0x0?void 0x0:_0x3c2565[_0x1df0d1(0x1a2)]))return[];const {width:width=0x0,height:height=0x0}=_0x3c2565[_0x1df0d1(0x1a2)];return _0x1b346c['updateContext']({'width':width,'height':height}),_0x1b346c[_0x1df0d1(0x1c8)]();}[_0x50bc8b(0x1d1)](){const _0x5e6dca=_0x50bc8b,_0x5344d5=this[_0x5e6dca(0x1fb)]['get'](SheetsShapeService)[_0x5e6dca(0x194)](this[_0x5e6dca(0x198)],this['subUnitId'],this[_0x5e6dca(0x18d)]);if(!_0x5344d5)return[];const _0x2135d5=this['_injector']['get'](IDrawingManagerService)[_0x5e6dca(0x199)]({'unitId':this[_0x5e6dca(0x198)],'subUnitId':this[_0x5e6dca(0x1b7)],'drawingId':this[_0x5e6dca(0x18d)]});if(!(_0x2135d5===null||_0x2135d5===void 0x0?void 0x0:_0x2135d5[_0x5e6dca(0x1a2)]))return[];const {width:width=0x0,height:height=0x0}=_0x2135d5[_0x5e6dca(0x1a2)];return _0x5344d5[_0x5e6dca(0x188)]({'width':width,'height':height}),_0x5344d5[_0x5e6dca(0x1f0)]();}[_0x50bc8b(0x1c2)](){const _0x174047=_0x50bc8b,_0x26ea35=this['_injector']['get'](SheetsShapeService)[_0x174047(0x194)](this['unitId'],this[_0x174047(0x1b7)],this[_0x174047(0x18d)]);if(!_0x26ea35)return[];if(!isConnectorShape(_0x26ea35[_0x174047(0x1dc)]()))return[];const _0xe15f2b=this[_0x174047(0x1fb)][_0x174047(0x1e1)](IDrawingManagerService)[_0x174047(0x199)]({'unitId':this['unitId'],'subUnitId':this[_0x174047(0x1b7)],'drawingId':this[_0x174047(0x18d)]});if(!(_0xe15f2b===null||_0xe15f2b===void 0x0?void 0x0:_0xe15f2b['transform']))return[];const {width:width=0x0,height:height=0x0}=_0xe15f2b[_0x174047(0x1a2)];return _0x26ea35[_0x174047(0x188)]({'width':width,'height':height}),_0x26ea35[_0x174047(0x1c2)]();}[_0x50bc8b(0x1fa)](){const _0x20e6f4=_0x50bc8b;var _0x35b53d;const _0x3b4d4c=this[_0x20e6f4(0x1fb)][_0x20e6f4(0x1e1)](SheetsShapeService)[_0x20e6f4(0x194)](this[_0x20e6f4(0x198)],this[_0x20e6f4(0x1b7)],this['drawId']);if(!_0x3b4d4c)return null;return(_0x35b53d=_0x3b4d4c[_0x20e6f4(0x1fa)]())!==null&&_0x35b53d!==void 0x0?_0x35b53d:null;}[_0x50bc8b(0x1ae)](){const _0x4366f6=_0x50bc8b;var _0x15565b;const _0x544b04=this[_0x4366f6(0x1fb)][_0x4366f6(0x1e1)](SheetsShapeService)['getShapeModel'](this[_0x4366f6(0x198)],this['subUnitId'],this[_0x4366f6(0x18d)]);if(!_0x544b04)return null;return(_0x15565b=_0x544b04[_0x4366f6(0x1ae)]())!==null&&_0x15565b!==void 0x0?_0x15565b:null;}[_0x50bc8b(0x1e6)](){const _0x75e5=_0x50bc8b;var _0x53334a,_0x7d99c1;if(!this[_0x75e5(0x1d3)])throw new Error(_0x75e5(0x1f9));if(this['x']===0x0||this['y']===0x0){const _0x5e02ed=this['_injector']['get'](SheetSkeletonService)[_0x75e5(0x17d)](this[_0x75e5(0x198)],this[_0x75e5(0x1b7)]);if(!_0x5e02ed)throw new Error(_0x75e5(0x1da)+this[_0x75e5(0x198)]+_0x75e5(0x1de)+this[_0x75e5(0x1b7)]+_0x75e5(0x1a7));const {transform:_0x220b02}=convertPositionCellToSheetOverGrid(this['unitId'],this[_0x75e5(0x1b7)],{'row':0x1,'column':0x1,'rowOffset':0x0,'columnOffset':0x0},0x1,0x1,_0x5e02ed);this['x']=this['x']>0x0?this['x']:_0x220b02[_0x75e5(0x1be)],this['y']=this['y']>0x0?this['y']:_0x220b02[_0x75e5(0x1ce)];}return this[_0x75e5(0x1df)]=(_0x53334a=this[_0x75e5(0x1df)])!==null&&_0x53334a!==void 0x0?_0x53334a:DEFAULT_SHAPE_WIDTH,this[_0x75e5(0x1d4)]=(_0x7d99c1=this[_0x75e5(0x1d4)])!==null&&_0x7d99c1!==void 0x0?_0x7d99c1:DEFAULT_SHAPE_HEIGHT,{'unitId':this[_0x75e5(0x198)],'subUnitId':this[_0x75e5(0x1b7)],'shapeId':this[_0x75e5(0x18d)],'shapeType':this[_0x75e5(0x1d3)],'shapeData':Object['keys'](this[_0x75e5(0x17b)])['length']>0x0?this[_0x75e5(0x17b)]:void 0x0,'x':this['x'],'y':this['y'],'width':this[_0x75e5(0x1df)],'height':this['height']};}[_0x50bc8b(0x186)](){const _0x4debcf=_0x50bc8b;return this[_0x4debcf(0x18d)];}[_0x50bc8b(0x1dc)](){const _0x53ef09=_0x50bc8b;return this[_0x53ef09(0x1d3)];}[_0x50bc8b(0x1a0)](){return this['shapeData'];}[_0x50bc8b(0x1d9)](){return{'x':this['x'],'y':this['y']};}[_0x50bc8b(0x1cd)](){const _0x4c5f36=_0x50bc8b;return{'width':this['width'],'height':this[_0x4c5f36(0x1d4)]};}},FConnectorShape=class extends FShape{constructor(_0x42ea8a,_0x5040aa,_0x53a74f,_0x3b7c4a){const _0x16b3ed=_0x50bc8b;super(_0x42ea8a,_0x5040aa,_0x53a74f,_0x3b7c4a),_defineProperty(this,_0x16b3ed(0x17b),{});}[_0x50bc8b(0x1d0)](_0x3e0433){const _0x1a7592=_0x50bc8b;if(!isConnectorShape(_0x3e0433))throw new Error(_0x1a7592(0x1f5)+_0x3e0433+_0x1a7592(0x183));return super[_0x1a7592(0x1d0)](_0x3e0433),this;}[_0x50bc8b(0x1b4)](_0x36a46f){const _0x38834f=_0x50bc8b;var _0x1cb7db,_0x5fc427;if(!((_0x1cb7db=this[_0x38834f(0x17b)])===null||_0x1cb7db===void 0x0?void 0x0:_0x1cb7db['ln']))this[_0x38834f(0x17b)]['ln']={};if(!((_0x5fc427=this[_0x38834f(0x17b)])===null||_0x5fc427===void 0x0||(_0x5fc427=_0x5fc427['ln'])===null||_0x5fc427===void 0x0?void 0x0:_0x5fc427[_0x38834f(0x187)]))this[_0x38834f(0x17b)]['ln'][_0x38834f(0x187)]={};return this[_0x38834f(0x17b)]['ln'][_0x38834f(0x187)][_0x38834f(0x1c3)]=_0x36a46f,this;}[_0x50bc8b(0x1b0)](_0x2fd45b){const _0x215a25=_0x50bc8b;var _0x191148,_0xf4f801;if(!((_0x191148=this[_0x215a25(0x17b)])===null||_0x191148===void 0x0?void 0x0:_0x191148['ln']))this[_0x215a25(0x17b)]['ln']={};if(!((_0xf4f801=this[_0x215a25(0x17b)])===null||_0xf4f801===void 0x0||(_0xf4f801=_0xf4f801['ln'])===null||_0xf4f801===void 0x0?void 0x0:_0xf4f801[_0x215a25(0x18a)]))this['shapeData']['ln'][_0x215a25(0x18a)]={};return this['shapeData']['ln'][_0x215a25(0x18a)][_0x215a25(0x1c3)]=_0x2fd45b,this;}[_0x50bc8b(0x19e)](_0x3e22cf){const _0x1c54cf=_0x50bc8b;var _0x50325c,_0x217767;if(!((_0x50325c=this[_0x1c54cf(0x17b)])===null||_0x50325c===void 0x0?void 0x0:_0x50325c['ln']))this['shapeData']['ln']={};if(!((_0x217767=this[_0x1c54cf(0x17b)])===null||_0x217767===void 0x0||(_0x217767=_0x217767['ln'])===null||_0x217767===void 0x0?void 0x0:_0x217767['startArrow']))this['shapeData']['ln'][_0x1c54cf(0x187)]={};return this[_0x1c54cf(0x17b)]['ln'][_0x1c54cf(0x187)][_0x1c54cf(0x1b6)]=_0x3e22cf,this;}[_0x50bc8b(0x1d2)](_0xc614a4){const _0x980681=_0x50bc8b;var _0x319eca,_0x4f6868;if(!((_0x319eca=this[_0x980681(0x17b)])===null||_0x319eca===void 0x0?void 0x0:_0x319eca['ln']))this['shapeData']['ln']={};if(!((_0x4f6868=this[_0x980681(0x17b)])===null||_0x4f6868===void 0x0||(_0x4f6868=_0x4f6868['ln'])===null||_0x4f6868===void 0x0?void 0x0:_0x4f6868[_0x980681(0x18a)]))this['shapeData']['ln'][_0x980681(0x18a)]={};return this[_0x980681(0x17b)]['ln'][_0x980681(0x18a)][_0x980681(0x1b6)]=_0xc614a4,this;}[_0x50bc8b(0x1e6)](){const _0x45ca69=_0x50bc8b;return super[_0x45ca69(0x1e6)]();}[_0x50bc8b(0x1ae)](){const _0x19b5b2=_0x50bc8b;var _0xc2877e;return((_0xc2877e=this[_0x19b5b2(0x17b)])===null||_0xc2877e===void 0x0||(_0xc2877e=_0xc2877e[_0x19b5b2(0x189)])===null||_0xc2877e===void 0x0?void 0x0:_0xc2877e['to'])||null;}[_0x50bc8b(0x1fa)](){const _0x1a279a=_0x50bc8b;var _0x387b5b;return((_0x387b5b=this[_0x1a279a(0x17b)])===null||_0x387b5b===void 0x0||(_0x387b5b=_0x387b5b[_0x1a279a(0x189)])===null||_0x387b5b===void 0x0?void 0x0:_0x387b5b[_0x1a279a(0x1c5)])||null;}};function computeConnectionPointInfo(_0x322398,_0x580ed2,_0x32090f,_0xf3933d,_0x343a9e,_0x57fbf8){const _0x1a99c0=_0x50bc8b,_0x157a5c=_0x343a9e[_0x1a99c0(0x194)](_0x322398,_0x580ed2,_0x32090f);if(!_0x157a5c)return null;const _0x5a2c0e=_0x57fbf8[_0x1a99c0(0x199)]({'unitId':_0x322398,'subUnitId':_0x580ed2,'drawingId':_0x32090f});if(!(_0x5a2c0e===null||_0x5a2c0e===void 0x0?void 0x0:_0x5a2c0e[_0x1a99c0(0x1a2)]))return null;const {left:left=0x0,top:top=0x0,width:width=0x0,height:height=0x0,flipX:flipX=![],flipY:flipY=![],angle:_0xd263c6}=_0x5a2c0e[_0x1a99c0(0x1a2)];_0x157a5c[_0x1a99c0(0x188)]({'width':width,'height':height});const _0x2a737b=_0x157a5c[_0x1a99c0(0x1c8)]()[_0x1a99c0(0x1c7)](_0x58771c=>_0x58771c[_0x1a99c0(0x19f)]===_0xf3933d);if(!_0x2a737b)return null;let _0x36e5a6=flipX?width-_0x2a737b['x']:_0x2a737b['x'],_0xbb3625=flipY?height-_0x2a737b['y']:_0x2a737b['y'];if(_0xd263c6&&_0xd263c6!==0x0){const _0x15caf7=_0xd263c6*Math['PI']/0xb4,_0x3d7346=Math['cos'](_0x15caf7),_0x457ade=Math[_0x1a99c0(0x1c4)](_0x15caf7),_0x37b6bf=width/0x2,_0x3e884c=height/0x2,_0x26658e=_0x36e5a6-_0x37b6bf,_0x43befb=_0xbb3625-_0x3e884c;_0x36e5a6=_0x37b6bf+_0x26658e*_0x3d7346-_0x43befb*_0x457ade,_0xbb3625=_0x3e884c+_0x26658e*_0x457ade+_0x43befb*_0x3d7346;}_0x36e5a6+=left,_0xbb3625+=top;let _0x17d231=_0x2a737b[_0x1a99c0(0x1cc)]/0xea60;if(flipX)_0x17d231=0xb4-_0x17d231;if(flipY)_0x17d231=-_0x17d231;_0x17d231+=_0xd263c6||0x0,_0x17d231=(_0x17d231%0x168+0x168)%0x168;const _0x1b9e53=getBasicShapeRotateBound({'left':left,'top':top,'width':width,'height':height},_0xd263c6||0x0);return{'point':{'x':_0x36e5a6,'y':_0xbb3625},'angle':_0x17d231,'bounds':_0x1b9e53};}function calculateFreeEndpointAngle(_0x5799bd,_0x341fa9){const _0x30b80e=_0x341fa9['x']-_0x5799bd['x'],_0x5a50c7=_0x341fa9['y']-_0x5799bd['y'];if(Math['abs'](_0x30b80e)>=Math['abs'](_0x5a50c7))return _0x30b80e>=0x0?0xb4:0x0;return _0x5a50c7>=0x0?0x10e:0x5a;}function computeFreeEndpointInfo(_0x5a61e6,_0x3e5981,_0x5b336c,_0x3f85da,_0x1e58fc,_0x3069bf,_0x4ffc89){const _0x4e733c=_0x50bc8b,_0x3ade5c=_0x3069bf['getShapeModel'](_0x5a61e6,_0x3e5981,_0x5b336c);if(!_0x3ade5c)return null;const _0x5f4144=_0x4ffc89['getDrawingByParam']({'unitId':_0x5a61e6,'subUnitId':_0x3e5981,'drawingId':_0x5b336c});if(!(_0x5f4144===null||_0x5f4144===void 0x0?void 0x0:_0x5f4144['transform']))return null;const {left:left=0x0,top:top=0x0,width:width=0x0,height:height=0x0,flipX:flipX=![],flipY:flipY=![]}=_0x5f4144[_0x4e733c(0x1a2)];_0x3ade5c[_0x4e733c(0x188)]({'width':width,'height':height});const _0x187069=_0x3ade5c[_0x4e733c(0x1c2)]();if(_0x187069[_0x4e733c(0x1ab)]<0x2)return null;const _0x4d03e7=_0x3f85da?_0x187069[0x0]:_0x187069[_0x187069[_0x4e733c(0x1ab)]-0x1],_0x4e44b1=new ConnectorCoordinateTransform({'left':left,'top':top,'width':width,'height':height,'flipX':flipX,'flipY':flipY})[_0x4e733c(0x190)](_0x4d03e7);return{'point':_0x4e44b1,'angle':calculateFreeEndpointAngle(_0x1e58fc[_0x4e733c(0x1e9)],_0x4e44b1),'bounds':{'left':_0x4e44b1['x'],'top':_0x4e44b1['y'],'width':0x0,'height':0x0}};}var FWorksheetShapeMixin=class extends FWorksheet{async[_0x50bc8b(0x1c1)](_0x251a7d){const _0x1e3d8f=_0x50bc8b,{unitId:_0x3a5fd1,subUnitId:_0x16878e,shapeId:_0x3098f4,shapeType:_0x449601,shapeData:_0xddc932,x:_0x4cdd2b,y:_0xe83090,width:_0x4dddd5,height:_0x51d982}=_0x251a7d;return this[_0x1e3d8f(0x196)]['executeCommand'](InsertShapeCommand['id'],{'unitId':_0x3a5fd1,'subUnitId':_0x16878e,'shapeId':_0x3098f4,'shapeType':_0x449601,'shapeData':_0xddc932,'position':{'x':_0x4cdd2b,'y':_0xe83090},'width':_0x4dddd5,'height':_0x51d982});}async[_0x50bc8b(0x1d5)](_0x3a5312){const _0x2ebea1=_0x50bc8b,{unitId:_0x115602,subUnitId:_0x24d220,shapeId:_0x263688,shapeType:_0x352215,shapeData:_0x1b788b,x:_0x4a902f,y:_0x1b831d,width:_0x73e581,height:_0x31ab6d}=_0x3a5312;return this[_0x2ebea1(0x196)][_0x2ebea1(0x1f7)](SetShapeDrawingDataCommand['id'],{'unitId':_0x115602,'subUnitId':_0x24d220,'shapeId':_0x263688,'shapeType':_0x352215,'shapeData':_0x1b788b,'position':{'x':_0x4a902f,'y':_0x1b831d},'width':_0x73e581,'height':_0x31ab6d});}[_0x50bc8b(0x1c9)](_0x4dfb86){const _0x389480=_0x50bc8b,_0x57f7ce=this[_0x389480(0x1a1)]()[_0x389480(0x1d6)](),_0x43cbbd=this[_0x389480(0x1cf)]();if(_0x4dfb86){const _0x2a6bba=new FShape(_0x57f7ce,_0x43cbbd,_0x4dfb86[_0x389480(0x18d)],this['_injector']);return this['_preloadShapeProperties'](_0x2a6bba,_0x57f7ce,_0x43cbbd,_0x4dfb86[_0x389480(0x18d)]),_0x2a6bba;}return new FShape(_0x57f7ce,_0x43cbbd,generateRandomId(),this[_0x389480(0x1fb)]);}[_0x50bc8b(0x1bd)](_0x54deff){const _0x2d7d82=_0x50bc8b,_0x40208c=this[_0x2d7d82(0x1a1)]()[_0x2d7d82(0x1d6)](),_0x57c089=this[_0x2d7d82(0x1cf)]();if(_0x54deff){const _0x30aa32=new FConnectorShape(_0x40208c,_0x57c089,_0x54deff[_0x2d7d82(0x18d)],this[_0x2d7d82(0x1fb)]);return this[_0x2d7d82(0x1f6)](_0x30aa32,_0x40208c,_0x57c089,_0x54deff[_0x2d7d82(0x18d)]),_0x30aa32;}return new FConnectorShape(_0x40208c,_0x57c089,generateRandomId(),this['_injector']);}[_0x50bc8b(0x184)](){const _0x30710d=_0x50bc8b,_0x4c07ad=this[_0x30710d(0x1fb)][_0x30710d(0x1e1)](ISheetDrawingService),_0x498402=this['getWorkbook']()[_0x30710d(0x1d6)](),_0xf8aad7=this[_0x30710d(0x1cf)](),_0x5ef72a=_0x4c07ad[_0x30710d(0x18c)](_0x498402,_0xf8aad7);if(!_0x5ef72a)return[];const _0x37f687=[];for(const [_0xc40887,_0x522bed]of Object[_0x30710d(0x1b2)](_0x5ef72a))if(_0x522bed&&_0x522bed[_0x30710d(0x1ef)]===DrawingTypeEnum[_0x30710d(0x1ba)]){const _0x1e46ca=new FShape(_0x498402,_0xf8aad7,_0xc40887,this[_0x30710d(0x1fb)]);this[_0x30710d(0x1f6)](_0x1e46ca,_0x498402,_0xf8aad7,_0xc40887),_0x37f687[_0x30710d(0x1e4)](_0x1e46ca);}return _0x37f687;}[_0x50bc8b(0x1dd)](_0x40dc2b){const _0x4046e0=_0x50bc8b,{unitId:_0x3dd743,subUnitId:_0x2814db,drawId:_0x336397}=_0x40dc2b;return this[_0x4046e0(0x196)][_0x4046e0(0x1f7)](RemoveSheetDrawingCommand['id'],{'unitId':_0x3dd743,'drawings':[{'unitId':_0x3dd743,'subUnitId':_0x2814db,'drawingId':_0x336397,'drawingType':DrawingTypeEnum[_0x4046e0(0x1ba)]}]});}async[_0x50bc8b(0x182)](_0x490c39){const _0x5817b6=_0x50bc8b,{connector:_0x455c99,startTarget:_0x4f8735,endTarget:_0x582c13}=_0x490c39;if(!_0x4f8735&&!_0x582c13)return![];const _0x225411=this[_0x5817b6(0x1a1)]()['getUnitId'](),_0x56a308=this[_0x5817b6(0x1cf)](),_0x479760=this[_0x5817b6(0x1fb)]['get'](SheetsShapeService),_0x4c9422=this[_0x5817b6(0x1fb)][_0x5817b6(0x1e1)](IDrawingManagerService),_0x3b6b0e=_0x479760[_0x5817b6(0x194)](_0x225411,_0x56a308,_0x455c99['drawId']);if(!_0x3b6b0e)return![];const _0x5a86fc=_0x3b6b0e[_0x5817b6(0x1dc)](),_0x5ccc5f=_0x3b6b0e[_0x5817b6(0x1c0)](),_0x940392={};for(const _0x58e9ee of _0x3b6b0e[_0x5817b6(0x185)]()){const _0x416cc8=_0x3b6b0e[_0x5817b6(0x1e7)](_0x58e9ee);if(_0x416cc8!==void 0x0)_0x940392[_0x58e9ee]=_0x416cc8;}const {startInfo:_0x58897c,endInfo:_0x2576f8}=this['_resolveEndpoints'](_0x225411,_0x56a308,_0x455c99,_0x3b6b0e,_0x4f8735,_0x582c13,_0x479760,_0x4c9422,_0x5ccc5f);if(!_0x58897c||!_0x2576f8)return![];const _0x3c5f39=computeConnectorRouteLayout(routeConnectorLineShape(_0x58897c,_0x2576f8,_0x5a86fc),_0x5a86fc),_0x37c981={};if(_0x4f8735)_0x37c981[_0x5817b6(0x1c5)]={'shapeId':_0x4f8735['shape'][_0x5817b6(0x18d)],'cxnIndex':_0x4f8735[_0x5817b6(0x17f)]};else{if(_0x5ccc5f===null||_0x5ccc5f===void 0x0?void 0x0:_0x5ccc5f['from'])_0x37c981['from']=_0x5ccc5f[_0x5817b6(0x1c5)];}if(_0x582c13)_0x37c981['to']={'shapeId':_0x582c13['shape']['drawId'],'cxnIndex':_0x582c13[_0x5817b6(0x17f)]};else{if(_0x5ccc5f===null||_0x5ccc5f===void 0x0?void 0x0:_0x5ccc5f['to'])_0x37c981['to']=_0x5ccc5f['to'];}return this[_0x5817b6(0x196)][_0x5817b6(0x1f7)](UpdateConnectorRelationCommand['id'],{'unitId':_0x225411,'subUnitId':_0x56a308,'connectorShapeId':_0x455c99['drawId'],'width':_0x3c5f39[_0x5817b6(0x1cb)]['width'],'height':_0x3c5f39[_0x5817b6(0x1cb)][_0x5817b6(0x1d4)],'left':_0x3c5f39[_0x5817b6(0x1cb)][_0x5817b6(0x1be)],'top':_0x3c5f39['worldRect'][_0x5817b6(0x1ce)],'flipX':_0x3c5f39[_0x5817b6(0x1cb)]['flipX']||![],'flipY':_0x3c5f39['worldRect'][_0x5817b6(0x1c6)]||![],'oldAdjustValues':_0x940392,'newAdjustValues':_0x3c5f39[_0x5817b6(0x1f8)],'newLineType':_0x3c5f39['lineType'],'oldLineType':_0x5a86fc,'rotation':_0x3c5f39[_0x5817b6(0x1ed)],'oldRelation':_0x5ccc5f,'newRelation':_0x37c981});}[_0x50bc8b(0x1f6)](_0x489038,_0x4c5c2d,_0x1b06a1,_0x5dfc89){const _0x39a575=_0x50bc8b,_0x5ac2cc=this[_0x39a575(0x1fb)][_0x39a575(0x1e1)](IDrawingManagerService)[_0x39a575(0x199)]({'unitId':_0x4c5c2d,'subUnitId':_0x1b06a1,'drawingId':_0x5dfc89});if(_0x5ac2cc===null||_0x5ac2cc===void 0x0?void 0x0:_0x5ac2cc['transform']){var _0x33f061,_0x4941ee,_0x51f28e,_0x448f5a;_0x489038['x']=(_0x33f061=_0x5ac2cc['transform'][_0x39a575(0x1be)])!==null&&_0x33f061!==void 0x0?_0x33f061:0x0,_0x489038['y']=(_0x4941ee=_0x5ac2cc[_0x39a575(0x1a2)][_0x39a575(0x1ce)])!==null&&_0x4941ee!==void 0x0?_0x4941ee:0x0,_0x489038[_0x39a575(0x1df)]=(_0x51f28e=_0x5ac2cc['transform'][_0x39a575(0x1df)])!==null&&_0x51f28e!==void 0x0?_0x51f28e:_0x489038[_0x39a575(0x1df)],_0x489038[_0x39a575(0x1d4)]=(_0x448f5a=_0x5ac2cc[_0x39a575(0x1a2)][_0x39a575(0x1d4)])!==null&&_0x448f5a!==void 0x0?_0x448f5a:_0x489038[_0x39a575(0x1d4)];}const _0x2381d7=this[_0x39a575(0x1fb)][_0x39a575(0x1e1)](SheetsShapeService)['getShapeModel'](_0x4c5c2d,_0x1b06a1,_0x5dfc89);if(_0x2381d7){_0x489038[_0x39a575(0x1d3)]=_0x2381d7[_0x39a575(0x1dc)]();const _0x381eeb=_0x2381d7['getShapeData']();if(_0x381eeb)_0x489038[_0x39a575(0x17b)]=JSON[_0x39a575(0x1eb)](JSON['stringify'](_0x381eeb));}}[_0x50bc8b(0x17e)](_0x740f21,_0x486f3d,_0xca9ddd,_0x290ce5,_0x2dea79,_0x32ddf4,_0x5f43ea,_0x3d5b91,_0x57599f){const _0x4c078a=_0x50bc8b;let _0x401bbc=null,_0x5376d5=null;if(_0x2dea79)_0x401bbc=computeConnectionPointInfo(_0x740f21,_0x486f3d,_0x2dea79[_0x4c078a(0x18f)][_0x4c078a(0x18d)],_0x2dea79[_0x4c078a(0x17f)],_0x5f43ea,_0x3d5b91);if(_0x32ddf4)_0x5376d5=computeConnectionPointInfo(_0x740f21,_0x486f3d,_0x32ddf4['shape'][_0x4c078a(0x18d)],_0x32ddf4[_0x4c078a(0x17f)],_0x5f43ea,_0x3d5b91);if(!_0x401bbc)_0x401bbc=this['_resolveExistingOrFreeEndpoint'](_0x740f21,_0x486f3d,_0xca9ddd[_0x4c078a(0x18d)],!![],_0x5376d5,_0x57599f===null||_0x57599f===void 0x0?void 0x0:_0x57599f[_0x4c078a(0x1c5)],_0x5f43ea,_0x3d5b91);if(!_0x5376d5)_0x5376d5=this[_0x4c078a(0x18e)](_0x740f21,_0x486f3d,_0xca9ddd['drawId'],![],_0x401bbc,_0x57599f===null||_0x57599f===void 0x0?void 0x0:_0x57599f['to'],_0x5f43ea,_0x3d5b91);return{'startInfo':_0x401bbc,'endInfo':_0x5376d5};}[_0x50bc8b(0x18e)](_0x144913,_0x452050,_0xb90d12,_0x59f4a1,_0x239f34,_0x1376f5,_0x29063c,_0x27cd66){if(_0x1376f5){const _0x4d43e6=computeConnectionPointInfo(_0x144913,_0x452050,_0x1376f5['shapeId'],_0x1376f5['cxnIndex'],_0x29063c,_0x27cd66);if(_0x4d43e6)return _0x4d43e6;}if(!_0x239f34)return null;return computeFreeEndpointInfo(_0x144913,_0x452050,_0xb90d12,_0x59f4a1,_0x239f34,_0x29063c,_0x27cd66);}};FWorksheet[_0x50bc8b(0x1f4)](FWorksheetShapeMixin);export{FConnectorShape,FShape};
1
+ const _0x1c0943=_0x52ab;(function(_0x467b1e,_0x39d3e4){const _0x53259a=_0x52ab,_0x170fdb=_0x467b1e();while(!![]){try{const _0x5cbaa8=-parseInt(_0x53259a(0x14a))/0x1*(-parseInt(_0x53259a(0x13a))/0x2)+-parseInt(_0x53259a(0x141))/0x3+parseInt(_0x53259a(0x181))/0x4*(parseInt(_0x53259a(0x128))/0x5)+parseInt(_0x53259a(0x17b))/0x6*(-parseInt(_0x53259a(0x143))/0x7)+parseInt(_0x53259a(0x14f))/0x8*(parseInt(_0x53259a(0x14e))/0x9)+parseInt(_0x53259a(0x161))/0xa+parseInt(_0x53259a(0x142))/0xb*(-parseInt(_0x53259a(0x172))/0xc);if(_0x5cbaa8===_0x39d3e4)break;else _0x170fdb['push'](_0x170fdb['shift']());}catch(_0x43c391){_0x170fdb['push'](_0x170fdb['shift']());}}}(_0x14c7,0x5ab2e));import{ConnectorCoordinateTransform,ShapeArrowSizeEnum,ShapeArrowTypeEnum,ShapeFillEnum,ShapeGradientTypeEnum,ShapeLineCapEnum,ShapeLineDashEnum,ShapeLineJoinEnum,ShapeLineTypeEnum,ShapeTypeEnum,computeConnectorRouteLayout,getBasicShapeRotateBound,isConnectorShape,routeConnectorLineShape}from'@univerjs-pro/engine-shape';import{FEnum}from'@univerjs/core/facade';import{DEFAULT_SHAPE_HEIGHT,DEFAULT_SHAPE_WIDTH,InsertShapeCommand,SetShapeDrawingDataCommand,SheetsShapeService,UpdateConnectorRelationCommand}from'@univerjs-pro/sheets-shape';import{DrawingTypeEnum,generateRandomId}from'@univerjs/core';function _0x52ab(_0x5149af,_0x21bfa2){_0x5149af=_0x5149af-0x108;const _0x14c7ab=_0x14c7();let _0x52abf6=_0x14c7ab[_0x5149af];return _0x52abf6;}import{IDrawingManagerService}from'@univerjs/drawing';import{SheetSkeletonService,convertPositionCellToSheetOverGrid}from'@univerjs/sheets';import{ISheetDrawingService,RemoveSheetDrawingCommand}from'@univerjs/sheets-drawing';import{FWorksheet}from'@univerjs/sheets/facade';var FSheetsShapeEnumMixin=class extends FEnum{get[_0x1c0943(0x10c)](){return ShapeTypeEnum;}get[_0x1c0943(0x156)](){return ShapeFillEnum;}get[_0x1c0943(0x174)](){return ShapeGradientTypeEnum;}get[_0x1c0943(0x189)](){return ShapeLineTypeEnum;}get[_0x1c0943(0x13b)](){return ShapeLineDashEnum;}get[_0x1c0943(0x138)](){return ShapeLineCapEnum;}get['ShapeLineJoinEnum'](){return ShapeLineJoinEnum;}get[_0x1c0943(0x17a)](){return ShapeArrowTypeEnum;}get[_0x1c0943(0x16c)](){return ShapeArrowSizeEnum;}};FEnum['extend'](FSheetsShapeEnumMixin);function _typeof(_0x484222){'@babel/helpers - typeof';const _0x4ee288=_0x1c0943;return _typeof=_0x4ee288(0x18a)==typeof Symbol&&_0x4ee288(0x182)==typeof Symbol['iterator']?function(_0x540e9f){return typeof _0x540e9f;}:function(_0x10b36b){const _0x465649=_0x4ee288;return _0x10b36b&&_0x465649(0x18a)==typeof Symbol&&_0x10b36b['constructor']===Symbol&&_0x10b36b!==Symbol['prototype']?'symbol':typeof _0x10b36b;},_typeof(_0x484222);}function toPrimitive(_0x3576b7,_0x4c4280){const _0x3f8a97=_0x1c0943;if('object'!=_typeof(_0x3576b7)||!_0x3576b7)return _0x3576b7;var _0x2448b6=_0x3576b7[Symbol[_0x3f8a97(0x184)]];if(void 0x0!==_0x2448b6){var _0x367437=_0x2448b6['call'](_0x3576b7,_0x4c4280||'default');if(_0x3f8a97(0x162)!=_typeof(_0x367437))return _0x367437;throw new TypeError(_0x3f8a97(0x185));}return(_0x3f8a97(0x144)===_0x4c4280?String:Number)(_0x3576b7);}function _0x14c7(){const _0x4658a5=['getSheetId','connectionSiteIndex',',\x20but\x20expected\x20a\x20connector\x20shape\x20type.','getSize','SolidFill','size','setShapeGradientFill','parse','ShapeLineCapEnum','stroke','10562CerUdF','ShapeLineDashEnum','setHeight','_injector','Skeleton\x20for\x20unitId\x20','getShapeModel','get','371763hhvTST','3097105RKQBCL','42gFWFKv','string','setStrokeColor','endArrow','setStrokeWidth','newConnector','updateContext','108emOiGC','dashType','shapeId','point','32517NMooIE','440AeVlcS','executeCommand','Invalid\x20shape\x20type\x20for\x20connector.\x20Received\x20','getConnectionSites','cxnIndex','left','drawId','ShapeFillEnum','getEndConnectInfo','flipX','drawingType','lineType','getAdjustValueByName','worldRect','ensureSkeleton','sin','defineProperty','getConnectorLinePoints','2823630JRLxwW','object','startArrow','NoFill','extend','type','adjustValues','_preloadShapeProperties','getDrawingByParam','abs','stringify','ShapeArrowSizeEnum','setStartArrowType','_resolveEndpoints','width','top','getStartConnectInfo','24VWozcP','_resolveExistingOrFreeEndpoint','ShapeGradientTypeEnum','setPosition','newShape','isLineShape','relation','insertShape','ShapeArrowTypeEnum','457716cyCjQf','opacity','\x20not\x20found','from','build','setStrokeLineDashType','36TFQigZ','symbol','lineStrokeType','toPrimitive','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','setWidth','removeShape','length','ShapeLineTypeEnum','function','gradientStops','getWorkbook','setEndArrowType','\x20and\x20subUnitId\x20','getShapeType','transform','getShapeData','setStrokeLineJoinType','ShapeTypeEnum','push','subUnitId','shapeData','keys','fill','setShapeSolidFill','setAbsolutePosition','getShapeId','shape','gradientType','getConnectionSiteList','getShapeRelation','connectShapes','getAdjustPoints','_commandService','setShapeType','getUnitId','setStrokeLineCapType','height','GradientFill','shapeType','color','entries','find','DRAWING_SHAPE','fillType','setStrokeOpacity','258235buLQpV','lineJoinType','updateShape','setNoneFill','localToWorld','getPosition','setStrokeLineType','unitId'];_0x14c7=function(){return _0x4658a5;};return _0x14c7();}function toPropertyKey(_0xa8165b){const _0x947360=_0x1c0943;var _0x1e9de6=toPrimitive(_0xa8165b,'string');return _0x947360(0x182)==_typeof(_0x1e9de6)?_0x1e9de6:_0x1e9de6+'';}function _defineProperty(_0x41a28a,_0x2467eb,_0xdd1e38){const _0x213a00=_0x1c0943;return(_0x2467eb=toPropertyKey(_0x2467eb))in _0x41a28a?Object[_0x213a00(0x15f)](_0x41a28a,_0x2467eb,{'value':_0xdd1e38,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x41a28a[_0x2467eb]=_0xdd1e38,_0x41a28a;}var FShape=class{constructor(_0x363fcf,_0x527c2a,_0x191348,_0x4dcd18){const _0x53d8cf=_0x1c0943;_defineProperty(this,_0x53d8cf(0x12f),void 0x0),_defineProperty(this,_0x53d8cf(0x10e),void 0x0),_defineProperty(this,_0x53d8cf(0x155),void 0x0),_defineProperty(this,'x',0x0),_defineProperty(this,'y',0x0),_defineProperty(this,_0x53d8cf(0x16f),DEFAULT_SHAPE_WIDTH),_defineProperty(this,_0x53d8cf(0x11f),DEFAULT_SHAPE_HEIGHT),_defineProperty(this,_0x53d8cf(0x121),void 0x0),_defineProperty(this,'shapeData',{}),_defineProperty(this,_0x53d8cf(0x13d),void 0x0),this[_0x53d8cf(0x12f)]=_0x363fcf,this[_0x53d8cf(0x10e)]=_0x527c2a,this[_0x53d8cf(0x155)]=_0x191348||generateRandomId(),this[_0x53d8cf(0x13d)]=_0x4dcd18;}[_0x1c0943(0x175)](_0x9e0542,_0x278d14,_0x79e600,_0x34f7df){const _0x482bb9=_0x1c0943,_0x33b653=this[_0x482bb9(0x13d)][_0x482bb9(0x140)](SheetSkeletonService)['ensureSkeleton'](this[_0x482bb9(0x12f)],this['subUnitId']);if(!_0x33b653)throw new Error(_0x482bb9(0x13e)+this['unitId']+_0x482bb9(0x18e)+this[_0x482bb9(0x10e)]+_0x482bb9(0x17d));const {transform:_0x1f8216}=convertPositionCellToSheetOverGrid(this[_0x482bb9(0x12f)],this[_0x482bb9(0x10e)],{'row':_0x9e0542,'column':_0x278d14,'rowOffset':_0x79e600,'columnOffset':_0x34f7df},0x1,0x1,_0x33b653);return this['x']=_0x1f8216[_0x482bb9(0x154)],this['y']=_0x1f8216[_0x482bb9(0x170)],this;}[_0x1c0943(0x113)](_0x2d7d49,_0x33ef79){return this['x']=_0x2d7d49,this['y']=_0x33ef79,this;}['setShapeType'](_0x59e87b){const _0x24240d=_0x1c0943;return this[_0x24240d(0x121)]=_0x59e87b,this;}[_0x1c0943(0x112)](_0x53d3a7,_0x556971){const _0x242a12=_0x1c0943;if(!this['shapeData'][_0x242a12(0x111)])this['shapeData'][_0x242a12(0x111)]={};this[_0x242a12(0x10f)][_0x242a12(0x111)][_0x242a12(0x126)]=ShapeFillEnum[_0x242a12(0x134)];if(_0x53d3a7!==void 0x0)this[_0x242a12(0x10f)][_0x242a12(0x111)]['color']=_0x53d3a7;if(_0x556971!==void 0x0)this['shapeData']['fill']['opacity']=_0x556971;return this;}[_0x1c0943(0x136)](_0x5718ea,_0x411868,_0x5d836b){const _0x265bd3=_0x1c0943;if(_0x411868===void 0x0||_0x411868[_0x265bd3(0x188)]===0x0)throw new Error('colorStops\x20is\x20required\x20and\x20should\x20contain\x20at\x20least\x20one\x20color\x20stop.');if(!this[_0x265bd3(0x10f)]['fill'])this[_0x265bd3(0x10f)]['fill']={};this['shapeData']['fill'][_0x265bd3(0x18b)]=_0x411868,this[_0x265bd3(0x10f)][_0x265bd3(0x111)][_0x265bd3(0x126)]=ShapeFillEnum[_0x265bd3(0x120)],this[_0x265bd3(0x10f)]['fill'][_0x265bd3(0x116)]=_0x5718ea;if(_0x5d836b!==void 0x0)this[_0x265bd3(0x10f)][_0x265bd3(0x111)]['gradientAngle']=_0x5d836b;return this;}[_0x1c0943(0x12b)](){const _0x1bd810=_0x1c0943;return this[_0x1bd810(0x10f)][_0x1bd810(0x111)]={'fillType':ShapeFillEnum[_0x1bd810(0x164)]},this;}[_0x1c0943(0x145)](_0x295f7d){const _0x23636d=_0x1c0943;if(!this[_0x23636d(0x10f)]['stroke'])this[_0x23636d(0x10f)][_0x23636d(0x139)]={};return this[_0x23636d(0x10f)][_0x23636d(0x139)][_0x23636d(0x122)]=_0x295f7d,this;}[_0x1c0943(0x147)](_0xfc98c1){const _0x30ec5b=_0x1c0943;if(!this[_0x30ec5b(0x10f)][_0x30ec5b(0x139)])this[_0x30ec5b(0x10f)][_0x30ec5b(0x139)]={};return this['shapeData'][_0x30ec5b(0x139)]['width']=_0xfc98c1,this;}[_0x1c0943(0x180)](_0x5e2e77){const _0x22ebe4=_0x1c0943;if(!this[_0x22ebe4(0x10f)]['stroke'])this[_0x22ebe4(0x10f)][_0x22ebe4(0x139)]={};return this['shapeData'][_0x22ebe4(0x139)][_0x22ebe4(0x14b)]=_0x5e2e77,this;}[_0x1c0943(0x10b)](_0xceff2c){const _0xffb65e=_0x1c0943;if(!this[_0xffb65e(0x10f)][_0xffb65e(0x139)])this[_0xffb65e(0x10f)][_0xffb65e(0x139)]={};return this[_0xffb65e(0x10f)][_0xffb65e(0x139)][_0xffb65e(0x129)]=_0xceff2c,this;}[_0x1c0943(0x11e)](_0x46366d){const _0x4a308c=_0x1c0943;if(!this[_0x4a308c(0x10f)]['stroke'])this[_0x4a308c(0x10f)]['stroke']={};return this['shapeData'][_0x4a308c(0x139)]['capType']=_0x46366d,this;}[_0x1c0943(0x127)](_0x594e4c){const _0x1b6fdc=_0x1c0943;if(!this[_0x1b6fdc(0x10f)][_0x1b6fdc(0x139)])this['shapeData'][_0x1b6fdc(0x139)]={};return this[_0x1b6fdc(0x10f)][_0x1b6fdc(0x139)][_0x1b6fdc(0x17c)]=_0x594e4c,this;}[_0x1c0943(0x12e)](_0x1266f0){const _0x41af5c=_0x1c0943;if(!this[_0x41af5c(0x10f)]['stroke'])this['shapeData'][_0x41af5c(0x139)]={};return this['shapeData'][_0x41af5c(0x139)][_0x41af5c(0x183)]=_0x1266f0,this;}[_0x1c0943(0x186)](_0xd231b7){const _0xa6b36=_0x1c0943;return this[_0xa6b36(0x16f)]=_0xd231b7,this;}[_0x1c0943(0x13c)](_0x4cf34c){const _0x59c451=_0x1c0943;return this[_0x59c451(0x11f)]=_0x4cf34c,this;}[_0x1c0943(0x177)](){const _0x5785be=_0x1c0943,_0x573d1=this[_0x5785be(0x13d)][_0x5785be(0x140)](SheetsShapeService)[_0x5785be(0x13f)](this[_0x5785be(0x12f)],this[_0x5785be(0x10e)],this[_0x5785be(0x155)]);if(_0x573d1)return isConnectorShape(_0x573d1['getShapeType']());if(this['shapeType'])return isConnectorShape(this[_0x5785be(0x121)]);return![];}[_0x1c0943(0x152)](){const _0x3bf9f6=_0x1c0943,_0x4be607=this[_0x3bf9f6(0x13d)][_0x3bf9f6(0x140)](SheetsShapeService)[_0x3bf9f6(0x13f)](this[_0x3bf9f6(0x12f)],this[_0x3bf9f6(0x10e)],this[_0x3bf9f6(0x155)]);if(!_0x4be607)return[];const _0x2a474e=this[_0x3bf9f6(0x13d)][_0x3bf9f6(0x140)](IDrawingManagerService)[_0x3bf9f6(0x169)]({'unitId':this[_0x3bf9f6(0x12f)],'subUnitId':this[_0x3bf9f6(0x10e)],'drawingId':this['drawId']});if(!(_0x2a474e===null||_0x2a474e===void 0x0?void 0x0:_0x2a474e[_0x3bf9f6(0x109)]))return[];const {width:width=0x0,height:height=0x0}=_0x2a474e[_0x3bf9f6(0x109)];return _0x4be607[_0x3bf9f6(0x149)]({'width':width,'height':height}),_0x4be607[_0x3bf9f6(0x117)]();}[_0x1c0943(0x11a)](){const _0x4b5a75=_0x1c0943,_0x4f7684=this[_0x4b5a75(0x13d)][_0x4b5a75(0x140)](SheetsShapeService)['getShapeModel'](this['unitId'],this[_0x4b5a75(0x10e)],this[_0x4b5a75(0x155)]);if(!_0x4f7684)return[];const _0x51c046=this[_0x4b5a75(0x13d)][_0x4b5a75(0x140)](IDrawingManagerService)['getDrawingByParam']({'unitId':this[_0x4b5a75(0x12f)],'subUnitId':this[_0x4b5a75(0x10e)],'drawingId':this['drawId']});if(!(_0x51c046===null||_0x51c046===void 0x0?void 0x0:_0x51c046[_0x4b5a75(0x109)]))return[];const {width:width=0x0,height:height=0x0}=_0x51c046['transform'];return _0x4f7684[_0x4b5a75(0x149)]({'width':width,'height':height}),_0x4f7684['getDrawingPoints']();}[_0x1c0943(0x160)](){const _0x3be83d=_0x1c0943,_0x729323=this[_0x3be83d(0x13d)][_0x3be83d(0x140)](SheetsShapeService)[_0x3be83d(0x13f)](this[_0x3be83d(0x12f)],this[_0x3be83d(0x10e)],this[_0x3be83d(0x155)]);if(!_0x729323)return[];if(!isConnectorShape(_0x729323[_0x3be83d(0x108)]()))return[];const _0x3593d1=this[_0x3be83d(0x13d)][_0x3be83d(0x140)](IDrawingManagerService)[_0x3be83d(0x169)]({'unitId':this[_0x3be83d(0x12f)],'subUnitId':this[_0x3be83d(0x10e)],'drawingId':this[_0x3be83d(0x155)]});if(!(_0x3593d1===null||_0x3593d1===void 0x0?void 0x0:_0x3593d1[_0x3be83d(0x109)]))return[];const {width:width=0x0,height:height=0x0}=_0x3593d1['transform'];return _0x729323[_0x3be83d(0x149)]({'width':width,'height':height}),_0x729323[_0x3be83d(0x160)]();}[_0x1c0943(0x171)](){const _0x4b69b1=_0x1c0943;var _0x1cd7b0;const _0x171296=this['_injector'][_0x4b69b1(0x140)](SheetsShapeService)[_0x4b69b1(0x13f)](this['unitId'],this[_0x4b69b1(0x10e)],this[_0x4b69b1(0x155)]);if(!_0x171296)return null;return(_0x1cd7b0=_0x171296[_0x4b69b1(0x171)]())!==null&&_0x1cd7b0!==void 0x0?_0x1cd7b0:null;}['getEndConnectInfo'](){const _0x4f679c=_0x1c0943;var _0x2719df;const _0x20303e=this['_injector'][_0x4f679c(0x140)](SheetsShapeService)[_0x4f679c(0x13f)](this[_0x4f679c(0x12f)],this[_0x4f679c(0x10e)],this['drawId']);if(!_0x20303e)return null;return(_0x2719df=_0x20303e[_0x4f679c(0x157)]())!==null&&_0x2719df!==void 0x0?_0x2719df:null;}[_0x1c0943(0x17f)](){const _0x1cc1b8=_0x1c0943;var _0x1afff0,_0x58776e;if(!this[_0x1cc1b8(0x121)])throw new Error('Shape\x20type\x20is\x20required.\x20Please\x20call\x20setShapeType()\x20before\x20build().');if(this['x']===0x0||this['y']===0x0){const _0x2fcd34=this[_0x1cc1b8(0x13d)]['get'](SheetSkeletonService)[_0x1cc1b8(0x15d)](this['unitId'],this['subUnitId']);if(!_0x2fcd34)throw new Error(_0x1cc1b8(0x13e)+this[_0x1cc1b8(0x12f)]+_0x1cc1b8(0x18e)+this['subUnitId']+_0x1cc1b8(0x17d));const {transform:_0x2c6a68}=convertPositionCellToSheetOverGrid(this[_0x1cc1b8(0x12f)],this[_0x1cc1b8(0x10e)],{'row':0x1,'column':0x1,'rowOffset':0x0,'columnOffset':0x0},0x1,0x1,_0x2fcd34);this['x']=this['x']>0x0?this['x']:_0x2c6a68[_0x1cc1b8(0x154)],this['y']=this['y']>0x0?this['y']:_0x2c6a68['top'];}return this['width']=(_0x1afff0=this[_0x1cc1b8(0x16f)])!==null&&_0x1afff0!==void 0x0?_0x1afff0:DEFAULT_SHAPE_WIDTH,this[_0x1cc1b8(0x11f)]=(_0x58776e=this[_0x1cc1b8(0x11f)])!==null&&_0x58776e!==void 0x0?_0x58776e:DEFAULT_SHAPE_HEIGHT,{'unitId':this[_0x1cc1b8(0x12f)],'subUnitId':this['subUnitId'],'shapeId':this[_0x1cc1b8(0x155)],'shapeType':this['shapeType'],'shapeData':Object[_0x1cc1b8(0x110)](this[_0x1cc1b8(0x10f)])[_0x1cc1b8(0x188)]>0x0?this[_0x1cc1b8(0x10f)]:void 0x0,'x':this['x'],'y':this['y'],'width':this['width'],'height':this[_0x1cc1b8(0x11f)]};}[_0x1c0943(0x114)](){const _0x146040=_0x1c0943;return this[_0x146040(0x155)];}[_0x1c0943(0x108)](){const _0x5b17c1=_0x1c0943;return this[_0x5b17c1(0x121)];}[_0x1c0943(0x10a)](){return this['shapeData'];}[_0x1c0943(0x12d)](){return{'x':this['x'],'y':this['y']};}[_0x1c0943(0x133)](){const _0x302a4a=_0x1c0943;return{'width':this[_0x302a4a(0x16f)],'height':this[_0x302a4a(0x11f)]};}},FConnectorShape=class extends FShape{constructor(_0x296028,_0x312eb5,_0x1580bf,_0x3c8013){const _0xd0f88a=_0x1c0943;super(_0x296028,_0x312eb5,_0x1580bf,_0x3c8013),_defineProperty(this,_0xd0f88a(0x10f),{});}[_0x1c0943(0x11c)](_0x3a53a4){const _0x58190d=_0x1c0943;if(!isConnectorShape(_0x3a53a4))throw new Error(_0x58190d(0x151)+_0x3a53a4+_0x58190d(0x132));return super[_0x58190d(0x11c)](_0x3a53a4),this;}[_0x1c0943(0x16d)](_0x33c702){const _0x34f738=_0x1c0943;var _0x50c021,_0x231b17;if(!((_0x50c021=this[_0x34f738(0x10f)])===null||_0x50c021===void 0x0?void 0x0:_0x50c021['ln']))this[_0x34f738(0x10f)]['ln']={};if(!((_0x231b17=this[_0x34f738(0x10f)])===null||_0x231b17===void 0x0||(_0x231b17=_0x231b17['ln'])===null||_0x231b17===void 0x0?void 0x0:_0x231b17['startArrow']))this[_0x34f738(0x10f)]['ln']['startArrow']={};return this[_0x34f738(0x10f)]['ln'][_0x34f738(0x163)][_0x34f738(0x166)]=_0x33c702,this;}[_0x1c0943(0x18d)](_0x5ad584){const _0x2b8595=_0x1c0943;var _0x4b7442,_0x5d4df7;if(!((_0x4b7442=this[_0x2b8595(0x10f)])===null||_0x4b7442===void 0x0?void 0x0:_0x4b7442['ln']))this[_0x2b8595(0x10f)]['ln']={};if(!((_0x5d4df7=this[_0x2b8595(0x10f)])===null||_0x5d4df7===void 0x0||(_0x5d4df7=_0x5d4df7['ln'])===null||_0x5d4df7===void 0x0?void 0x0:_0x5d4df7[_0x2b8595(0x146)]))this[_0x2b8595(0x10f)]['ln'][_0x2b8595(0x146)]={};return this['shapeData']['ln'][_0x2b8595(0x146)]['type']=_0x5ad584,this;}['setStartArrowSize'](_0x46d6bd){const _0x597488=_0x1c0943;var _0xb6e64d,_0x4592b8;if(!((_0xb6e64d=this[_0x597488(0x10f)])===null||_0xb6e64d===void 0x0?void 0x0:_0xb6e64d['ln']))this[_0x597488(0x10f)]['ln']={};if(!((_0x4592b8=this[_0x597488(0x10f)])===null||_0x4592b8===void 0x0||(_0x4592b8=_0x4592b8['ln'])===null||_0x4592b8===void 0x0?void 0x0:_0x4592b8[_0x597488(0x163)]))this['shapeData']['ln'][_0x597488(0x163)]={};return this[_0x597488(0x10f)]['ln'][_0x597488(0x163)][_0x597488(0x135)]=_0x46d6bd,this;}['setEndArrowSize'](_0x1a93e7){const _0x2340e9=_0x1c0943;var _0x2973d7,_0x410bd9;if(!((_0x2973d7=this['shapeData'])===null||_0x2973d7===void 0x0?void 0x0:_0x2973d7['ln']))this['shapeData']['ln']={};if(!((_0x410bd9=this[_0x2340e9(0x10f)])===null||_0x410bd9===void 0x0||(_0x410bd9=_0x410bd9['ln'])===null||_0x410bd9===void 0x0?void 0x0:_0x410bd9[_0x2340e9(0x146)]))this[_0x2340e9(0x10f)]['ln']['endArrow']={};return this[_0x2340e9(0x10f)]['ln'][_0x2340e9(0x146)][_0x2340e9(0x135)]=_0x1a93e7,this;}['build'](){return super['build']();}[_0x1c0943(0x157)](){var _0x416489;return((_0x416489=this['shapeData'])===null||_0x416489===void 0x0||(_0x416489=_0x416489['relation'])===null||_0x416489===void 0x0?void 0x0:_0x416489['to'])||null;}[_0x1c0943(0x171)](){const _0x10bb52=_0x1c0943;var _0x3e2829;return((_0x3e2829=this[_0x10bb52(0x10f)])===null||_0x3e2829===void 0x0||(_0x3e2829=_0x3e2829[_0x10bb52(0x178)])===null||_0x3e2829===void 0x0?void 0x0:_0x3e2829[_0x10bb52(0x17e)])||null;}};function computeConnectionPointInfo(_0x3444df,_0x2ca9c9,_0x36b22d,_0x5b5e13,_0x527fbc,_0x2a1e5e){const _0x1bae22=_0x1c0943,_0xc67215=_0x527fbc['getShapeModel'](_0x3444df,_0x2ca9c9,_0x36b22d);if(!_0xc67215)return null;const _0x507f4c=_0x2a1e5e[_0x1bae22(0x169)]({'unitId':_0x3444df,'subUnitId':_0x2ca9c9,'drawingId':_0x36b22d});if(!(_0x507f4c===null||_0x507f4c===void 0x0?void 0x0:_0x507f4c[_0x1bae22(0x109)]))return null;const {left:left=0x0,top:top=0x0,width:width=0x0,height:height=0x0,flipX:flipX=![],flipY:flipY=![],angle:_0x18e887}=_0x507f4c[_0x1bae22(0x109)];_0xc67215[_0x1bae22(0x149)]({'width':width,'height':height});const _0x2f5a03=_0xc67215[_0x1bae22(0x117)]()[_0x1bae22(0x124)](_0x276f29=>_0x276f29['index']===_0x5b5e13);if(!_0x2f5a03)return null;let _0x6be10d=flipX?width-_0x2f5a03['x']:_0x2f5a03['x'],_0x2020d5=flipY?height-_0x2f5a03['y']:_0x2f5a03['y'];if(_0x18e887&&_0x18e887!==0x0){const _0x32d616=_0x18e887*Math['PI']/0xb4,_0x2680b4=Math['cos'](_0x32d616),_0x255cb3=Math[_0x1bae22(0x15e)](_0x32d616),_0x5302af=width/0x2,_0x2e8cc6=height/0x2,_0x4d02d4=_0x6be10d-_0x5302af,_0x4e9a67=_0x2020d5-_0x2e8cc6;_0x6be10d=_0x5302af+_0x4d02d4*_0x2680b4-_0x4e9a67*_0x255cb3,_0x2020d5=_0x2e8cc6+_0x4d02d4*_0x255cb3+_0x4e9a67*_0x2680b4;}_0x6be10d+=left,_0x2020d5+=top;let _0x46d042=_0x2f5a03['ang']/0xea60;if(flipX)_0x46d042=0xb4-_0x46d042;if(flipY)_0x46d042=-_0x46d042;_0x46d042+=_0x18e887||0x0,_0x46d042=(_0x46d042%0x168+0x168)%0x168;const _0x5bead0=getBasicShapeRotateBound({'left':left,'top':top,'width':width,'height':height},_0x18e887||0x0);return{'point':{'x':_0x6be10d,'y':_0x2020d5},'angle':_0x46d042,'bounds':_0x5bead0};}function calculateFreeEndpointAngle(_0x27609e,_0x48cc9e){const _0xeeab98=_0x1c0943,_0x834cf2=_0x48cc9e['x']-_0x27609e['x'],_0x296ed7=_0x48cc9e['y']-_0x27609e['y'];if(Math[_0xeeab98(0x16a)](_0x834cf2)>=Math[_0xeeab98(0x16a)](_0x296ed7))return _0x834cf2>=0x0?0xb4:0x0;return _0x296ed7>=0x0?0x10e:0x5a;}function computeFreeEndpointInfo(_0x12231b,_0x6524c4,_0x18568a,_0x431b1c,_0xe7632b,_0x59b8d7,_0x105f2c){const _0x341cc5=_0x1c0943,_0xb0fc43=_0x59b8d7['getShapeModel'](_0x12231b,_0x6524c4,_0x18568a);if(!_0xb0fc43)return null;const _0x33e61b=_0x105f2c[_0x341cc5(0x169)]({'unitId':_0x12231b,'subUnitId':_0x6524c4,'drawingId':_0x18568a});if(!(_0x33e61b===null||_0x33e61b===void 0x0?void 0x0:_0x33e61b['transform']))return null;const {left:left=0x0,top:top=0x0,width:width=0x0,height:height=0x0,flipX:flipX=![],flipY:flipY=![]}=_0x33e61b[_0x341cc5(0x109)];_0xb0fc43[_0x341cc5(0x149)]({'width':width,'height':height});const _0x339b99=_0xb0fc43[_0x341cc5(0x160)]();if(_0x339b99['length']<0x2)return null;const _0x55ab4f=_0x431b1c?_0x339b99[0x0]:_0x339b99[_0x339b99[_0x341cc5(0x188)]-0x1],_0xd3bf8f=new ConnectorCoordinateTransform({'left':left,'top':top,'width':width,'height':height,'flipX':flipX,'flipY':flipY})[_0x341cc5(0x12c)](_0x55ab4f);return{'point':_0xd3bf8f,'angle':calculateFreeEndpointAngle(_0xe7632b[_0x341cc5(0x14d)],_0xd3bf8f),'bounds':{'left':_0xd3bf8f['x'],'top':_0xd3bf8f['y'],'width':0x0,'height':0x0}};}var FWorksheetShapeMixin=class extends FWorksheet{async[_0x1c0943(0x179)](_0x2a08dc){const _0x179c35=_0x1c0943,{unitId:_0x2088d4,subUnitId:_0x140f8b,shapeId:_0x33bc7d,shapeType:_0x133569,shapeData:_0x2f951b,x:_0x5b9ccc,y:_0x27b942,width:_0x49f3ba,height:_0x7560a3}=_0x2a08dc;return this[_0x179c35(0x11b)]['executeCommand'](InsertShapeCommand['id'],{'unitId':_0x2088d4,'subUnitId':_0x140f8b,'shapeId':_0x33bc7d,'shapeType':_0x133569,'shapeData':_0x2f951b,'position':{'x':_0x5b9ccc,'y':_0x27b942},'width':_0x49f3ba,'height':_0x7560a3});}async[_0x1c0943(0x12a)](_0xfda1a2){const _0x5b3ece=_0x1c0943,{unitId:_0x4791ca,subUnitId:_0x339e75,shapeId:_0x32ef15,shapeType:_0x568d59,shapeData:_0x2c4422,x:_0x433d70,y:_0x29152e,width:_0x4e9193,height:_0x57667e}=_0xfda1a2;return this[_0x5b3ece(0x11b)][_0x5b3ece(0x150)](SetShapeDrawingDataCommand['id'],{'unitId':_0x4791ca,'subUnitId':_0x339e75,'shapeId':_0x32ef15,'shapeType':_0x568d59,'shapeData':_0x2c4422,'position':{'x':_0x433d70,'y':_0x29152e},'width':_0x4e9193,'height':_0x57667e});}[_0x1c0943(0x176)](_0x489672){const _0xd8e9cd=_0x1c0943,_0x571516=this['getWorkbook']()[_0xd8e9cd(0x11d)](),_0xce0a76=this['getSheetId']();if(_0x489672){const _0x5172ff=new FShape(_0x571516,_0xce0a76,_0x489672[_0xd8e9cd(0x155)],this[_0xd8e9cd(0x13d)]);return this[_0xd8e9cd(0x168)](_0x5172ff,_0x571516,_0xce0a76,_0x489672[_0xd8e9cd(0x155)]),_0x5172ff;}return new FShape(_0x571516,_0xce0a76,generateRandomId(),this[_0xd8e9cd(0x13d)]);}[_0x1c0943(0x148)](_0x3a2e2e){const _0x1eb909=_0x1c0943,_0x250e55=this[_0x1eb909(0x18c)]()[_0x1eb909(0x11d)](),_0x487447=this[_0x1eb909(0x130)]();if(_0x3a2e2e){const _0x5ce809=new FConnectorShape(_0x250e55,_0x487447,_0x3a2e2e['drawId'],this['_injector']);return this[_0x1eb909(0x168)](_0x5ce809,_0x250e55,_0x487447,_0x3a2e2e['drawId']),_0x5ce809;}return new FConnectorShape(_0x250e55,_0x487447,generateRandomId(),this['_injector']);}['getShapes'](){const _0x4190f4=_0x1c0943,_0x119f00=this[_0x4190f4(0x13d)][_0x4190f4(0x140)](ISheetDrawingService),_0x33ce8e=this[_0x4190f4(0x18c)]()[_0x4190f4(0x11d)](),_0x929bce=this[_0x4190f4(0x130)](),_0x24088a=_0x119f00['getDrawingData'](_0x33ce8e,_0x929bce);if(!_0x24088a)return[];const _0x2a0960=[];for(const [_0x2bb0e2,_0x55d4f2]of Object[_0x4190f4(0x123)](_0x24088a))if(_0x55d4f2&&_0x55d4f2[_0x4190f4(0x159)]===DrawingTypeEnum['DRAWING_SHAPE']){const _0xb14264=new FShape(_0x33ce8e,_0x929bce,_0x2bb0e2,this[_0x4190f4(0x13d)]);this[_0x4190f4(0x168)](_0xb14264,_0x33ce8e,_0x929bce,_0x2bb0e2),_0x2a0960[_0x4190f4(0x10d)](_0xb14264);}return _0x2a0960;}[_0x1c0943(0x187)](_0x7d6d6){const _0x464a15=_0x1c0943,{unitId:_0x10045e,subUnitId:_0x17131c,drawId:_0x14770f}=_0x7d6d6;return this[_0x464a15(0x11b)][_0x464a15(0x150)](RemoveSheetDrawingCommand['id'],{'unitId':_0x10045e,'drawings':[{'unitId':_0x10045e,'subUnitId':_0x17131c,'drawingId':_0x14770f,'drawingType':DrawingTypeEnum[_0x464a15(0x125)]}]});}async[_0x1c0943(0x119)](_0x13965a){const _0x1a4b06=_0x1c0943,{connector:_0x4293fb,startTarget:_0x162f14,endTarget:_0x566454}=_0x13965a;if(!_0x162f14&&!_0x566454)return![];const _0xa9cb22=this[_0x1a4b06(0x18c)]()[_0x1a4b06(0x11d)](),_0x2183f1=this[_0x1a4b06(0x130)](),_0xfcdbef=this[_0x1a4b06(0x13d)][_0x1a4b06(0x140)](SheetsShapeService),_0x31ab05=this[_0x1a4b06(0x13d)][_0x1a4b06(0x140)](IDrawingManagerService),_0x1cf142=_0xfcdbef[_0x1a4b06(0x13f)](_0xa9cb22,_0x2183f1,_0x4293fb[_0x1a4b06(0x155)]);if(!_0x1cf142)return![];const _0x123596=_0x1cf142['getShapeType'](),_0x17ed94=_0x1cf142[_0x1a4b06(0x118)](),_0x6465d5={};for(const _0x347a71 of _0x1cf142['getAdjustNames']()){const _0x18cc21=_0x1cf142[_0x1a4b06(0x15b)](_0x347a71);if(_0x18cc21!==void 0x0)_0x6465d5[_0x347a71]=_0x18cc21;}const {startInfo:_0x141c3e,endInfo:_0x1576aa}=this[_0x1a4b06(0x16e)](_0xa9cb22,_0x2183f1,_0x4293fb,_0x1cf142,_0x162f14,_0x566454,_0xfcdbef,_0x31ab05,_0x17ed94);if(!_0x141c3e||!_0x1576aa)return![];const _0x5bb586=computeConnectorRouteLayout(routeConnectorLineShape(_0x141c3e,_0x1576aa,_0x123596),_0x123596),_0x169042={};if(_0x162f14)_0x169042[_0x1a4b06(0x17e)]={'shapeId':_0x162f14[_0x1a4b06(0x115)][_0x1a4b06(0x155)],'cxnIndex':_0x162f14[_0x1a4b06(0x131)]};else{if(_0x17ed94===null||_0x17ed94===void 0x0?void 0x0:_0x17ed94['from'])_0x169042[_0x1a4b06(0x17e)]=_0x17ed94[_0x1a4b06(0x17e)];}if(_0x566454)_0x169042['to']={'shapeId':_0x566454['shape'][_0x1a4b06(0x155)],'cxnIndex':_0x566454[_0x1a4b06(0x131)]};else{if(_0x17ed94===null||_0x17ed94===void 0x0?void 0x0:_0x17ed94['to'])_0x169042['to']=_0x17ed94['to'];}return this[_0x1a4b06(0x11b)][_0x1a4b06(0x150)](UpdateConnectorRelationCommand['id'],{'unitId':_0xa9cb22,'subUnitId':_0x2183f1,'connectorShapeId':_0x4293fb['drawId'],'width':_0x5bb586[_0x1a4b06(0x15c)][_0x1a4b06(0x16f)],'height':_0x5bb586[_0x1a4b06(0x15c)]['height'],'left':_0x5bb586[_0x1a4b06(0x15c)][_0x1a4b06(0x154)],'top':_0x5bb586[_0x1a4b06(0x15c)][_0x1a4b06(0x170)],'flipX':_0x5bb586[_0x1a4b06(0x15c)][_0x1a4b06(0x158)]||![],'flipY':_0x5bb586[_0x1a4b06(0x15c)]['flipY']||![],'oldAdjustValues':_0x6465d5,'newAdjustValues':_0x5bb586[_0x1a4b06(0x167)],'newLineType':_0x5bb586[_0x1a4b06(0x15a)],'oldLineType':_0x123596,'rotation':_0x5bb586['rotation'],'oldRelation':_0x17ed94,'newRelation':_0x169042});}[_0x1c0943(0x168)](_0x43a9ef,_0xfe3973,_0x13fac9,_0x499fb5){const _0x26ca79=_0x1c0943,_0x3e3dba=this[_0x26ca79(0x13d)][_0x26ca79(0x140)](IDrawingManagerService)[_0x26ca79(0x169)]({'unitId':_0xfe3973,'subUnitId':_0x13fac9,'drawingId':_0x499fb5});if(_0x3e3dba===null||_0x3e3dba===void 0x0?void 0x0:_0x3e3dba['transform']){var _0x427ff4,_0x65f86,_0x1a0263,_0x3810e5;_0x43a9ef['x']=(_0x427ff4=_0x3e3dba[_0x26ca79(0x109)]['left'])!==null&&_0x427ff4!==void 0x0?_0x427ff4:0x0,_0x43a9ef['y']=(_0x65f86=_0x3e3dba[_0x26ca79(0x109)][_0x26ca79(0x170)])!==null&&_0x65f86!==void 0x0?_0x65f86:0x0,_0x43a9ef[_0x26ca79(0x16f)]=(_0x1a0263=_0x3e3dba['transform'][_0x26ca79(0x16f)])!==null&&_0x1a0263!==void 0x0?_0x1a0263:_0x43a9ef[_0x26ca79(0x16f)],_0x43a9ef[_0x26ca79(0x11f)]=(_0x3810e5=_0x3e3dba[_0x26ca79(0x109)]['height'])!==null&&_0x3810e5!==void 0x0?_0x3810e5:_0x43a9ef['height'];}const _0x102311=this[_0x26ca79(0x13d)][_0x26ca79(0x140)](SheetsShapeService)[_0x26ca79(0x13f)](_0xfe3973,_0x13fac9,_0x499fb5);if(_0x102311){_0x43a9ef[_0x26ca79(0x121)]=_0x102311[_0x26ca79(0x108)]();const _0x664667=_0x102311[_0x26ca79(0x10a)]();if(_0x664667)_0x43a9ef[_0x26ca79(0x10f)]=JSON[_0x26ca79(0x137)](JSON[_0x26ca79(0x16b)](_0x664667));}}[_0x1c0943(0x16e)](_0x369373,_0x291e7a,_0x81569b,_0x274b3d,_0x21513b,_0x188f6a,_0x5d5f8c,_0x43522e,_0x3a9834){const _0x13471b=_0x1c0943;let _0x59d4c5=null,_0x6fd587=null;if(_0x21513b)_0x59d4c5=computeConnectionPointInfo(_0x369373,_0x291e7a,_0x21513b['shape'][_0x13471b(0x155)],_0x21513b['connectionSiteIndex'],_0x5d5f8c,_0x43522e);if(_0x188f6a)_0x6fd587=computeConnectionPointInfo(_0x369373,_0x291e7a,_0x188f6a['shape'][_0x13471b(0x155)],_0x188f6a[_0x13471b(0x131)],_0x5d5f8c,_0x43522e);if(!_0x59d4c5)_0x59d4c5=this[_0x13471b(0x173)](_0x369373,_0x291e7a,_0x81569b[_0x13471b(0x155)],!![],_0x6fd587,_0x3a9834===null||_0x3a9834===void 0x0?void 0x0:_0x3a9834['from'],_0x5d5f8c,_0x43522e);if(!_0x6fd587)_0x6fd587=this[_0x13471b(0x173)](_0x369373,_0x291e7a,_0x81569b['drawId'],![],_0x59d4c5,_0x3a9834===null||_0x3a9834===void 0x0?void 0x0:_0x3a9834['to'],_0x5d5f8c,_0x43522e);return{'startInfo':_0x59d4c5,'endInfo':_0x6fd587};}[_0x1c0943(0x173)](_0x32eaa4,_0x1ceac4,_0xcc1712,_0x21adca,_0x5e2c1d,_0xb83e95,_0x14f5a7,_0x2ed87a){const _0x53b544=_0x1c0943;if(_0xb83e95){const _0x3b3b32=computeConnectionPointInfo(_0x32eaa4,_0x1ceac4,_0xb83e95[_0x53b544(0x14c)],_0xb83e95[_0x53b544(0x153)],_0x14f5a7,_0x2ed87a);if(_0x3b3b32)return _0x3b3b32;}if(!_0x5e2c1d)return null;return computeFreeEndpointInfo(_0x32eaa4,_0x1ceac4,_0xcc1712,_0x21adca,_0x5e2c1d,_0x14f5a7,_0x2ed87a);}};FWorksheet[_0x1c0943(0x165)](FWorksheetShapeMixin);export{FConnectorShape,FShape};
package/lib/es/index.js CHANGED
@@ -1 +1 @@
1
- const _0x29362c=_0x5c41;(function(_0x41cc0d,_0x449cf8){const _0x5be84b=_0x5c41,_0x25d5a7=_0x41cc0d();while(!![]){try{const _0x5679ec=-parseInt(_0x5be84b(0xd7))/0x1+-parseInt(_0x5be84b(0xd2))/0x2*(parseInt(_0x5be84b(0xbb))/0x3)+parseInt(_0x5be84b(0x124))/0x4*(parseInt(_0x5be84b(0xe5))/0x5)+-parseInt(_0x5be84b(0xd4))/0x6*(parseInt(_0x5be84b(0xe1))/0x7)+parseInt(_0x5be84b(0xf4))/0x8*(-parseInt(_0x5be84b(0x137))/0x9)+parseInt(_0x5be84b(0xfc))/0xa+parseInt(_0x5be84b(0xfd))/0xb*(parseInt(_0x5be84b(0xd6))/0xc);if(_0x5679ec===_0x449cf8)break;else _0x25d5a7['push'](_0x25d5a7['shift']());}catch(_0x503b0e){_0x25d5a7['push'](_0x25d5a7['shift']());}}}(_0x3beb,0x57425));import{ShapeModel,computeConnectorRouteLayout,getBasicShapeRotateBound,isConnectorShape,routeConnectorLineShape}from'@univerjs-pro/engine-shape';import{CommandType,DependentOn,Disposable,DrawingTypeEnum,ICommandService,IConfigService,IResourceManagerService,IUndoRedoService,IUniverInstanceService,Inject,Injector,Plugin,UniverInstanceType,generateRandomId,merge,sequenceExecute,touchDependencies}from'@univerjs/core';function _0x5c41(_0x56e698,_0x3eb2fc){_0x56e698=_0x56e698-0xb8;const _0x3bebcf=_0x3beb();let _0x5c41d5=_0x3bebcf[_0x56e698];return _0x5c41d5;}import{SheetInterceptorService,SheetSkeletonService,getSheetCommandTarget}from'@univerjs/sheets';import{ClearSheetDrawingTransformerOperation,DrawingApplyType,ISheetDrawingService,InsertSheetDrawingCommand,RemoveSheetDrawingCommand,SetDrawingApplyMutation,SetSheetDrawingCommand,transformToAxisAlignPosition,transformToDrawingPosition}from'@univerjs/sheets-drawing';import{UniverLicensePlugin}from'@univerjs-pro/license';import{IDrawingManagerService}from'@univerjs/drawing';const DEFAULT_SHAPE_WIDTH=0xc8,DEFAULT_SHAPE_HEIGHT=0xc8;function _typeof(_0x4c9aa9){'@babel/helpers - typeof';const _0x2d74c4=_0x5c41;return _typeof=_0x2d74c4(0xbc)==typeof Symbol&&'symbol'==typeof Symbol[_0x2d74c4(0x13a)]?function(_0x5b2b26){return typeof _0x5b2b26;}:function(_0x416bdc){const _0x1aee73=_0x2d74c4;return _0x416bdc&&_0x1aee73(0xbc)==typeof Symbol&&_0x416bdc[_0x1aee73(0xee)]===Symbol&&_0x416bdc!==Symbol[_0x1aee73(0xc6)]?_0x1aee73(0x154):typeof _0x416bdc;},_typeof(_0x4c9aa9);}function toPrimitive(_0x47537d,_0xaeaef9){const _0x1c12cb=_0x5c41;if(_0x1c12cb(0x142)!=_typeof(_0x47537d)||!_0x47537d)return _0x47537d;var _0x1740a6=_0x47537d[Symbol['toPrimitive']];if(void 0x0!==_0x1740a6){var _0x2c53ed=_0x1740a6[_0x1c12cb(0x14b)](_0x47537d,_0xaeaef9||'default');if(_0x1c12cb(0x142)!=_typeof(_0x2c53ed))return _0x2c53ed;throw new TypeError(_0x1c12cb(0xcc));}return(_0x1c12cb(0x115)===_0xaeaef9?String:Number)(_0x47537d);}function toPropertyKey(_0xd94bc1){const _0x2cbaa4=_0x5c41;var _0xf78962=toPrimitive(_0xd94bc1,_0x2cbaa4(0x115));return _0x2cbaa4(0x154)==_typeof(_0xf78962)?_0xf78962:_0xf78962+'';}function _defineProperty(_0x30d4d6,_0x398da7,_0x413a2e){const _0x2a4271=_0x5c41;return(_0x398da7=toPropertyKey(_0x398da7))in _0x30d4d6?Object[_0x2a4271(0xdf)](_0x30d4d6,_0x398da7,{'value':_0x413a2e,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x30d4d6[_0x398da7]=_0x413a2e,_0x30d4d6;}var SheetShapeModelManager=class extends Disposable{constructor(){const _0x4dc27=_0x5c41;super(),_defineProperty(this,_0x4dc27(0x12d),new Map()),_defineProperty(this,_0x4dc27(0x118),new Set()),_defineProperty(this,_0x4dc27(0xdc),new Set());}[_0x29362c(0x13c)](_0x541a67,_0x248a10,_0x413529){const _0x59f82c=_0x29362c,_0x46442d=new ShapeModel(_0x541a67,_0x248a10,_0x413529);this['_shapes'][_0x59f82c(0xff)](_0x248a10,_0x46442d);if(isConnectorShape(_0x541a67))this[_0x59f82c(0x118)][_0x59f82c(0xe4)](_0x248a10);return _0x46442d;}[_0x29362c(0x117)](_0x34684b){const _0x3eed6b=_0x29362c,_0x13e767=[];for(const _0x3d78d9 of this[_0x3eed6b(0x118)]){const _0xd85425=this[_0x3eed6b(0x12d)][_0x3eed6b(0x130)](_0x3d78d9);if(_0xd85425){const _0x1368cf=_0xd85425['getShapeRelation']();if(_0x1368cf){var _0x267b9c,_0xbc7e91;if(((_0x267b9c=_0x1368cf[_0x3eed6b(0xfb)])===null||_0x267b9c===void 0x0?void 0x0:_0x267b9c[_0x3eed6b(0xe9)])===_0x34684b)_0x13e767[_0x3eed6b(0xed)]({..._0x1368cf[_0x3eed6b(0xfb)],'lineShapeId':_0x3d78d9,'isFrom':!![]});if(((_0xbc7e91=_0x1368cf['to'])===null||_0xbc7e91===void 0x0?void 0x0:_0xbc7e91[_0x3eed6b(0xe9)])===_0x34684b)_0x13e767['push']({..._0x1368cf['to'],'lineShapeId':_0x3d78d9,'isFrom':![]});}}}return _0x13e767;}[_0x29362c(0x153)](_0x509906){const _0x4217db=_0x29362c,_0x5801b3=this[_0x4217db(0x12d)]['get'](_0x509906);if(_0x5801b3)return _0x5801b3[_0x4217db(0x14c)]();}[_0x29362c(0x12b)](_0x596739){const _0x5d4706=_0x29362c,_0x7cab1=this[_0x5d4706(0x12d)][_0x5d4706(0x130)](_0x596739);if(_0x7cab1)return _0x7cab1['getShapeType']();}[_0x29362c(0xe2)](_0x5736b4){const _0x2274c7=_0x29362c;return this['_shapes'][_0x2274c7(0x126)](_0x5736b4);}[_0x29362c(0xe6)](_0x3c8729){const _0x525090=_0x29362c,_0x1ee457=this[_0x525090(0x12d)][_0x525090(0x130)](_0x3c8729);if(!_0x1ee457)return;if(isConnectorShape(_0x1ee457['getShapeType']()))this['_linesIds'][_0x525090(0xc2)](_0x3c8729);this['_shapes'][_0x525090(0xc2)](_0x3c8729);}[_0x29362c(0x147)](){const _0x5ac23d=_0x29362c,_0x52bc88=[];return this[_0x5ac23d(0x12d)][_0x5ac23d(0x136)](_0x22d0ba=>{const _0x3ea3cb=_0x5ac23d;_0x52bc88['push'](_0x22d0ba[_0x3ea3cb(0x147)]());}),_0x52bc88;}[_0x29362c(0x119)](_0x39b291){const _0x523353=_0x29362c;for(const _0x24b441 of _0x39b291){const {id:_0x4b427e,shapeType:_0x48b96a}=_0x24b441,_0x1428ff=this[_0x523353(0x13c)](_0x48b96a,_0x4b427e,_0x24b441[_0x523353(0x127)]);if(_0x1428ff&&_0x1428ff[_0x523353(0xf2)]())this['_linesIds']['add'](_0x4b427e);}}[_0x29362c(0x10f)](){const _0x2a3e21=_0x29362c;if(this[_0x2a3e21(0x11b)])return;this[_0x2a3e21(0x12d)][_0x2a3e21(0x136)](_0x13164a=>{const _0x4e11c9=_0x2a3e21;_0x13164a[_0x4e11c9(0x10f)]();}),this[_0x2a3e21(0x12d)][_0x2a3e21(0x13e)](),this[_0x2a3e21(0x118)]['clear'](),this[_0x2a3e21(0xdc)]['clear'](),super[_0x2a3e21(0x10f)]();}};function __decorateParam(_0xcf8436,_0x5143cb){return function(_0x25e3a6,_0x2f4df6){_0x5143cb(_0x25e3a6,_0x2f4df6,_0xcf8436);};}function __decorate(_0x31ed8c,_0x309357,_0x301ad3,_0x20e823){const _0x41c907=_0x29362c;var _0x23aca7=arguments[_0x41c907(0xf0)],_0x5e12af=_0x23aca7<0x3?_0x309357:_0x20e823===null?_0x20e823=Object['getOwnPropertyDescriptor'](_0x309357,_0x301ad3):_0x20e823,_0x19533d;if(typeof Reflect===_0x41c907(0x142)&&typeof Reflect['decorate']===_0x41c907(0xbc))_0x5e12af=Reflect[_0x41c907(0xca)](_0x31ed8c,_0x309357,_0x301ad3,_0x20e823);else{for(var _0x45cf14=_0x31ed8c[_0x41c907(0xf0)]-0x1;_0x45cf14>=0x0;_0x45cf14--)if(_0x19533d=_0x31ed8c[_0x45cf14])_0x5e12af=(_0x23aca7<0x3?_0x19533d(_0x5e12af):_0x23aca7>0x3?_0x19533d(_0x309357,_0x301ad3,_0x5e12af):_0x19533d(_0x309357,_0x301ad3))||_0x5e12af;}return _0x23aca7>0x3&&_0x5e12af&&Object[_0x41c907(0xdf)](_0x309357,_0x301ad3,_0x5e12af),_0x5e12af;}const SHEET_SHAPE_PLUGIN=_0x29362c(0x10b);let SheetsShapeService=class SheetsShapeService extends Disposable{constructor(_0x3caaa2){const _0x56353c=_0x29362c;super(),this[_0x56353c(0xe3)]=_0x3caaa2,_defineProperty(this,_0x56353c(0xe0),new Map()),this[_0x56353c(0x120)]();}[_0x29362c(0xde)](_0x1d3452,_0x392402){const _0x52d4ed=_0x29362c;let _0x923b84=this[_0x52d4ed(0xe0)][_0x52d4ed(0x130)](_0x1d3452);!_0x923b84&&(_0x923b84=new Map(),this[_0x52d4ed(0xe0)][_0x52d4ed(0xff)](_0x1d3452,_0x923b84));let _0x56fb73=_0x923b84[_0x52d4ed(0x130)](_0x392402);return!_0x56fb73&&(_0x56fb73=new SheetShapeModelManager(),_0x923b84[_0x52d4ed(0xff)](_0x392402,_0x56fb73)),_0x56fb73;}['insertShape'](_0x522570,_0x4788f2,_0x7853cf,_0x2cd408,_0x472af1){const _0x362695=_0x29362c;this[_0x362695(0xde)](_0x522570,_0x4788f2)[_0x362695(0x13c)](_0x7853cf,_0x2cd408,_0x472af1);}['removeShape'](_0x103aee,_0x19d5e5,_0x3008b1){const _0x2b84a3=_0x29362c;this['_ensureShapeModelManager'](_0x103aee,_0x19d5e5)[_0x2b84a3(0xe6)](_0x3008b1);}[_0x29362c(0x106)](_0x4ce094,_0x57a829,_0x3e5f5d){const _0x2a8772=_0x29362c;return this[_0x2a8772(0xde)](_0x4ce094,_0x57a829)[_0x2a8772(0x12b)](_0x3e5f5d);}[_0x29362c(0x12b)](_0x47ef51,_0x41981c,_0x3c5fb5){const _0x10d0b7=_0x29362c;return this[_0x10d0b7(0xde)](_0x47ef51,_0x41981c)['getShapeType'](_0x3c5fb5);}[_0x29362c(0xe2)](_0x468462,_0x414017,_0x548400){const _0x205b0f=_0x29362c;return this['_ensureShapeModelManager'](_0x468462,_0x414017)[_0x205b0f(0xe2)](_0x548400);}[_0x29362c(0xf7)](_0x261e80,_0x52c9ee,_0x50829c){const _0x59c579=_0x29362c;return this[_0x59c579(0xde)](_0x261e80,_0x52c9ee)[_0x59c579(0x12b)](_0x50829c);}[_0x29362c(0xeb)](_0x3dfbc9,_0x53adc3,_0x1c7fff){const _0x1e2edf=_0x29362c,_0xfbfd47=this[_0x1e2edf(0xde)](_0x3dfbc9,_0x53adc3);if(!_0xfbfd47[_0x1e2edf(0x12b)](_0x1c7fff))return;const _0x12655e=_0xfbfd47['_shapes'][_0x1e2edf(0x130)](_0x1c7fff);if(!_0x12655e)return;return _0x12655e[_0x1e2edf(0x10c)]();}[_0x29362c(0xf6)](_0x2e6398,_0x5e5416,_0x2e3a5d){const _0x38e09b=_0x29362c;return this[_0x38e09b(0xde)](_0x2e6398,_0x5e5416)['_shapes'][_0x38e09b(0x130)](_0x2e3a5d);}[_0x29362c(0x117)](_0x1e9677,_0x10aace,_0x5e259e){const _0x25bc3a=_0x29362c;return this[_0x25bc3a(0xde)](_0x1e9677,_0x10aace)[_0x25bc3a(0x117)](_0x5e259e);}['getLineShapeRelation'](_0x4569a1,_0x4a52a2,_0x3182bf){const _0x4bdc1e=_0x29362c,_0x4556cb=this[_0x4bdc1e(0xde)](_0x4569a1,_0x4a52a2)[_0x4bdc1e(0x12d)][_0x4bdc1e(0x130)](_0x3182bf);if(!_0x4556cb)return;return _0x4556cb[_0x4bdc1e(0x14c)]();}[_0x29362c(0x143)](){}[_0x29362c(0x131)](_0x271d83){const _0x4617d3=_0x29362c,_0x5b37f3={},_0x29da8a=this[_0x4617d3(0xe0)][_0x4617d3(0x130)](_0x271d83);if(_0x29da8a)_0x29da8a[_0x4617d3(0x136)]((_0x6373aa,_0x5f3954)=>{const _0x122e42=_0x4617d3,_0x2f4822=_0x6373aa[_0x122e42(0x147)]();if(_0x2f4822[_0x122e42(0xf0)]>0x0)_0x5b37f3[_0x5f3954]=_0x2f4822;});return JSON['stringify'](_0x5b37f3);}['_deserializeShapeForUnit'](_0x474596,_0x328632){const _0x167569=_0x29362c;Object[_0x167569(0x13f)](_0x328632)['forEach'](_0x2f6f7e=>{const _0x367a4f=_0x167569;this[_0x367a4f(0xde)](_0x474596,_0x2f6f7e)[_0x367a4f(0x119)](_0x328632[_0x2f6f7e]);});}['toJSON'](){const _0x47dbd7=_0x29362c,_0x5323b6={};return this[_0x47dbd7(0xe0)][_0x47dbd7(0x136)]((_0xbc0c8,_0xcdae5d)=>{const _0xe72dd1=_0x47dbd7;_0x5323b6[_0xcdae5d]={},_0xbc0c8[_0xe72dd1(0x136)]((_0x4a1373,_0x489e64)=>{const _0x4e4cf3=_0xe72dd1;_0x5323b6[_0xcdae5d][_0x489e64]=_0x4a1373[_0x4e4cf3(0x147)]();});}),_0x5323b6;}[_0x29362c(0x119)](_0x1678cd){const _0x22b415=_0x29362c;Object[_0x22b415(0x13f)](_0x1678cd)[_0x22b415(0x136)](_0x1918cd=>{const _0x1ad9d6=_0x22b415,_0x59e508=_0x1678cd[_0x1918cd];Object[_0x1ad9d6(0x13f)](_0x59e508)[_0x1ad9d6(0x136)](_0x4f970a=>{const _0x353727=_0x1ad9d6;this[_0x353727(0xde)](_0x1918cd,_0x4f970a)[_0x353727(0x119)](_0x59e508[_0x4f970a]);});});}[_0x29362c(0x120)](){const _0x3720e=_0x29362c;this[_0x3720e(0xe3)][_0x3720e(0x149)]({'pluginName':SHEET_SHAPE_PLUGIN,'businesses':[UniverInstanceType[_0x3720e(0x109)]],'toJson':_0x169639=>this[_0x3720e(0x131)](_0x169639),'parseJson':_0x268a88=>JSON[_0x3720e(0x10a)](_0x268a88),'onLoad':(_0x5078e5,_0x2b7702)=>{const _0xec3893=_0x3720e;this[_0xec3893(0x14e)](_0x5078e5,_0x2b7702);},'onUnLoad':_0x3a84f3=>{const _0x54ea20=_0x3720e,_0xce6002=this[_0x54ea20(0xe0)]['get'](_0x3a84f3);_0xce6002&&(_0xce6002[_0x54ea20(0x136)](_0x4be9a3=>{_0x4be9a3['dispose']();}),this['_shapeModelManagerMap'][_0x54ea20(0xc2)](_0x3a84f3));}});}[_0x29362c(0x10f)](){const _0x18d0ea=_0x29362c;this[_0x18d0ea(0xe0)][_0x18d0ea(0x136)](_0x51922c=>{_0x51922c['forEach'](_0x47a7d5=>{_0x47a7d5['dispose']();});});}};SheetsShapeService=__decorate([__decorateParam(0x0,IResourceManagerService)],SheetsShapeService);const InsertSheetsShapeMutation={'id':_0x29362c(0x105),'type':CommandType[_0x29362c(0xfe)],'handler':(_0x3070b5,_0x387a31)=>{const _0x21bca4=_0x29362c,{unitId:_0x1c15f3,subUnitId:_0x5656eb,shapeType:_0x49beba,shapeId:_0x56563e,shapeData:_0x8266b7}=_0x387a31;return _0x3070b5[_0x21bca4(0x130)](SheetsShapeService)[_0x21bca4(0xda)](_0x1c15f3,_0x5656eb,_0x49beba,_0x56563e,_0x8266b7),!![];}},RemoveSheetsShapeMutation={'id':'sheet.mutation.remove-shape','type':CommandType[_0x29362c(0xfe)],'handler':(_0x393eb5,_0x407d68)=>{const _0x5daaed=_0x29362c,{unitId:_0x27cfd4,subUnitId:_0x2d85fd,shapeId:_0x33b160}=_0x407d68;return _0x393eb5[_0x5daaed(0x130)](SheetsShapeService)['removeShape'](_0x27cfd4,_0x2d85fd,_0x33b160),!![];}},InsertShapeCommand={'type':CommandType['COMMAND'],'id':_0x29362c(0xd8),'handler':(_0xfa7e0e,_0x1b7a24)=>{const _0x25f623=_0x29362c;var _0x16b9dd,_0x5b8223;const _0x579317=getSheetCommandTarget(_0xfa7e0e[_0x25f623(0x130)](IUniverInstanceService),_0x1b7a24);if(!_0x579317)return![];const _0x33633e=_0xfa7e0e[_0x25f623(0x130)](SheetSkeletonService),{unitId:_0x5d96cd,subUnitId:_0x19749a}=_0x579317,_0x5bf944=_0x33633e[_0x25f623(0xdb)](_0x5d96cd,_0x19749a);if(!_0x5bf944)return![];const _0x194d6a=_0xfa7e0e[_0x25f623(0x130)](ICommandService),_0x1e0cb7=_0xfa7e0e[_0x25f623(0x130)](IUndoRedoService),_0x3a68af=_0xfa7e0e[_0x25f623(0x130)](SheetInterceptorService),_0x218f78=_0xfa7e0e[_0x25f623(0x130)](ISheetDrawingService),{shapeType:_0x1c592a,shapeData:_0x5ea4d9}=_0x1b7a24,_0x26d615=_0x1b7a24[_0x25f623(0xe9)]||generateRandomId(),_0x35736f={'unitId':_0x5d96cd,'subUnitId':_0x19749a,'shapeId':_0x26d615,'shapeType':_0x1c592a,'shapeData':_0x5ea4d9},_0x570487=_0x1b7a24[_0x25f623(0xc8)]||0xc8,_0x187610=_0x1b7a24['height']||0xc8;let _0x1f6731=0x0,_0x301c76=0x0,_0x2272be={'row':0x0,'rowOffset':0x0,'column':0x0,'columnOffset':0x0},_0x59457e={'row':0x0,'rowOffset':0x0,'column':0x0,'columnOffset':0x0};if(_0x1b7a24[_0x25f623(0x146)]){const {x:_0x50eb21,y:_0x4f690a}=_0x1b7a24[_0x25f623(0x146)];_0x1f6731=_0x50eb21,_0x301c76=_0x4f690a,_0x2272be=_0x5bf944[_0x25f623(0x102)](_0x50eb21,_0x4f690a),_0x59457e=_0x5bf944[_0x25f623(0x102)](_0x50eb21+_0x570487,_0x4f690a+_0x187610);}else{if(_0x1b7a24[_0x25f623(0x103)]){const {startRow:_0x139f70,startColumn:_0x222baa}=_0x1b7a24[_0x25f623(0x103)],_0xeecda=0xa,_0x2710d1=0xa;_0x2272be={'row':_0x139f70,'rowOffset':_0xeecda,'column':_0x222baa,'columnOffset':_0x2710d1};const _0x16ad55=_0x5bf944['getCellWithCoordByIndex'](_0x139f70,_0x222baa);_0x1f6731=_0x16ad55['startX']+_0x2710d1,_0x301c76=_0x16ad55['startY']+_0xeecda,_0x59457e=_0x5bf944['getCellIndexAndOffsetByPosition'](_0x1f6731+_0x570487,_0x301c76+_0x187610);}}const _0x4dda76={'from':_0x2272be,'to':_0x59457e},_0x269832={'unitId':_0x5d96cd,'subUnitId':_0x19749a,'drawingId':_0x26d615,'drawingType':DrawingTypeEnum['DRAWING_SHAPE'],'sheetTransform':_0x4dda76,'transform':{'left':_0x1f6731,'top':_0x301c76,'width':_0x570487,'height':_0x187610},'data':{'shapeType':_0x1c592a,'shapeData':_0x5ea4d9},'axisAlignSheetTransform':_0x4dda76,'allowTransform':!![]};isConnectorShape(_0x1c592a)&&(_0x269832[_0x25f623(0xc1)][_0x25f623(0x12f)]=![],_0x269832['data'][_0x25f623(0xc9)]=![],_0x269832[_0x25f623(0xc1)][_0x25f623(0xc3)]=![],_0x269832[_0x25f623(0xc1)][_0x25f623(0xc7)]=![],_0x269832[_0x25f623(0x13b)]['rotateEnabled']=![],_0x269832[_0x25f623(0x13b)][_0x25f623(0xc3)]=![],_0x269832[_0x25f623(0x13b)][_0x25f623(0xc7)]=![]);const {undo:_0x432471,redo:_0x10b83b,objects:_0x50c0e6}=_0x218f78[_0x25f623(0x101)]([_0x269832]),_0x15661a=_0x3a68af[_0x25f623(0xea)]({'id':InsertSheetDrawingCommand['id'],'params':{'unitId':_0x5d96cd,'drawings':[_0x269832]}}),_0x11739c=[...(_0x16b9dd=_0x15661a[_0x25f623(0x128)])!==null&&_0x16b9dd!==void 0x0?_0x16b9dd:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x5d96cd,'subUnitId':_0x19749a,'op':_0x10b83b,'objects':_0x50c0e6,'type':DrawingApplyType[_0x25f623(0x121)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x5d96cd]},..._0x15661a['redos'],{'id':InsertSheetsShapeMutation['id'],'params':_0x35736f}],_0x32ec73=[{'id':RemoveSheetsShapeMutation['id'],'params':{'unitId':_0x5d96cd,'subUnitId':_0x19749a,'shapeId':_0x26d615}},...(_0x5b8223=_0x15661a[_0x25f623(0xdd)])!==null&&_0x5b8223!==void 0x0?_0x5b8223:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x5d96cd,'subUnitId':_0x19749a,'op':_0x432471,'objects':_0x50c0e6,'type':DrawingApplyType['REMOVE']}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x5d96cd]},..._0x15661a[_0x25f623(0x11d)]];if(sequenceExecute(_0x11739c,_0x194d6a))return _0x1e0cb7['pushUndoRedo']({'unitID':_0x5d96cd,'undoMutations':_0x32ec73,'redoMutations':_0x11739c}),!![];return![];}},UpdateSheetsShapeDataMutation={'id':_0x29362c(0xcf),'type':CommandType['MUTATION'],'handler':(_0x4278a5,_0x44cb08)=>{const _0x3f215d=_0x29362c,{unitId:_0x33f2b1,subUnitId:_0x20c4f5,shapeType:_0x3c0c8e,shapeId:_0x296daa,shapeData:_0x3baad3}=_0x44cb08,_0x3ec7f5=_0x4278a5[_0x3f215d(0x130)](SheetsShapeService)[_0x3f215d(0xf6)](_0x33f2b1,_0x20c4f5,_0x296daa);if(_0x3ec7f5){if(_0x3c0c8e!==void 0x0)_0x3ec7f5[_0x3f215d(0x143)](_0x3c0c8e);if(_0x3baad3)_0x3ec7f5===null||_0x3ec7f5===void 0x0||_0x3ec7f5['setShapeData'](_0x3baad3,!![]);}return!![];}},SetShapeDrawingDataCommand={'type':CommandType['COMMAND'],'id':'sheet.command.set-shape-drawing-data','handler':(_0x4ce1e9,_0x31cc5b)=>{const _0x275cf7=_0x29362c;var _0x53fad9,_0x223bdb;const _0x34fd6c=getSheetCommandTarget(_0x4ce1e9[_0x275cf7(0x130)](IUniverInstanceService),_0x31cc5b);if(!_0x34fd6c)return![];const _0x514af6=_0x4ce1e9[_0x275cf7(0x130)](SheetSkeletonService),{unitId:_0x213722,subUnitId:_0x807364}=_0x34fd6c,_0xb877cd=_0x514af6[_0x275cf7(0xdb)](_0x213722,_0x807364);if(!_0xb877cd)return![];const _0x4d4b8f=_0x4ce1e9[_0x275cf7(0x130)](SheetsShapeService),{shapeId:_0x4521e6,shapeType:_0x2873c5,shapeData:_0x66623e,position:_0x5cbb5d,width:_0x577323,height:_0xa102ad}=_0x31cc5b,_0x19e200=_0x4d4b8f['getShapeModel'](_0x213722,_0x807364,_0x4521e6);if(!_0x19e200)return![];const _0xfead06=_0x4ce1e9[_0x275cf7(0x130)](ICommandService),_0x4652be=_0x4ce1e9[_0x275cf7(0x130)](IUndoRedoService),_0x323c00=_0x4ce1e9[_0x275cf7(0x130)](SheetInterceptorService),_0x442d10=_0x4ce1e9[_0x275cf7(0x130)](ISheetDrawingService),_0x477de1={'unitId':_0x213722,'subUnitId':_0x807364,'shapeId':_0x4521e6,'shapeType':_0x2873c5,'shapeData':_0x66623e},_0x48cf02=_0x19e200[_0x275cf7(0x12b)](),_0x58022f=_0x19e200['getShapeData'](),{x:_0x294bde,y:_0x403489}=_0x5cbb5d,_0x5ab0cb={'from':_0xb877cd['getCellIndexAndOffsetByPosition'](_0x294bde,_0x403489),'to':_0xb877cd[_0x275cf7(0x102)](_0x294bde+_0x577323,_0x403489+_0xa102ad)},_0x5ca7d1={'unitId':_0x213722,'subUnitId':_0x807364,'drawingId':_0x4521e6,'drawingType':DrawingTypeEnum[_0x275cf7(0x152)],'sheetTransform':_0x5ab0cb,'transform':{'left':_0x294bde,'top':_0x403489,'width':_0x577323,'height':_0xa102ad},'data':{'shapeType':_0x2873c5,'shapeData':_0x66623e},'axisAlignSheetTransform':_0x5ab0cb,'allowTransform':!![]};isConnectorShape(_0x2873c5)&&(_0x5ca7d1['data'][_0x275cf7(0x12f)]=![],_0x5ca7d1['data'][_0x275cf7(0xc9)]=![],_0x5ca7d1[_0x275cf7(0xc1)][_0x275cf7(0xc3)]=![],_0x5ca7d1[_0x275cf7(0xc1)][_0x275cf7(0xc7)]=![],_0x5ca7d1[_0x275cf7(0x13b)][_0x275cf7(0xc9)]=![],_0x5ca7d1[_0x275cf7(0x13b)][_0x275cf7(0xc3)]=![],_0x5ca7d1[_0x275cf7(0x13b)][_0x275cf7(0xc7)]=![]);const {undo:_0x2a6a0d,redo:_0x10da6b,objects:_0x3aeba4}=_0x442d10[_0x275cf7(0x11c)]([_0x5ca7d1]),_0x32ac06=_0x323c00[_0x275cf7(0xea)]({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x213722,'drawings':[_0x5ca7d1]}}),_0x3d4af0=[...(_0x53fad9=_0x32ac06[_0x275cf7(0x128)])!==null&&_0x53fad9!==void 0x0?_0x53fad9:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x213722,'subUnitId':_0x807364,'op':_0x10da6b,'objects':_0x3aeba4,'type':DrawingApplyType['UPDATE']}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x213722]},..._0x32ac06[_0x275cf7(0xcd)],{'id':UpdateSheetsShapeDataMutation['id'],'params':_0x477de1}],_0x331c20=[...(_0x223bdb=_0x32ac06[_0x275cf7(0xdd)])!==null&&_0x223bdb!==void 0x0?_0x223bdb:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x213722,'subUnitId':_0x807364,'op':_0x2a6a0d,'objects':_0x3aeba4,'type':DrawingApplyType[_0x275cf7(0x141)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x213722]},..._0x32ac06['undos'],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x213722,'subUnitId':_0x807364,'shapeType':_0x48cf02,'shapeId':_0x4521e6,'shapeData':_0x58022f}}];if(sequenceExecute(_0x3d4af0,_0xfead06))return _0x4652be[_0x275cf7(0xf5)]({'unitID':_0x213722,'undoMutations':_0x331c20,'redoMutations':_0x3d4af0}),!![];return![];}},ToggleSheetsShapeFlipCommand={'type':CommandType['COMMAND'],'id':_0x29362c(0x135),'handler':(_0x5b7bdf,_0x795913)=>{const _0x348acc=_0x29362c;var _0x1a3b1d,_0x2efe83;const _0x3b4ae3=getSheetCommandTarget(_0x5b7bdf[_0x348acc(0x130)](IUniverInstanceService),_0x795913);if(!_0x3b4ae3)return![];const _0x1cf4f9=_0x5b7bdf[_0x348acc(0x130)](SheetSkeletonService),{unitId:_0x2d4d10,subUnitId:_0x25f0e0}=_0x3b4ae3,_0x174664=_0x1cf4f9[_0x348acc(0x145)](_0x2d4d10,_0x25f0e0);if(!_0x174664)return![];const _0x1c3fc6=_0x5b7bdf[_0x348acc(0x130)](ISheetDrawingService),{shapeId:_0x36c1e1,flipH:_0x2adfd4,flipV:_0x35aff2}=_0x795913,_0x315d3a=_0x1c3fc6['getDrawingByParam']({'unitId':_0x2d4d10,'subUnitId':_0x25f0e0,'drawingId':_0x36c1e1});if(!_0x315d3a)return![];const _0x3a4f2d=_0x5b7bdf[_0x348acc(0x130)](SheetsShapeService)[_0x348acc(0xf6)](_0x2d4d10,_0x25f0e0,_0x36c1e1);if(!_0x3a4f2d)return![];const _0xef3e55=_0x5b7bdf[_0x348acc(0x130)](ICommandService),_0x24de29=_0x5b7bdf[_0x348acc(0x130)](IUndoRedoService),_0x53e351=_0x5b7bdf[_0x348acc(0x130)](SheetInterceptorService),_0x20200f={..._0x315d3a[_0x348acc(0x13b)]};if(_0x2adfd4!==void 0x0)_0x20200f[_0x348acc(0x14f)]=!_0x20200f['flipX'];if(_0x35aff2!==void 0x0)_0x20200f[_0x348acc(0x14a)]=!_0x20200f[_0x348acc(0x14a)];const _0xf54611=transformToDrawingPosition(_0x20200f,_0x174664),_0x30b366=transformToAxisAlignPosition(_0x20200f,_0x174664),_0x2191c9=_0x3a4f2d[_0x348acc(0x12b)](),_0x44d0e0=_0x3a4f2d[_0x348acc(0x10c)](),_0x53405c={'unitId':_0x2d4d10,'subUnitId':_0x25f0e0,'drawingId':_0x36c1e1,'drawingType':DrawingTypeEnum[_0x348acc(0x152)],'sheetTransform':_0xf54611,'transform':_0x20200f,'data':{'shapeType':_0x2191c9,'shapeData':_0x44d0e0},'axisAlignSheetTransform':_0x30b366,'allowTransform':!![]},{undo:_0x2a43cf,redo:_0x34dad4,objects:_0x5ebf20}=_0x1c3fc6['getBatchUpdateOp']([_0x53405c]),_0x4858ac=_0x53e351[_0x348acc(0xea)]({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x2d4d10,'drawings':[_0x53405c]}}),_0x2bd079=[...(_0x1a3b1d=_0x4858ac[_0x348acc(0x128)])!==null&&_0x1a3b1d!==void 0x0?_0x1a3b1d:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x2d4d10,'subUnitId':_0x25f0e0,'op':_0x34dad4,'objects':_0x5ebf20,'type':DrawingApplyType['UPDATE']}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x2d4d10]},..._0x4858ac[_0x348acc(0xcd)]],_0x2d3075=[...(_0x2efe83=_0x4858ac[_0x348acc(0xdd)])!==null&&_0x2efe83!==void 0x0?_0x2efe83:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x2d4d10,'subUnitId':_0x25f0e0,'op':_0x2a43cf,'objects':_0x5ebf20,'type':DrawingApplyType['UPDATE']}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x2d4d10]},..._0x4858ac[_0x348acc(0x11d)]];if(isConnectorShape(_0x2191c9)){const _0x128ab4=_0x3a4f2d[_0x348acc(0x14c)]();if(_0x128ab4){const _0x2abcb2={..._0x128ab4};_0x2abcb2[_0x348acc(0xfb)]=void 0x0,_0x2abcb2['to']=void 0x0,_0x2bd079[_0x348acc(0xed)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x2d4d10,'subUnitId':_0x25f0e0,'shapeId':_0x36c1e1,'shapeType':_0x2191c9,'shapeData':{'relation':_0x2abcb2}}}),_0x2d3075[_0x348acc(0xed)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x2d4d10,'subUnitId':_0x25f0e0,'shapeId':_0x36c1e1,'shapeType':_0x2191c9,'shapeData':{'relation':_0x128ab4}}});}}if(sequenceExecute(_0x2bd079,_0xef3e55))return _0x24de29[_0x348acc(0xf5)]({'unitID':_0x2d4d10,'undoMutations':_0x2d3075,'redoMutations':_0x2bd079}),!![];return![];}},SetSheetsShapeRotateCommand={'type':CommandType[_0x29362c(0x150)],'id':_0x29362c(0xf3),'handler':(_0x344c95,_0x419449)=>{const _0x544f88=_0x29362c;var _0x1ca0bd,_0x42669d;const _0x51c589=getSheetCommandTarget(_0x344c95[_0x544f88(0x130)](IUniverInstanceService),_0x419449);if(!_0x51c589)return![];const _0x9e32d3=_0x344c95[_0x544f88(0x130)](SheetSkeletonService),{unitId:_0x12a735,subUnitId:_0x4afb5b}=_0x51c589,_0x41d3eb=_0x9e32d3[_0x544f88(0x145)](_0x12a735,_0x4afb5b);if(!_0x41d3eb)return![];const _0x41e888=_0x344c95[_0x544f88(0x130)](ISheetDrawingService),{shapeId:_0x4c9227,rotate:_0x42a12f}=_0x419449,_0x813090=_0x41e888[_0x544f88(0xc5)]({'unitId':_0x12a735,'subUnitId':_0x4afb5b,'drawingId':_0x4c9227});if(!_0x813090)return![];const _0x1e6035=_0x344c95[_0x544f88(0x130)](SheetsShapeService)[_0x544f88(0xf6)](_0x12a735,_0x4afb5b,_0x4c9227);if(!_0x1e6035)return![];const _0x2df2de=_0x344c95[_0x544f88(0x130)](ICommandService),_0x44ea75=_0x344c95[_0x544f88(0x130)](IUndoRedoService),_0x20f0ef=_0x344c95[_0x544f88(0x130)](SheetInterceptorService),_0x215477={..._0x813090['transform']};if(_0x42a12f!==void 0x0)_0x215477['angle']=(_0x215477[_0x544f88(0x134)]||0x0)+_0x42a12f;const _0x15e2f1=transformToDrawingPosition(_0x215477,_0x41d3eb),_0x1f8019=transformToAxisAlignPosition(_0x215477,_0x41d3eb),_0x18c24e=_0x1e6035[_0x544f88(0x12b)](),_0x323c6b=_0x1e6035['getShapeData'](),_0x4e2e02={'unitId':_0x12a735,'subUnitId':_0x4afb5b,'drawingId':_0x4c9227,'drawingType':DrawingTypeEnum['DRAWING_SHAPE'],'sheetTransform':_0x15e2f1,'transform':_0x215477,'data':{'shapeType':_0x18c24e,'shapeData':_0x323c6b},'axisAlignSheetTransform':_0x1f8019,'allowTransform':!![]},{undo:_0x366832,redo:_0x3ac9a0,objects:_0x15ef57}=_0x41e888['getBatchUpdateOp']([_0x4e2e02]),_0x2cf90c=_0x20f0ef[_0x544f88(0xea)]({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x12a735,'drawings':[_0x4e2e02]}}),_0x4fa956=[...(_0x1ca0bd=_0x2cf90c[_0x544f88(0x128)])!==null&&_0x1ca0bd!==void 0x0?_0x1ca0bd:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x12a735,'subUnitId':_0x4afb5b,'op':_0x3ac9a0,'objects':_0x15ef57,'type':DrawingApplyType[_0x544f88(0x141)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x12a735]},..._0x2cf90c['redos']],_0xebc8ca=[...(_0x42669d=_0x2cf90c[_0x544f88(0xdd)])!==null&&_0x42669d!==void 0x0?_0x42669d:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x12a735,'subUnitId':_0x4afb5b,'op':_0x366832,'objects':_0x15ef57,'type':DrawingApplyType['UPDATE']}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x12a735]},..._0x2cf90c['undos']];if(sequenceExecute(_0x4fa956,_0x2df2de))return _0x44ea75['pushUndoRedo']({'unitID':_0x12a735,'undoMutations':_0xebc8ca,'redoMutations':_0x4fa956}),!![];return![];}},SetSheetsShapeTextVerticalToggleCommand={'type':CommandType[_0x29362c(0x150)],'id':_0x29362c(0x14d),'handler':(_0x3ddade,_0xdbdec8)=>{const _0x259b91=_0x29362c;var _0x21909e;const _0x558164=getSheetCommandTarget(_0x3ddade[_0x259b91(0x130)](IUniverInstanceService),_0xdbdec8);if(!_0x558164)return![];const {unitId:_0x2d7119,subUnitId:_0x141b8c}=_0x558164,{shapeId:_0x2c6847}=_0xdbdec8,_0x37615e=_0x3ddade[_0x259b91(0x130)](SheetsShapeService)['getShapeModel'](_0x2d7119,_0x141b8c,_0x2c6847);if(!_0x37615e)return![];const _0x599a8a=_0x37615e[_0x259b91(0x10e)](),_0x362dc7=(_0x21909e=_0x599a8a===null||_0x599a8a===void 0x0?void 0x0:_0x599a8a[_0x259b91(0x100)])!==null&&_0x21909e!==void 0x0?_0x21909e:!![],_0x1295b5=!_0x362dc7,_0x5c2ccc=_0x3ddade[_0x259b91(0x130)](ICommandService),_0x1440e9=_0x3ddade[_0x259b91(0x130)](IUndoRedoService),_0x1f2985={'unitId':_0x2d7119,'subUnitId':_0x141b8c,'shapeId':_0x2c6847,'shapeData':{'shapeText':{'isHorizontal':_0x1295b5}}},_0xf4cae9={'unitId':_0x2d7119,'subUnitId':_0x141b8c,'shapeId':_0x2c6847,'shapeData':{'shapeText':{'isHorizontal':_0x362dc7}}},_0x2fe501=[{'id':UpdateSheetsShapeDataMutation['id'],'params':_0x1f2985}],_0x39754c=[{'id':UpdateSheetsShapeDataMutation['id'],'params':_0xf4cae9}];if(sequenceExecute(_0x2fe501,_0x5c2ccc))return _0x1440e9['pushUndoRedo']({'unitID':_0x2d7119,'undoMutations':_0x39754c,'redoMutations':_0x2fe501}),!![];return![];}},UpdateConnectorRelationCommand={'type':CommandType[_0x29362c(0x150)],'id':_0x29362c(0x132),'handler':(_0x430658,_0x572ec9)=>{const _0x278b17=_0x29362c;var _0x43609d,_0xdc9b05,_0x297d34,_0x2ef89b;const _0x39fda9=getSheetCommandTarget(_0x430658[_0x278b17(0x130)](IUniverInstanceService),_0x572ec9);if(!_0x39fda9)return![];const _0x179d1b=_0x430658['get'](SheetSkeletonService),{unitId:_0xb7c1e3,subUnitId:_0x3ae862}=_0x39fda9,_0x37504d=_0x179d1b[_0x278b17(0x145)](_0xb7c1e3,_0x3ae862);if(!_0x37504d)return![];const _0x134130=_0x430658[_0x278b17(0x130)](ISheetDrawingService),{connectorShapeId:_0xa7e3f4,width:_0x29d3e5,height:_0x1bcab6,left:_0x2b9067,top:_0x493b1f,flipX:_0x412fd5,flipY:_0x3b765e,rotation:_0x4d1c4f,oldAdjustValues:_0x32edc4,newAdjustValues:_0x20f541,oldLineType:_0x8255a6,newLineType:_0x5332d6,oldRelation:_0x38be44,newRelation:_0x5a01c6}=_0x572ec9,_0x5b2482=_0x134130['getDrawingByParam']({'unitId':_0xb7c1e3,'subUnitId':_0x3ae862,'drawingId':_0xa7e3f4});if(!_0x5b2482)return![];const _0x4c5b4e=_0x430658['get'](SheetsShapeService)[_0x278b17(0xf6)](_0xb7c1e3,_0x3ae862,_0xa7e3f4);if(!_0x4c5b4e)return![];const _0x1bd9ed=_0x430658['get'](ICommandService),_0x55e65d=_0x430658[_0x278b17(0x130)](IUndoRedoService),_0x6eb173=_0x430658[_0x278b17(0x130)](SheetInterceptorService),_0x5c5d16={..._0x5b2482[_0x278b17(0x13b)],'width':_0x29d3e5,'height':_0x1bcab6,'left':_0x2b9067,'top':_0x493b1f,'flipX':_0x412fd5,'flipY':_0x3b765e,'angle':(_0x43609d=_0x4d1c4f!==null&&_0x4d1c4f!==void 0x0?_0x4d1c4f:(_0xdc9b05=_0x5b2482[_0x278b17(0x13b)])===null||_0xdc9b05===void 0x0?void 0x0:_0xdc9b05[_0x278b17(0x134)])!==null&&_0x43609d!==void 0x0?_0x43609d:0x0},_0x294ff5=transformToDrawingPosition(_0x5c5d16,_0x37504d),_0x1bbc9e=transformToAxisAlignPosition(_0x5c5d16,_0x37504d),_0x424d62=_0x4c5b4e[_0x278b17(0x12b)](),_0x28d28f=_0x4c5b4e[_0x278b17(0x10c)](),_0x16452d={'unitId':_0xb7c1e3,'subUnitId':_0x3ae862,'drawingId':_0xa7e3f4,'drawingType':DrawingTypeEnum[_0x278b17(0x152)],'sheetTransform':_0x294ff5,'transform':_0x5c5d16,'data':{'shapeType':_0x5332d6||_0x8255a6||_0x424d62,'shapeData':{..._0x28d28f,'adjustValues':_0x20f541||_0x32edc4||(_0x28d28f===null||_0x28d28f===void 0x0?void 0x0:_0x28d28f[_0x278b17(0x108)]),'relation':_0x5a01c6||_0x38be44||(_0x28d28f===null||_0x28d28f===void 0x0?void 0x0:_0x28d28f['relation'])}},'axisAlignSheetTransform':_0x1bbc9e,'allowTransform':!![]},{undo:_0x7cc7f2,redo:_0x2e398d,objects:_0x2ed0b1}=_0x134130[_0x278b17(0x11c)]([_0x16452d]),_0x406335=_0x6eb173[_0x278b17(0xea)]({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0xb7c1e3,'drawings':[_0x16452d]}}),_0x46bca3=[...(_0x297d34=_0x406335['preRedos'])!==null&&_0x297d34!==void 0x0?_0x297d34:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0xb7c1e3,'subUnitId':_0x3ae862,'op':_0x2e398d,'objects':_0x2ed0b1,'type':DrawingApplyType[_0x278b17(0x141)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0xb7c1e3]},..._0x406335['redos'],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0xb7c1e3,'subUnitId':_0x3ae862,'shapeId':_0xa7e3f4,'shapeType':_0x5332d6,'shapeData':{'adjustValues':_0x20f541,'relation':_0x5a01c6}}}],_0x3e9c7b=[...(_0x2ef89b=_0x406335[_0x278b17(0xdd)])!==null&&_0x2ef89b!==void 0x0?_0x2ef89b:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0xb7c1e3,'subUnitId':_0x3ae862,'op':_0x7cc7f2,'objects':_0x2ed0b1,'type':DrawingApplyType[_0x278b17(0x141)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0xb7c1e3]},..._0x406335['undos'],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0xb7c1e3,'subUnitId':_0x3ae862,'shapeId':_0xa7e3f4,'shapeType':_0x424d62,'shapeData':{..._0x28d28f,'adjustValues':_0x32edc4||(_0x28d28f===null||_0x28d28f===void 0x0?void 0x0:_0x28d28f[_0x278b17(0x108)]),'relation':_0x38be44||(_0x28d28f===null||_0x28d28f===void 0x0?void 0x0:_0x28d28f['relation'])}}}];if(sequenceExecute(_0x46bca3,_0x1bd9ed))return _0x55e65d[_0x278b17(0xf5)]({'unitID':_0xb7c1e3,'undoMutations':_0x3e9c7b,'redoMutations':_0x46bca3}),!![];return![];}},UpdateLineShapeResizeCommand={'type':CommandType[_0x29362c(0x150)],'id':_0x29362c(0x113),'handler':(_0xbf2b88,_0x41d1e4)=>{const _0x4b67f4=_0x29362c;var _0x4c974a,_0x32c221;const _0x514b56=getSheetCommandTarget(_0xbf2b88[_0x4b67f4(0x130)](IUniverInstanceService),_0x41d1e4);if(!_0x514b56)return![];const _0x2bf110=_0xbf2b88[_0x4b67f4(0x130)](SheetSkeletonService),{unitId:_0x35e646,subUnitId:_0x49784d}=_0x514b56,_0x20eaee=_0x2bf110[_0x4b67f4(0x145)](_0x35e646,_0x49784d);if(!_0x20eaee)return![];const _0x51d891=_0xbf2b88['get'](ISheetDrawingService),{shapeId:_0x1e8651,width:_0x4b5ce8,height:_0x472531,left:_0x2f15e2,top:_0x4dd666,flipX:_0x184d91,flipY:_0x3cba55,angle:_0x1f2d42,oldAdjustValues:_0x46ae1d,newAdjustValues:_0x4a5962,oldLineType:_0x183502,newLineType:_0x9cc689}=_0x41d1e4,_0x4524a9=_0x51d891[_0x4b67f4(0xc5)]({'unitId':_0x35e646,'subUnitId':_0x49784d,'drawingId':_0x1e8651});if(!_0x4524a9)return![];const _0x4db404=_0xbf2b88['get'](SheetsShapeService)[_0x4b67f4(0xf6)](_0x35e646,_0x49784d,_0x1e8651);if(!_0x4db404)return![];const _0x8ed6d6=_0xbf2b88[_0x4b67f4(0x130)](ICommandService),_0x4effec=_0xbf2b88[_0x4b67f4(0x130)](IUndoRedoService),_0x5ca586=_0xbf2b88[_0x4b67f4(0x130)](SheetInterceptorService),_0xbfd355={..._0x4524a9[_0x4b67f4(0x13b)],'width':_0x4b5ce8,'height':_0x472531,'left':_0x2f15e2,'top':_0x4dd666,'flipX':_0x184d91,'flipY':_0x3cba55,'angle':_0x1f2d42},_0x5877fb=transformToDrawingPosition(_0xbfd355,_0x20eaee),_0x37c620=transformToAxisAlignPosition(_0xbfd355,_0x20eaee),_0x5f5130=_0x4db404['getShapeType'](),_0x1a13a0=_0x4db404[_0x4b67f4(0x10c)](),_0x512945={'unitId':_0x35e646,'subUnitId':_0x49784d,'drawingId':_0x1e8651,'drawingType':DrawingTypeEnum[_0x4b67f4(0x152)],'sheetTransform':_0x5877fb,'transform':_0xbfd355,'data':{'shapeType':_0x9cc689||_0x183502||_0x5f5130,'shapeData':{..._0x1a13a0,'adjustValues':_0x4a5962||_0x46ae1d||(_0x1a13a0===null||_0x1a13a0===void 0x0?void 0x0:_0x1a13a0['adjustValues'])}},'axisAlignSheetTransform':_0x37c620,'allowTransform':!![]},{undo:_0x3eb377,redo:_0x43e2fb,objects:_0x222af9}=_0x51d891['getBatchUpdateOp']([_0x512945]),_0x254d10=_0x5ca586[_0x4b67f4(0xea)]({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x35e646,'drawings':[_0x512945]}}),_0xcefa4a=[...(_0x4c974a=_0x254d10[_0x4b67f4(0x128)])!==null&&_0x4c974a!==void 0x0?_0x4c974a:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x35e646,'subUnitId':_0x49784d,'op':_0x43e2fb,'objects':_0x222af9,'type':DrawingApplyType[_0x4b67f4(0x141)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x35e646]},..._0x254d10['redos'],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x35e646,'subUnitId':_0x49784d,'shapeId':_0x1e8651,'shapeType':_0x9cc689,'shapeData':{'adjustValues':_0x4a5962}}}],_0x542f8c=[...(_0x32c221=_0x254d10['preUndos'])!==null&&_0x32c221!==void 0x0?_0x32c221:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x35e646,'subUnitId':_0x49784d,'op':_0x3eb377,'objects':_0x222af9,'type':DrawingApplyType[_0x4b67f4(0x141)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x35e646]},..._0x254d10[_0x4b67f4(0x11d)],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x35e646,'subUnitId':_0x49784d,'shapeId':_0x1e8651,'shapeType':_0x5f5130,'shapeData':{..._0x1a13a0,'adjustValues':_0x46ae1d||(_0x1a13a0===null||_0x1a13a0===void 0x0?void 0x0:_0x1a13a0['adjustValues'])}}}];if(sequenceExecute(_0xcefa4a,_0x8ed6d6))return _0x4effec[_0x4b67f4(0xf5)]({'unitID':_0x35e646,'undoMutations':_0x542f8c,'redoMutations':_0xcefa4a}),!![];return![];}},UpdateSheetsShapeTypeMutation={'id':_0x29362c(0x112),'type':CommandType['MUTATION'],'handler':(_0x514d6b,_0x4cd122)=>{const _0x5a96c8=_0x29362c,{unitId:_0x5d1b18,subUnitId:_0xacfbe0,shapeType:_0x31ab0f,shapeId:_0x30658d,shapeData:_0x358ef8}=_0x4cd122,_0x144e1c=_0x514d6b['get'](SheetsShapeService)[_0x5a96c8(0xf6)](_0x5d1b18,_0xacfbe0,_0x30658d);if(_0x144e1c){_0x144e1c['setShapeType'](_0x31ab0f);if(_0x358ef8)_0x144e1c===null||_0x144e1c===void 0x0||_0x144e1c[_0x5a96c8(0xf9)](_0x358ef8);}return!![];}},UpdateSheetsShapeTypeCommand={'id':'sheet.command.update-shape-type','type':CommandType[_0x29362c(0x150)],'handler':(_0x5202d8,_0x2d69a0)=>{const _0x4b9e73=_0x29362c;if(!_0x2d69a0)return![];const _0x2a50bd=_0x5202d8[_0x4b9e73(0x130)](ICommandService),_0x309a05=_0x5202d8[_0x4b9e73(0x130)](SheetsShapeService),_0x2db40b=_0x5202d8[_0x4b9e73(0x130)](IUndoRedoService),_0x43e3e6=[],_0x4557a2=[],{unitId:_0x44bb41,subUnitId:_0x57ec5e,shapeId:_0x25cf7b,shapeType:_0x5f8f6c,shapeData:_0x21bc90}=_0x2d69a0,_0x119cdf=_0x309a05[_0x4b9e73(0xf6)](_0x44bb41,_0x57ec5e,_0x25cf7b);if(_0x119cdf){const _0x5c2329=_0x119cdf[_0x4b9e73(0x12b)](),_0x4b37ce=Object[_0x4b9e73(0xcb)]({},_0x119cdf[_0x4b9e73(0x10c)]()),_0x541304={'unitId':_0x44bb41,'subUnitId':_0x57ec5e,'shapeId':_0x25cf7b,'shapeType':_0x5f8f6c,'shapeData':_0x21bc90},_0x3dd53d={'unitId':_0x44bb41,'subUnitId':_0x57ec5e,'shapeId':_0x25cf7b,'shapeType':_0x5c2329,'shapeData':_0x4b37ce};_0x43e3e6[_0x4b9e73(0xed)]({'id':UpdateSheetsShapeTypeMutation['id'],'params':_0x541304}),_0x4557a2[_0x4b9e73(0xed)]({'id':UpdateSheetsShapeTypeMutation['id'],'params':_0x3dd53d});if(_0x43e3e6[_0x4b9e73(0x12c)](_0x316233=>_0x2a50bd[_0x4b9e73(0xbe)](_0x316233['id'],_0x316233[_0x4b9e73(0x11e)])))_0x2db40b['pushUndoRedo']({'unitID':_0x44bb41,'redoMutations':[..._0x43e3e6],'undoMutations':[..._0x4557a2]});return!![];}return![];}};var name=_0x29362c(0xd3),version=_0x29362c(0xba);const SHEETS_SHAPE_PLUGIN_CONFIG_KEY=_0x29362c(0xec),configSymbol=Symbol(SHEETS_SHAPE_PLUGIN_CONFIG_KEY),defaultPluginConfig={};let SheetsShapeController=class SheetsShapeController extends Disposable{constructor(_0x46857e,_0x31a945,_0x384908,_0x4c016b,_0x528ffa){const _0x5476e4=_0x29362c;super(),this['_commandService']=_0x46857e,this[_0x5476e4(0x144)]=_0x31a945,this[_0x5476e4(0xef)]=_0x384908,this[_0x5476e4(0xe7)]=_0x4c016b,this['_drawingManagerService']=_0x528ffa,this[_0x5476e4(0x123)](),this[_0x5476e4(0xf8)]();}[_0x29362c(0x123)](){const _0x96a29b=_0x29362c;[InsertShapeCommand,SetShapeDrawingDataCommand,ToggleSheetsShapeFlipCommand,SetSheetsShapeRotateCommand,SetSheetsShapeTextVerticalToggleCommand,UpdateConnectorRelationCommand,UpdateLineShapeResizeCommand,InsertSheetsShapeMutation,RemoveSheetsShapeMutation,UpdateSheetsShapeTypeMutation,UpdateSheetsShapeDataMutation][_0x96a29b(0x136)](_0x51e79a=>this[_0x96a29b(0x151)](this[_0x96a29b(0xbf)][_0x96a29b(0x11f)](_0x51e79a)));}[_0x29362c(0xf8)](){const _0x32ff96=_0x29362c;this[_0x32ff96(0x151)](this[_0x32ff96(0x144)][_0x32ff96(0xb8)]({'getMutations':_0x587a01=>{const _0x1a20e5=_0x32ff96;if(_0x587a01['id']===RemoveSheetDrawingCommand['id']){const {drawings:_0x3a94b7}=_0x587a01[_0x1a20e5(0x11e)],_0x5adc4d=_0x3a94b7['filter'](_0x4e7176=>_0x4e7176[_0x1a20e5(0x116)]===DrawingTypeEnum[_0x1a20e5(0x152)]);if(_0x5adc4d[_0x1a20e5(0xf0)]===0x0)return{'preRedos':[],'redos':[],'preUndos':[],'undos':[]};const _0x47569a=[],_0xe9513c=[];return _0x5adc4d[_0x1a20e5(0x136)](_0x1deace=>{const _0x206c2f=_0x1a20e5,{unitId:_0x176a72,subUnitId:_0x1793c7,drawingId:_0x561e65}=_0x1deace,_0x59195a=this[_0x206c2f(0xe7)][_0x206c2f(0xf6)](_0x176a72,_0x1793c7,_0x561e65);if(!_0x59195a)throw new TypeError(_0x206c2f(0xd0)+_0x59195a);_0x47569a[_0x206c2f(0xed)]({'id':RemoveSheetsShapeMutation['id'],'params':{'unitId':_0x176a72,'subUnitId':_0x1793c7,'shapeId':_0x561e65}}),_0xe9513c['push']({'id':InsertSheetsShapeMutation['id'],'params':{'unitId':_0x176a72,'subUnitId':_0x1793c7,'shapeId':_0x561e65,'shapeType':_0x59195a[_0x206c2f(0x12b)](),'shapeData':_0x59195a[_0x206c2f(0x10c)]()}});const _0x213374=this[_0x206c2f(0xe7)]['getBasicShapeRelation'](_0x176a72,_0x1793c7,_0x561e65);if(_0x213374)for(const _0x2ad257 of _0x213374){const _0xfc4c6a=_0x2ad257[_0x206c2f(0x125)],_0x10c489=_0x2ad257[_0x206c2f(0x140)],_0x522947=_0x10c489?{'from':void 0x0}:{'to':void 0x0},_0x24bc2f=_0x10c489?{'from':{'shapeId':_0x2ad257[_0x206c2f(0xe9)],'cxnIndex':_0x2ad257[_0x206c2f(0xd9)]}}:{'to':{'shapeId':_0x2ad257['shapeId'],'cxnIndex':_0x2ad257[_0x206c2f(0xd9)]}};_0x47569a[_0x206c2f(0xed)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x176a72,'subUnitId':_0x1793c7,'shapeId':_0xfc4c6a,'shapeData':{'relation':_0x522947}}}),_0xe9513c[_0x206c2f(0xed)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x176a72,'subUnitId':_0x1793c7,'shapeId':_0xfc4c6a,'shapeData':{'relation':_0x24bc2f}}});}}),{'preRedos':_0x47569a,'redos':[],'preUndos':[],'undos':_0xe9513c};}if(_0x587a01['id']===SetSheetDrawingCommand['id']){const {drawings:_0x5e2c76}=_0x587a01[_0x1a20e5(0x11e)],_0x351429=_0x5e2c76[_0x1a20e5(0xc0)](_0xf80053=>_0xf80053[_0x1a20e5(0x116)]===DrawingTypeEnum[_0x1a20e5(0x152)]);if(_0x351429['length']===0x0)return{'preRedos':[],'redos':[],'preUndos':[],'undos':[]};const _0x31c367=[],_0xf831f1=[];for(const _0xe08b6 of _0x351429){const {unitId:_0x3ac195,subUnitId:_0x3ec3e9,drawingId:_0x2aeea6,transform:_0x241bfd}=_0xe08b6;if(!_0x3ac195||!_0x3ec3e9||!_0x2aeea6||!_0x241bfd)continue;const _0x2d95e8=this[_0x1a20e5(0xe7)][_0x1a20e5(0xf6)](_0x3ac195,_0x3ec3e9,_0x2aeea6);if(!_0x2d95e8)throw new TypeError(_0x1a20e5(0xd0)+_0x2d95e8);if(isConnectorShape(_0x2d95e8[_0x1a20e5(0x12b)]())){const _0x780ee3=this[_0x1a20e5(0xe7)][_0x1a20e5(0x153)](_0x3ac195,_0x3ec3e9,_0x2aeea6),_0x34430d={'from':void 0x0,'to':void 0x0};_0x780ee3&&(_0x31c367[_0x1a20e5(0xed)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x3ac195,'subUnitId':_0x3ec3e9,'shapeId':_0x2aeea6,'shapeData':{'relation':_0x34430d}}}),_0xf831f1['push']({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x3ac195,'subUnitId':_0x3ec3e9,'shapeId':_0x2aeea6,'shapeData':{'relation':_0x780ee3}}}));}else{const _0x35320f=this['_sheetsShapeService'][_0x1a20e5(0x117)](_0x3ac195,_0x3ec3e9,_0x2aeea6);if(_0x35320f&&_0x35320f[_0x1a20e5(0xf0)]>0x0)for(const _0xecafc9 of _0x35320f){const _0x43bcbf=_0xecafc9[_0x1a20e5(0x125)],_0x58dc85=_0xecafc9['isFrom'],_0x2a3180=this['_sheetsShapeService'][_0x1a20e5(0xf6)](_0x3ac195,_0x3ec3e9,_0x43bcbf);if(!_0x2a3180)continue;const _0x39f7da=_0x2a3180[_0x1a20e5(0x110)](),_0x168787=_0x2a3180[_0x1a20e5(0x12e)]();if(_0x39f7da&&_0x168787)this[_0x1a20e5(0xfa)](_0x3ac195,_0x3ec3e9,_0x43bcbf,_0x2a3180,_0x39f7da,_0x168787,_0x31c367,_0xf831f1,_0x2aeea6,_0x241bfd);else this[_0x1a20e5(0x11a)](_0x3ac195,_0x3ec3e9,_0x43bcbf,_0x2a3180,_0x58dc85?_0x39f7da:_0x168787,_0x58dc85,_0x31c367,_0xf831f1,_0x2aeea6,_0x241bfd);}}}return{'preRedos':[],'redos':_0x31c367,'preUndos':_0xf831f1,'undos':[]};}return{'preRedos':[],'redos':[],'preUndos':[],'undos':[]};}}));}[_0x29362c(0xe8)](_0x1b7ccc,_0x3679a8,_0x575dc7,_0x57d640,_0x5471b4){const _0x51fa07=_0x29362c;if(!_0x3679a8||!_0x575dc7)return null;const {shapeId:_0x59fdb7,cxnIndex:_0x43b04e}=_0x1b7ccc,_0x46be6d=this['_sheetsShapeService'][_0x51fa07(0xf6)](_0x3679a8,_0x575dc7,_0x59fdb7);if(!_0x46be6d)return null;const _0x177b5f=this[_0x51fa07(0xc4)]['getDrawingByParam']({'unitId':_0x3679a8,'subUnitId':_0x575dc7,'drawingId':_0x59fdb7});if(!(_0x177b5f===null||_0x177b5f===void 0x0?void 0x0:_0x177b5f['transform']))return null;let {left:left=0x0,top:top=0x0,width:width=0x0,height:height=0x0,flipX:flipX=![],flipY:flipY=![],angle:_0x4fb386}=_0x177b5f[_0x51fa07(0x13b)];if(_0x5471b4&&_0x57d640===_0x59fdb7){var _0x24c099,_0x28810a,_0x4a62cf,_0x25a606,_0x5cf40a,_0x1f3701,_0x5d7b04;left=(_0x24c099=_0x5471b4[_0x51fa07(0xd5)])!==null&&_0x24c099!==void 0x0?_0x24c099:left,top=(_0x28810a=_0x5471b4[_0x51fa07(0x133)])!==null&&_0x28810a!==void 0x0?_0x28810a:top,width=(_0x4a62cf=_0x5471b4['width'])!==null&&_0x4a62cf!==void 0x0?_0x4a62cf:width,height=(_0x25a606=_0x5471b4['height'])!==null&&_0x25a606!==void 0x0?_0x25a606:height,flipX=(_0x5cf40a=_0x5471b4[_0x51fa07(0x14f)])!==null&&_0x5cf40a!==void 0x0?_0x5cf40a:flipX,flipY=(_0x1f3701=_0x5471b4['flipY'])!==null&&_0x1f3701!==void 0x0?_0x1f3701:flipY,_0x4fb386=(_0x5d7b04=_0x5471b4[_0x51fa07(0x134)])!==null&&_0x5d7b04!==void 0x0?_0x5d7b04:_0x4fb386;}_0x46be6d[_0x51fa07(0xf1)]({'width':width,'height':height});const _0x47fa39=_0x46be6d[_0x51fa07(0xce)]()['find'](_0x51c307=>_0x51c307['index']===_0x43b04e);if(!_0x47fa39)return null;let _0xaf5969=flipX?width-_0x47fa39['x']:_0x47fa39['x'],_0x2e9c99=flipY?height-_0x47fa39['y']:_0x47fa39['y'];if(_0x4fb386!==0x0&&_0x4fb386!==void 0x0&&_0x4fb386!==null){const _0x5c51fb=_0x4fb386*Math['PI']/0xb4,_0x11247c=Math['cos'](_0x5c51fb),_0x301be4=Math[_0x51fa07(0x114)](_0x5c51fb),_0x2338c6=width/0x2,_0x2e9354=height/0x2,_0x4e3dd5=_0xaf5969-_0x2338c6,_0x300b0c=_0x2e9c99-_0x2e9354;_0xaf5969=_0x2338c6+_0x4e3dd5*_0x11247c-_0x300b0c*_0x301be4,_0x2e9c99=_0x2e9354+_0x4e3dd5*_0x301be4+_0x300b0c*_0x11247c;}_0xaf5969+=left,_0x2e9c99+=top;let _0x5adde2=_0x47fa39[_0x51fa07(0x122)]/0xea60;if(flipX)_0x5adde2=0xb4-_0x5adde2;if(flipY)_0x5adde2=-_0x5adde2;_0x5adde2+=_0x4fb386||0x0,_0x5adde2=(_0x5adde2%0x168+0x168)%0x168;const _0x4282ea=getBasicShapeRotateBound({'left':left,'top':top,'width':width,'height':height},_0x4fb386||0x0);return{'point':{'x':_0xaf5969,'y':_0x2e9c99},'angle':_0x5adde2,'bounds':_0x4282ea};}[_0x29362c(0xfa)](_0x1ce11c,_0x4a8091,_0x5d9d0e,_0x122929,_0x203240,_0x346e80,_0x5e7497,_0x206f8b,_0x2adcab,_0x10c9d1){const _0x1a947e=_0x29362c,_0x1d9c06=this['_sheetSkeletonService']['getSkeleton'](_0x1ce11c,_0x4a8091);if(!_0x1d9c06)return;const _0x505ccf=_0x122929[_0x1a947e(0x14c)](),_0x541d51=_0x122929['getAdjustNames'](),_0x560ea4={},_0x5582dd={};_0x541d51[_0x1a947e(0x136)](_0x3b80b9=>{const _0x3d1b12=_0x122929['getAdjustValueByName'](_0x3b80b9);_0x5582dd[_0x3b80b9]=_0x3d1b12!==null&&_0x3d1b12!==void 0x0?_0x3d1b12:0x0;});const _0x78a02f=this[_0x1a947e(0xe8)](_0x203240,_0x1ce11c,_0x4a8091,_0x2adcab,_0x10c9d1),_0x3f4f26=this['_getConnectPointInfo'](_0x346e80,_0x1ce11c,_0x4a8091,_0x2adcab,_0x10c9d1);if(_0x78a02f&&_0x3f4f26){const _0x20f83a=_0x122929[_0x1a947e(0x12b)](),_0x22f86f=routeConnectorLineShape(_0x78a02f,_0x3f4f26,_0x20f83a);let _0x5c4a1a=_0x20f83a;if(_0x22f86f){const _0x5546cf=computeConnectorRouteLayout(_0x22f86f,_0x122929[_0x1a947e(0x12b)]()),_0x40a77a=this[_0x1a947e(0xc4)]['getDrawingData'](_0x1ce11c,_0x4a8091);if(_0x40a77a&&_0x40a77a[_0x5d9d0e]){const _0x2e8986=_0x40a77a[_0x5d9d0e];_0x5c4a1a=_0x5546cf['lineType'];for(const [_0x360097,_0x25af38]of Object[_0x1a947e(0x13d)](_0x5546cf[_0x1a947e(0x108)]))_0x560ea4[_0x360097]=_0x25af38;const _0x19f22f={..._0x2e8986['transform'],'width':_0x5546cf[_0x1a947e(0x148)]['width'],'height':_0x5546cf[_0x1a947e(0x148)]['height'],'left':_0x5546cf[_0x1a947e(0x148)][_0x1a947e(0xd5)],'top':_0x5546cf[_0x1a947e(0x148)][_0x1a947e(0x133)],'flipX':_0x5546cf[_0x1a947e(0x148)][_0x1a947e(0x14f)],'flipY':_0x5546cf[_0x1a947e(0x148)][_0x1a947e(0x14a)],'angle':_0x5546cf[_0x1a947e(0x12a)]},_0x13dec2=transformToDrawingPosition(_0x19f22f,_0x1d9c06),_0x40148b=transformToAxisAlignPosition(_0x19f22f,_0x1d9c06),_0x3f691a={'unitId':_0x1ce11c,'subUnitId':_0x4a8091,'drawingType':DrawingTypeEnum[_0x1a947e(0x152)],'drawingId':_0x5d9d0e,'transform':_0x19f22f,'sheetTransform':_0x13dec2,'axisAlignSheetTransform':_0x40148b},{unitId:_0x451153,subUnitId:_0x4fa966,undo:_0x1959e2,redo:_0x4061e6,objects:_0x3bcf1e}=this[_0x1a947e(0xc4)][_0x1a947e(0x11c)]([_0x3f691a]);_0x5e7497[_0x1a947e(0xed)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x451153,'subUnitId':_0x4fa966,'op':_0x4061e6,'objects':_0x3bcf1e,'type':DrawingApplyType['UPDATE']}}),_0x206f8b[_0x1a947e(0xed)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x451153,'subUnitId':_0x4fa966,'op':_0x1959e2,'objects':_0x3bcf1e,'type':DrawingApplyType['UPDATE']}});}_0x122929[_0x1a947e(0x10d)]();}_0x5e7497[_0x1a947e(0xed)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x1ce11c,'subUnitId':_0x4a8091,'shapeId':_0x5d9d0e,'shapeType':_0x5c4a1a,'shapeData':{'adjustValues':_0x560ea4,'relation':_0x505ccf}}}),_0x206f8b[_0x1a947e(0xed)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x1ce11c,'subUnitId':_0x4a8091,'shapeId':_0x5d9d0e,'shapeType':_0x20f83a,'shapeData':{'adjustValues':_0x5582dd,'relation':_0x505ccf}}});}}[_0x29362c(0x11a)](_0x237b0a,_0x24ac17,_0x418571,_0x46e6bc,_0x24e0fe,_0x26bb4b,_0x59c7f3,_0x34831b,_0x2b7ab8,_0x59327b){const _0x125167=_0x29362c;var _0x169e95;if(!_0x24e0fe)return;const _0x16e570=this[_0x125167(0xef)][_0x125167(0x145)](_0x237b0a,_0x24ac17);if(!_0x16e570)return;const _0x3cb9b9=(_0x169e95=this[_0x125167(0xc4)][_0x125167(0xc5)]({'unitId':_0x237b0a,'subUnitId':_0x24ac17,'drawingId':_0x2b7ab8}))===null||_0x169e95===void 0x0?void 0x0:_0x169e95[_0x125167(0x13b)];if(!_0x3cb9b9)return;const _0x2f21d8=_0x3cb9b9[_0x125167(0xd5)]!==_0x59327b[_0x125167(0xd5)]||_0x3cb9b9['top']!==_0x59327b[_0x125167(0x133)],_0x570b27=_0x3cb9b9[_0x125167(0xc8)]!==_0x59327b[_0x125167(0xc8)]||_0x3cb9b9[_0x125167(0x139)]!==_0x59327b[_0x125167(0x139)],_0xc9f6b=_0x3cb9b9['flipX']!==_0x59327b[_0x125167(0x14f)]||_0x3cb9b9['flipY']!==_0x59327b[_0x125167(0x14a)],_0x730604=_0x3cb9b9['angle']!==_0x59327b[_0x125167(0x134)];if(_0x2f21d8&&!_0x570b27&&!_0xc9f6b&&!_0x730604){var _0x12fa29,_0x47d7b5,_0x1e9631,_0x261ff9;const _0x5a9c89=((_0x12fa29=_0x59327b[_0x125167(0xd5)])!==null&&_0x12fa29!==void 0x0?_0x12fa29:0x0)-((_0x47d7b5=_0x3cb9b9[_0x125167(0xd5)])!==null&&_0x47d7b5!==void 0x0?_0x47d7b5:0x0),_0x15b39d=((_0x1e9631=_0x59327b[_0x125167(0x133)])!==null&&_0x1e9631!==void 0x0?_0x1e9631:0x0)-((_0x261ff9=_0x3cb9b9[_0x125167(0x133)])!==null&&_0x261ff9!==void 0x0?_0x261ff9:0x0),_0x3ced84=this[_0x125167(0xc4)]['getDrawingData'](_0x237b0a,_0x24ac17);if(_0x3ced84&&_0x3ced84[_0x418571]){var _0x2abc13,_0x2773c4,_0x11857b,_0x364b05;const _0x42e2a4=_0x3ced84[_0x418571],_0x374d19={..._0x42e2a4[_0x125167(0x13b)],'left':((_0x2abc13=(_0x2773c4=_0x42e2a4['transform'])===null||_0x2773c4===void 0x0?void 0x0:_0x2773c4[_0x125167(0xd5)])!==null&&_0x2abc13!==void 0x0?_0x2abc13:0x0)+_0x5a9c89,'top':((_0x11857b=(_0x364b05=_0x42e2a4['transform'])===null||_0x364b05===void 0x0?void 0x0:_0x364b05[_0x125167(0x133)])!==null&&_0x11857b!==void 0x0?_0x11857b:0x0)+_0x15b39d},_0x51a2e3=transformToDrawingPosition(_0x374d19,_0x16e570),_0x3da1d8=transformToAxisAlignPosition(_0x374d19,_0x16e570),_0x3a4380={'unitId':_0x237b0a,'subUnitId':_0x24ac17,'drawingType':DrawingTypeEnum[_0x125167(0x152)],'drawingId':_0x418571,'transform':_0x374d19,'sheetTransform':_0x51a2e3,'axisAlignSheetTransform':_0x3da1d8},{unitId:_0x506803,subUnitId:_0x41cb51,undo:_0x45841f,redo:_0x1c5002,objects:_0xe7a3bc}=this[_0x125167(0xc4)][_0x125167(0x11c)]([_0x3a4380]);_0x59c7f3[_0x125167(0xed)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x506803,'subUnitId':_0x41cb51,'op':_0x1c5002,'objects':_0xe7a3bc,'type':DrawingApplyType[_0x125167(0x141)]}}),_0x34831b['push']({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x506803,'subUnitId':_0x41cb51,'op':_0x45841f,'objects':_0xe7a3bc,'type':DrawingApplyType[_0x125167(0x141)]}});}}else{const _0x5b1510=_0x46e6bc['getStartConnectInfo'](),_0x35beaf=_0x46e6bc[_0x125167(0x12e)]();this[_0x125167(0xfa)](_0x237b0a,_0x24ac17,_0x418571,_0x46e6bc,_0x5b1510,_0x35beaf,_0x59c7f3,_0x34831b,_0x2b7ab8,_0x59327b);}}};SheetsShapeController=__decorate([__decorateParam(0x0,ICommandService),__decorateParam(0x1,Inject(SheetInterceptorService)),__decorateParam(0x2,Inject(SheetSkeletonService)),__decorateParam(0x3,Inject(SheetsShapeService)),__decorateParam(0x4,Inject(IDrawingManagerService))],SheetsShapeController);let UniverSheetsShapePlugin=class UniverSheetsShapePlugin extends Plugin{constructor(_0x22dd4d=defaultPluginConfig,_0x5e3daa,_0x974dbe,_0x3e4133){const _0x1727ad=_0x29362c;super(),this[_0x1727ad(0xbd)]=_0x22dd4d,this[_0x1727ad(0xb9)]=_0x5e3daa,this[_0x1727ad(0xbf)]=_0x974dbe,this[_0x1727ad(0x138)]=_0x3e4133;const {..._0x5283ec}=merge({},defaultPluginConfig,this[_0x1727ad(0xbd)]);this[_0x1727ad(0x138)][_0x1727ad(0x107)](SHEETS_SHAPE_PLUGIN_CONFIG_KEY,_0x5283ec);}[_0x29362c(0x104)](){const _0x57cf17=_0x29362c,_0x23bf79=this[_0x57cf17(0xb9)];[[SheetShapeModelManager],[SheetsShapeService],[SheetsShapeController]][_0x57cf17(0x136)](_0x32f857=>_0x23bf79[_0x57cf17(0xe4)](_0x32f857)),touchDependencies(_0x23bf79,[[SheetsShapeService],[SheetsShapeController]]);}};_defineProperty(UniverSheetsShapePlugin,_0x29362c(0xd1),UniverInstanceType['UNIVER_SHEET']),_defineProperty(UniverSheetsShapePlugin,_0x29362c(0x129),_0x29362c(0x10b)),_defineProperty(UniverSheetsShapePlugin,'packageName',name),_defineProperty(UniverSheetsShapePlugin,_0x29362c(0x111),version),UniverSheetsShapePlugin=__decorate([DependentOn(UniverLicensePlugin),__decorateParam(0x1,Inject(Injector)),__decorateParam(0x2,ICommandService),__decorateParam(0x3,IConfigService)],UniverSheetsShapePlugin);export{DEFAULT_SHAPE_HEIGHT,DEFAULT_SHAPE_WIDTH,InsertShapeCommand,InsertSheetsShapeMutation,RemoveSheetsShapeMutation,SetShapeDrawingDataCommand,SetSheetsShapeRotateCommand,SetSheetsShapeTextVerticalToggleCommand,SheetsShapeService,ToggleSheetsShapeFlipCommand,UniverSheetsShapePlugin,UpdateConnectorRelationCommand,UpdateLineShapeResizeCommand,UpdateSheetsShapeDataMutation,UpdateSheetsShapeTypeCommand,UpdateSheetsShapeTypeMutation};function _0x3beb(){const _0x6c41b8=['transform','addShape','entries','clear','keys','isFrom','UPDATE','object','setShapeType','_sheetInterceptorService','getSkeleton','position','toJSON','worldRect','registerPluginResource','flipY','call','getShapeRelation','sheet.command.set-shape-text-vertical-toggle','_deserializeShapeForUnit','flipX','COMMAND','disposeWithMe','DRAWING_SHAPE','getLineShapeRelation','symbol','interceptCommand','_injector','0.21.1','1052613gcHLXK','function','_config','syncExecuteCommand','_commandService','filter','data','delete','resizeEnabled','_drawingManagerService','getDrawingByParam','prototype','borderEnabled','width','rotateEnabled','decorate','assign','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','redos','getConnectionSiteList','sheet.mutation.update-shape-data','Fail\x20to\x20get\x20shape\x20model,\x20get:\x20','type','2BjeakJ','@univerjs-pro/sheets-shape','261882HIbwAQ','left','60fbqDWf','11586WnGKHb','sheet.command.insert-shape','cxnIndex','insertShape','ensureSkeleton','_groupIds','preUndos','_ensureShapeModelManager','defineProperty','_shapeModelManagerMap','7HhPdfq','hasShape','_resourcesManagerService','add','5ItIDTY','removeShape','_sheetsShapeService','_getConnectPointInfo','shapeId','onCommandExecute','getShapeDataById','sheets-shape.config','push','constructor','_sheetSkeletonService','length','updateContext','isLineShape','sheet.command.set-shape-rotate','643328PnDiGE','pushUndoRedo','getShapeModel','getShapeTypeById','_initCommandInterceptor','setShapeData','_addLineRerouteUpdates','from','1725850CbpKfI','1050841NZnOmr','MUTATION','set','isHorizontal','getBatchAddOp','getCellIndexAndOffsetByPosition','range','onStarting','sheet.mutation.insert-shape','getBasicShapeType','setConfig','adjustValues','UNIVER_SHEET','parse','SHEET_SHAPE_PLUGIN','getShapeData','removeLinePoints','getShapeTextData','dispose','getStartConnectInfo','version','sheet.mutation.update-shape-type','sheet.command.update-line-shape-resize','sin','string','drawingType','getBasicShapeRelation','_linesIds','fromJSON','_addLineFollowShapeUpdates','_disposed','getBatchUpdateOp','undos','params','registerCommand','_initSnapshot','INSERT','ang','_initCommands','1096436oMOdAJ','lineShapeId','has','shapeData','preRedos','pluginName','rotation','getShapeType','every','_shapes','getEndConnectInfo','fill','get','_serializeShapeForUnit','sheet.command.update-connector-relation','top','angle','sheet.command.toggle-shape-flip','forEach','18MvxRmQ','_configService','height','iterator'];_0x3beb=function(){return _0x6c41b8;};return _0x3beb();}
1
+ const _0x331e47=_0x1f87;(function(_0x4ae334,_0x22fdb0){const _0x106f5d=_0x1f87,_0x5c0b17=_0x4ae334();while(!![]){try{const _0x47b09e=-parseInt(_0x106f5d(0x150))/0x1*(parseInt(_0x106f5d(0x105))/0x2)+parseInt(_0x106f5d(0x113))/0x3*(parseInt(_0x106f5d(0xea))/0x4)+-parseInt(_0x106f5d(0x14f))/0x5+-parseInt(_0x106f5d(0x121))/0x6+parseInt(_0x106f5d(0xf4))/0x7*(-parseInt(_0x106f5d(0xe3))/0x8)+-parseInt(_0x106f5d(0x124))/0x9*(-parseInt(_0x106f5d(0xfe))/0xa)+parseInt(_0x106f5d(0xf0))/0xb;if(_0x47b09e===_0x22fdb0)break;else _0x5c0b17['push'](_0x5c0b17['shift']());}catch(_0x4b27a3){_0x5c0b17['push'](_0x5c0b17['shift']());}}}(_0x2c0a,0x7625c));import{ShapeModel,computeConnectorRouteLayout,getBasicShapeRotateBound,isConnectorShape,routeConnectorLineShape}from'@univerjs-pro/engine-shape';import{CommandType,DependentOn,Disposable,DrawingTypeEnum,ICommandService,IConfigService,IResourceManagerService,IUndoRedoService,IUniverInstanceService,Inject,Injector,Plugin,UniverInstanceType,generateRandomId,merge,sequenceExecute,touchDependencies}from'@univerjs/core';import{SheetInterceptorService,SheetSkeletonService,getSheetCommandTarget}from'@univerjs/sheets';import{ClearSheetDrawingTransformerOperation,DrawingApplyType,ISheetDrawingService,InsertSheetDrawingCommand,RemoveSheetDrawingCommand,SetDrawingApplyMutation,SetSheetDrawingCommand,transformToAxisAlignPosition,transformToDrawingPosition}from'@univerjs/sheets-drawing';import{UniverLicensePlugin}from'@univerjs-pro/license';import{IDrawingManagerService}from'@univerjs/drawing';const DEFAULT_SHAPE_WIDTH=0xc8,DEFAULT_SHAPE_HEIGHT=0xc8;function _typeof(_0x3cce5d){'@babel/helpers - typeof';const _0x4e76bf=_0x1f87;return _typeof=_0x4e76bf(0x132)==typeof Symbol&&_0x4e76bf(0xfb)==typeof Symbol[_0x4e76bf(0x12c)]?function(_0x18924d){return typeof _0x18924d;}:function(_0xed9ad7){const _0x468c84=_0x4e76bf;return _0xed9ad7&&_0x468c84(0x132)==typeof Symbol&&_0xed9ad7[_0x468c84(0xe1)]===Symbol&&_0xed9ad7!==Symbol['prototype']?_0x468c84(0xfb):typeof _0xed9ad7;},_typeof(_0x3cce5d);}function toPrimitive(_0x155ce3,_0x5cc320){const _0xb75b22=_0x1f87;if('object'!=_typeof(_0x155ce3)||!_0x155ce3)return _0x155ce3;var _0x1e2a8e=_0x155ce3[Symbol[_0xb75b22(0x127)]];if(void 0x0!==_0x1e2a8e){var _0x127ae7=_0x1e2a8e['call'](_0x155ce3,_0x5cc320||'default');if(_0xb75b22(0x116)!=_typeof(_0x127ae7))return _0x127ae7;throw new TypeError(_0xb75b22(0x11f));}return(_0xb75b22(0xe9)===_0x5cc320?String:Number)(_0x155ce3);}function toPropertyKey(_0x4b48bd){const _0x39dd42=_0x1f87;var _0x23c402=toPrimitive(_0x4b48bd,_0x39dd42(0xe9));return'symbol'==_typeof(_0x23c402)?_0x23c402:_0x23c402+'';}function _defineProperty(_0x8147f6,_0x4b0672,_0x20ad8b){return(_0x4b0672=toPropertyKey(_0x4b0672))in _0x8147f6?Object['defineProperty'](_0x8147f6,_0x4b0672,{'value':_0x20ad8b,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x8147f6[_0x4b0672]=_0x20ad8b,_0x8147f6;}var SheetShapeModelManager=class extends Disposable{constructor(){const _0x26e1b3=_0x1f87;super(),_defineProperty(this,_0x26e1b3(0x111),new Map()),_defineProperty(this,_0x26e1b3(0xc5),new Set()),_defineProperty(this,'_groupIds',new Set());}[_0x331e47(0x159)](_0x14da9c,_0x53d50,_0x16dad8){const _0x153a78=_0x331e47,_0x5a1894=new ShapeModel(_0x14da9c,_0x53d50,_0x16dad8);this['_shapes'][_0x153a78(0xd4)](_0x53d50,_0x5a1894);if(isConnectorShape(_0x14da9c))this[_0x153a78(0xc5)][_0x153a78(0x146)](_0x53d50);return _0x5a1894;}[_0x331e47(0xcd)](_0x3f9a1d){const _0x505c8a=_0x331e47,_0x52ee8c=[];for(const _0x1147a8 of this[_0x505c8a(0xc5)]){const _0x5bb11e=this['_shapes'][_0x505c8a(0x15c)](_0x1147a8);if(_0x5bb11e){const _0x34b225=_0x5bb11e['getShapeRelation']();if(_0x34b225){var _0x4da954,_0x10da91;if(((_0x4da954=_0x34b225[_0x505c8a(0x149)])===null||_0x4da954===void 0x0?void 0x0:_0x4da954[_0x505c8a(0xf8)])===_0x3f9a1d)_0x52ee8c['push']({..._0x34b225['from'],'lineShapeId':_0x1147a8,'isFrom':!![]});if(((_0x10da91=_0x34b225['to'])===null||_0x10da91===void 0x0?void 0x0:_0x10da91[_0x505c8a(0xf8)])===_0x3f9a1d)_0x52ee8c[_0x505c8a(0xca)]({..._0x34b225['to'],'lineShapeId':_0x1147a8,'isFrom':![]});}}}return _0x52ee8c;}[_0x331e47(0xfd)](_0x267948){const _0x2c23ac=_0x331e47,_0x446f9e=this['_shapes'][_0x2c23ac(0x15c)](_0x267948);if(_0x446f9e)return _0x446f9e[_0x2c23ac(0x10a)]();}[_0x331e47(0x135)](_0x41fa46){const _0x4f9e8c=_0x331e47,_0x1a707e=this['_shapes']['get'](_0x41fa46);if(_0x1a707e)return _0x1a707e[_0x4f9e8c(0x135)]();}[_0x331e47(0x118)](_0x113a41){const _0x43396a=_0x331e47;return this['_shapes'][_0x43396a(0x126)](_0x113a41);}[_0x331e47(0x11e)](_0x9fa814){const _0x582e03=_0x331e47,_0x10177b=this[_0x582e03(0x111)][_0x582e03(0x15c)](_0x9fa814);if(!_0x10177b)return;if(isConnectorShape(_0x10177b[_0x582e03(0x135)]()))this[_0x582e03(0xc5)][_0x582e03(0xf2)](_0x9fa814);this['_shapes']['delete'](_0x9fa814);}['toJSON'](){const _0x12db5b=_0x331e47,_0x30b19d=[];return this[_0x12db5b(0x111)][_0x12db5b(0x107)](_0xeb5f67=>{const _0x5caeef=_0x12db5b;_0x30b19d[_0x5caeef(0xca)](_0xeb5f67['toJSON']());}),_0x30b19d;}[_0x331e47(0x13d)](_0x14bbf8){const _0x10c963=_0x331e47;for(const _0x1be5d8 of _0x14bbf8){const {id:_0x2078c4,shapeType:_0xcdbb01}=_0x1be5d8,_0xe3354b=this['addShape'](_0xcdbb01,_0x2078c4,_0x1be5d8[_0x10c963(0xd2)]);if(_0xe3354b&&_0xe3354b[_0x10c963(0x119)]())this['_linesIds'][_0x10c963(0x146)](_0x2078c4);}}[_0x331e47(0x12b)](){const _0x32675f=_0x331e47;if(this[_0x32675f(0xc2)])return;this['_shapes'][_0x32675f(0x107)](_0x13e61f=>{const _0x12898c=_0x32675f;_0x13e61f[_0x12898c(0x12b)]();}),this['_shapes'][_0x32675f(0x133)](),this[_0x32675f(0xc5)][_0x32675f(0x133)](),this[_0x32675f(0x145)][_0x32675f(0x133)](),super[_0x32675f(0x12b)]();}};function __decorateParam(_0x12e038,_0x17f22b){return function(_0x2c923a,_0x330287){_0x17f22b(_0x2c923a,_0x330287,_0x12e038);};}function __decorate(_0x18b972,_0x5ba947,_0x22f080,_0x5cc4cb){const _0x53d514=_0x331e47;var _0x3f0a16=arguments[_0x53d514(0x12e)],_0x150a75=_0x3f0a16<0x3?_0x5ba947:_0x5cc4cb===null?_0x5cc4cb=Object[_0x53d514(0x15d)](_0x5ba947,_0x22f080):_0x5cc4cb,_0x429b47;if(typeof Reflect===_0x53d514(0x116)&&typeof Reflect[_0x53d514(0xc1)]===_0x53d514(0x132))_0x150a75=Reflect[_0x53d514(0xc1)](_0x18b972,_0x5ba947,_0x22f080,_0x5cc4cb);else{for(var _0x51da3f=_0x18b972['length']-0x1;_0x51da3f>=0x0;_0x51da3f--)if(_0x429b47=_0x18b972[_0x51da3f])_0x150a75=(_0x3f0a16<0x3?_0x429b47(_0x150a75):_0x3f0a16>0x3?_0x429b47(_0x5ba947,_0x22f080,_0x150a75):_0x429b47(_0x5ba947,_0x22f080))||_0x150a75;}return _0x3f0a16>0x3&&_0x150a75&&Object['defineProperty'](_0x5ba947,_0x22f080,_0x150a75),_0x150a75;}const SHEET_SHAPE_PLUGIN=_0x331e47(0xf9);let SheetsShapeService=class SheetsShapeService extends Disposable{constructor(_0x4bdf6f){const _0x986abb=_0x331e47;super(),this['_resourcesManagerService']=_0x4bdf6f,_defineProperty(this,_0x986abb(0xff),new Map()),this['_initSnapshot']();}['_ensureShapeModelManager'](_0x2808c7,_0x3b7ba7){const _0x3aa827=_0x331e47;let _0x3fa100=this[_0x3aa827(0xff)][_0x3aa827(0x15c)](_0x2808c7);!_0x3fa100&&(_0x3fa100=new Map(),this['_shapeModelManagerMap'][_0x3aa827(0xd4)](_0x2808c7,_0x3fa100));let _0x55c0b4=_0x3fa100[_0x3aa827(0x15c)](_0x3b7ba7);return!_0x55c0b4&&(_0x55c0b4=new SheetShapeModelManager(),_0x3fa100['set'](_0x3b7ba7,_0x55c0b4)),_0x55c0b4;}[_0x331e47(0xe4)](_0x2d4ca7,_0x492c1d,_0x75ef88,_0x2123c8,_0x1dc98f){const _0x59f890=_0x331e47;this[_0x59f890(0x14d)](_0x2d4ca7,_0x492c1d)[_0x59f890(0x159)](_0x75ef88,_0x2123c8,_0x1dc98f);}[_0x331e47(0x11e)](_0x2765eb,_0x52a788,_0x3ce671){const _0x401558=_0x331e47;this[_0x401558(0x14d)](_0x2765eb,_0x52a788)[_0x401558(0x11e)](_0x3ce671);}[_0x331e47(0x117)](_0x1386ae,_0x2fb855,_0x4eab38){const _0x1294ac=_0x331e47;return this['_ensureShapeModelManager'](_0x1386ae,_0x2fb855)[_0x1294ac(0x135)](_0x4eab38);}[_0x331e47(0x135)](_0x217039,_0x4c4e84,_0x1a7d5d){const _0x452df7=_0x331e47;return this[_0x452df7(0x14d)](_0x217039,_0x4c4e84)[_0x452df7(0x135)](_0x1a7d5d);}[_0x331e47(0x118)](_0x20a600,_0x29e96f,_0x40485c){const _0x2e5466=_0x331e47;return this[_0x2e5466(0x14d)](_0x20a600,_0x29e96f)[_0x2e5466(0x118)](_0x40485c);}['getShapeTypeById'](_0x481097,_0x77622f,_0x3808b0){const _0xd949c3=_0x331e47;return this[_0xd949c3(0x14d)](_0x481097,_0x77622f)['getShapeType'](_0x3808b0);}[_0x331e47(0xdc)](_0x524d55,_0x2e7610,_0x141a5a){const _0x58a51e=_0x331e47,_0x1e2a18=this[_0x58a51e(0x14d)](_0x524d55,_0x2e7610);if(!_0x1e2a18[_0x58a51e(0x135)](_0x141a5a))return;const _0x45e4fa=_0x1e2a18['_shapes'][_0x58a51e(0x15c)](_0x141a5a);if(!_0x45e4fa)return;return _0x45e4fa[_0x58a51e(0xec)]();}[_0x331e47(0x10e)](_0x1e46c3,_0x461f67,_0x104d2b){const _0x5858b6=_0x331e47;return this[_0x5858b6(0x14d)](_0x1e46c3,_0x461f67)[_0x5858b6(0x111)][_0x5858b6(0x15c)](_0x104d2b);}[_0x331e47(0xcd)](_0x195625,_0x423fe0,_0x5db248){const _0x289d7a=_0x331e47;return this['_ensureShapeModelManager'](_0x195625,_0x423fe0)[_0x289d7a(0xcd)](_0x5db248);}[_0x331e47(0xfd)](_0x31a2f3,_0x1f32a4,_0x442a73){const _0x427b89=_0x331e47,_0x2f1a6c=this[_0x427b89(0x14d)](_0x31a2f3,_0x1f32a4)[_0x427b89(0x111)][_0x427b89(0x15c)](_0x442a73);if(!_0x2f1a6c)return;return _0x2f1a6c[_0x427b89(0x10a)]();}[_0x331e47(0xd3)](){}[_0x331e47(0x122)](_0x21c2d1){const _0x111ce6=_0x331e47,_0x1b3ec4={},_0x24be21=this[_0x111ce6(0xff)][_0x111ce6(0x15c)](_0x21c2d1);if(_0x24be21)_0x24be21['forEach']((_0x571bfa,_0x5003fe)=>{const _0x114849=_0x111ce6,_0x183bb1=_0x571bfa[_0x114849(0x142)]();if(_0x183bb1[_0x114849(0x12e)]>0x0)_0x1b3ec4[_0x5003fe]=_0x183bb1;});return JSON[_0x111ce6(0x110)](_0x1b3ec4);}[_0x331e47(0xc6)](_0x3e1cb0,_0x16c81e){const _0x55c172=_0x331e47;Object[_0x55c172(0xc7)](_0x16c81e)[_0x55c172(0x107)](_0x5bc150=>{const _0x1139e7=_0x55c172;this[_0x1139e7(0x14d)](_0x3e1cb0,_0x5bc150)['fromJSON'](_0x16c81e[_0x5bc150]);});}[_0x331e47(0x142)](){const _0x26a232=_0x331e47,_0x4b30d9={};return this[_0x26a232(0xff)][_0x26a232(0x107)]((_0x2e9453,_0x2382fb)=>{const _0x15eb9a=_0x26a232;_0x4b30d9[_0x2382fb]={},_0x2e9453[_0x15eb9a(0x107)]((_0x2ae2f6,_0xcbe6c2)=>{const _0x170cdf=_0x15eb9a;_0x4b30d9[_0x2382fb][_0xcbe6c2]=_0x2ae2f6[_0x170cdf(0x142)]();});}),_0x4b30d9;}[_0x331e47(0x13d)](_0x8473c2){const _0x141aa1=_0x331e47;Object['keys'](_0x8473c2)[_0x141aa1(0x107)](_0x3c3b5a=>{const _0x3f95d4=_0x141aa1,_0x3c8549=_0x8473c2[_0x3c3b5a];Object[_0x3f95d4(0xc7)](_0x3c8549)['forEach'](_0x40fb07=>{this['_ensureShapeModelManager'](_0x3c3b5a,_0x40fb07)['fromJSON'](_0x3c8549[_0x40fb07]);});});}['_initSnapshot'](){const _0x50a8c5=_0x331e47;this[_0x50a8c5(0xe6)][_0x50a8c5(0x131)]({'pluginName':SHEET_SHAPE_PLUGIN,'businesses':[UniverInstanceType['UNIVER_SHEET']],'toJson':_0x3c6472=>this[_0x50a8c5(0x122)](_0x3c6472),'parseJson':_0x3d3a84=>JSON[_0x50a8c5(0x11c)](_0x3d3a84),'onLoad':(_0x2b4478,_0x25396b)=>{const _0x2aef20=_0x50a8c5;this[_0x2aef20(0xc6)](_0x2b4478,_0x25396b);},'onUnLoad':_0x2e8fea=>{const _0x55240f=_0x50a8c5,_0x1aaed6=this[_0x55240f(0xff)]['get'](_0x2e8fea);_0x1aaed6&&(_0x1aaed6[_0x55240f(0x107)](_0x4fa00f=>{const _0x3a0823=_0x55240f;_0x4fa00f[_0x3a0823(0x12b)]();}),this[_0x55240f(0xff)]['delete'](_0x2e8fea));}});}[_0x331e47(0x12b)](){const _0x47e7f2=_0x331e47;this[_0x47e7f2(0xff)][_0x47e7f2(0x107)](_0x2ac525=>{const _0x479420=_0x47e7f2;_0x2ac525[_0x479420(0x107)](_0x1542ef=>{const _0x1dfa37=_0x479420;_0x1542ef[_0x1dfa37(0x12b)]();});});}};SheetsShapeService=__decorate([__decorateParam(0x0,IResourceManagerService)],SheetsShapeService);const InsertSheetsShapeMutation={'id':'sheet.mutation.insert-shape','type':CommandType[_0x331e47(0xf1)],'handler':(_0x53e9f6,_0x127450)=>{const _0x52a25d=_0x331e47,{unitId:_0x2870ab,subUnitId:_0x5deb7a,shapeType:_0x597414,shapeId:_0x19ddb,shapeData:_0x3eea78}=_0x127450;return _0x53e9f6[_0x52a25d(0x15c)](SheetsShapeService)[_0x52a25d(0xe4)](_0x2870ab,_0x5deb7a,_0x597414,_0x19ddb,_0x3eea78),!![];}},RemoveSheetsShapeMutation={'id':_0x331e47(0x13f),'type':CommandType[_0x331e47(0xf1)],'handler':(_0x1068c4,_0xd82d1c)=>{const _0x51d8db=_0x331e47,{unitId:_0x1c5fc1,subUnitId:_0xa2f6b0,shapeId:_0x1cbd5a}=_0xd82d1c;return _0x1068c4[_0x51d8db(0x15c)](SheetsShapeService)['removeShape'](_0x1c5fc1,_0xa2f6b0,_0x1cbd5a),!![];}},InsertShapeCommand={'type':CommandType['COMMAND'],'id':_0x331e47(0x11b),'handler':(_0x3acf34,_0x44538d)=>{const _0x17d0d4=_0x331e47;var _0x5b39a0,_0x2e7b9b;const _0x4c0a2a=getSheetCommandTarget(_0x3acf34[_0x17d0d4(0x15c)](IUniverInstanceService),_0x44538d);if(!_0x4c0a2a)return![];const _0x184cc2=_0x3acf34[_0x17d0d4(0x15c)](SheetSkeletonService),{unitId:_0x346c90,subUnitId:_0x2149f0}=_0x4c0a2a,_0x4e2f6d=_0x184cc2[_0x17d0d4(0x12d)](_0x346c90,_0x2149f0);if(!_0x4e2f6d)return![];const _0xe73cee=_0x3acf34[_0x17d0d4(0x15c)](ICommandService),_0xc41818=_0x3acf34[_0x17d0d4(0x15c)](IUndoRedoService),_0x31d757=_0x3acf34['get'](SheetInterceptorService),_0x4e9335=_0x3acf34[_0x17d0d4(0x15c)](ISheetDrawingService),{shapeType:_0x242c76,shapeData:_0x499c35}=_0x44538d,_0x35be0b=_0x44538d[_0x17d0d4(0xf8)]||generateRandomId(),_0x4db212={'unitId':_0x346c90,'subUnitId':_0x2149f0,'shapeId':_0x35be0b,'shapeType':_0x242c76,'shapeData':_0x499c35},_0x4373dc=_0x44538d['width']||0xc8,_0x4cfe1b=_0x44538d[_0x17d0d4(0x136)]||0xc8;let _0x313102=0x0,_0x10c059=0x0,_0x3e9c47={'row':0x0,'rowOffset':0x0,'column':0x0,'columnOffset':0x0},_0x2c20ad={'row':0x0,'rowOffset':0x0,'column':0x0,'columnOffset':0x0};if(_0x44538d[_0x17d0d4(0x14c)]){const {x:_0x8d2136,y:_0x4016f4}=_0x44538d[_0x17d0d4(0x14c)];_0x313102=_0x8d2136,_0x10c059=_0x4016f4,_0x3e9c47=_0x4e2f6d['getCellIndexAndOffsetByPosition'](_0x8d2136,_0x4016f4),_0x2c20ad=_0x4e2f6d[_0x17d0d4(0x130)](_0x8d2136+_0x4373dc,_0x4016f4+_0x4cfe1b);}else{if(_0x44538d[_0x17d0d4(0x123)]){const {startRow:_0x2a3347,startColumn:_0xba072c}=_0x44538d[_0x17d0d4(0x123)],_0x67fbce=0xa,_0x37bd84=0xa;_0x3e9c47={'row':_0x2a3347,'rowOffset':_0x67fbce,'column':_0xba072c,'columnOffset':_0x37bd84};const _0x39d362=_0x4e2f6d[_0x17d0d4(0x15a)](_0x2a3347,_0xba072c);_0x313102=_0x39d362[_0x17d0d4(0x139)]+_0x37bd84,_0x10c059=_0x39d362[_0x17d0d4(0xed)]+_0x67fbce,_0x2c20ad=_0x4e2f6d[_0x17d0d4(0x130)](_0x313102+_0x4373dc,_0x10c059+_0x4cfe1b);}}const _0x19007a={'from':_0x3e9c47,'to':_0x2c20ad},_0x14b42f={'unitId':_0x346c90,'subUnitId':_0x2149f0,'drawingId':_0x35be0b,'drawingType':DrawingTypeEnum[_0x17d0d4(0xe2)],'sheetTransform':_0x19007a,'transform':{'left':_0x313102,'top':_0x10c059,'width':_0x4373dc,'height':_0x4cfe1b},'data':{'shapeType':_0x242c76,'shapeData':_0x499c35},'axisAlignSheetTransform':_0x19007a,'allowTransform':!![]};isConnectorShape(_0x242c76)&&(_0x14b42f[_0x17d0d4(0x15e)][_0x17d0d4(0xd1)]=![],_0x14b42f[_0x17d0d4(0x15e)][_0x17d0d4(0x109)]=![],_0x14b42f[_0x17d0d4(0x15e)]['resizeEnabled']=![],_0x14b42f[_0x17d0d4(0x15e)][_0x17d0d4(0xcf)]=![],_0x14b42f[_0x17d0d4(0x104)][_0x17d0d4(0x109)]=![],_0x14b42f[_0x17d0d4(0x104)]['resizeEnabled']=![],_0x14b42f[_0x17d0d4(0x104)][_0x17d0d4(0xcf)]=![]);const {undo:_0x4c0873,redo:_0x3b3f0b,objects:_0x7120ba}=_0x4e9335[_0x17d0d4(0x12f)]([_0x14b42f]),_0x17b87f=_0x31d757[_0x17d0d4(0x147)]({'id':InsertSheetDrawingCommand['id'],'params':{'unitId':_0x346c90,'drawings':[_0x14b42f]}}),_0x1b5fdf=[...(_0x5b39a0=_0x17b87f['preRedos'])!==null&&_0x5b39a0!==void 0x0?_0x5b39a0:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x346c90,'subUnitId':_0x2149f0,'op':_0x3b3f0b,'objects':_0x7120ba,'type':DrawingApplyType[_0x17d0d4(0x138)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x346c90]},..._0x17b87f[_0x17d0d4(0x112)],{'id':InsertSheetsShapeMutation['id'],'params':_0x4db212}],_0x2bc39b=[{'id':RemoveSheetsShapeMutation['id'],'params':{'unitId':_0x346c90,'subUnitId':_0x2149f0,'shapeId':_0x35be0b}},...(_0x2e7b9b=_0x17b87f['preUndos'])!==null&&_0x2e7b9b!==void 0x0?_0x2e7b9b:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x346c90,'subUnitId':_0x2149f0,'op':_0x4c0873,'objects':_0x7120ba,'type':DrawingApplyType['REMOVE']}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x346c90]},..._0x17b87f[_0x17d0d4(0xc0)]];if(sequenceExecute(_0x1b5fdf,_0xe73cee)[_0x17d0d4(0xf5)])return _0xc41818[_0x17d0d4(0xcb)]({'unitID':_0x346c90,'undoMutations':_0x2bc39b,'redoMutations':_0x1b5fdf}),!![];return![];}},UpdateSheetsShapeDataMutation={'id':'sheet.mutation.update-shape-data','type':CommandType[_0x331e47(0xf1)],'handler':(_0x6c8a13,_0x518b76)=>{const _0x379aac=_0x331e47,{unitId:_0x358178,subUnitId:_0x329ad9,shapeType:_0x3ed231,shapeId:_0x228d83,shapeData:_0x39c8a0}=_0x518b76,_0x484a56=_0x6c8a13[_0x379aac(0x15c)](SheetsShapeService)[_0x379aac(0x10e)](_0x358178,_0x329ad9,_0x228d83);if(_0x484a56){if(_0x3ed231!==void 0x0)_0x484a56['setShapeType'](_0x3ed231);if(_0x39c8a0)_0x484a56===null||_0x484a56===void 0x0||_0x484a56[_0x379aac(0x13a)](_0x39c8a0,!![]);}return!![];}},SetShapeDrawingDataCommand={'type':CommandType[_0x331e47(0x10c)],'id':_0x331e47(0x120),'handler':(_0x2b1103,_0x2d4cf2)=>{const _0x4d9a41=_0x331e47;var _0x2ed0c5,_0x20d694;const _0x5422b6=getSheetCommandTarget(_0x2b1103[_0x4d9a41(0x15c)](IUniverInstanceService),_0x2d4cf2);if(!_0x5422b6)return![];const _0x1666e9=_0x2b1103[_0x4d9a41(0x15c)](SheetSkeletonService),{unitId:_0x1ecf0e,subUnitId:_0x214080}=_0x5422b6,_0x5ce3ce=_0x1666e9[_0x4d9a41(0x12d)](_0x1ecf0e,_0x214080);if(!_0x5ce3ce)return![];const _0x4bb2fe=_0x2b1103[_0x4d9a41(0x15c)](SheetsShapeService),{shapeId:_0x2a553e,shapeType:_0x580d11,shapeData:_0x422053,position:_0x44e042,width:_0x452fc6,height:_0x1b651d}=_0x2d4cf2,_0x131e8e=_0x4bb2fe[_0x4d9a41(0x10e)](_0x1ecf0e,_0x214080,_0x2a553e);if(!_0x131e8e)return![];const _0x461490=_0x2b1103[_0x4d9a41(0x15c)](ICommandService),_0x3eeda0=_0x2b1103[_0x4d9a41(0x15c)](IUndoRedoService),_0x4e2110=_0x2b1103[_0x4d9a41(0x15c)](SheetInterceptorService),_0x141881=_0x2b1103[_0x4d9a41(0x15c)](ISheetDrawingService),_0x401b2e={'unitId':_0x1ecf0e,'subUnitId':_0x214080,'shapeId':_0x2a553e,'shapeType':_0x580d11,'shapeData':_0x422053},_0x3857fb=_0x131e8e[_0x4d9a41(0x135)](),_0x4026da=_0x131e8e[_0x4d9a41(0xec)](),{x:_0x1b12da,y:_0xa543b8}=_0x44e042,_0x37adb5={'from':_0x5ce3ce[_0x4d9a41(0x130)](_0x1b12da,_0xa543b8),'to':_0x5ce3ce[_0x4d9a41(0x130)](_0x1b12da+_0x452fc6,_0xa543b8+_0x1b651d)},_0x258a05={'unitId':_0x1ecf0e,'subUnitId':_0x214080,'drawingId':_0x2a553e,'drawingType':DrawingTypeEnum['DRAWING_SHAPE'],'sheetTransform':_0x37adb5,'transform':{'left':_0x1b12da,'top':_0xa543b8,'width':_0x452fc6,'height':_0x1b651d},'data':{'shapeType':_0x580d11,'shapeData':_0x422053},'axisAlignSheetTransform':_0x37adb5,'allowTransform':!![]};isConnectorShape(_0x580d11)&&(_0x258a05[_0x4d9a41(0x15e)][_0x4d9a41(0xd1)]=![],_0x258a05[_0x4d9a41(0x15e)][_0x4d9a41(0x109)]=![],_0x258a05['data']['resizeEnabled']=![],_0x258a05[_0x4d9a41(0x15e)][_0x4d9a41(0xcf)]=![],_0x258a05['transform'][_0x4d9a41(0x109)]=![],_0x258a05[_0x4d9a41(0x104)][_0x4d9a41(0x125)]=![],_0x258a05[_0x4d9a41(0x104)][_0x4d9a41(0xcf)]=![]);const {undo:_0xeefabf,redo:_0x36a56d,objects:_0x3cd26c}=_0x141881[_0x4d9a41(0x143)]([_0x258a05]),_0x4fedb8=_0x4e2110['onCommandExecute']({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x1ecf0e,'drawings':[_0x258a05]}}),_0x110952=[...(_0x2ed0c5=_0x4fedb8[_0x4d9a41(0xfc)])!==null&&_0x2ed0c5!==void 0x0?_0x2ed0c5:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x1ecf0e,'subUnitId':_0x214080,'op':_0x36a56d,'objects':_0x3cd26c,'type':DrawingApplyType[_0x4d9a41(0x129)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x1ecf0e]},..._0x4fedb8[_0x4d9a41(0x112)],{'id':UpdateSheetsShapeDataMutation['id'],'params':_0x401b2e}],_0x5c8ddb=[...(_0x20d694=_0x4fedb8[_0x4d9a41(0x15b)])!==null&&_0x20d694!==void 0x0?_0x20d694:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x1ecf0e,'subUnitId':_0x214080,'op':_0xeefabf,'objects':_0x3cd26c,'type':DrawingApplyType[_0x4d9a41(0x129)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x1ecf0e]},..._0x4fedb8[_0x4d9a41(0xc0)],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x1ecf0e,'subUnitId':_0x214080,'shapeType':_0x3857fb,'shapeId':_0x2a553e,'shapeData':_0x4026da}}];if(sequenceExecute(_0x110952,_0x461490)[_0x4d9a41(0xf5)])return _0x3eeda0[_0x4d9a41(0xcb)]({'unitID':_0x1ecf0e,'undoMutations':_0x5c8ddb,'redoMutations':_0x110952}),!![];return![];}},ToggleSheetsShapeFlipCommand={'type':CommandType[_0x331e47(0x10c)],'id':_0x331e47(0x11a),'handler':(_0x510f3c,_0x355af1)=>{const _0x70fc3c=_0x331e47;var _0x51b264,_0x789b6a;const _0x592ed9=getSheetCommandTarget(_0x510f3c[_0x70fc3c(0x15c)](IUniverInstanceService),_0x355af1);if(!_0x592ed9)return![];const _0x45df6e=_0x510f3c[_0x70fc3c(0x15c)](SheetSkeletonService),{unitId:_0x268392,subUnitId:_0x5460ad}=_0x592ed9,_0x4cbc7f=_0x45df6e[_0x70fc3c(0x151)](_0x268392,_0x5460ad);if(!_0x4cbc7f)return![];const _0x206048=_0x510f3c[_0x70fc3c(0x15c)](ISheetDrawingService),{shapeId:_0x46a777,flipH:_0x8fa859,flipV:_0x2d7578}=_0x355af1,_0x289351=_0x206048[_0x70fc3c(0x13e)]({'unitId':_0x268392,'subUnitId':_0x5460ad,'drawingId':_0x46a777});if(!_0x289351)return![];const _0x289fe5=_0x510f3c['get'](SheetsShapeService)['getShapeModel'](_0x268392,_0x5460ad,_0x46a777);if(!_0x289fe5)return![];const _0x2ac8ea=_0x510f3c[_0x70fc3c(0x15c)](ICommandService),_0x1e8147=_0x510f3c[_0x70fc3c(0x15c)](IUndoRedoService),_0x3440d0=_0x510f3c[_0x70fc3c(0x15c)](SheetInterceptorService),_0x48b6f3={..._0x289351['transform']};if(_0x8fa859!==void 0x0)_0x48b6f3[_0x70fc3c(0x102)]=!_0x48b6f3['flipX'];if(_0x2d7578!==void 0x0)_0x48b6f3[_0x70fc3c(0xe7)]=!_0x48b6f3[_0x70fc3c(0xe7)];const _0x248e08=transformToDrawingPosition(_0x48b6f3,_0x4cbc7f),_0x1ee56f=transformToAxisAlignPosition(_0x48b6f3,_0x4cbc7f),_0x1a2105=_0x289fe5['getShapeType'](),_0x5c2f4b=_0x289fe5['getShapeData'](),_0x18c50a={'unitId':_0x268392,'subUnitId':_0x5460ad,'drawingId':_0x46a777,'drawingType':DrawingTypeEnum[_0x70fc3c(0xe2)],'sheetTransform':_0x248e08,'transform':_0x48b6f3,'data':{'shapeType':_0x1a2105,'shapeData':_0x5c2f4b},'axisAlignSheetTransform':_0x1ee56f,'allowTransform':!![]},{undo:_0x546fd1,redo:_0x207943,objects:_0x3cdb67}=_0x206048['getBatchUpdateOp']([_0x18c50a]),_0x3beccd=_0x3440d0[_0x70fc3c(0x147)]({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x268392,'drawings':[_0x18c50a]}}),_0x4a1820=[...(_0x51b264=_0x3beccd[_0x70fc3c(0xfc)])!==null&&_0x51b264!==void 0x0?_0x51b264:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x268392,'subUnitId':_0x5460ad,'op':_0x207943,'objects':_0x3cdb67,'type':DrawingApplyType['UPDATE']}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x268392]},..._0x3beccd['redos']],_0x30596d=[...(_0x789b6a=_0x3beccd[_0x70fc3c(0x15b)])!==null&&_0x789b6a!==void 0x0?_0x789b6a:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x268392,'subUnitId':_0x5460ad,'op':_0x546fd1,'objects':_0x3cdb67,'type':DrawingApplyType[_0x70fc3c(0x129)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x268392]},..._0x3beccd[_0x70fc3c(0xc0)]];if(isConnectorShape(_0x1a2105)){const _0x4394f7=_0x289fe5[_0x70fc3c(0x10a)]();if(_0x4394f7){const _0x5cba5d={..._0x4394f7};_0x5cba5d[_0x70fc3c(0x149)]=void 0x0,_0x5cba5d['to']=void 0x0,_0x4a1820['push']({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x268392,'subUnitId':_0x5460ad,'shapeId':_0x46a777,'shapeType':_0x1a2105,'shapeData':{'relation':_0x5cba5d}}}),_0x30596d[_0x70fc3c(0xca)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x268392,'subUnitId':_0x5460ad,'shapeId':_0x46a777,'shapeType':_0x1a2105,'shapeData':{'relation':_0x4394f7}}});}}if(sequenceExecute(_0x4a1820,_0x2ac8ea)[_0x70fc3c(0xf5)])return _0x1e8147['pushUndoRedo']({'unitID':_0x268392,'undoMutations':_0x30596d,'redoMutations':_0x4a1820}),!![];return![];}},SetSheetsShapeRotateCommand={'type':CommandType['COMMAND'],'id':_0x331e47(0xc9),'handler':(_0xc5aba1,_0x3f2e36)=>{const _0x457c2b=_0x331e47;var _0x12622d,_0x495f82;const _0x4d6ab0=getSheetCommandTarget(_0xc5aba1['get'](IUniverInstanceService),_0x3f2e36);if(!_0x4d6ab0)return![];const _0xde10dc=_0xc5aba1['get'](SheetSkeletonService),{unitId:_0x625cfc,subUnitId:_0x1e59f8}=_0x4d6ab0,_0x1643f5=_0xde10dc[_0x457c2b(0x151)](_0x625cfc,_0x1e59f8);if(!_0x1643f5)return![];const _0x4b4896=_0xc5aba1[_0x457c2b(0x15c)](ISheetDrawingService),{shapeId:_0xaa0963,rotate:_0x4c9e72}=_0x3f2e36,_0x14781a=_0x4b4896['getDrawingByParam']({'unitId':_0x625cfc,'subUnitId':_0x1e59f8,'drawingId':_0xaa0963});if(!_0x14781a)return![];const _0x3e0beb=_0xc5aba1[_0x457c2b(0x15c)](SheetsShapeService)['getShapeModel'](_0x625cfc,_0x1e59f8,_0xaa0963);if(!_0x3e0beb)return![];const _0x24034d=_0xc5aba1[_0x457c2b(0x15c)](ICommandService),_0x1236b7=_0xc5aba1['get'](IUndoRedoService),_0xb2c0f8=_0xc5aba1['get'](SheetInterceptorService),_0x5465ad={..._0x14781a['transform']};if(_0x4c9e72!==void 0x0)_0x5465ad['angle']=(_0x5465ad['angle']||0x0)+_0x4c9e72;const _0x82f558=transformToDrawingPosition(_0x5465ad,_0x1643f5),_0x13c0c9=transformToAxisAlignPosition(_0x5465ad,_0x1643f5),_0x2377dd=_0x3e0beb[_0x457c2b(0x135)](),_0x414efc=_0x3e0beb[_0x457c2b(0xec)](),_0x4e685d={'unitId':_0x625cfc,'subUnitId':_0x1e59f8,'drawingId':_0xaa0963,'drawingType':DrawingTypeEnum[_0x457c2b(0xe2)],'sheetTransform':_0x82f558,'transform':_0x5465ad,'data':{'shapeType':_0x2377dd,'shapeData':_0x414efc},'axisAlignSheetTransform':_0x13c0c9,'allowTransform':!![]},{undo:_0x3f5be2,redo:_0x97595e,objects:_0x3463b7}=_0x4b4896[_0x457c2b(0x143)]([_0x4e685d]),_0x463bed=_0xb2c0f8[_0x457c2b(0x147)]({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x625cfc,'drawings':[_0x4e685d]}}),_0x1359d3=[...(_0x12622d=_0x463bed[_0x457c2b(0xfc)])!==null&&_0x12622d!==void 0x0?_0x12622d:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x625cfc,'subUnitId':_0x1e59f8,'op':_0x97595e,'objects':_0x3463b7,'type':DrawingApplyType[_0x457c2b(0x129)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x625cfc]},..._0x463bed[_0x457c2b(0x112)]],_0x2c5ce8=[...(_0x495f82=_0x463bed[_0x457c2b(0x15b)])!==null&&_0x495f82!==void 0x0?_0x495f82:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x625cfc,'subUnitId':_0x1e59f8,'op':_0x3f5be2,'objects':_0x3463b7,'type':DrawingApplyType[_0x457c2b(0x129)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x625cfc]},..._0x463bed[_0x457c2b(0xc0)]];if(sequenceExecute(_0x1359d3,_0x24034d)[_0x457c2b(0xf5)])return _0x1236b7['pushUndoRedo']({'unitID':_0x625cfc,'undoMutations':_0x2c5ce8,'redoMutations':_0x1359d3}),!![];return![];}},SetSheetsShapeTextVerticalToggleCommand={'type':CommandType[_0x331e47(0x10c)],'id':'sheet.command.set-shape-text-vertical-toggle','handler':(_0x1daee1,_0x3f33d3)=>{const _0x2090ba=_0x331e47;var _0x46891a;const _0x2c559d=getSheetCommandTarget(_0x1daee1[_0x2090ba(0x15c)](IUniverInstanceService),_0x3f33d3);if(!_0x2c559d)return![];const {unitId:_0x5582b4,subUnitId:_0x378090}=_0x2c559d,{shapeId:_0xa210bb}=_0x3f33d3,_0x124bd0=_0x1daee1[_0x2090ba(0x15c)](SheetsShapeService)[_0x2090ba(0x10e)](_0x5582b4,_0x378090,_0xa210bb);if(!_0x124bd0)return![];const _0x3fa518=_0x124bd0['getShapeTextData'](),_0x124aa1=(_0x46891a=_0x3fa518===null||_0x3fa518===void 0x0?void 0x0:_0x3fa518[_0x2090ba(0x140)])!==null&&_0x46891a!==void 0x0?_0x46891a:!![],_0x1657fa=!_0x124aa1,_0x405677=_0x1daee1['get'](ICommandService),_0x1cc068=_0x1daee1['get'](IUndoRedoService),_0x44720f={'unitId':_0x5582b4,'subUnitId':_0x378090,'shapeId':_0xa210bb,'shapeData':{'shapeText':{'isHorizontal':_0x1657fa}}},_0x2e9b58={'unitId':_0x5582b4,'subUnitId':_0x378090,'shapeId':_0xa210bb,'shapeData':{'shapeText':{'isHorizontal':_0x124aa1}}},_0x58a2e0=[{'id':UpdateSheetsShapeDataMutation['id'],'params':_0x44720f}],_0x46f31b=[{'id':UpdateSheetsShapeDataMutation['id'],'params':_0x2e9b58}];if(sequenceExecute(_0x58a2e0,_0x405677)[_0x2090ba(0xf5)])return _0x1cc068[_0x2090ba(0xcb)]({'unitID':_0x5582b4,'undoMutations':_0x46f31b,'redoMutations':_0x58a2e0}),!![];return![];}},UpdateConnectorRelationCommand={'type':CommandType[_0x331e47(0x10c)],'id':'sheet.command.update-connector-relation','handler':(_0x431f79,_0x35f92d)=>{const _0x4a2f63=_0x331e47;var _0x215ee1,_0x35d4ef,_0x437a0f,_0xb4905b;const _0x1432ea=getSheetCommandTarget(_0x431f79[_0x4a2f63(0x15c)](IUniverInstanceService),_0x35f92d);if(!_0x1432ea)return![];const _0x5b0135=_0x431f79[_0x4a2f63(0x15c)](SheetSkeletonService),{unitId:_0x47e927,subUnitId:_0x21d173}=_0x1432ea,_0x1c53d0=_0x5b0135['getSkeleton'](_0x47e927,_0x21d173);if(!_0x1c53d0)return![];const _0x12352c=_0x431f79['get'](ISheetDrawingService),{connectorShapeId:_0x563bd0,width:_0x1e7eef,height:_0x1bd34a,left:_0x53b3c9,top:_0x5dd2b5,flipX:_0x25dfb7,flipY:_0x25f2af,rotation:_0x1ef9d3,oldAdjustValues:_0x4f558c,newAdjustValues:_0x48e522,oldLineType:_0x2fe04c,newLineType:_0x550fe1,oldRelation:_0x1d6c9a,newRelation:_0x1bc224}=_0x35f92d,_0x608c3f=_0x12352c[_0x4a2f63(0x13e)]({'unitId':_0x47e927,'subUnitId':_0x21d173,'drawingId':_0x563bd0});if(!_0x608c3f)return![];const _0x276ab9=_0x431f79[_0x4a2f63(0x15c)](SheetsShapeService)[_0x4a2f63(0x10e)](_0x47e927,_0x21d173,_0x563bd0);if(!_0x276ab9)return![];const _0x4653c6=_0x431f79['get'](ICommandService),_0x44c153=_0x431f79[_0x4a2f63(0x15c)](IUndoRedoService),_0x31e33d=_0x431f79[_0x4a2f63(0x15c)](SheetInterceptorService),_0x2a8d61={..._0x608c3f[_0x4a2f63(0x104)],'width':_0x1e7eef,'height':_0x1bd34a,'left':_0x53b3c9,'top':_0x5dd2b5,'flipX':_0x25dfb7,'flipY':_0x25f2af,'angle':(_0x215ee1=_0x1ef9d3!==null&&_0x1ef9d3!==void 0x0?_0x1ef9d3:(_0x35d4ef=_0x608c3f[_0x4a2f63(0x104)])===null||_0x35d4ef===void 0x0?void 0x0:_0x35d4ef['angle'])!==null&&_0x215ee1!==void 0x0?_0x215ee1:0x0},_0x1012d8=transformToDrawingPosition(_0x2a8d61,_0x1c53d0),_0x459db6=transformToAxisAlignPosition(_0x2a8d61,_0x1c53d0),_0x118e4c=_0x276ab9[_0x4a2f63(0x135)](),_0x1a1fd3=_0x276ab9['getShapeData'](),_0x3b44ee={'unitId':_0x47e927,'subUnitId':_0x21d173,'drawingId':_0x563bd0,'drawingType':DrawingTypeEnum['DRAWING_SHAPE'],'sheetTransform':_0x1012d8,'transform':_0x2a8d61,'data':{'shapeType':_0x550fe1||_0x2fe04c||_0x118e4c,'shapeData':{..._0x1a1fd3,'adjustValues':_0x48e522||_0x4f558c||(_0x1a1fd3===null||_0x1a1fd3===void 0x0?void 0x0:_0x1a1fd3[_0x4a2f63(0x137)]),'relation':_0x1bc224||_0x1d6c9a||(_0x1a1fd3===null||_0x1a1fd3===void 0x0?void 0x0:_0x1a1fd3['relation'])}},'axisAlignSheetTransform':_0x459db6,'allowTransform':!![]},{undo:_0x4ff57b,redo:_0x5c46ad,objects:_0x2203f3}=_0x12352c[_0x4a2f63(0x143)]([_0x3b44ee]),_0xe69055=_0x31e33d[_0x4a2f63(0x147)]({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x47e927,'drawings':[_0x3b44ee]}}),_0x2e350c=[...(_0x437a0f=_0xe69055[_0x4a2f63(0xfc)])!==null&&_0x437a0f!==void 0x0?_0x437a0f:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x47e927,'subUnitId':_0x21d173,'op':_0x5c46ad,'objects':_0x2203f3,'type':DrawingApplyType[_0x4a2f63(0x129)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x47e927]},..._0xe69055['redos'],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x47e927,'subUnitId':_0x21d173,'shapeId':_0x563bd0,'shapeType':_0x550fe1,'shapeData':{'adjustValues':_0x48e522,'relation':_0x1bc224}}}],_0x4c496f=[...(_0xb4905b=_0xe69055['preUndos'])!==null&&_0xb4905b!==void 0x0?_0xb4905b:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x47e927,'subUnitId':_0x21d173,'op':_0x4ff57b,'objects':_0x2203f3,'type':DrawingApplyType[_0x4a2f63(0x129)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x47e927]},..._0xe69055[_0x4a2f63(0xc0)],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x47e927,'subUnitId':_0x21d173,'shapeId':_0x563bd0,'shapeType':_0x118e4c,'shapeData':{..._0x1a1fd3,'adjustValues':_0x4f558c||(_0x1a1fd3===null||_0x1a1fd3===void 0x0?void 0x0:_0x1a1fd3[_0x4a2f63(0x137)]),'relation':_0x1d6c9a||(_0x1a1fd3===null||_0x1a1fd3===void 0x0?void 0x0:_0x1a1fd3[_0x4a2f63(0xdd)])}}}];if(sequenceExecute(_0x2e350c,_0x4653c6)['result'])return _0x44c153['pushUndoRedo']({'unitID':_0x47e927,'undoMutations':_0x4c496f,'redoMutations':_0x2e350c}),!![];return![];}},UpdateLineShapeResizeCommand={'type':CommandType[_0x331e47(0x10c)],'id':_0x331e47(0xeb),'handler':(_0x2ca3d4,_0x2d8042)=>{const _0x22815d=_0x331e47;var _0x8119b1,_0x16dc1d;const _0x487ea7=getSheetCommandTarget(_0x2ca3d4[_0x22815d(0x15c)](IUniverInstanceService),_0x2d8042);if(!_0x487ea7)return![];const _0x379bc0=_0x2ca3d4[_0x22815d(0x15c)](SheetSkeletonService),{unitId:_0x4c0431,subUnitId:_0x551548}=_0x487ea7,_0x19efd6=_0x379bc0['getSkeleton'](_0x4c0431,_0x551548);if(!_0x19efd6)return![];const _0x4de5ea=_0x2ca3d4[_0x22815d(0x15c)](ISheetDrawingService),{shapeId:_0x318d9f,width:_0x258cf7,height:_0x7aa75e,left:_0x27c471,top:_0x2c775c,flipX:_0x3c5bff,flipY:_0x2655ec,angle:_0x277c9f,oldAdjustValues:_0x3de831,newAdjustValues:_0x358c1f,oldLineType:_0x24db98,newLineType:_0x46e990}=_0x2d8042,_0x23a3a7=_0x4de5ea[_0x22815d(0x13e)]({'unitId':_0x4c0431,'subUnitId':_0x551548,'drawingId':_0x318d9f});if(!_0x23a3a7)return![];const _0x7deff6=_0x2ca3d4[_0x22815d(0x15c)](SheetsShapeService)[_0x22815d(0x10e)](_0x4c0431,_0x551548,_0x318d9f);if(!_0x7deff6)return![];const _0xe504d8=_0x2ca3d4[_0x22815d(0x15c)](ICommandService),_0x44e5d7=_0x2ca3d4[_0x22815d(0x15c)](IUndoRedoService),_0x37f569=_0x2ca3d4[_0x22815d(0x15c)](SheetInterceptorService),_0xffeaab={..._0x23a3a7[_0x22815d(0x104)],'width':_0x258cf7,'height':_0x7aa75e,'left':_0x27c471,'top':_0x2c775c,'flipX':_0x3c5bff,'flipY':_0x2655ec,'angle':_0x277c9f},_0xf273c0=transformToDrawingPosition(_0xffeaab,_0x19efd6),_0x5f1de3=transformToAxisAlignPosition(_0xffeaab,_0x19efd6),_0x37934d=_0x7deff6[_0x22815d(0x135)](),_0x298d7d=_0x7deff6[_0x22815d(0xec)](),_0x246ad0={'unitId':_0x4c0431,'subUnitId':_0x551548,'drawingId':_0x318d9f,'drawingType':DrawingTypeEnum[_0x22815d(0xe2)],'sheetTransform':_0xf273c0,'transform':_0xffeaab,'data':{'shapeType':_0x46e990||_0x24db98||_0x37934d,'shapeData':{..._0x298d7d,'adjustValues':_0x358c1f||_0x3de831||(_0x298d7d===null||_0x298d7d===void 0x0?void 0x0:_0x298d7d[_0x22815d(0x137)])}},'axisAlignSheetTransform':_0x5f1de3,'allowTransform':!![]},{undo:_0x2008c1,redo:_0x57e65c,objects:_0x40ad26}=_0x4de5ea[_0x22815d(0x143)]([_0x246ad0]),_0x3ad3ea=_0x37f569[_0x22815d(0x147)]({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x4c0431,'drawings':[_0x246ad0]}}),_0x362dbb=[...(_0x8119b1=_0x3ad3ea['preRedos'])!==null&&_0x8119b1!==void 0x0?_0x8119b1:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x4c0431,'subUnitId':_0x551548,'op':_0x57e65c,'objects':_0x40ad26,'type':DrawingApplyType[_0x22815d(0x129)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x4c0431]},..._0x3ad3ea['redos'],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x4c0431,'subUnitId':_0x551548,'shapeId':_0x318d9f,'shapeType':_0x46e990,'shapeData':{'adjustValues':_0x358c1f}}}],_0x39c00c=[...(_0x16dc1d=_0x3ad3ea[_0x22815d(0x15b)])!==null&&_0x16dc1d!==void 0x0?_0x16dc1d:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x4c0431,'subUnitId':_0x551548,'op':_0x2008c1,'objects':_0x40ad26,'type':DrawingApplyType['UPDATE']}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x4c0431]},..._0x3ad3ea[_0x22815d(0xc0)],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x4c0431,'subUnitId':_0x551548,'shapeId':_0x318d9f,'shapeType':_0x37934d,'shapeData':{..._0x298d7d,'adjustValues':_0x3de831||(_0x298d7d===null||_0x298d7d===void 0x0?void 0x0:_0x298d7d[_0x22815d(0x137)])}}}];if(sequenceExecute(_0x362dbb,_0xe504d8)[_0x22815d(0xf5)])return _0x44e5d7[_0x22815d(0xcb)]({'unitID':_0x4c0431,'undoMutations':_0x39c00c,'redoMutations':_0x362dbb}),!![];return![];}},UpdateSheetsShapeTypeMutation={'id':_0x331e47(0xd7),'type':CommandType['MUTATION'],'handler':(_0x4c37f7,_0x50761d)=>{const _0x11bb60=_0x331e47,{unitId:_0x3939f6,subUnitId:_0x2a1381,shapeType:_0xf06002,shapeId:_0x42d002,shapeData:_0x2493d6}=_0x50761d,_0x54a7ba=_0x4c37f7[_0x11bb60(0x15c)](SheetsShapeService)['getShapeModel'](_0x3939f6,_0x2a1381,_0x42d002);if(_0x54a7ba){_0x54a7ba['setShapeType'](_0xf06002);if(_0x2493d6)_0x54a7ba===null||_0x54a7ba===void 0x0||_0x54a7ba[_0x11bb60(0x13a)](_0x2493d6);}return!![];}},UpdateSheetsShapeTypeCommand={'id':_0x331e47(0xf7),'type':CommandType['COMMAND'],'handler':(_0xf06dbc,_0x4f3b8e)=>{const _0x1e9312=_0x331e47;if(!_0x4f3b8e)return![];const _0x10c5fd=_0xf06dbc[_0x1e9312(0x15c)](ICommandService),_0x53188c=_0xf06dbc[_0x1e9312(0x15c)](SheetsShapeService),_0x1acc45=_0xf06dbc[_0x1e9312(0x15c)](IUndoRedoService),_0x5d430f=[],_0x4d10cc=[],{unitId:_0x3e4dd3,subUnitId:_0x2af8c1,shapeId:_0x2f3cb4,shapeType:_0x240775,shapeData:_0xbe5d9d}=_0x4f3b8e,_0x5f4b73=_0x53188c['getShapeModel'](_0x3e4dd3,_0x2af8c1,_0x2f3cb4);if(_0x5f4b73){const _0x31c6dc=_0x5f4b73[_0x1e9312(0x135)](),_0x28f448=Object[_0x1e9312(0x10d)]({},_0x5f4b73['getShapeData']()),_0x9240d8={'unitId':_0x3e4dd3,'subUnitId':_0x2af8c1,'shapeId':_0x2f3cb4,'shapeType':_0x240775,'shapeData':_0xbe5d9d},_0x3236b3={'unitId':_0x3e4dd3,'subUnitId':_0x2af8c1,'shapeId':_0x2f3cb4,'shapeType':_0x31c6dc,'shapeData':_0x28f448};_0x5d430f[_0x1e9312(0xca)]({'id':UpdateSheetsShapeTypeMutation['id'],'params':_0x9240d8}),_0x4d10cc[_0x1e9312(0xca)]({'id':UpdateSheetsShapeTypeMutation['id'],'params':_0x3236b3});if(_0x5d430f[_0x1e9312(0xd9)](_0x1c3d93=>_0x10c5fd[_0x1e9312(0x10b)](_0x1c3d93['id'],_0x1c3d93[_0x1e9312(0x101)])))_0x1acc45[_0x1e9312(0xcb)]({'unitID':_0x3e4dd3,'redoMutations':[..._0x5d430f],'undoMutations':[..._0x4d10cc]});return!![];}return![];}};var name=_0x331e47(0x12a),version=_0x331e47(0x154);function _0x1f87(_0x12bff7,_0x3faad0){_0x12bff7=_0x12bff7-0xc0;const _0x2c0a56=_0x2c0a();let _0x1f87ff=_0x2c0a56[_0x12bff7];return _0x1f87ff;}const SHEETS_SHAPE_PLUGIN_CONFIG_KEY='sheets-shape.config',configSymbol=Symbol(SHEETS_SHAPE_PLUGIN_CONFIG_KEY),defaultPluginConfig={};let SheetsShapeController=class SheetsShapeController extends Disposable{constructor(_0x2dee15,_0x4aa9db,_0x384cee,_0x3bbe31,_0x508ec4){const _0x25a1be=_0x331e47;super(),this[_0x25a1be(0x108)]=_0x2dee15,this['_sheetInterceptorService']=_0x4aa9db,this['_sheetSkeletonService']=_0x384cee,this[_0x25a1be(0x158)]=_0x3bbe31,this[_0x25a1be(0xe8)]=_0x508ec4,this['_initCommands'](),this[_0x25a1be(0xce)]();}[_0x331e47(0xcc)](){const _0x140ebf=_0x331e47;[InsertShapeCommand,SetShapeDrawingDataCommand,ToggleSheetsShapeFlipCommand,SetSheetsShapeRotateCommand,SetSheetsShapeTextVerticalToggleCommand,UpdateConnectorRelationCommand,UpdateLineShapeResizeCommand,InsertSheetsShapeMutation,RemoveSheetsShapeMutation,UpdateSheetsShapeTypeMutation,UpdateSheetsShapeDataMutation]['forEach'](_0x41b41d=>this[_0x140ebf(0x128)](this[_0x140ebf(0x108)]['registerCommand'](_0x41b41d)));}['_initCommandInterceptor'](){const _0x48932c=_0x331e47;this[_0x48932c(0x128)](this['_sheetInterceptorService'][_0x48932c(0x100)]({'getMutations':_0x2f5216=>{const _0x3f1785=_0x48932c;if(_0x2f5216['id']===RemoveSheetDrawingCommand['id']){const {drawings:_0x4e71d6}=_0x2f5216['params'],_0xbeec6=_0x4e71d6[_0x3f1785(0xf3)](_0x32346c=>_0x32346c[_0x3f1785(0x144)]===DrawingTypeEnum['DRAWING_SHAPE']);if(_0xbeec6[_0x3f1785(0x12e)]===0x0)return{'preRedos':[],'redos':[],'preUndos':[],'undos':[]};const _0x1d50ec=[],_0x23d6f1=[];return _0xbeec6[_0x3f1785(0x107)](_0x271b73=>{const _0x2139f8=_0x3f1785,{unitId:_0x482ec8,subUnitId:_0x3f8d73,drawingId:_0x199f92}=_0x271b73,_0x3376f3=this[_0x2139f8(0x158)][_0x2139f8(0x10e)](_0x482ec8,_0x3f8d73,_0x199f92);if(!_0x3376f3)throw new TypeError(_0x2139f8(0x156)+_0x3376f3);_0x1d50ec[_0x2139f8(0xca)]({'id':RemoveSheetsShapeMutation['id'],'params':{'unitId':_0x482ec8,'subUnitId':_0x3f8d73,'shapeId':_0x199f92}}),_0x23d6f1[_0x2139f8(0xca)]({'id':InsertSheetsShapeMutation['id'],'params':{'unitId':_0x482ec8,'subUnitId':_0x3f8d73,'shapeId':_0x199f92,'shapeType':_0x3376f3['getShapeType'](),'shapeData':_0x3376f3[_0x2139f8(0xec)]()}});const _0x24b0ff=this['_sheetsShapeService'][_0x2139f8(0xcd)](_0x482ec8,_0x3f8d73,_0x199f92);if(_0x24b0ff)for(const _0x42151a of _0x24b0ff){const _0x31276a=_0x42151a[_0x2139f8(0xfa)],_0x2e284a=_0x42151a[_0x2139f8(0xc4)],_0x219e70=_0x2e284a?{'from':void 0x0}:{'to':void 0x0},_0xf093c7=_0x2e284a?{'from':{'shapeId':_0x42151a[_0x2139f8(0xf8)],'cxnIndex':_0x42151a['cxnIndex']}}:{'to':{'shapeId':_0x42151a[_0x2139f8(0xf8)],'cxnIndex':_0x42151a[_0x2139f8(0x10f)]}};_0x1d50ec[_0x2139f8(0xca)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x482ec8,'subUnitId':_0x3f8d73,'shapeId':_0x31276a,'shapeData':{'relation':_0x219e70}}}),_0x23d6f1['push']({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x482ec8,'subUnitId':_0x3f8d73,'shapeId':_0x31276a,'shapeData':{'relation':_0xf093c7}}});}}),{'preRedos':_0x1d50ec,'redos':[],'preUndos':[],'undos':_0x23d6f1};}if(_0x2f5216['id']===SetSheetDrawingCommand['id']){const {drawings:_0x8fe1e3}=_0x2f5216['params'],_0x435334=_0x8fe1e3[_0x3f1785(0xf3)](_0x4c0f84=>_0x4c0f84[_0x3f1785(0x144)]===DrawingTypeEnum[_0x3f1785(0xe2)]);if(_0x435334[_0x3f1785(0x12e)]===0x0)return{'preRedos':[],'redos':[],'preUndos':[],'undos':[]};const _0x43e57c=[],_0xe135a5=[];for(const _0x6c9966 of _0x435334){const {unitId:_0x318c85,subUnitId:_0x13f314,drawingId:_0x479fe6,transform:_0x5a76b6}=_0x6c9966;if(!_0x318c85||!_0x13f314||!_0x479fe6||!_0x5a76b6)continue;const _0x4be04e=this[_0x3f1785(0x158)]['getShapeModel'](_0x318c85,_0x13f314,_0x479fe6);if(!_0x4be04e)throw new TypeError(_0x3f1785(0x156)+_0x4be04e);if(isConnectorShape(_0x4be04e[_0x3f1785(0x135)]())){const _0x24fa46=this[_0x3f1785(0x158)][_0x3f1785(0xfd)](_0x318c85,_0x13f314,_0x479fe6),_0x3f3d98={'from':void 0x0,'to':void 0x0};_0x24fa46&&(_0x43e57c[_0x3f1785(0xca)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x318c85,'subUnitId':_0x13f314,'shapeId':_0x479fe6,'shapeData':{'relation':_0x3f3d98}}}),_0xe135a5[_0x3f1785(0xca)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x318c85,'subUnitId':_0x13f314,'shapeId':_0x479fe6,'shapeData':{'relation':_0x24fa46}}}));}else{const _0x2768dc=this[_0x3f1785(0x158)][_0x3f1785(0xcd)](_0x318c85,_0x13f314,_0x479fe6);if(_0x2768dc&&_0x2768dc[_0x3f1785(0x12e)]>0x0)for(const _0x3a4365 of _0x2768dc){const _0x240333=_0x3a4365['lineShapeId'],_0x417900=_0x3a4365[_0x3f1785(0xc4)],_0x4094b1=this[_0x3f1785(0x158)][_0x3f1785(0x10e)](_0x318c85,_0x13f314,_0x240333);if(!_0x4094b1)continue;const _0xcb6e01=_0x4094b1[_0x3f1785(0xd8)](),_0x5a0dd2=_0x4094b1[_0x3f1785(0xda)]();if(_0xcb6e01&&_0x5a0dd2)this['_addLineRerouteUpdates'](_0x318c85,_0x13f314,_0x240333,_0x4094b1,_0xcb6e01,_0x5a0dd2,_0x43e57c,_0xe135a5,_0x479fe6,_0x5a76b6);else this[_0x3f1785(0xd6)](_0x318c85,_0x13f314,_0x240333,_0x4094b1,_0x417900?_0xcb6e01:_0x5a0dd2,_0x417900,_0x43e57c,_0xe135a5,_0x479fe6,_0x5a76b6);}}}return{'preRedos':[],'redos':_0x43e57c,'preUndos':_0xe135a5,'undos':[]};}return{'preRedos':[],'redos':[],'preUndos':[],'undos':[]};}}));}[_0x331e47(0xdb)](_0x205212,_0x39060f,_0x512278,_0x24f49f,_0x506531){const _0x553f=_0x331e47;if(!_0x39060f||!_0x512278)return null;const {shapeId:_0x483486,cxnIndex:_0x22fd5e}=_0x205212,_0x392f07=this[_0x553f(0x158)][_0x553f(0x10e)](_0x39060f,_0x512278,_0x483486);if(!_0x392f07)return null;const _0x9af3e9=this['_drawingManagerService'][_0x553f(0x13e)]({'unitId':_0x39060f,'subUnitId':_0x512278,'drawingId':_0x483486});if(!(_0x9af3e9===null||_0x9af3e9===void 0x0?void 0x0:_0x9af3e9[_0x553f(0x104)]))return null;let {left:left=0x0,top:top=0x0,width:width=0x0,height:height=0x0,flipX:flipX=![],flipY:flipY=![],angle:_0x295379}=_0x9af3e9[_0x553f(0x104)];if(_0x506531&&_0x24f49f===_0x483486){var _0x3f2d0b,_0x3f175e,_0x12b707,_0x4d8ea2,_0x1444c0,_0x31aa53,_0x29fc86;left=(_0x3f2d0b=_0x506531[_0x553f(0x152)])!==null&&_0x3f2d0b!==void 0x0?_0x3f2d0b:left,top=(_0x3f175e=_0x506531[_0x553f(0x13b)])!==null&&_0x3f175e!==void 0x0?_0x3f175e:top,width=(_0x12b707=_0x506531[_0x553f(0x14a)])!==null&&_0x12b707!==void 0x0?_0x12b707:width,height=(_0x4d8ea2=_0x506531['height'])!==null&&_0x4d8ea2!==void 0x0?_0x4d8ea2:height,flipX=(_0x1444c0=_0x506531[_0x553f(0x102)])!==null&&_0x1444c0!==void 0x0?_0x1444c0:flipX,flipY=(_0x31aa53=_0x506531[_0x553f(0xe7)])!==null&&_0x31aa53!==void 0x0?_0x31aa53:flipY,_0x295379=(_0x29fc86=_0x506531[_0x553f(0x114)])!==null&&_0x29fc86!==void 0x0?_0x29fc86:_0x295379;}_0x392f07[_0x553f(0xdf)]({'width':width,'height':height});const _0x4fc773=_0x392f07[_0x553f(0x134)]()['find'](_0x44a81d=>_0x44a81d['index']===_0x22fd5e);if(!_0x4fc773)return null;let _0x332f40=flipX?width-_0x4fc773['x']:_0x4fc773['x'],_0x3d25c2=flipY?height-_0x4fc773['y']:_0x4fc773['y'];if(_0x295379!==0x0&&_0x295379!==void 0x0&&_0x295379!==null){const _0xe29ae5=_0x295379*Math['PI']/0xb4,_0x5caf06=Math[_0x553f(0xc3)](_0xe29ae5),_0x150f55=Math[_0x553f(0xf6)](_0xe29ae5),_0x1f656=width/0x2,_0x37354c=height/0x2,_0x15dc81=_0x332f40-_0x1f656,_0x4544d3=_0x3d25c2-_0x37354c;_0x332f40=_0x1f656+_0x15dc81*_0x5caf06-_0x4544d3*_0x150f55,_0x3d25c2=_0x37354c+_0x15dc81*_0x150f55+_0x4544d3*_0x5caf06;}_0x332f40+=left,_0x3d25c2+=top;let _0x66c2bb=_0x4fc773[_0x553f(0x11d)]/0xea60;if(flipX)_0x66c2bb=0xb4-_0x66c2bb;if(flipY)_0x66c2bb=-_0x66c2bb;_0x66c2bb+=_0x295379||0x0,_0x66c2bb=(_0x66c2bb%0x168+0x168)%0x168;const _0x109de3=getBasicShapeRotateBound({'left':left,'top':top,'width':width,'height':height},_0x295379||0x0);return{'point':{'x':_0x332f40,'y':_0x3d25c2},'angle':_0x66c2bb,'bounds':_0x109de3};}[_0x331e47(0x115)](_0xeb8006,_0x5db83d,_0x55423e,_0x492a99,_0x10c229,_0x218873,_0x40daff,_0x3940f6,_0x13ecf0,_0x47c932){const _0x192391=_0x331e47,_0x3cb88c=this[_0x192391(0xde)][_0x192391(0x151)](_0xeb8006,_0x5db83d);if(!_0x3cb88c)return;const _0x1970b6=_0x492a99[_0x192391(0x10a)](),_0x341d6d=_0x492a99[_0x192391(0xd5)](),_0x1d9e2e={},_0x2b6d60={};_0x341d6d[_0x192391(0x107)](_0x3d8a51=>{const _0x59b1c7=_0x192391,_0xf78bb0=_0x492a99[_0x59b1c7(0x153)](_0x3d8a51);_0x2b6d60[_0x3d8a51]=_0xf78bb0!==null&&_0xf78bb0!==void 0x0?_0xf78bb0:0x0;});const _0x33bd94=this[_0x192391(0xdb)](_0x10c229,_0xeb8006,_0x5db83d,_0x13ecf0,_0x47c932),_0x48c1a4=this[_0x192391(0xdb)](_0x218873,_0xeb8006,_0x5db83d,_0x13ecf0,_0x47c932);if(_0x33bd94&&_0x48c1a4){const _0x397129=_0x492a99[_0x192391(0x135)](),_0x1f2a96=routeConnectorLineShape(_0x33bd94,_0x48c1a4,_0x397129);let _0x21cfde=_0x397129;if(_0x1f2a96){const _0x584a46=computeConnectorRouteLayout(_0x1f2a96,_0x492a99['getShapeType']()),_0x516018=this[_0x192391(0xe8)][_0x192391(0xef)](_0xeb8006,_0x5db83d);if(_0x516018&&_0x516018[_0x55423e]){const _0x482576=_0x516018[_0x55423e];_0x21cfde=_0x584a46[_0x192391(0xc8)];for(const [_0x487218,_0x5b8724]of Object[_0x192391(0xe5)](_0x584a46[_0x192391(0x137)]))_0x1d9e2e[_0x487218]=_0x5b8724;const _0x191599={..._0x482576[_0x192391(0x104)],'width':_0x584a46[_0x192391(0x14b)][_0x192391(0x14a)],'height':_0x584a46[_0x192391(0x14b)]['height'],'left':_0x584a46['worldRect'][_0x192391(0x152)],'top':_0x584a46['worldRect'][_0x192391(0x13b)],'flipX':_0x584a46[_0x192391(0x14b)][_0x192391(0x102)],'flipY':_0x584a46[_0x192391(0x14b)]['flipY'],'angle':_0x584a46['rotation']},_0x2d6bab=transformToDrawingPosition(_0x191599,_0x3cb88c),_0x50ed03=transformToAxisAlignPosition(_0x191599,_0x3cb88c),_0x4f4ffb={'unitId':_0xeb8006,'subUnitId':_0x5db83d,'drawingType':DrawingTypeEnum[_0x192391(0xe2)],'drawingId':_0x55423e,'transform':_0x191599,'sheetTransform':_0x2d6bab,'axisAlignSheetTransform':_0x50ed03},{unitId:_0x43d1c5,subUnitId:_0x1f886a,undo:_0x406e47,redo:_0x4d6bae,objects:_0x5311db}=this[_0x192391(0xe8)][_0x192391(0x143)]([_0x4f4ffb]);_0x40daff[_0x192391(0xca)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x43d1c5,'subUnitId':_0x1f886a,'op':_0x4d6bae,'objects':_0x5311db,'type':DrawingApplyType[_0x192391(0x129)]}}),_0x3940f6[_0x192391(0xca)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x43d1c5,'subUnitId':_0x1f886a,'op':_0x406e47,'objects':_0x5311db,'type':DrawingApplyType['UPDATE']}});}_0x492a99[_0x192391(0x103)]();}_0x40daff[_0x192391(0xca)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0xeb8006,'subUnitId':_0x5db83d,'shapeId':_0x55423e,'shapeType':_0x21cfde,'shapeData':{'adjustValues':_0x1d9e2e,'relation':_0x1970b6}}}),_0x3940f6[_0x192391(0xca)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0xeb8006,'subUnitId':_0x5db83d,'shapeId':_0x55423e,'shapeType':_0x397129,'shapeData':{'adjustValues':_0x2b6d60,'relation':_0x1970b6}}});}}[_0x331e47(0xd6)](_0x331943,_0xeff3d2,_0x218681,_0xa02121,_0x47c09e,_0x55b181,_0x1ac30f,_0x2147b0,_0x43be01,_0x535caa){const _0x4e4c34=_0x331e47;var _0xf61a79;if(!_0x47c09e)return;const _0x1aabc7=this[_0x4e4c34(0xde)][_0x4e4c34(0x151)](_0x331943,_0xeff3d2);if(!_0x1aabc7)return;const _0x1d4c45=(_0xf61a79=this[_0x4e4c34(0xe8)]['getDrawingByParam']({'unitId':_0x331943,'subUnitId':_0xeff3d2,'drawingId':_0x43be01}))===null||_0xf61a79===void 0x0?void 0x0:_0xf61a79['transform'];if(!_0x1d4c45)return;const _0x1f414c=_0x1d4c45['left']!==_0x535caa[_0x4e4c34(0x152)]||_0x1d4c45[_0x4e4c34(0x13b)]!==_0x535caa[_0x4e4c34(0x13b)],_0x349919=_0x1d4c45['width']!==_0x535caa[_0x4e4c34(0x14a)]||_0x1d4c45[_0x4e4c34(0x136)]!==_0x535caa[_0x4e4c34(0x136)],_0x2dac66=_0x1d4c45[_0x4e4c34(0x102)]!==_0x535caa[_0x4e4c34(0x102)]||_0x1d4c45[_0x4e4c34(0xe7)]!==_0x535caa['flipY'],_0x56e78b=_0x1d4c45['angle']!==_0x535caa[_0x4e4c34(0x114)];if(_0x1f414c&&!_0x349919&&!_0x2dac66&&!_0x56e78b){var _0x93133d,_0x6675c4,_0x2518dd,_0x341b04;const _0x161eaa=((_0x93133d=_0x535caa[_0x4e4c34(0x152)])!==null&&_0x93133d!==void 0x0?_0x93133d:0x0)-((_0x6675c4=_0x1d4c45[_0x4e4c34(0x152)])!==null&&_0x6675c4!==void 0x0?_0x6675c4:0x0),_0x1f55fd=((_0x2518dd=_0x535caa[_0x4e4c34(0x13b)])!==null&&_0x2518dd!==void 0x0?_0x2518dd:0x0)-((_0x341b04=_0x1d4c45[_0x4e4c34(0x13b)])!==null&&_0x341b04!==void 0x0?_0x341b04:0x0),_0x1a1ab9=this[_0x4e4c34(0xe8)][_0x4e4c34(0xef)](_0x331943,_0xeff3d2);if(_0x1a1ab9&&_0x1a1ab9[_0x218681]){var _0xdf05e6,_0xa89259,_0x4ceb4b,_0x4fa38c;const _0x6a28ad=_0x1a1ab9[_0x218681],_0x2cb97d={..._0x6a28ad['transform'],'left':((_0xdf05e6=(_0xa89259=_0x6a28ad[_0x4e4c34(0x104)])===null||_0xa89259===void 0x0?void 0x0:_0xa89259[_0x4e4c34(0x152)])!==null&&_0xdf05e6!==void 0x0?_0xdf05e6:0x0)+_0x161eaa,'top':((_0x4ceb4b=(_0x4fa38c=_0x6a28ad[_0x4e4c34(0x104)])===null||_0x4fa38c===void 0x0?void 0x0:_0x4fa38c['top'])!==null&&_0x4ceb4b!==void 0x0?_0x4ceb4b:0x0)+_0x1f55fd},_0x1c3ab6=transformToDrawingPosition(_0x2cb97d,_0x1aabc7),_0x116ea4=transformToAxisAlignPosition(_0x2cb97d,_0x1aabc7),_0x35f38b={'unitId':_0x331943,'subUnitId':_0xeff3d2,'drawingType':DrawingTypeEnum[_0x4e4c34(0xe2)],'drawingId':_0x218681,'transform':_0x2cb97d,'sheetTransform':_0x1c3ab6,'axisAlignSheetTransform':_0x116ea4},{unitId:_0x2ad709,subUnitId:_0x230533,undo:_0x5f5194,redo:_0x2160a9,objects:_0x56934f}=this[_0x4e4c34(0xe8)][_0x4e4c34(0x143)]([_0x35f38b]);_0x1ac30f[_0x4e4c34(0xca)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x2ad709,'subUnitId':_0x230533,'op':_0x2160a9,'objects':_0x56934f,'type':DrawingApplyType[_0x4e4c34(0x129)]}}),_0x2147b0[_0x4e4c34(0xca)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x2ad709,'subUnitId':_0x230533,'op':_0x5f5194,'objects':_0x56934f,'type':DrawingApplyType[_0x4e4c34(0x129)]}});}}else{const _0x1731c8=_0xa02121[_0x4e4c34(0xd8)](),_0xfe30d7=_0xa02121[_0x4e4c34(0xda)]();this[_0x4e4c34(0x115)](_0x331943,_0xeff3d2,_0x218681,_0xa02121,_0x1731c8,_0xfe30d7,_0x1ac30f,_0x2147b0,_0x43be01,_0x535caa);}}};SheetsShapeController=__decorate([__decorateParam(0x0,ICommandService),__decorateParam(0x1,Inject(SheetInterceptorService)),__decorateParam(0x2,Inject(SheetSkeletonService)),__decorateParam(0x3,Inject(SheetsShapeService)),__decorateParam(0x4,Inject(IDrawingManagerService))],SheetsShapeController);function _0x2c0a(){const _0x542a6f=['registerPluginResource','function','clear','getConnectionSiteList','getShapeType','height','adjustValues','INSERT','startX','setShapeData','top','_injector','fromJSON','getDrawingByParam','sheet.mutation.remove-shape','isHorizontal','type','toJSON','getBatchUpdateOp','drawingType','_groupIds','add','onCommandExecute','packageName','from','width','worldRect','position','_ensureShapeModelManager','version','4798650mYvWIv','9039NTdYIM','getSkeleton','left','getAdjustValueByName','0.22.0','_config','Fail\x20to\x20get\x20shape\x20model,\x20get:\x20','_configService','_sheetsShapeService','addShape','getCellWithCoordByIndex','preUndos','get','getOwnPropertyDescriptor','data','undos','decorate','_disposed','cos','isFrom','_linesIds','_deserializeShapeForUnit','keys','lineType','sheet.command.set-shape-rotate','push','pushUndoRedo','_initCommands','getBasicShapeRelation','_initCommandInterceptor','borderEnabled','UNIVER_SHEET','fill','shapeData','setShapeType','set','getAdjustNames','_addLineFollowShapeUpdates','sheet.mutation.update-shape-type','getStartConnectInfo','every','getEndConnectInfo','_getConnectPointInfo','getShapeDataById','relation','_sheetSkeletonService','updateContext','onStarting','constructor','DRAWING_SHAPE','424jcpDLy','insertShape','entries','_resourcesManagerService','flipY','_drawingManagerService','string','16rwdyOl','sheet.command.update-line-shape-resize','getShapeData','startY','pluginName','getDrawingData','16996903PfrULp','MUTATION','delete','filter','15169HdLucD','result','sin','sheet.command.update-shape-type','shapeId','SHEET_SHAPE_PLUGIN','lineShapeId','symbol','preRedos','getLineShapeRelation','92060ZzJWvv','_shapeModelManagerMap','interceptCommand','params','flipX','removeLinePoints','transform','198qfWnZs','setConfig','forEach','_commandService','rotateEnabled','getShapeRelation','syncExecuteCommand','COMMAND','assign','getShapeModel','cxnIndex','stringify','_shapes','redos','78387mYTekj','angle','_addLineRerouteUpdates','object','getBasicShapeType','hasShape','isLineShape','sheet.command.toggle-shape-flip','sheet.command.insert-shape','parse','ang','removeShape','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','sheet.command.set-shape-drawing-data','370074TCjuOS','_serializeShapeForUnit','range','846fIUYDu','resizeEnabled','has','toPrimitive','disposeWithMe','UPDATE','@univerjs-pro/sheets-shape','dispose','iterator','ensureSkeleton','length','getBatchAddOp','getCellIndexAndOffsetByPosition'];_0x2c0a=function(){return _0x542a6f;};return _0x2c0a();}let UniverSheetsShapePlugin=class UniverSheetsShapePlugin extends Plugin{constructor(_0x148550=defaultPluginConfig,_0x228e51,_0x24a1e7,_0x405e4e){const _0x32e942=_0x331e47;super(),this[_0x32e942(0x155)]=_0x148550,this[_0x32e942(0x13c)]=_0x228e51,this[_0x32e942(0x108)]=_0x24a1e7,this[_0x32e942(0x157)]=_0x405e4e;const {..._0x3cd1df}=merge({},defaultPluginConfig,this[_0x32e942(0x155)]);this[_0x32e942(0x157)][_0x32e942(0x106)](SHEETS_SHAPE_PLUGIN_CONFIG_KEY,_0x3cd1df);}[_0x331e47(0xe0)](){const _0x1b6fe2=_0x331e47,_0x57b5ff=this[_0x1b6fe2(0x13c)];[[SheetShapeModelManager],[SheetsShapeService],[SheetsShapeController]][_0x1b6fe2(0x107)](_0x46f3ce=>_0x57b5ff[_0x1b6fe2(0x146)](_0x46f3ce)),touchDependencies(_0x57b5ff,[[SheetsShapeService],[SheetsShapeController]]);}};_defineProperty(UniverSheetsShapePlugin,_0x331e47(0x141),UniverInstanceType[_0x331e47(0xd0)]),_defineProperty(UniverSheetsShapePlugin,_0x331e47(0xee),_0x331e47(0xf9)),_defineProperty(UniverSheetsShapePlugin,_0x331e47(0x148),name),_defineProperty(UniverSheetsShapePlugin,_0x331e47(0x14e),version),UniverSheetsShapePlugin=__decorate([DependentOn(UniverLicensePlugin),__decorateParam(0x1,Inject(Injector)),__decorateParam(0x2,ICommandService),__decorateParam(0x3,IConfigService)],UniverSheetsShapePlugin);export{DEFAULT_SHAPE_HEIGHT,DEFAULT_SHAPE_WIDTH,InsertShapeCommand,InsertSheetsShapeMutation,RemoveSheetsShapeMutation,SetShapeDrawingDataCommand,SetSheetsShapeRotateCommand,SetSheetsShapeTextVerticalToggleCommand,SheetsShapeService,ToggleSheetsShapeFlipCommand,UniverSheetsShapePlugin,UpdateConnectorRelationCommand,UpdateLineShapeResizeCommand,UpdateSheetsShapeDataMutation,UpdateSheetsShapeTypeCommand,UpdateSheetsShapeTypeMutation};