@univerjs/sheets-ui 1.5.1 → 1.5.2
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/cjs/index.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/index.js +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +13 -13
package/lib/umd/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
`,``);return n.forEach(e=>{let{st:t,ed:n,ts:a}=e;n-t>=i.length&&(r={...r,...a})}),Object.keys(r).length?r:null}function Sa(e,t=!1){var r;e.dataStream=n.DEFAULT_EMPTY_DOCUMENT_VALUE,(r=e.textRuns)!=null&&r.length&&(e.textRuns.length===1&&!t?(e.textRuns[0].st=0,e.textRuns[0].ed=1):e.textRuns=void 0),e.paragraphs!=null&&(e.paragraphs=[{startIndex:0,paragraphId:(0,n.createParagraphId)(/* @__PURE__ */ new Set)}]),e.sectionBreaks!=null&&(e.sectionBreaks=void 0),e.tables!=null&&(e.tables=void 0),e.customRanges!=null&&(e.customRanges=void 0),e.customBlocks!=null&&(e.customBlocks=void 0)}function Ca(e,t,n){if(!e)return e;let i={...e};if(e.v!=null){let a=(0,r.getCellType)(t,e,n??{});i.t=a,i.v=(0,r.getCellValue)(a,e)}return i.s&&=t.get(i.s),Object.fromEntries(Object.entries(i).filter(([e,t])=>!(t==null||Array.isArray(t)&&t.length===0||typeof t==`object`&&Object.keys(t).length===0)))}function wa(e,t,n,r,i){if(r.copyType===`CUT`){let{undos:n,redos:r}=Ta(e,t,i);return{undos:n,redos:r}}let a=[],o=[],{redo:s,undo:c}=Da(t,e,n,i);a.push(s),o.push(c);let{undos:l,redos:u}=Aa(t,n,i);return a.push(...u),o.push(...l),{undos:o,redos:a}}function Ta(e,t,n){let{range:i,subUnitId:a,unitId:o}=e,{range:s,subUnitId:c}=t,l=s?(0,r.discreteRangeToRange)(s):null,u=i?(0,r.discreteRangeToRange)(i):null;if(!u||!l)return{undos:[],redos:[]};let d=(0,r.getMoveRangeCommandMutations)(n,{fromRange:u,toRange:l,fromUnitId:o,fromSubUnitId:a,toUnitId:t.unitId,toSubUnitId:c},{includeAutoHeight:!1});return d?{undos:d.undos,redos:d.redos}:{undos:[],redos:[]}}function Ea(e,t,r){var i;if((0,n.isTextFormat)(t==null||(i=t.n)==null?void 0:i.pattern))return{n:t==null?void 0:t.n,t:n.CellValueType.STRING};let a=String(e).trim(),o=(0,n.getNumfmtParseValueFilter)(a,r),s={};return(o==null?void 0:o.v)!==void 0&&typeof o.v==`number`&&(!o.z&&(0,n.willLoseNumericPrecision)(a)?s.t=n.CellValueType.FORCE_STRING:s.v=o.v),o!=null&&o.z&&(s.n={pattern:o.z}),s}function Da(e,t,i,a){let{unitId:o,subUnitId:s,range:c}=e,l=(0,r.getSheetCommandTarget)(a.get(n.IUniverInstanceService),{unitId:o,subUnitId:s}),u=l==null?void 0:l.worksheet,d=l?{locale:(0,n.getNumfmtLocaleTag)(l.workbook.getSnapshot().locale),dateSystem:l.workbook.getDateSystem()}:void 0,{mapFunc:f}=D([c]),p=new n.ObjectMatrix;i.forValue((e,n,r)=>{var i,a;let{row:o,col:s}=f(e,n),c={...r.s??{}};c.bd&&Object.keys(c.bd).length===0&&(c.bd={t:null,r:null,b:null,l:null});let l={p:null,v:r.v,t:r.t};if((i=r.p)!=null&&i.body&&ya(r.p.body))l={p:r.p,v:r.v};else if(!t&&r.v&&!((a=c.n)!=null&&a.pattern)){let e=u==null?void 0:u.getCellStyle(o,s),t=Ea(r.v,e,d);t.n&&(c.n=t.n),t.t!==void 0&&(l.t=t.t),t.v!==void 0&&(l.v=t.v)}l.s=Object.keys(c).length>0?c:null,p.setValue(o,s,l)});let m={unitId:o,subUnitId:s,cellValue:(0,n.cloneCellDataMatrix)(p.getMatrix()),isOverrideStyle:!0},h=(0,r.SetRangeValuesUndoMutationFactory)(a,m);return{redo:{id:r.SetRangeValuesMutation.id,params:m},undo:{id:r.SetRangeValuesMutation.id,params:h}}}function Oa(e,t,i,a){let{unitId:o,subUnitId:s,range:c}=e,l=(0,r.getSheetCommandTarget)(a.get(n.IUniverInstanceService),{unitId:o,subUnitId:s}),u=l==null?void 0:l.worksheet,d=l?{locale:(0,n.getNumfmtLocaleTag)(l.workbook.getSnapshot().locale),dateSystem:l.workbook.getDateSystem()}:void 0,{mapFunc:f}=D([c]),p=new n.ObjectMatrix;i.forValue((e,n,r)=>{var i,a;let{row:o,col:s}=f(e,n),c={p:null,v:r.v,t:r.t};if((i=r.p)!=null&&i.body&&ya(r.p.body))c={p:r.p,v:r.v};else if(r.v&&!t&&!((a=r.s)!=null&&(a=a.n)!=null&&a.pattern)){let e=u==null?void 0:u.getCellStyle(o,s),t=Ea(r.v,e,d);t.t!==void 0&&(c.t=t.t),t.v!==void 0&&(c.v=t.v)}p.setValue(o,s,c)});let m={unitId:o,subUnitId:s,cellValue:(0,n.cloneCellDataMatrix)(p.getMatrix())},h=(0,r.SetRangeValuesUndoMutationFactory)(a,m);return{redo:{id:r.SetRangeValuesMutation.id,params:m},undo:{id:r.SetRangeValuesMutation.id,params:h}}}function ka(e,t,i,a){let{unitId:o,subUnitId:s,range:c}=e,l=(0,r.getSheetCommandTarget)(a.get(n.IUniverInstanceService),{unitId:o,subUnitId:s}),u=l==null?void 0:l.worksheet,d=l?{locale:(0,n.getNumfmtLocaleTag)(l.workbook.getSnapshot().locale),dateSystem:l.workbook.getDateSystem()}:void 0,{mapFunc:f}=D([c]),p=new n.ObjectMatrix;i.forValue((e,n,r)=>{var i;let{row:a,col:o}=f(e,n),s={...r.s??{}};if(s.bd&&Object.keys(s.bd).length===0&&(s.bd={t:null,r:null,b:null,l:null}),!t&&r.v&&!((i=s.n)!=null&&i.pattern)){let e=u==null?void 0:u.getCellStyle(a,o),t=Ea(r.v,e,d);t.n&&(s.n=t.n)}p.setValue(a,o,{s:Object.keys(s).length>0?s:null})});let m={unitId:o,subUnitId:s,cellValue:(0,n.cloneCellDataMatrix)(p.getMatrix()),isOverrideStyle:!0},h=(0,r.SetRangeValuesUndoMutationFactory)(a,m);return{redo:{id:r.SetRangeValuesMutation.id,params:m},undo:{id:r.SetRangeValuesMutation.id,params:h}}}function Aa(e,t,i){let a=[],o=[],{unitId:s,subUnitId:c,range:l}=e,{startColumn:u,startRow:d,endColumn:f,endRow:p}=(0,r.discreteRangeToRange)(l),m=[];t.forValue((e,t,n)=>{if(n.rowSpan&&n.rowSpan>1){let r=n.colSpan||1,i={startRow:d+e,endRow:d+e+n.rowSpan-1,startColumn:u+t,endColumn:u+t+r-1};m.push(i)}else if(n.colSpan&&n.colSpan>1){let r=n.rowSpan||1,i={startRow:d+e,endRow:d+e+r-1,startColumn:u+t,endColumn:u+t+n.colSpan-1};m.push(i)}});let h=(0,r.getSheetCommandTarget)(i.get(n.IUniverInstanceService),{unitId:s,subUnitId:c});if(h&&h.worksheet){let e=h.worksheet.getMergeData().filter(e=>n.Rectangle.intersects({startRow:d,startColumn:u,endRow:p,endColumn:f},e));if(e.length>0){let t={unitId:s,subUnitId:c,ranges:e};a.push({id:r.RemoveWorksheetMergeMutation.id,params:t});let n=(0,r.RemoveMergeUndoMutationFactory)(i,t);o.push({id:r.AddWorksheetMergeMutation.id,params:n})}}if(m.length>0){let e={unitId:s,subUnitId:c,ranges:m};a.push({id:r.AddWorksheetMergeMutation.id,params:e});let t=(0,r.AddMergeUndoMutationFactory)(i,e);o.unshift({id:r.RemoveWorksheetMergeMutation.id,params:t})}return{redos:a,undos:o}}function ja(e){if(!e.includes(`\r`)&&n.Tools.isLegalUrl(e)){let t=(0,n.generateRandomId)(),r=`${e}`,i={startIndex:0,endIndex:r.length-1,rangeId:t,rangeType:n.CustomRangeType.HYPERLINK,properties:{url:e}};return{dataStream:`${r}\r\n`,paragraphs:[{startIndex:r.length,paragraphId:(0,n.createParagraphId)(/* @__PURE__ */ new Set)}],customRanges:[i]}}let t=e.replace(/(\r\n|\n)/g,`\r`);t.endsWith(`\r
|
|
7
7
|
`)||(t+=`\r
|
|
8
8
|
`);let r=[],i=/* @__PURE__ */ new Set;for(let e=0;e<t.length;e++)t[e]===`\r`&&r.push({startIndex:e,paragraphId:(0,n.createParagraphId)(i)});return{dataStream:t,paragraphs:r,sectionBreaks:[{sectionId:(0,n.createSectionId)(/* @__PURE__ */ new Set),startIndex:t.indexOf(`
|
|
9
|
-
`)}]}}let Ma=[r.InsertColMutation.id,r.InsertRowMutation.id,r.RemoveColMutation.id,r.RemoveRowMutation.id,r.MoveRangeMutation.id,r.MoveRowsMutation.id,r.MoveColsMutation.id],Na=class extends n.RxDisposable{constructor(e,t,n,r,i,a,s,c,l,u,d){super(),this._injector=e,this._instanceService=t,this._renderManagerService=n,this._commandService=r,this._contextService=i,this._configService=a,this._sheetClipboardService=s,this._clipboardInterfaceService=c,this._messageService=l,this._localService=u,this._embedRuntimeFocusCoordinator=d,z(this,`_refreshOptionalPaste$`,new o.Subject),z(this,`refreshOptionalPaste$`,this._refreshOptionalPaste$.asObservable()),this._init(),this._initCommandListener(),this._pasteWithDoc()}refreshOptionalPaste(){this._refreshOptionalPaste$.next(Math.random())}_pasteWithDoc(){var e;let r=e=>{e.onPaste$.pipe((0,o.takeUntil)(this.dispose$)).subscribe(async e=>{var t,n;if(!this._isSheetGridPasteTarget())return;e.event.preventDefault();let r=e.event,i=(t=r.clipboardData)==null?void 0:t.getData(`text/html`),a=(n=r.clipboardData)==null?void 0:n.getData(`text/plain`),o=this._resolveClipboardFiles(r.clipboardData),s=this._sheetClipboardService.capturePasteTarget();if(!s)return;let c=await this._readFormulaClipboardPayload();await this._commandService.executeCommand(Dt.id,{htmlContent:i,textContent:a,files:o,formulaClipboardPayload:c,target:s})}),e==null||e.onKeydown$.subscribe(e=>{e.event.key===`Escape`&&this._sheetClipboardService.removeMarkSelection()})},i=(e=this._renderManagerService.getRenderUnitById(n.DOCS_NORMAL_EDITOR_UNIT_ID_KEY))==null?void 0:e.with(t.DocSelectionRenderService);i&&r(i),this._renderManagerService.created$.subscribe(e=>{if(e.unitId===n.DOCS_NORMAL_EDITOR_UNIT_ID_KEY){var a;i=(a=this._renderManagerService.getRenderUnitById(n.DOCS_NORMAL_EDITOR_UNIT_ID_KEY))==null?void 0:a.with(t.DocSelectionRenderService),i&&r(i)}})}_isSheetGridPasteTarget(){var e,t;if(_(this._contextService))return!0;let r=(e=this._embedRuntimeFocusCoordinator)==null?void 0:e.resolveActiveChildSessionRuntimeScope();return(r==null?void 0:r.childType)!==n.UniverInstanceType.UNIVER_SHEET||!r.childUnitId||this._contextService.getContextValue(n.EDITOR_ACTIVATED)?!1:((t=this._instanceService.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET))==null?void 0:t.getUnitId())===r.childUnitId}_resolveClipboardFiles(e){if(!e)return;let t=Array.from(e.items).map(e=>e.kind===`file`?e.getAsFile():void 0).filter(Boolean);return t.length>0?t:void 0}async _readFormulaClipboardPayload(){if(this._clipboardInterfaceService.supportClipboard)try{let e=(await this._clipboardInterfaceService.read()).find(e=>e.types.includes(pt));return e?(await e.getType(pt)).text():void 0}catch{return}}_init(){[wt,Tt,Et].forEach(e=>this.disposeWithMe(this._commandService.registerMultipleCommand(e))),[At,jt,Mt,Nt,Dt,Pt].forEach(e=>this.disposeWithMe(this._commandService.registerCommand(e))),this.disposeWithMe(this._sheetClipboardService.addClipboardHook(this._initCopyingHooks())),this.disposeWithMe(this._sheetClipboardService.addClipboardHook(this._initPastingRowsHook())),this.disposeWithMe(this._sheetClipboardService.addClipboardHook(this._initPastingColumnsHook())),this.disposeWithMe(this._sheetClipboardService.addClipboardHook(this._initPastingHook()));let e=this._initSpecialPasteHooks().map(e=>this._sheetClipboardService.addClipboardHook(e));this.disposeWithMe({dispose:()=>e.forEach(e=>e.dispose())})}_initCopyingHooks(){let e=this,r=null;return{id:ut.DEFAULT_COPY,isDefaultHook:!0,onBeforeCopy(t,n){r=e._getWorksheet(t,n)},onCopyCellContent(e,i){var a,o;let s=r.getCell(e,i);if(s!=null&&(a=s.p)!=null&&(a=a.body)!=null&&a.paragraphs||s!=null&&(o=s.p)!=null&&(o=o.body)!=null&&o.textRuns)return(0,t.convertBodyToHtml)(s.p);let c=(0,n.extractPureTextFromCell)(s);return c.trim()===``?c:bt(c)},onCopyCellStyle:(e,t,i,a)=>{let o={};(i||a)&&(o.rowspan=`${i||1}`,o.colspan=`${a||1}`);let s=r.getMergedCell(e,t),c=r.getComposedCellStyle(e,t),l=``;if(c&&(l=(0,n.handleStyleToString)(c)),s){let e=s.endRow,t=s.endColumn,i=r.getRange(e,t).getTextStyle();if(i){let e=(0,n.handleStyleToString)(i);l?l+=e?`;${e}`:``:l=e}}return l&&(o.style=l),Object.keys(o).length?o:null},onCopyColumn(e){return{width:`${r.getColumnWidth(e)}`}},onCopyRow(e){return{style:`height: ${r.getRowHeight(e)}px;`}},onAfterCopy(){r=null},getFilteredOutRows(t,n,r){let i=e._getWorksheet(t,n);if(!i)return[];let{startRow:a,endRow:o}=r,s=[];for(let e=a;e<=o;e++)i.getRowFiltered(e)&&s.push(e);return s}}}_initPastingHook(){let e=this;return{id:J.DEFAULT_PASTE,isDefaultHook:!0,onBeforePaste({range:t}){let n=e._configService.getConfig(r.MAX_CELL_PER_SHEET_KEY),i=t.rows[t.rows.length-1],a=t.cols[t.cols.length-1];return n&&i*a>n?(e._messageService.show({type:l.MessageType.Error,content:e._localService.t(`sheets-ui.clipboard.paste.exceedMaxCells`)}),!1):!0},onPastePlainText(t,n,r){return e._onPastePlainText(t,n,r)},onPasteCells(t,n,r,i){return e._onPasteCells(t,n,r,i)}}}_initPastingRowsHook(){let e=this;return{id:J.DEFAULT_PASTE_ROWS,isDefaultHook:!0,onPasteRows(t){let n=[],i=[],{range:a,unitId:o,subUnitId:s}=t,{rows:c,cols:l}=a;if(!c||!l||c.length===0||l.length===0)return{redos:n,undos:i};let u=e._getWorksheet(o,s).getMaxRows()-1,d=c[c.length-1],f=l[0],p=l[l.length-1];if(d-u>0){let e={unitId:o,subUnitId:s,range:{startRow:u+1,endRow:d,startColumn:f,endColumn:p}};n.push({id:r.InsertRowMutation.id,params:e}),i.push({id:r.RemoveRowMutation.id,params:e})}return{redos:n,undos:i}}}}_initPastingColumnsHook(){let e=this;return{id:J.DEFAULT_PASTE_COLUMNS,isDefaultHook:!0,onPasteColumns(t){let n=[],i=[],{range:a,unitId:o,subUnitId:s}=t,{rows:c,cols:l}=a;if(!c||!l||c.length===0||l.length===0)return{redos:n,undos:i};let u=e._getWorksheet(o,s).getMaxColumns()-1,d=c[0],f=c[c.length-1],p=l[l.length-1];if(p-u>0){let e={unitId:o,subUnitId:s,range:{startRow:d,endRow:f,startColumn:u+1,endColumn:p}};n.push({id:r.InsertColMutation.id,params:e}),i.push({id:r.RemoveColMutation.id,params:e})}return{redos:n,undos:i}}}}_generateDocumentDataModelSnapshot(e){var t;if(((t=(0,a.withCurrentTypeOfRenderer)(n.UniverInstanceType.UNIVER_SHEET,q,this._instanceService,this._renderManagerService))==null?void 0:t.getCurrentParam())==null)return null;let r=(0,n.createDocumentModelWithStyle)(``,{}),i={...r==null?void 0:r.getSnapshot(),...e};return r==null||r.reset(i),r==null?void 0:r.getSnapshot()}_onPastePlainText(e,t,i){let{range:a,unitId:o,subUnitId:s}=e,c=this._instanceService.getUnit(o,n.UniverInstanceType.UNIVER_SHEET),l=c?{locale:(0,n.getNumfmtLocaleTag)(c.getSnapshot().locale),dateSystem:c.getDateSystem()}:void 0,u;if(/\r|\n/.test(t)||n.Tools.isLegalUrl(t)){let e=ja(t),n=this._generateDocumentDataModelSnapshot({body:e});u={[a.rows[0]]:{[a.cols[0]]:{p:n,v:null,f:null}}}}else if((0,n.isFormulaString)(t))u={[a.rows[0]]:{[a.cols[0]]:{f:t,ft:null,fd:null,v:null,p:null}}};else{let e=(0,n.getNumfmtParseValueFilter)(t,l);u=e!=null&&e.z?{[a.rows[0]]:{[a.cols[0]]:{v:e.v,s:{n:{pattern:e.z}},f:null}}}:{[a.rows[0]]:{[a.cols[0]]:{v:t,f:null}}}}let d={unitId:o,subUnitId:s,cellValue:u};return{redos:[{id:r.SetRangeValuesMutation.id,params:d}],undos:[{id:r.SetRangeValuesMutation.id,params:(0,r.SetRangeValuesUndoMutationFactory)(this._injector,d)}]}}_onPasteCells(e,t,n,r){return this._injector.invoke(i=>wa(e,t,n,r,i))}_initSpecialPasteHooks(){let e=this;return[{id:J.SPECIAL_PASTE_VALUE,specialPasteInfo:{label:`specialPaste.value`},onPasteCells:(e,t,n)=>this._injector.invoke(r=>{let{redo:i,undo:a}=Oa(t,e,n,r);return{redos:[i],undos:[a]}})},{id:J.SPECIAL_PASTE_FORMAT,specialPasteInfo:{label:`specialPaste.format`},onPasteCells:(e,t,n)=>{let r=[],i=[],{redo:a,undo:o}=this._injector.invoke(r=>ka(t,e,n,r));r.push(a),i.push(o);let{undos:s,redos:c}=this._injector.invoke(e=>Aa(t,n,e));return r.push(...c),i.push(...s),{undos:i,redos:r}}},{id:J.SPECIAL_PASTE_COL_WIDTH,specialPasteInfo:{label:`specialPaste.colWidth`},onPasteCells(){return{undos:[],redos:[]}},onPasteColumns(t,i,a){let o=[],s=[];if(a.pasteType!==J.SPECIAL_PASTE_COL_WIDTH)return{redos:o,undos:s};let{range:c,unitId:l,subUnitId:u}=t,{rows:d,cols:f}=c;if(!d||!f||d.length===0||f.length===0)return{redos:o,undos:s};let p=e._getWorksheet(l,u),m=e._configService.getConfig(n.DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY)??n.DEFAULT_WORKSHEET_COLUMN_WIDTH,h=d[0],g=d[d.length-1],_=f[0],v=f[f.length-1],y=i.length;if(y>0){let e={};for(let t=_;t<=v;t++){let n=i[(t-_)%y];n.width&&Number(n.width)!==m&&(e[t]=Number(n.width))}let t={unitId:l,subUnitId:u,ranges:[{startRow:h,endRow:g,startColumn:_,endColumn:v}],colWidth:e};o.push({id:r.SetWorksheetColWidthMutation.id,params:t}),s.unshift({id:r.SetWorksheetColWidthMutation.id,params:(0,r.SetWorksheetColWidthMutationFactory)(t,p)})}return{redos:o,undos:s}}},{id:J.SPECIAL_PASTE_BESIDES_BORDER,specialPasteInfo:{label:`specialPaste.besidesBorder`},onPasteCells:(t,i,a,o)=>{e._instanceService.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET);let s=[],c=[],{range:l,unitId:u,subUnitId:d}=i,f=new n.ObjectMatrix;a.forValue((e,t,r)=>{let i=r.s;if(typeof i==`object`){let a=n.Tools.deepClone(r);a.s&&={...i,bd:null},f.setValue(l.rows[e],l.cols[t],a)}});let p={unitId:u,subUnitId:d,cellValue:f.clone()};s.push({id:r.SetRangeValuesMutation.id,params:p});let m=this._injector.invoke(r.SetRangeValuesUndoMutationFactory,p);c.push({id:r.SetRangeValuesMutation.id,params:m});let{undos:h,redos:g}=this._injector.invoke(e=>Aa(i,a,e));return c.push(...h),s.push(...g),{redos:s,undos:c}}}]}_getWorksheet(e,t){var r;let i=(r=this._instanceService.getUnit(e,n.UniverInstanceType.UNIVER_SHEET))==null?void 0:r.getSheetBySheetId(t);if(!i)throw Error(`[SheetClipboardController]: cannot find a worksheet with unitId ${e} and subUnitId ${t}.`);return i}_initCommandListener(){var e;this.disposeWithMe(this._commandService.onCommandExecuted(e=>{(e.id===r.AddWorksheetMergeCommand.id||Ma.includes(e.id))&&this._sheetClipboardService.removeMarkSelection()}));let t=this._configService.getConfig(U);t!=null&&(e=t.clipboardConfig)!=null&&e.hidePasteOptions||(this.disposeWithMe(this._commandService.onCommandExecuted(e=>{Ci.includes(e.id)&&this._sheetClipboardService.disposePasteOptionsCache()})),this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(e.id===ur.id){if(!this._sheetClipboardService.getPasteMenuVisible())return;let t=e.params.unitId,n=this._sheetClipboardService.getPasteOptionsCache();t===(n==null?void 0:n.target.unitId)&&this._refreshOptionalPaste$.next(Math.random())}})))}};Na=K([G(0,(0,n.Inject)(n.Injector)),G(1,n.IUniverInstanceService),G(2,a.IRenderManagerService),G(3,n.ICommandService),G(4,n.IContextService),G(5,n.IConfigService),G(6,gt),G(7,i.IClipboardInterfaceService),G(8,i.IMessageService),G(9,(0,n.Inject)(n.LocaleService)),G(10,(0,n.Optional)(gi))],Na);let Pa=class extends n.Disposable{constructor(e,t){super(),this._univerInstanceService=e,this._renderManagerService=t,z(this,`_currentCell$`,new o.Subject),z(this,`currentCell$`,this._currentCell$.asObservable().pipe((0,o.distinctUntilChanged)((e,t)=>{var n,r,i,a,o,s,c,l;return(e==null||(n=e.location)==null?void 0:n.unitId)===(t==null||(r=t.location)==null?void 0:r.unitId)&&(e==null||(i=e.location)==null?void 0:i.subUnitId)===(t==null||(a=t.location)==null?void 0:a.subUnitId)&&(e==null||(o=e.location)==null?void 0:o.row)===(t==null||(s=t.location)==null?void 0:s.row)&&(e==null||(c=e.location)==null?void 0:c.col)===(t==null||(l=t.location)==null?void 0:l.col)}))),z(this,`_endCell$`,new o.Subject),z(this,`endCell$`,this._endCell$.asObservable()),this._initCellDisposableListener()}dispose(){super.dispose(),this._currentCell$.complete(),this._endCell$.complete()}_initCellDisposableListener(){this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET).subscribe(e=>{e||(this._currentCell$.next(null),this._endCell$.next(null))}))}_calcActiveCell(e,t){let r=this._univerInstanceService.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET);if(!r)return null;let i=r.getActiveSheet();if(!i)return;let a=this._renderManagerService.getRenderUnitById(r.getUnitId());if(!a)return;let o=a.with(q).getCurrentParam(),s=a.with(Gn).getCurrentScrollState();if(o&&s&&a)return Dr(a,r,i,o,e,t)}onDragOver(e){let{offsetX:t,offsetY:n,dataTransfer:r}=e,i=this._calcActiveCell(t,n);if(!i){this._currentCell$.next(null);return}let{location:a,position:o}=i;this._currentCell$.next({location:a,position:o,dataTransfer:r})}onDrop(e){let{offsetX:t,offsetY:n,dataTransfer:r}=e,i=this._calcActiveCell(t,n);if(!i){this._endCell$.next(null);return}let{location:a,position:o}=i;this._endCell$.next({location:a,position:o,dataTransfer:r})}};Pa=K([G(0,n.IUniverInstanceService),G(1,a.IRenderManagerService)],Pa);let Fa=class extends n.Disposable{constructor(e,t,n,r){super(),this._context=e,this._renderManagerService=t,this._dragManagerService=n,this._sheetSkeletonManagerService=r,this._initDragEvent()}_initDragEvent(){let e=new n.DisposableCollection,t=t=>{if(e.dispose(),!t)return;let{scene:n}=this._context,r=n.onDragOver$.subscribeEvent(e=>{this._dragManagerService.onDragOver(e)}),i=n.onDrop$.subscribeEvent(e=>{this._dragManagerService.onDrop(e)});e.add({dispose(){r.unsubscribe(),i.unsubscribe()}})};t(this._sheetSkeletonManagerService.getCurrentParam()),this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.subscribe(e=>{t(e)}))}};Fa=K([G(1,a.IRenderManagerService),G(2,(0,n.Inject)(Pa)),G(3,(0,n.Inject)(q))],Fa);var Ia=class extends n.Disposable{constructor(...e){super(...e),z(this,`_position`,null),z(this,`_position$`,new o.BehaviorSubject(null)),z(this,`position$`,this._position$.asObservable()),z(this,`_focus`,!1),z(this,`_focus$`,new o.BehaviorSubject(this._focus)),z(this,`focus$`,this._focus$.asObservable()),z(this,`_fxBtnClick$`,new o.Subject),z(this,`fxBtnClick$`,this._fxBtnClick$.asObservable()),z(this,`_foldBtnStatus$`,new o.Subject),z(this,`foldBtnStatus$`,this._foldBtnStatus$.asObservable())}dispose(){super.dispose(),this._position$.complete(),this._focus$.complete(),this._position=null,this._focus=!1}setPosition(e){this._position=e,this._refresh(e)}getPosition(){return this._position}setFocus(e=!1){this._focus=e,this._focus$.next(e)}handleFxBtnClick(e){this._fxBtnClick$.next(e)}handleFoldBtnClick(e){this._foldBtnStatus$.next(e)}_refresh(e){this._position$.next(e)}};let La=(0,n.createIdentifier)(`univer.sheet-formula-editor-manager.service`),Ra=class extends n.RxDisposable{constructor(e,t,n,r,i,a,o,s,c){super(),this._univerInstanceService=e,this._renderManagerService=t,this._editorBridgeService=n,this._commandService=r,this._contextService=i,this._formulaEditorManagerService=a,this._undoRedoService=o,this._textSelectionManagerService=s,this._editorService=c,z(this,`_loadedMap`,/* @__PURE__ */ new WeakSet),z(this,`_scheduledCallback`,-1),this._initialize()}_initialize(){this._syncEditorSize(),this._listenFxBtnClick(),this._handleContentChange(),this._univerInstanceService.focused$.pipe((0,o.takeUntil)(this.dispose$)).subscribe(e=>{this._create(e)}),this._create(n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY),this.disposeWithMe(this._editorService.focus$.subscribe(()=>{this._syncFxBarFocusContext()}))}_syncFxBarFocusContext(){var e;((e=this._editorService.getFocusEditor())==null?void 0:e.getEditorId())===n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY?this._contextService.setContextValue(n.FOCUSING_FX_BAR_EDITOR,!0):this._contextService.getContextValue(n.FOCUSING_FX_BAR_EDITOR)&&this._contextService.getContextValue(n.EDITOR_ACTIVATED)||this._contextService.setContextValue(n.FOCUSING_FX_BAR_EDITOR,!1)}_handleContentChange(){this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(e.id===s.RichTextEditingMutation.id){let{unitId:t}=e.params;t===n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY&&this.autoScroll()}}))}_create(e){if(e!==n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY)return;let t=this._renderManagerService.getRenderUnitById(e);if(t==null)return;let{mainComponent:r}=t;r!=null&&(this._loadedMap.has(r)||this._loadedMap.add(r))}_listenFxBtnClick(){this._formulaEditorManagerService.fxBtnClick$.pipe((0,o.takeUntil)(this.dispose$)).subscribe(e=>{if(this._contextService.getContextValue(n.FOCUSING_UNIVER_EDITOR)&&!this._contextService.getContextValue(n.EDITOR_ACTIVATED)||e){var r;this._univerInstanceService.setCurrentUnitForType(n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY);let e=this._univerInstanceService.getUnit(n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY,n.UniverInstanceType.UNIVER_DOC);this._editorBridgeService.isVisible().visible===!1&&this._commandService.syncExecuteCommand(X.id,{visible:!0,eventType:a.DeviceInputEventType.PointerDown,unitId:n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY});let i=e==null||(r=e.getBody())==null?void 0:r.dataStream;if(i==null)return;let o=i.startsWith(`=`)?i:`=${i}`;o=o.replace(/\r\n$/,``);let s=[{startOffset:o.length,endOffset:o.length}],c={unitId:n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY,body:{dataStream:o},segmentId:``,textRanges:s};this._commandService.syncExecuteCommand(t.CoverContentCommand.id,c),requestAnimationFrame(()=>{this._textSelectionManagerService.replaceDocRanges([],{unitId:n.DOCS_NORMAL_EDITOR_UNIT_ID_KEY,subUnitId:n.DOCS_NORMAL_EDITOR_UNIT_ID_KEY}),this._textSelectionManagerService.replaceDocRanges(s,{unitId:n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY,subUnitId:n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY}),this._contextService.setContextValue(n.FOCUSING_FX_BAR_EDITOR,!0)})}})}_syncEditorSize(){let e=this._univerInstanceService.unitAdded$.pipe((0,o.filter)(e=>e.unit.getUnitId()===n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY));this.disposeWithMe((0,o.combineLatest)([this._formulaEditorManagerService.position$,e]).subscribe(([e])=>{if(!e)return this._clearScheduledCallback();let t=h(n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY,this._renderManagerService),r=this._univerInstanceService.getUnit(n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY,n.UniverInstanceType.UNIVER_DOC);if(t==null||r==null)return this._clearScheduledCallback();let{width:i,height:a}=e;if(i===0||a===0)return this._clearScheduledCallback();let{engine:o}=t;r.updateDocumentDataPageSize(i),this.autoScroll(),this._scheduledCallback=requestIdleCallback(()=>o.resizeBySize(i,a))}))}_clearScheduledCallback(){this._scheduledCallback!==-1&&cancelIdleCallback(this._scheduledCallback),this._scheduledCallback=-1}autoScroll(){var e;let r=this._formulaEditorManagerService.getPosition(),i=(e=this._renderManagerService.getRenderUnitById(n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY))==null?void 0:e.with(s.DocSkeletonManagerService).getSkeleton(),o=this._renderManagerService.getRenderUnitById(n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY),c=this._univerInstanceService.getUnit(n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY,n.UniverInstanceType.UNIVER_DOC);if(i==null||r==null||o==null||c==null)return;let{marginTop:l=0,marginBottom:u=0}=c.getSnapshot().documentStyle,{scene:d,mainComponent:f}=o,{actualHeight:p}=i.getActualSize();p+=l+u;let{width:m,height:h}=r,g=d.getViewport(t.VIEWPORT_KEY.VIEW_MAIN),_=g==null?void 0:g.getScrollBar();if(d.transformByState({width:m,height:p}),f==null||f.resize(m,p),p>h)_==null?g&&new a.ScrollBar(g,{enableHorizontal:!1,barSize:8}):g==null||g.resetCanvasSizeAndUpdateScroll();else{var v;_=null,g==null||g.scrollToViewportPos({viewportScrollX:0,viewportScrollY:0}),g==null||(v=g.getScrollBar())==null||v.dispose()}}};Ra=K([G(0,n.IUniverInstanceService),G(1,a.IRenderManagerService),G(2,Y),G(3,n.ICommandService),G(4,n.IContextService),G(5,La),G(6,n.IUndoRedoService),G(7,(0,n.Inject)(s.DocSelectionManagerService)),G(8,t.IEditorService)],Ra);let za=`embedding_formula_editor`,Ba=e=>e.includes(za),Va=(e,n)=>{let r=n.findNodePositionByCharIndex(e.startOffset,!0,e.segmentId,-1),i=n.getSkeletonData(),a=e.endOffset;if(e.segmentId){var o,s;let t=Array.from((i==null||(o=i.skeFooters.get(e.segmentId))==null?void 0:o.values())??[])[0]??Array.from((i==null||(s=i.skeHeaders.get(e.segmentId))==null?void 0:s.values())??[])[0];t&&(a=Math.min(t.ed,a))}let c=n.findNodePositionByCharIndex(a,!0,e.segmentId,-1);if(!c||!r)return;let{borderBoxPointGroup:l}=new t.NodePositionConvertToCursor({docsLeft:0,docsTop:0,pageMarginLeft:0,pageMarginTop:0},n).getRangePointData(r,c);return(0,t.getLineBounding)(l).map(e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right}))},Ha=(e,n,r=-1)=>{let i=n.findPositionByGlyph(e,r);if(!i)return;let a={...i,isBack:!0},{borderBoxPointGroup:o}=new t.NodePositionConvertToCursor({docsLeft:0,docsTop:0,pageMarginLeft:0,pageMarginTop:0},n).getRangePointData(a,a),s=(0,t.getLineBounding)(o)[0];if(s)return{top:s.top,bottom:s.bottom,left:s.left,right:s.right}},Ua=(e,t,n=0,r=0)=>{let i=Va({startOffset:t.startIndex,endOffset:t.endIndex+1,collapsed:!1},e);if(i)return{rects:i.map(e=>({top:e.top+r,bottom:e.bottom+r,left:e.left+n,right:e.right+n})),range:t}},Wa=(e,t,n=0,r=0)=>{var i;let a=e.findNodeByCharIndex(t.startIndex),o=a==null?void 0:a.parent,s=o==null?void 0:o.parent,c=s==null?void 0:s.parent,l=c==null?void 0:c.lines.find(e=>e.paragraphStart&&e.paragraphIndex===t.startIndex),u=l==null||(i=l.divides)==null||(i=i[0])==null||(i=i.glyphGroup)==null?void 0:i[0];if(!u||!u)return;let d=Ha(u,e);if(d)return{rect:{top:d.top+r,bottom:d.bottom+r,left:d.left+n,right:d.right+n},segmentId:void 0,segmentPageIndex:-1,paragraph:t}},Ga=(e,t=0,r=0)=>{var i,a,o;let s=e.getViewModel().getDataModel(),c=((i=s.getBody())==null||(i=i.customRanges)==null?void 0:i.filter(e=>e.rangeType===n.CustomRangeType.HYPERLINK))??[],l=((a=s.getBody())==null||(a=a.paragraphs)==null?void 0:a.filter(e=>{var t;return((t=e.bullet)==null?void 0:t.listType.indexOf(n.PresetListType.CHECK_LIST))===0}))??[],u=(o=e.getSkeletonData())==null?void 0:o.pages[0].skeDrawings;return{links:c.map(n=>Ua(e,n,t,r)).filter(Boolean),checkLists:l.map(n=>Wa(e,n,t,r)).filter(Boolean),drawings:u?Array.from(u.keys()).map(e=>({drawingId:e,rect:{top:u.get(e).aTop,bottom:u.get(e).aTop+u.get(e).height,left:u.get(e).aLeft,right:u.get(e).aLeft+u.get(e).width},drawing:u.get(e)})):[]}};function Ka(e,t,r){var i,a;let o=((i=t.documentSkeleton)==null||(i=i.getSkeletonData())==null?void 0:i.pages[0].height)??0,s=((a=t.documentSkeleton)==null||(a=a.getSkeletonData())==null?void 0:a.pages[0].width)??0,c=t.verticalAlign,l=t.horizontalAlign,u=0;switch(c){case n.VerticalAlign.UNSPECIFIED:case n.VerticalAlign.BOTTOM:u=e.mergeInfo.endY-e.mergeInfo.startY-o;break;case n.VerticalAlign.MIDDLE:u=(e.mergeInfo.endY-e.mergeInfo.startY-o)/2}let d=0;switch(l){case n.HorizontalAlign.RIGHT:d=e.mergeInfo.endX-e.mergeInfo.startX-s;break;case n.HorizontalAlign.CENTER:d=(e.mergeInfo.endX-e.mergeInfo.startX-s)/2;break;case n.HorizontalAlign.UNSPECIFIED:r&&(d=e.mergeInfo.endX-e.mergeInfo.startX-s)}return{paddingLeft:d,paddingTop:u}}let qa=(e,r,i,o,s,c)=>{var l;let u=e.get(n.IUniverInstanceService),d=e.get(a.IRenderManagerService),f=u.getUnit(r,n.UniverInstanceType.UNIVER_SHEET);if(!f)return null;let p=f.getSheetBySheetId(i);if(!p)return null;let m=d.getRenderUnitById(f.getUnitId()),h=m==null?void 0:m.with(q).getSkeletonParam(p.getSheetId()),g=h==null?void 0:h.skeleton;if(!g||!m)return;let _=g.getFont(o,s),v=_==null?void 0:_.documentSkeleton;if(!v)return null;let y=(l=v.getViewModel().getBody())==null||(l=l.customRanges)==null?void 0:l.find(e=>e.rangeId===c);if(!y)return null;let b=t.DOC_VERTICAL_PADDING,{actualColumn:x,actualRow:S}=g.getCellWithCoordByIndex(o,s);g.overflowCache.forValue((e,t,n)=>{n.startRow<=S&&n.endRow>=S&&n.startColumn<=x&&n.endColumn>=x&&(x=t,S=e)});let C=g.getCellWithCoordByIndex(S,x),w=p.getCell(C.actualRow,C.actualColumn),{topOffset:T=0,leftOffset:E=0}=(w==null?void 0:w.fontRenderExtension)??{},{paddingLeft:D,paddingTop:O}=Ka(C,_,!1),k=Va({startOffset:y.startIndex,endOffset:y.endIndex,collapsed:!1},v);return{rects:k==null?void 0:k.map(e=>({top:e.top+C.mergeInfo.startY+O+T+b,bottom:e.bottom+C.mergeInfo.startY+O+T+b,left:e.left+C.mergeInfo.startX+D+E,right:e.right+C.mergeInfo.startX+D+E})),customRange:y,label:v.getViewModel().getBody().dataStream.slice(y.startIndex,y.endIndex+1)}},Ja=(e,t,n,r,i,o)=>{var c,l;let u=e.get(Y),d=u.getEditCellState();if(!d||!u.isVisible().visible)return null;let{editorUnitId:f,unitId:p,sheetId:m,row:h,column:g}=d;if(t!==p||n!==m||h!==r||g!==i)return null;let _=e.get(a.IRenderManagerService),v=_.getRenderUnitById(f),y=_.getRenderUnitById(t);if(!v||!y)return null;let b=v.with(s.DocSkeletonManagerService).getSkeleton(),x=(c=y.with(q).getSkeletonParam(m))==null?void 0:c.skeleton;if(!b||!x)return null;let S=(l=b.getViewModel().getBody())==null||(l=l.customRanges)==null?void 0:l.find(e=>e.rangeId===o);if(!S)return null;let C=Va({startOffset:S.startIndex,endOffset:S.endIndex,collapsed:!1},b),w=v.engine.getCanvasElement().getBoundingClientRect();return{rects:C==null?void 0:C.map(e=>({top:e.top+w.top-4,bottom:e.bottom+w.top+4,left:e.left+w.left,right:e.right+w.left})),customRange:S,label:b.getViewModel().getBody().dataStream.slice(S.startIndex,S.endIndex+1)}};function Ya(e){let{workbook:t,worksheet:n,...r}=e;return r}function Xa(e,t,n){var r;let i=(r=e.documentSkeleton)==null?void 0:r.getViewModel().getDataModel().getDrawings(),o={left:0,top:0,right:t.mergeInfo.endX-t.mergeInfo.startX,bottom:t.mergeInfo.endY-t.mergeInfo.startY};return n.map(t=>{var n,r,s;let c=i==null?void 0:i[t.drawingId],l=(c==null||(n=c.docTransform)==null?void 0:n.size.width)??t.drawing.width,u=(c==null||(r=c.docTransform)==null?void 0:r.size.height)??t.drawing.height;return{...t,rect:(0,a.calculateCellImageRect)({cellRect:o,imageWidth:l,imageHeight:u,horizontalAlign:e.horizontalAlign,verticalAlign:e.verticalAlign,padding:(s=e.style)==null?void 0:s.pd})}})}let Za=class extends n.Disposable{constructor(e,t){super(),this._univerInstanceService=e,this._renderManagerService=t,z(this,`_currentCell$`,new o.BehaviorSubject(null)),z(this,`_currentRichText$`,new o.BehaviorSubject(null)),z(this,`_currentClickedCell$`,new o.Subject),z(this,`_currentDbClickedCell$`,new o.Subject),z(this,`_currentCellWithEvent$`,new o.Subject),z(this,`_currentPointerDownCell$`,new o.Subject),z(this,`_currentPointerUpCell$`,new o.Subject),z(this,`_currentHoveredRowHeader$`,new o.BehaviorSubject(null)),z(this,`_currentHoveredColHeader$`,new o.BehaviorSubject(null)),z(this,`_currentRowHeaderClick$`,new o.Subject),z(this,`_currentColHeaderClick$`,new o.Subject),z(this,`_currentRowHeaderDbClick$`,new o.Subject),z(this,`_currentColHeaderDbClick$`,new o.Subject),z(this,`_currentRowHeaderPointerDown$`,new o.Subject),z(this,`_currentColHeaderPointerDown$`,new o.Subject),z(this,`_currentRowHeaderPointerUp$`,new o.Subject),z(this,`_currentColHeaderPointerUp$`,new o.Subject),z(this,`currentCell$`,this._currentCell$.asObservable().pipe((0,o.distinctUntilChanged)((e,t)=>{var n,r,i,a,o,s,c,l;return(e==null||(n=e.location)==null?void 0:n.unitId)===(t==null||(r=t.location)==null?void 0:r.unitId)&&(e==null||(i=e.location)==null?void 0:i.subUnitId)===(t==null||(a=t.location)==null?void 0:a.subUnitId)&&(e==null||(o=e.location)==null?void 0:o.row)===(t==null||(s=t.location)==null?void 0:s.row)&&(e==null||(c=e.location)==null?void 0:c.col)===(t==null||(l=t.location)==null?void 0:l.col)}))),z(this,`currentRichTextNoDistinct$`,this._currentRichText$.pipe((0,o.map)(e=>e&&{unitId:e.location.unitId,subUnitId:e.location.subUnitId,row:e.location.row,col:e.location.col,customRange:e.customRange,bullet:e.bullet,rect:e.rect,drawing:e.drawing}))),z(this,`currentRichText$`,this._currentRichText$.pipe((0,o.distinctUntilChanged)((e,t)=>{var n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y;return(e==null||(n=e.location)==null?void 0:n.unitId)===(t==null||(r=t.location)==null?void 0:r.unitId)&&(e==null||(i=e.location)==null?void 0:i.subUnitId)===(t==null||(a=t.location)==null?void 0:a.subUnitId)&&(e==null||(o=e.location)==null?void 0:o.row)===(t==null||(s=t.location)==null?void 0:s.row)&&(e==null||(c=e.location)==null?void 0:c.col)===(t==null||(l=t.location)==null?void 0:l.col)&&(e==null||(u=e.customRange)==null?void 0:u.rangeId)===(t==null||(d=t.customRange)==null?void 0:d.rangeId)&&(e==null||(f=e.bullet)==null?void 0:f.startIndex)===(t==null||(p=t.bullet)==null?void 0:p.startIndex)&&(e==null||(m=e.customRange)==null?void 0:m.startIndex)===(t==null||(h=t.customRange)==null?void 0:h.startIndex)&&(e==null||(g=e.customRange)==null?void 0:g.endIndex)===(t==null||(_=t.customRange)==null?void 0:_.endIndex)&&(e==null||(v=e.drawing)==null?void 0:v.drawingId)===(t==null||(y=t.drawing)==null?void 0:y.drawingId)}),(0,o.map)(e=>e&&{unitId:e.location.unitId,subUnitId:e.location.subUnitId,row:e.location.row,col:e.location.col,customRange:e.customRange,bullet:e.bullet,rect:e.rect,drawing:e.drawing}))),z(this,`currentCellPosWithEvent$`,this._currentCellWithEvent$.pipe((0,o.distinctUntilChanged)((e,t)=>{var n,r,i,a,o,s,c,l;return(e==null||(n=e.location)==null?void 0:n.unitId)===(t==null||(r=t.location)==null?void 0:r.unitId)&&(e==null||(i=e.location)==null?void 0:i.subUnitId)===(t==null||(a=t.location)==null?void 0:a.subUnitId)&&(e==null||(o=e.location)==null?void 0:o.row)===(t==null||(s=t.location)==null?void 0:s.row)&&(e==null||(c=e.location)==null?void 0:c.col)===(t==null||(l=t.location)==null?void 0:l.col)}),(0,o.map)(e=>e&&{unitId:e.location.unitId,subUnitId:e.location.subUnitId,row:e.location.row,col:e.location.col,event:e.event}))),z(this,`currentPosition$`,this._currentCell$.asObservable()),z(this,`currentClickedCell$`,this._currentClickedCell$.asObservable()),z(this,`currentDbClickedCell$`,this._currentDbClickedCell$.asObservable()),z(this,`currentPointerDownCell$`,this._currentPointerDownCell$.asObservable()),z(this,`currentPointerUpCell$`,this._currentPointerUpCell$.asObservable()),z(this,`currentHoveredRowHeader$`,this._currentHoveredRowHeader$.asObservable()),z(this,`currentHoveredColHeader$`,this._currentHoveredColHeader$.asObservable()),z(this,`currentRowHeaderClick$`,this._currentRowHeaderClick$.asObservable()),z(this,`currentColHeaderClick$`,this._currentColHeaderClick$.asObservable()),z(this,`currentRowHeaderDbClick$`,this._currentRowHeaderDbClick$.asObservable()),z(this,`currentColHeaderDbClick$`,this._currentColHeaderDbClick$.asObservable()),z(this,`currentRowHeaderPointerDown$`,this._currentRowHeaderPointerDown$.asObservable()),z(this,`currentColHeaderPointerDown$`,this._currentColHeaderPointerDown$.asObservable()),z(this,`currentRowHeaderPointerUp$`,this._currentRowHeaderPointerUp$.asObservable()),z(this,`currentColHeaderPointerUp$`,this._currentColHeaderPointerUp$.asObservable()),this._initCellDisposableListener()}dispose(){super.dispose(),this._currentCell$.complete(),this._currentClickedCell$.complete(),this._currentPointerDownCell$.complete(),this._currentPointerUpCell$.complete(),this._currentCellWithEvent$.complete(),this._currentRichText$.complete(),this._currentDbClickedCell$.complete(),this._currentHoveredRowHeader$.complete(),this._currentHoveredColHeader$.complete(),this._currentRowHeaderClick$.complete(),this._currentColHeaderClick$.complete(),this._currentRowHeaderDbClick$.complete(),this._currentColHeaderDbClick$.complete(),this._currentRowHeaderPointerDown$.complete(),this._currentColHeaderPointerDown$.complete(),this._currentRowHeaderPointerUp$.complete(),this._currentColHeaderPointerUp$.complete(),this.currentCellPosWithEvent$=(0,o.of)(null),this.currentRichText$=(0,o.of)(null)}_initCellDisposableListener(){this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET).subscribe(e=>{e||this._currentCell$.next(null)})),this.disposeWithMe(this._univerInstanceService.unitDisposed$.subscribe(e=>{var t,n;((t=this._currentCell$.getValue())==null?void 0:t.location.unitId)===e.getUnitId()&&this._currentCell$.next(null),((n=this._currentRichText$.getValue())==null?void 0:n.location.unitId)===e.getUnitId()&&this._currentRichText$.next(null)}))}_getCalcDeps(e){let t=this._univerInstanceService.getUnit(e,n.UniverInstanceType.UNIVER_SHEET);if(!t)return null;let r=t.getActiveSheet();if(!r)return null;let i=this._renderManagerService.getRenderUnitById(t.getUnitId());if(!i)return null;let a=i.with(q).getSkeletonParam(r.getSheetId());if(!a)return null;let o=i.with(Gn);if(o!=null&&o.getCurrentScrollState()&&i)return{currentRender:i,workbook:t,worksheet:r,skeletonParam:a}}_calcActiveCell(e,t,r,i,a,o){let s=Dr(e,t,r,i,a,o),c=i.skeleton;if(!s)return null;let{position:l,overflowLocation:u,location:d}=s,f=c.getFont(u.row,u.col),p=null,m=null,h=null,g=c.getCellWithCoordByIndex(u.row,u.col),_=r.getCell(u.row,u.col),{topOffset:v=0,leftOffset:y=0}=(_==null?void 0:_.fontRenderExtension)??{};if(f!=null&&f.documentSkeleton){let{paddingLeft:e,paddingTop:t}=Ka(g,f,_!=null&&_.p?!1:(0,n.isRealNum)(_==null?void 0:_.v)&&(!(_!=null&&_.t)||_.t===n.CellValueType.NUMBER)),r=Ga(f.documentSkeleton,e,t),i=Xa(f,g,r.drawings),s=a-l.startX-y,c=o-l.startY-v;p=r.links.find(e=>e.rects.some(e=>e.left<=s&&s<=e.right&&e.top<=c&&c<=e.bottom)),m=r.checkLists.find(e=>e.rect.left<=s&&s<=e.rect.right&&e.rect.top<=c&&c<=e.rect.bottom),h=i.find(e=>e.rect.left<=s&&s<=e.rect.right&&e.rect.top<=c&&c<=e.rect.bottom)}let b=(p==null?void 0:p.rects.pop())??(m==null?void 0:m.rect)??(h==null?void 0:h.rect),x=b&&(()=>{let e=b.top+g.mergeInfo.startY+v,t=b.bottom+g.mergeInfo.startY+v,n=b.left+g.mergeInfo.startX+y,r=b.right+g.mergeInfo.startX+y,i=g.mergeInfo.startY+v,a=g.mergeInfo.endY+v,o=g.mergeInfo.startX+y,s=g.mergeInfo.endX+y;return{top:Math.min(Math.max(e,i),i),bottom:Math.min(t,a),left:Math.min(Math.max(n,o),o),right:Math.min(r,s)}})();return{location:d,position:l,overflowLocation:u,customRange:p==null?void 0:p.range,bullet:m==null?void 0:m.paragraph,drawing:h,rect:x}}_calcActiveRowHeader(e,t,n){let r=this._getCalcDeps(e);if(!r)return;let{currentRender:i,worksheet:o,skeletonParam:s}=r,{scaleY:c}=i.scene.getAncestorScale(),l=i.scene.getViewports().find(e=>e.isHit(new a.Vector2(t,n)));if(!l||l.viewportKey!==a.SHEET_VIEWPORT_KEY.VIEW_ROW_TOP&&l.viewportKey!==a.SHEET_VIEWPORT_KEY.VIEW_ROW_BOTTOM)return;let u={x:l.viewportScrollX,y:l.viewportScrollY};return{unitId:e,index:s.skeleton.getRowIndexByOffsetY(n,c,u),subUnitId:o.getSheetId()}}_calcActiveColHeader(e,t,n){let r=this._getCalcDeps(e);if(!r)return;let{currentRender:i,worksheet:o,skeletonParam:s}=r,{scaleX:c}=i.scene.getAncestorScale(),l=i.scene.getViewports().find(e=>e.isHit(new a.Vector2(t,n)));if(!l||l.viewportKey!==a.SHEET_VIEWPORT_KEY.VIEW_COLUMN_LEFT&&l.viewportKey!==a.SHEET_VIEWPORT_KEY.VIEW_COLUMN_RIGHT)return;let u={x:l.viewportScrollX,y:l.viewportScrollY};return{unitId:e,index:s.skeleton.getColumnIndexByOffsetX(t,c,u),subUnitId:o.getSheetId()}}triggerPointerDown(e,t){let n=this._getCalcDeps(e);if(!n)return;let{currentRender:r,workbook:i,worksheet:a,skeletonParam:o}=n,s=this._calcActiveCell(r,i,a,o,t.offsetX,t.offsetY);if(s&&s.location){let{unitId:e,subUnitId:n,row:r,col:i}=Ya(s.location);this._currentPointerDownCell$.next({unitId:e,subUnitId:n,row:r,col:i,event:t})}}triggerPointerUp(e,t){let n=this._getCalcDeps(e);if(!n)return;let{currentRender:r,workbook:i,worksheet:a,skeletonParam:o}=n,s=this._calcActiveCell(r,i,a,o,t.offsetX,t.offsetY);if(s){let e=Ya(s.location);this._currentPointerUpCell$.next({...e,event:t})}}triggerMouseMove(e,t){let n=this._getCalcDeps(e);if(!n)return;let{currentRender:r,workbook:i,worksheet:a,skeletonParam:o}=n,s=this._calcActiveCell(r,i,a,o,t.offsetX,t.offsetY);this._currentCell$.next(s&&{location:Ya(s.location),position:s.position}),this._currentRichText$.next(s&&{...s,location:Ya(s.overflowLocation)}),this._currentCellWithEvent$.next(s&&{...s,location:Ya(s.location),event:t})}triggerClick(e,t,n){let r=this._getCalcDeps(e);if(!r)return;let{currentRender:i,workbook:a,worksheet:o,skeletonParam:s}=r,c=this._calcActiveCell(i,a,o,s,t,n);c&&this._currentClickedCell$.next({...c,location:Ya(c.location)})}triggerDbClick(e,t){let n=this._getCalcDeps(e);if(!n)return;let{currentRender:r,workbook:i,worksheet:a,skeletonParam:o}=n,s=this._calcActiveCell(r,i,a,o,t.offsetX,t.offsetY);s&&this._currentDbClickedCell$.next({...s,location:Ya(s.location),event:t})}triggerMouseLeave(){this._currentCell$.next(null)}triggerScroll(){this._currentCell$.next(null)}triggerRowHeaderClick(e,t,n){let r=this._calcActiveRowHeader(e,t,n);r&&this._currentRowHeaderClick$.next(r)}triggerColHeaderClick(e,t,n){let r=this._calcActiveColHeader(e,t,n);r&&this._currentColHeaderClick$.next(r)}triggerRowHeaderDbClick(e,t,n){let r=this._calcActiveRowHeader(e,t,n);r&&this._currentRowHeaderDbClick$.next(r)}triggerColHeaderDbClick(e,t,n){let r=this._calcActiveColHeader(e,t,n);r&&this._currentColHeaderDbClick$.next(r)}triggerRowHeaderMouseMove(e,t,n){this._currentHoveredRowHeader$.next(this._calcActiveRowHeader(e,t,n))}triggerColHeaderMouseMove(e,t,n){this._currentHoveredColHeader$.next(this._calcActiveColHeader(e,t,n))}triggerRowHeaderPoniterDown(e,t,n){let r=this._calcActiveRowHeader(e,t,n);r&&this._currentRowHeaderPointerDown$.next(r)}triggerColHeaderPoniterDown(e,t,n){let r=this._calcActiveColHeader(e,t,n);r&&this._currentColHeaderPointerDown$.next(r)}triggerRowHeaderPoniterUp(e,t,n){let r=this._calcActiveRowHeader(e,t,n);r&&this._currentRowHeaderPointerUp$.next(r)}triggerColHeaderPoniterUp(e,t,n){let r=this._calcActiveColHeader(e,t,n);r&&this._currentColHeaderPointerUp$.next(r)}};Za=K([G(0,n.IUniverInstanceService),G(1,a.IRenderManagerService)],Za);let Qa=class extends n.Disposable{get active(){return this._active}constructor(e,t,n,r){super(),this._context=e,this._hoverManagerService=t,this._sheetSkeletonManagerService=n,this._scrollManagerService=r,z(this,`_active`,!1),this._initPointerEvent(),this._initScrollEvent()}_initPointerEvent(){let e=new n.DisposableCollection,t=t=>{if(e.dispose(),!t)return;let{mainComponent:r,unitId:i,components:a}=this._context;if(!r)return;e.add(r.onPointerEnter$.subscribeEvent(()=>{this._active=!0})),e.add((0,n.fromEventSubject)(r.onPointerMove$).subscribe(e=>{this._active=!0,this._hoverManagerService.triggerMouseMove(i,e)})),e.add(r.onPointerDown$.subscribeEvent(e=>{this._hoverManagerService.triggerPointerDown(i,e)})),e.add(r.onPointerUp$.subscribeEvent(e=>{this._hoverManagerService.triggerPointerUp(i,e)})),e.add(r.onClick$.subscribeEvent(e=>{this._hoverManagerService.triggerClick(i,e.offsetX,e.offsetY)})),e.add(r.onDblclick$.subscribeEvent(e=>{this._hoverManagerService.triggerDbClick(i,e)})),e.add(r.onPointerLeave$.subscribeEvent(()=>{this._active=!1,this._hoverManagerService.triggerMouseLeave()}));let o=a.get(`__SpreadsheetRowHeader__`),s=a.get(`__SpreadsheetColumnHeader__`);o&&(e.add(o.onPointerMove$.subscribeEvent(e=>{this._hoverManagerService.triggerRowHeaderMouseMove(i,e.offsetX,e.offsetY)})),e.add(o.onPointerDown$.subscribeEvent(e=>{this._hoverManagerService.triggerRowHeaderPoniterDown(i,e.offsetX,e.offsetY)})),e.add(o.onPointerUp$.subscribeEvent(e=>{this._hoverManagerService.triggerRowHeaderPoniterUp(i,e.offsetX,e.offsetY),this._hoverManagerService.triggerRowHeaderClick(i,e.offsetX,e.offsetY)})),e.add(o.onDblclick$.subscribeEvent(e=>{this._hoverManagerService.triggerRowHeaderDbClick(i,e.offsetX,e.offsetY)}))),s&&(e.add(s.onPointerMove$.subscribeEvent(e=>{this._hoverManagerService.triggerColHeaderMouseMove(i,e.offsetX,e.offsetY)})),e.add(s.onPointerDown$.subscribeEvent(e=>{this._hoverManagerService.triggerColHeaderPoniterDown(i,e.offsetX,e.offsetY)})),e.add(s.onPointerUp$.subscribeEvent(e=>{this._hoverManagerService.triggerColHeaderPoniterUp(i,e.offsetX,e.offsetY),this._hoverManagerService.triggerColHeaderClick(i,e.offsetX,e.offsetY)})),e.add(s.onDblclick$.subscribeEvent(e=>{this._hoverManagerService.triggerColHeaderDbClick(i,e.offsetX,e.offsetY)})))};t(this._sheetSkeletonManagerService.getCurrentParam()),this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.subscribe(e=>{t(e)}))}_initScrollEvent(){this.disposeWithMe(this._scrollManagerService.validViewportScrollInfo$.subscribe(()=>this._hoverManagerService.triggerScroll()))}};Qa=K([G(1,(0,n.Inject)(Za)),G(2,(0,n.Inject)(q)),G(3,(0,n.Inject)(Gn))],Qa);let $a=`UNIVER_SHEET_PERMISSION_ALERT_DIALOG_ID`,eo=`UNIVER_SHEET_PERMISSION_ALERT_DIALOG`,to=class extends n.Disposable{constructor(e,t,r,i,a,o,s){super(),this._commandService=e,this._permissionService=t,this._dialogService=r,this._rangeProtectionRuleModel=i,this._localeService=a,this._contextService=o,this._sheetPermissionCheckController=s,z(this,`disposableCollection`,new n.DisposableCollection),this._initialize(),this._initUIEvent()}_initUIEvent(){this.disposeWithMe(this._sheetPermissionCheckController.triggerPermissionUIEvent$.subscribe(e=>{this._haveNotPermissionHandle(e)}))}_haveNotPermissionHandle(e){let t={id:$a,title:{title:`sheets-ui.permission.dialog.alert`},children:{label:eo,errorMsg:e},width:320,showOk:!0,onClose:()=>{this._dialogService.close($a)},onOk:()=>{this._dialogService.close($a)},className:`sheet-permission-user-dialog`};this._permissionService.getShowComponents()&&this._dialogService.open(t)}_getPermissionCheck(e){let{id:i}=e,a=!0,o=``,c;switch(i){case s.InsertTextCommand.id:case t.IMEInputCommand.id:if(c=e.params,!c||!n.SHEET_EDITOR_UNITS.includes(c.unitId)||this._contextService.getContextValue(n.FOCUSING_EDITOR_STANDALONE)===!0||this._contextService.getContextValue(n.FOCUSING_COMMENT_EDITOR)===!0)break;a=this._sheetPermissionCheckController.permissionCheckWithoutRange({workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetSetCellValuePermission,r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]}),o=this._localeService.t(`sheets-ui.permission.dialog.editErr`);break;case X.id:if(c=e.params,c.visible===!1)break;a=this._sheetPermissionCheckController.permissionCheckWithoutRange({workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetSetCellValuePermission,r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]},n.SHEET_EDITOR_UNITS.includes(c.unitId)?void 0:c.unitId),o=this._localeService.t(`sheets-ui.permission.dialog.editErr`);break;case Wn.id:a=this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellValuePermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]}),o=this._localeService.t(`sheets-ui.permission.dialog.commonErr`)}a||this._sheetPermissionCheckController.blockExecuteWithoutPermission(o)}_initialize(){this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(e=>{this._getPermissionCheck(e)}))}};to=K([G(0,n.ICommandService),G(1,n.IPermissionService),G(2,i.IDialogService),G(3,(0,n.Inject)(r.RangeProtectionRuleModel)),G(4,(0,n.Inject)(n.LocaleService)),G(5,n.IContextService),G(6,(0,n.Inject)(r.SheetPermissionCheckController))],to);let no=1.5,ro=(0,n.createInterceptorKey)(`freezePermissionCheck`),io=class extends n.Disposable{constructor(e,t,r,i,a,o,s,c){super(),this._context=e,this._sheetSkeletonManagerService=t,this._commandService=r,this._selectionManagerService=i,this._scrollManagerService=a,this._themeService=o,this._sheetInterceptorService=s,this._injector=c,z(this,`_rowFreezeHeaderRect`,void 0),z(this,`_rowFreezeMainRect`,void 0),z(this,`_columnFreezeHeaderRect`,void 0),z(this,`_columnFreezeMainRect`,void 0),z(this,`_freezeDownSubs`,void 0),z(this,`_freezePointerEnterSubs`,void 0),z(this,`_freezePointerLeaveSubs`,void 0),z(this,`_scenePointerMoveSub`,void 0),z(this,`_scenePointerUpSub`,void 0),z(this,`_changeToRow`,-1),z(this,`_changeToColumn`,-1),z(this,`_changeToOffsetX`,0),z(this,`_changeToOffsetY`,0),z(this,`_activeViewport`,null),z(this,`_freezeNormalHeaderColor`,``),z(this,`_freezeNormalMainColor`,``),z(this,`_freezeActiveColor`,``),z(this,`_freezeHoverColor`,``),z(this,`_lastFreeze`,void 0),z(this,`interceptor`,new n.InterceptorManager({FREEZE_PERMISSION_CHECK:ro})),this._initialize()}_getSheetType(){var e;return(e=this._context.unit.getActiveSheet())==null?void 0:e.getConfig().type}dispose(){this._clearFreeze(),super.dispose()}_initialize(){this._skeletonListener(),this._commandExecutedListener(),this._themeChangeListener(),this._interceptorCommands(),this._bindViewportScroll(),this._zoomRefresh()}_createFreeze(e=0,t){var r;if(this._getSheetType()===n.SheetTypes.CHART)return null;let i=t??this._getFreeze();if(i==null)return null;let o=(r=this._sheetSkeletonManagerService.getCurrentParam())==null?void 0:r.skeleton,{startRow:s,startColumn:c}=i,l=this._getPositionByIndex(s,c);if(l==null||o==null)return null;let u=this._getSheetObject().scene,{startX:d,startY:f}=l,{rowTotalHeight:p,columnTotalWidth:m,rowHeaderWidthAndMarginLeft:h,columnHeaderHeightAndMarginTop:g}=o;this._changeToRow=s,this._changeToColumn=c,this._changeToOffsetX=d,this._changeToOffsetY=f;let _=Math.max(u.scaleX,u.scaleY),v=2/Math.max(1,_);if(e===0){(s===-1||s===0)&&(v*=no);let e=v;this._rowFreezeHeaderRect=new a.Rect(`__SpreadsheetFreezeRowHeaderName__`,{fill:this._freezeNormalHeaderColor,width:h,height:v,left:0,top:f-e,zIndex:3});let t=this._freezeNormalHeaderColor;(s===-1||s===0)&&(t=this._freezeNormalMainColor),this._rowFreezeMainRect=new a.Rect(`__SpreadsheetFreezeRowMainName__`,{fill:t,width:m,height:v,left:h,top:f-e,zIndex:3}),this._rowFreezeHeaderRect.viewportCacheReusable=!0,this._rowFreezeMainRect.viewportCacheReusable=!0,u.addObjects([this._rowFreezeHeaderRect,this._rowFreezeMainRect],10)}else{(c===-1||c===0)&&(v*=no);let e=v;this._columnFreezeHeaderRect=new a.Rect(`__SpreadsheetFreezeColumnHeaderName__`,{fill:this._freezeNormalHeaderColor,width:v,height:g,left:d-e,top:0,zIndex:3});let t=this._freezeNormalHeaderColor;(c===-1||c===0)&&(t=this._freezeNormalMainColor),this._columnFreezeMainRect=new a.Rect(`__SpreadsheetFreezeColumnMainName__`,{fill:t,width:v,height:p,left:d-e,top:g,zIndex:3}),this._columnFreezeHeaderRect.viewportCacheReusable=!0,this._columnFreezeMainRect.viewportCacheReusable=!0,u.addObjects([this._columnFreezeHeaderRect,this._columnFreezeMainRect],10)}this._eventBinding(e)}_eventBinding(e=0){let t=this._rowFreezeHeaderRect,n=this._rowFreezeMainRect;e===1&&(t=this._columnFreezeHeaderRect,n=this._columnFreezeMainRect);let r=this._getSheetObject();if(r==null)return;let{scene:i}=r;if(this._freezePointerEnterSubs=new o.Subscription,this._freezePointerLeaveSubs=new o.Subscription,this._freezeDownSubs=new o.Subscription,n){let e=n.onPointerEnter$.subscribeEvent(()=>{if(!this.interceptor.fetchThroughInterceptors(ro)(!0,null))return!1;t==null||t.setProps({fill:this._freezeHoverColor,zIndex:4}),i.setCursor(a.CURSOR_TYPE.GRAB)});this._freezePointerEnterSubs.add(e);let r=n.onPointerLeave$.subscribeEvent(()=>{t==null||t.setProps({fill:this._freezeNormalHeaderColor,zIndex:3}),i.resetCursor()});this._freezePointerLeaveSubs.add(r)}if(t){let e=t.onPointerEnter$.subscribeEvent(()=>{if(!this.interceptor.fetchThroughInterceptors(ro)(!0,null))return!1;t==null||t.setProps({fill:this._freezeHoverColor,zIndex:4}),i.setCursor(a.CURSOR_TYPE.GRAB)});this._freezePointerEnterSubs.add(e);let n=t.onPointerLeave$.subscribeEvent(()=>{t==null||t.setProps({fill:this._freezeNormalHeaderColor,zIndex:3}),i.resetCursor()});this._freezePointerLeaveSubs.add(n)}let s=t==null?void 0:t.onPointerDown$.subscribeEvent(r=>{this._freezeDown(r,t,n,e)});s&&this._freezeDownSubs.add(s);let c=n==null?void 0:n.onPointerDown$.subscribeEvent(r=>{this._freezeDown(r,t,n,e)});c&&this._freezeDownSubs.add(c)}_getCurrentLastVisible(){var e;let t=this._getSheetObject();if(t==null)return;let n=(e=this._sheetSkeletonManagerService.getCurrentParam())==null?void 0:e.skeleton;if(n==null)return;let r=t.scene,i=Math.max(r.scaleX,r.scaleY),a=this._scrollManagerService.getCurrentScrollState(),o=(t.engine.height-n.columnHeaderHeight)/i,s=(t.engine.width-n.rowHeaderWidth)/i,c=(a==null?void 0:a.sheetViewStartRow)??0,l=c===0?-((a==null?void 0:a.offsetY)??0):n.rowHeightAccumulation[c-1]-((a==null?void 0:a.offsetY)??0),u=0,d=!1;for(let e=c,t=n.rowHeightAccumulation.length;e<t;e++)if(n.rowHeightAccumulation[e]-l>o){u=e,d=!0;break}d||(u=n.rowHeightAccumulation.length-1);let f=(a==null?void 0:a.sheetViewStartColumn)??0,p=f===0?-((a==null?void 0:a.offsetX)??0):n.columnWidthAccumulation[f-1]-((a==null?void 0:a.offsetX)??0),m=0,h=!1;for(let e=f,t=n.columnWidthAccumulation.length;e<t;e++)if(n.columnWidthAccumulation[e]-p>s){m=e,h=!0;break}return h||(m=n.columnWidthAccumulation.length-1),{lastRow:u,lastColumn:m}}_getActiveViewport(e){var t;let n=(t=this._getSheetObject())==null?void 0:t.scene.getViewports();return n&&n.find(t=>t.isHit(new a.Vector2(e.offsetX,e.offsetY)))||null}_freezeDown(e,t,i,o=0){var s;let c=(s=this._sheetSkeletonManagerService.getCurrentParam())==null?void 0:s.skeleton;if(c==null)return;let l=this._getSheetObject();if(l==null)return;if(!this.interceptor.fetchThroughInterceptors(ro)(!0,null))return!1;let{scene:u}=l;u.setCursor(a.CURSOR_TYPE.GRABBING),u.disableObjectsEvent();let d=this._getCurrentLastVisible(),f=d===void 0?1/0:c.rowHeightAccumulation[d.lastRow],p=d===void 0?1/0:c.columnWidthAccumulation[d.lastColumn-1]+c.rowHeaderWidth;this._activeViewport=null;let m=this._getFreeze();m&&(this._changeToColumn=m.startColumn,this._changeToRow=m.startRow),this._scenePointerMoveSub=u.onPointerMove$.subscribeEvent(e=>{let n=this._getActiveViewport(e),{startX:r,startY:s,row:l,column:m}=sr(e.offsetX,e.offsetY,u,c,n||void 0,!0);if(!this.interceptor.fetchThroughInterceptors(ro)(!0,null))return!1;u.setCursor(a.CURSOR_TYPE.GRABBING);let h=2/Math.max(u.scaleX,u.scaleY);if(o===0){var g,_;(g=t.transformByState({top:Math.min(s,f)-h/2}))==null||g.setProps({fill:this._freezeActiveColor}),(_=i.transformByState({top:Math.min(s,f)-h/2}))==null||_.setProps({fill:this._freezeNormalHeaderColor}),this._changeToRow=d===void 0?l:Math.min(l,d.lastRow),this._changeToOffsetY=Math.min(s,f),this._activeViewport=n}else{var v,y;(v=t.transformByState({left:Math.min(r,p)-h/2}))==null||v.setProps({fill:this._freezeActiveColor}),(y=i.transformByState({left:Math.min(r,p)-h/2}))==null||y.setProps({fill:this._freezeNormalHeaderColor}),this._changeToColumn=d===void 0?m:Math.min(m,d.lastColumn),this._changeToOffsetX=r,this._activeViewport=n}}),this._scenePointerUpSub=u.onPointerUp$.subscribeEvent(()=>{var e,s;u.resetCursor(),u.enableObjectsEvent(),this._clearObserverEvent();let{rowHeaderWidthAndMarginLeft:l,columnHeaderHeightAndMarginTop:d}=c;o===0&&(this._changeToRow===0||this._changeToRow===-1)||o===1&&(this._changeToColumn===0||this._changeToColumn===-1)?(t.setProps({fill:this._freezeNormalHeaderColor}),i.setProps({fill:this._freezeNormalMainColor})):(t==null||t.setProps({fill:this._freezeNormalHeaderColor}),i==null||i.setProps({fill:this._freezeNormalHeaderColor}));let f=2/Math.max(u.scaleX,u.scaleY);o===0?(this._changeToRow===0||this._changeToRow===-1)&&(t.transformByState({top:d-f}),i.transformByState({top:d-f})):(this._changeToColumn===0||this._changeToColumn===-1)&&(t.transformByState({left:l-f}),i.transformByState({left:l-f}));let{sheetViewStartRow:p,sheetViewStartColumn:m}=this._scrollManagerService.getCurrentScrollState()||{sheetViewStartRow:0,sheetViewStartColumn:0};if(m==null||p==null)return;let h=this._context.unit,g=h.getActiveSheet();if(!g||g.getConfig().type===n.SheetTypes.CHART){this._clearFreeze();return}let _=(e=g.getConfig())==null?void 0:e.freeze,v=(_==null?void 0:_.xSplit)||0,y=(_==null?void 0:_.ySplit)||0,b=(s=this._activeViewport)==null?void 0:s.viewportKey;o===0&&(y=!b||b===a.SHEET_VIEWPORT_KEY.VIEW_LEFT_TOP||b===a.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT_TOP||b===a.SHEET_VIEWPORT_KEY.VIEW_MAIN_TOP||b===a.SHEET_VIEWPORT_KEY.VIEW_ROW_TOP?this._changeToRow-(_.startRow-_.ySplit):this._changeToRow-p,y=y<0?0:y),o===1&&(v=!b||b===a.SHEET_VIEWPORT_KEY.VIEW_LEFT_TOP||b===a.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT_TOP||b===a.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT||b===a.SHEET_VIEWPORT_KEY.VIEW_COLUMN_LEFT?this._changeToColumn-(_.startColumn-_.xSplit):this._changeToColumn-m,v=v<0?0:v),this._commandService.executeCommand(r.SetFrozenCommand.id,{startRow:y===0?-1:this._changeToRow,startColumn:v===0?-1:this._changeToColumn,ySplit:y,xSplit:v,unitId:h.getUnitId(),subUnitId:g.getSheetId()})})}_getViewports(){let e=this._getSheetObject();if(e==null)return;let{scene:t}=e,n=t.getViewport(a.SHEET_VIEWPORT_KEY.VIEW_COLUMN_LEFT),r=t.getViewport(a.SHEET_VIEWPORT_KEY.VIEW_COLUMN_RIGHT),i=t.getViewport(a.SHEET_VIEWPORT_KEY.VIEW_ROW_TOP),o=t.getViewport(a.SHEET_VIEWPORT_KEY.VIEW_ROW_BOTTOM),s=t.getViewport(a.SHEET_VIEWPORT_KEY.VIEW_LEFT_TOP),c=t.getViewport(a.SHEET_VIEWPORT_KEY.VIEW_MAIN),l=t.getViewport(a.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT_TOP),u=t.getViewport(a.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT),d=t.getViewport(a.SHEET_VIEWPORT_KEY.VIEW_MAIN_TOP);if(n!=null&&r!=null&&i!=null&&o!=null&&s!=null&&c!=null&&l!=null&&u!=null&&d!=null)return{viewMain:c,viewMainLeftTop:l,viewMainLeft:u,viewMainTop:d,viewColumnLeft:n,viewColumnRight:r,viewRowTop:i,viewRowBottom:o,viewLeftTop:s}}_bindViewportScroll(){let e=this._getViewports();if(!e)return;let{viewRowBottom:t,viewColumnRight:r,viewMainLeft:i,viewMainTop:a}=e;this.disposeWithMe(this._scrollManagerService.validViewportScrollInfo$.subscribe(e=>{if(!e||this._getSheetType()===n.SheetTypes.CHART)return;let{scrollX:o,scrollY:s,viewportScrollX:c,viewportScrollY:l}=e;t.isActive&&t.updateScrollVal({scrollY:s,viewportScrollY:l}),r.isActive&&r.updateScrollVal({scrollX:o,viewportScrollX:c}),i.isActive&&i.updateScrollVal({scrollY:s,viewportScrollY:l}),a.isActive&&a.updateScrollVal({scrollX:o,viewportScrollX:c})}))}_updateViewport(e=-1,t=-1,r=0,i=0,a=3){var o;let s=(o=this._sheetSkeletonManagerService.getCurrentParam())==null?void 0:o.skeleton,c=this._context.unit.getActiveSheet();if(s==null||(c==null?void 0:c.getConfig().type)===n.SheetTypes.CHART||s.worksheet.getSheetId()!==(c==null?void 0:c.getSheetId()))return;let{rowHeaderWidthAndMarginLeft:l,columnHeaderHeightAndMarginTop:u}=s,d=this._getViewports();if(!d)return;let{viewMain:f,viewMainLeftTop:p,viewMainLeft:m,viewMainTop:h,viewColumnLeft:g,viewColumnRight:_,viewRowTop:v,viewRowBottom:y,viewLeftTop:b}=d;_.resizeWhenFreezeChange({left:l,top:0,height:u+1,right:0}),y.resizeWhenFreezeChange({left:0,top:u,bottom:0,width:l+1}),b.resizeWhenFreezeChange({left:0,top:0,width:l+1,height:u});let x=!0,S=!0;p.enable(),(e===-1||e===0)&&(x=!1),(t===-1||t===0)&&(S=!1);let C=s.getNoMergeCellWithCoordByIndex(e-r,t-i,!1);x&&e===r&&(C.startY=0);let w=s.getNoMergeCellWithCoordByIndex(e,t,!1);if(p.disable(),h.disable(),m.disable(),v.disable(),g.disable(),p.resetPadding(),h.resetPadding(),m.resetPadding(),v.resetPadding(),g.resetPadding(),x===!1&&S===!1)f.resizeWhenFreezeChange({left:l,top:u,bottom:0,right:0}),f.resetPadding(),m.resizeWhenFreezeChange({left:l,top:u,bottom:0,width:0}),h.resizeWhenFreezeChange({left:l,top:u,height:0,right:0}),p.resizeWhenFreezeChange({left:l,top:u,width:0,height:0}),v.resizeWhenFreezeChange({left:0,top:u,width:l+1,height:0}),g.resizeWhenFreezeChange({left:0,top:0,height:u+1,width:0});else if(x===!0&&S===!1){let e=w.startY-C.startY;f.resizeWhenFreezeChange({left:l,top:u+e,bottom:0,right:0}),f.setPadding({startY:C.startY,endY:w.startY,startX:0,endX:0}),a&2&&this._commandService.executeCommand(fr.id,{sheetViewStartRow:0,offsetY:0}),h.resizeWhenFreezeChange({left:l,top:u,height:e,right:0}),h.updateScrollVal({viewportScrollY:C.startY,rawScrollX:f.scrollX,viewportScrollX:f.viewportScrollX}),v.resizeWhenFreezeChange({left:0,top:u,width:l+1,height:e}),v.updateScrollVal({viewportScrollY:C.startY}),y.resizeWhenFreezeChange({left:0,top:u+e,bottom:0,width:l+1}),h.enable(),v.enable()}else if(x===!1&&S===!0){let e=w.startX-C.startX;f.resizeWhenFreezeChange({left:l+e,top:u,bottom:0,right:0}),f.setPadding({startX:C.startX,endX:w.startX,startY:0,endY:0}),a&1&&this._commandService.executeCommand(fr.id,{sheetViewStartColumn:0,offsetX:0}),m.resizeWhenFreezeChange({left:l,top:u,width:e,bottom:0,right:0}),m.updateScrollVal({viewportScrollX:C.startX,rawScrollY:f.scrollY,viewportScrollY:f.viewportScrollY}),g.resizeWhenFreezeChange({left:l,top:0,width:e,height:u+1}),g.updateScrollVal({viewportScrollX:C.startX}),_.resizeWhenFreezeChange({left:l+e,top:0,height:u+1,right:0}),m.enable(),g.enable()}else{let e=w.startX-C.startX,t=w.startY-C.startY;f.resizeWhenFreezeChange({left:l+e,top:u+t,bottom:0,right:0}),f.setPadding({startY:C.startY,endY:w.startY,startX:C.startX,endX:w.startX}),a&&this._commandService.executeCommand(fr.id,{...a&1?{sheetViewStartColumn:0,offsetX:0}:null,...a&2?{sheetViewStartRow:0,offsetY:0}:null}),m.resizeWhenFreezeChange({left:l,top:u+t,width:e,bottom:0}),m.updateScrollVal({viewportScrollX:C.startX,rawScrollY:f.scrollY,viewportScrollY:f.viewportScrollY}),h.resizeWhenFreezeChange({left:l+e,top:u,height:t,right:0}),h.updateScrollVal({viewportScrollY:C.startY,rawScrollX:f.scrollX,viewportScrollX:f.viewportScrollX}),p.resizeWhenFreezeChange({left:l,top:u,width:e,height:t}),p.updateScrollVal({viewportScrollX:C.startX,viewportScrollY:C.startY}),v.resizeWhenFreezeChange({left:0,top:u,width:l+1,height:t}),v.updateScrollVal({viewportScrollY:C.startY}),y.resizeWhenFreezeChange({left:0,top:u+t,bottom:0,width:l+1}),g.resizeWhenFreezeChange({left:l,top:0,width:e,height:u+1}),g.updateScrollVal({viewportScrollX:C.startX}),_.resizeWhenFreezeChange({left:l+e,top:0,height:u+1,right:0}),p.enable(),h.enable(),m.enable(),v.enable(),g.enable()}}_skeletonListener(){this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.pipe((0,o.switchMap)(e=>{var t;return(e==null||(t=e.skeleton)==null?void 0:t.gapConfigChanged$)??o.EMPTY})).subscribe(()=>this._refreshCurrent())),this.disposeWithMe((0,n.toDisposable)(this._sheetSkeletonManagerService.currentSkeleton$.subscribe(e=>{var t;if(this._getSheetType()===n.SheetTypes.CHART){this._clearFreeze(),this._lastFreeze=void 0;return}let i=[r.SetWorksheetActiveOperation.id,r.InsertRangeMoveDownCommand.id,r.InsertRangeMoveRightCommand.id];e&&(i.includes(e.commandId||``)||this._lastFreeze!==((t=this._context.unit.getActiveSheet())==null?void 0:t.getFreeze()))&&this._refreshCurrent()})))}_refreshCurrent(){let e=this._context.unit.getActiveSheet();if(!e||e.getConfig().type===n.SheetTypes.CHART){this._clearFreeze();return}let t=this._sheetSkeletonManagerService.getCurrentSkeleton();if((t==null?void 0:t.worksheet.getSheetId())!==e.getSheetId())return;let r=e.getConfig().freeze;this._lastFreeze=r;let{startRow:i=-1,startColumn:a=-1,ySplit:o=0,xSplit:s=0}=r;this._refreshFreeze(i,a,o,s,0)}_themeChangeListener(){this._themeChange(this._themeService.getCurrentTheme()),this.disposeWithMe(this._themeService.currentTheme$.subscribe(e=>{this._clearFreeze(),this._themeChange(e),this._refreshCurrent()}))}_themeChange(e){this._freezeNormalHeaderColor=(0,n.get)(e,`gray.300`),this._freezeNormalMainColor=new n.ColorKit(this._freezeNormalHeaderColor).setAlpha(.01).toRgbString(),this._freezeActiveColor=(0,n.get)(e,`primary.600`),this._freezeHoverColor=(0,n.get)(e,`gray.500`)}_interceptorCommands(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{let t={redos:[],undos:[]},i=this._getFreeze();if(!i)return t;let a=e=>{let n=this._context.unit,i=n.getUnitId(),a=n.getActiveSheet();if(!a)return t;let o=a.getSheetId();this._refreshFreeze(e.startRow,e.startColumn,e.ySplit,e.xSplit,0);let s={...e,unitId:i,subUnitId:o,resetScroll:!1},c=(0,r.SetFrozenMutationFactory)(this._injector,s);return{undos:[{id:r.SetFrozenMutation.id,params:c}],redos:[{id:r.SetFrozenMutation.id,params:s}]}};if(e.id===r.InsertRowCommand.id){let{range:t,direction:r}=e.params,o=t.endRow-t.startRow+1;if(t.startRow<i.startRow||t.startRow+1===i.startRow&&r===n.Direction.UP)return a({...i,startRow:Math.max(1,i.startRow+o),ySplit:Math.max(1,i.ySplit+o)})}if(e.id===r.InsertColCommand.id){let{range:t,direction:r}=e.params,o=t.endColumn-t.startColumn+1;if(t.startColumn<i.startColumn||t.startColumn+1===i.startColumn&&r===n.Direction.LEFT)return a({...i,startColumn:Math.max(1,i.startColumn+o),xSplit:Math.max(1,i.xSplit+o)})}if(e.id===r.MoveColsCommand.id){let r=this._selectionManagerService.getCurrentSelections(),{fromRange:{startColumn:o},toRange:{startColumn:s}}=e.params,c=r==null?void 0:r.filter(e=>e.range.rangeType===n.RANGE_TYPE.COLUMN&&e.range.startColumn<=o&&o<=e.range.endColumn);if(!(c!=null&&c.length))return t;let l=c[0].range,u={...l,startColumn:s,endColumn:s+l.endColumn-l.startColumn};if(!i||i.startColumn<=0||l.startColumn>=i.startColumn&&u.startColumn>=i.startColumn||l.startColumn===u.startColumn||l.endColumn<i.startColumn&&u.startColumn<i.startColumn)return t;let d=l.endColumn-l.startColumn+1,f=Math.max(Math.min(i.startColumn,l.endColumn+1)-l.startColumn,0),p,m;return u.startColumn>=i.startColumn?(p=Math.max(i.startColumn-f,1),m=Math.max(i.xSplit-f,1)):(p=i.startColumn+d-f,m=i.xSplit+d-f),a({...i,startColumn:p,xSplit:m})}if(e.id===r.MoveRowsCommand.id){let r=this._selectionManagerService.getCurrentSelections(),{fromRange:{startRow:o},toRange:{startRow:s}}=e.params,c=r==null?void 0:r.filter(e=>e.range.rangeType===n.RANGE_TYPE.ROW&&e.range.startRow<=o&&o<=e.range.endRow);if(!(c!=null&&c.length))return t;let l=c[0].range,u={...l,startRow:s,endRow:s+l.endRow-l.startRow};if(!i||i.startRow<=0||l.startRow>=i.startRow&&u.startRow>=i.startRow||l.startRow===u.startRow||l.endRow<i.startRow&&u.startRow<i.startRow)return t;let d=l.endRow-l.startRow+1,f=Math.max(Math.min(i.startRow,l.endRow+1)-l.startRow,0),p,m;return u.startRow>=i.startRow?(p=Math.max(i.startRow-f,1),m=Math.max(i.ySplit-f,1)):(p=i.startRow+d-f,m=i.ySplit+d-f),a({...i,startRow:p,ySplit:m})}if(e.id===r.RemoveColCommand.id||e.id===r.RemoveRowCommand.id){let t=e.params,r=t.range;if(r.rangeType===n.RANGE_TYPE.COLUMN&&r.startColumn<i.startColumn){let e=Math.min(i.startColumn,r.endColumn+1)-r.startColumn;return a({...i,startColumn:Math.max(1,i.startColumn-e),xSplit:Math.max(1,i.xSplit-e)})}if(t.range.rangeType===n.RANGE_TYPE.ROW&&r.startRow<i.startRow){let e=Math.min(i.startRow,r.endRow+1)-r.startRow;return a({...i,startRow:Math.max(1,i.startRow-e),ySplit:Math.max(1,i.ySplit-e)})}}return t}}))}_commandExecutedListener(){this.disposeWithMe(this._commandService.onCommandExecuted(e=>{switch(e.id){case r.SetFrozenMutation.id:case Ar.id:{let t=this._lastFreeze,n=this._context.unit,r=n.getActiveSheet(),i=e.params,{unitId:a,subUnitId:o}=i;if(a!==n.getUnitId()||o!==(r==null?void 0:r.getSheetId()))return;let s=r.getConfig().freeze;if(this._lastFreeze=s,s==null)return;let c=0,{startRow:l=-1,startColumn:u=-1,ySplit:d=0,xSplit:f=0}=s;t&&t.startRow===l&&t.ySplit===d||(c|=2),t&&t.startColumn===u&&t.xSplit===f||(c|=1),i.resetScroll===!1&&(c=0),this._refreshFreeze(l,u,d,f,c)}break;case r.SetWorksheetRowHeightMutation.id:{let t=this._getFreeze(),n=t&&e.params.ranges.some(e=>e.startRow<t.startRow);e.params&&n&&this._refreshCurrent()}break;case r.SetWorksheetColWidthMutation.id:{let t=this._getFreeze();e.params&&t&&e.params.ranges.some(e=>e.startColumn<t.startColumn)&&this._refreshCurrent()}break;case r.SetWorksheetRowAutoHeightMutation.id:{let t=e.params,n=this._getFreeze();if(n&&n.startRow>-1&&t.rowsAutoHeightInfo.some(e=>e.row<n.startRow)){let e=this._sheetSkeletonManagerService.currentSkeleton$.subscribe(()=>{this._refreshCurrent(),setTimeout(()=>{e.unsubscribe()})})}}break;case r.SetColHiddenMutation.id:case r.SetColVisibleMutation.id:{let t=e.params,n=this._getFreeze(),r=t.ranges;n&&n.startColumn>-1&&r.some(e=>e.startColumn<n.startColumn)&&this._refreshCurrent()}break;case r.SetRowHiddenMutation.id:case r.SetRowVisibleMutation.id:{let t=e.params,n=this._getFreeze(),r=t.ranges;n&&n.startRow>-1&&r.some(e=>e.startRow<n.startRow)&&this._refreshCurrent()}break;case B.id:case V.id:this._refreshCurrent()}}))}_zoomRefresh(){let e=this._getSheetObject();if(e==null)return;let{scene:t}=e;this.disposeWithMe(t.onTransformChange$.subscribeEvent(e=>{[a.TRANSFORM_CHANGE_OBSERVABLE_TYPE.scale,a.TRANSFORM_CHANGE_OBSERVABLE_TYPE.all].includes(e.type)&&this._refreshCurrent()}))}_clearObserverEvent(){var e,t;this._getSheetObject()!=null&&((e=this._scenePointerMoveSub)==null||e.unsubscribe(),(t=this._scenePointerUpSub)==null||t.unsubscribe(),this._scenePointerMoveSub=null,this._scenePointerUpSub=null)}_clearFreeze(){var e,t,n,r,i,a;(e=this._rowFreezeHeaderRect)==null||e.dispose(),(t=this._rowFreezeMainRect)==null||t.dispose(),(n=this._columnFreezeHeaderRect)==null||n.dispose(),(r=this._columnFreezeMainRect)==null||r.dispose(),this._rowFreezeHeaderRect=null,this._rowFreezeMainRect=null,this._columnFreezeHeaderRect=null,this._columnFreezeMainRect=null,[this._freezeDownSubs,this._freezePointerEnterSubs,this._freezePointerLeaveSubs].forEach(e=>{e==null||e.unsubscribe()}),this._freezeDownSubs=null,this._freezePointerEnterSubs=null,this._freezePointerLeaveSubs=null,(i=this._scenePointerMoveSub)==null||i.unsubscribe(),(a=this._scenePointerUpSub)==null||a.unsubscribe(),this._scenePointerMoveSub=null,this._scenePointerUpSub=null}_getPositionByIndex(e,t){var n;if(this._getSheetObject()==null)return;let r=(n=this._sheetSkeletonManagerService.getCurrentParam())==null?void 0:n.skeleton,i=r==null?void 0:r.getNoMergeCellWithCoordByIndex(e,t);if(r==null)return;if(i!=null&&(!isNaN(i.endX)||!isNaN(i.endY)))return i;let{rowHeaderWidthAndMarginLeft:a,columnHeaderHeightAndMarginTop:o}=r;return{startX:a,endX:a,startY:o,endY:o}}_getFreeze(){var e;if(this._getSheetType()!==n.SheetTypes.CHART)return(e=this._sheetSkeletonManagerService.getCurrentParam())==null?void 0:e.skeleton.worksheet.getFreeze()}_getSheetObject(){return ar(this._context.unit,this._context)}_refreshFreeze(e,t,n,r,i){var a;let o={startRow:e,startColumn:t,ySplit:n,xSplit:r};this._clearFreeze(),this._createFreeze(0,o),this._createFreeze(1,o),this._updateViewport(e,t,n,r,i),(a=this._getSheetObject())==null||a.spreadsheet.makeForceDirty()}};io=K([G(1,(0,n.Inject)(q)),G(2,n.ICommandService),G(3,(0,n.Inject)(r.SheetsSelectionsService)),G(4,(0,n.Inject)(Gn)),G(5,(0,n.Inject)(n.ThemeService)),G(6,(0,n.Inject)(r.SheetInterceptorService)),G(7,(0,n.Inject)(n.Injector))],io);function ao(e){let t=e.get(r.SheetsSelectionsService),i=e.get(r.RangeProtectionRuleModel),a=e.get(n.IUniverInstanceService),s=e.get(r.MergeCellController),c=a.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET);return(0,o.combineLatest)([t.selectionMoveEnd$,c.pipe((0,o.map)(e=>(e==null?void 0:e.getUnitId())??``)),c.pipe((0,o.switchMap)(e=>(e==null?void 0:e.activeSheet$)??(0,o.of)(null)))]).pipe((0,o.map)(([e,t,a])=>{if(!a||!e||e.length===0)return!1;let o=a.getSheetId(),c=e.map(e=>e.range);if(s.interceptor.fetchThroughInterceptors(r.MERGE_CELL_INTERCEPTOR_CHECK)(!1,c))return!0;let l=i.getSubunitRuleList(t,o).map(e=>e.ranges).flat();if(e.length<2){let t=e[0].range;return l.some(e=>n.Rectangle.intersects(e,t)&&!n.Rectangle.contains(e,t))}for(let t=0;t<e.length;t++)for(let r=t+1;r<e.length;r++)if(n.Rectangle.intersects(e[t].range,e[r].range))return!0;return!1}))}function oo(e,t){return!!co(e,t,n.RANGE_TYPE.ROW)}function so(e,t){return!!co(e,t,n.RANGE_TYPE.COLUMN)}function co(e,t,r){return e.find(e=>{let{startRow:i,endRow:a,startColumn:o,endColumn:s,rangeType:c}=e.range;return c===n.RANGE_TYPE.ALL||c===n.RANGE_TYPE.NORMAL?!1:c===r&&(r===n.RANGE_TYPE.COLUMN&&o<=t&&t<=s||r===n.RANGE_TYPE.ROW&&i<=t&&t<=a)})}let lo=(0,n.createInterceptorKey)(`headerMovePermissionCheck`),uo=class extends n.Disposable{constructor(e,t,r,i,a,o){super(),this._context=e,this._sheetSkeletonManagerService=r,this._commandService=i,this._platformService=a,this._contextService=o,z(this,`_startOffsetX`,-1/0),z(this,`_startOffsetY`,-1/0),z(this,`_moveHelperBackgroundShape`,void 0),z(this,`_moveHelperLineShape`,void 0),z(this,`_headerPointerDownSubs`,void 0),z(this,`_headerPointerMoveSubs`,void 0),z(this,`_headerPointerLeaveSubs`,void 0),z(this,`_dragHeaderMoveSub`,void 0),z(this,`_scenePointerUpSub`,void 0),z(this,`_scrollTimer`,void 0),z(this,`_changeFromColumn`,-1),z(this,`_changeFromRow`,-1),z(this,`_changeToColumn`,-1),z(this,`_changeToRow`,-1),z(this,`interceptor`,new n.InterceptorManager({HEADER_MOVE_PERMISSION_CHECK:lo})),z(this,`_workbookSelections`,void 0),this._workbookSelections=t.getWorkbookSelections(this._context.unitId),this._init()}dispose(){var e,t,n,r,i,a,o,s;(e=this._moveHelperBackgroundShape)==null||e.dispose(),(t=this._moveHelperLineShape)==null||t.dispose(),(n=this._headerPointerMoveSubs)==null||n.unsubscribe(),(r=this._headerPointerLeaveSubs)==null||r.unsubscribe(),(i=this._headerPointerDownSubs)==null||i.unsubscribe(),this._headerPointerMoveSubs=null,this._headerPointerLeaveSubs=null,this._headerPointerDownSubs=null,(a=this._dragHeaderMoveSub)==null||a.unsubscribe(),(o=this._scenePointerUpSub)==null||o.unsubscribe(),this._dragHeaderMoveSub=null,this._scenePointerUpSub=null,(s=this._scrollTimer)==null||s.dispose()}_init(){this._initialRowOrColumn(n.RANGE_TYPE.ROW),this._initialRowOrColumn(n.RANGE_TYPE.COLUMN)}_initialRowOrColumn(e=n.RANGE_TYPE.ROW){let t=this._context.components.get(`__SpreadsheetColumnHeader__`),r=this._context.components.get(`__SpreadsheetRowHeader__`),i=this._context.scene,s=e===n.RANGE_TYPE.ROW?r:t,c=t=>{var r,o;let s=(r=this._sheetSkeletonManagerService.getCurrentParam())==null?void 0:r.skeleton;if(s==null)return;let c=(o=this._workbookSelections.getCurrentLastSelection())==null?void 0:o.range;if(!c||!this.interceptor.fetchThroughInterceptors(lo)(!1,c))return;let l=this._workbookSelections.getCurrentSelections(),{row:u,column:d}=sr(t.offsetX,t.offsetY,i,s);co(l,e===n.RANGE_TYPE.ROW?u:d,e)?i.setCursor(a.CURSOR_TYPE.GRAB):i.resetCursor()},l=()=>{var e,t;(e=this._moveHelperBackgroundShape)==null||e.hide(),(t=this._moveHelperLineShape)==null||t.hide(),i.resetCursor()};this._headerPointerMoveSubs=new o.Subscription,this._headerPointerMoveSubs.add(s.onPointerMove$.subscribeEvent(c)),this._headerPointerLeaveSubs=new o.Subscription,this._headerPointerLeaveSubs.add(s==null?void 0:s.onPointerLeave$.subscribeEvent(l)),this._headerPointerDownSubs=new o.Subscription,this._headerPointerDownSubs.add(s==null?void 0:s.onPointerDown$.subscribeEvent((t,n)=>this._onPointerDown(t,n,e)))}_onPointerDown(e,t,i){var o,s;if(t.isStopPropagation||e.button!==0||H(e,this._platformService.isMac,this._contextService.getContextValue(r.REF_SELECTIONS_ENABLED)))return;let c=this._context.scene,l=(o=this._sheetSkeletonManagerService.getCurrentParam())==null?void 0:o.skeleton;if(l==null)return;let u=(s=this._workbookSelections.getCurrentLastSelection())==null?void 0:s.range;if(!u||!this.interceptor.fetchThroughInterceptors(lo)(!1,u))return;let{offsetX:d,offsetY:f}=e,{x:p,y:m}=c.getCoordRelativeToViewport(a.Vector2.FromArray([d,f]));this._startOffsetX=p,this._startOffsetY=m;let{row:h,column:g}=sr(e.offsetX,e.offsetY,c,l),_;i===n.RANGE_TYPE.ROW?(this._changeFromRow=h,_=a.ScrollTimerType.Y):(this._changeFromColumn=g,_=a.ScrollTimerType.X);let v=co(this._workbookSelections.getCurrentSelections(),i===n.RANGE_TYPE.ROW?h:g,i);v&&this._startDragging(p,m,v,_,i)}_startDragging(e,t,n,r,i){let o=this._context.scene,s=o.getScrollXYInfoByViewport(a.Vector2.FromArray([this._startOffsetX,this._startOffsetY]));this._newBackgroundAndLine(),o.setCursor(a.CURSOR_TYPE.GRABBING),o.disableObjectsEvent();let c=!1,l,u=()=>{if(c)return;l=a.ScrollTimer.create(o,r),this._scrollTimer=l;let n=o.getViewport(a.SHEET_VIEWPORT_KEY.VIEW_MAIN);l.startScroll(e,t,n),c=!0};this._dragHeaderMoveSub=o.onPointerMove$.subscribeEvent(e=>{u();let{offsetX:t,offsetY:r}=e,{x:c,y:d}=o.getCoordRelativeToViewport(a.Vector2.FromArray([t,r]));this._rowColumnMoving(c,d,n,s,i),l.scrolling(c,d,()=>{this._rowColumnMoving(c,d,n,s,i)})}),this._scenePointerUpSub=o.onPointerUp$.subscribeEvent(()=>this._onPointerUp(i))}_onPointerUp(e){var t;let i=this._context.scene;this._disposeBackgroundAndLine(),i.resetCursor(),i.enableObjectsEvent(),this._clearObserverEvent(),(t=this._scrollTimer)==null||t.dispose();let a=this._workbookSelections.getCurrentSelections();if(e===n.RANGE_TYPE.ROW){if(this._changeFromRow!==this._changeToRow&&this._changeToRow!==-1){var o;let e=(o=((a==null?void 0:a.filter(e=>e.range.rangeType===n.RANGE_TYPE.ROW&&e.range.startRow<=this._changeFromRow&&this._changeFromRow<=e.range.endRow))||[])[0])==null?void 0:o.range;e&&this._commandService.executeCommand(r.MoveRowsCommand.id,{fromRange:e,toRange:{...e,startRow:this._changeToRow,endRow:this._changeToRow+e.endRow-e.startRow}})}this._changeToRow=this._changeFromRow=-1}else{if(this._changeFromColumn!==this._changeToColumn&&this._changeToColumn!==-1){var s;let e=(s=((a==null?void 0:a.filter(e=>e.range.rangeType===n.RANGE_TYPE.COLUMN&&e.range.startColumn<=this._changeFromColumn&&this._changeFromColumn<=e.range.endColumn))||[])[0])==null?void 0:s.range;e&&this._commandService.executeCommand(r.MoveColsCommand.id,{fromRange:e,toRange:{...e,startColumn:this._changeToColumn,endColumn:this._changeToColumn+e.endColumn-e.startColumn}})}this._changeToColumn=this._changeFromColumn=-1}}_rowColumnMoving(e,t,i,o,s){var c,l;let u=this._context.scene,d=(c=this._sheetSkeletonManagerService.getCurrentParam())==null?void 0:c.skeleton;if(d==null)return;let{rowHeaderWidth:f,columnHeaderHeight:p,rowTotalHeight:m,columnTotalWidth:h}=d,g=u.getViewportScrollXY(u.getViewport(a.SHEET_VIEWPORT_KEY.VIEW_MAIN)),{scaleX:_,scaleY:v}=u.getAncestorScale(),y=d.getCellIndexByOffset(e,t,_,v,g),b=(0,r.attachRangeWithCoord)(d,i.range);if(b==null)return;let x=Math.max(_,_),{startX:S,endX:C,startY:w,endY:T}=b;if(s===n.RANGE_TYPE.ROW){var E;(E=this._moveHelperBackgroundShape)==null||E.transformByState({height:T-w,width:h+f,left:0,top:w+(t-this._startOffsetY)/x+g.y-o.y})}else{var D;(D=this._moveHelperBackgroundShape)==null||D.transformByState({height:m+p,width:C-S,left:S+(e-this._startOffsetX)/x+g.x-o.x,top:0})}(l=this._moveHelperBackgroundShape)==null||l.show(),this._updateMoveHelperLine(y,i.range,d,s,x)}_updateMoveHelperLine({row:e,column:t},r,i,a,o){var s;let{startX:c,startY:l,endX:u,endY:d}=i.getNoMergeCellWithCoordByIndex(e,t),{startRow:f,startColumn:p,endRow:m,endColumn:h}=r,{rowHeaderWidth:g,columnHeaderHeight:_,rowTotalHeight:v,columnTotalWidth:y}=i,b=4/o;if(a===n.RANGE_TYPE.ROW){var x;let t=0;if(e<=f)t=l-b/2,this._changeToRow=e;else if(e>m)t=d-b/2,this._changeToRow=e+1;else return;(x=this._moveHelperLineShape)==null||x.transformByState({height:b,width:y,left:g,top:t})}else{var S;let e=0;if(t<=p)e=c-b/2,this._changeToColumn=t;else if(t>h)e=u-b/2,this._changeToColumn=t+1;else return;(S=this._moveHelperLineShape)==null||S.transformByState({height:v,width:b,left:e,top:_})}(s=this._moveHelperLineShape)==null||s.show()}_clearObserverEvent(){var e,t;(e=this._dragHeaderMoveSub)==null||e.unsubscribe(),(t=this._scenePointerUpSub)==null||t.unsubscribe(),this._dragHeaderMoveSub=null,this._scenePointerUpSub=null}_newBackgroundAndLine(){let e=this._context.scene;this._moveHelperBackgroundShape=new a.Rect(`__SpreadsheetHeaderMoveControllerBackground__`,{fill:`rgba(0, 0, 0, 0.1)`,evented:!1,zIndex:100}),this._moveHelperLineShape=new a.Rect(`__SpreadsheetHeaderMoveControllerShapeLine__`,{fill:`rgb(119, 119, 119)`,evented:!1,zIndex:100}),e.addObjects([this._moveHelperBackgroundShape,this._moveHelperLineShape],10)}_disposeBackgroundAndLine(){var e,t;(e=this._moveHelperBackgroundShape)==null||e.dispose(),(t=this._moveHelperLineShape)==null||t.dispose()}};uo=K([G(1,(0,n.Inject)(r.SheetsSelectionsService)),G(2,(0,n.Inject)(q)),G(3,n.ICommandService),G(4,i.IPlatformService),G(5,n.IContextService)],uo);let fo=`rgb(68, 71, 70)`;var po=class extends a.Shape{constructor(e,t){super(e,t),z(this,`_size`,12),z(this,`_color`,fo),z(this,`_mode`,0),this.setShapeProps(t)}get size(){return this._size}get mode(){return this._mode}get color(){return this._color}_draw(e){let t=this.getScene();if(!t)return;let{scaleX:n,scaleY:r}=t.getAncestorScale(),i=Math.max(n,r),o=12/i,s=4/i,{width:c,height:l}=this,u=0,d=0;this.mode===0?(c=s,u=o-s):(l=s,d=o-s),a.Rect.drawWith(e,{width:this.width,height:this.height,left:0,top:0,fill:`rgba(120, 120, 120, 0.01)`}),a.Rect.drawWith(e,{width:c,height:l,fill:fo,radius:s}),e.save(),e.transform(1,0,0,1,u,d),a.Rect.drawWith(e,{width:c,height:l,fill:fo,radius:s}),e.restore()}setShapeProps(e){return e!=null&&e.size&&(this._size=e.size),e!=null&&e.mode&&(this._mode=e.mode),e!=null&&e.color&&(this._color=e.color),this.mode===0?this.transformByState({width:12,height:this.size}):this.transformByState({width:this.size,height:12}),this}};let mo=`__SpreadsheetHeaderResizeControllerShapeHelper__`,ho=`rgb(199, 199, 199)`,go=(0,n.createInterceptorKey)(`headerResizePermissionCheck`),_o=class extends n.Disposable{constructor(e,t,r,i){super(),this._context=e,this._sheetSkeletonManagerService=t,this._selectionManagerService=r,this._commandService=i,z(this,`_currentRow`,0),z(this,`_currentColumn`,0),z(this,`_rowResizeRect`,void 0),z(this,`_columnResizeRect`,void 0),z(this,`_headerPointerSubs`,void 0),z(this,`_scenePointerMoveSub`,void 0),z(this,`_scenePointerUpSub`,void 0),z(this,`_resizeHelperShape`,void 0),z(this,`_startOffsetX`,1/0),z(this,`_startOffsetY`,1/0),z(this,`interceptor`,new n.InterceptorManager({HEADER_RESIZE_PERMISSION_CHECK:go})),this._init()}dispose(){var e,t,n;(e=this._rowResizeRect)==null||e.dispose(),this._rowResizeRect=null,(t=this._columnResizeRect)==null||t.dispose(),this._columnResizeRect=null,(n=this._headerPointerSubs)==null||n.unsubscribe(),this._headerPointerSubs=null}_init(){let e=this._context.scene;this._rowResizeRect=new po(`__SpreadsheetHeaderResizeControllerShapeRow__`,{visible:!1,mode:1,zIndex:100}),this._columnResizeRect=new po(`__SpreadsheetHeaderResizeControllerShapeColumn__`,{visible:!1,mode:0,zIndex:100}),e.addObjects([this._rowResizeRect,this._columnResizeRect],10),this._initialHover(0),this._initialHover(1),this._initialHoverResize(0),this._initialHoverResize(1)}_initialHover(e=0){let t=this._context.components.get(`__SpreadsheetColumnHeader__`),n=this._context.components.get(`__SpreadsheetRowHeader__`),r=this._context.scene,i=e===0?n:t,a=(e,t)=>{var n,r;(n=this._rowResizeRect)==null||n.hide(),(r=this._columnResizeRect)==null||r.hide()},s=(t,n)=>{var i;let a=(i=this._sheetSkeletonManagerService.getCurrentParam())==null?void 0:i.skeleton;if(a==null||this._rowResizeRect==null||this._columnResizeRect==null)return;let{rowBaseWidth:o,rowGutterWidth:s,columnBaseHeight:c,columnGutterHeight:l}=vo(a),{startX:u,startY:d,endX:f,endY:p,row:m,column:h}=sr(t.offsetX,t.offsetY,r,a),g=m===a.worksheet.getRowCount()-1,_=h===a.worksheet.getColumnCount()-1,v=cr(t.offsetX,t.offsetY,r,a),{scaleX:y,scaleY:b}=r.getAncestorScale(),x=12/Math.max(y,b);if(e===0){let e=d-x/2;if(g&&p-d<=x/2)this._currentRow=m;else if(v.y<=d+x/2&&v.y>=d)this._currentRow=m-1;else if(v.y>=p-x/2&&v.y<=p)this._currentRow=m,e=p-x/2;else{this._rowResizeRect.hide();return}if(this._currentRow===-1)return;if(!this.interceptor.fetchThroughInterceptors(go)(null,{row:this._currentRow}))return!1;let t=Math.min(44,o/3);this._rowResizeRect.transformByState({left:s+o/2-t/2,top:e}),this._rowResizeRect.setShapeProps({size:t}),this._rowResizeRect.show()}else{let e=u-x/2;if(_&&f-u<=x/2)this._currentColumn=h;else if(v.x<=u+x/2&&v.x>=u)this._currentColumn=h-1;else if(v.x>=f-x/2&&v.x<=f)this._currentColumn=h,e=f-x/2;else{this._columnResizeRect.hide();return}if(this._currentColumn===-1)return;if(!this.interceptor.fetchThroughInterceptors(go)(null,{col:this._currentColumn}))return!1;let t=c*.7;this._columnResizeRect.transformByState({left:e,top:l+c/2-t/2}),this._columnResizeRect.setShapeProps({size:t}),this._columnResizeRect.show()}};this._headerPointerSubs=new o.Subscription,this._headerPointerSubs.add(i==null?void 0:i.onPointerMove$.subscribeEvent(s)),this._headerPointerSubs.add(i==null?void 0:i.onPointerLeave$.subscribeEvent(a))}_initialHoverResize(e=0){let t=this._context.scene,i=e===0?this._rowResizeRect:this._columnResizeRect;i!=null&&(this.disposeWithMe(i.onPointerEnter$.subscribeEvent(()=>{i!=null&&(i.show(),t.setCursor(e===0?a.CURSOR_TYPE.ROW_RESIZE:a.CURSOR_TYPE.COLUMN_RESIZE))})),this.disposeWithMe(i.onPointerLeave$.subscribeEvent(()=>{i!=null&&(i.hide(),t.resetCursor())})),this.disposeWithMe(i.onPointerDown$.subscribeEvent(t=>{var n,i,o,s,c;let l=(n=this._sheetSkeletonManagerService.getCurrentParam())==null?void 0:n.skeleton;if(l==null)return;let u=this._context.scene,d=u.getEngine(),f=(d==null?void 0:d.height)||0,p=(d==null?void 0:d.width)||0,m=u.getViewport(a.SHEET_VIEWPORT_KEY.VIEW_MAIN),h=((m==null||(i=m.getScrollBar())==null||(i=i.horizonScrollTrack)==null?void 0:i.height)||0)+10,g=((m==null||(o=m.getScrollBar())==null||(o=o.verticalScrollTrack)==null?void 0:o.width)||0)+10,_=cr(t.offsetX,t.offsetY,u,l),{scaleX:v,scaleY:y}=u.getAncestorScale();this._startOffsetX=_.x,this._startOffsetY=_.y;let b=l.getOffsetByColumn(this._currentColumn),x=l.getOffsetByRow(this._currentRow),S=l.getNoMergeCellWithCoordByIndex(this._currentRow,this._currentColumn),C=!1,w=0,T=0,{columnTotalWidth:E,rowHeaderWidthAndMarginLeft:D,rowTotalHeight:O,columnHeaderHeightAndMarginTop:k}=l,A=p>E+D?p:E+D,j=f>O+k?f:O+k,M=4/Math.max(v,y);this._resizeHelperShape=e===0?new a.Rect(mo,{width:A,height:M,fill:ho,left:0,top:x-M/2}):new a.Rect(mo,{width:M,height:j,fill:ho,left:b-M/2,top:0});let N=((s=this._columnResizeRect)==null?void 0:s.left)||0,P=((c=this._rowResizeRect)==null?void 0:c.top)||0;u.addObject(this._resizeHelperShape,10),u.disableObjectsEvent(),this._scenePointerMoveSub=u.onPointerMove$.subscribeEvent(t=>{let n=u.getCoordRelativeToViewport(a.Vector2.FromArray([this._startOffsetX,this._startOffsetY])),r=u.getScrollXYInfoByViewport(n,m),{x:i,y:o}=cr(t.offsetX,t.offsetY,u,l),{scaleX:s,scaleY:c}=u.getAncestorScale(),d=4/Math.max(s,c);if(w=i-this._startOffsetX-d/2,T=o-this._startOffsetY-d/2,Math.abs(e===0?T:w)>=2&&(C=!0),e===0){if(T>f-h+r.y-S.startY&&(T=f-h+r.y-S.startY),T=Math.max(T,-(S.endY-S.startY)),C){var _,v,y;(_=this._resizeHelperShape)==null||_.transformByState({top:x+T}),(v=this._rowResizeRect)==null||v.transformByState({top:P+T+d/2}),(y=this._rowResizeRect)==null||y.show(),u.setCursor(a.CURSOR_TYPE.ROW_RESIZE)}}else if(w>p-g+r.x-S.startX&&(w=p-g+r.x-S.startX),w=Math.max(w,-(S.endX-S.startX)),C){var E,D,O;(E=this._resizeHelperShape)==null||E.transformByState({left:b+w}),(D=this._columnResizeRect)==null||D.transformByState({left:N+w+d/2}),(O=this._columnResizeRect)==null||O.show(),u.setCursor(a.CURSOR_TYPE.COLUMN_RESIZE)}}),this._scenePointerUpSub=u.onPointerUp$.subscribeEvent(()=>{var t;let n=this._context.scene;if(this._clearObserverEvent(),(t=this._resizeHelperShape)==null||t.dispose(),this._resizeHelperShape=null,n.enableObjectsEvent(),C){var i,a;n.resetCursor(),(i=this._rowResizeRect)==null||i.hide(),(a=this._columnResizeRect)==null||a.hide(),e===0?this._commandService.executeCommand(r.DeltaRowHeightCommand.id,{deltaY:T,anchorRow:this._currentRow}):this._commandService.executeCommand(r.DeltaColumnWidthCommand.id,{deltaX:w,anchorCol:this._currentColumn})}})})),this.disposeWithMe(i.onDblclick$.subscribeEvent(()=>{var t;this._context.scene.resetCursor();let i=(t=this._sheetSkeletonManagerService.getCurrentParam())==null?void 0:t.skeleton;if(!i)return;let a=i.worksheet.getRowCount()-1||0,o=i.worksheet.getColumnCount()-1||0;switch(e){case 1:{var s;let e=this._selectionManagerService.getCurrentSelections(),t=[];for(let r=0;r<e.length;r++){let i=e[r];i.range.rangeType===n.RANGE_TYPE.COLUMN&&this._currentColumn<=i.range.endColumn&&this._currentColumn>=i.range.startColumn&&t.push({startColumn:i.range.startColumn,endColumn:i.range.endColumn,startRow:0,endRow:a})}t.length===0&&t.push({startColumn:this._currentColumn,endColumn:this._currentColumn,startRow:0,endRow:a}),this._commandService.executeCommand(vr.id,{ranges:t}),(s=this._columnResizeRect)==null||s.hide();break}case 0:var c;this._commandService.executeCommand(r.SetWorksheetRowIsAutoHeightCommand.id,{ranges:[{startRow:this._currentRow,endRow:this._currentRow,startColumn:0,endColumn:o}]}),(c=this._rowResizeRect)==null||c.hide()}})))}_clearObserverEvent(){var e,t;(e=this._scenePointerMoveSub)==null||e.unsubscribe(),(t=this._scenePointerUpSub)==null||t.unsubscribe(),this._scenePointerMoveSub=null,this._scenePointerUpSub=null}};_o=K([G(1,(0,n.Inject)(q)),G(2,(0,n.Inject)(r.SheetsSelectionsService)),G(3,n.ICommandService)],_o);function vo(e){var t,n,r,i;let a=(t=(n=e.worksheet).getConfig)==null?void 0:t.call(n),o=a==null||(r=a.rowHeader)==null?void 0:r.width,s=a==null||(i=a.columnHeader)==null?void 0:i.height,c=typeof o==`number`&&o>0?Math.min(o,e.rowHeaderWidth):e.rowHeaderWidth,l=typeof s==`number`&&s>0?Math.min(s,e.columnHeaderHeight):e.columnHeaderHeight;return{rowBaseWidth:c,rowGutterWidth:Math.max(0,e.rowHeaderWidthAndMarginLeft-c),columnBaseHeight:l,columnGutterHeight:Math.max(0,e.columnHeaderHeightAndMarginTop-l)}}let yo=/* @__PURE__ */ function(e){return e.ROW=`row`,e.COLUMN=`column`,e}({});var bo=class{constructor(){z(this,`_visibleHandlers`,/* @__PURE__ */ new Set)}registerRangeVisibleHandler(e){this._visibleHandlers.add(e);let t=()=>this._visibleHandlers.delete(e);return{dispose:t,unsubscribe:t}}shouldRenderRange(e,t){let n=e;for(let e of this._visibleHandlers)n=e(n,t);return n}};let xo=`gray.900`,So=`gray.50`;var Co=class extends a.Shape{constructor(e,t){super(e,t),z(this,`_size`,12),z(this,`_iconRatio`,.4),z(this,`_mode`,0),this.setShapeProps(t)}setShapeProps(e){e!=null&&e.size&&(this._size=e.size),e!=null&&e.mode&&(this._mode=e.mode),this.transformByState({width:this._size,height:this._size})}_draw(e){this._mode===1&&a.Rect.drawWith(e,{width:this._size,height:this._size,radius:this._size,fill:`gray.200`});let t=this._size*.5*this._iconRatio,n=Math.PI/180*60,r=t*Math.sin(n),i=t*Math.cos(n);a.RegularPolygon.drawWith(e,{pointsGroup:[[{x:-r+this._size/2,y:-i+this._size/2},{x:r+this._size/2,y:-i+this._size/2},{x:this._size/2,y:t+this._size/2}]],fill:xo})}},wo=class extends a.Shape{constructor(e,t,n){super(e,t),z(this,`_size`,12),z(this,`_iconRatio`,.4),z(this,`_hovered`,!0),z(this,`_hasPrevious`,!0),z(this,`_hasNext`,!0),z(this,`_unhideType`,void 0),t&&this.setShapeProps(t),this.onPointerEnter$.subscribeEvent(()=>this.setShapeProps({hovered:!0})),this.onPointerLeave$.subscribeEvent(()=>this.setShapeProps({hovered:!1})),this.onPointerDown$.subscribeEvent(()=>n==null?void 0:n())}setShapeProps(e){e.type!==void 0&&(this._unhideType=e.type),e.hovered!==void 0&&(this._hovered=e.hovered),e.hasPrevious!==void 0&&(this._hasPrevious=e.hasPrevious),e.hasNext!==void 0&&(this._hasNext=e.hasNext),this.transformByState({width:this._size*(this._unhideType===1?2:1),height:this._size*(this._unhideType===0?2:1)})}_draw(e){this._unhideType===0?this._drawOnRow(e):this._drawOnCol(e)}_drawOnRow(e){this._hovered&&(!this._hasNext||!this._hasPrevious?a.Rect.drawWith(e,{width:this._size,height:this._size,stroke:xo,fill:So}):a.Rect.drawWith(e,{width:this._size,height:2*this._size,stroke:xo,fill:So}));let t=this._size*.5*this._iconRatio,n=Math.PI/3,r=t*Math.cos(n),i=t*Math.sin(n);if(this._hasPrevious&&a.RegularPolygon.drawWith(e,{pointsGroup:[[{x:this._size/2,y:this._size/2-i},{x:this._size/2-i,y:this._size/2+r},{x:this._size/2+i,y:this._size/2+r}]],fill:xo}),this._hasNext){let t=this._hasPrevious?3:1;a.RegularPolygon.drawWith(e,{pointsGroup:[[{x:this._size/2,y:this._size*t/2+i},{x:this._size/2-i,y:this._size*t/2-r},{x:this._size/2+i,y:this._size*t/2-r}]],fill:xo})}}_drawOnCol(e){this._hovered&&(!this._hasNext||!this._hasPrevious?a.Rect.drawWith(e,{width:this._size,height:this._size,stroke:xo,fill:So}):a.Rect.drawWith(e,{width:2*this._size,height:this._size,stroke:xo,fill:So}));let t=this._size*.5*this._iconRatio,n=Math.PI/3,r=t*Math.cos(n),i=t*Math.sin(n);if(this._hasPrevious&&a.RegularPolygon.drawWith(e,{pointsGroup:[[{x:-r+this._size/2,y:this._size/2},{x:this._size/2+i,y:this._size/2-i},{x:this._size/2+i,y:this._size/2+i}]],fill:xo}),this._hasNext){let t=this._hasPrevious?3:1;a.RegularPolygon.drawWith(e,{pointsGroup:[[{x:r+this._size*t/2,y:this._size/2},{x:-i+this._size*t/2,y:this._size/2-i},{x:-i+this._size*t/2,y:this._size/2+i}]],fill:xo})}}};let To=`__SpreadsheetHeaderUnhideSHAPEControllerShape__`,Eo=(0,n.createInterceptorKey)(`headerUnhideRangeVisibleCheck`),Do=class extends n.RxDisposable{get _workbook(){return this._context.unit}constructor(e,t,r,i){super(),this._context=e,this._sheetSkeletonManagerService=t,this._headerUnhideRangeService=r,this._commandService=i,z(this,`_shapes`,{cols:[],rows:[]}),z(this,`interceptor`,new n.InterceptorManager({HEADER_UNHIDE_RANGE_VISIBLE_CHECK:Eo})),this._init()}dispose(){super.dispose(),this._clearShapes(),this.interceptor.dispose()}_init(){let e=``;this._context.unit.activeSheet$.pipe((0,o.takeUntil)(this.dispose$)).subscribe(t=>{this._clearShapes(),t?(e=t.getSheetId(),this._update(this._workbook,t)):e=``}),this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.subscribe(t=>{if(t){let{unitId:n,sheetId:r}=t;if(n===this._workbook.getUnitId()&&r===e){let e=this._workbook.getSheetBySheetId(r);e&&this._update(this._workbook,e)}}}))}_update(e,t){var i;let a=(i=this._sheetSkeletonManagerService.getSkeletonParam(t.getSheetId()))==null?void 0:i.skeleton;if(!a)return;let o=this.interceptor.fetchThroughInterceptors(Eo),s=e=>this._headerUnhideRangeService.shouldRenderRange(o(!0,e)??!0,e),c=[],l=t.getRowManager().getRowData();for(let e of Object.keys(l)){let n=Number(e);n>=0&&n<t.getRowCount()&&t.getRowVisible(n)&&t.getRowHeight(n)===0&&c.push({startRow:n,endRow:n,startColumn:0,endColumn:t.getColumnCount()-1})}let u=[...t.getHiddenRows(),...n.Rectangle.mergeRanges(c)].map(e=>({...e,rangeType:n.RANGE_TYPE.ROW})).filter(n=>s({axis:`row`,range:n,workbook:e,worksheet:t})),d=n.Rectangle.mergeRanges(u).map(e=>({...e,rangeType:n.RANGE_TYPE.ROW})),f=[],p=t.getColumnManager().getColumnData();for(let e of Object.keys(p)){let n=Number(e);n>=0&&n<t.getColumnCount()&&t.getColVisible(n)&&t.getColumnWidth(n)===0&&f.push({startRow:0,endRow:t.getRowCount()-1,startColumn:n,endColumn:n})}let m=[...t.getHiddenCols(),...n.Rectangle.mergeRanges(f)].map(e=>({...e,rangeType:n.RANGE_TYPE.COLUMN})).filter(n=>s({axis:`column`,range:n,workbook:e,worksheet:t})),h=n.Rectangle.mergeRanges(m).map(e=>({...e,rangeType:n.RANGE_TYPE.COLUMN})),{scene:g}=this._getSheetObject(),_=t.getRowCount(),v=d.map(n=>{let{startRow:i,endRow:o}=n,s=or(i,0,g,a),c=i!==0,l=o!==_-1;return new wo(To,{type:0,hovered:!1,hasPrevious:c,hasNext:l,top:s.startY-(c?12:0),left:s.startX-12},()=>this._commandService.executeCommand(r.SetSpecificRowsVisibleCommand.id,{unitId:e.getUnitId(),subUnitId:t.getSheetId(),ranges:[n]}))}),y=t.getColumnCount(),b=h.map(n=>{let{startColumn:i,endColumn:o}=n,s=or(0,i,g,a),c=i!==0,l=o!==y-1;return new wo(To,{type:1,hovered:!1,hasPrevious:c,hasNext:l,top:Math.max(a.columnHeaderHeight,a.columnHeaderHeightAndMarginTop)-12,left:s.startX-(c?12:0)},()=>this._commandService.executeCommand(r.SetSpecificColsVisibleCommand.id,{unitId:e.getUnitId(),subUnitId:t.getSheetId(),ranges:[n]}))});g.addObjects(b,12),g.addObjects(v,12),this._clearShapes(),this._shapes={cols:b,rows:v}}_clearShapes(){this._shapes.cols.forEach(e=>e.dispose()),this._shapes.rows.forEach(e=>e.dispose()),this._shapes={cols:[],rows:[]}}_getSheetObject(){return ar(this._workbook,this._context)}};Do=K([G(1,(0,n.Inject)(q)),G(2,(0,n.Inject)(bo)),G(3,n.ICommandService)],Do);let Oo=/* @__PURE__ */ new Set([a.SHEET_VIEWPORT_KEY.VIEW_MAIN,a.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT_TOP,a.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT,a.SHEET_VIEWPORT_KEY.VIEW_MAIN_TOP]),ko=/* @__PURE__ */ new Set([a.SHEET_VIEWPORT_KEY.VIEW_ROW_TOP,a.SHEET_VIEWPORT_KEY.VIEW_ROW_BOTTOM]),Ao=/* @__PURE__ */ new Set([a.SHEET_VIEWPORT_KEY.VIEW_COLUMN_LEFT,a.SHEET_VIEWPORT_KEY.VIEW_COLUMN_RIGHT]),jo=[`__SpreadsheetSelectionShape__`,`__SpreadsheetSelectionTopControl__`,`__SpreadsheetSelectionBottomControl__`,`__SpreadsheetSelectionShapeLeftControl__`,`__SpreadsheetSelectionShapeRightControl__`,`__SpreadsheetSelectionExpandControlTopLeft__`,`__SpreadsheetSelectionExpandControlBottomRight__`,`__SpreadsheetSelectionBackgroundControlTop__`,`__SpreadsheetSelectionBackgroundControlMiddleLeft__`,`__SpreadsheetSelectionBackgroundControlMiddleRight__`,`__SpreadsheetSelectionBackgroundControlBottom__`],Mo=(0,n.createInterceptorKey)(`mobile-context-menu`);function No(e){return!!e&&jo.some(t=>e.startsWith(t))}function Po(e){return Oo.has(e)?i.ContextMenuPosition.MAIN_AREA:ko.has(e)?i.ContextMenuPosition.ROW_HEADER:Ao.has(e)?i.ContextMenuPosition.COL_HEADER:null}function Fo(e,t){return e.some(e=>n.Rectangle.contains(`range`in e?e.range:e,t))}let Io=class extends n.Disposable{constructor(e,t,r,i,a,o,s,c){super(),this._context=e,this._layoutService=t,this._contextMenuService=r,this._contextService=i,this._commandService=a,this._renderManagerService=o,this._selectionManagerService=s,this._sheetSkeletonManagerService=c,z(this,`contextMenuInterceptor`,new n.InterceptorManager({MOBILE_CONTEXT_MENU:Mo})),this.disposeWithMe((0,n.toDisposable)(()=>this.contextMenuInterceptor.dispose())),this._init()}_init(){let e=this._layoutService.getContentElement();if(!e)return;let t=this._createLongPressState(),r=!1;this.disposeWithMe(this._context.activated$.subscribe(e=>{r=e,r||this._resetLongPressState(t)}));let i=n=>{r&&this._handlePointerDown(e,t,n)},a=n=>this._handlePointerMove(e,t,n),o=e=>this._handlePointerUp(t,e),s=()=>this._resetLongPressState(t);e.addEventListener(`pointerdown`,i,!0),e.addEventListener(`pointermove`,a,!0),e.addEventListener(`pointerup`,o,!0),e.addEventListener(`pointercancel`,s,!0),this.disposeWithMe((0,n.toDisposable)(()=>{e.removeEventListener(`pointerdown`,i,!0),e.removeEventListener(`pointermove`,a,!0),e.removeEventListener(`pointerup`,o,!0),e.removeEventListener(`pointercancel`,s,!0),this._resetLongPressState(t)}))}_createLongPressState(){return{activeTouch:null,longPressTimer:null,longPressTriggered:!1,selectionSnapshot:[],target:null}}_clearLongPressTimer(e){e.longPressTimer!=null&&(clearTimeout(e.longPressTimer),e.longPressTimer=null)}_resetLongPressState(e){this._clearLongPressTimer(e),e.activeTouch=null,e.longPressTriggered=!1,e.target=null}_getPointerOffset(e,t){let n=e.getBoundingClientRect();return{clientX:t.clientX,clientY:t.clientY,offsetX:t.clientX-n.left,offsetY:t.clientY-n.top,pointerId:t.pointerId}}_getTargetCellByOffset(e,t,n){var r;let i=(r=this._sheetSkeletonManagerService.getCurrentParam())==null?void 0:r.skeleton,{scene:o}=this._context;if(!i)return null;let s=o.getCoordRelativeToViewport(a.Vector2.FromArray([e,t])),c=o.getScrollXYInfoByViewport(s,n),{scaleX:l,scaleY:u}=o.getAncestorScale();return i.getCellWithCoordByOffset(s.x,s.y,l,u,c)}_resolveLongPressTarget(e,t){let{scene:n}=this._context,r=n.getActiveViewportByCoord(a.Vector2.FromArray([e,t]));if(!r)return null;let o=Po(r.viewportKey);if(!o)return null;if(o!==i.ContextMenuPosition.MAIN_AREA)return{cell:null,menuPosition:o,selectionObjectPicked:!1};let s=n.pick(a.Vector2.FromArray([e,t])),c=No(s&&`oKey`in s?s.oKey:void 0);if(s&&s!==this._context.mainComponent&&!c)return null;let l=this._getTargetCellByOffset(e,t,r);return l?{cell:l,menuPosition:o,selectionObjectPicked:c}:null}_getCurrentRenderSelections(){let e=this._renderManagerService.getRenderUnitById(this._context.unitId),t=e==null?void 0:e.with(W);return(t==null?void 0:t.getSelectionControls().map(e=>(0,r.convertSelectionDataToRange)(e.getValue())))??[]}_cloneSelections(e){return e.map(e=>({range:{...e.range},primary:e.primary?{...e.primary}:e.primary,style:e.style?{...e.style}:e.style}))}_getSelectionSnapshot(){let e=this._getCurrentRenderSelections();return e.length?this._cloneSelections(e):this._cloneSelections(this._selectionManagerService.getCurrentSelections())}_selectTargetCell(e){let t=this._context.unit.getActiveSheet();if(!t)return!1;let{startRow:i,endRow:a,startColumn:o,endColumn:s}=e.mergeInfo;return this._commandService.syncExecuteCommand(r.SetSelectionsOperation.id,{unitId:this._context.unitId,subUnitId:t.getSheetId(),type:r.SelectionMoveType.MOVE_END,selections:[{range:{startRow:i,endRow:a,startColumn:o,endColumn:s,rangeType:n.RANGE_TYPE.NORMAL},primary:(0,r.convertPrimaryWithCoordToPrimary)(e),style:null}]})}_openMenu(e,t,n){let r=new MouseEvent(`contextmenu`,{clientX:e,clientY:t});this._contextMenuService.triggerContextMenu(r,n,{unitId:this._context.unitId})}_triggerLongPress(e){var t,n;e.longPressTimer=null;let{activeTouch:r,target:a}=e;if(!r||!a||this._contextMenuService.visible||this._contextService.getContextValue(`MOBILE_PINCH_ZOOMING`)||this._contextService.getContextValue(`MOBILE_EXPANDING_SELECTION`)||a.menuPosition===i.ContextMenuPosition.MAIN_AREA&&a.cell&&!a.selectionObjectPicked&&!Fo(e.selectionSnapshot,a.cell.mergeInfo)&&!this._selectTargetCell(a.cell))return;e.longPressTriggered=!0,this._contextService.setContextValue(Jr,!0);let o=this._context.unit.getActiveSheet();o&&(this.contextMenuInterceptor.fetchThroughInterceptors(Mo)(!1,{col:(t=a.cell)==null?void 0:t.actualColumn,menuPosition:a.menuPosition,row:(n=a.cell)==null?void 0:n.actualRow,subUnitId:o.getSheetId(),unitId:this._context.unitId})||this._openMenu(r.clientX,r.clientY,a.menuPosition))}_handlePointerDown(e,t,n){if(this._resetLongPressState(t),this._contextService.setContextValue(Jr,!1),this._contextMenuService.visible){this._contextMenuService.hideContextMenu();return}if(!n.isPrimary||n.button!==0||this._contextService.getContextValue(`MOBILE_PINCH_ZOOMING`)||this._contextService.getContextValue(`MOBILE_EXPANDING_SELECTION`))return;let r=this._getPointerOffset(e,n),i=this._resolveLongPressTarget(r.offsetX,r.offsetY);i&&(t.activeTouch=r,t.selectionSnapshot=this._getSelectionSnapshot(),t.target=i,t.longPressTimer=setTimeout(()=>this._triggerLongPress(t),500))}_handlePointerMove(e,t,n){if(!t.activeTouch||!n.isPrimary||n.pointerId!==t.activeTouch.pointerId){this._resetLongPressState(t);return}let r=this._getPointerOffset(e,n);(Math.abs(r.offsetX-t.activeTouch.offsetX)>10||Math.abs(r.offsetY-t.activeTouch.offsetY)>10)&&this._resetLongPressState(t)}_handlePointerUp(e,t){var n;((n=e.activeTouch)==null?void 0:n.pointerId)===t.pointerId&&(e.longPressTriggered&&t.preventDefault(),this._resetLongPressState(e))}};Io=K([G(1,i.ILayoutService),G(2,i.IContextMenuService),G(3,n.IContextService),G(4,n.ICommandService),G(5,a.IRenderManagerService),G(6,(0,n.Inject)(r.SheetsSelectionsService)),G(7,(0,n.Inject)(q))],Io);let Lo=class extends n.RxDisposable{constructor(e,t,n,r,i,a,s){super(),this._context=e,this._configService=t,this._sheetSkeletonManagerService=n,this._sheetRenderService=r,this._commandService=i,this._telemetryService=a,this._formulaDataModel=s,z(this,`_arrayFormulaSheets`,void 0),z(this,`_hadEmbeddedArrayData`,void 0),z(this,`_renderMetric$`,new o.Subject),z(this,`renderMetric$`,this._renderMetric$.asObservable()),z(this,`_renderFrameTimeMetric`,null),z(this,`_renderFrameTags`,{}),z(this,`_afterRenderMetric$`,new o.Subject),this._formulaDataModel&&(this._arrayFormulaSheets=Ro(this._context.unitId,{arrayFormulaCellData:this._formulaDataModel.getArrayFormulaCellData(),arrayFormulaRange:this._formulaDataModel.getArrayFormulaRange()})),this._addNewRender(),this._initRenderMetricSubscriber()}_getSheetType(){var e;return(e=this._context.unit.getActiveSheet())==null?void 0:e.getConfig().type}_addNewRender(){let{scene:e,engine:t,unit:n}=this._context;this._addComponent(n),this._initWorksheetVisibility(),this._initRerenderScheduler(),this._initCommandListener();let r=this._context.unit.getActiveSheet();if(!r)throw Error(`No active sheet found`);let i=r.getSheetId();this._sheetSkeletonManagerService.setCurrent({sheetId:i});let a=()=>e.render();this.disposeWithMe(this._context.activated$.subscribe(e=>{e?t.runRenderLoop(a):t.stopRenderLoop(a)}))}_initRenderMetricSubscriber(){let{engine:e}=this._context;this.disposeWithMe(e.beginFrame$.subscribe(()=>{this._renderFrameTimeMetric=null,this._renderFrameTags={}})),this.disposeWithMe(e.endFrame$.subscribe(()=>{this._renderFrameTimeMetric&&Object.keys(this._renderFrameTimeMetric).some(e=>e.startsWith(a.SHEET_EXTENSION_PREFIX))&&this._afterRenderMetric$.next({frameTimeMetric:this._renderFrameTimeMetric,tags:this._renderFrameTags})})),this.disposeWithMe(e.renderFrameTimeMetric$.subscribe(([e,t])=>{this._renderFrameTimeMetric||={},this._renderFrameTimeMetric[e]||(this._renderFrameTimeMetric[e]=[]),this._renderFrameTimeMetric[e].push(Math.round(t*100)/100)})),this.disposeWithMe(e.renderFrameTags$.subscribe(([e,t])=>{this._renderFrameTags[e]=t}));let t=[];this.disposeWithMe(this._afterRenderMetric$.pipe((0,o.withLatestFrom)(e.endFrame$)).subscribe(([e,n])=>{t.push({FPS:n.FPS,elapsedTime:n.elapsedTime,frameTime:Math.round(n.frameTime*100)/100,...e.frameTimeMetric,...e.tags}),t.length>60&&(this._captureRenderMetric(t),t.length=0)}))}_captureRenderMetric(e){var t;let n=e;if(n.length===0)return;let r=e=>{let t=0,n=Object.entries(e).filter(([e,t])=>Array.isArray(t)).map(([e])=>e).reduce((t,n)=>(t[n]=e[n].reduce((e,t)=>e+t,0),t),{});return Object.keys(e).filter(e=>e.startsWith(a.SHEET_EXTENSION_PREFIX)).forEach(e=>{t+=n[e]}),{...n,extensionTotal:t}},i=(e=>Object.entries(e[0]).filter(([e,t])=>![`elapsedTime`].includes(e)).filter(([e,t])=>typeof t==`number`).map(([e])=>e).reduce((t,n)=>{let r=e.map(e=>e[n]),i=Math.max(...r),a=Math.min(...r),o=r.reduce((e,t)=>e+t,0)/r.length;return t[n]={max:Math.round(i*100)/100,min:Math.round(a*100)/100,avg:Math.round(o*100)/100},t},{}))(e.map(e=>({...e,...r(e)}))),o=n[n.length-1].elapsedTime,s={sheetId:this._context.unit.getActiveSheet().getSheetId(),unitId:this._context.unit.getUnitId(),elapsedTimeToStart:o,...i};this._renderMetric$.next(s),(t=this._telemetryService)==null||t.capture(`sheet_render_cost`,s)}_addComponent(e){let{scene:t,components:r}=this._context,i=e.getActiveSheet(),o=new a.Spreadsheet(`__SpreadsheetRender__`);this._addViewport(i);let s=new a.SpreadsheetRowHeader(`__SpreadsheetRowHeader__`),c=new a.SpreadsheetColumnHeader(`__SpreadsheetColumnHeader__`),l=new a.Rect(`__SpreadsheetLeftTopPlaceholder__`,{zIndex:2,left:-1,top:-1,fill:`gray.50`,stroke:`gray.200`,strokeWidth:1});l.viewportCacheReusable=!0,t.setViewportCacheReuseKey(a.SHEET_VIEWPORT_KEY.VIEW_MAIN),this.disposeWithMe((0,n.toDisposable)(()=>t.setViewportCacheReuseKey(null))),this._context.mainComponent=o,r.set(`__SpreadsheetRender__`,o),r.set(`__SpreadsheetRowHeader__`,s),r.set(`__SpreadsheetColumnHeader__`,c),r.set(`__SpreadsheetLeftTopPlaceholder__`,l),t.addObjects([o],0),t.addObjects([s,c,l],10),t.enableLayerCache(0,10)}_initViewports(e,t,n){let r=t.hidden?0:t.width,i=n.hidden?0:n.height,o=new a.Viewport(a.SHEET_VIEWPORT_KEY.VIEW_MAIN,e,{left:r,top:i,bottom:0,right:0,isWheelPreventDefaultX:!0,allowCache:!0,bufferEdgeX:100,bufferEdgeY:100}),s=new a.Viewport(a.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT_TOP,e,{isWheelPreventDefaultX:!0,active:!1,allowCache:!0,bufferEdgeX:0,bufferEdgeY:0}),c=new a.Viewport(a.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT,e,{isWheelPreventDefaultX:!0,active:!1,allowCache:!0,bufferEdgeX:0,bufferEdgeY:100}),l=new a.Viewport(a.SHEET_VIEWPORT_KEY.VIEW_MAIN_TOP,e,{isWheelPreventDefaultX:!0,active:!1,allowCache:!0,bufferEdgeX:100,bufferEdgeY:0}),u=new a.Viewport(a.SHEET_VIEWPORT_KEY.VIEW_ROW_TOP,e,{active:!1,isWheelPreventDefaultX:!0}),d=new a.Viewport(a.SHEET_VIEWPORT_KEY.VIEW_ROW_BOTTOM,e,{left:0,top:i,bottom:0,width:r+1,isWheelPreventDefaultX:!0}),f=new a.Viewport(a.SHEET_VIEWPORT_KEY.VIEW_COLUMN_LEFT,e,{active:!1,isWheelPreventDefaultX:!0}),p=new a.Viewport(a.SHEET_VIEWPORT_KEY.VIEW_COLUMN_RIGHT,e,{left:r,top:0,height:i+1,right:0,isWheelPreventDefaultX:!0});return{viewMain:o,viewLeftTop:new a.Viewport(a.SHEET_VIEWPORT_KEY.VIEW_LEFT_TOP,e,{left:0,top:0,width:r,height:i,isWheelPreventDefaultX:!0}),viewMainLeftTop:s,viewMainLeft:c,viewMainTop:l,viewColumnLeft:f,viewRowTop:u,viewRowBottom:d,viewColumnRight:p}}_addViewport(e){let t=this._context.scene,{rowHeader:n,columnHeader:r}=e.getConfig(),{viewMain:i}=this._initViewports(t,n,r),o=this._configService.getConfig(U),s=o==null?void 0:o.scrollConfig;return new a.ScrollBar(i,s),t.attachControl(),i}_initWorksheetVisibility(){let e=!1;this.disposeWithMe(this._context.unit.activeSheet$.subscribe(t=>{let{scene:r,components:i}=this._context,o=(t==null?void 0:t.getConfig().type)===n.SheetTypes.CHART;if(o||e){e=o;for(let e of[`__SpreadsheetRender__`,`__SpreadsheetRowHeader__`,`__SpreadsheetColumnHeader__`,`__SpreadsheetLeftTopPlaceholder__`]){let t=i.get(e);o?t==null||t.hide():t==null||t.show()}if(o)for(let e of[a.SHEET_VIEWPORT_KEY.VIEW_MAIN,a.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT_TOP,a.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT,a.SHEET_VIEWPORT_KEY.VIEW_MAIN_TOP,a.SHEET_VIEWPORT_KEY.VIEW_ROW_TOP,a.SHEET_VIEWPORT_KEY.VIEW_ROW_BOTTOM,a.SHEET_VIEWPORT_KEY.VIEW_COLUMN_LEFT,a.SHEET_VIEWPORT_KEY.VIEW_COLUMN_RIGHT,a.SHEET_VIEWPORT_KEY.VIEW_LEFT_TOP]){let t=r.getViewport(e);t&&(t.viewportKey===a.SHEET_VIEWPORT_KEY.VIEW_MAIN?(t.enable(),t.setMargin(0,0),t.resetPadding(),t.resizeWhenFreezeChange({left:0,top:0,right:0,bottom:0})):t.disable())}else for(let e of[a.SHEET_VIEWPORT_KEY.VIEW_MAIN,a.SHEET_VIEWPORT_KEY.VIEW_ROW_BOTTOM,a.SHEET_VIEWPORT_KEY.VIEW_COLUMN_RIGHT,a.SHEET_VIEWPORT_KEY.VIEW_LEFT_TOP]){var s;(s=r.getViewport(e))==null||s.enable()}r.makeDirty()}}))}_initRerenderScheduler(){this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.subscribe(e=>{if(!e)return null;let{skeleton:t,sheetId:r}=e,i=this._context.unit,a=i==null?void 0:i.getSheetBySheetId(r);if(!a||a!==i.getActiveSheet()||a.getConfig().type===n.SheetTypes.CHART)return;let{mainComponent:o,components:s}=this._context,c=o,l=s.get(`__SpreadsheetRowHeader__`),u=s.get(`__SpreadsheetColumnHeader__`),d=s.get(`__SpreadsheetLeftTopPlaceholder__`),f=zo(t);c==null||c.updateSkeleton(t),l==null||l.updateSkeleton(t),u==null||u.updateSkeleton(t),d==null||d.transformByState({width:f.width,height:f.height})}))}_initCommandListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(e=>{e.id!==dr.id&&e.id!==ur.id&&this._context.scene.invalidateViewportCacheReuse()})),this.disposeWithMe(this._commandService.onCommandExecuted((e,t)=>{let{unit:i}=this._context,{id:a}=e;if(r.COMMAND_LISTENER_SKELETON_CHANGE.includes(a)||this._sheetRenderService.checkMutationShouldTriggerRerender(a)){let{unitId:t,subUnitId:n}=e.params,r=i.getActiveSheet();if(!r)return;let o=this._context.unitId,s=r.getSheetId();if(t!==o||n!==s)return;this._sheetSkeletonManagerService.makeDirty({sheetId:s,commandId:a},!0),this._sheetSkeletonManagerService.setCurrent({sheetId:s,commandId:a})}else r.COMMAND_LISTENER_VALUE_CHANGE.includes(a)&&this._sheetSkeletonManagerService.reCalculate();e.type===n.CommandType.MUTATION&&this._markUnitDirty(e,t)}))}_markUnitDirty(e,t){if(e.id.substring(0,3)===`doc`||!this._sheetRenderService.shouldAutomaticallyRenderMutation(e.id))return;let i=!0;if(e.id===u.SetArrayFormulaDataMutation.id&&e.params){var a;let t=e.params,n=Ro(this._context.unitId,t),r=this._arrayFormulaSheets;this._arrayFormulaSheets=n;let o=(a=this._context.unit.getActiveSheet())==null?void 0:a.getSheetId(),s=this._hadEmbeddedArrayData,c=Object.values(t.arrayFormulaEmbedded??{}).some(e=>Object.values(e??{}).some(e=>Object.keys(e??{}).length>0));this._hadEmbeddedArrayData=c,r&&o&&!r.has(o)&&!n.has(o)&&s===!1&&!c&&(i=!1)}let{mainComponent:o,scene:s}=this._context;if(e.id===u.SetFormulaCalculationNotificationMutation.id&&e.params.stageInfo!=null||(o&&i&&o.makeDirty(),s.makeDirty(),!e.params||this._getSheetType()===n.SheetTypes.CHART))return;let c=e.params,l=this._spreadsheetViewports(s);if(e.id===r.SetRangeValuesMutation.id&&c.cellValue&&!(t!=null&&t.fromChangeset)){let e=this._cellValueToRange(c.cellValue),t=this._rangeToBounds([e]);this._markViewportDirty(l,t),o.setDirtyArea(t)}if(e.id===r.MoveRangeMutation.id&&c.from&&c.to&&!(t!=null&&t.fromChangeset)){let e=c.fromRange||this._cellValueToRange(c.from.value),t=c.toRange||this._cellValueToRange(c.to.value),n=this._rangeToBounds([e,t]);this._markViewportDirty(l,n),o.setDirtyArea(n)}}_cellValueToRange(e){let t=[],n=0,r=0,i=0,a=0;for(let[o,s]of Object.entries(e)){for(let e in s)t.push(Number(e)),n>Number(e)&&(n=Number(e)),r<Number(e)&&(r=Number(e));i>Number(o)&&(i=Number(o)),a<Number(o)&&(a=Number(o))}return{startRow:i,endRow:a,startColumn:n,endColumn:r}}_rangeToBounds(e){let t=this._sheetSkeletonManagerService.getCurrentParam();if(!t)return[];let{rowHeightAccumulation:n,columnWidthAccumulation:r,rowHeaderWidth:i,columnHeaderHeight:a}=t.skeleton,o=[];for(let t of e){let{startRow:e,endRow:s,startColumn:c,endColumn:l}=t,u=e===0?0:n[e-1]+a,d=n[s]+a,f=c===0?0:r[c-1]+i,p=r[l]+i;o.push({top:u,left:f,bottom:d,right:p,width:p-f,height:d-u})}return o}_markViewportDirty(e,t){let r=e.filter(e=>e.isActive&&e.cacheBound);for(let e of r)for(let r of t)n.Rectangle.hasIntersectionBetweenTwoRect(e.cacheBound,r)&&e.markDirty(!0)}_spreadsheetViewports(e){return e.getViewports().filter(e=>[`viewMain`,`viewMainLeftTop`,`viewMainTop`,`viewMainLeft`].includes(e.viewportKey))}};Lo=K([G(1,(0,n.Inject)(n.IConfigService)),G(2,(0,n.Inject)(q)),G(3,(0,n.Inject)(ii)),G(4,n.ICommandService),G(5,(0,n.Optional)(d.ITelemetryService)),G(6,(0,n.Optional)(u.FormulaDataModel))],Lo);function Ro(e,t){let n=/* @__PURE__ */ new Set;for(let r of[t.arrayFormulaCellData,t.arrayFormulaRange]){let t=r==null?void 0:r[e];for(let e in t)t[e]&&Object.keys(t[e]).length&&n.add(e)}return n}function zo(e){return{width:e.rowHeaderWidthAndMarginLeft??e.rowHeaderWidth,height:e.columnHeaderHeightAndMarginTop??e.columnHeaderHeight}}var Bo=class{constructor(){z(this,`_functions`,[{func:u.FUNCTION_NAMES_STATISTICAL.MAX,filter:e=>{var t,n;return(((t=e.values.find(e=>e.func===u.FUNCTION_NAMES_STATISTICAL.COUNTA))==null?void 0:t.value)??0)>1&&(((n=e.values.find(e=>e.func===u.FUNCTION_NAMES_STATISTICAL.COUNT))==null?void 0:n.value)??0)>0}},{func:u.FUNCTION_NAMES_STATISTICAL.MIN,filter:e=>{var t,n;return(((t=e.values.find(e=>e.func===u.FUNCTION_NAMES_STATISTICAL.COUNTA))==null?void 0:t.value)??0)>1&&(((n=e.values.find(e=>e.func===u.FUNCTION_NAMES_STATISTICAL.COUNT))==null?void 0:n.value)??0)>0}},{func:u.FUNCTION_NAMES_MATH.SUM,filter:e=>{var t,n;return(((t=e.values.find(e=>e.func===u.FUNCTION_NAMES_STATISTICAL.COUNTA))==null?void 0:t.value)??0)>1&&(((n=e.values.find(e=>e.func===u.FUNCTION_NAMES_STATISTICAL.COUNT))==null?void 0:n.value)??0)>0}},{func:u.FUNCTION_NAMES_STATISTICAL.COUNTA,filter:e=>{var t;return(((t=e.values.find(e=>e.func===u.FUNCTION_NAMES_STATISTICAL.COUNTA))==null?void 0:t.value)??0)>1}},{func:u.FUNCTION_NAMES_STATISTICAL.COUNT,filter:e=>{var t,n;return(((t=e.values.find(e=>e.func===u.FUNCTION_NAMES_STATISTICAL.COUNTA))==null?void 0:t.value)??0)>1&&(((n=e.values.find(e=>e.func===u.FUNCTION_NAMES_STATISTICAL.COUNT))==null?void 0:n.value)??0)>0}},{func:u.FUNCTION_NAMES_STATISTICAL.AVERAGE,filter:e=>{var t,n;return(((t=e.values.find(e=>e.func===u.FUNCTION_NAMES_STATISTICAL.COUNTA))==null?void 0:t.value)??0)>1&&(((n=e.values.find(e=>e.func===u.FUNCTION_NAMES_STATISTICAL.COUNT))==null?void 0:n.value)??0)>0}}]),z(this,`_state$`,new o.BehaviorSubject(null)),z(this,`state$`,this._state$.asObservable())}dispose(){this._state$.complete()}setState(e){let t={values:[],pattern:null};e==null||e.values.forEach(n=>{let r=this._functions.find(e=>e.func===n.func);r&&(r.filter===void 0||r.filter(e))&&t.values.push(n)}),t.pattern=(e==null?void 0:e.pattern)??null,this._state$.next(t)}getState(){return this._state$.getValue()}getFunctions(){return this._functions}addFunctions(e){this._functions.push(...e)}};let Vo=(0,n.createIdentifier)(`univer.sheet-status-bar.service`),Ho=(0,n.createInterceptorKey)(`statusBarPermissionCorrect`);var Uo=class{constructor(){z(this,`_sum`,0),z(this,`_count`,0),z(this,`_countNumber`,0),z(this,`_min`,1/0),z(this,`_max`,-1/0)}add(e,t,r){if(!n.Tools.isDefine(e==null?void 0:e.v))return;let i=e==null?void 0:e.t,{v:a}=e,o=e=>{this._sum+=e,this._countNumber++,this._min=Math.min(this._min,e),this._max=Math.max(this._max,e)},s=(e,t,r)=>{var i;if(!(e!=null&&(i=e.n)!=null&&i.pattern))return;let{pattern:a}=e.n;r[a]||(r[a]=n.numfmt.getFormatInfo(a)),r[a].isDate&&o(t)};if(typeof a==`string`&&i===n.CellValueType.NUMBER){let e=Number(a);Number.isNaN(e)||(a=e)}typeof a==`number`&&i!==n.CellValueType.STRING?o(a):i===n.CellValueType.NUMBER&&e.s&&s(t.get(e.s),a,r),this._count++}getResults(){return{sum:this._sum,count:this._countNumber,countA:this._count,min:this._min,max:this._max}}};function Wo(e){let{sum:t,count:n,countA:r,min:i,max:a}=e.getResults();return[{func:u.FUNCTION_NAMES_STATISTICAL.MAX,value:a},{func:u.FUNCTION_NAMES_STATISTICAL.MIN,value:i},{func:u.FUNCTION_NAMES_MATH.SUM,value:t},{func:u.FUNCTION_NAMES_STATISTICAL.COUNTA,value:r},{func:u.FUNCTION_NAMES_STATISTICAL.COUNT,value:n},{func:u.FUNCTION_NAMES_STATISTICAL.AVERAGE,value:t/n}]}let Go=class extends n.Disposable{constructor(e,t,r,i,a,o){super(),this._univerInstanceService=e,this._selectionManagerService=t,this._statusBarService=r,this._commandService=i,this._numfmtService=a,this._formulaDataModel=o,z(this,`interceptor`,new n.InterceptorManager({STATUS_BAR_PERMISSION_CORRECT:Ho})),this._init()}_init(){this._registerSelectionListener()}_registerSelectionListener(){let e=(0,n.debounce)(e=>{var t;let n=(t=e[e.length-1])==null?void 0:t.primary;this._calculateSelection(e.map(e=>e.range),n)},100),t=(0,n.debounce)(e=>{var t;let n=(t=e[e.length-1])==null?void 0:t.primary;this._calculateSelection(e.map(e=>e.range),n)},500);this.disposeWithMe((0,n.toDisposable)(this._selectionManagerService.selectionMoving$.subscribe(e=>{e&&t(e)}))),this.disposeWithMe((0,n.toDisposable)(this._selectionManagerService.selectionMoveEnd$.subscribe(t=>{t&&e(t)}))),this.disposeWithMe((0,n.toDisposable)(this._selectionManagerService.selectionSet$.subscribe(t=>{t&&e(t)}))),this.disposeWithMe(this._commandService.onCommandExecuted(t=>{if(t.id===r.SetRangeValuesMutation.id){let r=this._selectionManagerService.getCurrentSelections(),{cellValue:i}=t.params;if(r&&r.length>0&&i){let t=new n.ObjectMatrix(i),a=!1;t.forValue((e,t)=>{if(r.some(n=>{let r=n.range;return e>=r.startRow&&e<=r.endRow&&t>=r.startColumn&&t<=r.endColumn}))return a=!0,!1}),a&&e(r)}}}))}_clearResult(){this._statusBarService.setState(null)}getRangeStartEndInfo(e,t){return e.rangeType===n.RANGE_TYPE.ALL?{startRow:0,startColumn:0,endRow:t.getRowCount()-1,endColumn:t.getColumnCount()-1}:e.rangeType===n.RANGE_TYPE.COLUMN?{startRow:0,startColumn:e.startColumn,endRow:t.getRowCount()-1,endColumn:e.endColumn}:e.rangeType===n.RANGE_TYPE.ROW?{startRow:e.startRow,startColumn:0,endRow:e.endRow,endColumn:t.getColumnCount()-1}:{startRow:e.startRow,startColumn:e.startColumn,endRow:e.endRow,endColumn:e.endColumn}}_getCellValue(e,t,n,r){var i;let a=n.getCellRaw(e,t),o=r==null||(i=r[e])==null?void 0:i[t];return o?{t:o.t??(a==null?void 0:a.t),v:o.v??(a==null?void 0:a.v),s:o.s??(a==null?void 0:a.s)}:a}_calculateSelection(e,t){let r=this._univerInstanceService.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET);if(!r)return this._clearResult();let i=r.getUnitId(),a=r.getActiveSheet(),o=a==null?void 0:a.getSheetId();if(!o)return this._clearResult();let s={};if(this._univerInstanceService.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET).getSheets().forEach(e=>{let t=e.getConfig();s[e.getSheetId()]={cellData:new n.ObjectMatrix(t.cellData),rowCount:t.rowCount,columnCount:t.columnCount,rowData:t.rowData,columnData:t.columnData}}),e!=null&&e.length){var c;let s=[];e.forEach(e=>{let{startRow:t,endRow:n}=e,r=null;for(let i=t;i<=n;i++)a.getRowVisible(i)?r===null&&(r=i):r!==null&&(s.push({...e,startRow:r,endRow:i-1}),r=null);r!==null&&s.push({...e,startRow:r,endRow:n})});let u=(0,n.splitIntoGrid)(s),d=new Uo,f=r.getStyles(),p={},m=this._formulaDataModel.getArrayFormulaCellData(),h=m==null||(c=m[i])==null?void 0:c[o];for(let e of u){let{startRow:t,startColumn:n,endColumn:r,endRow:i}=this.getRangeStartEndInfo(e,a);for(let e=t;e<=i;e++)for(let t=n;t<=r;t++){let n=this._getCellValue(e,t,a,h);d.add(n,f,p)}}let g=Wo(d);if(g.every(e=>e===void 0))return;let _=null;if(t){var l;let{actualRow:e,actualColumn:n}=t;_=(l=this._numfmtService.getValue(i,o,e,n))==null?void 0:l.pattern}let v={values:g.filter(e=>e!==void 0),pattern:_};this._statusBarService.setState(v)}else this._clearResult()}};Go=K([G(0,n.IUniverInstanceService),G(1,(0,n.Inject)(r.SheetsSelectionsService)),G(2,Vo),G(3,n.ICommandService),G(4,(0,n.Inject)(r.INumfmtService)),G(5,(0,n.Inject)(u.FormulaDataModel))],Go);let Ko={type:n.CommandType.COMMAND,id:`sheet.command.move-range-confirm`,handler:async(e,t)=>{var i;if(!t||!await e.get(r.SheetInterceptorService).beforeCommandExecute({id:r.MoveRangeCommand.id,params:t}))return!1;let a=e.get(n.ICommandService);if(((i=e.get(n.IConfigService).getConfig(`sheets-ui.config`))==null?void 0:i.warnBeforeDragOverwrite)===!1)return a.executeCommand(r.MoveRangeCommand.id,t);let o=e.get(n.IUniverInstanceService),s=(0,r.getSheetCommandTarget)(o,{unitId:t.fromUnitId,subUnitId:t.fromSubUnitId}),c=(0,r.getSheetCommandTarget)(o,{unitId:t.toUnitId??t.fromUnitId,subUnitId:t.toSubUnitId??t.fromSubUnitId});if(!c)return a.executeCommand(r.MoveRangeCommand.id,t);if(((s==null?void 0:s.unitId)===c.unitId&&s.subUnitId===c.subUnitId?n.Rectangle.subtract(t.toRange,t.fromRange):[t.toRange]).some(e=>(0,r.findFirstNonEmptyCell)(e,c.worksheet)!==null)){let t=e.get(n.LocaleService);if(!await e.get(n.IConfirmService).confirm({id:Ko.id,title:{title:t.t(`sheets-ui.merge.confirm.warning`)},children:{title:t.t(`sheets-ui.info.overwriteCellContent`)},cancelText:t.t(`sheets-ui.button.cancel`),confirmText:t.t(`sheets-ui.button.confirm`)}))return!1}return a.executeCommand(r.MoveRangeCommand.id,t)}},qo={id:`sheet.command.set-zoom-ratio-from-toolbar`,type:n.CommandType.COMMAND,handler:(e,t)=>{if(!t||!Number.isFinite(t.value))return!1;let i=(0,r.getSheetCommandTarget)(e.get(n.IUniverInstanceService));if(!i)return!1;let a=Math.min(M[1],Math.max(M[0],t.value));return e.get(n.ICommandService).executeCommand(Mr.id,{unitId:i.unitId,subUnitId:i.subUnitId,zoomRatio:a/100})}},Jo=`UI_PLUGIN_SHEETS`,Yo=`${Jo}_BORDER_PANEL_COMPONENT`,Xo=[{label:`sheets-ui.borderLine.borderTop`,icon:`UpBorderDoubleIcon`,value:n.BorderType.TOP},{label:`sheets-ui.borderLine.borderBottom`,icon:`DownBorderDoubleIcon`,value:n.BorderType.BOTTOM},{label:`sheets-ui.borderLine.borderLeft`,icon:`LeftBorderDoubleIcon`,value:n.BorderType.LEFT},{label:`sheets-ui.borderLine.borderRight`,icon:`RightBorderDoubleIcon`,value:n.BorderType.RIGHT},{label:`sheets-ui.borderLine.borderNone`,icon:`NoBorderIcon`,value:n.BorderType.NONE},{label:`sheets-ui.borderLine.borderAll`,icon:`AllBorderIcon`,value:n.BorderType.ALL},{label:`sheets-ui.borderLine.borderOutside`,icon:`OuterBorderDoubleIcon`,value:n.BorderType.OUTSIDE},{label:`sheets-ui.borderLine.borderInside`,icon:`InnerBorderDoubleIcon`,value:n.BorderType.INSIDE},{label:`sheets-ui.borderLine.borderHorizontal`,icon:`HorizontalBorderDoubleIcon`,value:n.BorderType.HORIZONTAL},{label:`sheets-ui.borderLine.borderVertical`,icon:`VerticalBorderDoubleIcon`,value:n.BorderType.VERTICAL},{label:`sheets-ui.borderLine.borderTlbr`,icon:`BackSlashDoubleIcon`,value:n.BorderType.TLBR},{label:`sheets-ui.borderLine.borderTlbcTlmr`,icon:`LeftDoubleDiagonalDoubleIcon`,value:n.BorderType.TLBC_TLMR},{label:`sheets-ui.borderLine.borderTlbrTlbcTlmr`,icon:`LeftTridiagonalDoubleIcon`,value:n.BorderType.TLBR_TLBC_TLMR},{label:`sheets-ui.borderLine.borderBlTr`,icon:`SlashDoubleIcon`,value:n.BorderType.BLTR},{label:`sheets-ui.borderLine.borderMltrBctr`,icon:`RightDoubleDiagonalDoubleIcon`,value:n.BorderType.MLTR_BCTR}],Zo=[{label:`sheets-ui.borderStyle.thin`,value:n.BorderStyleTypes.THIN},{label:`sheets-ui.borderStyle.hair`,value:n.BorderStyleTypes.HAIR},{label:`sheets-ui.borderStyle.dotted`,value:n.BorderStyleTypes.DOTTED},{label:`sheets-ui.borderStyle.dashed`,value:n.BorderStyleTypes.DASHED},{label:`sheets-ui.borderStyle.dashDot`,value:n.BorderStyleTypes.DASH_DOT},{label:`sheets-ui.borderStyle.dashDotDot`,value:n.BorderStyleTypes.DASH_DOT_DOT},{label:`sheets-ui.borderStyle.medium`,value:n.BorderStyleTypes.MEDIUM},{label:`sheets-ui.borderStyle.mediumDashed`,value:n.BorderStyleTypes.MEDIUM_DASHED},{label:`sheets-ui.borderStyle.mediumDashDot`,value:n.BorderStyleTypes.MEDIUM_DASH_DOT},{label:`sheets-ui.borderStyle.mediumDashDotDot`,value:n.BorderStyleTypes.MEDIUM_DASH_DOT_DOT},{label:`sheets-ui.borderStyle.thick`,value:n.BorderStyleTypes.THICK},{label:`sheets-ui.borderStyle.double`,value:n.BorderStyleTypes.DOUBLE}];function Qo(e){return(0,o.merge)(e.activeSheet$,e.sheetDisposed$.pipe((0,f.map)(()=>e.getActiveSheet(!0)))).pipe((0,f.map)(t=>!t||!e.getSheetBySheetId(t.getSheetId())?null:t))}function $o(e){return e.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET).pipe((0,f.switchMap)(e=>e?Qo(e).pipe((0,f.map)(t=>t?{workbook:e,worksheet:t}:null)):(0,o.of)(null)))}function Z(e,t,n){return $o(e).pipe((0,f.switchMap)(e=>e?n(e):(0,o.of)(t)))}function es(e,t){let i=e.get(n.IUniverInstanceService),a=e.get(r.IExclusiveRangeService),s=e.get(r.SheetsSelectionsService);return i.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET).pipe((0,f.switchMap)(e=>e?e.activeSheet$.pipe((0,f.switchMap)(e=>e?s.selectionMoveEnd$.pipe((0,f.map)(()=>s.getCurrentSelections()),(0,f.startWith)(s.getCurrentSelections()),(0,f.map)(e=>{if(e.length===0)return!1;let n=a.getInterestGroupId([...e]);return t?n.some(e=>t.has(e)):n.length>0})):(0,o.of)(!1))):(0,o.of)(!1)))}function ts(e,t,n){return(0,o.combineLatest)([t,es(e,n)]).pipe((0,f.map)(([e,t])=>e||t))}function Q(e,t={},i=!1,a=!1){let s=e.get(n.IUniverInstanceService).getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET),c=e.get(n.UserManagerService),l=e.has(Y)?e.get(Y):null,u=e.get(n.IContextService),d=((l==null?void 0:l.visible$)??(0,o.of)(null)).pipe((0,f.startWith)(null),(0,f.shareReplay)({bufferSize:1,refCount:!0})),p=u.subscribeContextValue$(n.FOCUSING_FX_BAR_EDITOR).pipe((0,f.startWith)(!1),(0,f.shareReplay)({bufferSize:1,refCount:!0})),m=u.subscribeContextValue$(n.FOCUSING_SHAPE_TEXT_EDITOR).pipe((0,f.startWith)(!1),(0,f.shareReplay)({bufferSize:1,refCount:!0})),h=u.subscribeContextValue$(n.EDITOR_ACTIVATED).pipe((0,f.startWith)(!1));return(0,o.combineLatest)([c.currentUser$,s,d,p,m,h]).pipe((0,f.switchMap)(([s,c,l,u,d,p])=>!c||l!=null&&l.visible&&l.unitId===c.getUnitId()&&!i||u&&!i?(0,o.of)(!0):Qo(c).pipe((0,f.switchMap)(i=>{if(!i||i.getConfig().type===n.SheetTypes.CHART&&!(a&&d&&p))return(0,o.of)(!0);let s=c.getUnitId(),l=i.getSheetId(),u=e.get(r.RangeProtectionRuleModel),m=e.get(r.WorksheetProtectionRuleModel),h=e.get(r.SheetsSelectionsService),g=h.selectionChanged$.pipe((0,f.startWith)(h.getWorkbookSelections(s).getSelectionsOfWorksheet(l))),_=e.get(n.IContextService).subscribeContextValue$(n.FOCUSING_COMMON_DRAWINGS).pipe((0,f.startWith)(!1)),v=e.get(n.IPermissionService),y=v.permissionPointUpdate$.pipe((0,f.debounceTime)(100),(0,f.startWith)(null));return(0,o.combineLatest)([g,_,y]).pipe((0,f.switchMap)(([e,i])=>{if(i&&!d)return(0,o.of)(!0);let{workbookTypes:a=[r.WorkbookEditablePermission],worksheetTypes:c,rangeTypes:p}=t,h=[];if(a==null||a.forEach(e=>{h.push(new e(s).id)}),c==null||c.forEach(e=>{h.push(new e(s,l).id)}),m.getRule(s,l))return v.composePermission$(h).pipe((0,f.map)(e=>e.some(e=>e.value===!1)));let g=e==null?void 0:e.map(e=>e.range),_=u.getSubunitRuleList(s,l).filter(e=>g==null?void 0:g.some(t=>e.ranges.some(e=>n.Rectangle.intersects(t,e))));return p==null||p.forEach(e=>{_.forEach(t=>{h.push(new e(s,l,t.permissionId).id)})}),v.composePermission$(h).pipe((0,f.map)(e=>e.some(e=>e.value===!1)))}))}))))}function ns(e){let t=e.get(n.IUniverInstanceService),i=e.get(r.SheetsSelectionsService),a=e.get(r.RangeProtectionRuleModel),s=e.get(n.IPermissionService);return(0,o.combineLatest)([$o(t),(0,o.merge)(i.selectionMoveEnd$,s.permissionPointUpdate$.pipe((0,f.debounceTime)(100))).pipe((0,f.startWith)(null))]).pipe((0,f.map)(([e])=>{var t;let o=(t=i.getCurrentLastSelection())==null?void 0:t.range;if(!e||!o)return!0;let{workbook:c,worksheet:l}=e;if(l.getConfig().type===n.SheetTypes.CHART)return!0;let u=c.getUnitId(),d=l.getSheetId(),f=[new r.WorkbookEditablePermission(u).id,new r.WorksheetEditPermission(u,d).id];return a.getSubunitRuleList(u,d).filter(e=>e.ranges.some(e=>n.Rectangle.intersects(o,e))).forEach(e=>{f.push(new r.RangeProtectionPermissionEditPoint(u,d,e.permissionId).id)}),s.composePermission(f).some(e=>e.value===!1)}))}function rs(e,t){let i=e.get(n.IUniverInstanceService),a=e.get(r.SheetsSelectionsService),s=e.get(r.RangeProtectionRuleModel),c=e.get(n.IPermissionService);return(0,o.combineLatest)([$o(i),(0,o.merge)(a.selectionMoveEnd$,c.permissionPointUpdate$.pipe((0,f.debounceTime)(100))).pipe((0,f.startWith)(null))]).pipe((0,f.map)(([e])=>{var i;let o=(i=a.getCurrentLastSelection())==null?void 0:i.range;if(!e||!o)return!0;let{workbook:l,worksheet:u}=e;if(u.getConfig().type===n.SheetTypes.CHART)return!0;let d=l.getUnitId(),f=u.getSheetId(),p=[new r.WorkbookEditablePermission(d).id,new r.WorksheetEditPermission(d,f).id];return s.getSubunitRuleList(d,f).filter(e=>t===`row`?e.ranges.some(e=>o.startRow>e.startRow&&o.startRow<=e.endRow):e.ranges.some(e=>o.startColumn>e.startColumn&&o.startColumn<=e.endColumn)).forEach(e=>{p.push(new r.RangeProtectionPermissionEditPoint(d,f,e.permissionId).id)}),c.composePermission(p).some(e=>e.value===!1)}))}function is(e,t){let i=e.get(n.IUniverInstanceService),a=e.get(r.SheetsSelectionsService),s=e.get(r.RangeProtectionRuleModel),c=e.get(n.IPermissionService);return(0,o.combineLatest)([$o(i),(0,o.merge)(a.selectionMoveEnd$,c.permissionPointUpdate$.pipe((0,f.debounceTime)(100))).pipe((0,f.startWith)(null))]).pipe((0,f.map)(([e])=>{var i;let o=(i=a.getCurrentLastSelection())==null?void 0:i.range;if(!e||!o)return!0;let{workbook:l,worksheet:u}=e;if(u.getConfig().type===n.SheetTypes.CHART)return!0;let d=l.getUnitId(),f=u.getSheetId(),p=[new r.WorkbookEditablePermission(d).id,new r.WorksheetEditPermission(d,f).id],m=n.Tools.deepClone(o);return t===`row`?(m.startColumn=0,m.endColumn=u.getColumnCount()-1):(m.startRow=0,m.endRow=u.getRowCount()-1),s.getSubunitRuleList(d,f).filter(e=>e.ranges.some(e=>n.Rectangle.intersects(m,e))).forEach(e=>{p.push(new r.RangeProtectionPermissionEditPoint(d,f,e.permissionId).id)}),c.composePermission(p).some(e=>e.value===!1)}))}function as(e,t){let i=e.get(n.IUniverInstanceService),a=e.get(r.SheetsSelectionsService),s=e.get(r.RangeProtectionRuleModel),c=e.get(n.IPermissionService);return(0,o.combineLatest)([$o(i),(0,o.merge)(a.selectionMoveEnd$,c.permissionPointUpdate$.pipe((0,f.debounceTime)(100))).pipe((0,f.startWith)(null))]).pipe((0,f.map)(([e])=>{var i;let o=(i=a.getCurrentLastSelection())==null?void 0:i.range;if(!e||!o)return!0;let{workbook:l,worksheet:u}=e;if(u.getConfig().type===n.SheetTypes.CHART)return!0;let d=l.getUnitId(),f=u.getSheetId(),p=[new r.WorkbookEditablePermission(d).id,new r.WorksheetEditPermission(d,f).id],m=n.Tools.deepClone(o);return t===`row`?m.endRow=u.getRowCount()-1:m.endColumn=u.getColumnCount()-1,s.getSubunitRuleList(d,f).filter(e=>e.ranges.some(e=>n.Rectangle.intersects(m,e))).forEach(e=>{p.push(new r.RangeProtectionPermissionEditPoint(d,f,e.permissionId).id)}),c.composePermission(p).some(e=>e.value===!1)}))}function os(e,t){let i=e.get(n.IUniverInstanceService).getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET),a=e.get(n.IPermissionService),s=e.get(n.UserManagerService);return(0,o.combineLatest)([s.currentUser$,i]).pipe((0,f.switchMap)(([n,i])=>i?i.activeSheet$.pipe((0,f.switchMap)(n=>{if(!n)return(0,o.of)(!0);let s=i.getUnitId(),c=n.getSheetId(),l=e.get(r.RangeProtectionRuleModel),u=e.get(r.WorksheetProtectionRuleModel),d=[];t.forEach(e=>d.push(new e(s).id));let p=a.composePermission$(d).pipe((0,f.map)(e=>e.every(e=>e.value===!0)))??(0,o.of)(!1),m=(0,o.merge)(l.ruleChange$,u.ruleChange$).pipe((0,f.startWith)(null));return(0,o.combineLatest)([p,m]).pipe((0,f.map)(([e,t])=>{var n;if(!e)return!0;let r=u.getRule(s,c);return r!=null&&r.permissionId?!0:((n=l.getSubunitRuleList(s,c))==null?void 0:n.filter(e=>e==null?void 0:e.permissionId)).length>0}))})):(0,o.of)(!0)))}function ss(e){let t=e.get(r.BorderStyleManagerService),a=Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]});return{id:r.SetBorderBasicCommand.id,icon:new o.Observable(t=>{let i=`AllBorderIcon`,a=e.get(r.BorderStyleManagerService),o=e.get(n.ICommandService).onCommandExecuted(e=>{if(e.id!==r.SetBorderBasicCommand.id)return;let{type:n}=a.getBorderInfo(),o=Xo.find(e=>e.value===n),s=(o==null?void 0:o.icon)??i;t.next(s)});return t.next(i),o.dispose}),tooltip:`sheets-ui.toolbar.border.main`,type:i.MenuItemType.BUTTON_SELECTOR,slot:!0,selections:[{label:{name:Yo,hoverable:!1,selectable:!1},value$:t.borderInfo$}],value$:t.borderInfo$,hidden$:(0,o.combineLatest)([(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),e.get(n.IContextService).subscribeContextValue$(n.FOCUSING_COMMON_DRAWINGS).pipe((0,o.startWith)(!1))]).pipe((0,o.map)(([e,t])=>e||t)),disabled$:a}}let cs=`sheet.menu.clear-selection`;function ls(e){return{id:cs,type:i.MenuItemType.SUBITEMS,icon:`ClearFormatDoubleIcon`,title:`sheets-ui.rightClick.clearSelection`,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function us(e){return{id:r.ClearSelectionContentCommand.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.clearContent`,disabled$:ts(e,Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellValuePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function ds(e){return{id:r.ClearSelectionFormatCommand.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.clearFormat`,disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]}),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function fs(e){return{id:r.ClearSelectionAllCommand.id,type:i.MenuItemType.BUTTON,icon:`ClearFormatDoubleIcon`,tooltip:`sheets-ui.rightClick.clearAll`,disabled$:ts(e,Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellValuePermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function ps(e){return{id:r.ClearSelectionAllCommand.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.clearAll`,tooltip:`sheets-ui.rightClick.clearAll`,disabled$:ts(e,Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellValuePermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}let ms=`sheet.menu.delete`;function hs(e){return{id:ms,type:i.MenuItemType.SUBITEMS,title:`sheets-ui.rightClick.delete`,icon:`ReduceDoubleIcon`,hidden$:ts(e,ns(e)),disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission]})}}function gs(e){return{id:In.id,type:i.MenuItemType.BUTTON,icon:`DeleteColumnDoubleIcon`,title:`sheets-ui.rightClick.deleteSelectedColumn`,hidden$:is(e,`col`),disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission,r.WorkbookDeleteColumnPermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetDeleteColumnPermission]})}}function _s(e){return{id:Fn.id,type:i.MenuItemType.BUTTON,icon:`DeleteRowDoubleIcon`,title:`sheets-ui.rightClick.deleteSelectedRow`,disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission,r.WorkbookDeleteRowPermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetDeleteRowPermission]}),hidden$:is(e,`row`)}}function vs(e){return{id:Ft.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.moveLeft`,icon:`DeleteCellShiftLeftDoubleIcon`,disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]}),hidden$:as(e,`col`)}}function ys(e){return{id:It.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.moveUp`,icon:`DeleteCellShiftUpDoubleIcon`,disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]}),hidden$:as(e,`row`)}}function bs(e,i){let a=e.get(r.SheetsSelectionsService),c=e.get(n.IUniverInstanceService),l=e.get(n.ICommandService),u=e.get(n.IContextService);return Z(c,i,({worksheet:c})=>new o.Observable(o=>{let d=()=>{var e;let t=i,n=(e=a.getCurrentLastSelection())==null?void 0:e.primary;if(n!=null){let e=c.getComposedCellStyle(n.startRow,n.startColumn);e.fs&&(t=e.fs)}o.next(t)},f=()=>{let t=en(e);if(t!=null){var n;let e=((n=t.ts)==null?void 0:n.fs)??i;o.next(e)}},p=l.onCommandExecuted(e=>{let i=e.id;(i===r.SetRangeValuesMutation.id||i===r.SetSelectionsOperation.id||i===r.SetWorksheetActiveOperation.id)&&d(),(i===s.SetTextSelectionsOperation.id||i===t.SetInlineFormatCommand.id)&&u.getContextValue(n.EDITOR_ACTIVATED)&&(u.getContextValue(n.FOCUSING_SHEET)||u.getContextValue(n.FOCUSING_SHAPE_TEXT_EDITOR))&&f()});return d(),p.dispose}))}function xs(e){let t=n.DEFAULT_STYLES.fs,a=Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]},!0,!0);return{id:cn.id,type:i.MenuItemType.SELECTOR,tooltip:`sheets-ui.toolbar.fontSize`,label:{name:i.FONT_SIZE_COMPONENT,props:{min:6,max:400,disabled$:a}},selections:i.FONT_SIZE_LIST,disabled$:a,value$:bs(e,t),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Ss(e){let t=Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]},!0,!0);return{id:ln.id,type:i.MenuItemType.BUTTON,icon:`FontSizeIncreaseIcon`,tooltip:`sheets-ui.toolbar.fontSizeIncrease`,disabled$:t,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Cs(e){let t=Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]},!0,!0);return{id:un.id,type:i.MenuItemType.BUTTON,icon:`FontSizeReduceIcon`,tooltip:`sheets-ui.toolbar.fontSizeDecrease`,disabled$:t,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}let ws=`${Jo}_MENU_ITEM_FROZEN_COMPONENT`,Ts={row:`1`,col:`A`};function Es(e){if(!e)return Ts;let{primary:t,range:r}=e,i=(t==null?void 0:t.startRow)??r.startRow,a=(t==null?void 0:t.startColumn)??r.startColumn;return{row:i===0?`1`:String(i),col:a===0?`A`:n.Tools.chatAtABC(a-1)}}let Ds=e=>{let{type:t}=e,a=(0,i.useDependency)(n.LocaleService),o=(0,i.useDependency)(r.SheetsSelectionsService),[s,c]=(0,p.useState)(()=>Es(o.getCurrentLastSelection()));return(0,p.useEffect)(()=>{let e=o.selectionChanged$.subscribe(e=>{c(Es(e==null?void 0:e[e.length-1]))});return()=>e.unsubscribe()},[o]),/* @__PURE__ */ (0,m.jsxs)(m.Fragment,{children:[t===`row`&&a.t(`sheets-ui.rightClick.freezeRow`,s.row),t===`col`&&a.t(`sheets-ui.rightClick.freezeCol`,s.col),t===`all`&&a.t(`sheets-ui.rightClick.freezeCell`,s.row,s.col)]})};function Os(e){return Z(e.get(n.IUniverInstanceService),!0,({worksheet:e})=>(0,o.of)(e.getConfig().type===n.SheetTypes.CHART))}let ks=(e,t)=>{let n=e.get(r.SheetsSelectionsService);return new o.Observable(e=>{let r=n=>{if(!n)return e.next(!0);let{primary:r,range:i}=n,a=(r==null?void 0:r.startRow)??i.startRow,o=(r==null?void 0:r.startColumn)??i.startColumn;if(t===`row`&&a<=0||t===`col`&&o<=0)return e.next(!0);e.next(!1)},i=n.selectionChanged$.subscribe(t=>{if(!t||t.length===0)return e.next(!0);r(t[t.length-1])});return r(n.getCurrentLastSelection()),()=>i.unsubscribe()})},As=`sheet.menu.sheet-frozen`,js=`sheet.toolbar.sheet-frozen`;function Ms(e){return{id:js,type:i.MenuItemType.SUBITEMS,tooltip:`sheets-ui.rightClick.freeze`,icon:`FreezeToSelectedIcon`,selections:[{id:Kn.id,value:Kn.id,params:{},icon:`FreezeToSelectedIcon`,label:{name:ws,selectable:!1,props:{type:`all`}}},{id:qn.id,value:qn.id,params:{},icon:`FreezeRowIcon`,label:{name:ws,selectable:!1,props:{type:`row`}}},{id:Jn.id,value:Jn.id,params:{},icon:`FreezeColumnIcon`,label:{name:ws,selectable:!1,props:{type:`col`}}},{id:Yn.id,value:Yn.id,params:{},icon:`FreezeRowIcon`,label:{name:`sheets-ui.rightClick.freezeFirstRow`,selectable:!1}},{id:Xn.id,value:Xn.id,params:{},icon:`FreezeColumnIcon`,label:{name:`sheets-ui.rightClick.freezeFirstCol`,selectable:!1}},{id:r.CancelFrozenCommand.id,value:r.CancelFrozenCommand.id,params:{},icon:`CancelFreezeIcon`,label:{name:`sheets-ui.rightClick.cancelFreeze`,selectable:!1}}],hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),disabled$:Os(e)}}function Ns(e){return{id:As,type:i.MenuItemType.SUBITEMS,title:`sheets-ui.rightClick.freeze`,icon:`FreezeToSelectedIcon`,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),disabled$:Os(e)}}let Ps=`sheet.column-header-menu.sheet-frozen`;function Fs(e){return{id:Ps,type:i.MenuItemType.SUBITEMS,title:`sheets-ui.rightClick.freeze`,icon:`FreezeToSelectedIcon`,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),disabled$:Os(e)}}let Is=`sheet.row-header-menu.sheet-frozen`;function Ls(e){return{id:Is,type:i.MenuItemType.SUBITEMS,title:`sheets-ui.rightClick.freeze`,icon:`FreezeToSelectedIcon`,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),disabled$:Os(e)}}function Rs(e){return{id:Kn.id,type:i.MenuItemType.BUTTON,icon:`FreezeToSelectedIcon`,label:{name:ws,props:{type:`all`}},hidden$:(0,o.combineLatest)([(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),ks(e,`all`)]).pipe((0,o.map)(([e,t])=>e||t))}}function zs(e){return{id:qn.id,type:i.MenuItemType.BUTTON,icon:`FreezeRowIcon`,label:{name:ws,props:{type:`row`}},hidden$:(0,o.combineLatest)([(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),ks(e,`row`)]).pipe((0,o.map)(([e,t])=>e||t))}}function Bs(e){return{id:Jn.id,type:i.MenuItemType.BUTTON,icon:`FreezeColumnIcon`,label:{name:ws,props:{type:`col`}},hidden$:(0,o.combineLatest)([(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),ks(e,`col`)]).pipe((0,o.map)(([e,t])=>e||t))}}function Vs(e){return{id:Yn.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.freezeFirstRow`,icon:`FreezeRowIcon`,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),disabled$:Os(e)}}function Hs(e){return{id:Xn.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.freezeFirstCol`,icon:`FreezeColumnIcon`,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),disabled$:Os(e)}}function Us(e){return{id:r.CancelFrozenCommand.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.cancelFreeze`,icon:`CancelFreezeIcon`,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),disabled$:Os(e)}}function Ws(e){let t=e.get(i.ILayoutService).rootContainerElement,r=t?(0,o.merge)((0,o.of)(null),(0,o.fromEvent)(t.ownerDocument,`fullscreenchange`)).pipe((0,o.map)(()=>t.ownerDocument.fullscreenElement===t),(0,o.distinctUntilChanged)()):(0,o.of)(!1);return{id:i.ToggleFullscreenOperation.id,type:i.MenuItemType.BUTTON,tooltip:`sheets-ui.toolbar.fullscreen`,icon:r.pipe((0,o.map)(e=>e?`ShrinkIcon`:`ExpandIcon`)),activated$:r,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Gs(e){let t=e.get(n.ICommandService),a=e.get(n.IUniverInstanceService);return{id:r.ToggleGridlinesCommand.id,type:i.MenuItemType.BUTTON,tooltip:`sheets-ui.toolbar.toggleGridlines`,icon:`HideGridlinesIcon`,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),activated$:new o.Observable(e=>{let i=()=>{let e=a.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET);return e?e.getActiveSheet().getConfig().showGridlines===n.BooleanNumber.TRUE:!1},o=new n.DisposableCollection;return o.add(t.onCommandExecuted(t=>{(t.id===r.ToggleGridlinesMutation.id||t.id===r.SetWorksheetActiveOperation.id)&&e.next(i())})),o.add(a.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET).subscribe(()=>{e.next(i())})),e.next(i()),()=>o.dispose()}),disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission]})}}let Ks=`${Jo}_MENU_ITEM_INPUT_COMPONENT`,qs=e=>{let{prefix:t,suffix:r,value:a,min:o=-(2**53-1),max:s=2**53-1,disabled$:c,onChange:u}=e,d=(0,i.useDependency)(n.LocaleService),f=(0,i.useDependency)(i.IContextMenuService),h=(0,i.useObservable)(c??null,!1),[g,_]=(0,p.useState)(),v=(0,p.useRef)(!1),y=(0,p.useRef)(null);(0,p.useEffect)(()=>()=>{y.current!==null&&clearTimeout(y.current)},[]);let b=e=>{let t=(e??o).toString();_(t),u(t)};(0,p.useEffect)(()=>{f.visible||_(a)},[f.visible]),(0,p.useEffect)(()=>{+a<o?_(o.toString()):+a>s?_(s.toString()):_(a)},[a]);function x(e){(e.key!==`Escape`&&e.key!==`Enter`||e.nativeEvent.isComposing||v.current)&&e.stopPropagation()}function S(){y.current!==null&&(clearTimeout(y.current),y.current=null),v.current=!1}function C(){S(),v.current=!0}function w(){S(),v.current=!0,y.current=setTimeout(S,0)}return/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-inline-flex univer-items-center univer-gap-1`,children:[d.t(t),/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-w-16`,onClick:e=>e.stopPropagation(),onCompositionStart:C,onCompositionEnd:w,onBlur:S,children:/* @__PURE__ */ (0,m.jsx)(l.InputNumber,{value:Number(g),size:`mini`,precision:0,min:o,max:s,disabled:h,onKeyDown:x,onChange:b})}),d.t(r)]})},Js=`sheet.menu.cell-insert`;function Ys(e){return{id:Js,type:i.MenuItemType.SUBITEMS,title:`sheets-ui.rightClick.insert`,icon:`InsertDoubleIcon`,hidden$:ts(e,ns(e)),disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission,r.WorkbookInsertColumnPermission,r.WorkbookInsertRowPermission],worksheetTypes:[r.WorksheetInsertColumnPermission,r.WorksheetInsertRowPermission,r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})}}function Xs(e){let t=e.get(n.IUniverInstanceService),a=e.get(r.SheetsSelectionsService),s=e.get(n.ICommandService),c=Q(e,{workbookTypes:[r.WorkbookEditablePermission,r.WorkbookInsertRowPermission],worksheetTypes:[r.WorksheetInsertRowPermission,r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]});return{id:r.InsertRowBeforeCommand.id,type:i.MenuItemType.BUTTON,icon:`InsertRowAboveDoubleIcon`,label:{name:Ks,props:{prefix:`sheets-ui.rightClick.insertRowsAbove`,min:1,max:1e3,suffix:`sheets-ui.rightClick.insertRowsAboveSuffix`,disabled$:c}},value$:Z(t,1,()=>new o.Observable(e=>{function t(){var t;let n=(t=a.getCurrentLastSelection())==null?void 0:t.range,r=1;n&&(r=(n==null?void 0:n.endRow)-(n==null?void 0:n.startRow)+1),e.next(r)}let n=s.onCommandExecuted(e=>{if(e.id===r.SetSelectionsOperation.id)return t()});return t(),n.dispose})),disabled$:c,hidden$:rs(e,`row`)}}function Zs(e){let t=e.get(n.IUniverInstanceService),a=e.get(r.SheetsSelectionsService),s=e.get(n.ICommandService),c=Q(e,{workbookTypes:[r.WorkbookEditablePermission,r.WorkbookInsertColumnPermission],worksheetTypes:[r.WorksheetInsertColumnPermission,r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]});return{id:r.InsertColBeforeCommand.id,type:i.MenuItemType.BUTTON,icon:`LeftInsertColumnDoubleIcon`,label:{name:Ks,props:{prefix:`sheets-ui.rightClick.insertColsLeft`,min:1,max:1e3,suffix:`sheets-ui.rightClick.insertColsLeftSuffix`,disabled$:c}},value$:Z(t,1,()=>new o.Observable(e=>{function t(){var t;let n=(t=a.getCurrentLastSelection())==null?void 0:t.range,r=1;n&&(r=(n==null?void 0:n.endColumn)-(n==null?void 0:n.startColumn)+1),e.next(r)}let n=s.onCommandExecuted(e=>{if(e.id===r.SetSelectionsOperation.id)return t()});return t(),n.dispose})),disabled$:c,hidden$:rs(e,`col`)}}function Qs(e){return{id:hn.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.moveRight`,icon:`InsertCellShiftRightDoubleIcon`,disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]}),hidden$:as(e,`col`)}}function $s(e){return{id:mn.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.moveDown`,icon:`InsertCellDownDoubleIcon`,disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]}),hidden$:as(e,`row`)}}function ec(e){let t=e.get(n.IUniverInstanceService),a=e.get(r.SheetsSelectionsService),s=e.get(n.ICommandService),c=Q(e,{workbookTypes:[r.WorkbookEditablePermission,r.WorkbookInsertRowPermission],worksheetTypes:[r.WorksheetInsertRowPermission,r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]});return{id:r.InsertMultiRowsAfterCommand.id,type:i.MenuItemType.BUTTON,icon:`InsertRowBelowDoubleIcon`,label:{name:Ks,props:{prefix:`sheets-ui.rightClick.insertRowsAfter`,min:1,max:1e3,suffix:`sheets-ui.rightClick.insertRowsAfterSuffix`,disabled$:c}},value$:Z(t,1,()=>new o.Observable(e=>{function t(){var t;let n=(t=a.getCurrentLastSelection())==null?void 0:t.range,r=1;n&&(r=(n==null?void 0:n.endRow)-(n==null?void 0:n.startRow)+1),e.next(r)}let n=s.onCommandExecuted(e=>{if(e.id===r.SetSelectionsOperation.id)return t()});return t(),n.dispose})),disabled$:c,hidden$:ns(e)}}function tc(e){let t=e.get(n.IUniverInstanceService),a=e.get(r.SheetsSelectionsService),s=e.get(n.ICommandService),c=Q(e,{workbookTypes:[r.WorkbookEditablePermission,r.WorkbookInsertRowPermission],worksheetTypes:[r.WorksheetInsertRowPermission,r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]});return{id:r.InsertMultiRowsAboveCommand.id,type:i.MenuItemType.BUTTON,icon:`InsertRowAboveDoubleIcon`,label:{name:Ks,props:{prefix:`sheets-ui.rightClick.insertRowsAbove`,min:1,max:1e3,suffix:`sheets-ui.rightClick.insertRowsAboveSuffix`,disabled$:c}},value$:Z(t,1,()=>new o.Observable(e=>{function t(){var t;let n=(t=a.getCurrentLastSelection())==null?void 0:t.range,r=1;n&&(r=(n==null?void 0:n.endRow)-(n==null?void 0:n.startRow)+1),e.next(r)}let n=s.onCommandExecuted(e=>{if(e.id===r.SetSelectionsOperation.id)return t()});return t(),n.dispose})),disabled$:c,hidden$:ns(e)}}function nc(e){let t=e.get(n.IUniverInstanceService),a=e.get(r.SheetsSelectionsService),s=e.get(n.ICommandService),c=Q(e,{workbookTypes:[r.WorkbookEditablePermission,r.WorkbookInsertColumnPermission],worksheetTypes:[r.WorksheetInsertColumnPermission,r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]});return{id:r.InsertMultiColsLeftCommand.id,type:i.MenuItemType.BUTTON,icon:`LeftInsertColumnDoubleIcon`,label:{name:Ks,props:{prefix:`sheets-ui.rightClick.insertColsLeft`,min:1,max:1e3,suffix:`sheets-ui.rightClick.insertColsLeftSuffix`,disabled$:c}},value$:Z(t,1,()=>new o.Observable(e=>{function t(){var t;let n=(t=a.getCurrentLastSelection())==null?void 0:t.range,r=1;n&&(r=(n==null?void 0:n.endColumn)-(n==null?void 0:n.startColumn)+1),e.next(r)}let n=s.onCommandExecuted(e=>{if(e.id===r.SetSelectionsOperation.id)return t()});return t(),n.dispose})),disabled$:c,hidden$:ns(e)}}function rc(e){let t=e.get(n.IUniverInstanceService),a=e.get(r.SheetsSelectionsService),s=e.get(n.ICommandService),c=Q(e,{workbookTypes:[r.WorkbookEditablePermission,r.WorkbookInsertColumnPermission],worksheetTypes:[r.WorksheetInsertColumnPermission,r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]});return{id:r.InsertMultiColsRightCommand.id,type:i.MenuItemType.BUTTON,icon:`RightInsertColumnDoubleIcon`,label:{name:Ks,props:{prefix:`sheets-ui.rightClick.insertColsRight`,min:1,max:1e3,suffix:`sheets-ui.rightClick.insertColsRightSuffix`,disabled$:c}},value$:Z(t,1,()=>new o.Observable(e=>{function t(){var t;let n=(t=a.getCurrentLastSelection())==null?void 0:t.range,r=1;n&&(r=(n==null?void 0:n.endColumn)-(n==null?void 0:n.startColumn)+1),e.next(r)}let n=s.onCommandExecuted(e=>{if(e.id===r.SetSelectionsOperation.id)return t()});return t(),n.dispose})),disabled$:c,hidden$:ns(e)}}let ic=/* @__PURE__ */ function(e){return e.ROW_HEADER_CONTEXT_MENU=`ROW_HEADER_CONTEXT_MENU`,e.COL_HEADER_CONTEXT_MENU=`COL_HEADER_CONTEXT_MENU`,e.SHEET_BAR=`SHEET_BAR`,e.SHEET_FOOTER=`SHEET_FOOTER`,e}({});function ac(e){let t=e.get(zn);return{id:Un.id,subId:Hn.id,type:i.MenuItemType.BUTTON,icon:`BrushIcon`,title:`sheets-ui.toolbar.formatPainter`,tooltip:`sheets-ui.toolbar.formatPainter`,activated$:new o.Observable(e=>{let n=!1,r=t.status$.subscribe(t=>{n=t!==0,e.next(n)});return e.next(n),()=>{r.unsubscribe()}}),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetCopyPermission,r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]},!0)}}function oc(e){let a=e.get(n.ICommandService),c=e.get(n.IUniverInstanceService),l=e.get(n.IContextService),u=e.get(r.SheetsSelectionsService);return{id:tn.id,type:i.MenuItemType.BUTTON,icon:`BoldIcon`,title:`sheets-ui.toolbar.bold`,tooltip:`sheets-ui.toolbar.bold`,disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]},!0,!0),activated$:Z(c,!1,({worksheet:i})=>new o.Observable(o=>{var c;let d=a.onCommandExecuted(a=>{let c=a.id;if(c===r.SetRangeValuesMutation.id||c===r.SetSelectionsOperation.id||c===r.SetWorksheetActiveOperation.id){var d;let e=(d=u.getCurrentLastSelection())==null?void 0:d.primary,t=n.FontWeight.NORMAL;if(e!=null){let n=i.getRange(e.startRow,e.startColumn);t=n==null?void 0:n.getFontWeight()}o.next(t===n.FontWeight.BOLD)}if((c===s.SetTextSelectionsOperation.id||c===t.SetInlineFormatCommand.id)&&l.getContextValue(n.EDITOR_ACTIVATED)&&(l.getContextValue(n.FOCUSING_SHEET)||l.getContextValue(n.FOCUSING_SHAPE_TEXT_EDITOR))){var f;let t=en(e);if(t==null)return;let r=(f=t.ts)==null?void 0:f.bl;o.next(r===n.BooleanNumber.TRUE)}}),f=(c=u.getCurrentLastSelection())==null?void 0:c.primary;if(!i){o.next(!1);return}let p=n.FontWeight.NORMAL;if(f!=null){let e=i.getRange(f.startRow,f.startColumn);p=e==null?void 0:e.getFontWeight()}return o.next(p===n.FontWeight.BOLD),d.dispose})),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function sc(e){let a=e.get(n.ICommandService),c=e.get(n.IUniverInstanceService),l=e.get(r.SheetsSelectionsService),u=e.get(n.IContextService);return{id:nn.id,type:i.MenuItemType.BUTTON,icon:`ItalicIcon`,title:`sheets-ui.toolbar.italic`,tooltip:`sheets-ui.toolbar.italic`,disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]},!0,!0),activated$:Z(c,!1,({worksheet:i})=>new o.Observable(o=>{var c;let d=a.onCommandExecuted(a=>{let c=a.id;if(c===r.SetRangeValuesMutation.id||c===r.SetSelectionsOperation.id||c===r.SetWorksheetActiveOperation.id){var d;let e=(d=l.getCurrentLastSelection())==null?void 0:d.primary,t=n.FontItalic.NORMAL;if(e!=null){let n=i.getRange(e.startRow,e.startColumn);t=n==null?void 0:n.getFontStyle()}o.next(t===n.FontItalic.ITALIC)}if((c===s.SetTextSelectionsOperation.id||c===t.SetInlineFormatCommand.id)&&u.getContextValue(n.EDITOR_ACTIVATED)&&(u.getContextValue(n.FOCUSING_SHEET)||u.getContextValue(n.FOCUSING_SHAPE_TEXT_EDITOR))){var f;let t=en(e);if(t==null)return;let r=(f=t.ts)==null?void 0:f.it;o.next(r===n.BooleanNumber.TRUE)}}),f=(c=l.getCurrentLastSelection())==null?void 0:c.primary,p=n.FontItalic.NORMAL;if(f!=null){let e=i.getRange(f.startRow,f.startColumn);p=e==null?void 0:e.getFontStyle()}return o.next(p===n.FontItalic.ITALIC),d.dispose})),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function cc(e){let a=e.get(n.ICommandService),c=e.get(n.IUniverInstanceService),l=e.get(r.SheetsSelectionsService),u=e.get(n.IContextService);return{id:rn.id,type:i.MenuItemType.BUTTON,icon:`UnderlineIcon`,title:`sheets-ui.toolbar.underline`,tooltip:`sheets-ui.toolbar.underline`,activated$:Z(c,!1,({worksheet:i})=>new o.Observable(o=>{var c;let d=a.onCommandExecuted(a=>{let c=a.id;if(c===r.SetRangeValuesMutation.id||c===r.SetSelectionsOperation.id||c===r.SetWorksheetActiveOperation.id){var d;let e=(d=l.getCurrentLastSelection())==null?void 0:d.primary,t;if(e!=null){let n=i.getRange(e.startRow,e.startColumn);t=n==null?void 0:n.getUnderline()}o.next(!!(t&&t.s))}if((c===s.SetTextSelectionsOperation.id||c===t.SetInlineFormatCommand.id)&&u.getContextValue(n.EDITOR_ACTIVATED)&&(u.getContextValue(n.FOCUSING_SHEET)||u.getContextValue(n.FOCUSING_SHAPE_TEXT_EDITOR))){var f;let t=en(e);if(t==null)return;let r=(f=t.ts)==null?void 0:f.ul;o.next((r==null?void 0:r.s)===n.BooleanNumber.TRUE)}}),f=(c=l.getCurrentLastSelection())==null?void 0:c.primary,p;if(f!=null){let e=i.getRange(f.startRow,f.startColumn);p=e==null?void 0:e.getUnderline()}return o.next(!!(p&&p.s)),d.dispose})),disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]},!0,!0),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function lc(e){let a=e.get(n.ICommandService),c=e.get(n.IUniverInstanceService),l=e.get(r.SheetsSelectionsService),u=e.get(n.IContextService);return{id:an.id,type:i.MenuItemType.BUTTON,icon:`StrikethroughIcon`,title:`sheets-ui.toolbar.strikethrough`,tooltip:`sheets-ui.toolbar.strikethrough`,disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]},!0,!0),activated$:Z(c,!1,({worksheet:i})=>new o.Observable(o=>{var c;let d=a.onCommandExecuted(a=>{let c=a.id;if(c===r.SetRangeValuesMutation.id||c===r.SetSelectionsOperation.id||c===r.SetWorksheetActiveOperation.id){var d;let e=(d=l.getCurrentLastSelection())==null?void 0:d.primary,t;if(e!=null){let n=i.getRange(e.startRow,e.startColumn);t=n==null?void 0:n.getStrikeThrough()}o.next(!!(t&&t.s))}if((c===s.SetTextSelectionsOperation.id||c===t.SetInlineFormatCommand.id)&&u.getContextValue(n.EDITOR_ACTIVATED)&&(u.getContextValue(n.FOCUSING_SHEET)||u.getContextValue(n.FOCUSING_SHAPE_TEXT_EDITOR))){var f;let t=en(e);if(t==null)return;let r=(f=t.ts)==null?void 0:f.st;o.next((r==null?void 0:r.s)===n.BooleanNumber.TRUE)}}),f=(c=l.getCurrentLastSelection())==null?void 0:c.primary,p;if(f!=null){let e=i.getRange(f.startRow,f.startColumn);p=e==null?void 0:e.getStrikeThrough()}return o.next(!!(p&&p.s)),d.dispose})),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function uc(e){let a=e.get(n.ICommandService),c=e.get(n.IUniverInstanceService),l=e.get(r.SheetsSelectionsService),u=n.DEFAULT_STYLES.ff,d=Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]},!0,!0);return{id:dn.id,tooltip:`sheets-ui.toolbar.font`,type:i.MenuItemType.SELECTOR,label:{name:i.FONT_FAMILY_COMPONENT,props:{id:dn.id,disabled$:d}},selections:[{label:{name:i.FONT_FAMILY_ITEM_COMPONENT,hoverable:!1,selectable:!1,props:{id:dn.id}}}],disabled$:d,value$:Z(c,u,({worksheet:i})=>new o.Observable(o=>{let c=()=>{var e;let t=u,r=(e=l.getCurrentLastSelection())==null?void 0:e.primary;if(r!=null){let e=i.getCellStyle(r.startRow,r.startColumn),a=i.getDefaultCellStyleInternal(),o=i.getRowStyle(r.startRow),s=i.getColumnStyle(r.startColumn),c=(0,n.composeStyles)(a,o,s,e);c.ff&&(t=c.ff)}o.next(t)},d=a.onCommandExecuted(i=>{let a=i.id;if((a===r.SetRangeValuesMutation.id||a===r.SetSelectionsOperation.id||a===r.SetWorksheetActiveOperation.id)&&c(),(a===s.SetTextSelectionsOperation.id||a===t.SetInlineFormatCommand.id)&&e.get(n.IContextService).getContextValue(n.EDITOR_ACTIVATED)&&(e.get(n.IContextService).getContextValue(n.FOCUSING_SHEET)||e.get(n.IContextService).getContextValue(n.FOCUSING_SHAPE_TEXT_EDITOR))){let t=en(e);if(t!=null){var l;let e=((l=t.ts)==null?void 0:l.ff)??u;o.next(e)}}});return c(),d.dispose})),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function dc(e){return{id:pn.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.toolbar.resetColor`,icon:`NoColorDoubleIcon`,disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]},!0,!0),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function fc(e){let a=e.get(n.ICommandService),s=e.get(n.ThemeService),c=e.get(r.SheetsSelectionsService);return{id:fn.id,icon:`FontColorDoubleIcon`,tooltip:`sheets-ui.toolbar.textColor.main`,type:i.MenuItemType.BUTTON_SELECTOR,selections:[{label:{name:t.EditorColorPicker.componentKey,hoverable:!1,selectable:!1},value$:new o.Observable(e=>{let t=s.getColorFromTheme(`gray.900`),{isAllValuesSame:n,value:r}=c.getCellStylesProperty(`cl`);n?e.next((r==null?void 0:r.rgb)??t):e.next(t)})}],value$:new o.Observable(e=>{let t=s.getColorFromTheme(`gray.900`),n=a.onCommandExecuted(n=>{if(n.id===fn.id){let r=n.params.value;e.next(r??t)}});return e.next(t),n.dispose}),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]},!0,!0)}}function pc(e){return{id:r.ResetBackgroundColorCommand.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.toolbar.resetColor`,icon:`NoColorDoubleIcon`,disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})}}function mc(e){let a=e.get(n.ICommandService),s=e.get(n.ThemeService),c=e.get(r.SheetsSelectionsService);return{id:r.SetBackgroundColorCommand.id,tooltip:`sheets-ui.toolbar.fillColor.main`,type:i.MenuItemType.BUTTON_SELECTOR,icon:`PaintBucketDoubleIcon`,selections:[{label:{name:t.EditorColorPicker.componentKey,hoverable:!1,selectable:!1},value$:new o.Observable(e=>{let t=s.getColorFromTheme(`primary.600`),{isAllValuesSame:n,value:r}=c.getCellStylesProperty(`bg`);n?e.next((r==null?void 0:r.rgb)??t):e.next(t)})}],value$:new o.Observable(e=>{let t=s.getColorFromTheme(`primary.600`),n=a.onCommandExecuted(n=>{if(n.id===r.SetBackgroundColorCommand.id){let r=n.params.value;e.next(r??t)}});return e.next(t),n.dispose}),hidden$:(0,o.combineLatest)([(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),e.get(n.IContextService).subscribeContextValue$(n.FOCUSING_COMMON_DRAWINGS).pipe((0,o.startWith)(!1))]).pipe((0,o.map)(([e,t])=>e||t)),disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})}}let hc=[{label:`sheets-ui.align.left`,icon:`LeftJustifyingIcon`,value:n.HorizontalAlign.LEFT},{label:`sheets-ui.align.center`,icon:`HorizontallyIcon`,value:n.HorizontalAlign.CENTER},{label:`sheets-ui.align.right`,icon:`RightJustifyingIcon`,value:n.HorizontalAlign.RIGHT}];function gc(e){var t;let a=e.get(n.IUniverInstanceService),s=e.get(r.SheetsSelectionsService),c=a.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET),l=c==null?void 0:c.getActiveSheet().getDefaultCellStyleInternal(),u=(l==null?void 0:l.ht)??n.HorizontalAlign.LEFT;return{id:r.SetHorizontalTextAlignCommand.id,icon:(t=hc.find(e=>e.value===u))==null?void 0:t.icon,tooltip:`sheets-ui.toolbar.horizontalAlignMode.main`,type:i.MenuItemType.SELECTOR,selections:hc,value$:Z(a,u,({worksheet:t})=>new o.Observable(i=>{var a;let o=e.get(n.ICommandService).onCommandExecuted(e=>{var n;let a=e.id;if(a!==r.SetHorizontalTextAlignCommand.id&&a!==r.SetSelectionsOperation.id&&a!==r.SetWorksheetActiveOperation.id)return;let o=(n=s.getCurrentLastSelection())==null?void 0:n.primary,l;if(o!=null){let e=t.getRange(o.startRow,o.startColumn),n=c==null?void 0:c.getActiveSheet().getComposedCellStyle(o.startRow,o.startColumn);l=(n==null?void 0:n.ht)??(e==null?void 0:e.getHorizontalAlignment())}i.next(l??u)}),l=(a=s.getCurrentLastSelection())==null?void 0:a.primary,d;if(l!=null){let e=t.getRange(l.startRow,l.startColumn),n=c==null?void 0:c.getActiveSheet().getComposedCellStyle(l.startRow,l.startColumn);d=(n==null?void 0:n.ht)??(e==null?void 0:e.getHorizontalAlignment())}return i.next(d??u),o.dispose})),hidden$:(0,o.combineLatest)([(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),e.get(n.IContextService).subscribeContextValue$(n.FOCUSING_COMMON_DRAWINGS).pipe((0,o.startWith)(!1))]).pipe((0,o.map)(([e,t])=>e||t)),disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})}}let _c=[{label:`sheets-ui.align.top`,icon:`AlignTopIcon`,value:n.VerticalAlign.TOP},{label:`sheets-ui.align.middle`,icon:`VerticalCenterIcon`,value:n.VerticalAlign.MIDDLE},{label:`sheets-ui.align.bottom`,icon:`AlignBottomIcon`,value:n.VerticalAlign.BOTTOM}];function vc(e){var t;let a=e.get(n.IUniverInstanceService),s=e.get(r.SheetsSelectionsService),c=a.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET),l=c==null?void 0:c.getActiveSheet().getDefaultCellStyleInternal(),u=(l==null?void 0:l.vt)??n.VerticalAlign.BOTTOM;return{id:r.SetVerticalTextAlignCommand.id,icon:(t=_c.find(e=>e.value===u))==null?void 0:t.icon,tooltip:`sheets-ui.toolbar.verticalAlignMode.main`,type:i.MenuItemType.SELECTOR,selections:_c,value$:Z(a,u,({worksheet:t})=>new o.Observable(i=>{var a;let o=e.get(n.ICommandService).onCommandExecuted(e=>{var n;let a=e.id;if(a!==r.SetVerticalTextAlignCommand.id&&a!==r.SetSelectionsOperation.id&&a!==r.SetWorksheetActiveOperation.id)return;let o=(n=s.getCurrentLastSelection())==null?void 0:n.primary,l;if(o!=null){let e=t.getRange(o.startRow,o.startColumn),n=c==null?void 0:c.getActiveSheet().getComposedCellStyle(o.startRow,o.startColumn);l=(n==null?void 0:n.vt)??(e==null?void 0:e.getVerticalAlignment())}i.next(l??u)}),l=(a=s.getCurrentLastSelection())==null?void 0:a.primary,d;if(l!=null){let e=t.getRange(l.startRow,l.startColumn),n=c==null?void 0:c.getActiveSheet().getComposedCellStyle(l.startRow,l.startColumn);d=(n==null?void 0:n.vt)??(e==null?void 0:e.getVerticalAlignment())}return i.next(d??u),o.dispose})),hidden$:(0,o.combineLatest)([(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),e.get(n.IContextService).subscribeContextValue$(n.FOCUSING_COMMON_DRAWINGS).pipe((0,o.startWith)(!1))]).pipe((0,o.map)(([e,t])=>e||t)),disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})}}let yc=[{label:`sheets-ui.textWrap.overflow`,icon:`OverflowIcon`,value:n.WrapStrategy.OVERFLOW},{label:`sheets-ui.textWrap.wrap`,icon:`AutowrapIcon`,value:n.WrapStrategy.WRAP},{label:`sheets-ui.textWrap.clip`,icon:`TruncationIcon`,value:n.WrapStrategy.CLIP}];function bc(e){var t;let a=e.get(r.SheetsSelectionsService),s=e.get(n.IUniverInstanceService),c=s.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET),l=c==null?void 0:c.getActiveSheet().getDefaultCellStyleInternal(),u=(l==null?void 0:l.tb)??n.WrapStrategy.OVERFLOW;return{id:r.SetTextWrapCommand.id,tooltip:`sheets-ui.toolbar.textWrapMode.main`,icon:(t=yc.find(e=>e.value===u))==null?void 0:t.icon,type:i.MenuItemType.SELECTOR,selections:yc,value$:Z(s,u,({worksheet:t})=>new o.Observable(i=>{var o;let s=e.get(n.ICommandService).onCommandExecuted(e=>{var n;let o=e.id;if(o!==r.SetRangeValuesMutation.id&&o!==r.SetSelectionsOperation.id&&o!==r.SetWorksheetActiveOperation.id)return;let s=(n=a.getCurrentLastSelection())==null?void 0:n.primary,l;if(s!=null){let e=t.getRange(s.startRow,s.startColumn),n=c==null?void 0:c.getActiveSheet().getComposedCellStyle(s.startRow,s.startColumn);l=(n==null?void 0:n.tb)??(e==null?void 0:e.getWrapStrategy())}i.next(l??u)}),l=(o=a.getCurrentLastSelection())==null?void 0:o.primary,d;if(l!=null){let e=t.getRange(l.startRow,l.startColumn),n=c==null?void 0:c.getActiveSheet().getComposedCellStyle(l.startRow,l.startColumn);d=(n==null?void 0:n.tb)??(e==null?void 0:e.getWrapStrategy())}return i.next(d??u),s.dispose})),hidden$:(0,o.combineLatest)([(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),e.get(n.IContextService).subscribeContextValue$(n.FOCUSING_COMMON_DRAWINGS).pipe((0,o.startWith)(!1))]).pipe((0,o.map)(([e,t])=>e||t)),disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})}}function xc(e){let t=e.get(n.ICommandService),a=e.get(n.IUniverInstanceService),s=e.get(r.SheetsSelectionsService),c=Z(a,{},({worksheet:e})=>new o.Observable(n=>{let i=()=>{var t;let r=(t=s.getCurrentLastSelection())==null?void 0:t.primary;n.next(r==null?{}:e.getComposedCellStyle(r.startRow,r.startColumn)??{})},a=t.onCommandExecuted(e=>{[r.SetRangeValuesMutation.id,r.SetSelectionsOperation.id,r.SetWorksheetActiveOperation.id].includes(e.id)&&i()});return i(),a.dispose}));return{id:r.SetShrinkToFitCommand.id,type:i.MenuItemType.BUTTON,icon:`ShrinkToFitIcon`,title:`sheets-ui.toolbar.shrinkToFit`,tooltip:`sheets-ui.toolbar.shrinkToFit`,activated$:c.pipe((0,o.map)(e=>e.stf===n.BooleanNumber.TRUE&&e.tb!==n.WrapStrategy.WRAP)),disabled$:(0,o.combineLatest)([Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]}),c]).pipe((0,o.map)(([e,t])=>e||t.tb===n.WrapStrategy.WRAP)),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}let Sc=[{label:`sheets-ui.textRotate.none`,icon:`NoRotationIcon`,value:0},{label:`sheets-ui.textRotate.angleUp`,icon:`LeftRotationFortyFiveDegreesIcon`,value:-45},{label:`sheets-ui.textRotate.angleDown`,icon:`RightRotationFortyFiveDegreesIcon`,value:45},{label:`sheets-ui.textRotate.vertical`,icon:`VerticalTextIcon`,value:`v`},{label:`sheets-ui.textRotate.rotationUp`,icon:`LeftRotationNinetyDegreesIcon`,value:-90},{label:`sheets-ui.textRotate.rotationDown`,icon:`RightRotationNinetyDegreesIcon`,value:90}];function Cc(e){let t=e.get(r.SheetsSelectionsService),a=e.get(n.IUniverInstanceService);return{id:r.SetTextRotationCommand.id,tooltip:`sheets-ui.toolbar.textRotateMode.main`,icon:Sc[0].icon,type:i.MenuItemType.SELECTOR,selections:Sc,value$:Z(a,0,({worksheet:i})=>new o.Observable(a=>{var o;let s=e.get(n.ICommandService).onCommandExecuted(e=>{var o;let s=e.id;if(s!==r.SetTextRotationCommand.id&&s!==r.SetSelectionsOperation.id&&s!==r.SetWorksheetActiveOperation.id)return;let c=(o=t.getCurrentLastSelection())==null?void 0:o.primary,l;if(c!=null){let e=i.getRange(c.startRow,c.startColumn);l=e==null?void 0:e.getTextRotation()}(l==null?void 0:l.v)===n.BooleanNumber.TRUE?a.next(`v`):a.next((l&&l.a)??0)}),c=(o=t.getCurrentLastSelection())==null?void 0:o.primary,l;if(c!=null){let e=i.getRange(c.startRow,c.startColumn);l=e==null?void 0:e.getTextRotation()}return(l==null?void 0:l.v)===n.BooleanNumber.TRUE?a.next(`v`):a.next((l&&l.a)??0),s.dispose})),hidden$:(0,o.combineLatest)([(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),e.get(n.IContextService).subscribeContextValue$(n.FOCUSING_COMMON_DRAWINGS).pipe((0,o.startWith)(!1))]).pipe((0,o.map)(([e,t])=>e||t)),disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})}}function wc(e){return new o.Observable(t=>{let n=e.get(i.IClipboardInterfaceService).supportClipboard,r=e.get(gt).copyContentCache().lastCopyId$.subscribe(e=>{t.next(!n&&!e)});return t.next(!n),()=>r.unsubscribe()})}function Tc(e){return{id:wt.name,commandId:wt.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.copy`,icon:`CopyDoubleIcon`,disabled$:Q(e,{workbookTypes:[r.WorkbookCopyPermission],worksheetTypes:[r.WorksheetCopyPermission],rangeTypes:[r.RangeProtectionPermissionViewPoint]}),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Ec(e){return{id:Tt.name,commandId:i.CutCommand.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.cut`,icon:`CutIcon`,disabled$:Q(e,{workbookTypes:[r.WorkbookCopyPermission,r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetCopyPermission,r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionViewPoint,r.RangeProtectionPermissionEditPoint]}),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Dc(e){return{id:Et.name,commandId:Et.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.paste`,icon:`PasteSpecialDoubleIcon`,disabled$:wc(e).pipe((0,o.combineLatestWith)(Q(e,{rangeTypes:[r.RangeProtectionPermissionEditPoint],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission,r.WorksheetSetCellValuePermission],workbookTypes:[r.WorkbookEditablePermission]})),(0,o.map)(([e,t])=>e||t)),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}let Oc=`sheet.menu.copy-special`;function kc(e){return{id:Oc,type:i.MenuItemType.SUBITEMS,icon:`CopyDoubleIcon`,title:`sheets-ui.rightClick.copySpecial`,hidden$:ts(e,(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET))}}let Ac=`sheet.menu.paste-special`;function jc(e){return{id:Ac,type:i.MenuItemType.SUBITEMS,icon:`PasteSpecialDoubleIcon`,title:`sheets-ui.rightClick.pasteSpecial`,hidden$:ts(e,(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET))}}let Mc=`sheet.menu.paste`;function Nc(e){return{...jc(e),id:Mc,icon:`DocPasteOptionsIcon`,title:`sheets-ui.rightClick.paste`,hidden$:(0,o.combineLatest)([ts(e,(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)),e.get(n.IContextService).subscribeContextValue$(n.FOCUSING_SHAPE_TEXT_EDITOR).pipe((0,o.startWith)(!1))]).pipe((0,o.map)(([e,t])=>e||t))}}function Pc(e){return{id:At.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.pasteValue`,disabled$:wc(e).pipe((0,o.combineLatestWith)(Q(e,{rangeTypes:[r.RangeProtectionPermissionEditPoint],worksheetTypes:[r.WorksheetSetCellValuePermission,r.WorksheetEditPermission],workbookTypes:[r.WorkbookEditablePermission]})),(0,o.map)(([e,t])=>e||t)),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Fc(e){return{id:jt.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.pasteFormat`,disabled$:wc(e).pipe((0,o.combineLatestWith)(Q(e,{rangeTypes:[r.RangeProtectionPermissionEditPoint],worksheetTypes:[r.WorksheetSetCellStylePermission,r.WorksheetEditPermission],workbookTypes:[r.WorkbookEditablePermission]})),(0,o.map)(([e,t])=>e||t)),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Ic(e){return{id:Mt.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.pasteColWidth`,disabled$:wc(e).pipe((0,o.combineLatestWith)(Q(e,{rangeTypes:[r.RangeProtectionPermissionEditPoint],worksheetTypes:[r.WorksheetSetColumnStylePermission,r.WorksheetEditPermission],workbookTypes:[r.WorkbookEditablePermission]})),(0,o.map)(([e,t])=>e||t))}}function Lc(e){return{id:Nt.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.pasteBesidesBorder`,disabled$:wc(e).pipe((0,o.combineLatestWith)(Q(e,{rangeTypes:[r.RangeProtectionPermissionEditPoint],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission,r.WorksheetSetCellValuePermission,r.WorksheetSetRowStylePermission,r.WorksheetSetColumnStylePermission],workbookTypes:[r.WorkbookEditablePermission]})),(0,o.map)(([e,t])=>e||t)),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Rc(e){return{id:r.SetWorksheetRowIsAutoHeightCommand.id,type:i.MenuItemType.BUTTON,icon:`AutoHeightDoubleIcon`,title:`sheets-ui.rightClick.fitContent`,disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetSetRowStylePermission,r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]}),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function zc(e){return{id:vr.id,type:i.MenuItemType.BUTTON,icon:`AutoWidthDoubleIcon`,title:`sheets-ui.rightClick.fitContent`,disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetSetRowStylePermission,r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]}),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Bc(e){return{id:Qt.id,type:i.MenuItemType.BUTTON,icon:`HideDoubleIcon`,title:`sheets-ui.rightClick.hideSelectedRow`,disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetSetRowStylePermission,r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]}),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Vc(e){return{id:$t.id,type:i.MenuItemType.BUTTON,icon:`HideDoubleIcon`,title:`sheets-ui.rightClick.hideSelectedColumn`,disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetColumnStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]}),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Hc(e){let t=e.get(n.IUniverInstanceService),a=e.get(r.SheetsSelectionsService),s=e.get(n.ICommandService),c=[r.SetSelectionsOperation,r.SetRowHiddenMutation,r.SetRowVisibleMutation].map(e=>e.id);return{id:r.SetSelectedRowsVisibleCommand.id,type:i.MenuItemType.BUTTON,icon:`EyeIcon`,title:`sheets-ui.rightClick.showHideRow`,hidden$:Z(t,!0,({worksheet:e})=>new o.Observable(t=>{function r(){var t;let r=(t=a.getCurrentSelections())==null?void 0:t.map(e=>e.range).filter(e=>e.rangeType===n.RANGE_TYPE.ROW);return!!(r!=null&&r.some(t=>{for(let n=t.startRow;n<=t.endRow;n++)if(!e.getRowRawVisible(n))return!0;return!1}))}let i=s.onCommandExecuted(e=>{c.findIndex(t=>t===e.id)!==-1&&t.next(!r())});return t.next(!r()),()=>i.dispose()})),disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetRowStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})}}function Uc(e){let t=e.get(n.IUniverInstanceService),a=e.get(r.SheetsSelectionsService),s=e.get(n.ICommandService),c=[r.SetSelectionsOperation,r.SetColHiddenMutation,r.SetColVisibleMutation].map(e=>e.id);return{id:r.SetSelectedColsVisibleCommand.id,type:i.MenuItemType.BUTTON,icon:`EyeIcon`,title:`sheets-ui.rightClick.showHideColumn`,hidden$:Z(t,!0,({worksheet:e})=>new o.Observable(t=>{function r(){var t;let r=(t=a.getCurrentSelections())==null?void 0:t.map(e=>e.range).filter(e=>e.rangeType===n.RANGE_TYPE.COLUMN);return!r||r.length===0?!1:!!r.some(t=>{for(let n=t.startColumn;n<=t.endColumn;n++)if(!e.getColVisible(n))return!0;return!1})}let i=s.onCommandExecuted(e=>{c.findIndex(t=>t===e.id)!==-1&&t.next(!r())});return t.next(!r()),()=>i.dispose()})),disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetSetColumnStylePermission,r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})}}function Wc(e){let t=e.get(n.ICommandService),a=e.get(n.IUniverInstanceService),s=e.get(r.SheetsSelectionsService);return{id:r.SetRowHeightCommand.id,type:i.MenuItemType.BUTTON,icon:`AdjustHeightDoubleIcon`,label:{name:Ks,props:{prefix:`sheets-ui.rightClick.rowHeight`,suffix:`px`,min:0,max:1e3}},value$:Z(a,0,({worksheet:e})=>new o.Observable(n=>{function i(){var t;let r=(t=s.getCurrentLastSelection())==null?void 0:t.primary,i=r?e.getRowHeight(r.startRow):e.getConfig().defaultRowHeight;n.next(i)}let a=t.onCommandExecuted(e=>{let t=e.id;if(t===r.SetRangeValuesMutation.id||t===r.SetSelectionsOperation.id||t===r.SetWorksheetRowIsAutoHeightMutation.id)return i()});return i(),a.dispose})),hidden$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetRowStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})}}function Gc(e){let t=e.get(n.ICommandService),a=e.get(n.IUniverInstanceService),s=e.get(r.SheetsSelectionsService);return{id:r.SetColWidthCommand.id,type:i.MenuItemType.BUTTON,icon:`AdjustWidthDoubleIcon`,label:{name:Ks,props:{prefix:`sheets-ui.rightClick.columnWidth`,suffix:`px`,min:0,max:1e3}},value$:Z(a,0,({worksheet:e})=>new o.Observable(n=>{function i(){var t;let r=(t=s.getCurrentLastSelection())==null?void 0:t.primary,i=r?e.getColumnWidth(r.startColumn):e.getConfig().defaultColumnWidth;n.next(i)}let a=t.onCommandExecuted(e=>{let t=e.id;if(t===r.SetRangeValuesMutation.id||t===r.SetSelectionsOperation.id||t===r.SetWorksheetColWidthMutation.id)return i()});return i(),a.dispose})),hidden$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetColumnStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})}}function Kc(e){let t=e.get(n.ICommandService),a=e.get(n.IUniverInstanceService),s=e.get(r.SheetsSelectionsService),c=ts(e,Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellValuePermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})),l=ao(e);return{id:r.AddWorksheetMergeCommand.id,icon:`MergeAllIcon`,tooltip:`sheets-ui.toolbar.mergeCell.main`,type:i.MenuItemType.SUBITEMS,activated$:Z(a,!1,({worksheet:e})=>new o.Observable(n=>{let i=()=>{var t;let r=(t=s.getCurrentLastSelection())==null?void 0:t.primary;n.next(!!r&&!!e.getMergedCell(r.actualRow,r.actualColumn))},a=s.selectionChanged$.subscribe(i),o=t.onCommandExecuted(e=>{(e.id===r.AddWorksheetMergeMutation.id||e.id===r.RemoveWorksheetMergeMutation.id)&&i()});return i(),()=>{a.unsubscribe(),o.dispose()}})).pipe((0,o.distinctUntilChanged)()),hidden$:(0,o.combineLatest)([(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),e.get(n.IContextService).subscribeContextValue$(n.FOCUSING_COMMON_DRAWINGS).pipe((0,o.startWith)(!1))]).pipe((0,o.map)(([e,t])=>e||t)),disabled$:c.pipe((0,o.combineLatestWith)(l),(0,o.map)(([e,t])=>e||t))}}function qc(e){return{id:r.AddWorksheetMergeAllCommand.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.merge.all`,icon:`MergeAllIcon`,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Jc(e){return{id:r.AddWorksheetMergeVerticalCommand.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.merge.vertical`,icon:`VerticalIntegrationIcon`,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Yc(e){return{id:r.AddWorksheetMergeHorizontalCommand.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.merge.horizontal`,icon:`HorizontalMergeIcon`,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Xc(e){return{id:r.RemoveWorksheetMergeCommand.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.merge.cancel`,icon:`CancelMergeIcon`,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Zc(e){let t=e.get(n.IUniverInstanceService).getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET),i=e.get(n.UserManagerService);return(0,o.combineLatest)([t,i.currentUser$]).pipe((0,o.switchMap)(([t,i])=>t?t.activeSheet$.pipe((0,o.switchMap)(i=>{if(!i)return(0,o.of)(!0);let a=e.get(r.RangeProtectionRuleModel),s=e.get(r.WorksheetProtectionRuleModel),c=e.get(r.SheetsSelectionsService);return(0,o.merge)(c.selectionMoveEnd$,a.ruleChange$,s.ruleChange$).pipe((0,o.map)(()=>{let e=t.getUnitId(),r=i.getSheetId(),o=a.getSubunitRuleList(e,r),l=c.getCurrentSelections(),u=l==null?void 0:l.map(e=>e.range),d=o.map(e=>e.ranges).flat();if(!u)return!1;let f=s.getRule(e,r);return f!=null&&f.permissionId?!0:u==null?void 0:u.some(e=>d.some(t=>n.Rectangle.intersects(e,t)))}))})):(0,o.of)(!0)))}function Qc(e){let t=e.get(n.IUniverInstanceService),i=e.get(r.RangeProtectionRuleModel),a=t.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET),s=e.get(n.UserManagerService);return(0,o.combineLatest)([a,s.currentUser$]).pipe((0,o.switchMap)(([t,a])=>t?t.activeSheet$.pipe((0,o.switchMap)(a=>{if(!a)return(0,o.of)(!0);let s=e.get(r.RangeProtectionRuleModel),l=e.get(r.WorksheetProtectionRuleModel),u=e.get(n.IPermissionService),d=e.get(r.SheetsSelectionsService);return(0,o.merge)(d.selectionMoveEnd$,s.ruleChange$,l.ruleChange$).pipe((0,o.map)(()=>{var o;let s=t.getUnitId(),f=a.getSheetId(),p=i.getSubunitRuleList(s,f),m=(o=d.getCurrentSelections())==null?void 0:o.map(e=>e.range);if(p.map(e=>e.ranges).flat(),!(m!=null&&m.length)||m.length>1)return!0;let h=m[0];if((h==null?void 0:h.rangeType)===n.RANGE_TYPE.ALL||(h==null?void 0:h.rangeType)===n.RANGE_TYPE.COLUMN||(h==null?void 0:h.rangeType)===n.RANGE_TYPE.ROW)return!0;let g=l.getRule(s,f);if(g!=null&&g.permissionId){var _;return((_=u.getPermissionPoint(new r.WorksheetManageCollaboratorPermission(s,f).id))==null?void 0:_.value)===!1}if(p.filter(e=>e.ranges.some(e=>n.Rectangle.intersects(e,h))).length!==1)return!0;let{startRow:v,endRow:y,startColumn:b,endColumn:x}=h,S=e.get(r.RangeProtectionCache);for(let e=v;e<=y;e++)for(let t=b;t<=x;t++){let n=S.getCellInfo(s,f,e,t);if(n)return n[c.UnitAction.ManageCollaborator]===!1}return!1}))})):(0,o.of)(!0)))}function $c(e){let t=e.get(n.IUniverInstanceService),i=e.get(n.IPermissionService),a=t.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET),s=e.get(n.UserManagerService);return(0,o.combineLatest)([a,s.currentUser$]).pipe((0,o.switchMap)(([t,n])=>t?t.activeSheet$.pipe((0,o.switchMap)(n=>{if(!n)return(0,o.of)(!0);let a=t.getUnitId(),s=e.get(r.SheetsSelectionsService),c=e.get(r.RangeProtectionRuleModel),l=e.get(r.WorksheetProtectionRuleModel),u=i.composePermission$([new r.WorkbookEditablePermission(a).id]).pipe((0,o.map)(e=>e.every(e=>e.value)))??(0,o.of)(!1),d=(0,o.merge)(c.ruleChange$,l.ruleChange$).pipe((0,o.startWith)(null));return(0,o.combineLatest)([u,d,s.selectionMoveEnd$]).pipe((0,o.map)(([e,t,n])=>{if(!e)return!0;let r=s.getCurrentSelections(),i=r==null?void 0:r.map(e=>e.range);return i!=null&&i.length?i.length>1:!1}))})):(0,o.of)(!0)))}function el(e){let t=e.get(n.IUniverInstanceService),i=e.get(n.IPermissionService),a=t.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET),s=e.get(n.UserManagerService),c=e.has(Y)?e.get(Y):null,l=e.get(n.IContextService).subscribeContextValue$(n.FOCUSING_FX_BAR_EDITOR).pipe((0,o.startWith)(!1),(0,o.shareReplay)({bufferSize:1,refCount:!0})),u=(c==null?void 0:c.visible$.pipe((0,o.startWith)(null),(0,o.shareReplay)({bufferSize:1,refCount:!0})))??(0,o.of)(null);return(0,o.combineLatest)([a,s.currentUser$,u,l]).pipe((0,o.switchMap)(([t,a,s,c])=>!t||s!=null&&s.visible&&s.unitId===t.getUnitId()||c?(0,o.of)(!0):t.activeSheet$.pipe((0,o.switchMap)(a=>{if(!a)return(0,o.of)(!0);let s=e.get(n.IContextService).subscribeContextValue$(n.FOCUSING_COMMON_DRAWINGS).pipe((0,o.startWith)(!1)),c=t.getUnitId(),l=a.getSheetId(),u=e.get(r.RangeProtectionRuleModel),d=e.get(r.WorksheetProtectionRuleModel),f=e.get(r.SheetsSelectionsService),p=i.composePermission$([new r.WorkbookCreateProtectPermission(c).id]).pipe((0,o.map)(e=>e.every(e=>e.value)))??(0,o.of)(!1),m=(0,o.merge)(u.ruleChange$,d.ruleChange$).pipe((0,o.startWith)(null));return(0,o.combineLatest)([p,m,f.selectionMoveEnd$,s]).pipe((0,o.map)(([e,t,r,i])=>{if(!e||i)return!0;let a=f.getCurrentSelections(),o=a==null?void 0:a.map(e=>e.range);if(!(o!=null&&o.length))return!0;let s=d.getRule(c,l);if(s!=null&&s.permissionId)return!0;let p=u.getSubunitRuleList(c,l);return o==null?void 0:o.some(e=>p.some(t=>t.ranges.some(t=>n.Rectangle.intersects(e,t))))}))}))))}function tl(e){let t=e.get(n.IUniverInstanceService),i=e.get(n.IPermissionService),a=t.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET),s=e.get(n.UserManagerService);return(0,o.combineLatest)([a,s.currentUser$]).pipe((0,o.switchMap)(([t,n])=>t?t.activeSheet$.pipe((0,o.switchMap)(n=>{if(!n)return(0,o.of)(!0);let a=t.getUnitId(),s=n.getSheetId(),c=e.get(r.RangeProtectionRuleModel),l=e.get(r.WorksheetProtectionRuleModel),u=i.composePermission$([new r.WorkbookCreateProtectPermission(a).id]).pipe((0,o.map)(e=>e.every(e=>e.value)))??(0,o.of)(!1),d=(0,o.merge)(c.ruleChange$,l.ruleChange$).pipe((0,o.startWith)(null));return(0,o.combineLatest)([u,d]).pipe((0,o.map)(([e,t])=>{var n;if(!e)return!0;let r=l.getRule(a,s);return r!=null&&r.permissionId?!0:((n=c.getSubunitRuleList(a,s))==null?void 0:n.filter(e=>e==null?void 0:e.permissionId)).length>0}))})):(0,o.of)(!0)))}function nl(e){let t=e.get(n.IUniverInstanceService),i=e.get(n.IPermissionService),a=t.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET),s=e.get(n.UserManagerService);return(0,o.combineLatest)([a,s.currentUser$]).pipe((0,o.switchMap)(([t,n])=>t?t.activeSheet$.pipe((0,o.switchMap)(n=>{var a;if(!n)return(0,o.of)(!0);let s=t.getUnitId(),c=n.getSheetId(),l=e.get(r.WorksheetProtectionRuleModel),u=((a=i.getPermissionPoint$(new r.WorksheetDeleteProtectionPermission(s,c).id))==null?void 0:a.pipe((0,o.map)(e=>!!e.value)))??(0,o.of)(!1),d=l.ruleChange$.pipe((0,o.startWith)(null));return(0,o.combineLatest)([u,d]).pipe((0,o.map)(([e,t])=>{let n=l.getRule(s,c);return n!=null&&n.permissionId?!e:!0}))})):(0,o.of)(!0)))}function rl(e){let t=e.get(n.IUniverInstanceService),i=e.get(n.IPermissionService),a=t.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET),s=e.get(n.UserManagerService);return(0,o.combineLatest)([a,s.currentUser$]).pipe((0,o.switchMap)(([t,n])=>t?t.activeSheet$.pipe((0,o.switchMap)(n=>{if(!n)return(0,o.of)(!0);let a=t.getUnitId(),s=n.getSheetId(),c=e.get(r.RangeProtectionRuleModel),l=e.get(r.WorksheetProtectionRuleModel),u=i.composePermission$([new r.WorkbookCreateProtectPermission(a).id,new r.WorkbookManageCollaboratorPermission(a).id]).pipe((0,o.map)(e=>e.every(e=>e.value)))??(0,o.of)(!1),d=(0,o.merge)(c.ruleChange$,l.ruleChange$).pipe((0,o.startWith)(null));return(0,o.combineLatest)([u,d]).pipe((0,o.map)(([e,t])=>{var n;if(!e)return!0;let r=l.getRule(a,s);return r!=null&&r.permissionId?!1:((n=c.getSubunitRuleList(a,s))==null?void 0:n.filter(e=>e==null?void 0:e.permissionId)).length===0}))})):(0,o.of)(!0)))}function il(e){let t=e.get(n.IUniverInstanceService),i=e.get(n.IPermissionService),a=t.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET),s=e.get(n.UserManagerService);return(0,o.combineLatest)([a,s.currentUser$]).pipe((0,o.switchMap)(([t,a])=>t?t.activeSheet$.pipe((0,o.switchMap)(a=>{if(!a)return(0,o.of)(!0);let s=t.getUnitId(),l=a.getSheetId(),u=e.get(r.SheetsSelectionsService),d=e.get(r.RangeProtectionRuleModel),f=e.get(r.WorksheetProtectionRuleModel),p=(0,o.merge)(d.ruleChange$,f.ruleChange$,u.selectionMoveEnd$).pipe((0,o.startWith)(null));return(0,o.combineLatest)([p]).pipe((0,o.map)(([t])=>{let a=e.get(r.SheetsSelectionsService).getCurrentSelections(),o=a==null?void 0:a.map(e=>e.range);if(!(o!=null&&o.length)||o.length>1)return!0;let u=o[0];if((u==null?void 0:u.rangeType)===n.RANGE_TYPE.ALL||(u==null?void 0:u.rangeType)===n.RANGE_TYPE.COLUMN||(u==null?void 0:u.rangeType)===n.RANGE_TYPE.ROW)return!0;let p=f.getRule(s,l);if(p!=null&&p.permissionId){var m;return((m=i.getPermissionPoint(new r.WorksheetDeleteProtectionPermission(s,l).id))==null?void 0:m.value)===!1}if(d.getSubunitRuleList(s,l).filter(e=>e.ranges.some(e=>n.Rectangle.intersects(e,u))).length!==1)return!0;let{startRow:h,endRow:g,startColumn:_,endColumn:v}=u,y=e.get(r.RangeProtectionCache);for(let e=h;e<=g;e++)for(let t=_;t<=v;t++){let n=y.getCellInfo(s,l,e,t);if(n)return n[c.UnitAction.Delete]===!1}return!1}))})):(0,o.of)(!0)))}function al(e){let t=e.get(n.IUniverInstanceService),i=e.get(n.IPermissionService),a=t.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET),s=e.get(n.UserManagerService),c=e.has(Y)?e.get(Y):null,l=e.get(n.IContextService).subscribeContextValue$(n.FOCUSING_FX_BAR_EDITOR),u=(c==null?void 0:c.visible$)??(0,o.of)(null);return(0,o.combineLatest)([a,s.currentUser$,u,l]).pipe((0,o.switchMap)(([e,t,n,a])=>!e||n!=null&&n.visible&&n.unitId===e.getUnitId()||a?(0,o.of)(!0):e.activeSheet$.pipe((0,o.switchMap)(t=>{var n;if(!t)return(0,o.of)(!0);let a=e.getUnitId();return(((n=i.getPermissionPoint$(new r.WorkbookEditablePermission(a).id))==null?void 0:n.pipe((0,o.map)(e=>!!e.value)))??(0,o.of)(!1)).pipe((0,o.map)(e=>!e))}))))}let ol=`sheet.contextMenu.permission`;function sl(e){return{id:On.id,type:i.MenuItemType.BUTTON,icon:`ProtectIcon`,tooltip:`sheets-ui.permission.toolbarMenu`,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),disabled$:el(e)}}function cl(e){return{id:ol,type:i.MenuItemType.SUBITEMS,title:`sheets-ui.rightClick.protectRange`,icon:`LockIcon`,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function ll(e){return{id:kn.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.turnOnProtectRange`,hidden$:Zc(e),disabled$:el(e)}}function ul(e){return{id:Pn.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.editProtectRange`,disabled$:$c(e),hidden$:Qc(e)}}function dl(e){return{id:Nn.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.removeProtectRange`,disabled$:il(e),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function fl(e){return{id:An.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.viewAllProtectArea`,disabled$:al(e),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function pl(e){return{id:jn.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.sheetConfig.addProtectSheet`,disabled$:tl(e),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function ml(e){return{id:Ir.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.sheetConfig.removeProtectSheet`,disabled$:nl(e),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function hl(e){return{id:Lr.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.sheetConfig.changeSheetPermission`,disabled$:rl(e),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function gl(e){return{id:Mn.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.sheetConfig.viewAllProtectArea`,disabled$:al(e),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function _l(e){let t=e.get(n.IUniverInstanceService),a=e.get(n.ICommandService),s=new o.Observable(e=>{let n=a.onCommandExecuted(n=>{let i=n.id;(i===r.RemoveSheetMutation.id||i===r.InsertSheetMutation.id||i===r.SetWorksheetHideMutation.id)&&Cl(t,e)});return Cl(t,e),n.dispose}),c=os(e,[r.WorkbookEditablePermission,r.WorkbookDeleteSheetPermission]);return{id:Ln.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.sheetConfig.delete`,disabled$:(0,o.combineLatest)([s,c]).pipe((0,o.map)(([e,t])=>e||t)),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function vl(e){return{id:r.CopySheetCommand.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.sheetConfig.copy`,disabled$:os(e,[r.WorkbookEditablePermission,r.WorkbookCreateSheetPermission]),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function yl(e){return{id:Vr.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.sheetConfig.rename`,disabled$:os(e,[r.WorkbookEditablePermission,r.WorkbookRenameSheetPermission]),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function bl(e){let a=e.get(n.IUniverInstanceService),s=e.get(n.ICommandService);return{id:r.SetTabColorCommand.id,title:`sheets-ui.sheetConfig.changeColor`,type:i.MenuItemType.SELECTOR,selections:[{label:`sheets-ui.toolbar.resetColor`,icon:`NoColorDoubleIcon`,value:``},{label:{name:t.EditorColorPicker.componentKey,hoverable:!1,selectable:!1},value$:new o.Observable(e=>{let t=()=>{var t;let r=a.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET);e.next((r==null||(t=r.getActiveSheet())==null?void 0:t.getTabColor())??``)};t();let i=s.onCommandExecuted(({id:e})=>{(e===r.SetTabColorMutation.id||e===r.SetWorksheetActiveOperation.id)&&t()});return()=>i.dispose()})}],hidden$:os(e,[r.WorkbookEditablePermission])}}function xl(e){let t=e.get(n.IUniverInstanceService),a=e.get(n.ICommandService);return{id:r.SetWorksheetHideCommand.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.sheetConfig.hide`,disabled$:new o.Observable(e=>{let n=a.onCommandExecuted(n=>{let i=n.id;(i===r.RemoveSheetMutation.id||i===r.InsertSheetMutation.id||i===r.SetWorksheetHideMutation.id)&&Cl(t,e)});return Cl(t,e),n.dispose}).pipe((0,o.combineLatestWith)(os(e,[r.WorkbookEditablePermission,r.WorkbookHideSheetPermission])),(0,o.map)(([e,t])=>e||t)),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Sl(e){let t=e.get(n.IUniverInstanceService),a=e.get(n.ICommandService);return{id:Fr.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.sheetConfig.unhide`,disabled$:new o.Observable(e=>{function i(){let r=t.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET).getWorksheets(),i=Array.from(r.values());e.next(i.length===1)}let o=a.onCommandExecuted(e=>{let t=e.id;(t===r.RemoveSheetMutation.id||t===r.InsertSheetMutation.id||t===r.SetWorksheetHideMutation.id)&&i()});return i(),o.dispose}).pipe((0,o.combineLatestWith)(os(e,[r.WorkbookEditablePermission,r.WorkbookHideSheetPermission])),(0,o.map)(([e,t])=>e||t)),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Cl(e,t){let r=e.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET).getWorksheets(),i=Array.from(r.values()).filter(e=>e.getConfig().hidden===n.BooleanNumber.FALSE);t.next(i.length===1)}let wl=e=>{var t;let i=e.get(r.SheetsSelectionsService),a=(t=e.get(n.IUniverInstanceService).getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET))==null?void 0:t.getActiveSheet();return new o.Observable(e=>{let t=t=>{if(!a||!t||t.length===0)return e.next(!0);for(let o=0;o<t.length;o++){let{range:s}=t[o];for(let t=s.startRow;t<=s.endRow;t++)for(let o=s.startColumn;o<=s.endColumn;o++){var r,i;let s=a.getCellRaw(t,o),c=typeof(s==null?void 0:s.s)==`string`?(r=a.getStyleDataByHash(s.s))==null||(r=r.n)==null?void 0:r.pattern:s==null||(i=s.s)==null||(i=i.n)==null?void 0:i.pattern;if(s&&s.v&&(s.t!==n.CellValueType.NUMBER||(0,n.isTextFormat)(c))&&(0,n.isRealNum)(s.v))return e.next(!1)}}e.next(!0)},r=i.selectionChanged$.subscribe(n=>{if(!n||n.length===0)return e.next(!0);t(n)});return t(i.getCurrentSelections()),()=>r.unsubscribe()})},Tl=`sheet.contextMenu.text-to-number`;function El(e){return{id:Tl,commandId:r.TextToNumberCommand.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.textToNumber`,icon:`ConvertToNumberIcon`,disabled$:ts(e,Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellValuePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})),hidden$:(0,o.combineLatest)([(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),wl(e)]).pipe((0,o.map)(([e,t])=>e||t))}}let Dl=`sheet.menu.zoom-ratio`,Ol=[50,75,100,125,150,175,200,400];function kl(e){let t=e.get(n.ICommandService);return Z(e.get(n.IUniverInstanceService),100,({worksheet:e})=>new o.Observable(n=>{let r=()=>n.next(Math.round(e.getZoomRatio()*100)),i=t.onCommandExecuted(e=>{e.id===Ar.id&&r()});return r(),i.dispose}))}function Al(e){return{id:Dl,selectionsCommandId:qo.id,type:i.MenuItemType.SELECTOR,icon:`ZoomInIcon`,tooltip:`sheets-ui.toolbar.zoom`,selections:Ol.map(e=>({value:e,label:`${e}%`})),value$:kl(e),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}let jl={[i.RibbonPosition.START]:{[i.RibbonStartGroup.HISTORY]:{[Mc]:{order:4,gridLayout:{row:1,column:3,rowSpan:2,showLabel:!0},menuItemFactory:Nc,[Et.name]:{order:0,menuItemFactory:e=>({...Dc(e),icon:void 0})},[At.id]:{order:1,menuItemFactory:Pc},[jt.id]:{order:2,menuItemFactory:Fc},[Mt.id]:{order:3,menuItemFactory:Ic},[Nt.id]:{order:4,menuItemFactory:Lc}}},[i.RibbonStartGroup.FORMAT]:{[dn.id]:{order:1,gridLayout:{row:1,column:1,columnSpan:4,width:180,minWidth:120},menuItemFactory:uc},[cn.id]:{order:2,gridLayout:{row:1,column:5,width:72},menuItemFactory:xs},[ln.id]:{order:2.1,gridLayout:{row:1,column:6},menuItemFactory:Ss},[un.id]:{order:2.2,gridLayout:{row:1,column:7},menuItemFactory:Cs},[tn.id]:{order:5,gridLayout:{row:2,column:1},menuItemFactory:oc},[nn.id]:{order:6,gridLayout:{row:2,column:2},menuItemFactory:sc},[rn.id]:{order:7,gridLayout:{row:2,column:3},menuItemFactory:cc},[an.id]:{order:8,gridLayout:{row:2,column:4},menuItemFactory:lc},[fn.id]:{order:9,gridLayout:{row:2,column:7},menuItemFactory:fc,[r.ResetTextColorCommand.id]:{order:0,menuItemFactory:dc}},[r.SetBackgroundColorCommand.id]:{order:10,gridLayout:{row:2,column:6},menuItemFactory:mc,[r.ResetBackgroundColorCommand.id]:{order:0,menuItemFactory:pc}},[r.SetBorderBasicCommand.id]:{order:11,gridLayout:{row:2,column:5},menuItemFactory:ss}},[i.RibbonStartGroup.LAYOUT]:{[r.SetHorizontalTextAlignCommand.id]:{order:0,gridLayout:{row:1,column:1},menuItemFactory:gc},[r.SetVerticalTextAlignCommand.id]:{order:3,gridLayout:{row:2,column:1},menuItemFactory:vc},[r.SetTextWrapCommand.id]:{order:6,gridLayout:{row:1,column:2},menuItemFactory:bc},[r.SetShrinkToFitCommand.id]:{order:7,gridLayout:{row:2,column:2},menuItemFactory:xc},[r.SetTextRotationCommand.id]:{order:8,gridLayout:{row:1,column:3},menuItemFactory:Cc},[r.AddWorksheetMergeCommand.id]:{order:9,gridLayout:{row:2,column:3},menuItemFactory:Kc,[r.AddWorksheetMergeAllCommand.id]:{order:0,menuItemFactory:qc},[r.AddWorksheetMergeVerticalCommand.id]:{order:1,menuItemFactory:Jc},[r.AddWorksheetMergeHorizontalCommand.id]:{order:2,menuItemFactory:Yc},[r.RemoveWorksheetMergeCommand.id]:{order:3,menuItemFactory:Xc}}},[i.RibbonStartGroup.OTHERS]:{[On.id]:{order:0,gridLayout:{row:1,column:1,rowSpan:2,showLabel:!0},menuItemFactory:sl}}},[i.RibbonPosition.VIEW]:{[i.RibbonViewGroup.DISPLAY]:{[js]:{order:0,gridLayout:{row:1,column:1,rowSpan:2,showLabel:!0},menuItemFactory:Ms},[Dl]:{order:1,gridLayout:{row:1,column:2},menuItemFactory:Al}},[i.RibbonViewGroup.VISIBILITY]:{[r.ToggleGridlinesCommand.id]:{order:0,gridLayout:{row:1,column:1},menuItemFactory:Gs},[i.ToggleFullscreenOperation.id]:{order:1,gridLayout:{row:2,column:1},menuItemFactory:Ws}}},[i.ContextMenuPosition.MAIN_AREA]:{[i.ContextMenuGroup.QUICK]:{quickLayout:`tile`,[wt.name]:{order:0,menuItemFactory:Tc},[Tt.name]:{order:1,menuItemFactory:Ec},[Et.name]:{order:2,menuItemFactory:Dc}},[i.ContextMenuGroup.FORMAT]:{[Oc]:{order:0,menuItemFactory:kc},[Ac]:{order:1,menuItemFactory:jc,[At.id]:{order:0,menuItemFactory:Pc},[jt.id]:{order:1,menuItemFactory:Fc},[Mt.id]:{order:2,menuItemFactory:Ic},[Nt.id]:{order:3,menuItemFactory:Lc}},[cs]:{order:2,menuItemFactory:ls,[r.ClearSelectionContentCommand.id]:{order:0,menuItemFactory:us},[r.ClearSelectionFormatCommand.id]:{order:1,menuItemFactory:ds},[r.ClearSelectionAllCommand.id]:{order:2,menuItemFactory:ps}},[Tl]:{order:3,menuItemFactory:El}},[i.ContextMenuGroup.LAYOUT]:{order:1,[Js]:{order:0,menuItemFactory:Ys,[r.InsertRowBeforeCommand.id]:{order:0,menuItemFactory:Xs},[r.InsertColBeforeCommand.id]:{order:1,menuItemFactory:Zs},[hn.id]:{order:2,menuItemFactory:Qs},[mn.id]:{order:3,menuItemFactory:$s}},[ms]:{order:0,menuItemFactory:hs,[In.id]:{order:0,menuItemFactory:gs},[Fn.id]:{order:1,menuItemFactory:_s},[Ft.id]:{order:2,menuItemFactory:vs},[It.id]:{order:3,menuItemFactory:ys}},[As]:{order:2,menuItemFactory:Ns,[Kn.id]:{order:0,menuItemFactory:Rs},[qn.id]:{order:1,menuItemFactory:zs},[Jn.id]:{order:2,menuItemFactory:Bs},[Yn.id]:{order:3,menuItemFactory:Vs},[Xn.id]:{order:4,menuItemFactory:Hs},[r.CancelFrozenCommand.id]:{order:5,menuItemFactory:Us}},[ol]:{order:3,menuItemFactory:cl,[kn.id]:{order:0,menuItemFactory:ll},[Pn.id]:{order:1,menuItemFactory:ul},[Nn.id]:{order:2,menuItemFactory:dl},[An.id]:{order:3,menuItemFactory:fl}}},[i.ContextMenuGroup.DATA]:{order:2},[i.ContextMenuGroup.OTHERS]:{order:3}},[i.ContextMenuPosition.COL_HEADER]:{[i.ContextMenuGroup.QUICK]:{quickLayout:`tile`,[wt.name]:{order:0,menuItemFactory:Tc},[Tt.name]:{order:1,menuItemFactory:Ec},[Et.name]:{order:2,menuItemFactory:Dc}},[i.ContextMenuGroup.FORMAT]:{[Oc]:{order:0,menuItemFactory:kc},[Ac]:{order:1,menuItemFactory:jc,[At.id]:{order:0,menuItemFactory:Pc},[jt.id]:{order:1,menuItemFactory:Fc},[Mt.id]:{order:2,menuItemFactory:Ic},[Nt.id]:{order:3,menuItemFactory:Lc}},[cs]:{order:2,menuItemFactory:ls,[r.ClearSelectionContentCommand.id]:{order:0,menuItemFactory:us},[r.ClearSelectionFormatCommand.id]:{order:1,menuItemFactory:ds},[r.ClearSelectionAllCommand.id]:{order:2,menuItemFactory:ps}},[Tl]:{order:3,menuItemFactory:El}},[i.ContextMenuGroup.LAYOUT]:{order:1,[r.InsertMultiColsLeftCommand.id]:{order:0,menuItemFactory:nc},[r.InsertMultiColsRightCommand.id]:{order:0,menuItemFactory:rc},[$t.id]:{order:1,menuItemFactory:Vc},[r.SetSelectedColsVisibleCommand.id]:{order:2,menuItemFactory:Uc},[In.id]:{order:2,menuItemFactory:gs},[r.SetColWidthCommand.id]:{order:3,menuItemFactory:Gc},[vr.id]:{order:4,menuItemFactory:zc},[Ps]:{order:5,menuItemFactory:Fs,[Jn.id]:{order:2,menuItemFactory:Bs},[Xn.id]:{order:4,menuItemFactory:Hs},[r.CancelFrozenCommand.id]:{order:5,menuItemFactory:Us}},[ol]:{order:6,menuItemFactory:cl,[kn.id]:{order:0,menuItemFactory:ll},[Pn.id]:{order:1,menuItemFactory:ul},[Nn.id]:{order:2,menuItemFactory:dl},[An.id]:{order:3,menuItemFactory:fl}}},[i.ContextMenuGroup.DATA]:{order:2},[i.ContextMenuGroup.OTHERS]:{order:3}},[i.ContextMenuPosition.ROW_HEADER]:{[i.ContextMenuGroup.QUICK]:{quickLayout:`tile`,[wt.name]:{order:0,menuItemFactory:Tc},[Tt.name]:{order:1,menuItemFactory:Ec},[Et.name]:{order:2,menuItemFactory:Dc}},[i.ContextMenuGroup.FORMAT]:{[Oc]:{order:0,menuItemFactory:kc},[Ac]:{order:1,menuItemFactory:jc,[At.id]:{order:0,menuItemFactory:Pc},[jt.id]:{order:1,menuItemFactory:Fc},[Mt.id]:{order:2,menuItemFactory:Ic},[Nt.id]:{order:3,menuItemFactory:Lc}},[cs]:{order:2,menuItemFactory:ls,[r.ClearSelectionContentCommand.id]:{order:0,menuItemFactory:us},[r.ClearSelectionFormatCommand.id]:{order:1,menuItemFactory:ds},[r.ClearSelectionAllCommand.id]:{order:2,menuItemFactory:ps}},[Tl]:{order:3,menuItemFactory:El}},[i.ContextMenuGroup.LAYOUT]:{order:1,[r.InsertMultiRowsAboveCommand.id]:{order:0,menuItemFactory:tc},[r.InsertMultiRowsAfterCommand.id]:{order:1,menuItemFactory:ec},[Fn.id]:{order:1,menuItemFactory:_s},[Qt.id]:{order:2,menuItemFactory:Bc},[r.SetSelectedRowsVisibleCommand.id]:{order:2,menuItemFactory:Hc},[r.SetRowHeightCommand.id]:{order:3,menuItemFactory:Wc},[r.SetWorksheetRowIsAutoHeightCommand.id]:{order:4,menuItemFactory:Rc},[Is]:{order:5,menuItemFactory:Ls,[qn.id]:{order:1,menuItemFactory:zs},[Yn.id]:{order:3,menuItemFactory:Vs},[r.CancelFrozenCommand.id]:{order:5,menuItemFactory:Us}},[ol]:{order:6,menuItemFactory:cl,[kn.id]:{order:0,menuItemFactory:ll},[Pn.id]:{order:1,menuItemFactory:ul},[Nn.id]:{order:2,menuItemFactory:dl},[An.id]:{order:3,menuItemFactory:fl}}},[i.ContextMenuGroup.DATA]:{order:2},[i.ContextMenuGroup.OTHERS]:{order:3}},[i.ContextMenuPosition.FOOTER_TABS]:{[i.ContextMenuGroup.OTHERS]:{order:0,[Ln.id]:{order:0,menuItemFactory:_l},[r.CopySheetCommand.id]:{order:1,menuItemFactory:vl},[Vr.id]:{order:2,menuItemFactory:yl},[r.SetTabColorCommand.id]:{order:3,menuItemFactory:bl},[r.SetWorksheetHideCommand.id]:{order:4,menuItemFactory:xl},[Fr.id]:{order:6,menuItemFactory:Sl},[jn.id]:{order:7,menuItemFactory:pl},[Ir.id]:{order:8,menuItemFactory:ml},[Lr.id]:{order:9,menuItemFactory:hl},[Mn.id]:{order:10,menuItemFactory:gl}}},[i.ContextMenuPosition.FOOTER_MENU]:{[i.ContextMenuGroup.OTHERS]:{[r.ToggleGridlinesCommand.id]:{order:1,menuItemFactory:Gs}}}};function Ml(e){var t;let n=(t=e.custom)==null?void 0:t.UNIVER_EMBED_SHEETS_TAB;if(Nl(n))return n}function Nl(e){if(!e||typeof e!=`object`)return!1;let t=e;return t.version===1&&typeof t.embedId==`string`&&typeof t.hostAnchorId==`string`&&(t.childType===void 0||typeof t.childType==`number`)}let Pl=(0,n.createIdentifier)(`sheet-ui.embed-runtime.service`);function Fl(){let e=(0,i.useDependency)(n.IUniverInstanceService);return(0,i.useObservable)(()=>e.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET),void 0,void 0,[])??null}function Il(e){return(0,i.useObservable)(()=>(e==null?void 0:e.activeSheet$)??(0,o.of)(null),void 0,void 0,[e])}function Ll(){let e=(0,i.useDependency)(n.IUniverInstanceService);return(0,i.useObservable)(()=>(0,o.merge)([e.getTypeOfUnitAdded$(n.UniverInstanceType.UNIVER_SHEET),e.getTypeOfUnitDisposed$(n.UniverInstanceType.UNIVER_SHEET)]).pipe((0,o.map)(()=>e.getAllUnitsForType(n.UniverInstanceType.UNIVER_SHEET)),(0,o.startWith)(e.getAllUnitsForType(n.UniverInstanceType.UNIVER_SHEET))),[],void 0,[e])}function Rl(e){var t;let r=(t=e.getEditor(n.DOCS_NORMAL_EDITOR_UNIT_ID_KEY))==null?void 0:t.docSelectionRenderService;return!r||r.isFocusing?!1:(r.focus(),r.isFocusing)}function zl(e){let t=e.ownerDocument??(typeof document>`u`?void 0:document);if(!t)return(0,n.toDisposable)(()=>{});let r=new n.DisposableCollection,i=t.defaultView,a=!1,o=null,s,c=[],l,u=()=>{var t;if(a)return;let r=(t=e.editorService.getEditor(n.DOCS_NORMAL_EDITOR_UNIT_ID_KEY))==null?void 0:t.docSelectionRenderService,i=r!=null&&r.selectionContainer.isConnected?r.selectionContainer:null;if(i===o||(s==null||s.dispose(),s=void 0,o=null,!i))return;let c=new n.DisposableCollection;if(o=i,e.interactionBoundaryService&&c.add(e.interactionBoundaryService.registerOwnedElement(e.embedId,i)),e.focusCoordinator){c.add(e.focusCoordinator.registerElement({embedId:e.embedId,role:`child-editor`,element:i}));let t=r==null?void 0:r.inputElement;t&&t!==i&&c.add(e.focusCoordinator.registerElement({embedId:e.embedId,role:`child-editor`,element:t}))}s=c},d=e=>{if(e<=0||!(i!=null&&i.requestAnimationFrame))return;let t=i.requestAnimationFrame(()=>{let n=c.indexOf(t);n>=0&&c.splice(n,1),u(),o||d(e-1)});c.push(t)};return u(),o||d(2),i!=null&&i.MutationObserver&&t.body&&(l=new i.MutationObserver(()=>u()),l.observe(t.body,{childList:!0,subtree:!0})),r.add((0,n.toDisposable)(()=>{a=!0,c.forEach(e=>{var t;return i==null||(t=i.cancelAnimationFrame)==null?void 0:t.call(i,e)}),c.length=0,l==null||l.disconnect(),l=void 0,s==null||s.dispose(),s=void 0,o=null})),r}function Bl(e){let t=(0,i.useDependency)(Y),r=(0,i.useDependency)(n.ICommandService),o=(0,i.useDependency)(n.Injector);return(0,p.useMemo)(()=>({keyCodes:[{keyCode:i.KeyCode.ENTER},{keyCode:i.KeyCode.ENTER,metaKey:i.MetaKeys.SHIFT},{keyCode:i.KeyCode.ESC},{keyCode:i.KeyCode.TAB},{keyCode:i.KeyCode.TAB,metaKey:i.MetaKeys.SHIFT}],handler:(s,c)=>{if(s===i.KeyCode.ENTER||s===i.KeyCode.ESC||s===i.KeyCode.TAB){if(e==null)return;t.disableForceKeepVisible();let l=o.has(i.IUIRuntimeScopeService)?o.get(i.IUIRuntimeScopeService).get(e):void 0;(l!=null&&l.has(n.ICommandService)?l.get(n.ICommandService):r).syncExecuteCommand(X.id,{visible:!1,eventType:a.DeviceInputEventType.Keyboard,keycode:s,isShift:c===i.MetaKeys.SHIFT,unitId:e})}}}),[r,t,o,e])}let Vl=-1e3,Hl={width:0,height:0,top:Vl,left:Vl};function Ul(e){let{root:t,target:n,activeElement:r,isEditorFocusing:i}=e;if(!t||!(n instanceof HTMLElement)||!(r instanceof HTMLElement))return!0;let a=t.closest(`[${di}]`),o=a==null?void 0:a.getAttribute(di);if(!o)return!0;let s=n.closest(`[${di}="${o}"]`)!=null,c=r.closest(`[${di}="${o}"]`);return s&&c&&Wl(r)?!1:!i||n.closest(`[data-embed-interaction-boundary-owner="${o}"]`)==null||c==null}function Wl(e){let t=e.getAttribute(fi);return t===`child-editor`||t===`child-popup`||t===`floating-menu`}function Gl(e,t){var r;if(!e)return!1;let a=t.activeElement;if(!(a instanceof HTMLElement)||(0,i.getEmbedBoundaryOwner)(a)!==e)return!1;let o=a.getAttribute(`data-embed-runtime-focus-role`)??((r=a.closest(`[data-embed-runtime-focus-role]`))==null?void 0:r.getAttribute(`data-embed-runtime-focus-role`)),s=o===`child-editor`&&a.id!==`__editor_${n.DOCS_NORMAL_EDITOR_UNIT_ID_KEY}`;return a.matches(`input, textarea, select`)||s||o===`child-popup`||o===`floating-menu`}function Kl(e,t){var n;if(!e)return!1;let r=t.activeElement;if(!(r instanceof HTMLElement)||(0,i.getEmbedBoundaryOwner)(r)!==e)return!1;let a=r.getAttribute(`data-embed-runtime-focus-role`)??((n=r.closest(`[data-embed-runtime-focus-role]`))==null?void 0:n.getAttribute(`data-embed-runtime-focus-role`));return r.matches(`input, textarea, select`)||a==null&&r.tagName!==`CANVAS`||a===`child-editor`||a===`child-popup`||a===`floating-menu`}function ql(e){var t;if(!(e instanceof HTMLElement))return!1;let n=e.getAttribute(`data-embed-runtime-focus-role`)??((t=e.closest(`[data-embed-runtime-focus-role]`))==null?void 0:t.getAttribute(`data-embed-runtime-focus-role`));return n===`child-editor`||n===`child-popup`||n===`floating-menu`}function Jl({hidden:e=!1}){var r;let[s,c]=(0,p.useState)({...Hl}),l=(0,i.useDependency)(Ti),d=(0,i.useDependency)(n.Injector),f=(0,i.useDependency)(t.IEditorService),h=(0,i.useDependency)(n.IUniverInstanceService),g=(0,i.useDependency)(n.IContextService),_=(0,i.useDependency)(n.ThemeService),v=(0,i.useDependency)(i.ComponentManager),y=(0,i.useDependency)(Y),b=(0,i.useDependency)(Ei),x=(0,i.useDependency)(a.IRenderManagerService),S=(0,p.useRef)(null),C=(0,p.useRef)(void 0),w=(0,i.useObservable)(y.visible$),T=(0,i.useDependency)(n.ICommandService),E=(0,i.useObservable)(()=>g.subscribeContextValue$(i.DISABLE_AUTO_FOCUS_KEY),!1,void 0,[g,i.DISABLE_AUTO_FOCUS_KEY]),D=v.get(P),O=(0,i.useObservable)(y.currentEditCellState$),k=O?h.getUnit(O.unitId,n.UniverInstanceType.UNIVER_SHEET)??null:null,A=Il(k),M=(0,i.useObservable)(_.darkMode$,_.darkMode),N=O==null?void 0:O.documentLayoutObject.fill,F=N==null?void 0:N.trim().toLowerCase().replace(/\s+/g,``),I=N&&F!==`transparent`&&F!==`rgba(0,0,0,0)`?N:_.getColorFromTheme(M?`gray.800`:`gray.0`),[L,R]=(0,p.useState)(!1),z=O?k==null||(r=k.getSheetBySheetId(O.sheetId))==null?void 0:r.getName():null,ee=O?`${A&&z&&A.getSheetId()!==O.sheetId?`'${(0,u.quoteSheetName)(z)}'!`:``}${(0,n.numberToABC)(O.column)}${O.row+1}`:null,{stroke:B,strokeWidth:V}=j(_),H=d.has(gi)?d.get(gi):void 0,te=()=>{var e;return{activeSessionScope:H==null?void 0:H.resolveActiveChildSessionRuntimeScope(),editUnitScope:H==null?void 0:H.resolveRuntimeScopeByChildUnitId(O==null?void 0:O.unitId),visibleUnitScope:H==null?void 0:H.resolveRuntimeScopeByChildUnitId(w==null?void 0:w.unitId),focusedUnitScope:H==null?void 0:H.resolveRuntimeScopeByChildUnitId((e=h.getFocusedUnit())==null?void 0:e.getUnitId())}},U=(0,i.useObservable)(H?()=>H.runtimeSessionChanged$.pipe((0,o.map)(te),(0,o.startWith)(te())):null,te(),!1,[O==null?void 0:O.unitId,H,h,w==null?void 0:w.unitId]);(0,p.useEffect)(()=>{var e;if(R(!1),!(w!=null&&w.visible)||!(O!=null&&O.unitId))return;let t=(e=x.getRenderUnitById(O.unitId))==null?void 0:e.with(Gn);if(!t)return;let n=t.validViewportScrollInfo$.pipe((0,o.skip)(1)).subscribe(e=>{e&&R(!0)});return()=>n.unsubscribe()},[O==null?void 0:O.column,O==null?void 0:O.row,O==null?void 0:O.sheetId,O==null?void 0:O.unitId,x,w==null?void 0:w.visible]),(0,p.useEffect)(()=>{let e=l.state$.subscribe(e=>{if(e==null)return;let{startX:t=Vl,startY:r=Vl,endX:i=0,endY:a=0,show:o=!1}=e;if(!o)c({...Hl});else{c({width:i-t,height:a-r,left:t,top:r});let e=f.getEditor(n.DOCS_NORMAL_EDITOR_UNIT_ID_KEY);if(e==null)return;let{left:o,top:s,width:u,height:d}=e.getBoundingClientRect();l.setRect({left:o,top:s,width:u,height:d})}});return()=>e.unsubscribe()},[l,f]),(0,p.useEffect)(()=>{if(!d.has(_i))return;let e=d.get(_i).geometryInvalidated$.subscribe(()=>{b.resizeCellEditor()});return()=>e.unsubscribe()},[b,d]),(0,p.useEffect)(()=>{e||E||g.getContextValue(i.DISABLE_AUTO_FOCUS_KEY)||l.setFocus(!0)},[l,g,E,e,s]),(0,p.useEffect)(()=>{var t;if(e||!(w!=null&&w.visible)||(b.fitTextSize(),g.getContextValue(n.FOCUSING_FX_BAR_EDITOR)))return;let r=((t=S.current)==null?void 0:t.ownerDocument)??document,i=r.defaultView??window,a=0,o=0,s,c=()=>{let e=S.current?vi(S.current)??yi(r):yi(r);Kl(e==null?void 0:e.embedId,r)||(Rl(f),s!=null&&i.clearTimeout(s),s=i.setTimeout(()=>{s=void 0,Kl(e==null?void 0:e.embedId,r)||Rl(f)},0))},l=()=>{if(g.getContextValue(n.FOCUSING_FX_BAR_EDITOR))return;let e=S.current?vi(S.current)??yi(r):yi(r);Gl(e==null?void 0:e.embedId,r)||c()};return l(),a=requestAnimationFrame(()=>{l(),o=requestAnimationFrame(l)}),()=>{cancelAnimationFrame(a),cancelAnimationFrame(o),s!=null&&i.clearTimeout(s)}},[b,g,f,e,w==null?void 0:w.visible]),(0,p.useEffect)(()=>{if(!(w!=null&&w.visible)||!S.current||!H)return;let e=vi(S.current),t=[U.editUnitScope,U.visibleUnitScope,U.focusedUnitScope].find(e=>e!=null);if(e&&t&&e.embedId!==t.embedId)return;let r=U.activeSessionScope,i=t??e;if(r&&e&&!t&&e.embedId!==r.embedId)return;let a=i??r??yi(S.current.ownerDocument);if(!a)return;let o=new n.DisposableCollection,s=d.has(hi)?d.get(hi):void 0,c=S.current;if(o.add(H.acquireLease({embedId:a.embedId,role:`child-editor`,owner:`sheet-cell-editor`,hostUnitId:a.hostUnitId,childUnitId:a.childUnitId,associatedChildUnitIds:[n.DOCS_NORMAL_EDITOR_UNIT_ID_KEY]})),s&&o.add(s.registerOwnedElement(a.embedId,c)),o.add(H.registerElement({embedId:a.embedId,role:`child-editor`,element:c})),o.add(zl({editorService:f,embedId:a.embedId,ownerDocument:S.current.ownerDocument,interactionBoundaryService:s,focusCoordinator:H})),a.childType===n.UniverInstanceType.UNIVER_SHEET&&a.childUnitId){let e=S.current.ownerDocument,t=0,r=()=>{g.getContextValue(n.FOCUSING_FX_BAR_EDITOR)||Gl(a.embedId,e)||Rl(f)},i=e=>{H.isChildUnitRuntimeEvent(a.childUnitId,e.target,e)&&!ql(e.target)&&(cancelAnimationFrame(t),t=requestAnimationFrame(r))};e.addEventListener(`pointerdown`,i,!0),e.addEventListener(`pointerup`,i,!0),e.addEventListener(`click`,i,!0),o.add((0,n.toDisposable)(()=>{cancelAnimationFrame(t),e.removeEventListener(`pointerdown`,i,!0),e.removeEventListener(`pointerup`,i,!0),e.removeEventListener(`click`,i,!0)}))}return()=>o.dispose()},[g,f,H,d,U,w==null?void 0:w.visible]),(0,p.useEffect)(()=>{var e;if(w!=null&&w.visible||!H||E||g.getContextValue(i.DISABLE_AUTO_FOCUS_KEY))return;let r=U.activeSessionScope,a=r==null?void 0:r.childUnitId;if(!r||r.childType!==n.UniverInstanceType.UNIVER_SHEET||!a||!h.getUnit(a,n.UniverInstanceType.UNIVER_SHEET))return;let o=((e=S.current)==null?void 0:e.ownerDocument)??document,s=d.has(hi)?d.get(hi):void 0,c=zl({editorService:f,embedId:r.embedId,ownerDocument:o,interactionBoundaryService:s,focusCoordinator:H}),l=o.defaultView??window,u,p=()=>{Kl(r.embedId,o)||(Rl(f),u!=null&&l.clearTimeout(u),u=l.setTimeout(()=>{u=void 0,Kl(r.embedId,o)||Rl(f)},0))},m=()=>{if(Gl(r.embedId,o))return;let e=f.getEditor(n.DOCS_NORMAL_EDITOR_UNIT_ID_KEY),i=e==null?void 0:e.render.with(t.DocSelectionRenderService);i!=null&&i.isFocusing||i==null||i.focus(),p()},_=0,v=0,y=0;m(),_=requestAnimationFrame(()=>{m(),v=requestAnimationFrame(m)});let b=e=>{H.isChildUnitRuntimeEvent(a,e.target,e)&&!ql(e.target)&&(cancelAnimationFrame(y),e.type===`click`&&m(),y=requestAnimationFrame(m))};return o.addEventListener(`pointerdown`,b,!0),o.addEventListener(`pointerup`,b,!0),o.addEventListener(`click`,b,!0),()=>{cancelAnimationFrame(_),cancelAnimationFrame(v),cancelAnimationFrame(y),u!=null&&l.clearTimeout(u),o.removeEventListener(`pointerdown`,b,!0),o.removeEventListener(`pointerup`,b,!0),o.removeEventListener(`click`,b,!0),c.dispose()}},[g,E,f,H,d,h,U,w==null?void 0:w.visible]),(0,p.useEffect)(()=>{var e;let t=(e=S.current)==null?void 0:e.ownerDocument.defaultView;return()=>{t&&C.current!=null&&t.clearTimeout(C.current)}},[]);let ne=(0,i.useEvent)(r=>{var i;if(e||!(w!=null&&w.visible))return;let a=((i=S.current)==null?void 0:i.ownerDocument)??document,o=a.defaultView??window,s=f.getEditor(n.DOCS_NORMAL_EDITOR_UNIT_ID_KEY),c=s==null?void 0:s.render.with(t.DocSelectionRenderService),l=r.target,u=a.activeElement;Ul({root:S.current,target:l,activeElement:u,isEditorFocusing:c==null?void 0:c.isFocusing})&&(C.current!=null&&o.clearTimeout(C.current),C.current=o.setTimeout(()=>{C.current=void 0,Rl(f)},0))}),re=(0,i.useEvent)(()=>{if(y.isVisible().visible)return T.executeCommand(X.id,{visible:!1,eventType:a.DeviceInputEventType.PointerUp,unitId:O==null?void 0:O.unitId})});(0,i.useSidebarClick)(re);let ie=Bl(O==null?void 0:O.unitId),W=(0,i.useEvent)((e,t)=>T.executeCommand(Br.id,{keycode:e,visible:!1,eventType:a.DeviceInputEventType.Keyboard,isShift:t===i.MetaKeys.SHIFT||t===(i.MetaKeys.CTRL_COMMAND|i.MetaKeys.SHIFT),unitId:O==null?void 0:O.unitId}));return/* @__PURE__ */ (0,m.jsxs)(`div`,{ref:S,"data-u-comp":`editor`,className:`univer-absolute univer-z-10 univer-flex`,onPointerDownCapture:ne,style:{left:s.left,top:s.top,width:s.width,height:s.height,opacity:e?0:void 0,pointerEvents:e?`none`:void 0,backgroundColor:I},children:[(w==null?void 0:w.visible)&&L&&ee&&/* @__PURE__ */ (0,m.jsx)(`div`,{"data-u-comp":`sheet-cell-editor-address`,className:`univer-pointer-events-none univer-absolute univer-left-0 univer-top-0 univer-z-10 univer-whitespace-nowrap univer-rounded-t univer-px-1.5 univer-text-xs univer-leading-5`,style:{backgroundColor:B,color:_.getColorFromTheme(`gray.0`),transform:`translateY(-100%)`},children:ee}),D&&/* @__PURE__ */ (0,m.jsx)(D,{editorId:n.DOCS_NORMAL_EDITOR_UNIT_ID_KEY,className:`univer-relative univer-flex univer-size-full [&_canvas]:univer-absolute`,initValue:``,onChange:()=>{},isFocus:!e&&(w==null?void 0:w.visible),unitId:O==null?void 0:O.unitId,subUnitId:O==null?void 0:O.sheetId,keyboardEventConfig:ie,onMoveInEditor:W,isSupportAcrossSheet:!0,resetSelectionOnBlur:!1,isSingle:!1,autoScrollbar:!1,borderless:!0,onFormulaSelectingChange:e=>{e?y.enableForceKeepVisible():y.disableForceKeepVisible()},disableContextMenu:!1,canvasStyle:{backgroundColor:`transparent`}}),(w==null?void 0:w.visible)&&/* @__PURE__ */ (0,m.jsx)(`div`,{"aria-hidden":!0,className:`univer-pointer-events-none univer-absolute univer-left-0 univer-top-0 univer-z-10 univer-box-border`,style:{width:s.width+V,height:s.height+V,border:`${V}px solid ${B}`}})]})}function $({ref:e,...t}){let{preserveStrokeWidth:n,icon:r,id:i,className:a,extend:o,...s}=t,c=`univerjs-icon univerjs-icon-${i} ${a||``}`.trim(),l=`_${(0,p.useId)()}`,u=(0,p.useRef)(null);return(0,p.useImperativeHandle)(e,()=>u.current),(0,p.useLayoutEffect)(()=>{if(n&&u.current&&u.current.localName===r.tag)return Ql(u.current)},[n,r]),Yl(r,`${i}`,{defIds:r.defIds,idSuffix:l},{ref:u,className:c,...s},o)}function Yl(e,t,n,r,i){return(0,p.createElement)(e.tag,{key:t,...Xl(e,n,i),...r},(Zl(e,n).children||[]).map((r,a)=>Yl(r,`${t}-${e.tag}-${a}`,n,void 0,i)))}function Xl(e,t,n){let r={...e.attrs};n!=null&&n.colorChannel1&&r.fill===`colorChannel1`&&(r.fill=n.colorChannel1),n!=null&&n.colorChannel1&&r.stroke===`colorChannel1`&&(r.stroke=n.colorChannel1),e.tag===`mask`&&r.id&&(r.id+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{e===`mask`&&typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))});let{defIds:i}=t;return!i||i.length===0||(e.tag===`use`&&r[`xlink:href`]&&(r[`xlink:href`]+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))})),r}function Zl(e,t){var n;let{defIds:r}=t;return!r||r.length===0?e:e.tag===`defs`&&(n=e.children)!=null&&n.length?{...e,children:e.children.map(e=>typeof e.attrs.id==`string`&&r&&r.includes(e.attrs.id)?{...e,attrs:{...e.attrs,id:e.attrs.id+t.idSuffix}}:e)}:e}function Ql(e){let t=e.viewBox.baseVal,n=Math.max(t.width,t.height);if(!Number.isFinite(n)||n<=0||t.width<=0||t.height<=0)return()=>void 0;let r=16/n,i=Array.from(e.querySelectorAll(`circle, ellipse, line, path, polygon, polyline, rect, text, textPath, tspan, use`)).flatMap(e=>{let t=getComputedStyle(e),n=Number.parseFloat(t.strokeWidth);return t.stroke===`none`||Number.parseFloat(t.strokeOpacity)===0||t.vectorEffect===`non-scaling-stroke`||!Number.isFinite(n)||n<=0?[]:[{element:e,hadStyleAttribute:e.hasAttribute(`style`),originalStrokeWidth:n,strokeWidth:$l(e.style,`stroke-width`)}]}).map(e=>({appliedStrokeWidth:null,element:e.element,hadStyleAttribute:e.hadStyleAttribute,isReleased:!1,originalStrokeWidth:e.originalStrokeWidth,strokeWidth:e.strokeWidth}));if(i.length===0)return()=>void 0;let a=(e,n)=>{if(t.width<=0||t.height<=0||e<=0||n<=0)return;let a=Math.min(e/t.width,n/t.height);!Number.isFinite(a)||a<=0||i.forEach(e=>{if(e.isReleased)return;if(e.appliedStrokeWidth!==null&&(e.element.style.getPropertyValue(`stroke-width`)!==e.appliedStrokeWidth||e.element.style.getPropertyPriority(`stroke-width`)!==e.strokeWidth.priority)){e.appliedStrokeWidth=null,e.isReleased=!0;return}let t=e.originalStrokeWidth*r/a,n=`${Number(t.toFixed(12))}px`;e.element.style.setProperty(`stroke-width`,n,e.strokeWidth.priority),e.appliedStrokeWidth=n})},o=e.getBoundingClientRect();a(o.width,o.height);let s=typeof ResizeObserver>`u`?null:new ResizeObserver(t=>{if(t.some(t=>t.target===e)){let t=e.getBoundingClientRect();a(t.width,t.height)}});return s==null||s.observe(e),()=>{s==null||s.disconnect(),i.forEach(e=>{e.appliedStrokeWidth!==null&&(eu(e.element.style,`stroke-width`,e.appliedStrokeWidth,e.strokeWidth.priority,e.strokeWidth),!e.hadStyleAttribute&&e.element.style.length===0&&e.element.removeAttribute(`style`))})}}function $l(e,t){return{priority:e.getPropertyPriority(t),value:e.getPropertyValue(t)}}function eu(e,t,n,r,i){e.getPropertyValue(t)===n&&e.getPropertyPriority(t)===r&&(i.value?e.setProperty(t,i.value,i.priority):e.removeProperty(t))}$.displayName=`UniverIcon`;let tu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M7.9998 1.65005H3.64981C2.54524 1.65005 1.6498 2.54548 1.6498 3.65005V12.35C1.6498 13.4546 2.54523 14.35 3.6498 14.35H12.3498C13.4544 14.35 14.3498 13.4546 14.3498 12.3501V8.00005`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.2}},{tag:`path`,attrs:{stroke:`currentColor`,d:`M1.6498 11.2148L5.43408 8.29588L10.711 12.0198`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.2}},{tag:`path`,attrs:{stroke:`currentColor`,d:`M9.46559 10.1621L10.9774 8.65032C11.2042 8.42344 11.5634 8.39794 11.8201 8.59045L14.3498 10.4877`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.2}},{tag:`path`,attrs:{stroke:`currentColor`,d:`M11.8097 1.74783V6.24167M9.6603 3.897H14.1541`,strokeLinecap:`round`,strokeWidth:1.2}}]},nu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`add-image-icon`,ref:t,icon:tu}))});nu.displayName=`AddImageIcon`;let ru={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M1.3999 13.6999C1.3999 13.3685 1.66853 13.0999 1.9999 13.0999H13.9999C14.3313 13.0999 14.5999 13.3685 14.5999 13.6999C14.5999 14.0312 14.3313 14.2999 13.9999 14.2999H1.9999C1.66853 14.2999 1.3999 14.0312 1.3999 13.6999Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M7.57564 10.3914C7.80995 10.6257 8.18985 10.6257 8.42417 10.3914L10.4242 8.3914C10.6585 8.15709 10.6585 7.77719 10.4242 7.54287C10.1899 7.30856 9.80995 7.30856 9.57564 7.54287L7.9999 9.11861L6.42417 7.54287C6.18985 7.30856 5.80995 7.30856 5.57564 7.54287C5.34132 7.77719 5.34132 8.15709 5.57564 8.3914L7.57564 10.3914Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M7.9999 10.5671C8.33127 10.5671 8.5999 10.2985 8.5999 9.96714V2.30047C8.5999 1.9691 8.33127 1.70047 7.9999 1.70047C7.66853 1.70047 7.3999 1.9691 7.3999 2.30047V9.96714C7.3999 10.2985 7.66853 10.5671 7.9999 10.5671Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},iu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`align-bottom-icon`,ref:t,icon:ru}))});iu.displayName=`AlignBottomIcon`;let au={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M1.3999 2.3002C1.3999 2.63157 1.66853 2.9002 1.9999 2.9002H13.9999C14.3313 2.9002 14.5999 2.63157 14.5999 2.3002C14.5999 1.96882 14.3313 1.7002 13.9999 1.7002H1.9999C1.66853 1.7002 1.3999 1.96882 1.3999 2.3002Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M8.22957 5.47839C8.30034 5.50767 8.36664 5.55107 8.42417 5.6086L10.4242 7.6086C10.6585 7.84291 10.6585 8.22281 10.4242 8.45713C10.1899 8.69144 9.80995 8.69144 9.57564 8.45713L8.5999 7.48139V13.6995C8.5999 14.0309 8.33127 14.2995 7.9999 14.2995C7.66853 14.2995 7.3999 14.0309 7.3999 13.6995V7.48139L6.42417 8.45713C6.18985 8.69144 5.80995 8.69144 5.57564 8.45713C5.34132 8.22281 5.34132 7.84291 5.57564 7.6086L7.57541 5.60882C7.7522 5.43203 8.01209 5.38841 8.22957 5.47839Z`}}]},ou=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`align-top-icon`,ref:t,icon:au}))});ou.displayName=`AlignTopIcon`;let su={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M7.9999 1.12915C8.03875 1.12915 8.07673 1.13284 8.11352 1.13989H12.2599C13.6958 1.13989 14.8599 2.30395 14.8599 3.73989V7.88619C14.867 7.92301 14.8707 7.96102 14.8707 7.9999C14.8707 8.03878 14.867 8.0768 14.8599 8.11362V12.2599C14.8599 13.6958 13.6958 14.8599 12.2599 14.8599H8.11362C8.0768 14.867 8.03878 14.8707 7.9999 14.8707C7.96102 14.8707 7.92301 14.867 7.88619 14.8599H3.73989C2.30396 14.8599 1.13989 13.6958 1.13989 12.2599V8.11352C1.13284 8.07673 1.12915 8.03875 1.12915 7.9999C1.12915 7.96106 1.13284 7.92308 1.13989 7.88629V3.73989C1.13989 2.30396 2.30395 1.13989 3.73989 1.13989H7.88629C7.92308 1.13284 7.96106 1.12915 7.9999 1.12915ZM2.33989 8.5999V12.2599C2.33989 13.0331 2.9667 13.6599 3.73989 13.6599H7.3999V8.5999H2.33989ZM7.3999 7.3999H2.33989V3.73989C2.33989 2.9667 2.96669 2.33989 3.73989 2.33989H7.3999V7.3999ZM8.5999 8.5999V13.6599H12.2599C13.0331 13.6599 13.6599 13.0331 13.6599 12.2599V8.5999H8.5999ZM13.6599 7.3999H8.5999V2.33989H12.2599C13.0331 2.33989 13.6599 2.96669 13.6599 3.73989V7.3999Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},cu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`all-border-icon`,ref:t,icon:su}))});cu.displayName=`AllBorderIcon`;let lu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M2.5999 2.2001C2.5999 1.86873 2.33127 1.6001 1.9999 1.6001C1.66853 1.6001 1.3999 1.86873 1.3999 2.2001V13.8001C1.3999 14.1315 1.66853 14.4001 1.9999 14.4001C2.33127 14.4001 2.5999 14.1315 2.5999 13.8001V2.2001Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M14.5999 2.2001C14.5999 1.86873 14.3313 1.6001 13.9999 1.6001C13.6685 1.6001 13.3999 1.86873 13.3999 2.2001V13.8001C13.3999 14.1315 13.6685 14.4001 13.9999 14.4001C14.3313 14.4001 14.5999 14.1315 14.5999 13.8001V2.2001Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M6.424 8.24239C6.65832 8.4767 6.65832 8.8566 6.424 9.09091L6.11502 9.3999H9.33307C10.1063 9.3999 10.7331 8.7731 10.7331 7.9999C10.7331 7.22671 10.1063 6.5999 9.33307 6.5999H4.6666L4.66645 5.3999H9.33307C10.769 5.3999 11.9331 6.56396 11.9331 7.9999C11.9331 9.43584 10.769 10.5999 9.33307 10.5999H6.11485L6.424 10.9091C6.65832 11.1434 6.65832 11.5233 6.424 11.7576C6.18969 11.9919 5.80979 11.9919 5.57548 11.7576L4.24214 10.4242C4.00783 10.1899 4.00783 9.81003 4.24214 9.57572L5.57548 8.24239C5.80979 8.00807 6.18969 8.00807 6.424 8.24239Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M4.6666 6.5999C4.33523 6.5999 4.06641 6.33127 4.06641 5.9999C4.06641 5.66853 4.33508 5.3999 4.66645 5.3999L4.6666 6.5999Z`}}]},uu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`autowrap-icon`,ref:t,icon:lu}))});uu.displayName=`AutowrapIcon`;let du={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M4.65791 1.30005C3.77355 1.30005 3.05664 2.01696 3.05664 2.90132V12.8588C3.05664 13.8755 3.88086 14.6998 4.89759 14.6998H9.1016C11.2233 14.6998 12.9433 12.9798 12.9433 10.8581C12.9433 9.13925 11.8145 7.68407 10.2578 7.1934C10.8806 6.56856 11.2655 5.70659 11.2655 4.75472C11.2655 2.84676 9.71883 1.30005 7.81087 1.30005H4.65791ZM4.25664 2.90132C4.25664 2.6797 4.4363 2.50005 4.65791 2.50005H7.81087C9.05609 2.50005 10.0655 3.5095 10.0655 4.75472C10.0655 5.99993 9.05609 7.00938 7.81087 7.00938H4.25664V2.90132ZM4.25664 12.8588V8.21636H9.1016C10.5606 8.21636 11.7433 9.39909 11.7433 10.8581C11.7433 12.317 10.5606 13.4998 9.1016 13.4998H4.89759C4.5436 13.4998 4.25664 13.2128 4.25664 12.8588Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},fu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`bold-icon`,ref:t,icon:du}))});fu.displayName=`BoldIcon`;let pu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M2.59219 1.3667C1.70853 1.3667 0.992188 2.08304 0.992188 2.9667V4.9667C0.992188 5.85036 1.70853 6.5667 2.59219 6.5667H11.2694C12.1531 6.5667 12.8694 5.85036 12.8694 4.9667V4.79985H13.8075V8.18642C13.8075 8.38777 13.6579 8.55773 13.4581 8.58321L7.10511 9.39341C6.30618 9.4953 5.70752 10.1752 5.70752 10.9806V14.0332C5.70752 14.3646 5.97615 14.6332 6.30752 14.6332C6.63889 14.6332 6.90752 14.3646 6.90752 14.0332V10.9806C6.90752 10.7792 7.05718 10.6092 7.25692 10.5838L13.6099 9.77356C14.4089 9.67168 15.0075 8.99182 15.0075 8.18642V4.19985C15.0075 3.86848 14.7389 3.59985 14.4075 3.59985H12.8694V2.9667C12.8694 2.08304 12.1531 1.3667 11.2694 1.3667H2.59219ZM2.19219 2.9667C2.19219 2.74579 2.37127 2.5667 2.59219 2.5667H11.2694C11.4903 2.5667 11.6694 2.74579 11.6694 2.9667V4.9667C11.6694 5.18761 11.4903 5.3667 11.2694 5.3667H2.59219C2.37127 5.3667 2.19219 5.18761 2.19219 4.9667V2.9667Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},mu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`brush-icon`,ref:t,icon:pu}))});mu.displayName=`BrushIcon`;let hu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M1.14014 3.73989C1.14014 2.30396 2.3042 1.13989 3.74014 1.13989H12.2601C13.6961 1.13989 14.8601 2.30395 14.8601 3.73989V4.86989C14.8601 5.20126 14.5915 5.46989 14.2601 5.46989C13.9288 5.46989 13.6601 5.20126 13.6601 4.86989V3.73989C13.6601 2.96669 13.0333 2.33989 12.2601 2.33989H8.34014V3.20284C8.34014 3.20446 8.34014 3.20608 8.34014 3.2077V6.73989C8.34014 7.62355 7.62379 8.33989 6.74014 8.33989H2.70277C2.70112 8.3399 2.69947 8.3399 2.69781 8.33989H2.34014V12.2599C2.34014 13.0331 2.96694 13.6599 3.74014 13.6599H12.2601C13.0333 13.6599 13.6601 13.0331 13.6601 12.2599V11.7299C13.6601 11.3985 13.9288 11.1299 14.2601 11.1299C14.5915 11.1299 14.8601 11.3985 14.8601 11.7299V12.2599C14.8601 13.6958 13.6961 14.8599 12.2601 14.8599H3.74014C2.3042 14.8599 1.14014 13.6958 1.14014 12.2599V3.73989ZM4.26409 7.13989H6.74014C6.96105 7.13989 7.14014 6.96081 7.14014 6.73989V4.55237L4.26409 7.13989ZM7.14014 2.93819V2.33989H6.28159L2.34044 5.614L2.34056 7.13989H2.46992L7.14014 2.93819ZM2.34032 4.05403L4.40368 2.33989H3.74029C2.96705 2.33989 2.34023 2.96676 2.34029 3.74L2.34032 4.05403Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M8.73877 9.00298C8.73877 9.55526 9.18649 10.003 9.73877 10.003H11.7792C12.1106 10.003 12.3792 9.73435 12.3792 9.40298C12.3792 9.07161 12.1106 8.80298 11.7792 8.80298H10.7874L12.2304 7.36157C12.7051 6.88734 13.4743 6.88754 13.9488 7.36202C14.4234 7.83667 14.4234 8.60624 13.9488 9.0809L13.2095 9.82016C12.9752 10.0545 12.9752 10.4344 13.2095 10.6687C13.4439 10.903 13.8238 10.903 14.0581 10.6687L14.7973 9.92943C15.7406 8.98614 15.7406 7.45678 14.7973 6.51349C13.8544 5.57056 12.3257 5.57015 11.3823 6.51259L9.93877 7.95459V6.96255C9.93877 6.63118 9.67014 6.36255 9.33877 6.36255C9.0074 6.36255 8.73877 6.63118 8.73877 6.96255V9.00298Z`}}]},gu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`cancel-freeze-icon`,ref:t,icon:hu}))});gu.displayName=`CancelFreezeIcon`;let _u={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M12.5939 1.13916L10.6607 1.1392C9.55628 1.13922 8.66093 2.03448 8.66077 3.13893L8.66063 4.19191C8.66059 4.52328 8.92918 4.79194 9.26055 4.79199C9.59192 4.79204 9.86059 4.52344 9.86063 4.19207L9.86077 3.13909C9.86084 2.69731 10.219 2.33921 10.6608 2.3392L12.594 2.33916C13.0358 2.33915 13.394 2.69732 13.394 3.13916L13.394 12.8612C13.394 13.303 13.0358 13.6612 12.594 13.6612H10.6606C10.2188 13.6612 9.86063 13.303 9.86063 12.8612V11.8084C9.86063 11.4771 9.592 11.2084 9.26063 11.2084C8.92926 11.2084 8.66063 11.4771 8.66063 11.8084V12.8612C8.66063 13.9658 9.55606 14.8612 10.6606 14.8612H12.594C13.6986 14.8612 14.594 13.9658 14.594 12.8612L14.594 3.13915C14.594 2.03457 13.6985 1.13914 12.5939 1.13916Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M5.33888 1.13919L3.40568 1.13926C2.30114 1.13931 1.40575 2.03474 1.40576 3.13928L1.40586 12.8612C1.40587 13.9658 2.3013 14.8612 3.40586 14.8612H5.33896C6.44353 14.8612 7.33896 13.9658 7.33896 12.8612V11.8084C7.33896 11.4771 7.07033 11.2084 6.73896 11.2084C6.40759 11.2084 6.13896 11.4771 6.13896 11.8084V12.8612C6.13896 13.303 5.78079 13.6612 5.33896 13.6612H3.40586C2.96403 13.6612 2.60586 13.303 2.60586 12.8612L2.60576 3.13927C2.60576 2.69745 2.96391 2.33928 3.40573 2.33926L5.33893 2.33919C5.78077 2.33917 6.13896 2.69735 6.13896 3.13919V4.192C6.13896 4.52337 6.40759 4.792 6.73896 4.792C7.07033 4.792 7.33896 4.52337 7.33896 4.192V3.13919C7.33896 2.03459 6.44348 1.13914 5.33888 1.13919Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M9.20731 5.99993C8.973 6.23424 8.973 6.61414 9.20731 6.84845L10.0912 7.73235C10.2474 7.88856 10.2474 8.14182 10.0912 8.29803L9.20731 9.18192C8.973 9.41624 8.973 9.79614 9.20731 10.0305C9.44163 10.2648 9.82153 10.2648 10.0558 10.0305L10.9397 9.14654C11.5646 8.52171 11.5646 7.50867 10.9397 6.88384L10.0558 5.99993C9.82153 5.76561 9.44163 5.76561 9.20731 5.99993Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M5.94379 5.99993C6.1781 5.76561 6.558 5.76561 6.79232 5.99993C7.02663 6.23424 7.02663 6.61414 6.79232 6.84845L5.90842 7.73235C5.75221 7.88856 5.75221 8.14182 5.90842 8.29803L6.79232 9.18193C7.02663 9.41624 7.02663 9.79614 6.79232 10.0305C6.558 10.2648 6.1781 10.2648 5.94379 10.0305L5.0599 9.14656C4.43506 8.52172 4.43506 7.50866 5.0599 6.88382L5.94379 5.99993Z`}}]},vu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`cancel-merge-icon`,ref:t,icon:_u}))});vu.displayName=`CancelMergeIcon`;let yu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M2.27 8L6.09 11.82L13.73 4.18`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.2}}]},bu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`check-mark-icon`,ref:t,icon:yu}))});bu.displayName=`CheckMarkIcon`;let xu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M3.3 3.3L12.7 12.7M12.7 3.3L3.3 12.7`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.2}}]},Su=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`close-icon`,ref:t,icon:xu}))});Su.displayName=`CloseIcon`;let Cu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M9.92206 2.45064C9.98634 2.12556 9.77492 1.80992 9.44984 1.74564C9.12477 1.68136 8.80913 1.89278 8.74485 2.21785L6.41152 14.0179C6.34724 14.3429 6.55865 14.6586 6.88373 14.7228C7.20881 14.7871 7.52444 14.5757 7.58872 14.2506L9.92206 2.45064Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M5.14972 3.90157C5.38815 4.1317 5.39487 4.51154 5.16473 4.74996L2.55461 7.45409C2.01739 8.01066 2.03336 8.89745 2.59029 9.43431L5.14944 11.9013C5.38802 12.1313 5.39498 12.5111 5.165 12.7497C4.93502 12.9883 4.55519 12.9952 4.31662 12.7652L1.75746 10.2983C0.723174 9.30122 0.693506 7.65434 1.69121 6.6207L4.30133 3.91657C4.53146 3.67815 4.9113 3.67143 5.14972 3.90157Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M10.8505 3.90157C11.0889 3.67143 11.4688 3.67815 11.6989 3.91657L14.309 6.6207C15.3067 7.65434 15.2771 9.30122 14.2428 10.2983L11.6836 12.7652C11.4451 12.9952 11.0652 12.9883 10.8352 12.7497C10.6053 12.5111 10.6122 12.1313 10.8508 11.9013L13.41 9.43431C13.9669 8.89745 13.9829 8.01066 13.4456 7.45409L10.8355 4.74996C10.6054 4.51154 10.6121 4.1317 10.8505 3.90157Z`}}]},wu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`code-icon`,ref:t,icon:Cu}))});wu.displayName=`CodeIcon`;let Tu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`g`,attrs:{fill:`currentColor`,clipPath:`url(#convert-icon_clip0_911_593)`},children:[{tag:`path`,attrs:{d:`M2.44766 0.848145C1.564 0.848145 0.847656 1.56449 0.847656 2.44814V6.44814C0.847656 7.3318 1.564 8.04814 2.44766 8.04814H6.44766C7.33131 8.04814 8.04766 7.3318 8.04766 6.44814V2.44814C8.04766 1.56449 7.33131 0.848145 6.44766 0.848145H2.44766ZM2.04766 6.44814V5.04824H3.84775V6.84814H2.44766C2.22674 6.84814 2.04766 6.66906 2.04766 6.44814ZM2.04766 3.84824H3.84775V2.04814H2.44766C2.22674 2.04814 2.04766 2.22723 2.04766 2.44814V3.84824ZM5.04775 6.84814V5.04824H6.84766V6.44814C6.84766 6.66906 6.66857 6.84814 6.44766 6.84814H5.04775ZM5.04775 3.84824H6.84766V2.44814C6.84766 2.22723 6.66857 2.04814 6.44766 2.04814H5.04775V3.84824Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{d:`M9.55215 7.95166C8.66849 7.95166 7.95215 8.668 7.95215 9.55166V13.5517C7.95215 14.4353 8.66849 15.1517 9.55215 15.1517L11.5522 15.1517L13.5521 15.1517C14.4358 15.1517 15.1521 14.4353 15.1521 13.5517L15.1521 11.5518L15.1521 9.55166C15.1521 8.668 14.4358 7.95166 13.5521 7.95166H9.55215ZM13.9521 10.9518V9.55166C13.9521 9.33075 13.7731 9.15166 13.5521 9.15166H12.1522V10.9518H13.9521ZM10.9522 10.9518V9.15166H9.55215C9.33123 9.15166 9.15215 9.33075 9.15215 9.55166V10.9518H10.9522ZM9.15215 12.1518H10.9522V13.9517H9.55215C9.33123 13.9517 9.15215 13.7726 9.15215 13.5517V12.1518ZM12.1522 12.1518H13.9521V13.5517C13.9521 13.7726 13.7731 13.9517 13.5521 13.9517H12.1522V12.1518Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{d:`M9.62158 2.44912C9.62158 2.11775 9.89021 1.84912 10.2216 1.84912H12.7516C13.6352 1.84912 14.3516 2.56547 14.3516 3.44912V5.9791C14.3516 6.31047 14.0829 6.5791 13.7516 6.5791C13.4202 6.5791 13.1516 6.31047 13.1516 5.9791V3.44912C13.1516 3.22821 12.9725 3.04912 12.7516 3.04912H10.2216C9.89021 3.04912 9.62158 2.78049 9.62158 2.44912Z`}},{tag:`path`,attrs:{d:`M5.77871 14.1507C6.11008 14.1507 6.37871 13.8821 6.37871 13.5507C6.37871 13.2193 6.11008 12.9507 5.77871 12.9507L3.24873 12.9507C3.02782 12.9507 2.84873 12.7716 2.84873 12.5507L2.84873 10.0207C2.84873 9.68933 2.5801 9.4207 2.24873 9.4207C1.91736 9.4207 1.64873 9.68933 1.64873 10.0207L1.64873 12.5507C1.64873 13.4343 2.36507 14.1507 3.24873 14.1507H5.77871Z`}}]},{tag:`defs`,attrs:{},children:[{tag:`clipPath`,attrs:{id:`convert-icon_clip0_911_593`},children:[{tag:`path`,attrs:{fill:`white`,d:`M0 0H16V16H0z`}}]}]}],defIds:[`convert-icon_clip0_911_593`]},Eu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`convert-icon`,ref:t,icon:Tu}))});Eu.displayName=`ConvertIcon`;let Du={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M2 3.5V6.2C2 7.2 2.8 8 3.8 8H6.4M4.8 6.2L6.6 8L4.8 9.8`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.2}},{tag:`path`,attrs:{stroke:`currentColor`,d:`M9.8 3.2L8.8 12.8M13.2 3.2L12.2 12.8M8 6.2H14M7.7 9.8H13.7`,strokeLinecap:`round`,strokeWidth:1.2}}]},Ou=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`convert-to-number-icon`,ref:t,icon:Du}))});Ou.displayName=`ConvertToNumberIcon`;let ku={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M2.50095 1.84399C2.73322 1.60765 3.11311 1.60435 3.34945 1.83662L8.00012 6.40726L12.6508 1.83662C12.8871 1.60435 13.267 1.60765 13.4993 1.84399C13.7316 2.08032 13.7283 2.46021 13.4919 2.69248L8.85611 7.24852L10.8941 9.25146C11.1382 9.17563 11.3976 9.13477 11.6667 9.13477C13.1026 9.13477 14.2667 10.2988 14.2667 11.7348C14.2667 13.1707 13.1026 14.3348 11.6667 14.3348C10.2307 14.3348 9.06665 13.1707 9.06665 11.7348C9.06665 11.0143 9.35973 10.3622 9.83319 9.89129L8.00012 8.08978L6.16708 9.89127C6.64055 10.3622 6.93364 11.0142 6.93364 11.7348C6.93364 13.1707 5.76958 14.3348 4.33364 14.3348C2.8977 14.3348 1.73364 13.1707 1.73364 11.7348C1.73364 10.2988 2.8977 9.13477 4.33364 9.13477C4.60263 9.13477 4.86208 9.17562 5.10612 9.25145L7.14413 7.24852L2.50831 2.69248C2.27197 2.46021 2.26868 2.08032 2.50095 1.84399ZM2.93364 11.7348C2.93364 10.9616 3.56044 10.3348 4.33364 10.3348C5.10684 10.3348 5.73364 10.9616 5.73364 11.7348C5.73364 12.508 5.10684 13.1348 4.33364 13.1348C3.56044 13.1348 2.93364 12.508 2.93364 11.7348ZM10.2667 11.7348C10.2667 10.9616 10.8935 10.3348 11.6667 10.3348C12.4398 10.3348 13.0667 10.9616 13.0667 11.7348C13.0667 12.508 12.4398 13.1348 11.6667 13.1348C10.8935 13.1348 10.2667 12.508 10.2667 11.7348Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Au=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`cut-icon`,ref:t,icon:ku}))});Au.displayName=`CutIcon`;let ju={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M5.93 1.47H10.07M1.7 3.64H14.3M4.75 5.82H11.25A1 1 0 0 1 12.25 6.82V12.53A2 2 0 0 1 10.25 14.53H5.75A2 2 0 0 1 3.75 12.53V6.82A1 1 0 0 1 4.75 5.82ZM6.55 8.73L9.45 11.63M9.45 8.73L6.55 11.63`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.2}}]},Mu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`delete-icon`,ref:t,icon:ju}))});Mu.displayName=`DeleteIcon`;let Nu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M4.5 2.75H3.25C2.56 2.75 2 3.31 2 4V12.75C2 13.44 2.56 14 3.25 14H5.5M8.5 2.75H9.75C10.44 2.75 11 3.31 11 4V5`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.33}},{tag:`rect`,attrs:{width:4,height:2.5,x:4.5,y:1.5,stroke:`currentColor`,rx:.75,strokeWidth:1.33}},{tag:`rect`,attrs:{width:7,height:7,x:7.5,y:7,stroke:`currentColor`,rx:1.25,strokeWidth:1.33}},{tag:`path`,attrs:{stroke:`currentColor`,d:`M9.25 9.25H12.75M9.25 11.75H12.75M10.25 8.5V10M11.75 11V12.5`,strokeLinecap:`round`,strokeWidth:1.33}}]},Pu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`doc-paste-options-icon`,ref:t,icon:Nu}))});Pu.displayName=`DocPasteOptionsIcon`;let Fu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M8.55935 11.7617C8.29238 12.1202 7.75558 12.1202 7.48861 11.7617L3.08649 5.84931C2.75722 5.40708 3.07292 4.77771 3.62432 4.77771H12.4236C12.975 4.77771 13.2907 5.40708 12.9614 5.84931L8.55935 11.7617Z`}}]},Iu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`down-icon`,ref:t,icon:Fu}))});Iu.displayName=`DownIcon`;let Lu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M2.35381 3.65517C2.35381 2.88198 2.98061 2.25518 3.75381 2.25518H8.10381C8.43518 2.25518 8.70381 1.98655 8.70381 1.65518C8.70381 1.3238 8.43518 1.05518 8.10381 1.05518H3.75381C2.31787 1.05518 1.15381 2.21923 1.15381 3.65517V12.3552C1.15381 13.7911 2.31787 14.9552 3.75381 14.9552H12.4538C13.8897 14.9552 15.0538 13.7911 15.0538 12.3552V8.00518C15.0538 7.6738 14.7852 7.40518 14.4538 7.40518C14.1224 7.40518 13.8538 7.6738 13.8538 8.00518V9.24469L12.3428 8.11143C11.8294 7.72642 11.1111 7.77744 10.6573 8.23119L9.11281 9.77567L6.84342 7.83047C6.34812 7.40592 5.61375 7.41815 5.13289 7.85896L2.35381 10.4064V3.65517ZM2.35381 12.0343V12.3552C2.35381 13.1284 2.98061 13.7552 3.75381 13.7552H12.4538C13.227 13.7552 13.8538 13.1284 13.8538 12.3552V10.7447L11.6228 9.07144C11.5871 9.04469 11.5373 9.04827 11.5058 9.07971L10.0266 10.5589L11.2057 11.5696C11.4573 11.7853 11.4865 12.164 11.2708 12.4156C11.0552 12.6672 10.6764 12.6964 10.4248 12.4807L6.06245 8.74157C6.02809 8.71212 5.97713 8.71296 5.94377 8.74353L2.35381 12.0343Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M10.3911 3.84419C10.6254 3.60988 11.0053 3.60988 11.2396 3.84419L11.8818 4.48643V1.93496C11.8818 1.60359 12.1505 1.33496 12.4818 1.33496C12.8132 1.33496 13.0818 1.60359 13.0818 1.93496V4.48676L13.7244 3.84419C13.9587 3.60988 14.3386 3.60988 14.5729 3.84419C14.8072 4.07851 14.8072 4.45841 14.5729 4.69272L12.9063 6.35939C12.6719 6.5937 12.292 6.5937 12.0577 6.35939L10.3911 4.69272C10.1568 4.45841 10.1568 4.07851 10.3911 3.84419Z`}}]},Ru=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`download-image-icon`,ref:t,icon:Lu}))});Ru.displayName=`DownloadImageIcon`;let zu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM10.3097 5.69014C10.544 5.92445 10.544 6.30435 10.3097 6.53867L8.84843 7.9999L10.3099 9.46137C10.5442 9.69569 10.5442 10.0756 10.3099 10.3099C10.0756 10.5442 9.69569 10.5442 9.46137 10.3099L7.9999 8.84843L6.53842 10.3099C6.30411 10.5442 5.92421 10.5442 5.6899 10.3099C5.45558 10.0756 5.45558 9.69569 5.6899 9.46137L7.15137 7.9999L5.69014 6.53867C5.45583 6.30435 5.45583 5.92445 5.69014 5.69014C5.92445 5.45583 6.30435 5.45583 6.53867 5.69014L7.9999 7.15137L9.46113 5.69014C9.69544 5.45583 10.0753 5.45583 10.3097 5.69014Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Bu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`error-icon`,ref:t,icon:zu}))});Bu.displayName=`ErrorIcon`;let Vu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M7.46613 5.2614C7.99641 5.15377 8.54607 5.209 9.04566 5.42016C9.54527 5.63133 9.9725 5.98902 10.2732 6.44821C10.5739 6.90741 10.7345 7.44742 10.7345 7.99994C10.7345 8.74088 10.446 9.45122 9.93293 9.97475C9.41991 10.4982 8.72439 10.7921 7.99945 10.7921C7.45882 10.7921 6.93021 10.6285 6.48047 10.3219C6.03072 10.0152 5.67998 9.57922 5.47282 9.06887C5.26565 8.55852 5.21142 7.99686 5.31705 7.45498C5.42268 6.9131 5.68338 6.41554 6.06598 6.02513C6.44856 5.63474 6.93584 5.36903 7.46613 5.2614ZM7.99945 6.50637C7.70941 6.50637 7.42599 6.59414 7.18504 6.75842C6.94411 6.92269 6.75652 7.15604 6.64579 7.4288C6.53508 7.70156 6.50613 8.00161 6.56255 8.29108C6.61898 8.58055 6.7583 8.84663 6.96308 9.05559C7.16788 9.26456 7.42896 9.40703 7.7134 9.46476C7.99784 9.5225 8.29266 9.49286 8.56052 9.37964C8.82836 9.26643 9.05707 9.07481 9.21789 8.82922C9.3787 8.58364 9.46445 8.29505 9.46445 7.99994C9.46445 7.60424 9.31042 7.22449 9.03583 6.94429C8.76119 6.66405 8.38842 6.50637 7.99945 6.50637Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.06445 7.99994C1.06445 7.86432 1.111 7.68433 1.20506 7.46997C1.29865 7.25669 1.43723 7.01393 1.61634 6.75416C1.97451 6.23466 2.49209 5.65088 3.12753 5.10347C4.3995 4.00771 6.13495 3.06494 7.99945 3.06494C9.86395 3.06494 11.5994 4.00771 12.8714 5.10347C13.5068 5.65088 14.0244 6.23466 14.3826 6.75416C14.5617 7.01393 14.7003 7.25669 14.7938 7.46997C14.8879 7.68433 14.9345 7.86432 14.9345 7.99994C14.9345 8.29406 14.7859 8.75016 14.4847 9.27371C14.1847 9.79497 13.7374 10.3759 13.1495 10.9188C11.974 12.0042 10.2392 12.9349 7.99945 12.9349C5.75972 12.9349 4.02489 12.0042 2.84937 10.9188C2.26147 10.3759 1.81418 9.79497 1.51423 9.27371C1.21296 8.75016 1.06445 8.29406 1.06445 7.99994ZM7.99945 4.36351C6.48933 4.36351 5.14092 5.09788 4.14125 5.91406C3.64087 6.32258 3.22616 6.75295 2.92026 7.12521C2.61595 7.49554 2.415 7.81359 2.34753 7.99756L2.33827 8.0228L2.34954 8.0472C2.85275 9.13669 3.65354 10.055 4.65594 10.6918C5.65805 11.3283 6.81899 11.6563 7.99945 11.6364C9.17991 11.6563 10.3409 11.3283 11.343 10.6918C12.3454 10.055 13.1462 9.13669 13.6494 8.0472L13.6606 8.0228L13.6514 7.99756C13.5839 7.81359 13.383 7.49554 13.0786 7.12521C12.7727 6.75295 12.358 6.32258 11.8577 5.91406C10.858 5.09788 9.50957 4.36351 7.99945 4.36351Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Hu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`eye-icon`,ref:t,icon:Vu}))});Hu.displayName=`EyeIcon`;let Uu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M1.28096 4.6541C1.57489 4.50109 1.93721 4.61533 2.09022 4.90926C2.27315 5.26067 2.55999 5.60455 2.94829 5.92278C4.04628 6.82266 5.87505 7.44865 7.99828 7.44865C10.1215 7.44865 11.9503 6.82267 13.0482 5.92279C13.4366 5.60455 13.7234 5.26067 13.9063 4.90927C14.0594 4.61533 14.4217 4.50109 14.7156 4.65409C15.0095 4.8071 15.1238 5.16941 14.9708 5.46334C14.6995 5.98445 14.2981 6.44997 13.8089 6.8509C13.7298 6.91575 13.6481 6.97914 13.564 7.041L15.2245 8.70153C15.4588 8.93585 15.4588 9.31575 15.2245 9.55006C14.9902 9.78438 14.6103 9.78438 14.376 9.55006L12.5041 7.67822C11.8977 7.97568 11.2181 8.21208 10.4884 8.37706L11.0996 10.6581C11.1853 10.9782 10.9954 11.3072 10.6753 11.393C10.3552 11.4787 10.0262 11.2888 9.94045 10.9687L9.29949 8.57652C8.8758 8.62404 8.44081 8.64865 7.99828 8.64865C7.55276 8.64865 7.11487 8.62371 6.68846 8.57555L6.04723 10.9687C5.96147 11.2888 5.63247 11.4788 5.31239 11.393C4.99231 11.3073 4.80236 10.9783 4.88812 10.6582L5.49983 8.37516C4.7743 8.2105 4.09843 7.9752 3.49498 7.67947L1.62436 9.55009C1.39005 9.78441 1.01015 9.78441 0.775835 9.5501C0.54152 9.31578 0.541518 8.93588 0.775832 8.70157L2.43478 7.04261C2.34987 6.98024 2.26746 6.91632 2.18764 6.8509C1.69842 6.44997 1.29706 5.98445 1.0258 5.46335C0.872791 5.16942 0.987031 4.80711 1.28096 4.6541Z`}}]},Wu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`eyelash-icon`,ref:t,icon:Uu}))});Wu.displayName=`EyelashIcon`;let Gu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M4.92494 2.4224C5.37364 1.19807 7.10523 1.19807 7.55394 2.4224L11.7284 13.8128C11.8425 14.124 11.6827 14.4686 11.3716 14.5827C11.0604 14.6967 10.7158 14.5369 10.6017 14.2258L9.02773 9.93099C9.02555 9.93101 9.02338 9.93102 9.0212 9.93102H3.74372C3.6469 9.93102 3.55544 9.90809 3.47447 9.86736L1.87714 14.2258C1.76312 14.5369 1.41845 14.6967 1.10732 14.5827C0.796186 14.4686 0.636401 14.124 0.750429 13.8128L4.92494 2.4224ZM3.89093 8.73102H8.58795L6.42722 2.83533C6.36312 2.66043 6.11576 2.66042 6.05165 2.83533L3.89093 8.73102Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M13.0504 2.47954C13.0504 2.14817 12.7818 1.87954 12.4504 1.87954C12.1191 1.87954 11.8504 2.14817 11.8504 2.47954V4.11554H10.2144C9.88305 4.11554 9.61442 4.38417 9.61442 4.71554C9.61442 5.04691 9.88305 5.31554 10.2144 5.31554H11.8504V6.95155C11.8504 7.28292 12.1191 7.55155 12.4504 7.55155C12.7818 7.55155 13.0504 7.28292 13.0504 6.95155V5.31554H14.6864C15.0178 5.31554 15.2864 5.04691 15.2864 4.71554C15.2864 4.38417 15.0178 4.11554 14.6864 4.11554H13.0504V2.47954Z`}}]},Ku=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`font-size-increase-icon`,ref:t,icon:Gu}))});Ku.displayName=`FontSizeIncreaseIcon`;let qu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M4.92469 2.4224C5.3734 1.19807 7.10499 1.19807 7.5537 2.4224L11.7282 13.8128C11.8422 14.124 11.6824 14.4686 11.3713 14.5827C11.0602 14.6967 10.7155 14.5369 10.6015 14.2258L9.02748 9.93099C9.02539 9.93101 9.0233 9.93102 9.0212 9.93102H3.74372C3.64682 9.93102 3.55528 9.90805 3.47426 9.86726L1.8769 14.2258C1.76287 14.5369 1.41821 14.6967 1.10708 14.5827C0.795942 14.4686 0.636156 14.124 0.750185 13.8128L4.92469 2.4224ZM3.89068 8.73102H8.58771L6.42698 2.83533C6.36288 2.66043 6.11551 2.66042 6.05141 2.83533L3.89068 8.73102Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M9.61442 4.71554C9.61442 4.38417 9.88305 4.11554 10.2144 4.11554H14.6864C15.0178 4.11554 15.2864 4.38417 15.2864 4.71554C15.2864 5.04691 15.0178 5.31554 14.6864 5.31554H10.2144C9.88305 5.31554 9.61442 5.04691 9.61442 4.71554Z`}}]},Ju=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`font-size-reduce-icon`,ref:t,icon:qu}))});Ju.displayName=`FontSizeReduceIcon`;let Yu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M1.14014 12.2599C1.14014 13.6958 2.3042 14.8599 3.74014 14.8599H12.2601C13.6961 14.8599 14.8601 13.6958 14.8601 12.2599V3.73989C14.8601 2.30395 13.6961 1.13989 12.2601 1.13989H3.74014C2.3042 1.13989 1.14014 2.30396 1.14014 3.73989V12.2599ZM2.68766 13.1831C2.47131 12.9367 2.34014 12.6136 2.34014 12.2599V11.9756L5.68213 8.21656V9.69237L2.68766 13.1831ZM3.85969 13.6599H5.68213V11.5354L3.85969 13.6599ZM6.88213 13.6599H12.2601C13.0333 13.6599 13.6601 13.0331 13.6601 12.2599V3.73989C13.6601 2.96669 13.0333 2.33989 12.2601 2.33989H6.88213V13.6599ZM5.68213 2.33989H5.10563L2.34014 5.5448V6.99379L5.68213 3.23472V2.33989ZM2.34014 8.79985V10.1696L5.68213 6.4105V5.04078L2.34014 8.79985ZM2.3405 3.70754L3.50344 2.35982C2.85328 2.47053 2.35588 3.02952 2.3405 3.70754Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Xu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`freeze-column-icon`,ref:t,icon:Yu}))});Xu.displayName=`FreezeColumnIcon`;let Zu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M3.74015 1.13989C2.30421 1.13989 1.14015 2.30396 1.14015 3.73989V5.32866C1.14013 5.33155 1.14013 5.33444 1.14015 5.33732V12.2599C1.14015 13.6958 2.30421 14.8599 3.74015 14.8599H12.2602C13.6961 14.8599 14.8602 13.6958 14.8602 12.2599V3.73989C14.8602 2.46491 13.9424 1.40427 12.7315 1.18251C12.6397 1.14703 12.5407 1.13477 12.4436 1.14626C12.383 1.14204 12.3218 1.13989 12.2602 1.13989H3.74015ZM10.9392 2.33989H9.5695L5.81042 5.68188H7.18015L10.9392 2.33989ZM7.76344 2.33989H6.2816L2.34015 5.61425V5.68188H4.00437L7.76344 2.33989ZM2.34015 6.88188V12.2599C2.34015 13.0331 2.96695 13.6599 3.74015 13.6599H12.2602C13.0334 13.6599 13.6602 13.0331 13.6602 12.2599V6.88188H2.34015ZM13.6602 5.68188V4.48357L12.2714 5.68188H13.6602ZM13.4806 3.05349C13.3067 2.745 13.0193 2.50905 12.675 2.40238L8.98621 5.68188H10.4346L13.4806 3.05349ZM2.34015 4.05418L4.4037 2.33989H3.74015C2.96695 2.33989 2.34015 2.9667 2.34015 3.73989V4.05418Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Qu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`freeze-row-icon`,ref:t,icon:Zu}))});Qu.displayName=`FreezeRowIcon`;let $u={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M1.74014 4.65986L4.66011 1.73989M1.74014 7.85986L7.86011 1.73989M1.74014 11.0599L11.2601 1.73989M1.74014 14.2599L7.39256 8.60744M8.89317 7.10684L14.2601 1.73989M4.94011 14.2599L7.39256 11.8074M12.0932 7.10684L14.2601 4.93989`,strokeWidth:1.2}},{tag:`path`,attrs:{stroke:`currentColor`,d:`M7.39256 7.10684H14.2601M7.39256 7.10684V14.2599`,strokeWidth:1.2}},{tag:`rect`,attrs:{width:12.52,height:12.52,x:1.74,y:1.74,stroke:`currentColor`,rx:2,strokeWidth:1.2}}]},ed=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`freeze-to-selected-icon`,ref:t,icon:$u}))});ed.displayName=`FreezeToSelectedIcon`;let td={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 17`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M6.06409 5.53454C5.93592 5.53454 5.84083 5.41567 5.86897 5.29063L5.95442 4.9109C6.05444 4.48178 6.23806 4.11547 6.51182 3.81952C6.81082 3.49628 7.25398 3.35405 7.79738 3.35405C7.99847 3.35405 8.21359 3.37775 8.44188 3.42245C8.46089 3.42617 8.47974 3.43006 8.49846 3.4341C8.7099 3.4798 8.93698 3.38478 9.02031 3.18514L9.24767 2.6404C9.33457 2.43219 9.23178 2.19404 9.01582 2.12874C8.98358 2.11899 8.95028 2.10912 8.91591 2.09914C8.62745 2.01631 8.28392 1.97217 7.88074 1.97217C6.82015 1.97217 6.02714 2.23936 5.4746 2.7444C4.90987 3.26069 4.50889 3.99917 4.28413 4.9762L2.83703 11.1909C2.76126 11.5286 2.666 11.8917 2.54844 12.2812C2.42975 12.6734 2.2873 13.0595 2.12221 13.4373C1.95577 13.8159 1.76813 14.1762 1.55955 14.5171C1.49345 14.6251 1.42515 14.7282 1.35467 14.8263C1.26508 14.9509 1.3347 15.133 1.48655 15.1554C2.13635 15.2509 2.8179 15.0763 3.18197 14.5296C3.32661 14.3124 3.46779 14.0646 3.60509 13.7851C3.96635 13.0497 4.30522 12.0103 4.61867 10.6574L5.469 7.01534C5.49013 6.92483 5.57082 6.86081 5.66376 6.86081H7.62478C7.8097 6.86081 7.97051 6.73405 8.01371 6.55425L8.14014 6.02798C8.20057 5.77642 8.00992 5.53454 7.75121 5.53454H6.06409Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M14.3211 5.72037L12.5124 7.96963L11.4089 5.77754C11.3422 5.63012 11.1954 5.5354 11.0336 5.5354H10.3129C10.0085 5.5354 9.80921 5.85428 9.9427 6.1279L11.4089 9.05502L8.79783 12.1493C8.56587 12.4158 8.75519 12.8315 9.10855 12.8315H9.68607C9.80672 12.8315 9.9605 12.7822 10.0388 12.6904L12.1108 10.2648L13.1176 12.561C13.1786 12.7231 13.333 12.8315 13.5061 12.8315H14.3C14.5831 12.8315 14.7417 12.6175 14.6426 12.3524L13.1728 9.28628C13.1728 9.28628 15.4009 6.45542 15.6013 6.17892C15.7966 5.90929 15.6023 5.5354 15.2693 5.5354H14.6661C14.5275 5.5354 14.4333 5.58887 14.3211 5.72037Z`}}]},nd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`fx-icon`,ref:t,icon:td}))});nd.displayName=`FxIcon`;let rd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M5 2H2V5M11 2H14V5M14 11V14H11M5 14H2V11`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.3}},{tag:`path`,attrs:{stroke:`currentColor`,d:`M5.4 4V12M10.6 4V12M4 5.4H12M4 10.6H12`,strokeDasharray:`1.6 1.6`,strokeWidth:1.05}},{tag:`path`,attrs:{fill:`currentColor`,d:`M4.875 4.875H5.925V5.925H4.875V4.875ZM10.075 4.875H11.125V5.925H10.075V4.875ZM10.075 10.075H11.125V11.125H10.075V10.075ZM4.875 10.075H5.925V11.125H4.875V10.075Z`}}]},id=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`hide-gridlines-icon`,ref:t,icon:rd}))});id.displayName=`HideGridlinesIcon`;let ad={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M5.91296 6.82256L5.89774 6.82237L2.83868 6.8223C1.89982 6.82228 1.13874 6.06119 1.13872 5.12234L1.13867 3.32265C1.13865 2.38375 1.89977 1.62261 2.83866 1.62261L5.90639 1.62259L5.91296 1.62256L5.91953 1.62259L10.0821 1.62258L10.0868 1.62256L10.0914 1.62258L13.1607 1.62256C14.0996 1.62256 14.8607 2.38368 14.8607 3.32256V5.12253C14.8607 6.06143 14.0996 6.82256 13.1607 6.82253L10.0975 6.82246L10.0868 6.82256L10.076 6.82246L5.92815 6.82237L5.91296 6.82256ZM10.6868 5.62248L13.1607 5.62253C13.4368 5.62254 13.6607 5.39868 13.6607 5.12253V3.32256C13.6607 3.04642 13.4368 2.82256 13.1607 2.82256L10.6868 2.82257V5.62248ZM9.48679 2.82258V5.62245L6.51296 5.62238V2.82259L9.48679 2.82258ZM5.31296 2.8226V5.62236L2.8387 5.6223C2.56257 5.62229 2.33872 5.39845 2.33872 5.12231L2.33867 3.32262C2.33867 3.04647 2.56252 2.82261 2.83867 2.82261L5.31296 2.8226Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.1387 10.8773L1.13878 12.6773C1.13883 13.6162 1.89994 14.3772 2.8388 14.3772L5.90638 14.3772L5.91296 14.3772L5.91955 14.3772L10.0775 14.3772C10.0806 14.3772 10.0837 14.3772 10.0868 14.3772C10.0899 14.3772 10.093 14.3772 10.0961 14.3772L13.1607 14.3772C14.0996 14.3771 14.8607 13.616 14.8607 12.6772V10.8772C14.8607 9.93836 14.0996 9.17725 13.1607 9.17725H2.8387C1.89978 9.17725 1.13865 9.93841 1.1387 10.8773ZM9.48679 10.3772H6.51296V13.1772L9.48679 13.1772V10.3772ZM10.6868 13.1772V10.3772H13.1607C13.4369 10.3772 13.6607 10.6011 13.6607 10.8772V12.6772C13.6607 12.9533 13.4369 13.1771 13.1607 13.1772L10.6868 13.1772ZM5.31296 13.1772V10.3772H2.8387C2.56254 10.3772 2.33868 10.6011 2.3387 10.8773L2.33878 12.6773C2.33879 12.9534 2.56265 13.1772 2.83879 13.1772L5.31296 13.1772Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},od=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`horizontal-merge-icon`,ref:t,icon:ad}))});od.displayName=`HorizontalMergeIcon`;let sd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M1.9999 1.89941C1.66853 1.89941 1.3999 2.16804 1.3999 2.49941C1.3999 2.83078 1.66853 3.09941 1.9999 3.09941H13.9999C14.3313 3.09941 14.5999 2.83078 14.5999 2.49941C14.5999 2.16804 14.3313 1.89941 13.9999 1.89941H1.9999Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M3.33315 5.56641C3.00178 5.56641 2.73315 5.83504 2.73315 6.16641C2.73315 6.49778 3.00178 6.76641 3.33315 6.76641H12.6665C12.9979 6.76641 13.2665 6.49778 13.2665 6.16641C13.2665 5.83504 12.9979 5.56641 12.6665 5.56641H3.33315Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.3999 9.8334C1.3999 9.50203 1.66853 9.2334 1.9999 9.2334H13.9999C14.3313 9.2334 14.5999 9.50203 14.5999 9.8334C14.5999 10.1648 14.3313 10.4334 13.9999 10.4334H1.9999C1.66853 10.4334 1.3999 10.1648 1.3999 9.8334Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M3.33315 12.9004C3.00178 12.9004 2.73315 13.169 2.73315 13.5004C2.73315 13.8318 3.00178 14.1004 3.33315 14.1004H12.6665C12.9979 14.1004 13.2665 13.8318 13.2665 13.5004C13.2665 13.169 12.9979 12.9004 12.6665 12.9004H3.33315Z`}}]},cd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`horizontally-icon`,ref:t,icon:sd}))});cd.displayName=`HorizontallyIcon`;let ld={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M8 2V14M2 8H14`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.2}}]},ud=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`increase-icon`,ref:t,icon:ld}))});ud.displayName=`IncreaseIcon`;let dd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M8.00016 1.33203C6.68162 1.33203 5.39269 1.72302 4.29636 2.45557C3.20004 3.18811 2.34555 4.2293 1.84097 5.44747C1.33638 6.66565 1.20436 8.00609 1.4616 9.2993C1.71883 10.5925 2.35377 11.7804 3.28612 12.7127C4.21847 13.6451 5.40636 14.28 6.69956 14.5373C7.99277 14.7945 9.33321 14.6625 10.5514 14.1579C11.7696 13.6533 12.8108 12.7988 13.5433 11.7025C14.2758 10.6062 14.6668 9.31724 14.6668 7.9987C14.6649 6.23118 13.9619 4.53662 12.7121 3.2868C11.4622 2.03697 9.76768 1.33397 8.00016 1.33203ZM7.66683 3.9987C7.86461 3.9987 8.05795 4.05735 8.2224 4.16723C8.38685 4.27711 8.51502 4.43329 8.59071 4.61601C8.6664 4.79874 8.6862 4.99981 8.64762 5.19379C8.60903 5.38777 8.51379 5.56595 8.37394 5.7058C8.23409 5.84566 8.0559 5.9409 7.86192 5.97948C7.66794 6.01807 7.46687 5.99826 7.28415 5.92258C7.10142 5.84689 6.94524 5.71872 6.83536 5.55427C6.72548 5.38982 6.66683 5.19648 6.66683 4.9987C6.66683 4.73348 6.77219 4.47913 6.95972 4.29159C7.14726 4.10405 7.40162 3.9987 7.66683 3.9987ZM9.3335 11.332H6.66683C6.49002 11.332 6.32045 11.2618 6.19543 11.1368C6.0704 11.0117 6.00016 10.8422 6.00016 10.6654C6.00016 10.4886 6.0704 10.319 6.19543 10.194C6.32045 10.0689 6.49002 9.9987 6.66683 9.9987H7.3335V7.9987H6.66683C6.49002 7.9987 6.32045 7.92846 6.19543 7.80343C6.0704 7.67841 6.00016 7.50884 6.00016 7.33203C6.00016 7.15522 6.0704 6.98565 6.19543 6.86063C6.32045 6.7356 6.49002 6.66536 6.66683 6.66536H8.00016C8.17698 6.66536 8.34655 6.7356 8.47157 6.86063C8.59659 6.98565 8.66683 7.15522 8.66683 7.33203V9.9987H9.3335C9.51031 9.9987 9.67988 10.0689 9.8049 10.194C9.92993 10.319 10.0002 10.4886 10.0002 10.6654C10.0002 10.8422 9.92993 11.0117 9.8049 11.1368C9.67988 11.2618 9.51031 11.332 9.3335 11.332Z`}}]},fd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`info-icon`,ref:t,icon:dd}))});fd.displayName=`InfoIcon`;let pd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M9.80385 1.40005H11.9997C12.3311 1.40005 12.5997 1.66868 12.5997 2.00005C12.5997 2.33143 12.3311 2.60005 11.9997 2.60005H10.1185L7.12251 13.4001H9.33324C9.66461 13.4001 9.93324 13.6687 9.93324 14.0001C9.93324 14.3314 9.66461 14.6001 9.33324 14.6001H6.34785C6.33847 14.6003 6.32905 14.6003 6.31962 14.6001H3.9999C3.66853 14.6001 3.3999 14.3314 3.3999 14.0001C3.3999 13.6687 3.66853 13.4001 3.9999 13.4001H5.87719L8.87322 2.60005H6.66641C6.33504 2.60005 6.06641 2.33143 6.06641 2.00005C6.06641 1.66868 6.33504 1.40005 6.66641 1.40005H9.52916C9.61698 1.37929 9.71064 1.3781 9.80385 1.40005Z`}}]},md=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`italic-icon`,ref:t,icon:pd}))});md.displayName=`ItalicIcon`;let hd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M3.39986 6.33339C3.39986 6.00202 3.66849 5.73339 3.99986 5.73339H4.66652C4.99789 5.73339 5.26652 6.00202 5.26652 6.33339C5.26652 6.66476 4.99789 6.93339 4.66652 6.93339H3.99986C3.66849 6.93339 3.39986 6.66476 3.39986 6.33339Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M6.99986 5.73339C6.66849 5.73339 6.39986 6.00202 6.39986 6.33339C6.39986 6.66476 6.66849 6.93339 6.99986 6.93339H7.66652C7.99789 6.93339 8.26652 6.66476 8.26652 6.33339C8.26652 6.00202 7.99789 5.73339 7.66652 5.73339H6.99986Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M9.06636 6.33339C9.06636 6.00202 9.33499 5.73339 9.66636 5.73339H11.9997C12.3311 5.73339 12.5997 6.00202 12.5997 6.33339C12.5997 6.66476 12.3311 6.93339 11.9997 6.93339H9.66636C9.33499 6.93339 9.06636 6.66476 9.06636 6.33339Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M3.99986 8.73339C3.66849 8.73339 3.39986 9.00202 3.39986 9.33339C3.39986 9.66476 3.66849 9.93339 3.99986 9.93339H11.9999C12.3312 9.93339 12.5999 9.66476 12.5999 9.33339C12.5999 9.00202 12.3312 8.73339 11.9999 8.73339H3.99986Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M3.33338 1.73345L12.6667 1.7334C14.1026 1.73339 15.2667 2.89745 15.2667 4.3334V11C15.2667 12.4359 14.1027 13.6 12.6667 13.6H3.33355C1.89763 13.6 0.733583 12.4359 0.73355 11L0.733398 4.33351C0.733366 2.89755 1.89742 1.73346 3.33338 1.73345ZM12.6667 2.9334L3.33339 2.93345C2.56018 2.93346 1.93338 3.56028 1.9334 4.33348L1.93355 11C1.93357 11.7732 2.56036 12.4 3.33355 12.4H12.6667C13.4399 12.4 14.0667 11.7732 14.0667 11V4.3334C14.0667 3.5602 13.4399 2.93339 12.6667 2.9334Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},gd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`keyboard-icon`,ref:t,icon:hd}))});gd.displayName=`KeyboardIcon`;let _d={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M1.9999 1.89941C1.66853 1.89941 1.3999 2.16804 1.3999 2.49941C1.3999 2.83078 1.66853 3.09941 1.9999 3.09941H13.9999C14.3313 3.09941 14.5999 2.83078 14.5999 2.49941C14.5999 2.16804 14.3313 1.89941 13.9999 1.89941H1.9999Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.9999 5.56641C1.66853 5.56641 1.3999 5.83504 1.3999 6.16641C1.3999 6.49778 1.66853 6.76641 1.9999 6.76641H11.3332C11.6646 6.76641 11.9332 6.49778 11.9332 6.16641C11.9332 5.83504 11.6646 5.56641 11.3332 5.56641H1.9999Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.3999 9.8334C1.3999 9.50203 1.66853 9.2334 1.9999 9.2334H13.9999C14.3313 9.2334 14.5999 9.50203 14.5999 9.8334C14.5999 10.1648 14.3313 10.4334 13.9999 10.4334H1.9999C1.66853 10.4334 1.3999 10.1648 1.3999 9.8334Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.9999 12.9004C1.66853 12.9004 1.3999 13.169 1.3999 13.5004C1.3999 13.8318 1.66853 14.1004 1.9999 14.1004H11.3332C11.6646 14.1004 11.9332 13.8318 11.9332 13.5004C11.9332 13.169 11.6646 12.9004 11.3332 12.9004H1.9999Z`}}]},vd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`left-justifying-icon`,ref:t,icon:_d}))});vd.displayName=`LeftJustifyingIcon`;let yd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M1.3732 3.94019C0.82475 2.75718 2.04917 1.53276 3.23218 2.0812L10.0657 5.24921C10.3663 5.38859 10.497 5.74529 10.3576 6.04592C10.2183 6.34656 9.86157 6.47728 9.56094 6.33791L6.86664 5.08883L4.42613 7.52934C4.41111 7.54436 4.3955 7.55841 4.37936 7.5715L5.6299 10.2689C5.76928 10.5696 5.63855 10.9263 5.33791 11.0656C5.03728 11.205 4.68058 11.0743 4.54121 10.7737L1.3732 3.94019ZM2.72746 3.1699L5.70713 4.55128L3.84327 6.41514L2.46189 3.43547C2.38354 3.26647 2.55846 3.09155 2.72746 3.1699Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M4.56311 13.7359C4.32879 13.9702 4.32879 14.3501 4.56311 14.5844C4.79742 14.8188 5.17732 14.8188 5.41163 14.5844L13.3083 6.68776L13.3842 8.21165C13.4006 8.54261 13.6823 8.79755 14.0133 8.78108C14.3442 8.76461 14.5992 8.48295 14.5827 8.15199L14.4844 6.17786C14.4413 5.3118 13.3917 4.90732 12.7786 5.52046L4.56311 13.7359Z`}}]},bd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`left-rotation-forty-five-degrees-icon`,ref:t,icon:yd}))});bd.displayName=`LeftRotationFortyFiveDegreesIcon`;let xd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M11.4046 13.9395C11.4046 14.2708 11.6732 14.5395 12.0046 14.5395C12.336 14.5395 12.6046 14.2708 12.6046 13.9395V2.77186L13.7358 3.79578C13.9815 4.01815 14.3609 3.99927 14.5833 3.75359C14.8057 3.50792 14.7868 3.12849 14.5411 2.90612L13.0757 1.57967C12.4328 0.997761 11.4046 1.45394 11.4046 2.32106V13.9395Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M2.22244 9.26836C0.998116 8.81966 0.998119 7.08807 2.22245 6.63936L9.29456 4.04749C9.60569 3.93346 9.95036 4.09325 10.0644 4.40438C10.1784 4.71551 10.0186 5.06018 9.70749 5.1742L6.91911 6.19613V9.64753C6.91911 9.66877 6.918 9.68974 6.91585 9.71041L9.70749 10.7335C10.0186 10.8476 10.1784 11.1922 10.0644 11.5033C9.95036 11.8145 9.60569 11.9743 9.29456 11.8602L2.22244 9.26836ZM2.63538 7.76608L5.71911 6.63592V9.27181L2.63538 8.14165C2.46047 8.07755 2.46047 7.83018 2.63538 7.76608Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Sd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`left-rotation-ninety-degrees-icon`,ref:t,icon:xd}))});Sd.displayName=`LeftRotationNinetyDegreesIcon`;let Cd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M2.62402 7.72905C2.58427 7.72905 2.55205 7.76127 2.55205 7.80102V13.6782C2.55205 13.7179 2.58427 13.7502 2.62402 13.7502H13.3755C13.4152 13.7502 13.4474 13.7179 13.4474 13.6782V7.80102C13.4474 7.76127 13.4152 7.72905 13.3755 7.72905H2.62402ZM1.35205 7.80102C1.35205 7.09853 1.92153 6.52905 2.62402 6.52905H13.3755C14.0779 6.52905 14.6474 7.09853 14.6474 7.80102V13.6782C14.6474 14.3807 14.0779 14.9502 13.3755 14.9502H2.62402C1.92153 14.9502 1.35205 14.3807 1.35205 13.6782V7.80102Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M8 2.25005C6.69847 2.25003 5.64336 3.30513 5.64336 4.60666V7.12895C5.64336 7.46032 5.37473 7.72895 5.04336 7.72895C4.71199 7.72895 4.44336 7.46032 4.44336 7.12895V4.60666C4.44336 2.64239 6.04451 1.05565 8.00879 1.05566M8 2.25005L8.00879 1.05566L8 2.25005ZM8.00879 1.05566L8 2.25005C9.30154 2.25003 10.3567 3.30513 10.3567 4.60666V7.12895C10.3567 7.46032 10.6253 7.72895 10.9567 7.72895C11.288 7.72895 11.5567 7.46032 11.5567 7.12895V4.60666C11.5567 2.64239 9.97306 1.05565 8.00879 1.05566Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M8.00039 9.4668C8.33176 9.4668 8.60039 9.73543 8.60039 10.0668V12.0827C8.60039 12.4141 8.33176 12.6827 8.00039 12.6827C7.66902 12.6827 7.40039 12.4141 7.40039 12.0827V10.0668C7.40039 9.73543 7.66902 9.4668 8.00039 9.4668Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},wd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`lock-icon`,ref:t,icon:Cd}))});wd.displayName=`LockIcon`;let Td={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M1.66504 2.8666C1.66504 2.53523 1.93367 2.2666 2.26504 2.2666H13.735C14.0664 2.2666 14.335 2.53523 14.335 2.8666C14.335 3.19797 14.0664 3.4666 13.735 3.4666H2.26504C1.93367 3.4666 1.66504 3.19797 1.66504 2.8666Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.66504 8.00002C1.66504 7.66865 1.93367 7.40002 2.26504 7.40002H13.735C14.0664 7.40002 14.335 7.66865 14.335 8.00002C14.335 8.3314 14.0664 8.60002 13.735 8.60002H2.26504C1.93367 8.60002 1.66504 8.3314 1.66504 8.00002Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M2.26504 12.5334C1.93367 12.5334 1.66504 12.8021 1.66504 13.1334C1.66504 13.4648 1.93367 13.7334 2.26504 13.7334H13.735C14.0664 13.7334 14.335 13.4648 14.335 13.1334C14.335 12.8021 14.0664 12.5334 13.735 12.5334H2.26504Z`}}]},Ed=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`menu-icon`,ref:t,icon:Td}))});Ed.displayName=`MenuIcon`;let Dd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M12.5939 1.13916L10.6607 1.1392C9.5563 1.13922 8.66094 2.03448 8.66079 3.13893L8.66064 4.19191C8.6606 4.52328 8.92919 4.79194 9.26056 4.79199C9.59193 4.79204 9.8606 4.52344 9.86064 4.19207L9.86079 3.13909C9.86085 2.69731 10.219 2.33921 10.6608 2.3392L12.594 2.33916C13.0358 2.33915 13.394 2.69732 13.394 3.13916L13.394 7.40012H10.4947L11.0464 6.84845C11.2807 6.61414 11.2807 6.23424 11.0464 5.99993C10.8121 5.76561 10.4322 5.76561 10.1979 5.99993L9.31395 6.88384C8.68914 7.50867 8.68914 8.52171 9.31396 9.14654L10.1979 10.0305C10.4322 10.2648 10.8121 10.2648 11.0464 10.0305C11.2807 9.79614 11.2807 9.41624 11.0464 9.18192L10.4646 8.60012H13.394L13.394 12.8612C13.394 13.303 13.0359 13.6612 12.594 13.6612H10.6606C10.2188 13.6612 9.86064 13.303 9.86064 12.8612V11.8084C9.86064 11.4771 9.59202 11.2084 9.26064 11.2084C8.92927 11.2084 8.66064 11.4771 8.66064 11.8084V12.8612C8.66064 13.9658 9.55607 14.8612 10.6606 14.8612H12.594C13.6986 14.8612 14.594 13.9658 14.594 12.8612L14.594 8.0066L14.594 8.00012L14.594 7.99363L14.594 3.13915C14.594 2.03457 13.6985 1.13914 12.5939 1.13916Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M5.33889 1.13919L3.4057 1.13926C2.30115 1.13931 1.40576 2.03474 1.40578 3.13928L1.40582 7.99139L1.40576 8.00012L1.40582 8.00886L1.40587 12.8612C1.40588 13.9658 2.30131 14.8612 3.40587 14.8612H5.33897C6.44354 14.8612 7.33897 13.9658 7.33897 12.8612V11.8084C7.33897 11.4771 7.07034 11.2084 6.73897 11.2084C6.4076 11.2084 6.13897 11.4771 6.13897 11.8084V12.8612C6.13897 13.303 5.7808 13.6612 5.33897 13.6612H3.40587C2.96405 13.6612 2.60588 13.303 2.60587 12.8612L2.60583 8.60012H5.53538L4.95357 9.18193C4.71925 9.41624 4.71925 9.79614 4.95357 10.0305C5.18788 10.2648 5.56778 10.2648 5.8021 10.0305L6.68599 9.14656C7.31083 8.52172 7.31083 7.50866 6.68599 6.88382L5.8021 5.99993C5.56778 5.76561 5.18788 5.76561 4.95357 5.99993C4.71925 6.23424 4.71925 6.61414 4.95357 6.84845L5.50523 7.40012H2.60582L2.60578 3.13927C2.60577 2.69745 2.96393 2.33928 3.40574 2.33926L5.33894 2.33919C5.78078 2.33917 6.13897 2.69735 6.13897 3.13919V4.192C6.13897 4.52337 6.4076 4.792 6.73897 4.792C7.07034 4.792 7.33897 4.52337 7.33897 4.192V3.13919C7.33897 2.03459 6.44349 1.13914 5.33889 1.13919Z`}}]},Od=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`merge-all-icon`,ref:t,icon:Dd}))});Od.displayName=`MergeAllIcon`;let kd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M5 6.5L8 9.5L11 6.5`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.2}}]},Ad=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`more-down-icon`,ref:t,icon:kd}))});Ad.displayName=`MoreDownIcon`;let jd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M9.5 5L6.5 8L9.5 11`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.2}}]},Md=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`more-left-icon`,ref:t,icon:jd}))});Md.displayName=`MoreLeftIcon`;let Nd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M6.5 5L9.5 8L6.5 11`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.2}}]},Pd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`more-right-icon`,ref:t,icon:Nd}))});Pd.displayName=`MoreRightIcon`;let Fd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M7.1349 1.3999C6.80353 1.3999 6.5349 1.66853 6.5349 1.9999C6.5349 2.33127 6.80353 2.5999 7.1349 2.5999H7.67993V4.55065C7.67993 4.88203 7.94856 5.15065 8.27993 5.15065C8.6113 5.15065 8.87993 4.88203 8.87993 4.55065V2.5999H9.4049C9.73627 2.5999 10.0049 2.33127 10.0049 1.9999C10.0049 1.66853 9.73627 1.3999 9.4049 1.3999H7.1349Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M2.5999 7.1349C2.5999 6.80353 2.33127 6.5349 1.9999 6.5349C1.66853 6.5349 1.3999 6.80353 1.3999 7.1349V9.4049C1.3999 9.73627 1.66853 10.0049 1.9999 10.0049C2.33127 10.0049 2.5999 9.73627 2.5999 9.4049V8.86968H4.54992C4.88129 8.86968 5.14992 8.60105 5.14992 8.26968C5.14992 7.93831 4.88129 7.66968 4.54992 7.66968H2.5999V7.1349Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M15.1399 7.1349C15.1399 6.80353 14.8713 6.5349 14.5399 6.5349C14.2085 6.5349 13.9399 6.80353 13.9399 7.1349V7.66968H12.0099C11.6786 7.66968 11.4099 7.93831 11.4099 8.26968C11.4099 8.60105 11.6786 8.86968 12.0099 8.86968H13.9399V9.4049C13.9399 9.73627 14.2085 10.0049 14.5399 10.0049C14.8713 10.0049 15.1399 9.73627 15.1399 9.4049V8.27463L15.1399 8.26968L15.1399 8.26472V7.1349Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M7.1349 13.9399C6.80353 13.9399 6.5349 14.2085 6.5349 14.5399C6.5349 14.8713 6.80353 15.1399 7.1349 15.1399H8.24962C8.25966 15.1404 8.26977 15.1407 8.27993 15.1407C8.2901 15.1407 8.3002 15.1404 8.31024 15.1399H9.4049C9.73627 15.1399 10.0049 14.8713 10.0049 14.5399C10.0049 14.2085 9.73627 13.9399 9.4049 13.9399H8.87993V12.0107C8.87993 11.6793 8.6113 11.4107 8.27993 11.4107C7.94856 11.4107 7.67993 11.6793 7.67993 12.0107V13.9399H7.1349Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M2.60991 4.00967C2.60991 3.23647 3.23671 2.60967 4.00991 2.60967H4.33991C4.67128 2.60967 4.93991 2.34104 4.93991 2.00967C4.93991 1.6783 4.67128 1.40967 4.33991 1.40967H4.00991C2.57397 1.40967 1.40991 2.57373 1.40991 4.00967V4.33967C1.40991 4.67104 1.67854 4.93967 2.00991 4.93967C2.34128 4.93967 2.60991 4.67104 2.60991 4.33967V4.00967Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M12.1999 1.40967C11.8685 1.40967 11.5999 1.6783 11.5999 2.00967C11.5999 2.34104 11.8685 2.60967 12.1999 2.60967H12.5299C13.3031 2.60967 13.9299 3.23647 13.9299 4.00967V4.33967C13.9299 4.67104 14.1985 4.93967 14.5299 4.93967C14.8613 4.93967 15.1299 4.67104 15.1299 4.33967V4.00967C15.1299 2.57373 13.9659 1.40967 12.5299 1.40967H12.1999Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M2.60991 12.1997C2.60991 11.8683 2.34128 11.5997 2.00991 11.5997C1.67854 11.5997 1.40991 11.8683 1.40991 12.1997V12.5297C1.40991 13.9656 2.57397 15.1297 4.00991 15.1297H4.33991C4.67128 15.1297 4.93991 14.861 4.93991 14.5297C4.93991 14.1983 4.67128 13.9297 4.33991 13.9297H4.00991C3.23671 13.9297 2.60991 13.3029 2.60991 12.5297V12.1997Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M15.1299 12.1997C15.1299 11.8683 14.8613 11.5997 14.5299 11.5997C14.1985 11.5997 13.9299 11.8683 13.9299 12.1997V12.5297C13.9299 13.3029 13.3031 13.9297 12.5299 13.9297H12.1999C11.8685 13.9297 11.5999 14.1983 11.5999 14.5297C11.5999 14.861 11.8685 15.1297 12.1999 15.1297H12.5299C13.9659 15.1297 15.1299 13.9656 15.1299 12.5297V12.1997Z`}}]},Id=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`no-border-icon`,ref:t,icon:Fd}))});Id.displayName=`NoBorderIcon`;let Ld={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M6.671 2.24246C7.1197 1.01814 8.85129 1.01814 9.3 2.24246L11.8919 9.31458C12.0059 9.62571 11.8461 9.97038 11.535 10.0844C11.2238 10.1984 10.8792 10.0386 10.7652 9.72751L9.74324 6.93913H6.29183C6.2706 6.93913 6.24962 6.93802 6.22895 6.93587L5.20584 9.72751C5.09181 10.0386 4.74715 10.1984 4.43601 10.0844C4.12488 9.97038 3.96509 9.62571 4.07912 9.31458L6.671 2.24246ZM8.17328 2.6554L9.30345 5.73913H6.66755L7.79771 2.6554C7.86181 2.48049 8.10918 2.48049 8.17328 2.6554Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.9999 11.4246C1.66853 11.4246 1.3999 11.6933 1.3999 12.0246C1.3999 12.356 1.66853 12.6246 1.9999 12.6246H13.1675L12.1436 13.7558C11.9212 14.0015 11.9401 14.3809 12.1858 14.6033C12.4314 14.8257 12.8109 14.8068 13.0332 14.5611L14.3597 13.0957C14.9416 12.4528 14.4854 11.4246 13.6183 11.4246H1.9999Z`}}]},Rd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`no-rotation-icon`,ref:t,icon:Ld}))});Rd.displayName=`NoRotationIcon`;let zd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M7.9999 0.733154C8.33127 0.733154 8.5999 1.00178 8.5999 1.33315V5.33315C8.5999 5.66453 8.33127 5.93315 7.9999 5.93315C7.66853 5.93315 7.3999 5.66453 7.3999 5.33315V1.33315C7.3999 1.00178 7.66853 0.733154 7.9999 0.733154Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M2.46621 2.73315C2.79758 2.73315 3.06621 3.00178 3.06621 3.33315V12.6665C3.06621 12.9979 2.79758 13.2665 2.46621 13.2665C2.13484 13.2665 1.86621 12.9979 1.86621 12.6665V3.33315C1.86621 3.00178 2.13484 2.73315 2.46621 2.73315Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M5.3334 7.3999C5.00203 7.3999 4.7334 7.66853 4.7334 7.9999C4.7334 8.33127 5.00203 8.5999 5.3334 8.5999H12.603L11.9252 9.28591C11.6922 9.52163 11.6945 9.90152 11.9302 10.1344C12.166 10.3673 12.5458 10.3651 12.7788 10.1293L14.4577 8.43018C14.69 8.19509 14.6884 7.81641 14.4542 7.58324L12.7753 5.91184C12.5404 5.67806 12.1605 5.67891 11.9267 5.91375C11.6929 6.14859 11.6938 6.52849 11.9286 6.76228L12.5691 7.3999H5.3334Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M8.5999 10.6667C8.5999 10.3353 8.33127 10.0667 7.9999 10.0667C7.66853 10.0667 7.3999 10.3353 7.3999 10.6667V14.6667C7.3999 14.998 7.66853 15.2667 7.9999 15.2667C8.33127 15.2667 8.5999 14.998 8.5999 14.6667V10.6667Z`}}]},Bd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`overflow-icon`,ref:t,icon:zd}))});Bd.displayName=`OverflowIcon`;let Vd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M12.666 2.70571C11.7769 1.76476 10.3295 1.76476 9.4404 2.70571L3.37843 9.12427C3.31779 9.18848 3.27756 9.26409 3.24979 9.3439C3.24809 9.3493 3.24299 9.3529 3.24129 9.3583L2.02912 13.2097C1.96112 13.4251 2.01439 13.6633 2.16626 13.8236C2.27393 13.9382 2.41901 14 2.56692 14C2.62699 14 2.68762 13.9898 2.74599 13.9688L6.3825 12.6846C6.3876 12.6828 6.391 12.678 6.39553 12.6762C6.47147 12.6474 6.54287 12.6042 6.60351 12.54L12.666 6.12202C13.5558 5.18048 13.5558 3.64725 12.666 2.70571ZM8.62832 5.26209L9.04031 5.69836C9.03918 5.69956 9.03748 5.70016 9.03634 5.70136L4.99182 9.9836L4.58096 9.54853L8.62832 5.26209ZM3.46287 12.4512L4.02673 10.6593L5.15446 11.8535L3.46287 12.4512ZM6.20342 11.2672L5.79256 10.8321L9.83709 6.54988C9.83822 6.54868 9.83879 6.54688 9.83992 6.54568L10.2513 6.98135L6.20342 11.2672ZM11.8647 5.27349L11.0532 6.13282L9.42963 4.41356L10.2411 3.55423C10.6888 3.08016 11.417 3.08076 11.8642 3.55423C12.3124 4.0283 12.3124 4.79942 11.8647 5.27349Z`}}]},Hd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`pen-icon`,ref:t,icon:Vd}))});Hd.displayName=`PenIcon`;let Ud={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M14.2638 7.63727V3.9999C14.2638 2.89533 13.3683 1.9999 12.2638 1.9999L3.56389 1.99999C2.45932 2 1.56392 2.89542 1.56392 3.99998L1.56387 11.6666C1.56386 12.7712 2.4593 13.6666 3.56387 13.6666H8.0542`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.2}},{tag:`path`,attrs:{stroke:`currentColor`,d:`M1.5639 6.17762H14.2638M5.79725 1.99996V6.17762M10.0307 1.99993V6.17762`,strokeWidth:1.2}},{tag:`path`,attrs:{stroke:`currentColor`,d:`M11.5223 11.2333V10.2333C11.5223 9.681 11.97 9.23328 12.5223 9.23328C13.0746 9.23328 13.5223 9.681 13.5223 10.2333V11.2333`,strokeLinecap:`round`,strokeWidth:1.2}},{tag:`rect`,attrs:{width:4,height:2.67,x:10.52,y:11.23,stroke:`currentColor`,rx:1,strokeWidth:1.2}}]},Wd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`protect-icon`,ref:t,icon:Ud}))});Wd.displayName=`ProtectIcon`;let Gd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M1.9999 1.89941C1.66853 1.89941 1.3999 2.16804 1.3999 2.49941C1.3999 2.83078 1.66853 3.09941 1.9999 3.09941H13.9999C14.3313 3.09941 14.5999 2.83078 14.5999 2.49941C14.5999 2.16804 14.3313 1.89941 13.9999 1.89941H1.9999Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M4.66665 5.56641C4.33528 5.56641 4.06665 5.83504 4.06665 6.16641C4.06665 6.49778 4.33528 6.76641 4.66665 6.76641H14C14.3314 6.76641 14.6 6.49778 14.6 6.16641C14.6 5.83504 14.3314 5.56641 14 5.56641H4.66665Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.3999 9.8334C1.3999 9.50203 1.66853 9.2334 1.9999 9.2334H13.9999C14.3313 9.2334 14.5999 9.50203 14.5999 9.8334C14.5999 10.1648 14.3313 10.4334 13.9999 10.4334H1.9999C1.66853 10.4334 1.3999 10.1648 1.3999 9.8334Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M4.66665 12.9004C4.33528 12.9004 4.06665 13.169 4.06665 13.5004C4.06665 13.8318 4.33528 14.1004 4.66665 14.1004H14C14.3314 14.1004 14.6 13.8318 14.6 13.5004C14.6 13.169 14.3314 12.9004 14 12.9004H4.66665Z`}}]},Kd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`right-justifying-icon`,ref:t,icon:Gd}))});Kd.displayName=`RightJustifyingIcon`;let qd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M12.1994 1.49307C13.3824 0.944623 14.6068 2.16904 14.0584 3.35206L10.8904 10.1855C10.751 10.4862 10.3943 10.6169 10.0937 10.4775C9.79302 10.3381 9.66229 9.98144 9.80166 9.68081L11.0507 6.98651L8.61023 4.546C8.59522 4.53098 8.58116 4.51537 8.56807 4.49924L5.87063 5.74977C5.57 5.88915 5.2133 5.75842 5.07392 5.45779C4.93455 5.15715 5.06528 4.80045 5.36591 4.66108L12.1994 1.49307ZM12.9697 2.84734L11.5883 5.82701L9.72443 3.96315L12.7041 2.58177C12.8731 2.50342 13.048 2.67833 12.9697 2.84734Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M2.40366 4.68273C2.16934 4.44842 1.78945 4.44842 1.55513 4.68273C1.32082 4.91705 1.32082 5.29695 1.55513 5.53126L9.45182 13.4279L7.92792 13.5038C7.59696 13.5203 7.34202 13.8019 7.35849 14.1329C7.37497 14.4639 7.65662 14.7188 7.98758 14.7023L9.96172 14.6041C10.8278 14.5609 11.2323 13.5113 10.6191 12.8982L2.40366 4.68273Z`}}]},Jd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`right-rotation-forty-five-degrees-icon`,ref:t,icon:qd}))});Jd.displayName=`RightRotationFortyFiveDegreesIcon`;let Yd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`g`,attrs:{fill:`currentColor`},children:[{tag:`path`,attrs:{d:`M11.4046 13.9395C11.4046 14.2708 11.6732 14.5395 12.0046 14.5395C12.336 14.5395 12.6046 14.2708 12.6046 13.9395V2.77186L13.7358 3.79578C13.9815 4.01815 14.3609 3.99927 14.5833 3.75359C14.8057 3.50792 14.7868 3.12849 14.5411 2.90612L13.0757 1.57967C12.4328 0.997761 11.4046 1.45394 11.4046 2.32106V13.9395Z`,transform:`rotate(180 8 8)`}},{tag:`path`,attrs:{d:`M2.22244 9.26836C0.998116 8.81966 0.998119 7.08807 2.22245 6.63936L9.29456 4.04749C9.60569 3.93346 9.95036 4.09325 10.0644 4.40438C10.1784 4.71551 10.0186 5.06018 9.70749 5.1742L6.91911 6.19613V9.64753C6.91911 9.66877 6.918 9.68974 6.91585 9.71041L9.70749 10.7335C10.0186 10.8476 10.1784 11.1922 10.0644 11.5033C9.95036 11.8145 9.60569 11.9743 9.29456 11.8602L2.22244 9.26836ZM2.63538 7.76608L5.71911 6.63592V9.27181L2.63538 8.14165C2.46047 8.07755 2.46047 7.83018 2.63538 7.76608Z`,transform:`rotate(180 8 8)`,fillRule:`evenodd`,clipRule:`evenodd`}}]}]},Xd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`right-rotation-ninety-degrees-icon`,ref:t,icon:Yd}))});Xd.displayName=`RightRotationNinetyDegreesIcon`;let Zd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M5.4 13.5L7.65 2.8C7.73 2.4 8.27 2.4 8.35 2.8L10.6 13.5M6.2 9.7H9.8`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.3}},{tag:`path`,attrs:{stroke:`currentColor`,d:`M1.5 8H4.3M3.2 6.9L4.3 8L3.2 9.1M14.5 8H11.7M12.8 6.9L11.7 8L12.8 9.1`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.2}}]},Qd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`shrink-to-fit-icon`,ref:t,icon:Zd}))});Qd.displayName=`ShrinkToFitIcon`;let $d={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M8.00033 1.20996C6.43345 1.20996 5.23596 1.88077 4.64804 2.94304C4.06338 3.99943 4.15123 5.32084 4.90099 6.47062C5.08199 6.7482 5.45374 6.82648 5.73131 6.64548C6.00888 6.46448 6.08716 6.09273 5.90616 5.81516C5.36418 4.98402 5.35768 4.13897 5.69797 3.52412C6.035 2.91515 6.78176 2.40996 8.00033 2.40996C9.19423 2.40996 10.0017 2.93409 10.5236 3.46755C10.7871 3.73682 10.9756 4.00712 11.0974 4.20903C11.158 4.30951 11.2013 4.39164 11.2284 4.44625C11.2419 4.47351 11.2514 4.49377 11.2568 4.50588L11.2621 4.51771C11.3901 4.82216 11.7407 4.96686 12.046 4.83992C12.3519 4.71267 12.4968 4.36149 12.3695 4.05552L11.8231 4.28278C12.3695 4.05552 12.3697 4.0558 12.3695 4.05552L12.3691 4.05437L12.3685 4.05298L12.367 4.04953L12.3629 4.03993L12.3498 4.01036C12.3388 3.98619 12.3234 3.95326 12.3033 3.91282C12.2632 3.83203 12.2043 3.72072 12.1249 3.58908C11.9666 3.32674 11.7235 2.97805 11.3814 2.62834C10.6921 1.92381 9.59192 1.20996 8.00033 1.20996Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M2.11953 8.5999H7.88935C10.1109 9.46549 10.5895 10.7649 10.4268 11.6869C10.2475 12.703 9.26939 13.5898 8.00009 13.5898C6.63323 13.5898 5.77631 13.0502 5.25534 12.528C4.99021 12.2623 4.80823 11.9965 4.69365 11.7993C4.63659 11.7011 4.59698 11.6211 4.5727 11.5686C4.56059 11.5424 4.55236 11.5231 4.54774 11.512L4.54352 11.5016C4.4267 11.193 4.0823 11.0363 3.77279 11.1516C3.46228 11.2673 3.30438 11.6129 3.4201 11.9234L3.9649 11.7203C3.4201 11.9234 3.41998 11.9231 3.4201 11.9234L3.4206 11.9247L3.42118 11.9263L3.42262 11.9301L3.42661 11.9403C3.42977 11.9484 3.43394 11.9588 3.43914 11.9713C3.44956 11.9965 3.46418 12.0304 3.48334 12.0719C3.52161 12.1547 3.57828 12.2682 3.65608 12.4021C3.81124 12.6692 4.0534 13.0223 4.40584 13.3756C5.12 14.0914 6.27196 14.7898 8.00009 14.7898C9.82574 14.7898 11.3236 13.5101 11.6085 11.8955C11.812 10.7422 11.3901 9.55402 10.2665 8.5999H13.8804C14.2117 8.5999 14.4803 8.33127 14.4803 7.9999C14.4803 7.66853 14.2117 7.3999 13.8804 7.3999H8.01411C8.0048 7.39968 7.99551 7.39969 7.98625 7.3999H2.11953C1.78816 7.3999 1.51953 7.66853 1.51953 7.9999C1.51953 8.33127 1.78816 8.5999 2.11953 8.5999Z`}}]},ef=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`strikethrough-icon`,ref:t,icon:$d}))});ef.displayName=`StrikethroughIcon`;let tf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 17`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M2.08596 14.1387L10.3379 2.66873`,strokeLinecap:`round`,strokeWidth:1.2}},{tag:`path`,attrs:{stroke:`currentColor`,d:`M10.3379 14.1387L2.08596 2.66873`,strokeLinecap:`round`,strokeWidth:1.2}},{tag:`path`,attrs:{stroke:`currentColor`,d:`M12.8098 10.0174C13.4565 9.45285 14.781 9.44507 15.0272 10.5759C15.2798 11.736 13.8101 13.2515 12.7376 14.1033C12.7227 14.1151 12.7315 14.1389 12.7505 14.1388L15.2251 14.1388`,strokeLinecap:`round`,strokeWidth:1.2}}]},nf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`subscript-icon`,ref:t,icon:tf}))});nf.displayName=`SubscriptIcon`;let rf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 17`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M2.10904 14.4537L10.299 3.06987`,strokeLinecap:`round`,strokeWidth:1.2}},{tag:`path`,attrs:{stroke:`currentColor`,d:`M10.2989 14.4537L2.10899 3.06987`,strokeLinecap:`round`,strokeWidth:1.2}},{tag:`path`,attrs:{stroke:`currentColor`,d:`M12.7525 3.35933C13.3943 2.79901 14.7089 2.79129 14.9533 3.91363C15.204 5.06487 13.7456 6.56876 12.6812 7.41429C12.6663 7.4261 12.6751 7.44982 12.6941 7.44982L15.1497 7.44977`,strokeLinecap:`round`,strokeWidth:1.2}}]},af=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`superscript-icon`,ref:t,icon:rf}))});af.displayName=`SuperscriptIcon`;let of={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M2.21572 1.80029C2.54709 1.80029 2.81572 2.06892 2.81572 2.40029V14.0003C2.81572 14.3317 2.54709 14.6003 2.21572 14.6003C1.88435 14.6003 1.61572 14.3317 1.61572 14.0003V2.40029C1.61572 2.06892 1.88435 1.80029 2.21572 1.80029Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M13.7841 1.80029C14.1155 1.80029 14.3841 2.06892 14.3841 2.40029V14.0003C14.3841 14.3317 14.1155 14.6003 13.7841 14.6003C13.4527 14.6003 13.1841 14.3317 13.1841 14.0003V8.60259H7.13467C6.8033 8.60259 6.53467 8.33396 6.53467 8.00259C6.53467 7.67122 6.8033 7.40259 7.13467 7.40259H13.1841V2.40029C13.1841 2.06892 13.4527 1.80029 13.7841 1.80029Z`}}]},sf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`truncation-icon`,ref:t,icon:of}))});sf.displayName=`TruncationIcon`;let cf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M4.46416 2.03237C4.46416 1.701 4.19553 1.43237 3.86416 1.43237C3.53279 1.43237 3.26416 1.701 3.26416 2.03237V7.33338C3.26416 10.0313 5.35834 12.2667 7.9999 12.2667C10.6415 12.2667 12.7356 10.0313 12.7356 7.33338V2.03237C12.7356 1.701 12.467 1.43237 12.1356 1.43237C11.8043 1.43237 11.5356 1.701 11.5356 2.03237V7.33338C11.5356 9.42194 9.92656 11.0667 7.9999 11.0667C6.07325 11.0667 4.46416 9.42194 4.46416 7.33338V2.03237Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M2.66641 13.4663C2.33504 13.4663 2.06641 13.7349 2.06641 14.0663C2.06641 14.3977 2.33504 14.6663 2.66641 14.6663H13.3331C13.6644 14.6663 13.9331 14.3977 13.9331 14.0663C13.9331 13.7349 13.6644 13.4663 13.3331 13.4663H2.66641Z`}}]},lf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`underline-icon`,ref:t,icon:cf}))});lf.displayName=`UnderlineIcon`;let uf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M7.9999 0.733398C8.33127 0.733398 8.5999 1.00203 8.5999 1.3334V4.55137L9.57564 3.57564C9.80995 3.34132 10.1899 3.34132 10.4242 3.57564C10.6585 3.80995 10.6585 4.18985 10.4242 4.42417L8.42417 6.42417C8.18985 6.65848 7.80995 6.65848 7.57564 6.42417L5.57564 4.42417C5.34132 4.18985 5.34132 3.80995 5.57564 3.57564C5.80995 3.34132 6.18985 3.34132 6.42417 3.57564L7.3999 4.55137V1.3334C7.3999 1.00203 7.66853 0.733398 7.9999 0.733398Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M5.57564 11.5756L7.57564 9.57564C7.80995 9.34132 8.18985 9.34132 8.42417 9.57564L10.4242 11.5756C10.6585 11.81 10.6585 12.1899 10.4242 12.4242C10.1899 12.6585 9.80995 12.6585 9.57564 12.4242L8.5999 11.4484V14.6665C8.5999 14.9979 8.33127 15.2665 7.9999 15.2665C7.66853 15.2665 7.3999 14.9979 7.3999 14.6665V11.4484L6.42417 12.4242C6.18985 12.6585 5.80995 12.6585 5.57564 12.4242C5.34132 12.1899 5.34132 11.81 5.57564 11.5756Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.9999 7.40015C1.66853 7.40015 1.3999 7.66878 1.3999 8.00015C1.3999 8.33152 1.66853 8.60015 1.9999 8.60015H13.9999C14.3313 8.60015 14.5999 8.33152 14.5999 8.00015C14.5999 7.66878 14.3313 7.40015 13.9999 7.40015H1.9999Z`}}]},df=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`vertical-center-icon`,ref:t,icon:uf}))});df.displayName=`VerticalCenterIcon`;let ff={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 17`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M2.2157 2.90265C2.2157 2.16628 2.81264 1.56934 3.54901 1.56934H6.21565C6.95202 1.56934 7.54896 2.16628 7.54896 2.90265V13.5692C7.54896 14.3056 6.95202 14.9025 6.21565 14.9025H3.54901C2.81264 14.9025 2.2157 14.3056 2.2157 13.5692V2.90265ZM3.54901 2.90265H6.21565V5.5622H3.54901V2.90265ZM3.54901 6.89552V9.57631H6.21565V6.89552H3.54901ZM3.54901 13.5692V10.9096H6.21565V13.5692H3.54901Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M10.2156 2.90265C10.2156 2.16628 10.8125 1.56934 11.5489 1.56934H14.2155C14.9519 1.56934 15.5489 2.16628 15.5489 2.90265V13.5692C15.5489 14.3056 14.9519 14.9025 14.2155 14.9025H11.5489C10.8125 14.9025 10.2156 14.3056 10.2156 13.5692V2.90265ZM11.5489 2.90265H14.2155V5.5622H11.5489V2.90265ZM11.5489 6.89552V9.57631H14.2155V6.89552H11.5489ZM11.5489 13.5692V10.9096H14.2155V13.5692H11.5489Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},pf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`vertical-integration-icon`,ref:t,icon:ff}))});pf.displayName=`VerticalIntegrationIcon`;let mf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M4.55504 2.73208C4.55504 2.40071 4.28641 2.13208 3.95504 2.13208C3.62367 2.13208 3.35504 2.40071 3.35504 2.73208V12.5172L2.21439 11.5276C1.96409 11.3104 1.58515 11.3373 1.36799 11.5876C1.15084 11.8379 1.17771 12.2169 1.42801 12.434L2.89972 13.7108C3.54718 14.2726 4.55504 13.8127 4.55504 12.9555L4.55504 2.73208Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M9.00725 4.01095C9.45595 2.78663 11.1875 2.78662 11.6362 4.01095L14.743 12.488C14.8571 12.7992 14.6973 13.1438 14.3861 13.2578C14.075 13.3719 13.7303 13.2121 13.6163 12.9009L12.4148 9.62242H8.36729C8.32154 9.62242 8.27699 9.6173 8.23417 9.6076L7.02719 12.9009C6.91316 13.2121 6.5685 13.3719 6.25736 13.2578C5.94623 13.1438 5.78644 12.7992 5.90047 12.488L9.00725 4.01095ZM10.5095 4.42388L11.975 8.42242H8.66853L10.134 4.42389C10.1981 4.24898 10.4454 4.24898 10.5095 4.42388Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},hf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`vertical-text-icon`,ref:t,icon:mf}))});hf.displayName=`VerticalTextIcon`;let gf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM8.00008 12.3671C8.46031 12.3671 8.83342 11.994 8.83342 11.5338C8.83342 11.0735 8.46031 10.7004 8.00008 10.7004C7.53985 10.7004 7.16675 11.0735 7.16675 11.5338C7.16675 11.994 7.53985 12.3671 8.00008 12.3671ZM8.5999 4.4335C8.5999 4.10213 8.33127 3.8335 7.9999 3.8335C7.66853 3.8335 7.3999 4.10213 7.3999 4.4335V9.36683C7.3999 9.6982 7.66853 9.96683 7.9999 9.96683C8.33127 9.96683 8.5999 9.6982 8.5999 9.36683V4.4335Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},_f=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`warning-icon`,ref:t,icon:gf}))});_f.displayName=`WarningIcon`;let vf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M12.6551 1.98906C11.7476 1.08113 10.2757 1.08149 9.3686 1.98987L4.82542 6.53955C4.75087 6.61421 4.69336 6.70411 4.65682 6.80309L3.2461 10.625C3.16506 10.8446 3.21909 11.0912 3.3845 11.2568C3.54991 11.4224 3.79651 11.4767 4.01616 11.3959L7.85031 9.98517C7.94979 9.94856 8.04014 9.89077 8.11508 9.81579L12.6552 5.27327C13.5618 4.36621 13.5618 2.89607 12.6551 1.98906ZM10.2177 2.83779C10.6562 2.39869 11.3677 2.39851 11.8064 2.8374C12.2447 3.27584 12.2447 3.9865 11.8065 4.42497L7.3392 8.89457L4.82213 9.82068L5.74706 7.31487L10.2177 2.83779Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.79238 13.2999C1.46101 13.2999 1.19238 13.5685 1.19238 13.8999C1.19238 14.2313 1.46101 14.4999 1.79238 14.4999H14.4924C14.8238 14.4999 15.0924 14.2313 15.0924 13.8999C15.0924 13.5685 14.8238 13.2999 14.4924 13.2999H1.79238Z`}}]},yf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`write-icon`,ref:t,icon:vf}))});yf.displayName=`WriteIcon`;let bf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`g`,attrs:{stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.2},children:[{tag:`circle`,attrs:{cx:7,cy:7,r:5.2}},{tag:`path`,attrs:{d:`M10.8 10.8L14.2 14.2M5 7H9M7 5V9`}}]}]},xf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`zoom-in-icon`,ref:t,icon:bf}))});xf.displayName=`ZoomInIcon`;let Sf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`#14B8A6`,d:`M3.4535 1.12549C2.7002 1.12549 2.08954 1.73615 2.08954 2.48945V13.5104C2.08954 14.2637 2.7002 14.8744 3.4535 14.8744H12.5465C13.2998 14.8744 13.9105 14.2637 13.9105 13.5104V5.0992L10.0091 1.12549H3.4535Z`}},{tag:`path`,attrs:{fill:`#0E9284`,d:`M10.0075 1.12549L13.9104 5.09842H10.6742C10.306 5.09842 10.0075 4.79994 10.0075 4.43175V1.12549Z`}},{tag:`path`,attrs:{fill:`white`,d:`M7.9 6.55C6.24437 6.55 4.9 7.10222 4.9 7.78333V11.0167C4.9 11.6978 6.24437 12.25 7.9 12.25C9.55563 12.25 10.9 11.6978 10.9 11.0167V7.78333C10.9 7.10222 9.55563 6.55 7.9 6.55Z`}},{tag:`path`,attrs:{fill:`#14B8A6`,d:`M5.05 8.42C5.671 8.72 6.709 8.89 7.9 8.89C9.091 8.89 10.129 8.72 10.75 8.42V9.02C10.129 9.32 9.091 9.49 7.9 9.49C6.709 9.49 5.671 9.32 5.05 9.02V8.42Z`}},{tag:`path`,attrs:{fill:`#14B8A6`,d:`M5.05 10.02C5.671 10.32 6.709 10.49 7.9 10.49C9.091 10.49 10.129 10.32 10.75 10.02V10.62C10.129 10.92 9.091 11.09 7.9 11.09C6.709 11.09 5.671 10.92 5.05 10.62V10.02Z`}}]},Cf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`bases-multi-icon`,ref:t,icon:Sf}))});Cf.displayName=`BasesMultiIcon`;let wf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`#8B5CF6`,d:`M3.4535 1.12549C2.7002 1.12549 2.08954 1.73615 2.08954 2.48945V13.5104C2.08954 14.2637 2.7002 14.8744 3.4535 14.8744H12.5465C13.2998 14.8744 13.9105 14.2637 13.9105 13.5104V5.0992L10.0091 1.12549H3.4535Z`}},{tag:`path`,attrs:{fill:`#6D3FE8`,d:`M10.0075 1.12549L13.9104 5.09842H10.6742C10.306 5.09842 10.0075 4.79994 10.0075 4.43175V1.12549Z`}},{tag:`path`,attrs:{fill:`white`,d:`M5 7.45H10.8V11.65H5V7.45ZM5.8 8.25V10.85H10V8.25H5.8Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`white`,d:`M5.8 6.25H7.25V7H5.8V6.25Z`}},{tag:`path`,attrs:{fill:`white`,d:`M8.55 6.25H10V7H8.55V6.25Z`}}]},Tf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`boards-multi-icon`,ref:t,icon:wf}))});Tf.displayName=`BoardsMultiIcon`;let Ef={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`#4B7DFF`,d:`M3.4535 1.12549C2.7002 1.12549 2.08954 1.73615 2.08954 2.48945V13.5104C2.08954 14.2637 2.7002 14.8744 3.4535 14.8744H12.5465C13.2998 14.8744 13.9105 14.2637 13.9105 13.5104V5.0992L10.0091 1.12549H3.4535Z`}},{tag:`path`,attrs:{fill:`#305CFA`,d:`M10.0075 1.12549L13.9104 5.09842H10.6742C10.306 5.09842 10.0075 4.79994 10.0075 4.43175V1.12549Z`}},{tag:`path`,attrs:{fill:`white`,d:`M4.57245 7.27962C4.57245 7.09553 4.72169 6.94629 4.90578 6.94629H10.2391C10.4232 6.94629 10.5724 7.09553 10.5724 7.27962C10.5724 7.46372 10.4232 7.61296 10.2391 7.61296H4.90578C4.72169 7.61296 4.57245 7.46372 4.57245 7.27962Z`}},{tag:`path`,attrs:{fill:`white`,d:`M4.57245 9.62638C4.57245 9.44229 4.72169 9.29305 4.90578 9.29305H10.2391C10.4232 9.29305 10.5724 9.44229 10.5724 9.62638C10.5724 9.81048 10.4232 9.95972 10.2391 9.95972H4.90578C4.72169 9.95972 4.57245 9.81048 4.57245 9.62638Z`}},{tag:`path`,attrs:{fill:`white`,d:`M4.90578 11.6398C4.72169 11.6398 4.57245 11.789 4.57245 11.9731C4.57245 12.1572 4.72169 12.3065 4.90578 12.3065H7.57245C7.75654 12.3065 7.90578 12.1572 7.90578 11.9731C7.90578 11.789 7.75654 11.6398 7.57245 11.6398H4.90578Z`}}]},Df=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`docs-multi-icon`,ref:t,icon:Ef}))});Df.displayName=`DocsMultiIcon`;let Of={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`#35BD4B`,d:`M3.4535 1.12549C2.7002 1.12549 2.08954 1.73615 2.08954 2.48945V13.5104C2.08954 14.2637 2.7002 14.8744 3.4535 14.8744H12.5465C13.2998 14.8744 13.9105 14.2637 13.9105 13.5104V5.0992L10.0091 1.12549H3.4535Z`}},{tag:`path`,attrs:{fill:`#32A846`,d:`M10.0075 1.12549L13.9104 5.09842H10.6742C10.306 5.09842 10.0075 4.79994 10.0075 4.43175V1.12549Z`}},{tag:`path`,attrs:{fill:`white`,d:`M4.7 7.05H11.1V12.05H4.7V7.05ZM5.5 7.85V9.2H7.35V7.85H5.5ZM8.15 7.85V9.2H10.3V7.85H8.15ZM5.5 10V11.25H7.35V10H5.5ZM8.15 10V11.25H10.3V10H8.15Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},kf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`sheets-multi-icon`,ref:t,icon:Of}))});kf.displayName=`SheetsMultiIcon`;let Af={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`#FF6B4B`,d:`M3.4535 1.12549C2.7002 1.12549 2.08954 1.73615 2.08954 2.48945V13.5104C2.08954 14.2637 2.7002 14.8744 3.4535 14.8744H12.5465C13.2998 14.8744 13.9105 14.2637 13.9105 13.5104V5.0992L10.0091 1.12549H3.4535Z`}},{tag:`path`,attrs:{fill:`#EC4F2D`,d:`M10.0075 1.12549L13.9104 5.09842H10.6742C10.306 5.09842 10.0075 4.79994 10.0075 4.43175V1.12549Z`}},{tag:`path`,attrs:{fill:`white`,d:`M7.76493 7.24535C7.76493 7.07967 7.63024 6.94371 7.46548 6.96123C7.01146 7.00953 6.57426 7.16714 6.19216 7.42245C5.72662 7.73351 5.36378 8.17564 5.14951 8.69292C4.93525 9.2102 4.87918 9.77941 4.98842 10.3285C5.09765 10.8777 5.36727 11.3821 5.76318 11.778C6.15909 12.1739 6.66351 12.4436 7.21265 12.5528C7.76179 12.662 8.33099 12.606 8.84828 12.3917C9.36556 12.1774 9.80769 11.8146 10.1188 11.349C10.3741 10.9669 10.5317 10.5297 10.58 10.0757C10.5975 9.91096 10.4615 9.77627 10.2958 9.77627L8.06493 9.77627C7.89925 9.77627 7.76493 9.64195 7.76493 9.47627L7.76493 7.24535Z`}},{tag:`path`,attrs:{fill:`white`,d:`M10.4097 9.35206C10.5753 9.35206 10.7115 9.21728 10.6918 9.05277C10.6645 8.82511 10.6062 8.60178 10.5181 8.38909C10.3917 8.08379 10.2063 7.80639 9.97264 7.57272C9.73897 7.33905 9.46157 7.1537 9.15627 7.02724C8.94358 6.93914 8.72024 6.88083 8.49259 6.85356C8.32808 6.83385 8.1933 6.97001 8.1933 7.13569V9.05206C8.1933 9.21774 8.32761 9.35206 8.4933 9.35206H10.4097Z`}}]},jf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`slides-multi-icon`,ref:t,icon:Af}))});jf.displayName=`SlidesMultiIcon`;let Mf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`colorChannel1`,d:`M8.60231 5.77597L9.38125 6.55432C9.61658 6.78947 9.99797 6.78932 10.2331 6.554C10.4683 6.31867 10.4681 5.93728 10.2328 5.70214L8.44939 3.92009C8.33908 3.79657 8.1786 3.7188 7.99995 3.7188C7.84562 3.71861 7.6906 3.77736 7.57281 3.89506L5.76712 5.69933C5.5318 5.93447 5.53165 6.31587 5.76679 6.55119C6.00193 6.78652 6.38332 6.78667 6.61865 6.55153L7.3976 5.77319L7.3976 10.2246L6.61865 9.44621C6.38333 9.21107 6.00194 9.21121 5.76679 9.44654C5.53165 9.68186 5.53179 10.0633 5.76712 10.2984L7.55051 12.0804C7.66082 12.204 7.82131 12.2817 7.99995 12.2817L8.00089 12.2817C8.15512 12.2819 8.30939 12.2231 8.4271 12.1055L10.2328 10.3012C10.4681 10.0661 10.4683 9.68467 10.2331 9.44934C9.99798 9.21402 9.61659 9.21387 9.38126 9.44901L8.60231 10.2274L8.60231 5.77597Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M13.7039 3.24701C14.0539 3.24701 14.3377 2.96327 14.3377 2.61325C14.3377 2.26324 14.0539 1.97949 13.7039 1.97949L2.29627 1.97949C1.94625 1.97949 1.66251 2.26324 1.66251 2.61325C1.66251 2.96327 1.94625 3.24701 2.29627 3.24701L13.7039 3.24701Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M13.7039 14.0209C14.0539 14.0209 14.3377 13.7372 14.3377 13.3872C14.3377 13.0371 14.0539 12.7534 13.7039 12.7534L2.29627 12.7534C1.94625 12.7534 1.66251 13.0371 1.66251 13.3872C1.66251 13.7372 1.94625 14.0209 2.29627 14.0209L13.7039 14.0209Z`}}]},Nf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`adjust-height-double-icon`,ref:t,icon:Mf}))});Nf.displayName=`AdjustHeightDoubleIcon`;let Pf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`colorChannel1`,d:`M5.77574 7.3974L6.5541 6.61846C6.78924 6.38313 6.78909 6.00174 6.55377 5.7666C6.31844 5.53145 5.93705 5.5316 5.70191 5.76692L3.91987 7.55032C3.79634 7.66063 3.71857 7.82111 3.71857 7.99976C3.71838 8.15409 3.77713 8.30912 3.89483 8.42691L5.6991 10.2326C5.93425 10.4679 6.31564 10.4681 6.55096 10.2329C6.78629 9.99778 6.78644 9.61639 6.5513 9.38106L5.77296 8.60211L10.2243 8.60211L9.44598 9.38106C9.21084 9.61638 9.21099 9.99777 9.44631 10.2329C9.68164 10.4681 10.063 10.4679 10.2982 10.2326L12.0802 8.4492C12.2037 8.33889 12.2815 8.1784 12.2815 7.99976L12.2815 7.99882C12.2816 7.84459 12.2229 7.69032 12.1052 7.57261L10.301 5.76693C10.0658 5.5316 9.68444 5.53145 9.44911 5.76659C9.21379 6.00173 9.21364 6.38312 9.44878 6.61845L10.2271 7.3974L5.77574 7.3974Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M3.24683 2.29598C3.24683 1.94596 2.96308 1.66222 2.61307 1.66222C2.26305 1.66222 1.97931 1.94596 1.97931 2.29598L1.97931 13.7036C1.97931 14.0537 2.26305 14.3374 2.61307 14.3374C2.96308 14.3374 3.24683 14.0537 3.24683 13.7036L3.24683 2.29598Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M14.0207 2.29598C14.0207 1.94596 13.737 1.66222 13.387 1.66222C13.037 1.66222 12.7532 1.94596 12.7532 2.29598L12.7532 13.7036C12.7532 14.0537 13.037 14.3374 13.387 14.3374C13.737 14.3374 14.0207 14.0537 14.0207 13.7036L14.0207 2.29598Z`}}]},Ff=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`adjust-width-double-icon`,ref:t,icon:Pf}))});Ff.displayName=`AdjustWidthDoubleIcon`;let If={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M2.29713 1.98047C1.94717 1.98047 1.66348 2.26416 1.66348 2.61412C1.66348 2.96408 1.94717 3.24777 2.29713 3.24777H13.7028C14.0528 3.24777 14.3365 2.96408 14.3365 2.61412C14.3365 2.26416 14.0528 1.98047 13.7028 1.98047H2.29713Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M2.29713 12.7525C1.94717 12.7525 1.66348 13.0362 1.66348 13.3862C1.66348 13.7361 1.94717 14.0198 2.29713 14.0198H13.7028C14.0528 14.0198 14.3365 13.7361 14.3365 13.3862C14.3365 13.0362 14.0528 12.7525 13.7028 12.7525H2.29713Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M7.42163 4.25588L4.25471 11.2231C4.10989 11.5417 4.25077 11.9174 4.56935 12.0622C4.88794 12.207 5.2636 12.0661 5.40841 11.7475L6.24766 9.90119H9.75197L10.5912 11.7475C10.736 12.0661 11.1117 12.207 11.4303 12.0622C11.7489 11.9174 11.8897 11.5417 11.7449 11.2231L8.578 4.25589C8.5675 4.23244 8.55557 4.20961 8.54227 4.18755C8.49012 4.10102 8.41688 4.0262 8.32579 3.97171C8.301 3.95688 8.27527 3.94377 8.24878 3.93246C8.16764 3.89775 8.08309 3.8813 7.99981 3.88135C7.88457 3.88142 7.77177 3.91309 7.67384 3.97171C7.58714 4.02361 7.5121 4.09664 7.45735 4.18755C7.44406 4.20961 7.43213 4.23244 7.42163 4.25588ZM9.17592 8.63388L7.99981 6.04644L6.8237 8.63388H9.17592Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Lf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`auto-height-double-icon`,ref:t,icon:If}))});Lf.displayName=`AutoHeightDoubleIcon`;let Rf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M1.98032 13.7028C1.98032 14.0527 2.26401 14.3364 2.61397 14.3364C2.96392 14.3364 3.24762 14.0527 3.24762 13.7028L3.24762 2.29706C3.24762 1.9471 2.96392 1.66341 2.61397 1.66341C2.26401 1.66341 1.98032 1.9471 1.98032 2.29706L1.98032 13.7028Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M12.7524 13.7028C12.7524 14.0527 13.0361 14.3364 13.386 14.3364C13.736 14.3364 14.0197 14.0527 14.0197 13.7028L14.0197 2.29706C14.0197 1.9471 13.736 1.66341 13.386 1.66341C13.0361 1.66341 12.7524 1.9471 12.7524 2.29706L12.7524 13.7028Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M7.42187 4.25588L4.25495 11.2231C4.11014 11.5417 4.25101 11.9174 4.5696 12.0622C4.88819 12.207 5.26385 12.0661 5.40866 11.7475L6.2479 9.90119H9.75222L10.5915 11.7475C10.7363 12.0661 11.1119 12.207 11.4305 12.0622C11.7491 11.9174 11.89 11.5417 11.7452 11.2231L8.57825 4.25589C8.56775 4.23244 8.55582 4.20961 8.54252 4.18755C8.49037 4.10102 8.41713 4.0262 8.32603 3.97171C8.30125 3.95688 8.27551 3.94377 8.24902 3.93246C8.16788 3.89775 8.08333 3.8813 8.00006 3.88135C7.88481 3.88142 7.77201 3.91309 7.67409 3.97171C7.58739 4.02361 7.51235 4.09664 7.4576 4.18755C7.4443 4.20961 7.43237 4.23244 7.42187 4.25588ZM9.17617 8.63388L8.00006 6.04644L6.82395 8.63388H9.17617Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},zf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`auto-width-double-icon`,ref:t,icon:Rf}))});zf.displayName=`AutoWidthDoubleIcon`;let Bf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`colorChannel1`,d:`M11.0363 12.2367V14.0367C11.0363 14.3681 11.3049 14.6367 11.6363 14.6367C11.9676 14.6367 12.2363 14.3681 12.2363 14.0367V12.2367H14.0364C14.3677 12.2367 14.6364 11.9681 14.6364 11.6367C14.6364 11.3054 14.3677 11.0367 14.0364 11.0367H12.2363V9.23672C12.2363 8.90535 11.9676 8.63672 11.6363 8.63672C11.3049 8.63672 11.0363 8.90535 11.0363 9.23672V11.0367H9.23635C8.90498 11.0367 8.63635 11.3054 8.63635 11.6367C8.63635 11.9681 8.90498 12.2367 9.23635 12.2367H11.0363Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M2.56365 1.36377C1.90091 1.36377 1.36365 1.90103 1.36365 2.56377V6.16377C1.36365 6.82651 1.90091 7.36377 2.56365 7.36377H6.16365C6.82639 7.36377 7.36365 6.82651 7.36365 6.16377V2.56377C7.36365 1.90103 6.82639 1.36377 6.16365 1.36377H2.56365ZM6.16365 2.56377H2.56365L2.56365 6.16377H6.16365V2.56377Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M2.56365 8.63647C1.90091 8.63647 1.36365 9.17373 1.36365 9.83647V13.4365C1.36365 14.0992 1.90091 14.6365 2.56365 14.6365H6.16365C6.82639 14.6365 7.36365 14.0992 7.36365 13.4365V9.83647C7.36365 9.17373 6.82639 8.63647 6.16365 8.63647H2.56365ZM6.16365 9.83647H2.56365L2.56365 13.4365H6.16365V9.83647Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M9.83635 7.36377C9.17361 7.36377 8.63635 6.82651 8.63635 6.16377V2.56377C8.63635 1.90103 9.17361 1.36377 9.83635 1.36377H13.4364C14.0991 1.36377 14.6364 1.90103 14.6364 2.56377V6.16377C14.6364 6.82651 14.0991 7.36377 13.4364 7.36377H9.83635ZM9.83635 6.16377V2.56377L13.4364 2.56377V6.16377H9.83635Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Vf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`autofill-double-icon`,ref:t,icon:Bf}))});Vf.displayName=`AutofillDoubleIcon`;let Hf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 17`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M13.5853 14.7987L2.27159 3.485L3.12012 2.63647L14.4338 13.9502L13.5853 14.7987Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M1.69629 12.8102L1.69629 14.1743C1.69629 14.8371 2.23355 15.3743 2.89629 15.3743L4.26042 15.3743L4.26042 14.0443L3.02629 14.0443L3.02629 12.8102L1.69629 12.8102ZM4.26042 2.06128L2.89629 2.06128C2.23355 2.06128 1.69629 2.59854 1.69629 3.26128L1.69629 4.62541L3.02629 4.62541L3.02629 3.39128L4.26042 3.39128L4.26042 2.06128ZM1.69629 10.0819L3.02629 10.0819L3.02629 7.35367L1.69629 7.35367L1.69629 10.0819ZM6.98868 2.06128L6.98868 3.39128L9.71693 3.39128L9.71693 2.06128L6.98868 2.06128ZM12.4452 2.06128L12.4452 3.39128L13.6793 3.39128L13.6793 4.62541L15.0093 4.62541L15.0093 3.26128C15.0093 2.59854 14.4721 2.06128 13.8093 2.06128L12.4452 2.06128ZM15.0093 7.35367L13.6793 7.35367L13.6793 10.0819L15.0093 10.0819L15.0093 7.35367ZM15.0093 12.8102L13.6793 12.8102L13.6793 14.0443L12.4452 14.0443L12.4452 15.3743L13.8093 15.3743C14.4721 15.3743 15.0093 14.8371 15.0093 14.1743L15.0093 12.8102ZM9.71693 15.3743L9.71693 14.0443L6.98868 14.0443L6.98868 15.3743L9.71693 15.3743Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Uf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`back-slash-double-icon`,ref:t,icon:Hf}))});Uf.displayName=`BackSlashDoubleIcon`;let Wf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`colorChannel1`,d:`M5.36831 3.22148C5.36831 1.94497 6.40313 0.910156 7.67964 0.910156C8.95615 0.910156 9.99097 1.94497 9.99097 3.22149V6.74754H8.72649V3.22149C8.72649 2.64333 8.2578 2.17464 7.67964 2.17464C7.10148 2.17464 6.63279 2.64333 6.63279 3.22148V6.74754H5.36831V3.22148Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M5.00091 5.47314C3.33644 5.47314 1.9499 6.74914 1.81192 8.40788L1.54428 11.6254C1.38911 13.4909 2.86133 15.0906 4.73327 15.0906H13.6667C14.175 15.0906 14.5544 14.6228 14.4495 14.1255L13.0262 7.37781C12.792 6.26766 11.8125 5.47314 10.6779 5.47314H5.00091ZM10.6779 6.75314H5.00091C4.00223 6.75314 3.1703 7.51874 3.08751 8.51399L2.81988 11.7315C2.72677 12.8508 3.61011 13.8106 4.73327 13.8106H5.7695C5.26362 13.0554 5.05585 12.0527 5.31224 11.047C5.40861 10.6689 5.76242 10.4493 6.10249 10.5564C6.44256 10.6636 6.64012 11.0569 6.54374 11.4349C6.27517 12.4885 6.92898 13.6738 7.87916 13.8106H9.01412C8.50824 13.0554 8.30047 12.0527 8.55686 11.047C8.65324 10.6689 9.00704 10.4493 9.34711 10.5564C9.68719 10.6636 9.88474 11.0569 9.78837 11.4349C9.51979 12.4885 10.1736 13.6738 11.1238 13.8106H13.0749L11.7738 7.64199C11.6645 7.12392 11.2073 6.75314 10.6779 6.75314Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Gf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`clear-format-double-icon`,ref:t,icon:Wf}))});Gf.displayName=`ClearFormatDoubleIcon`;let Kf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`colorChannel1`,d:`M5.4004 2.60213C5.25792 2.60213 5.14241 2.71763 5.14241 2.86011V4.32679C5.14241 4.67752 4.85809 4.96184 4.50736 4.96184C4.15663 4.96184 3.87231 4.67752 3.87231 4.32679V2.86011C3.87231 2.01618 4.55646 1.33203 5.4004 1.33203H13.14C13.984 1.33203 14.6681 2.01618 14.6681 2.86011V10.5998C14.6681 11.4437 13.984 12.1278 13.14 12.1278H11.6568C11.3061 12.1278 11.0218 11.8435 11.0218 11.4928C11.0218 11.1421 11.3061 10.8577 11.6568 10.8577H13.14C13.2825 10.8577 13.398 10.7422 13.398 10.5998V2.86011C13.398 2.71763 13.2825 2.60213 13.14 2.60213H5.4004Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.33203 5.40015C1.33203 4.55622 2.01618 3.87207 2.86011 3.87207H10.5998C11.4437 3.87207 12.1278 4.55622 12.1278 5.40015V13.1398C12.1278 13.9837 11.4437 14.6679 10.5998 14.6679H2.86011C2.01618 14.6679 1.33203 13.9837 1.33203 13.1398V5.40015ZM2.86011 5.14217C2.71763 5.14217 2.60213 5.25767 2.60213 5.40015V13.1398C2.60213 13.2823 2.71763 13.3978 2.86011 13.3978H10.5998C10.7422 13.3978 10.8577 13.2823 10.8577 13.1398V5.40015C10.8577 5.25767 10.7422 5.14217 10.5998 5.14217H2.86011Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},qf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`copy-double-icon`,ref:t,icon:Kf}))});qf.displayName=`CopyDoubleIcon`;let Jf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M8.29012 10.552C8.29012 10.9202 8.5886 11.2187 8.95679 11.2187L12.7271 11.2187C13.0953 11.2187 13.3938 10.9202 13.3938 10.552L13.3938 5.44836C13.3938 5.08016 13.0953 4.7817 12.7271 4.7817L8.95678 4.7817C8.5886 4.7817 8.29012 5.08016 8.29012 5.44836L8.29012 10.552ZM13.3938 12.4946C14.0985 12.4946 14.6697 11.9234 14.6697 11.2187L14.6697 4.7817C14.6697 4.07703 14.0985 3.50576 13.3938 3.50576L8.29012 3.50576C7.58547 3.50576 7.0142 4.07703 7.0142 4.7817L7.0142 11.2187C7.0142 11.9234 7.58547 12.4946 8.29012 12.4946L13.3938 12.4946Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M1.37899 7.7562C1.34779 7.83142 1.33053 7.9139 1.33053 8.0004C1.33053 8.0869 1.34779 8.16938 1.37899 8.2446C1.41013 8.31985 1.45626 8.39034 1.51739 8.45151L3.43133 10.3654C3.68046 10.6145 4.08439 10.6145 4.33353 10.3654C4.58266 10.1163 4.58266 9.71232 4.33353 9.46318L3.50873 8.63836L5.70059 8.63836C6.05293 8.63836 6.33855 8.35273 6.33855 8.0004C6.33855 7.64806 6.05293 7.36244 5.70059 7.36244L3.50873 7.36244L4.33353 6.53762C4.58266 6.28848 4.58266 5.88455 4.33353 5.63541C4.08439 5.38627 3.68046 5.38627 3.43133 5.63541L1.51773 7.54899M9.00896 6.15858C9.28326 5.87701 9.72798 5.87701 10.0023 6.15858L10.8032 6.98073L11.6042 6.15852C11.8784 5.87695 12.3232 5.87695 12.5975 6.15852C12.8718 6.44009 12.8718 6.89661 12.5975 7.17819L11.7965 8.00041L12.5975 8.8226C12.8718 9.10417 12.8718 9.56069 12.5975 9.84227C12.3232 10.1238 11.8784 10.1238 11.6041 9.84227L10.8032 9.02007L10.0023 9.84221C9.728 10.1238 9.28327 10.1238 9.00897 9.84221C8.73468 9.56063 8.73468 9.10411 9.00898 8.82254L9.80987 8.00041L9.00896 7.17825C8.73466 6.89668 8.73466 6.44016 9.00896 6.15858Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Yf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`delete-cell-shift-left-double-icon`,ref:t,icon:Jf}))});Yf.displayName=`DeleteCellShiftLeftDoubleIcon`;let Xf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M7.69172 10.552C7.69172 10.9202 7.39324 11.2187 7.02506 11.2187H3.2547C2.8865 11.2187 2.58803 10.9202 2.58803 10.552V5.44836C2.58803 5.08016 2.8865 4.7817 3.2547 4.7817H7.02506C7.39324 4.7817 7.69172 5.08016 7.69172 5.44836V10.552ZM2.58803 12.4946C1.88335 12.4946 1.3121 11.9234 1.3121 11.2187V4.7817C1.3121 4.07703 1.88335 3.50576 2.58803 3.50576H7.69172C8.39637 3.50576 8.96764 4.07703 8.96764 4.7817V11.2187C8.96764 11.9234 8.39637 12.4946 7.69172 12.4946H2.58803Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M11.892 5.54431C11.9672 5.51312 12.0497 5.49591 12.1362 5.49591C12.2227 5.49591 12.3052 5.51312 12.3804 5.54431C12.4557 5.57545 12.5261 5.62159 12.5873 5.68276L14.5012 7.59665C14.7503 7.84579 14.7503 8.24972 14.5012 8.49886C14.2521 8.748 13.8481 8.748 13.599 8.49886L12.7741 7.67405V9.86594C12.7741 10.2183 12.4885 10.5039 12.1362 10.5039C11.7839 10.5039 11.4983 10.2183 11.4983 9.86594V7.67405L10.6734 8.49886C10.4243 8.748 10.0203 8.748 9.77121 8.49886C9.52207 8.24972 9.52207 7.84579 9.77121 7.59665L11.6848 5.68305M6.97304 6.15811C6.69874 5.87653 6.25401 5.87654 5.97972 6.15811L5.17881 6.98026L4.37784 6.15805C4.10355 5.87647 3.65882 5.87647 3.38453 6.15805C3.11023 6.43962 3.11023 6.89615 3.38453 7.17772L4.18549 7.99993L3.38454 8.82213C3.11024 9.1037 3.11024 9.56023 3.38454 9.8418C3.65884 10.1234 4.10356 10.1234 4.37786 9.8418L5.17881 9.0196L5.9797 9.84174C6.254 10.1233 6.69872 10.1233 6.97302 9.84174C7.24732 9.56016 7.24732 9.10364 6.97302 8.82207L6.17213 7.99993L6.97304 7.17778C7.24734 6.89621 7.24734 6.43969 6.97304 6.15811Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Zf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`delete-cell-shift-up-double-icon`,ref:t,icon:Xf}))});Zf.displayName=`DeleteCellShiftUpDoubleIcon`;let Qf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M11.9503 1.33317C12.6866 1.33317 13.2836 1.9301 13.2836 2.6665V13.3332C13.2836 14.0695 12.6866 14.6665 11.9503 14.6665H9.28359C8.54721 14.6665 7.95026 14.0696 7.95026 13.3332L7.95026 2.6665C7.95026 1.9301 8.54721 1.33317 9.28359 1.33317H11.9503ZM11.9503 2.6665V13.3332H9.28359V2.6665H11.9503Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M3.8542 6.29716C3.59385 6.03681 3.17174 6.03681 2.91139 6.29716C2.65104 6.55751 2.65104 6.97962 2.91139 7.23997L3.67157 8.00014L2.9114 8.76031C2.65105 9.02066 2.65105 9.44277 2.9114 9.70312C3.17175 9.96347 3.59387 9.96347 3.85421 9.70312L4.61437 8.94296L5.37459 9.70318C5.63494 9.96352 6.05705 9.96353 6.31741 9.70318C6.57775 9.44283 6.57775 9.02072 6.31741 8.76036L5.55718 8.00014L6.31742 7.23991C6.57777 6.97956 6.57777 6.55745 6.31742 6.2971C6.05707 6.03675 5.63496 6.03675 5.37461 6.2971L4.61437 7.05734L3.8542 6.29716Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},$f=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`delete-column-double-icon`,ref:t,icon:Qf}))});$f.displayName=`DeleteColumnDoubleIcon`;let ep={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M14.6666 11.9502C14.6666 12.6866 14.0697 13.2835 13.3333 13.2835H2.66665C1.93027 13.2835 1.33331 12.6866 1.33331 11.9502V9.28353C1.33331 8.54715 1.93027 7.9502 2.66665 7.9502L13.3333 7.9502C14.0697 7.9502 14.6666 8.54715 14.6666 9.28353V11.9502ZM13.3333 11.9502H2.66665V9.28353H13.3333V11.9502Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M9.60134 3.85438C9.86169 3.59403 9.86169 3.17192 9.60134 2.91157C9.34099 2.65122 8.91888 2.65122 8.65853 2.91157L7.89835 3.67175L7.13819 2.91159C6.87784 2.65124 6.45573 2.65124 6.19538 2.91159C5.93503 3.17194 5.93503 3.59405 6.19538 3.8544L6.95554 4.61456L6.19532 5.37478C5.93497 5.63513 5.93497 6.05724 6.19532 6.31759C6.45567 6.57794 6.87778 6.57794 7.13813 6.31759L7.89835 5.55737L8.65859 6.3176C8.91893 6.57796 9.34105 6.57796 9.60139 6.3176C9.86175 6.05726 9.86175 5.63514 9.60139 5.3748L8.84116 4.61456L9.60134 3.85438Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},tp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`delete-row-double-icon`,ref:t,icon:ep}))});tp.displayName=`DeleteRowDoubleIcon`;let np={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`colorChannel1`,d:`M3.99992 1.33301H2.66659C1.93021 1.33301 1.33325 1.92996 1.33325 2.66634V3.99967H2.66659V2.66634L3.99992 2.66634V1.33301Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M1.33325 9.33301H2.66659V6.66634H1.33325V9.33301Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M6.66659 1.33301V2.66634H7.33325V5.33301H8.66659V2.66634H9.33325V1.33301H6.66659Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M11.9999 1.33301V2.66634H13.3333V3.99967H14.6666V2.66634C14.6666 1.92996 14.0696 1.33301 13.3333 1.33301H11.9999Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M14.6666 6.66634H13.3333V7.33301H10.6666V8.66634H13.3333V9.33301H14.6666V6.66634Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M7.33325 13.333V10.6663H8.66659V13.333H7.33325Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M5.33325 7.33301H2.66659V8.66634H5.33325V7.33301Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.33325 13.3333V12H2.66659L2.66659 13.3333H13.3333V12H14.6666V13.3333C14.6666 14.0697 14.0696 14.6667 13.3333 14.6667H2.66659C1.93021 14.6667 1.33325 14.0697 1.33325 13.3333Z`}}]},rp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`down-border-double-icon`,ref:t,icon:np}))});rp.displayName=`DownBorderDoubleIcon`;let ip={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`colorChannel1`,d:`M1.98682 13.4992C1.98682 12.5603 2.74793 11.7992 3.68682 11.7992H14.2868C15.2257 11.7992 15.9868 12.5603 15.9868 13.4992V13.4992C15.9868 14.4381 15.2257 15.1992 14.2868 15.1992H3.68682C2.74793 15.1992 1.98682 14.4381 1.98682 13.4992V13.4992Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M10.3014 1.70389C9.85268 0.479568 8.12109 0.479557 7.67238 1.70389L4.72235 9.75326C4.60832 10.0644 4.76811 10.4091 5.07924 10.5231C5.39038 10.6371 5.73504 10.4773 5.84907 10.1662L6.99975 7.02646C7.03588 7.03324 7.07314 7.03679 7.11123 7.03679H10.9778L12.1247 10.1662C12.2387 10.4773 12.5834 10.6371 12.8945 10.5231C13.2057 10.4091 13.3654 10.0644 13.2514 9.75326L10.3014 1.70389ZM10.538 5.83679L9.17467 2.11682C9.11057 1.94192 8.8632 1.94192 8.7991 2.11682L7.43576 5.83679H10.538Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},ap=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`font-color-double-icon`,ref:t,icon:ip}))});ap.displayName=`FontColorDoubleIcon`;let op={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M8.01519 4.9156C7.65059 4.9156 7.29055 4.96431 6.93757 5.05194C6.6062 5.1342 6.2709 4.93226 6.18864 4.60089C6.10638 4.26953 6.30831 3.93422 6.63968 3.85196C7.0796 3.74275 7.53991 3.6792 8.01519 3.6792C9.93752 3.6792 11.6225 4.71575 12.781 5.67605C13.3691 6.16346 13.8434 6.64946 14.171 7.01358C14.3351 7.19604 14.4633 7.34895 14.5515 7.45755C14.5956 7.51187 14.6298 7.5552 14.6535 7.58568C14.6653 7.60092 14.6745 7.61296 14.6811 7.62157L14.6889 7.63188L14.6913 7.63506L14.6921 7.63614C14.6921 7.63614 14.6927 7.63689 14.1972 8.0066C14.6927 8.37631 14.6925 8.37646 14.6925 8.37646L14.6921 8.37705L14.6913 8.37814L14.6889 8.38131L14.6811 8.39163C14.6745 8.40023 14.6653 8.41227 14.6535 8.42752C14.6298 8.458 14.5956 8.50132 14.5515 8.55565C14.4633 8.66425 14.3351 8.81715 14.171 8.99961C13.8434 9.36373 13.3691 9.84973 12.781 10.3371C12.5182 10.555 12.1284 10.5186 11.9106 10.2557C11.6927 9.99285 11.7291 9.60313 11.992 9.38524C12.5227 8.94536 12.9537 8.50406 13.2518 8.1727C13.3051 8.11347 13.354 8.05788 13.3984 8.0066C13.354 7.95531 13.3051 7.89972 13.2518 7.84049C12.9537 7.50913 12.5227 7.06783 11.992 6.62795C10.9131 5.73365 9.50709 4.9156 8.01519 4.9156ZM14.1972 8.0066L14.6925 8.37646C14.8562 8.15715 14.8563 7.8562 14.6927 7.63689L14.1972 8.0066ZM4.11981 5.75748C4.3377 6.02035 4.30123 6.41007 4.03837 6.62795C3.50769 7.06783 3.07669 7.50913 2.7786 7.84049C2.72531 7.89972 2.67639 7.95531 2.63203 8.0066C2.67639 8.05788 2.72531 8.11347 2.7786 8.17271C3.07669 8.50406 3.50769 8.94536 4.03837 9.38524C5.11729 10.2795 6.5233 11.0976 8.01519 11.0976C8.38283 11.0976 8.74582 11.0481 9.10157 10.9591C9.43279 10.8762 9.76846 11.0776 9.85131 11.4088C9.93417 11.74 9.73283 12.0757 9.40162 12.1585C8.95841 12.2694 8.49443 12.334 8.01519 12.334C6.09287 12.334 4.40788 11.2974 3.24935 10.3371C2.66132 9.84973 2.18698 9.36373 1.85941 8.99961C1.69527 8.81715 1.56704 8.66425 1.47887 8.55565C1.43476 8.50132 1.4006 8.458 1.37692 8.42752C1.36508 8.41227 1.35585 8.40023 1.3493 8.39162L1.34149 8.38131L1.3391 8.37813L1.33829 8.37705C1.33829 8.37705 1.33773 8.37631 1.8332 8.0066C1.33773 7.63689 1.33785 7.63673 1.33785 7.63673L1.3391 7.63506L1.34149 7.63188L1.3493 7.62157C1.35585 7.61296 1.36508 7.60092 1.37692 7.58568C1.4006 7.5552 1.43476 7.51187 1.47887 7.45755C1.56704 7.34895 1.69527 7.19604 1.85941 7.01358C2.18698 6.64946 2.66132 6.16346 3.24935 5.67605C3.51221 5.45816 3.90193 5.49462 4.11981 5.75748ZM1.8332 8.0066L1.33785 7.63673C1.1742 7.85604 1.17464 8.15774 1.33829 8.37705L1.8332 8.0066Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M3.8775 2.99454C3.63608 2.75312 3.24466 2.75312 3.00323 2.99454C2.76181 3.23596 2.76181 3.62739 3.00323 3.86881L6.11167 6.97725C5.94588 7.28339 5.85153 7.63423 5.85153 8.00647C5.85153 9.20144 6.82025 10.1702 8.01523 10.1702C8.38756 10.1702 8.73834 10.0758 9.04444 9.91001L12.1095 12.9751C12.3509 13.2165 12.7424 13.2165 12.9838 12.9751C13.2252 12.7337 13.2252 12.3422 12.9838 12.1008L3.8775 2.99454ZM8.0668 8.93237L7.08932 7.9549C7.0884 7.97197 7.08793 7.98916 7.08793 8.00647C7.08793 8.5186 7.5031 8.93377 8.01523 8.93377C8.03254 8.93377 8.04973 8.9333 8.0668 8.93237Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},sp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`hide-double-icon`,ref:t,icon:op}))});sp.displayName=`HideDoubleIcon`;let cp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`colorChannel1`,d:`M1.33325 13.333V11.9997H2.66659L2.66659 13.333H3.99992V14.6663H2.66659C1.93021 14.6663 1.33325 14.0694 1.33325 13.333Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M2.66659 1.33301H3.99992V2.66634L2.66659 2.66634V3.99967H1.33325V2.66634C1.33325 1.92996 1.93021 1.33301 2.66659 1.33301Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M2.66659 9.33301H1.33325V6.66634H2.66659V9.33301Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M6.66659 2.66634V1.33301H9.33325V2.66634H8.66496V3.9855H7.33496V2.66634H6.66659Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M11.9999 2.66634V1.33301H13.3333C14.0696 1.33301 14.6666 1.92996 14.6666 2.66634V3.99967H13.3333V2.66634H11.9999Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M13.3333 6.66634H14.6666V9.33301H13.3333V6.66634Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M13.3333 11.9997H14.6666V13.333C14.6666 14.0694 14.0696 14.6663 13.3333 14.6663H11.9999V13.333H13.3333V11.9997Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M9.33325 13.333V14.6663H6.66659V13.333H7.33496V12.0138H8.66496V13.333H9.33325Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M7.33496 6.66159L7.33496 9.33768H8.66496V6.66159H7.33496Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M8.66687 7.33423H7.33354L2.66687 7.33431V8.66764H7.33354L8.66687 8.66756L13.3335 8.66764V7.33431L8.66687 7.33423Z`}}]},lp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`horizontal-border-double-icon`,ref:t,icon:cp}))});lp.displayName=`HorizontalBorderDoubleIcon`;let up={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`colorChannel1`,d:`M1.33325 11.9997V13.333C1.33325 14.0694 1.93021 14.6663 2.66659 14.6663H3.99992V13.333H2.66659L2.66659 11.9997H1.33325ZM3.99992 1.33301H2.66659C1.93021 1.33301 1.33325 1.92996 1.33325 2.66634V3.99967H2.66659V2.66634L3.99992 2.66634V1.33301ZM1.33325 9.33301H2.66659V6.66634H1.33325V9.33301ZM6.66659 1.33301V2.66634H9.33325V1.33301H6.66659ZM11.9999 1.33301V2.66634H13.3333V3.99967H14.6666V2.66634C14.6666 1.92996 14.0696 1.33301 13.3333 1.33301H11.9999ZM14.6666 6.66634H13.3333V9.33301H14.6666V6.66634ZM14.6666 11.9997H13.3333V13.333H11.9999V14.6663H13.3333C14.0696 14.6663 14.6666 14.0694 14.6666 13.333V11.9997ZM9.33325 14.6663V13.333H6.66659V14.6663H9.33325Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M8.66693 7.33415V2.66748H7.3336V7.33415H2.66693V8.66748H7.3336V13.3341H8.66693V8.66748H13.3336V7.33415H8.66693Z`}}]},dp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`inner-border-double-icon`,ref:t,icon:up}))});dp.displayName=`InnerBorderDoubleIcon`;let fp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M7.66105 5.44796C7.66105 5.07977 7.36257 4.7813 6.99439 4.7813H3.22403C2.85583 4.7813 2.55736 5.07977 2.55736 5.44796V10.5516C2.55736 10.9198 2.85583 11.2183 3.22403 11.2183H6.99439C7.36257 11.2183 7.66105 10.9198 7.66105 10.5516V5.44796ZM2.55736 3.50537C1.85268 3.50537 1.28143 4.07662 1.28143 4.7813V11.2183C1.28143 11.923 1.85268 12.4942 2.55736 12.4942H7.66105C8.3657 12.4942 8.93697 11.923 8.93697 11.2183V4.7813C8.93697 4.07662 8.3657 3.50537 7.66105 3.50537H2.55736Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M11.9225 10.465C11.9977 10.4962 12.0802 10.5134 12.1667 10.5134C12.2532 10.5134 12.3357 10.4962 12.4109 10.465C12.4862 10.4338 12.5567 10.3877 12.6178 10.3265L14.5317 8.41263C14.7808 8.16349 14.7808 7.75956 14.5317 7.51042C14.2826 7.26128 13.8786 7.26128 13.6295 7.51042L12.8047 8.33523V6.14333C12.8047 5.791 12.5191 5.50537 12.1667 5.50537C11.8144 5.50537 11.5288 5.791 11.5288 6.14333V8.33523L10.7039 7.51042C10.4548 7.26128 10.0509 7.26128 9.80172 7.51042C9.55258 7.75956 9.55258 8.16349 9.80172 8.41263L11.7153 10.3262`,fillRule:`evenodd`,clipRule:`evenodd`}}]},pp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`insert-cell-down-double-icon`,ref:t,icon:fp}))});pp.displayName=`InsertCellDownDoubleIcon`;let mp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M7.56614 5.44796C7.56614 5.07977 7.26766 4.7813 6.89948 4.7813H3.12912C2.76092 4.7813 2.46245 5.07977 2.46245 5.44796V10.5516C2.46245 10.9198 2.76092 11.2183 3.12912 11.2183H6.89948C7.26766 11.2183 7.56614 10.9198 7.56614 10.5516V5.44796ZM2.46245 3.50537C1.75777 3.50537 1.18652 4.07662 1.18652 4.7813V11.2183C1.18652 11.923 1.75777 12.4942 2.46245 12.4942H7.56614C8.27079 12.4942 8.84206 11.923 8.84206 11.2183V4.7813C8.84206 4.07662 8.27079 3.50537 7.56614 3.50537H2.46245Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M14.7651 8.2438C14.7963 8.16858 14.8135 8.0861 14.8135 7.9996C14.8135 7.9131 14.7963 7.83062 14.7651 7.7554C14.7339 7.68015 14.6878 7.60966 14.6266 7.54849L12.7127 5.63461C12.4636 5.38547 12.0597 5.38547 11.8105 5.63461C11.5614 5.88375 11.5614 6.28768 11.8105 6.53682L12.6353 7.36164H10.4434C10.0911 7.36164 9.80548 7.64727 9.80548 7.9996C9.80548 8.35194 10.0911 8.63756 10.4434 8.63756H12.6353L11.8105 9.46238C11.5614 9.71152 11.5614 10.1155 11.8105 10.3646C12.0597 10.6137 12.4636 10.6137 12.7127 10.3646L14.6263 8.45101`,fillRule:`evenodd`,clipRule:`evenodd`}}]},hp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`insert-cell-shift-right-double-icon`,ref:t,icon:mp}))});hp.displayName=`InsertCellShiftRightDoubleIcon`;let gp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M2.53337 14C2.35658 14 2.18704 13.9297 2.06203 13.8047C1.93703 13.6797 1.86681 13.5101 1.86681 13.3333C1.86681 13.1565 1.93703 12.987 2.06203 12.862C2.18704 12.7369 2.35658 12.6667 2.53337 12.6667L13.4667 12.6667C13.6435 12.6667 13.813 12.7369 13.938 12.862C14.063 12.987 14.1333 13.1565 14.1333 13.3333C14.1333 13.5101 14.063 13.6797 13.938 13.8047C13.813 13.9297 13.6435 14 13.4667 14L2.53337 14ZM2.53337 3.33333C2.35658 3.33331 2.18703 3.26306 2.06203 3.13804C1.93703 3.01301 1.86681 2.84346 1.86681 2.66667C1.86681 2.48987 1.93703 2.32032 2.06203 2.1953C2.18703 2.07028 2.35658 2.00003 2.53337 2L13.4667 2C13.6435 2.00003 13.813 2.07028 13.938 2.1953C14.063 2.32032 14.1333 2.48987 14.1333 2.66667C14.1333 2.84346 14.063 3.01301 13.938 3.13803C13.813 3.26306 13.6435 3.33331 13.4667 3.33333L2.53337 3.33333Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M11.0573 7.33327L10.1953 6.47127C10.0703 6.34627 10.0001 6.17672 10.0001 5.99994C10.0001 5.82315 10.0703 5.65361 10.1953 5.52861C10.3203 5.4036 10.4899 5.33337 10.6667 5.33337C10.8434 5.33337 11.013 5.4036 11.138 5.52861L13.138 7.5286C13.2 7.59046 13.2491 7.66393 13.2827 7.74481C13.3162 7.82569 13.3335 7.91238 13.3335 7.99994C13.3335 8.08749 13.3162 8.17419 13.2827 8.25507C13.2491 8.33594 13.2 8.40941 13.138 8.47127L11.138 10.4713C11.0761 10.5332 11.0026 10.5823 10.9217 10.6158C10.8409 10.6493 10.7542 10.6665 10.6667 10.6665C10.5791 10.6665 10.4925 10.6493 10.4116 10.6158C10.3307 10.5823 10.2572 10.5332 10.1953 10.4713C10.1334 10.4094 10.0843 10.3359 10.0508 10.255C10.0173 10.1742 10.0001 10.0875 10.0001 9.99994C10.0001 9.9124 10.0173 9.82573 10.0508 9.74486C10.0843 9.66398 10.1334 9.5905 10.1953 9.52861L11.0573 8.6666L3.33333 8.66661C3.15652 8.66661 2.98695 8.59637 2.86193 8.47134C2.7369 8.34632 2.66666 8.17675 2.66666 7.99994C2.66666 7.82313 2.7369 7.65356 2.86193 7.52853C2.98695 7.40351 3.15652 7.33327 3.33333 7.33327L11.0573 7.33327Z`}}]},_p=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`insert-double-icon`,ref:t,icon:gp}))});_p.displayName=`InsertDoubleIcon`;let vp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M13.3333 13.4087C14.0697 13.4087 14.6666 12.8117 14.6666 12.0754L14.6666 9.40869C14.6666 8.67231 14.0697 8.07536 13.3333 8.07536L2.66663 8.07536C1.93023 8.07536 1.33329 8.67231 1.33329 9.40869L1.33329 12.0754C1.33329 12.8117 1.93023 13.4087 2.66663 13.4087L13.3333 13.4087ZM2.66663 12.0754L13.3333 12.0754L13.3333 9.40869L2.66663 9.40869L2.66663 12.0754Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M7.74168 2.59137C8.10987 2.59137 8.40835 2.88984 8.40835 3.25804L8.40835 4.33309L9.48348 4.33309C9.85167 4.33309 10.1501 4.63156 10.1501 4.99976C10.1501 5.36794 9.85167 5.66642 9.48348 5.66642L8.40835 5.66642L8.40835 6.74154C8.40835 7.10973 8.10987 7.4082 7.74168 7.4082C7.37349 7.4082 7.07501 7.10973 7.07501 6.74154L7.07501 5.66642L5.99998 5.66642C5.63179 5.66642 5.33331 5.36794 5.33331 4.99976C5.33331 4.63156 5.63179 4.33309 5.99998 4.33309L7.07501 4.33309L7.07501 3.25804C7.07501 2.88984 7.37349 2.59137 7.74168 2.59137Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},yp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`insert-row-above-double-icon`,ref:t,icon:vp}))});yp.displayName=`InsertRowAboveDoubleIcon`;let bp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M2.66671 2.59131C1.93033 2.59131 1.33337 3.18826 1.33337 3.92464L1.33337 6.59131C1.33337 7.32769 1.93033 7.92464 2.66671 7.92464L13.3334 7.92464C14.0698 7.92464 14.6667 7.32769 14.6667 6.59131L14.6667 3.92464C14.6667 3.18826 14.0698 2.59131 13.3334 2.59131L2.66671 2.59131ZM13.3334 3.92464L2.66671 3.92464L2.66671 6.59131L13.3334 6.59131L13.3334 3.92464Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M8.25838 13.4086C7.8902 13.4086 7.59172 13.1102 7.59172 12.742L7.59172 11.6669L6.51658 11.6669C6.14839 11.6669 5.84992 11.3684 5.84991 11.0002C5.84991 10.6321 6.14839 10.3336 6.51658 10.3336L7.59172 10.3336L7.59171 9.25846C7.59171 8.89027 7.89019 8.5918 8.25838 8.5918C8.62657 8.5918 8.92505 8.89027 8.92505 9.25846L8.92505 10.3336L10.0001 10.3336C10.3683 10.3336 10.6667 10.6321 10.6667 11.0002C10.6667 11.3684 10.3683 11.6669 10.0001 11.6669L8.92505 11.6669L8.92505 12.742C8.92505 13.1102 8.62658 13.4086 8.25838 13.4086Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},xp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`insert-row-below-double-icon`,ref:t,icon:bp}))});xp.displayName=`InsertRowBelowDoubleIcon`;let Sp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`colorChannel1`,d:`M14.6664 3.99967L14.6664 2.66634C14.6664 1.92996 14.0694 1.33301 13.333 1.33301L11.9997 1.33301L11.9997 2.66634L13.333 2.66634L13.333 3.99967L14.6664 3.99967Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M6.66638 1.33301L6.66638 2.66634L9.33305 2.66634L9.33305 1.33301L6.66638 1.33301Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M14.6664 6.66634L13.333 6.66634L13.333 7.33301L10.6664 7.33301L10.6664 8.66634L13.333 8.66634L13.333 9.33301L14.6664 9.33301L14.6664 6.66634Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M14.6664 11.9997L13.333 11.9997L13.333 13.333L11.9997 13.333L11.9997 14.6663L13.333 14.6663C14.0694 14.6663 14.6664 14.0694 14.6664 13.333L14.6664 11.9997Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M9.33305 14.6663L9.33305 13.333L8.66638 13.333L8.66638 10.6663L7.33305 10.6663L7.33305 13.333L6.66638 13.333L6.66638 14.6663L9.33305 14.6663Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M2.66638 7.33301L5.33305 7.33301L5.33305 8.66634L2.66638 8.66634L2.66638 7.33301Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M8.66638 5.33301L8.66638 2.66634L7.33305 2.66634L7.33305 5.33301L8.66638 5.33301Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M2.66667 1.33301L4 1.33301L4 2.66634L2.66667 2.66634L2.66667 13.333L4 13.333L4 14.6663L2.66667 14.6663C1.93029 14.6663 1.33333 14.0694 1.33333 13.333L1.33333 2.66634C1.33333 1.92996 1.93029 1.33301 2.66667 1.33301Z`}}]},Cp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`left-border-double-icon`,ref:t,icon:Sp}))});Cp.displayName=`LeftBorderDoubleIcon`;let wp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M3.2987 2.39556L14.424 7.49259L13.9241 8.58354L4.06409 4.06617L8.58147 13.9262L7.49051 14.426L2.39348 3.30078L2.08524 3.15956L2.20701 2.89377L2.06653 2.58713L2.42214 2.42421L2.58506 2.0686L2.89169 2.20909L3.15748 2.08732L3.2987 2.39556Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M1.34351 12.0924L1.34351 13.4565C1.34351 14.1193 1.88077 14.6565 2.54351 14.6565L3.90764 14.6565L3.90764 13.3265L2.67351 13.3265L2.67351 12.0924L1.34351 12.0924ZM3.90763 1.34351L2.54351 1.34351C1.88076 1.34351 1.34351 1.88076 1.34351 2.54351L1.34351 3.90764L2.67351 3.90764L2.67351 2.67351L3.90763 2.67351L3.90763 1.34351ZM1.34351 9.36415L2.67351 9.36415L2.67351 6.63589L1.34351 6.63589L1.34351 9.36415ZM6.63589 1.34351L6.63589 2.67351L9.36415 2.67351L9.36415 1.34351L6.63589 1.34351ZM12.0924 1.34351L12.0924 2.67351L13.3265 2.67351L13.3265 3.90763L14.6565 3.90763L14.6565 2.54351C14.6565 1.88076 14.1193 1.34351 13.4565 1.34351L12.0924 1.34351ZM14.6565 6.63589L13.3265 6.63589L13.3265 9.36415L14.6565 9.36415L14.6565 6.63589ZM14.6565 12.0924L13.3265 12.0924L13.3265 13.3265L12.0924 13.3265L12.0924 14.6565L13.4565 14.6565C14.1193 14.6565 14.6565 14.1193 14.6565 13.4565L14.6565 12.0924ZM9.36415 14.6565L9.36415 13.3265L6.63589 13.3265L6.63589 14.6565L9.36415 14.6565Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Tp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`left-double-diagonal-double-icon`,ref:t,icon:wp}))});Tp.displayName=`LeftDoubleDiagonalDoubleIcon`;let Ep={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M13.4322 2.66683C13.4322 1.93045 12.8352 1.3335 12.0989 1.3335H9.43219C8.69581 1.3335 8.09886 1.93045 8.09886 2.66683V13.3335C8.09886 14.0699 8.69581 14.6668 9.43219 14.6668H12.0989C12.8352 14.6668 13.4322 14.0699 13.4322 13.3335V2.66683ZM12.0989 13.3335V2.66683H9.43219V13.3335H12.0989Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M2.56769 7.99978C2.56769 7.63159 2.86616 7.33311 3.23435 7.33311H4.30941V6.25798C4.30941 5.88979 4.60788 5.59131 4.97607 5.59131C5.34426 5.59131 5.64274 5.88979 5.64274 6.25798V7.33311H6.71785C7.08604 7.33311 7.38452 7.63159 7.38452 7.99978C7.38452 8.36797 7.08604 8.66644 6.71785 8.66644H5.64274V9.74148C5.64274 10.1097 5.34426 10.4081 4.97607 10.4081C4.60788 10.4081 4.30941 10.1097 4.30941 9.74148V8.66644H3.23435C2.86616 8.66644 2.56769 8.36797 2.56769 7.99978Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Dp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`left-insert-column-double-icon`,ref:t,icon:Ep}))});Dp.displayName=`LeftInsertColumnDoubleIcon`;let Op={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 17`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M2.33875 3.57255L2.23657 3.79614L2.72883 4.0211L7.58275 14.6428L8.67419 14.144L5.10931 6.34311L13.5649 14.7987L14.4134 13.9502L5.96172 5.49847L13.7573 9.0609L14.2561 7.96947L3.63438 3.11555L3.40942 2.62329L3.18782 2.72456L3.09973 2.63647L2.93861 2.7976L2.73534 2.70471L2.60444 2.99116L2.31799 3.12206L2.41088 3.32533L2.2512 3.485L2.33875 3.57255Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M1.6759 12.8102L1.6759 14.1743C1.6759 14.8371 2.21316 15.3743 2.8759 15.3743L4.24003 15.3743L4.24003 14.0443L3.0059 14.0443L3.0059 12.8102L1.6759 12.8102ZM4.24003 2.06128L2.8759 2.06128C2.21316 2.06128 1.6759 2.59854 1.6759 3.26128L1.6759 4.62541L3.0059 4.62541L3.0059 3.39128L4.24003 3.39128L4.24003 2.06128ZM1.6759 10.0819L3.0059 10.0819L3.0059 7.35367L1.6759 7.35367L1.6759 10.0819ZM6.96829 2.06128L6.96829 3.39128L9.69655 3.39128L9.69655 2.06128L6.96829 2.06128ZM12.4248 2.06128L12.4248 3.39128L13.6589 3.39128L13.6589 4.62541L14.9889 4.62541L14.9889 3.26128C14.9889 2.59854 14.4517 2.06128 13.7889 2.06128L12.4248 2.06128ZM14.9889 7.35367L13.6589 7.35367L13.6589 10.0819L14.9889 10.0819L14.9889 7.35367ZM14.9889 12.8102L13.6589 12.8102L13.6589 14.0443L12.4248 14.0443L12.4248 15.3743L13.7889 15.3743C14.4517 15.3743 14.9889 14.8371 14.9889 14.1743L14.9889 12.8102ZM9.69655 15.3743L9.69655 14.0443L6.96829 14.0443L6.96829 15.3743L9.69655 15.3743Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},kp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`left-tridiagonal-double-icon`,ref:t,icon:Op}))});kp.displayName=`LeftTridiagonalDoubleIcon`;let Ap={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M12.665 2.66496H3.33496C2.96493 2.66496 2.66496 2.96493 2.66496 3.33496V12.665C2.66496 13.035 2.96493 13.335 3.33496 13.335H12.665C13.035 13.335 13.335 13.035 13.335 12.665V3.33496C13.335 2.96493 13.035 2.66496 12.665 2.66496ZM3.33496 1.33496C2.23039 1.33496 1.33496 2.23039 1.33496 3.33496V12.665C1.33496 13.7695 2.23039 14.665 3.33496 14.665H12.665C13.7695 14.665 14.665 13.7695 14.665 12.665V3.33496C14.665 2.23039 13.7695 1.33496 12.665 1.33496H3.33496Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M13.2559 14.1963L1.64941 2.58984L2.58987 1.64939L14.1963 13.2558L13.2559 14.1963Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},jp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`no-color-double-icon`,ref:t,icon:Ap}))});jp.displayName=`NoColorDoubleIcon`;let Mp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M13.3333 2.66634H2.66659V13.333H13.3333V2.66634ZM2.66659 1.33301C1.93021 1.33301 1.33325 1.92996 1.33325 2.66634V13.333C1.33325 14.0694 1.93021 14.6663 2.66659 14.6663H13.3333C14.0696 14.6663 14.6666 14.0694 14.6666 13.333V2.66634C14.6666 1.92996 14.0696 1.33301 13.3333 1.33301H2.66659Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M7.33311 2.66748V5.33415H8.66644V2.66748H7.33311Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M7.33311 10.6675V13.3341H8.66644V10.6675H7.33311Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M13.3331 7.33415H10.6664V8.66748H13.3331V7.33415Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M5.33311 7.33415H2.66644V8.66748H5.33311V7.33415Z`}}]},Np=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`outer-border-double-icon`,ref:t,icon:Mp}))});Np.displayName=`OuterBorderDoubleIcon`;let Pp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M8.01281 1.36643C8.79386 0.585377 10.0602 0.585378 10.8412 1.36643L12.9223 3.44752C13.7034 4.22857 13.7034 5.4949 12.9223 6.27595L9.36445 9.83383C8.5834 10.6149 7.31707 10.6149 6.53602 9.83383L4.45493 7.75273C3.67388 6.97168 3.67388 5.70535 4.45493 4.9243L8.01281 1.36643ZM9.9927 2.21495C9.68028 1.90253 9.17375 1.90253 8.86133 2.21495L5.30346 5.77283L5.29671 5.77966L10.839 6.66224L12.0738 5.42742C12.3862 5.115 12.3862 4.60847 12.0738 4.29605L9.9927 2.21495Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M14.5179 9.48875C14.5179 9.99175 14.1101 10.3995 13.607 10.3995C13.1041 10.3995 12.6963 9.99175 12.6963 9.48875C12.6963 9.1773 13.0455 8.59966 13.3114 8.20487C13.4549 7.99177 13.7591 7.99177 13.9027 8.20486C14.1687 8.59965 14.5179 9.1773 14.5179 9.48875Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M1.98682 13.4992C1.98682 12.5603 2.74793 11.7992 3.68682 11.7992H14.2868C15.2257 11.7992 15.9868 12.5603 15.9868 13.4992V13.4992C15.9868 14.4381 15.2257 15.1992 14.2868 15.1992H3.68682C2.74793 15.1992 1.98682 14.4381 1.98682 13.4992V13.4992Z`}}]},Fp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`paint-bucket-double-icon`,ref:t,icon:Pp}))});Fp.displayName=`PaintBucketDoubleIcon`;let Ip={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`colorChannel1`,d:`M7.74692 9.12463C7.74692 9.46018 8.01893 9.73219 8.35448 9.73219H11.4933C11.8288 9.73219 12.1009 9.46018 12.1009 9.12463C12.1009 8.78909 11.8288 8.51707 11.4933 8.51707H8.35448C8.01893 8.51707 7.74692 8.78909 7.74692 9.12463Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M10.8636 10.8523C10.8636 11.1879 10.5915 11.4599 10.256 11.4599H8.35448C8.01893 11.4599 7.74692 11.1879 7.74692 10.8523C7.74692 10.5168 8.01893 10.2447 8.35448 10.2447H10.256C10.5915 10.2447 10.8636 10.5168 10.8636 10.8523Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M5.4791 1.98268C5.47913 1.71529 5.87912 1.49854 6.37252 1.49854C6.86593 1.49854 7.26592 1.71529 7.26595 1.98268H7.62187C8.22277 1.98268 8.72459 2.39534 8.84412 2.9452H9.39563C10.0856 2.9452 10.6449 3.48923 10.6449 4.16032V6.00569H12.1261C13.161 6.00569 14 6.82174 14 7.82838V11.334C14 11.8174 13.8025 12.281 13.4511 12.6228L12.0693 13.9647C11.7179 14.3065 11.2412 14.4985 10.7442 14.4985H7.91116C7.05024 14.4985 6.32492 14.0431 6.10535 13.2737H3.34925C2.6593 13.2737 2.09998 12.7297 2.09998 12.0586V4.16032C2.09998 3.48923 2.6593 2.9452 3.34925 2.9452H3.90107C4.0206 2.39534 4.52241 1.98268 5.12332 1.98268H5.4791ZM3.97249 4.16032H3.24925L3.24925 12.0586H6.03725V7.82838C6.03725 6.82174 6.87623 6.00569 7.91116 6.00569H9.49563V4.16032H8.7727C8.58289 4.59611 8.13909 4.90183 7.62187 4.90183H5.12332C4.6061 4.90183 4.1623 4.59611 3.97249 4.16032ZM5.12332 2.89403H7.62187C7.79436 2.89403 7.93419 3.03003 7.93419 3.19781V3.68671C7.93419 3.85448 7.79436 3.99049 7.62187 3.99049H5.12332C4.95083 3.99049 4.811 3.85448 4.811 3.68671V3.19781C4.811 3.03003 4.95083 2.89403 5.12332 2.89403ZM7.91116 7.11157C7.56618 7.11157 7.28652 7.38359 7.28652 7.71913V12.7851C7.28652 13.1206 7.56618 13.3927 7.91116 13.3927H10.7442C10.8401 13.3927 10.9337 13.3712 11.0182 13.3311C11.1373 13.2746 11.1859 13.1423 11.1859 13.0134V12.0066C11.1859 11.8724 11.2978 11.7636 11.4358 11.7636H12.4709C12.6034 11.7636 12.7394 11.7163 12.7975 11.6004C12.8388 11.5182 12.8608 11.4272 12.8608 11.334V7.71913C12.8608 7.38359 12.5811 7.11157 12.2362 7.11157H7.91116Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Lp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`paste-special-double-icon`,ref:t,icon:Ip}))});Lp.displayName=`PasteSpecialDoubleIcon`;let Rp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M2.53331 14C2.35652 14 2.18697 13.9297 2.06197 13.8047C1.93697 13.6797 1.86675 13.5101 1.86675 13.3333C1.86675 13.1565 1.93697 12.987 2.06197 12.862C2.18697 12.7369 2.35652 12.6667 2.53331 12.6667L13.4666 12.6667C13.6434 12.6667 13.813 12.7369 13.938 12.862C14.063 12.987 14.1332 13.1565 14.1332 13.3333C14.1332 13.5101 14.063 13.6797 13.938 13.8047C13.813 13.9297 13.6434 14 13.4666 14L2.53331 14ZM2.53331 3.33333C2.35652 3.33331 2.18697 3.26306 2.06197 3.13804C1.93697 3.01301 1.86675 2.84346 1.86675 2.66667C1.86675 2.48987 1.93697 2.32032 2.06197 2.1953C2.18697 2.07028 2.35652 2.00003 2.53331 2L13.4666 2C13.6434 2.00003 13.813 2.07028 13.938 2.1953C14.063 2.32032 14.1332 2.48987 14.1332 2.66667C14.1332 2.84346 14.063 3.01301 13.938 3.13803C13.813 3.26306 13.6434 3.33331 13.4666 3.33333L2.53331 3.33333Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M10.8142 10.8141C10.5588 11.0695 10.1447 11.0695 9.88929 10.8141L7.97868 8.90354L6.14021 10.742C5.89652 10.9857 5.50142 10.9857 5.25774 10.742C5.01405 10.4983 5.01405 10.1032 5.25774 9.85955L7.09621 8.02107L5.18561 6.11047C4.93021 5.85507 4.93021 5.44098 5.18561 5.18557C5.44101 4.93017 5.8551 4.93017 6.11051 5.18557L8.02111 7.09618L9.85959 5.2577C10.1033 5.01401 10.4984 5.01401 10.7421 5.2577C10.9857 5.50139 10.9857 5.89648 10.7421 6.14017L8.90358 7.97865L10.8142 9.88925C11.0696 10.1447 11.0696 10.5587 10.8142 10.8141Z`}}]},zp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`reduce-double-icon`,ref:t,icon:Rp}))});zp.displayName=`ReduceDoubleIcon`;let Bp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`colorChannel1`,d:`M1.33325 3.99992L1.33325 2.66659C1.33325 1.93021 1.93021 1.33325 2.66659 1.33325L3.99992 1.33325L3.99992 2.66659L2.66659 2.66659L2.66659 3.99992L1.33325 3.99992Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M9.33325 1.33325L9.33325 2.66658L6.66659 2.66659L6.66659 1.33325L9.33325 1.33325Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M1.33325 6.66659L2.66659 6.66659L2.66659 7.33325L5.33325 7.33325L5.33325 8.66659L2.66659 8.66659L2.66659 9.33325L1.33325 9.33325L1.33325 6.66659Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M1.33325 11.9999L2.66659 11.9999L2.66659 13.3333L3.99992 13.3333L3.99992 14.6666L2.66659 14.6666C1.93021 14.6666 1.33325 14.0696 1.33325 13.3333L1.33325 11.9999Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M6.66659 14.6666L6.66659 13.3333L7.33325 13.3333L7.33325 10.6666L8.66659 10.6666L8.66659 13.3333L9.33325 13.3333L9.33325 14.6666L6.66659 14.6666Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M13.3333 7.33325L10.6666 7.33325L10.6666 8.66659L13.3333 8.66658L13.3333 7.33325Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M7.33325 5.33325L7.33325 2.66659L8.66659 2.66659L8.66659 5.33325L7.33325 5.33325Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M13.3333 1.33325L12 1.33325L12 2.66659L13.3333 2.66659L13.3333 13.3333L12 13.3333L12 14.6666L13.3333 14.6666C14.0697 14.6666 14.6667 14.0696 14.6667 13.3333L14.6667 2.66659C14.6667 1.93021 14.0697 1.33325 13.3333 1.33325Z`}}]},Vp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`right-border-double-icon`,ref:t,icon:Bp}))});Vp.displayName=`RightBorderDoubleIcon`;let Hp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 17`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M13.2368 2.87507L2.11162 7.97208L2.61144 9.06304L12.4714 4.54568L7.95409 14.4057L9.04505 14.9055L14.1421 3.78029L14.4503 3.63905L14.3286 3.37322L14.469 3.0666L14.1134 2.90369L13.9505 2.5481L13.6439 2.68857L13.3781 2.56678L13.2368 2.87507Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M4.44524 1.82495L3.08111 1.82495C2.41837 1.82495 1.88111 2.36221 1.88111 3.02495L1.88111 4.38908L3.21111 4.38908L3.21111 3.15495L4.44524 3.15495L4.44524 1.82495ZM15.1941 4.38908L15.1941 3.02495C15.1941 2.36221 14.6569 1.82495 13.9941 1.82495L12.63 1.82495L12.63 3.15495L13.8641 3.15495L13.8641 4.38908L15.1941 4.38908ZM7.17349 1.82495L7.17349 3.15495L9.90175 3.15495L9.90175 1.82495L7.17349 1.82495ZM15.1941 7.11734L13.8641 7.11734L13.8641 9.84559L15.1941 9.84559L15.1941 7.11734ZM15.1941 12.5739L13.8641 12.5739L13.8641 13.808L12.63 13.808L12.63 15.138L13.9941 15.138C14.6569 15.138 15.1941 14.6007 15.1941 13.938L15.1941 12.5739ZM9.90175 15.138L9.90175 13.808L7.17349 13.808L7.17349 15.138L9.90175 15.138ZM4.44524 15.138L4.44524 13.808L3.21111 13.808L3.21111 12.5739L1.88111 12.5739L1.88111 13.938C1.88111 14.6007 2.41837 15.138 3.08111 15.138L4.44524 15.138ZM1.88111 9.8456L3.21111 9.8456L3.21111 7.11734L1.88111 7.11734L1.88111 9.8456Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Up=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`right-double-diagonal-double-icon`,ref:t,icon:Hp}))});Up.displayName=`RightDoubleDiagonalDoubleIcon`;let Wp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M2.56781 13.3332C2.56781 14.0695 3.16476 14.6665 3.90114 14.6665L6.56781 14.6665C7.30419 14.6665 7.90114 14.0695 7.90114 13.3332L7.90114 2.6665C7.90114 1.9301 7.30419 1.33317 6.56781 1.33317L3.90114 1.33317C3.16476 1.33317 2.56781 1.9301 2.56781 2.6665L2.56781 13.3332ZM3.90114 2.6665L3.90114 13.3332L6.56781 13.3332L6.56781 2.6665L3.90114 2.6665Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M13.4323 8.00022C13.4323 8.36841 13.1338 8.66689 12.7656 8.66689L11.6906 8.66689L11.6906 9.74202C11.6906 10.1102 11.3921 10.4087 11.0239 10.4087C10.6557 10.4087 10.3573 10.1102 10.3573 9.74202L10.3573 8.66689L9.28215 8.66689C8.91396 8.66689 8.61548 8.36841 8.61548 8.00022C8.61548 7.63203 8.91396 7.33356 9.28214 7.33356L10.3573 7.33356L10.3573 6.25852C10.3573 5.89033 10.6557 5.59186 11.0239 5.59186C11.3921 5.59186 11.6906 5.89033 11.6906 6.25852L11.6906 7.33356L12.7656 7.33356C13.1338 7.33356 13.4323 7.63203 13.4323 8.00022Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Gp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`right-insert-column-double-icon`,ref:t,icon:Wp}))});Gp.displayName=`RightInsertColumnDoubleIcon`;let Kp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 17`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M2.27177 13.714L13.5855 2.40025L14.434 3.24878L3.1203 14.5625L2.27177 13.714Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M4.2603 1.82495L2.89617 1.82495C2.23343 1.82495 1.69617 2.36221 1.69617 3.02495L1.69617 4.38908L3.02617 4.38908L3.02617 3.15495L4.2603 3.15495L4.2603 1.82495ZM15.0092 4.38908L15.0092 3.02495C15.0092 2.36221 14.4719 1.82495 13.8092 1.82495L12.4451 1.82495L12.4451 3.15495L13.6792 3.15495L13.6792 4.38908L15.0092 4.38908ZM6.98856 1.82495L6.98856 3.15495L9.71681 3.15495L9.71681 1.82495L6.98856 1.82495ZM15.0092 7.11734L13.6792 7.11734L13.6792 9.84559L15.0092 9.84559L15.0092 7.11734ZM15.0092 12.5739L13.6792 12.5739L13.6792 13.808L12.4451 13.808L12.4451 15.138L13.8092 15.138C14.4719 15.138 15.0092 14.6007 15.0092 13.938L15.0092 12.5739ZM9.71681 15.138L9.71681 13.808L6.98856 13.808L6.98856 15.138L9.71681 15.138ZM4.2603 15.138L4.2603 13.808L3.02617 13.808L3.02617 12.5739L1.69617 12.5739L1.69617 13.938C1.69617 14.6007 2.23343 15.138 2.89617 15.138L4.2603 15.138ZM1.69617 9.8456L3.02617 9.8456L3.02617 7.11734L1.69617 7.11734L1.69617 9.8456Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},qp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`slash-double-icon`,ref:t,icon:Kp}))});qp.displayName=`SlashDoubleIcon`;let Jp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`colorChannel1`,d:`M4.0001 14.667H2.66677C1.93039 14.667 1.33344 14.07 1.33344 13.3337V12.0003H2.66677V13.3337L4.0001 13.3337V14.667Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M1.33344 6.66699H2.66677V9.33366H1.33344V6.66699Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M6.66677 14.667V13.3337H7.33344V10.667H8.66677V13.3337H9.33344V14.667H6.66677Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M12.0001 14.667V13.3337H13.3334V12.0003H14.6668V13.3337C14.6668 14.07 14.0698 14.667 13.3334 14.667H12.0001Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M14.6668 9.33366H13.3334V8.66699H10.6668V7.33366H13.3334V6.66699H14.6668V9.33366Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M7.33344 2.66699V5.33366H8.66677V2.66699H7.33344Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M5.33344 8.66699H2.66677V7.33366H5.33344V8.66699Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.33344 2.66789V4.00122H2.66677L2.66677 2.66789H13.3334V4.00122H14.6668V2.66789C14.6668 1.93151 14.0698 1.33455 13.3334 1.33455H2.66677C1.93039 1.33455 1.33344 1.93151 1.33344 2.66789Z`}}]},Yp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`up-border-double-icon`,ref:t,icon:Jp}))});Yp.displayName=`UpBorderDoubleIcon`;let Xp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`colorChannel1`,d:`M2.66699 1.33325L4.00033 1.33325L4.00033 2.66658L2.66699 2.66659L2.66699 3.99992L1.33366 3.99992L1.33366 2.66659C1.33366 1.93021 1.93061 1.33325 2.66699 1.33325Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M14.667 2.66659L14.667 3.99992L13.3337 3.99992L13.3337 2.66659L12.0003 2.66659L12.0003 1.33325L13.3337 1.33325C14.07 1.33325 14.667 1.93021 14.667 2.66659Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M6.66699 2.66658L6.66699 1.33325L9.33366 1.33325L9.33366 2.66659L6.66699 2.66658Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M13.3337 6.66659L14.667 6.66659L14.667 9.33325L13.3337 9.33325L13.3337 8.66496L12.0145 8.66496L12.0145 7.33496L13.3337 7.33496L13.3337 6.66659Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M13.3337 11.9999L14.667 11.9999L14.667 13.3333C14.667 14.0696 14.07 14.6666 13.3337 14.6666L12.0003 14.6666L12.0003 13.3333L13.3337 13.3333L13.3337 11.9999Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M9.33366 13.3333L9.33366 14.6666L6.66699 14.6666L6.66699 13.3333L9.33366 13.3333Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M4.00032 13.3333L4.00032 14.6666L2.66699 14.6666C1.93061 14.6666 1.33366 14.0696 1.33366 13.3333L1.33366 11.9999L2.66699 11.9999L2.66699 13.3333L4.00032 13.3333Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M2.66699 9.33325L1.33366 9.33325L1.33366 6.66658L2.66699 6.66658L2.66699 7.33496L3.98624 7.33496L3.98624 8.66496L2.66699 8.66496L2.66699 9.33325Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M9.33841 7.33496L6.66232 7.33496L6.66232 8.66496L9.33841 8.66496L9.33841 7.33496Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M8.66577 8.66675L8.66577 7.33342L8.66569 2.66675L7.33236 2.66675L7.33236 7.33341L7.33244 8.66675L7.33236 13.3334L8.66569 13.3334L8.66577 8.66675Z`}}]},Zp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`vertical-border-double-icon`,ref:t,icon:Xp}))});Zp.displayName=`VerticalBorderDoubleIcon`;function Qp(e){let{inputValue:t,rangeString:i,unitId:a,formulaOrRefString:o,worksheet:s,univerInstanceService:c,definedNamesService:l,superTableService:d,functionService:f}=e;if(t===i)return{type:`noop`};let p=l.getValueByName(a,t);if(p)return{type:`focusDefinedName`,definedName:p};if((0,u.isReferenceStringWithEffectiveColumn)(t)){let{range:e}=(0,u.deserializeRangeWithSheet)(t);return!s||!(0,n.isValidRange)(e,s)?{type:`reset`}:{type:`focusSelection`,refString:t}}return(0,r.validateDefinedName)(t,{unitId:a,formulaOrRefString:o,univerInstanceService:c,definedNamesService:l,superTableService:d,functionService:f})===!0?{type:`createDefinedName`,name:t}:{type:`reset`}}function $p(e,t,r){var i;let a=(i=e.getActiveSheet())==null?void 0:i.getName();if(!a||t==null||t.length===0)return``;let o=t.map(e=>(0,u.serializeRangeWithSheet)(a,e.range)).join(`,`);return r.convertRefersToAbsolute(o,n.AbsoluteRefType.ALL,n.AbsoluteRefType.ALL,a)}function em({search:e,isInputEvent:t,onClose:a}){let s=(0,i.useDependency)(n.ICommandService),c=(0,i.useDependency)(n.LocaleService),d=(0,i.useDependency)(u.IDefinedNamesService),f=(0,i.useDependency)(n.IUniverInstanceService),h=(0,i.useDependency)(i.ISidebarService),g=c.getDirection(),_=f.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET).getUnitId(),v=()=>{let e=d.getDefinedNameMap(_);return e?Object.values(e):[]},y=(0,i.useObservable)(()=>d.update$.pipe((0,o.map)(v),(0,o.startWith)(v())),v(),!1,[d,_]);(0,p.useEffect)(()=>{let e,t=h.sidebarOptions$.subscribe(t=>{t.id===`DefinedNameContainer`&&(t.visible||(e!==void 0&&clearTimeout(e),e=setTimeout(()=>{h.sidebarOptions$.next({visible:!1})})))});return()=>{t.unsubscribe(),e!==void 0&&clearTimeout(e)}},[]);let b=(0,p.useMemo)(()=>e&&t?y.filter(t=>t.name.toLowerCase().includes(e.toLowerCase())):y,[e,t,y]),x=(0,p.useRef)(void 0),[S,C]=(0,i.useVirtualList)(b,{containerTarget:x,itemHeight:30,overscan:6}),w=async()=>{a(),await s.executeCommand(Gr.id,{value:`open`})},T=async e=>{let{formulaOrRefString:t,id:n}=e,i=d.getWorksheetByRef(_,t);i&&(i.isSheetHidden()&&await s.executeCommand(r.SetWorksheetShowCommand.id,{unitId:_,subUnitId:i.getSheetId()}),d.focusRange(_,n))};return/* @__PURE__ */ (0,m.jsxs)(`div`,{"data-u-comp":`defined-name-overlay`,dir:g,className:`univer-w-[300px] rtl:univer-text-right`,children:[/* @__PURE__ */ (0,m.jsx)(`div`,{ref:x,className:(0,l.clsx)(`univer-max-h-[360px] univer-min-h-0 univer-overflow-y-auto`,l.scrollbarClassName,{"univer-min-h-[30px]":b.length>0}),...C.containerProps,children:/* @__PURE__ */ (0,m.jsx)(`div`,{style:C.wrapperStyle,children:S.map(({data:e,index:t})=>/* @__PURE__ */ (0,m.jsx)(`li`,{className:`univer-cursor-pointer univer-px-2 univer-transition-colors univer-duration-200 hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-600`,onClick:async()=>{a(),await T(e)},children:/* @__PURE__ */ (0,m.jsxs)(`div`,{"data-u-comp":`defined-name-overlay-row`,className:(0,l.clsx)(`univer-flex univer-items-center univer-gap-2 univer-py-1 rtl:univer-flex-row-reverse`,l.borderBottomClassName),children:[/* @__PURE__ */ (0,m.jsx)(`div`,{"data-u-comp":`defined-name-overlay-name`,className:`univer-min-w-0 univer-flex-1 univer-basis-0 univer-truncate univer-text-sm univer-text-gray-600 rtl:univer-text-right dark:!univer-text-gray-200`,title:e.name,children:e.name}),/* @__PURE__ */ (0,m.jsx)(`div`,{"data-u-comp":`defined-name-overlay-reference`,className:`univer-min-w-0 univer-flex-1 univer-basis-0 univer-truncate univer-text-xs univer-text-gray-400 rtl:univer-text-right`,title:e.formulaOrRefString,children:e.formulaOrRefString})]})},t))})}),/* @__PURE__ */ (0,m.jsxs)(`div`,{"data-u-comp":`defined-name-overlay-footer`,className:`univer-cursor-pointer univer-p-2 univer-transition-colors univer-duration-200 hover:univer-bg-gray-100 rtl:univer-text-right dark:hover:!univer-bg-gray-600`,onClick:w,children:[/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-mb-2 univer-text-sm univer-font-semibold univer-text-gray-600 dark:!univer-text-gray-200`,children:c.t(`sheets-ui.definedName.managerTitle`)}),/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-text-xs univer-text-gray-400`,children:c.t(`sheets-ui.definedName.managerDescription`)})]})]})}function tm({disable:e}){let[t,a]=(0,p.useState)(``),[s,c]=(0,p.useState)(``),d=(0,i.useDependency)(u.IDefinedNamesService),f=(0,i.useDependency)(n.ICommandService),h=(0,i.useDependency)(n.IUniverInstanceService),g=(0,i.useDependency)(r.SheetsSelectionsService),_=(0,i.useDependency)(u.LexerTreeBuilder),v=(0,i.useDependency)(u.ISuperTableService),y=(0,i.useDependency)(u.IFunctionService),b=(0,i.useDependency)(i.ILayoutService),x=(0,i.useDependency)(r.SheetPermissionCheckController),S=Fl(),C=Il(S),w=!!C&&(C.getConfig().type??n.SheetTypes.GRID)===n.SheetTypes.GRID,T=e||!w,E=S==null?void 0:S.getUnitId(),D=(0,i.useDependency)(n.ThemeService),[O,k]=(0,p.useState)(!1),[A,M]=(0,p.useState)(!1),N=(0,p.useRef)(null),P=(0,p.useRef)(null),F=()=>{let e=d.getDefinedNameMap(E);return e?Object.values(e):[]},I=async e=>{let{formulaOrRefString:t,id:n}=e,i=d.getWorksheetByRef(E,t);i&&(i.isSheetHidden()&&await f.executeCommand(r.SetWorksheetShowCommand.id,{unitId:E,subUnitId:i.getSheetId()}),d.focusRange(E,n))},L=e=>{let t=S.getActiveSheet(),n=t.getSheetId();te(t,e).then(e=>{e&&(f.executeCommand(r.SetSelectionsOperation.id,{unitId:E,subUnitId:n,selections:e}),f.executeCommand(mr.id,{range:e[0].range}))})},R=(0,i.useObservable)(()=>d.update$.pipe((0,o.map)(F),(0,o.startWith)(F())),F(),!1,[d,E]);(0,p.useEffect)(()=>{let e=d.currentRange$.subscribe(()=>{let e=g.getCurrentSelections(),t=$p(S,e,_),n=d.getDefinedNameByRefString(E,t);if(n)a(n.name),c(n.name);else{let e=d.getCurrentRangeForString();a(e),c(e)}});return()=>{e.unsubscribe()}},[d,_,g,E,S]);let z=(0,p.useMemo)(()=>(0,n.debounce)(e=>{let t=R.find(t=>t.name.toLowerCase().includes(e.toLowerCase()));t&&!O?k(!0):!t&&O&&k(!1)},100),[R,O]);(0,p.useEffect)(()=>()=>z.cancel(),[z,w]),(0,p.useEffect)(()=>{let e=S==null?void 0:S.activeSheet$.subscribe(()=>k(!1));return()=>e==null?void 0:e.unsubscribe()},[S]);function ee(e){if(T)return;let t=e.target.value.trim();c(t),M(!0),t?z(t):O&&k(!1)}function B(){if(T)return!1;let e=$p(S,g.getCurrentSelections(),_),i=Qp({inputValue:s,rangeString:t,unitId:E,formulaOrRefString:e,worksheet:S.getActiveSheet(),univerInstanceService:h,definedNamesService:d,superTableService:v,functionService:y});switch(i.type){case`noop`:return!0;case`focusDefinedName`:return a(i.definedName.name),c(i.definedName.name),I(i.definedName),!0;case`focusSelection`:return a(i.refString),c(i.refString),L(i.refString),!0;case`createDefinedName`:{if(!e||!x.permissionCheckWithoutRange({workbookTypes:[r.WorkbookEditablePermission]},E))return H(),!1;let t=f.syncExecuteCommand(r.InsertDefinedNameCommand.id,{id:(0,n.generateRandomId)(10),unitId:E,name:i.name,formulaOrRefString:e,localSheetId:r.SCOPE_WORKBOOK_VALUE_DEFINED_NAME});return t?(a(i.name),c(i.name)):H(),!!t}case`reset`:return H(),!1}}function V(e){if(!T){if(e.key===`Enter`){let e=B();M(!1),k(!1),e&&b.focus()}else e.key===`Escape`&&(e.preventDefault(),M(!1),H())}}function H(){c(t)}async function te(e,t){if(!e)return;let n=(0,u.deserializeRangeWithSheet)(t.trim()),{startRow:i,startColumn:a,endRow:o,endColumn:s}=n.range,c=(0,r.getPrimaryForRange)({startRow:i,startColumn:a,endRow:o,endColumn:s},e),l=[];return l.push({range:n.range,style:j(D),primary:c}),l}return/* @__PURE__ */ (0,m.jsxs)(`div`,{ref:N,"data-u-comp":`defined-name`,onMouseDown:e=>{T&&e.preventDefault()},className:`univer-relative univer-box-border univer-flex univer-h-full univer-w-24 univer-border-r-gray-200 univer-py-1.5 univer-transition-all`,children:[/* @__PURE__ */ (0,m.jsx)(`input`,{ref:P,className:(0,l.clsx)(`univer-box-border univer-size-full univer-appearance-none univer-bg-transparent univer-pl-1.5 univer-pr-5 univer-text-gray-900 focus:univer-outline-none dark:!univer-border-r-gray-700 dark:!univer-text-gray-0`,l.borderRightClassName,{"univer-cursor-not-allowed":T}),type:`text`,disabled:T,value:w?s:``,onChange:ee,onKeyDown:V,onBlur:()=>M(!1)}),/* @__PURE__ */ (0,m.jsx)(l.Dropdown,{align:`start`,anchorRef:N,overlay:/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-z-[1001]`,children:/* @__PURE__ */ (0,m.jsx)(em,{search:s,isInputEvent:A,onClose:()=>k(!1)})}),disabled:T,open:!T&&O,onOpenChange:k,onOpenAutoFocus:e=>e.preventDefault(),children:/* @__PURE__ */ (0,m.jsx)(`a`,{className:(0,l.clsx)(`univer-absolute univer-right-0 univer-top-0 univer-flex univer-h-full univer-cursor-pointer univer-items-center univer-justify-center univer-px-1 univer-transition-colors univer-duration-200 hover:univer-bg-gray-100 dark:!univer-text-gray-0 dark:hover:!univer-bg-gray-800`,{"univer-cursor-not-allowed univer-text-gray-300 hover:univer-bg-transparent dark:!univer-text-gray-700":T}),children:/* @__PURE__ */ (0,m.jsx)(Ad,{})})})]})}function nm(e){var s;let{className:u,disableDefinedName:d}=e,f=(0,i.useDependency)(Y),h=(0,i.useObservable)(()=>f.visible$.pipe((0,o.map)(e=>e.visible)),!1,!1,[f]),[g,_]=(0,p.useState)(0),v=(0,i.useDependency)(La),y=(0,i.useDependency)(r.WorksheetProtectionRuleModel),b=(0,i.useDependency)(r.RangeProtectionRuleModel),x=(0,i.useDependency)(r.SheetsSelectionsService),S=(0,i.useDependency)(n.IPermissionService),C=(0,i.useDependency)(r.RangeProtectionCache),w=(0,i.useDependency)(n.ICommandService),T=(0,i.useObservable)(()=>f.currentEditCellState$.pipe((0,o.map)(e=>{var t;return!!(e!=null&&(t=e.documentLayoutObject.documentModel)!=null&&(t=t.getBody())!=null&&(t=t.customBlocks)!=null&&t.length)})),!1,!1,[f]),E=(0,i.useDependency)(i.ComponentManager),D=Fl(),O=Il(D),k=!!O&&(O.getConfig().type??n.SheetTypes.GRID)===n.SheetTypes.GRID,A=(0,i.useObservable)(f.currentEditCellState$),j=Bl(A==null?void 0:A.unitId),M=E.get(P),N=(0,i.useComponentsOfPart)(`formula-aux`),F=(0,i.useDependency)(n.IContextService),I=(0,i.useObservable)((0,p.useMemo)(()=>F.subscribeContextValue$(n.FOCUSING_FX_BAR_EDITOR),[F]),F.getContextValue(n.FOCUSING_FX_BAR_EDITOR)),L=(0,i.useObservable)((0,p.useMemo)(()=>{if(D)return S.getPermissionPoint$(new r.WorkbookEditablePermission(D.getUnitId()).id)},[S,D])),R=(0,p.useRef)(null),z=(0,i.useDependency)(t.IEditorService),ee=(0,i.useConfigValue)(U),B=ee==null?void 0:ee.disableEdit,V=(0,i.useObservable)(()=>D?D.activeSheet$.pipe((0,o.switchMap)(e=>e?(0,o.merge)(y.ruleChange$,b.ruleChange$,x.selectionMoveEnd$,x.selectionSet$).pipe((0,o.switchMap)(()=>{var t,n;let r=D.getUnitId(),i=e.getSheetId();if(!((t=x.getCurrentLastSelection())!=null&&t.range))return o.EMPTY;let a=(n=x.getCurrentLastSelection())==null?void 0:n.primary;return a?(0,o.of)({unitId:r,subUnitId:i,primary:a}):(0,o.of)(null)})):o.EMPTY),(0,o.map)(e=>{if(e){let{unitId:i,subUnitId:a,primary:o}=e;if(y.getRule(i,a)){var t,n;let e=!(((t=S.getPermissionPoint(new r.WorksheetEditPermission(i,a).id))==null?void 0:t.value)??!0);return{viewDisable:!(((n=S.getPermissionPoint(new r.WorksheetViewPermission(i,a).id))==null?void 0:n.value)??!0),editDisable:e}}let{actualRow:s,actualColumn:l}=o,u=C.getCellInfo(i,a,s,l);return{editDisable:!((u==null?void 0:u[c.UnitAction.Edit])??!0),viewDisable:!((u==null?void 0:u[c.UnitAction.View])??!0)}}return{viewDisable:!1,editDisable:!1}})):o.EMPTY,{editDisable:!1,viewDisable:!1},!1,[S,C,b,x,D,y]);(0,p.useEffect)(()=>{let e=()=>{if(!R.current)return;let e=R.current.getBoundingClientRect();v.setPosition(e)};if(R.current){e();let t=new ResizeObserver(e);return t.observe(R.current),()=>t.disconnect()}},[v]);function H(){k&&(_(+(g===0)),setTimeout(()=>{v.handleFoldBtnClick(g===1)},150))}function te(){k&&f.isVisible().visible&&w.executeCommand(X.id,{visible:!1,eventType:a.DeviceInputEventType.Keyboard,keycode:i.KeyCode.ESC,unitId:A.unitId})}function ne(){k&&f.isVisible().visible&&w.executeCommand(X.id,{visible:!1,eventType:a.DeviceInputEventType.PointerDown,unitId:A.unitId})}function re(){k&&v.handleFxBtnClick(!0)}let{viewDisable:ie,editDisable:W}=V,ae=!k||W||!!B,oe=!((L==null?void 0:L.value)??!0),se=ae||oe,ce=ae||T,G=(0,p.useRef)(!1),K=()=>{if(k)try{if(F.setContextValue(n.FOCUSING_FX_BAR_EDITOR,!0),f.isVisible().visible===!1){if(se){z.focus(n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY);return}w.syncExecuteCommand(X.id,{visible:!0,eventType:a.DeviceInputEventType.PointerDown,unitId:A.unitId})||(F.setContextValue(n.FOCUSING_FX_BAR_EDITOR,!1),G.current=!0)}}catch(e){throw F.setContextValue(n.FOCUSING_FX_BAR_EDITOR,!1),G.current=!0,e}},q=()=>{G.current&&setTimeout(()=>{z.blur(!0)},30),G.current=!1},le=(0,r.isCellImage)(A==null||(s=A.documentLayoutObject.documentModel)==null?void 0:s.getSnapshot()),ue=!k||le||ie;return/* @__PURE__ */ (0,m.jsxs)(`div`,{dir:`ltr`,"data-u-comp":`formula-bar`,className:(0,l.clsx)(`univer-box-border univer-flex univer-bg-gray-0 univer-text-gray-900 univer-transition-[height] univer-ease-linear dark:!univer-bg-gray-800`,l.borderBottomClassName,u,{"univer-h-7":g===0,"univer-h-20":g===1,"univer-pointer-events-none":ae}),children:[/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-relative univer-box-border univer-h-full univer-w-[100px]`,children:/* @__PURE__ */ (0,m.jsx)(tm,{disable:h||(d??ae)})}),/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-flex univer-size-full`,children:[/* @__PURE__ */ (0,m.jsx)(`div`,{className:(0,l.clsx)(`univer-py-1.5`,{"univer-cursor-not-allowed univer-text-gray-200":ce}),children:/* @__PURE__ */ (0,m.jsxs)(`div`,{"data-u-comp":`formula-bar-actions`,className:(0,l.clsx)(`univer-relative univer-box-border univer-flex univer-h-full univer-w-20 univer-items-center univer-justify-center univer-text-xs`,l.borderRightClassName),children:[/* @__PURE__ */ (0,m.jsx)(`span`,{className:(0,l.clsx)(`univer-flex univer-items-center univer-justify-center univer-rounded univer-p-1 univer-text-base dark:!univer-text-gray-0`,{"univer-cursor-pointer univer-text-red-600 hover:univer-bg-gray-100 dark:!univer-text-green-400 dark:hover:!univer-bg-gray-700":h}),onClick:te,children:/* @__PURE__ */ (0,m.jsx)(Su,{})}),/* @__PURE__ */ (0,m.jsx)(`span`,{className:(0,l.clsx)(`univer-flex univer-items-center univer-justify-center univer-rounded univer-p-1 univer-text-base dark:!univer-text-gray-0`,{"univer-cursor-pointer univer-text-green-600 hover:univer-bg-gray-100 dark:!univer-text-red-400 dark:hover:!univer-bg-gray-700":h}),onClick:ne,children:/* @__PURE__ */ (0,m.jsx)(bu,{})}),/* @__PURE__ */ (0,m.jsx)(`span`,{className:`univer-flex univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-p-1 univer-text-base hover:univer-bg-gray-100 dark:!univer-text-gray-0 dark:hover:!univer-bg-gray-700`,onClick:re,children:/* @__PURE__ */ (0,m.jsx)(nd,{})})]})}),/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-flex univer-w-full univer-flex-1 univer-overflow-hidden univer-pl-3`,children:[/* @__PURE__ */ (0,m.jsxs)(`div`,{ref:R,className:`univer-relative univer-flex-1 univer-bg-gray-0 dark:!univer-bg-gray-800`,onPointerDown:K,onPointerUp:q,"aria-hidden":!k,style:{pointerEvents:ue?`none`:`auto`,visibility:k?void 0:`hidden`},children:[M&&/* @__PURE__ */ (0,m.jsx)(M,{className:`univer-relative univer-size-full univer-break-words univer-outline-none`,borderless:!0,disableSelectionOnClick:!0,editorId:n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY,initValue:``,onChange:()=>{},isFocus:k&&I,unitId:A==null?void 0:A.unitId,subUnitId:A==null?void 0:A.sheetId,isSupportAcrossSheet:!0,resetSelectionOnBlur:!1,isSingle:!1,keyboardEventConfig:j,onFormulaSelectingChange:(e,t)=>{t&&(e?f.enableForceKeepVisible():f.disableForceKeepVisible())},autoScrollbar:!1,disableContextMenu:!1}),ue&&/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-pointer-events-none univer-relative univer-left-0 univer-top-0 univer-z-[100] univer-size-full univer-cursor-not-allowed univer-bg-gray-0 dark:!univer-bg-gray-800`})]}),/* @__PURE__ */ (0,m.jsx)(`div`,{className:(0,l.clsx)(`univer-flex univer-h-full univer-w-5 univer-cursor-pointer univer-items-center univer-justify-center univer-text-xs univer-text-gray-700 dark:!univer-text-gray-200`,{"univer-cursor-not-allowed univer-text-gray-200 dark:!univer-text-gray-700":ae}),onClick:H,children:/* @__PURE__ */ (0,m.jsx)(Iu,{className:(0,l.clsx)({"univer-rotate-180":g===1})})})]})]}),/* @__PURE__ */ (0,m.jsx)(i.ComponentContainer,{components:N},`formula-aux`)]})}function rm(e){let{children:t,className:n,style:r,disabled:i=!1,onClick:a,...o}=e;return/* @__PURE__ */ (0,m.jsx)(l.Button,{"data-u-comp":`sheet-bar-append-button`,className:n,size:`small`,disabled:i,style:r,variant:`text`,onClick:e=>{i?e.preventDefault():a&&a(e)},...o,children:t})}function im(){let[e,t]=(0,p.useState)([]),[a,o]=(0,p.useState)(!1),s=(0,i.useDependency)(n.IUniverInstanceService),c=(0,i.useDependency)(n.ICommandService),u=(0,i.useDependency)(Nr),d=(0,i.useDependency)(r.WorksheetProtectionRuleModel),f=(0,i.useObservable)(()=>s.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET),null,!1,[]),h=e=>{let{sheetId:t}=e;t&&f&&(e.hidden?c.executeCommand(r.SetWorksheetShowCommand.id,{unitId:f.getUnitId(),subUnitId:t}):e.selected||c.executeCommand(r.SetWorksheetActivateCommand.id,{unitId:f.getUnitId(),subUnitId:t}),o(!1))},g=(0,p.useCallback)(()=>{if(!f)return;let e=f.getSheets(),r=f.getActiveSheet(),i=e.filter(e=>e.getHiddenState()!==n.WorksheetHiddenState.VERY_HIDDEN).map((e,t)=>({label:e.getName(),index:`${t}`,sheetId:e.getSheetId(),hidden:e.isSheetHidden()===n.BooleanNumber.TRUE,selected:r===e}));t(i)},[f,d]),_=(0,p.useCallback)(()=>c.onCommandExecuted(e=>{switch(e.id){case r.SetWorksheetHideMutation.id:case r.RemoveSheetMutation.id:case r.SetWorksheetNameMutation.id:case r.InsertSheetMutation.id:case r.SetWorksheetOrderMutation.id:case r.SetWorksheetActiveOperation.id:g()}}),[c,g]);function v(){o(!0)}let y=e=>{o(e)};(0,p.useEffect)(()=>{g();let e=new n.DisposableCollection;return e.add(_()),e.add(u.registerSheetBarMenuHandler({handleSheetBarMenu:v})),()=>e.dispose()},[_,u,g,f]);let b=(0,p.useMemo)(()=>e.map(e=>({type:`item`,children:/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-relative univer-box-border univer-overflow-hidden univer-truncate univer-pl-6`,children:[(e.selected||e.hidden)&&/* @__PURE__ */ (0,m.jsxs)(`span`,{className:`univer-absolute univer-left-1 univer-top-0.5`,children:[e.selected&&/* @__PURE__ */ (0,m.jsx)(bu,{className:`univer-size-4 univer-text-primary-600`}),e.hidden&&/* @__PURE__ */ (0,m.jsx)(Wu,{className:`univer-size-4 univer-text-gray-400`})]}),/* @__PURE__ */ (0,m.jsx)(`span`,{className:(0,l.clsx)({"univer-text-primary-600":e.selected}),children:e.label})]}),onSelect:()=>{h(e)}})),[e]);return/* @__PURE__ */ (0,m.jsx)(l.DropdownMenu,{className:`univer-max-w-lg`,align:`start`,items:b,open:a,onOpenChange:y,children:/* @__PURE__ */ (0,m.jsx)(`div`,{children:/* @__PURE__ */ (0,m.jsx)(rm,{children:/* @__PURE__ */ (0,m.jsx)(Eu,{})})})})}function am(e){let{sheetId:t,label:r,color:a,selected:o,className:s,onKeyDown:c,onClick:u,tabIndex:d}=e,f=(0,i.useDependency)(n.ThemeService),p=e=>{let t=f.getColorFromTheme(`gray.900`),r=f.getColorFromTheme(`gray.0`);return new n.ColorKit(e).isDark()?r:t},h=!!o,g=a?p(a):``;return/* @__PURE__ */ (0,m.jsxs)(`div`,{"data-u-comp":`slide-tab-item`,"data-id":t,role:`tab`,"aria-selected":h,tabIndex:d??(h?0:-1),onKeyDown:c,onClick:u,className:(0,l.clsx)(`univer-relative univer-mx-1 univer-box-border univer-flex univer-flex-grow univer-cursor-pointer univer-select-none univer-flex-row univer-items-center univer-justify-center univer-rounded univer-text-xs univer-font-medium univer-transition-[colors,box-shadow] focus-visible:univer-ring-2 focus-visible:univer-ring-primary-500`,{"dark:!univer-text-gray-0":!a||a&&!g,"univer-bg-gray-0 univer-text-primary-700 univer-shadow":h,"dark:!univer-bg-gray-700":h&&!a,"univer-text-gray-900 hover:univer-bg-gray-100":!h,"dark:hover:!univer-bg-gray-700":!h&&!a},s),style:{backgroundColor:!h&&a?a:``,color:!h&&a?g:``,boxShadow:h&&a?`0px 0px 8px rgba(0, 0, 0, 0.08)`:``},children:[/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-box-border univer-flex univer-max-w-lg univer-items-center univer-gap-1 univer-overflow-hidden univer-whitespace-nowrap univer-rounded univer-border-2 univer-border-solid univer-border-transparent univer-px-1.5 univer-py-1`,children:r}),h&&a&&/* @__PURE__ */ (0,m.jsx)(`div`,{"aria-hidden":!0,className:`univer-pointer-events-none univer-absolute univer-inset-x-2 univer-bottom-0 univer-h-0.5`,style:{backgroundColor:a}})]},t)}function om(e){let{children:t,anchorRect:r,showContextMenu:a,visible:o,onCommandSelect:s,onVisibleChange:c}=e,l=(0,p.useRef)(`sheetbar-tabs-context-menu-${(0,n.generateRandomId)(6)}`);return a?/* @__PURE__ */ (0,m.jsxs)(m.Fragment,{children:[t,/* @__PURE__ */ (0,m.jsx)(i.AnchoredContextMenu,{hostId:l.current,visible:o,anchorRect:r,menuType:i.ContextMenuPosition.FOOTER_TABS,anchorVertical:`top`,menuOffset:6,onRequestClose:()=>c(!1),onOptionSelect:e=>{let{label:t,id:n,commandId:r,value:i}=e;s(r??n??t,i)}})]}):t}function sm(e){return e.left+e.width/2}function cm(e,t,n){let r=e.map(()=>0),i=e[t];if(!i)return{targetIndex:t,itemOffsets:r};r[t]=n;let a=i.left+n,o=a+i.width,s=t;if(n>0)for(let n=t+1;n<e.length;n++)o>sm(e[n])&&(r[n]=-i.width,s=n);else if(n<0)for(let n=t-1;n>=0;n--)a<sm(e[n])&&(r[n]=i.width,s=n);return{targetIndex:s,itemOffsets:r}}function lm(e,t,n){if(t===n||t<0||n<0||t>=e.length||n>=e.length)return[...e];let r=[...e],[i]=r.splice(t,1);return r.splice(n,0,i),r}function um(e,t,n){return e.indexOf(t[n])}let dm={easeOutStrong(e,t,n,r){return-n*((e=e/r-1)*e*e*e-1)+t},backOut(e,t,n,r,i){return i===void 0&&(i=.7),n*((e=e/r-1)*e*((i+1)*e+i)+1)+t}},fm={loop:!1,begin:0,end:0,duration:300,delay:0,type:`easeOutStrong`,receive(e){},success(e){},cancel(e){},complete(e){}};var pm=class{constructor(e){z(this,`_config`,void 0),z(this,`_status`,0),z(this,`_start`,0),z(this,`_handle`,0),z(this,`_delayHandle`,null),this._config={...fm,...e},this._config.loop&&(this._config.complete=()=>{},this._config.success=()=>{this.request()})}static success(...e){let t=0;return new Promise(n=>{for(let r=0;r<e.length;r++){let i=e[r],a=i._config,o=a.success;a.loop||(a.success=r=>{t++,o&&o.call(i,r),t===e.length&&n()})}})}request(){this._config.delay===0?(this._status=0,this._start=Date.now(),this._fakeHandle()):(this._delayHandle&&clearTimeout(this._delayHandle),this._delayHandle=setTimeout(()=>{this._status=0,this._start=Date.now(),this._fakeHandle()},this._config.delay))}cancel(){this._status=1,this._delayHandle&&clearTimeout(this._delayHandle),cancelAnimationFrame(this._handle)}_fakeHandle(){let e=Date.now()-this._start;e=e>=this._config.duration?this._config.duration:e;let t=dm[this._config.type](e,this._config.begin,this._config.end-this._config.begin,this._config.duration,.7).toFixed(2);this._config.receive(t),this._status===1?(this._config.cancel(t),this._config.complete(t)):e===this._config.duration?(this._config.success(t),this._config.complete(t)):this._handle=requestAnimationFrame(()=>{this._fakeHandle()})}};function mm(e){return e.textContent??``}function hm(e){setTimeout(()=>{let t=window.getSelection();t&&(t.selectAllChildren(e),t.collapseToEnd())})}function gm(e){setTimeout(()=>{let t=window.getSelection();if(!t)return;let n=document.createRange();n.selectNodeContents(e),mm(e)||n.collapse(!0),t.removeAllRanges(),t.addRange(n)})}function _m(e,t){let n=!0,r=()=>{},i=mm(e),a=e=>{var t;e.preventDefault();let n=(t=e.clipboardData)==null?void 0:t.getData(`text/plain`);if(n){let e=n.replace(/\s/g,``);document.execCommand(`insertText`,!1,e)}},o=n=>{t.checkName(mm(e))||(t.setEditMode(!1),r(),t.beforeCommit(),t.onCommit(mm(e),n))},s=()=>{e.textContent=i,t.setEditMode(!1),r(),t.beforeCommit(),t.onCancel()},c=t=>{t.stopPropagation(),t.key===`Escape`?(t.preventDefault(),s()):t.key===`Enter`&&(e.blur(),t.preventDefault())},l=()=>{n=!1},u=()=>{n=!0},d=()=>{setTimeout(()=>{if(n){let t=mm(e);t.length>31&&(e.textContent=t.substring(0,31),hm(e))}},0)};return r=()=>{e.removeAttribute(`contentEditable`),e.removeEventListener(`focusout`,o),e.removeEventListener(`compositionstart`,l),e.removeEventListener(`compositionend`,u),e.removeEventListener(`input`,d),e.removeEventListener(`keydown`,c),e.removeEventListener(`paste`,a)},{blurAction:o,compositionstartAction:l,compositionendAction:u,inputAction:d,keydownAction:c,pasteAction:a,cleanup:r}}function vm(e){if(!e.canStart())return;let t=e.slideTabItem.querySelector(`span`);if(!t)return;let n=_m(t,e);t.setAttribute(`contentEditable`,`true`),t.addEventListener(`focusout`,n.blurAction),t.addEventListener(`compositionstart`,n.compositionstartAction),t.addEventListener(`compositionend`,n.compositionendAction),t.addEventListener(`input`,n.inputAction),t.addEventListener(`keydown`,n.keydownAction),t.addEventListener(`paste`,n.pasteAction),e.setEditMode(!0),gm(t)}var ym=class e{constructor(e,t){z(this,`_slideTabItem`,void 0),z(this,`_animate`,void 0),z(this,`_midline`,0),z(this,`_translateX`,void 0),z(this,`_scrollbar`,void 0),z(this,`_slideTabBar`,void 0),z(this,`_editMode`,void 0),z(this,`_placeholder`,void 0),this._slideTabItem=e,this._animate=null,this._translateX=0,this._editMode=!1,this._slideTabBar=t,this._placeholder=null,this._scrollbar=t.getScrollbar(),this.update()}static midline(e){return e.getBoundingRect().x+e.getBoundingRect().width/2}static leftLine(e){return e.getBoundingRect().x}static rightLine(e){return e.getBoundingRect().x+e.getBoundingRect().width}static make(t,n){let r=[];return t.forEach(t=>r.push(new e(t,n))),r}getSlideTabItem(){return this._slideTabItem}getEditor(){return this._slideTabItem.querySelector(`span`)}focus(){var e;(e=this.getEditor())==null||e.focus()}selectAll(){let e=this.getEditor();e&&xm.keepSelectAll(e)}isEditMode(){return this._editMode}classList(){return this._slideTabItem.classList}translateX(e){return this._translateX=e,this._slideTabItem.style.transform=`translateX(${e}px)`,this.getTranslateXDirection()}setEditor(e){this._editMode||vm({slideTabItem:this._slideTabItem,canStart:()=>this._slideTabBar.getConfig().onNameChangeCheck(),checkName:e=>this._slideTabBar.getConfig().onNameCheckAlert(e,this.getId()),setEditMode:e=>{this._editMode=e},beforeCommit:()=>{this._slideTabBar.removeListener(),this._slideTabBar.updateItems()},onCommit:(t,n)=>{try{this._slideTabBar.getConfig().onChangeName(this.getId(),t),e&&e(n)}finally{this._slideTabBar.addListener()}},onCancel:()=>{this._slideTabBar.addListener()}})}nameCheck(){let e=this._slideTabItem.querySelector(`span`);if(!e)return!1;let t=e.textContent??``;return this._slideTabBar.getConfig().onNameCheckAlert(t,this.getId())}animate(){return{translateX:e=>{this._translateX!==e&&(this._animate&&=(this._animate.cancel(),null),this._animate=new pm({begin:this._translateX,end:e,receive:e=>{this._slideTabItem.style.transform=`translateX(${e}px)`}}),this._translateX=e,this._animate.request())},cancel:()=>{this._animate&&=(this._animate.cancel(),null)}}}after(e){this._slideTabItem.after(e._slideTabItem||e)}update(){this._midline=e.midline(this)}disableFixed(){if(this._placeholder){let e=this._slideTabBar.primeval();this._slideTabItem.style.removeProperty(`position`),this._slideTabItem.style.removeProperty(`left`),this._slideTabItem.style.removeProperty(`top`),this._slideTabItem.style.removeProperty(`width`),this._slideTabItem.style.removeProperty(`height`),this._slideTabItem.style.removeProperty(`background`),this._slideTabItem.style.removeProperty(`padding`),this._slideTabItem.style.removeProperty(`box-sizing`),this._slideTabItem.style.removeProperty(`font-size`),this._slideTabItem.style.removeProperty(`font-family`),this._slideTabItem.style.removeProperty(`font-weight`),this._slideTabItem.style.removeProperty(`color`),this._slideTabItem.style.removeProperty(`border-radius`),this._placeholder.after(this._slideTabItem),e.removeChild(this._placeholder),this._placeholder=null}}enableFixed(){let e=document.createElement(`div`),t=this.getBoundingRect(),n=getComputedStyle(this._slideTabItem),r=this._slideTabItem.querySelector(`span`);if(this._placeholder=e,this._placeholder.style.width=`${t.width}px`,this._placeholder.style.height=`${t.height}px`,this._placeholder.style.flexShrink=`0`,this._placeholder.style.margin=n.margin,this._slideTabItem.style.background=n.background,r){let e=getComputedStyle(r).padding;this._slideTabItem.style.padding=e}this._slideTabItem.style.boxSizing=n.boxSizing,this._slideTabItem.style.fontSize=n.fontSize,this._slideTabItem.style.fontFamily=n.fontFamily,this._slideTabItem.style.fontWeight=n.fontWeight,this._slideTabItem.style.color=n.color,this._slideTabItem.style.borderRadius=n.borderRadius,this._slideTabItem.style.left=`${t.x-this.getScrollbar().getScrollX()}px`,this._slideTabItem.style.top=`${t.y}px`,this._slideTabItem.style.width=`${t.width}px`,this._slideTabItem.style.height=`${t.height}px`,this._slideTabItem.style.position=`fixed`,this._slideTabItem.after(e),document.body.appendChild(this._slideTabItem)}addEventListener(e,t,n){this._slideTabItem.addEventListener(e,t,n)}removeEventListener(e,t,n){this._slideTabItem.removeEventListener(e,t,n)}getScrollbar(){return this._scrollbar}getMidLine(){return this._midline}getBoundingRect(){let e=this._slideTabItem.getBoundingClientRect();return e.x+=this._scrollbar.getScrollX(),e}getWidth(){return this.getBoundingRect().width}getTranslateXDirection(){let t=e.midline(this);return t>this._midline?1:t<this._midline?-1:0}equals(e){return e&&e._slideTabItem===this._slideTabItem}getId(){return this._slideTabItem.dataset.id||``}},bm=class{constructor(e){z(this,`_slideTabBar`,void 0),this._slideTabBar=e}scrollX(e){var t;let n=this._slideTabBar.primeval(),r=((t=n.parentElement)==null?void 0:t.clientWidth)??n.clientWidth,i=Math.max(0,n.scrollWidth-r);n.scrollLeft=Math.min(i,Math.max(0,e))}scrollRight(){let e=this._slideTabBar.primeval();this.scrollX(e.scrollWidth)}getScrollX(){return this._slideTabBar.primeval().scrollLeft}},xm=class e{constructor(e){if(z(this,`_activeTabItemIndex`,0),z(this,`_slideTabBar`,void 0),z(this,`_slideTabItems`,[]),z(this,`_config`,void 0),z(this,`_downActionX`,0),z(this,`_moveActionX`,0),z(this,`_compareIndex`,0),z(this,`_activeTabItem`,null),z(this,`_moveAction`,e=>{this._activeTabItem&&(this._moveActionX=e.pageX-this._downActionX,this._moveActionX<=-this._leftMoveX?this._moveActionX=-this._leftMoveX:this._moveActionX>=this._rightMoveX&&(this._moveActionX=this._rightMoveX),this._scrollIncremental=0,this._scrollLeft(e),this._scrollRight(e))}),z(this,`_upAction`,e=>{var t,n,r;if(this._longPressTimer&&=(clearTimeout(this._longPressTimer),null),!this._activeTabItem)return;if(this._activeTabItem.isEditMode()){let t=this._activeTabItem.getSlideTabItem(),n=e.pointerId;n!=null&&t.hasPointerCapture(n)&&t.releasePointerCapture(n),this._activeTabItem.removeEventListener(`pointerup`,this._upAction);return}let i=this._autoScrollTime!==null;this._closeAutoScroll(),this._activeTabItem.disableFixed(),this.updateItems();let a=(t=this._activeTabItem)==null?void 0:t.getSlideTabItem();a&&(a.style.cursor=``,a.releasePointerCapture(e.pointerId),(n=this._activeTabItem)==null||n.removeEventListener(`pointermove`,this._moveAction),(r=this._activeTabItem)==null||r.removeEventListener(`pointerup`,this._upAction),this._config.onSlideEnd&&this._activeTabItemIndex!==this._compareIndex&&i&&(this.removeListener(),this._config.onSlideEnd(e,this._compareIndex||0)),this._scrollIncremental=0,this._downActionX=0,this._moveActionX=0,this._dragStartScrollX=this._slideScrollbar.getScrollX(),this._compareIndex=0)}),z(this,`_downAction`,void 0),z(this,`_wheelAction`,e=>{var t;let n=((t=this._slideTabBar.parentElement)==null?void 0:t.clientWidth)??this._slideTabBar.clientWidth;if(this._slideTabBar.scrollWidth<=n)return;let r=Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY;if(r===0)return;let i=e.deltaMode===WheelEvent.DOM_DELTA_LINE?16:e.deltaMode===WheelEvent.DOM_DELTA_PAGE?n:1;e.preventDefault(),this.setScroll(r*i)}),z(this,`_scrollIncremental`,0),z(this,`_dragStartScrollX`,0),z(this,`_compareDirection`,0),z(this,`_autoScrollTime`,null),z(this,`_slideScrollbar`,void 0),z(this,`_longPressTimer`,null),z(this,`_leftBoundingLine`,0),z(this,`_rightBoundingLine`,0),z(this,`_leftMoveX`,0),z(this,`_rightMoveX`,0),e.slideTabBarContainer==null)throw Error(`not found slide-tab-bar root element`);let t=e.slideTabBarContainer.querySelector(`${e.slideTabBarSelector}`);if(t==null)throw Error(`not found slide-tab-bar`);this._slideTabBar=t,this._slideScrollbar=new bm(this),this._config=e,this._initConfig(),this._downAction=this._createDownAction(),this.addListener()}_createDownAction(){let t=0,n=0,r=0;return i=>{var a,o,s;if((a=this._activeTabItem)!=null&&a.isEditMode())return;this._longPressTimer&&=(clearTimeout(this._longPressTimer),null);let c=(o=i.target)==null||(o=o.closest(this._config.slideTabBarItemSelector))==null?void 0:o.getAttribute(`data-id`),l=this._slideTabItems.findIndex(e=>e.getId()===c);if(c==null||l===-1)return;if(this._activeTabItemIndex!==l){var u,d;(u=this._activeTabItem)==null||u.removeEventListener(`pointermove`,this._moveAction),(d=this._activeTabItem)==null||d.removeEventListener(`pointerup`,this._upAction),this._config.onChangeTab(i,c);return}if(this._compareIndex=l,this._downActionX=i.pageX,this._moveActionX=0,this._scrollIncremental=0,this._dragStartScrollX=this._slideScrollbar.getScrollX(),this._activeTabItem=this._slideTabItems[l],!this._activeTabItem){console.error(`Not found active slide-tab-item in sheet bar`);return}let f=this._activeTabItem.getSlideTabItem();f==null||f.setPointerCapture(i.pointerId),(s=this._activeTabItem)==null||s.addEventListener(`pointerup`,this._upAction);let{x:p,width:m}=this._activeTabItem.getBoundingRect(),{x:h,width:g}=this.getBoundingRect(),_=this._slideScrollbar.getScrollX();if(this._leftBoundingLine=this._downActionX-(p-_),this._rightBoundingLine=p-_+m-this._downActionX,this._leftMoveX=p-h-_,this._rightMoveX=h+g-(p+m)+_,i.button===2||this._hasEditItem())return;let{pageX:v,pageY:y}=i,b=Date.now(),x=b-r<=e.DoubleClickDelay,S=Math.abs(v-t)<10,C=Math.abs(y-n)<10;x&&S&&C&&this._activeTabItem.setEditor(),t=v,n=y,r=b,this._startLongPress(i,f)}}_startLongPress(t,n){this._longPressTimer=setTimeout(()=>{var e,r,i;!n||(e=this._activeTabItem)!=null&&e.isEditMode()||((r=this._activeTabItem)==null||r.enableFixed(),this._startAutoScroll(),n.setPointerCapture(t.pointerId),n.style.cursor=`move`,(i=this._activeTabItem)==null||i.addEventListener(`pointermove`,this._moveAction))},e.LongPressDelay)}static checkedSkipSlide(e){let t=e.target;for(;t!=null&&t!==document.body;){if(t.getAttribute(`data-slide-skip`))return!0;t=t.parentElement}return!1}static keepLastIndex(e){hm(e)}static keepSelectAll(e){gm(e)}update(e){this.removeListener(),this._config.currentIndex=e,this._initConfig(),this.addListener(),this.scrollToItem(e)}primeval(){return this._slideTabBar}updateItems(){for(let e=0;e<this._slideTabItems.length;e++)this._slideTabItems[e].animate().cancel(),this._slideTabItems[e].translateX(0),this._slideTabItems[e].update()}getScrollbar(){return this._slideScrollbar}getConfig(){return this._config}getBoundingRect(){return this._slideTabBar.getBoundingClientRect()}getSlideTabItems(){return this._slideTabItems}getActiveItem(){return this._activeTabItem}isLeftEnd(){return this._slideTabBar.scrollLeft<=1}isRightEnd(){let e=this._slideTabBar.parentElement;return e?Math.max(0,this._slideTabBar.scrollWidth-e.clientWidth)-this._slideTabBar.scrollLeft<=1:!1}addListener(){this._slideTabBar.addEventListener(`wheel`,this._wheelAction,{passive:!1}),this._slideTabItems.forEach(e=>{e.addEventListener(`pointerdown`,this._downAction)})}removeListener(){this._slideTabBar.removeEventListener(`wheel`,this._wheelAction),this._slideTabItems.forEach(e=>{e.removeEventListener(`pointerdown`,this._downAction)})}setScroll(e){this._slideScrollbar.scrollX(this._slideScrollbar.getScrollX()+e),this._config.onScroll({leftEnd:this.isLeftEnd(),rightEnd:this.isRightEnd()})}flipPage(e){if(e>0){let e=this.calculateLeftScrollX(!0);this._slideScrollbar.scrollX(this._slideScrollbar.getScrollX()+e)}else if(e<0){let e=this.calculateRightScrollX(!0);this._slideScrollbar.scrollX(this._slideScrollbar.getScrollX()+e)}this._config.onScroll({leftEnd:this.isLeftEnd(),rightEnd:this.isRightEnd()})}scrollToItem(e){let t=e??this._config.currentIndex;if(t<0||t>=this._slideTabItems.length){console.error(`Index out of bounds`);return}let n=this.calculateTabItemScrollX(t);this._slideScrollbar.scrollX(this._slideScrollbar.getScrollX()+n),this._config.onScroll({leftEnd:this.isLeftEnd(),rightEnd:this.isRightEnd()})}calculateLeftScrollX(e){let t=0;return this._slideTabItems.some(n=>{let r=this._slideTabBar.getBoundingClientRect(),i=r.left+r.width,a=n.getSlideTabItem().getBoundingClientRect(),o=a.left,s=a.width;return o<i&&o+s+8>i&&(t=e?o-r.left-4:o+s-i+4,!0)}),t}calculateRightScrollX(e){let t=0;return this._slideTabItems.some(n=>{let r=this._slideTabBar.getBoundingClientRect(),i=r.left,a=n.getSlideTabItem().getBoundingClientRect(),o=a.left,s=a.width;return o-8<i&&o+s>i&&(t=e?o+s-r.left-r.width+4:o-i-4,!0)}),t}calculateTabItemScrollX(e){let t=0,n=this._slideTabBar.getBoundingClientRect(),r=n.left,i=n.left+n.width,a=this._slideTabItems[e].getSlideTabItem().getBoundingClientRect(),o=a.left,s=a.width;return o-8<r&&(t=o-r-4),o+s+8>i&&(t=o+s-i+4),t}calculateActiveTabItemScrollX(){var e;let t=0,n=this._slideTabBar.getBoundingClientRect(),r=n.left,i=n.left+n.width,a=(e=this._activeTabItem)==null?void 0:e.getSlideTabItem().getBoundingClientRect();if(!a)return 0;let o=a.left,s=a.width;return o-8<r&&o+s>r&&(t=o-r-4),o<i&&o+s+8>i&&(t=o+s-i+4),t}destroy(){this.removeListener(),this._downActionX=0,this._moveActionX=0,this._dragStartScrollX=this._slideScrollbar.getScrollX(),this._compareDirection=0,this._compareIndex=0,this._slideTabItems=[],this._activeTabItem=null}_hasEditItem(){for(let e=0;e<this._slideTabItems.length;e++)if(this._slideTabItems[e].isEditMode())return!0;return!1}_autoScrollFrame(){this._activeTabItem&&(this._slideScrollbar.scrollX(this._slideScrollbar.getScrollX()+this._scrollIncremental),this._updateDragSortState()),this._autoScrollTime=requestAnimationFrame(()=>{this._autoScrollFrame()})}_startAutoScroll(){this._autoScrollTime??this._autoScrollFrame()}_closeAutoScroll(){this._autoScrollTime&&cancelAnimationFrame(this._autoScrollTime),this._autoScrollTime=null}_scrollLeft(e){let t=this.getBoundingRect(),n=e.pageX-t.x;n<this._leftBoundingLine&&(this._scrollIncremental=-Math.min(Math.abs(n-this._leftBoundingLine)*.1,50))}_scrollRight(e){let t=this.getBoundingRect(),n=e.pageX-t.x;n>t.width-this._rightBoundingLine&&(this._scrollIncremental=Math.min(Math.abs(n-(t.width-this._rightBoundingLine))*.1,50))}_sortedItems(){if(this._activeTabItem!=null&&this._activeTabItemIndex!=null&&this._compareIndex!=null&&(this._slideTabItems=lm(this._slideTabItems,this._activeTabItemIndex,this._compareIndex),this._config.slideTabBarItemAutoSort))for(let e=0;e<this._slideTabItems.length;e++){let t=this._slideTabItems[e],n=this._slideTabItems[e+1];n&&t.after(n)}}_compareLeft(){this._updateDragSortState()}_compareRight(){this._updateDragSortState()}_updateDragSortState(){if(!this._activeTabItem)return;let e=this._moveActionX+this._slideScrollbar.getScrollX()-this._dragStartScrollX,t=cm(this._slideTabItems.map(e=>({id:e.getId(),left:e.getMidLine()-e.getWidth()/2,width:e.getWidth()})),this._activeTabItemIndex,e);this._compareIndex=t.targetIndex,t.itemOffsets.forEach((e,t)=>{let n=this._slideTabItems[t];n&&(n.equals(this._activeTabItem)?this._compareDirection=n.translateX(this._moveActionX):n.animate().translateX(e))})}_initConfig(){let e=this._slideTabBar.querySelectorAll(`${this._config.slideTabBarItemSelector}`);this._downActionX=0,this._moveActionX=0,this._compareDirection=0,this._compareIndex=0,this._slideTabItems=ym.make(e,this),this._activeTabItemIndex=this._config.currentIndex,this._activeTabItem=this._slideTabItems[this._activeTabItemIndex]}};z(xm,`LongPressDelay`,500),z(xm,`DoubleClickDelay`,300);function Sm({childType:e}){let t=`univer-size-4 univer-shrink-0`;switch(e){case n.UniverInstanceType.UNIVER_SHEET:return/* @__PURE__ */ (0,m.jsx)(kf,{"aria-hidden":!0,className:t});case n.UniverInstanceType.UNIVER_DOC:return/* @__PURE__ */ (0,m.jsx)(Df,{"aria-hidden":!0,className:t});case n.UniverInstanceType.UNIVER_SLIDE:return/* @__PURE__ */ (0,m.jsx)(jf,{"aria-hidden":!0,className:t});case n.UniverInstanceType.UNIVER_BASE:return/* @__PURE__ */ (0,m.jsx)(Cf,{"aria-hidden":!0,className:t});case n.UniverInstanceType.UNIVER_BOARD:return/* @__PURE__ */ (0,m.jsx)(Tf,{"aria-hidden":!0,className:t});default:return null}}function Cm(){let e=(0,i.useDependency)(n.Injector),[t,a]=(0,p.useState)([]),[s,c]=(0,p.useState)(``),[l,u]=(0,p.useState)(``),[d,f]=(0,p.useState)(!1),[h,g]=(0,p.useState)(null),_=(0,p.useRef)(null),v=(0,p.useRef)(null),y=(0,i.useDependency)(n.ICommandService),b=(0,i.useDependency)(i.ILayoutService),x=(0,i.useDependency)(Nr),S=(0,i.useDependency)(n.LocaleService),C=(0,i.useDependency)(n.IConfirmService),w=(0,i.useDependency)(Y,n.Quantity.OPTIONAL),T=(0,i.useDependency)(r.WorksheetProtectionRuleModel),E=(0,i.useDependency)(r.RangeProtectionRuleModel),D=(0,i.useDependency)(n.IPermissionService),O=Fl(),k=(0,i.useObservable)(T.resetOrder$),A=(0,i.useConfigValue)(i.UI_PLUGIN_CONFIG_KEY),j=(A==null?void 0:A.contextMenu)??!0,M=(0,p.useCallback)(()=>{var e;let t=(e=_.current)==null||(e=e.getActiveItem())==null?void 0:e.getSlideTabItem().getBoundingClientRect();return t?{left:t.left,top:t.top,bottom:t.bottom}:null},[]),N=(0,p.useCallback)(()=>{setTimeout(()=>{var e;let t=(e=_.current)==null?void 0:e.getActiveItem();t&&(t.focus(),t.selectAll())},0)},[]),P=(0,p.useCallback)((e,t)=>{C.open({id:e,title:{title:S.t(`sheets-ui.sheetConfig.sheetNameErrorTitle`)},children:{title:t},cancelText:S.t(`sheets-ui.button.cancel`),confirmText:S.t(`sheets-ui.button.confirm`),onClose(){N(),C.close(e)},onConfirm(){N(),C.close(e)}})},[C,N,S]),F=(0,p.useCallback)(e=>e.trim()===``&&(P(`sheetNameEmptyAlert`,S.t(`sheets-ui.sheetConfig.sheetNameCannotIsEmptyError`)),!0),[S,P]),I=(0,p.useCallback)(e=>!(0,n.nameCharacterCheck)(e)&&(P(`sheetNameSpecCharAlert`,S.t(`sheets-ui.sheetConfig.sheetNameSpecCharError`)),!0),[S,P]),L=(0,p.useCallback)((e,t)=>{var n,r;if((t?(n=O.getSheetBySheetId(t))==null?void 0:n.getName():(r=O.getActiveSheet())==null?void 0:r.getName())===e||!O.checkSheetName(e))return!1;let i=`sheetNameRepeatAlert`;return C.open({id:i,title:{title:S.t(`sheets-ui.sheetConfig.sheetNameErrorTitle`)},children:{title:S.t(`sheets-ui.sheetConfig.sheetNameAlreadyExistsError`)},cancelText:S.t(`sheets-ui.button.cancel`),confirmText:S.t(`sheets-ui.button.confirm`),onClose(){C.close(i),N()},onConfirm(){C.close(i),N()}}),!0},[C,N,S,O]),R=(0,p.useCallback)(()=>{var e;let t=O.getUnitId(),n=O.getActiveSheet();if(!n)return!1;let i=n.getSheetId(),a=T.getRule(t,i),o=E.getSubunitRuleList(t,i).length>0;if(a||o){var s;return((s=D.getPermissionPoint(new r.WorkbookManageCollaboratorPermission(t).id))==null?void 0:s.value)??!1}return((e=D.getPermissionPoint(new r.WorkbookRenameSheetPermission(t).id))==null?void 0:e.value)??!1},[D,E,O,T]),z=(0,p.useCallback)(()=>{let t=O.getActiveSheet(),n=(t==null?void 0:t.getSheetId())??``,r=e.has(Pl)?e.get(Pl):void 0,i=O.getSheets().filter(e=>!e.isSheetHidden()).map((e,n)=>{var i;let a=T.getRule(O.getUnitId(),e.getSheetId()),o=E.getSubunitRuleList(O.getUnitId(),e.getSheetId()).length>0,s=!!(a!=null&&a.permissionId||o),c=Ml(e.getConfig()),l=(c==null?void 0:c.childType)??(c?r==null||(i=r.getSheetTabChildType)==null?void 0:i.call(r,{hostUnitId:O.getUnitId(),hostAnchorId:c.hostAnchorId,embedId:c.embedId}):void 0);return{sheetId:e.getSheetId(),label:/* @__PURE__ */ (0,m.jsxs)(m.Fragment,{children:[l!=null&&/* @__PURE__ */ (0,m.jsx)(Sm,{childType:l}),s&&/* @__PURE__ */ (0,m.jsx)(wd,{className:`univer-shrink-0`}),/* @__PURE__ */ (0,m.jsx)(`span`,{className:`univer-min-w-px univer-truncate univer-outline-none`,children:e.getName()})]}),index:n,selected:t===e,color:e.getTabColor()??void 0}});a(i),c(n)},[e,E,O,T]),ee=(0,p.useCallback)(()=>{var e;(e=_.current)==null||(e=e.getActiveItem())==null||e.setEditor()},[]),B=(0,p.useCallback)(({leftEnd:e,rightEnd:t})=>{u(e&&t?``:e?`inset -10px 0px 10px -10px rgba(0, 0, 0, 0.2)`:t?`inset 10px 0px 10px -10px rgba(0, 0, 0, 0.2)`:`inset 10px 0px 10px -10px rgba(0, 0, 0, 0.2), inset -10px 0px 10px -10px rgba(0, 0, 0, 0.2)`)},[]),V=(0,p.useCallback)(e=>{let t=e.calculateActiveTabItemScrollX();if(t){let n=e.getScrollbar();n.scrollX(n.getScrollX()+t)}x.setScroll({leftEnd:e.isLeftEnd(),rightEnd:e.isRightEnd()})},[x]),H=(0,p.useCallback)(e=>{var t;!e||e===s||(t=_.current)!=null&&(t=t.getActiveItem())!=null&&t.isEditMode()||y.executeCommand(r.SetWorksheetActiveOperation.id,{subUnitId:e,unitId:O.getUnitId()}).then(e=>{e!==!1&&requestAnimationFrame(()=>b.focus(O.getUnitId()))})},[s,y,b,O]),te=(0,p.useCallback)(e=>{var t;let n=(t=v.current)==null?void 0:t.querySelector(`[data-u-comp=slide-tab-bar]`);if(!n)return;let r=new ResizeObserver(()=>{V(e)});return r.observe(n),()=>r.disconnect()},[V]),U=(0,p.useCallback)(e=>{j&&(w!=null&&w.isForceKeepVisible()||(g(e),f(!0)))},[w,j]),ne=(0,p.useCallback)(e=>{if(!e){f(!1);return}let t=M();t&&U(t)},[M,U]),re=(0,p.useCallback)((e,t)=>{y.executeCommand(e,{value:t,subUnitId:s}),f(!1)},[s,y]);(0,p.useEffect)(()=>{if(!d)return;let e=()=>{let e=M();e&&g(e)};return window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},[d,M]);let ie=(0,p.useCallback)(e=>{var t;if(e.preventDefault(),(t=_.current)!=null&&(t=t.getActiveItem())!=null&&t.isEditMode())return;let n=e.target.closest(`[data-u-comp=slide-tab-item]`),i=n==null?void 0:n.dataset.id;if(!i||!n)return;let a=n.getBoundingClientRect(),o={left:a.left,top:a.top,bottom:a.bottom};i===s?U(o):y.executeCommand(r.SetWorksheetActiveOperation.id,{unitId:O.getUnitId(),subUnitId:i}).finally(()=>{U(o)})},[s,y,U,O]),W=(0,p.useCallback)(e=>{var t;let n=e.target;if(n.closest(`[contenteditable=true]`))return;let r=n.closest(`[data-u-comp=slide-tab-item]`),i=r==null?void 0:r.dataset.id;if(!i)return;if(e.key===`Enter`||e.key===` `){e.preventDefault(),H(i);return}if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`)return;let a=Array.from(((t=v.current)==null?void 0:t.querySelectorAll(`[data-u-comp=slide-tab-item]`))??[]),o=a.findIndex(e=>e.dataset.id===i);if(o<0)return;e.preventDefault();let s=a[e.key===`ArrowRight`?Math.min(a.length-1,o+1):Math.max(0,o-1)],c=s==null?void 0:s.dataset.id;s&&c&&(s.focus(),H(c))},[H]),ae=(0,p.useCallback)(()=>{let e=new xm({slideTabBarSelector:`[data-u-comp=slide-tab-bar]`,slideTabBarItemSelector:`[data-u-comp=slide-tab-item]`,slideTabBarItemAutoSort:!0,slideTabBarContainer:v.current,currentIndex:0,onChangeName:(e,t)=>{var n;((n=O.getSheetBySheetId(e))==null?void 0:n.getName())===t?z():y.executeCommand(r.SetWorksheetNameCommand.id,{subUnitId:e,name:t})},onSlideEnd:async(e,t)=>{let n=um(O.getSheetOrders(),O.getUnhiddenWorksheets(),t);await y.executeCommand(r.SetWorksheetOrderCommand.id,{order:n})},onChangeTab:(e,t)=>{y.executeCommand(r.SetWorksheetActiveOperation.id,{subUnitId:t,unitId:O.getUnitId()})},onScroll:e=>{x.setScroll(e)},onNameCheckAlert:(e,t)=>F(e)||I(e)||L(e,t),onNameChangeCheck:R});return _.current=e,{slideTabBar:e,disconnectResizeObserver:te(e)}},[R,y,F,L,te,x,I,z,O]);return(0,p.useEffect)(()=>{let{slideTabBar:e,disconnectResizeObserver:t}=ae(),n=y.onCommandExecuted(e=>{switch(e.id){case r.SetTabColorMutation.id:case r.SetWorksheetHideMutation.id:case r.RemoveSheetMutation.id:case r.SetWorksheetNameMutation.id:case r.InsertSheetMutation.id:case r.SetWorksheetOrderMutation.id:case r.SetWorksheetActiveOperation.id:z()}}),i=x.scroll$.subscribe(B),a=x.scrollX$.subscribe(e=>{var t;(t=_.current)==null||t.flipPage(e)}),o=x.renameId$.subscribe(()=>{ee()}),s=O.activeSheet$.subscribe(()=>{z()});return()=>{n.dispose(),e.destroy(),_.current=null,i.unsubscribe(),a.unsubscribe(),o.unsubscribe(),s.unsubscribe(),t==null||t()}},[y,ae,k,ee,x,B,z,O]),(0,p.useEffect)(()=>{var e;if(!t.length)return;let n=t.findIndex(e=>e.sheetId===s);(e=_.current)==null||e.update(n>=0?n:0)},[s,t]),(0,p.useEffect)(()=>{let e=e=>{let t=v.current,n=e.target;if(!t||!(n instanceof Element))return;let r=n.closest(`[data-u-comp=slide-tab-item]`);r&&t.contains(r)&&H(r.getAttribute(`data-id`)??void 0)};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[H]),(0,p.useEffect)(()=>{let e=(0,o.merge)(T.ruleChange$,E.ruleChange$).subscribe(()=>{z()});return()=>{e.unsubscribe()}},[E,z,T]),!j&&d&&f(!1),/* @__PURE__ */ (0,m.jsx)(om,{showContextMenu:j,visible:d,anchorRect:h,onVisibleChange:ne,onCommandSelect:re,children:/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-max-w-[calc(100%-112px)] univer-overflow-hidden`,ref:v,onDragStart:e=>e.preventDefault(),onContextMenu:ie,children:/* @__PURE__ */ (0,m.jsx)(`div`,{"data-u-comp":`slide-tab-bar`,role:`tablist`,"aria-label":S.t(`sheets-ui.sheetConfig.sheetTabs`),onKeyDown:W,className:`univer-flex univer-select-none univer-flex-row univer-items-center univer-overflow-hidden univer-px-1.5 univer-py-1`,style:{boxShadow:l},children:t.map(e=>/* @__PURE__ */ (0,m.jsx)(am,{...e,selected:s===e.sheetId},e.sheetId))})})})}let wm=()=>{var e,t;let[a,o]=(0,p.useState)(!0),[s,c]=(0,p.useState)(!0),l=(0,i.useDependency)(n.ICommandService),u=(0,i.useDependency)(Nr),d=(0,i.useDependency)(n.IPermissionService),f=Fl().getUnitId(),h=(0,i.useObservable)(d.getPermissionPoint$((e=new r.WorkbookEditablePermission(f))==null?void 0:e.id)),g=(0,i.useObservable)(d.getPermissionPoint$((t=new r.WorkbookCreateSheetPermission(f))==null?void 0:t.id)),_=(0,i.useConfigValue)(U),{show:v=!0,defaultRowCount:y=n.DEFAULT_WORKSHEET_ROW_COUNT,defaultColumnCount:b=n.DEFAULT_WORKSHEET_COLUMN_COUNT}=((_==null?void 0:_.footer)||{}).addSheetButtonConfig||{},x=e=>{let{leftEnd:t,rightEnd:n}=e;o(t),c(n)};return(0,p.useEffect)(()=>{let e=u.scroll$.subscribe((0,n.throttle)(e=>{x(e)},100));return()=>{e.unsubscribe()}},[u.scroll$]),/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-relative univer-flex univer-h-full univer-min-w-0 univer-flex-1`,children:[/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-flex univer-items-center`,children:[v&&/* @__PURE__ */ (0,m.jsx)(rm,{className:`univer-mr-2`,onClick:()=>{l.executeCommand(r.InsertSheetCommand.id,{sheet:{rowCount:y,columnCount:b}}),setTimeout(()=>{u.setAddSheet(0)},0)},disabled:!(g!=null&&g.value&&h!=null&&h.value),children:/* @__PURE__ */ (0,m.jsx)(ud,{})}),/* @__PURE__ */ (0,m.jsx)(im,{})]}),/* @__PURE__ */ (0,m.jsx)(Cm,{}),(!a||!s)&&/* @__PURE__ */ (0,m.jsxs)(`div`,{"data-u-comp":`sheet-bar-scroll-buttons`,className:`univer-relative univer-flex univer-items-center univer-px-2 after:univer-absolute after:univer-right-0 after:univer-top-1/2 after:univer-h-4 after:univer-w-px after:-univer-translate-y-1/2 after:univer-bg-gray-200 after:univer-content-[""] rtl:univer-flex-row-reverse rtl:after:univer-left-0 rtl:after:univer-right-auto`,children:[/* @__PURE__ */ (0,m.jsx)(rm,{disabled:a,onClick:()=>{u.setScrollX(-100)},children:/* @__PURE__ */ (0,m.jsx)(Md,{})}),/* @__PURE__ */ (0,m.jsx)(rm,{disabled:s,onClick:()=>{u.setScrollX(100)},children:/* @__PURE__ */ (0,m.jsx)(Pd,{})})]})]})},Tm=[50,75,100,125,150,175,200,400];function Em(){let e=(0,i.useDependency)(n.ICommandService),t=(0,i.useDependency)(n.IUniverInstanceService),a=Fl(),o=(0,i.useDependency)(Y),s=(0,i.useObservable)(o.visible$),c=(0,p.useCallback)(()=>{if(!a)return 100;let e=a.getActiveSheet(),t=e&&e.getZoomRatio()*100||100;return Math.round(t)},[a]),[l,u]=(0,p.useState)(()=>c());(0,p.useEffect)(()=>(u(c()),e.onCommandExecuted(e=>{if(e.id===Ar.id||e.id===r.SetWorksheetActiveOperation.id){let e=c();u(e)}}).dispose),[e,c]);function d(r){u(r);let i=t.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET),a=i==null?void 0:i.getActiveSheet();if(a==null)return;let o=r/100;e.executeCommand(Mr.id,{unitId:i.getUnitId(),subUnitId:a.getSheetId(),zoomRatio:o})}let f=(s==null?void 0:s.visible)&&(s.unitId===(a==null?void 0:a.getUnitId())||s.unitId===n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY);return/* @__PURE__ */ (0,m.jsx)(i.Slider,{disabled:f,min:M[0],value:l,shortcuts:Tm,onChange:d})}function Dm(){return/* @__PURE__ */ (0,m.jsx)(`section`,{className:`univer-flex univer-flex-shrink-0 univer-justify-end`,children:/* @__PURE__ */ (0,m.jsx)(Em,{})})}let Om=[u.FUNCTION_NAMES_MATH.SUM,u.FUNCTION_NAMES_STATISTICAL.AVERAGE,u.FUNCTION_NAMES_STATISTICAL.MIN,u.FUNCTION_NAMES_STATISTICAL.MAX],km={[u.FUNCTION_NAMES_MATH.SUM]:`sheets-ui.statusbar.sum`,[u.FUNCTION_NAMES_STATISTICAL.AVERAGE]:`sheets-ui.statusbar.average`,[u.FUNCTION_NAMES_STATISTICAL.MIN]:`sheets-ui.statusbar.min`,[u.FUNCTION_NAMES_STATISTICAL.MAX]:`sheets-ui.statusbar.max`,[u.FUNCTION_NAMES_STATISTICAL.COUNT]:`sheets-ui.statusbar.count`,[u.FUNCTION_NAMES_STATISTICAL.COUNTA]:`sheets-ui.statusbar.countA`,[u.FUNCTION_NAMES_TEXT.CONCATENATE]:`concatenate`};function Am(e){let{pattern:t,value:r}=e;return typeof r==`number`?t&&Om.includes(e.name)?n.numfmt.format(t,r,{throws:!1}):r.toLocaleString():0}let jm=()=>{let e=(0,i.useDependency)(n.LocaleService),t=(0,i.useDependency)(Vo),[r,a]=(0,p.useState)(u.FUNCTION_NAMES_MATH.SUM),[o,s]=(0,p.useState)(!1),[c,d]=(0,p.useState)(()=>t.getFunctions().map(e=>({name:e.func,value:0,show:!0,disable:!0,pattern:null})));(0,p.useEffect)(()=>{let e=t.state$.subscribe(e=>{let t=(e==null?void 0:e.values)??[];d(n=>n.map(n=>{let r=t.find(e=>e.func===n.name);return{...n,value:(r==null?void 0:r.value)??n.value,disable:!r,pattern:(e==null?void 0:e.pattern)??null}}))});return()=>e.unsubscribe()},[t]);let f=c.filter(e=>e.show&&!e.disable),h=f.find(e=>e.name===r)??f.find(e=>e.name===u.FUNCTION_NAMES_MATH.SUM)??f[0];if(!h)return null;let g=t=>{let n=km[t.name]||t.name;return`${e.t(n)}: ${Am(t)}`},_=e=>{a(e),s(!1)};return/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-relative univer-box-border univer-flex univer-h-full univer-min-w-0 univer-max-w-64 univer-items-center univer-overflow-hidden univer-px-2 after:univer-absolute after:univer-right-0 after:univer-top-1/2 after:univer-block after:univer-h-4 after:univer-w-px after:-univer-translate-y-1/2 after:univer-bg-gray-200 after:univer-content-[""]`,children:/* @__PURE__ */ (0,m.jsx)(l.Dropdown,{align:`end`,side:`top`,open:o,onOpenChange:s,overlay:/* @__PURE__ */ (0,m.jsx)(`div`,{"data-u-comp":`status-bar-statistic-menu`,className:`univer-grid univer-w-max univer-max-w-[calc(100vw-16px)] univer-gap-0.5 univer-p-1.5`,children:f.map(e=>{let t=g(e),n=e.name===h.name;return/* @__PURE__ */ (0,m.jsxs)(`button`,{type:`button`,className:(0,l.clsx)(`univer-flex univer-cursor-pointer univer-items-center univer-gap-2 univer-rounded univer-border-none univer-bg-transparent univer-px-2 univer-py-1.5 univer-text-left univer-text-xs univer-text-gray-900 hover:univer-bg-gray-100 dark:!univer-text-gray-200 dark:hover:!univer-bg-gray-800`,{"univer-bg-gray-100 dark:!univer-bg-gray-800":n}),"aria-pressed":n,onClick:()=>_(e.name),children:[/* @__PURE__ */ (0,m.jsx)(`span`,{className:`univer-w-3 univer-shrink-0`,children:n&&/* @__PURE__ */ (0,m.jsx)(bu,{})}),/* @__PURE__ */ (0,m.jsx)(l.Tooltip,{title:t,placement:`top`,children:/* @__PURE__ */ (0,m.jsx)(`span`,{className:`univer-min-w-0 univer-flex-1 univer-truncate`,children:t})})]},e.name)})}),children:/* @__PURE__ */ (0,m.jsxs)(`button`,{type:`button`,"data-u-comp":`status-bar-statistic-picker`,className:`univer-flex univer-min-w-0 univer-max-w-full univer-cursor-pointer univer-items-center univer-gap-1 univer-border-none univer-bg-transparent univer-p-0 univer-text-xs univer-text-gray-400`,children:[/* @__PURE__ */ (0,m.jsx)(l.Tooltip,{title:g(h),placement:`top`,children:/* @__PURE__ */ (0,m.jsx)(`span`,{className:`univer-min-w-0 univer-flex-1 univer-truncate`,children:g(h)})}),/* @__PURE__ */ (0,m.jsx)(Ad,{className:`univer-shrink-0`})]})})})};function Mm(){let e=(0,i.useConfigValue)(U),t=(0,i.useDependency)(i.IMenuManagerService),r=(e==null?void 0:e.footer)??!0,a=Lm(),o=Im(a),s=Rm(),c=zm(a);if(!a||!r||o||s!==n.UniverInstanceType.UNIVER_SHEET&&!c)return null;let l=t.getMenuByPositionKey(i.ContextMenuPosition.FOOTER_MENU),{sheetBar:u=!0,statisticBar:d=!0,menus:f=!0,zoomSlider:p=!0}=(e==null?void 0:e.footer)||{},h=!c&&d,g=!c&&f,_=!c&&p;return!u&&!h&&!g&&!_?null:/* @__PURE__ */ (0,m.jsxs)(`section`,{className:`univer-box-border univer-grid univer-w-full univer-grid-flow-col univer-grid-cols-[1fr,auto,auto,auto] univer-items-center univer-justify-between univer-bg-gray-0 univer-px-5 univer-text-gray-900 dark:!univer-bg-gray-900 dark:!univer-text-gray-200`,"data-range-selector":!0,style:{height:36},children:[u&&/* @__PURE__ */ (0,m.jsx)(wm,{}),h&&/* @__PURE__ */ (0,m.jsx)(jm,{}),g&&l.length>0&&/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-box-border univer-flex univer-gap-2 univer-px-2`,children:l.map(e=>{var t;return(t=e.children)==null?void 0:t.map(e=>(e==null?void 0:e.item)&&/* @__PURE__ */ (0,m.jsx)(i.ToolbarItem,{...e.item},e.key))})}),_&&/* @__PURE__ */ (0,m.jsx)(Dm,{})]})}function Nm(){let e=(0,i.useConfigValue)(U),t=Lm(),r=!!t,a=Im(t),o=Rm(),s=zm(t);return!r||a||s||o!==n.UniverInstanceType.UNIVER_SHEET||(e==null?void 0:e.formulaBar)===!1?null:/* @__PURE__ */ (0,m.jsx)(nm,{})}function Pm(){let e=(0,i.useConfigValue)(U),t=(0,i.useDependency)(i.ComponentManager),r=Fl(),o=Lm(),s=zm(o),c=(0,i.useDependency)(n.Injector),l=Im(r),u=Im(o),d=Rm()===n.UniverInstanceType.UNIVER_SHEET||!!s,f=t.get(`SheetShapeTextEditorContainer`)??t.get(`ShapeTextEditorContainer`),h=t.get(`EMBEDDING_CELL_EDITOR_COMPONENT_KEY`)??Jl;return(0,p.useEffect)(()=>{var e,t,i;if(!o||s||(r==null?void 0:r.getUnitId())!==o.getUnitId()||l||u||!d)return;let f=c.get(n.IUniverInstanceService),p=f.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET),m=c.has(gi)?c.get(gi):void 0,h=m==null?void 0:m.resolveRuntimeScopeByChildUnitId(p==null?void 0:p.getUnitId()),g=p!=null&&(((e=c.get(a.IRenderManagerService).getRenderUnitById(p.getUnitId()))==null?void 0:e.isMainScene)===!1||((t=f.getUnitCreateOptions(p.getUnitId()))==null?void 0:t.embeddedRender)===!0);((p==null?void 0:p.getUnitId())===o.getUnitId()||(h==null?void 0:h.hostUnitId)!==o.getUnitId()&&!g)&&(f.setCurrentUnitForType(o.getUnitId()),f.focusUnit(o.getUnitId()),(i=Bm(c))==null||i.clearTab())},[s,l,r,u,c,d,o]),!o||!d||u?null:s&&o?/* @__PURE__ */ (0,m.jsx)(Fm,{workbook:o,worksheet:s.worksheet}):/* @__PURE__ */ (0,m.jsxs)(m.Fragment,{children:[f&&/* @__PURE__ */ (0,m.jsx)(f,{}),!(e!=null&&e.disableEdit)&&/* @__PURE__ */ (0,m.jsx)(h,{})]})}function Fm(e){let{workbook:t,worksheet:r}=e,a=(0,i.useDependency)(n.Injector),o=Ml(r.getConfig()),s=t.getUnitId(),c=o==null?void 0:o.hostAnchorId,l=o==null?void 0:o.embedId;return(0,p.useEffect)(()=>{if(!l||!c)return;let e=Bm(a);if(e)try{let t=e.mountSheetTab({hostUnitId:s,hostAnchorId:c,embedId:l});return()=>{t==null||t.dispose()}}catch(e){console.warn(`[sheets-ui] failed to mount embedded sheet-tab block`,e)}},[l,c,s,a]),/* @__PURE__ */ (0,m.jsx)(`div`,{"data-embed-sheets-sheet-tab-host":c,className:`univer-absolute univer-inset-0 univer-z-40 univer-bg-gray-0 dark:!univer-bg-gray-900`})}function Im(e){let t=(0,i.useDependency)(n.IUniverInstanceService),r=(0,i.useDependency)(a.IRenderManagerService),s=(0,i.useDependency)(n.Injector),c=s.has(gi)?s.get(gi):void 0,l=(0,i.useObservable)(()=>(0,o.merge)(r.created$,r.disposed$,(c==null?void 0:c.runtimeSessionChanged$)??o.EMPTY),null,!1,[r,c]);return(0,p.useMemo)(()=>{var n,i;return e?(c==null?void 0:c.resolveRuntimeScopeByChildUnitId(e.getUnitId()))!=null||((n=r.getRenderUnitById(e.getUnitId()))==null?void 0:n.isMainScene)===!1||((i=t.getUnitCreateOptions(e.getUnitId()))==null?void 0:i.embeddedRender)===!0:!1},[l,r,c,t,e])}function Lm(){let e=Fl(),t=(0,i.useDependency)(n.Injector),r=(0,i.useDependency)(n.IUniverInstanceService),a=t.has(gi)?t.get(gi):void 0,s=(0,i.useObservable)(()=>(a==null?void 0:a.runtimeSessionChanged$)??o.EMPTY,null,!1,[a]);return(0,p.useMemo)(()=>{if(!e||!a)return e;let t=a.resolveRuntimeScopeByChildUnitId(e.getUnitId());return t!=null&&t.hostUnitId?r.getUnit(t.hostUnitId,n.UniverInstanceType.UNIVER_SHEET)??e:e},[e,r,a,s])}function Rm(){let e=(0,i.useDependency)(i.IWorkbenchService);return(0,i.useObservable)(e.rootUnitType$,null,!0)}function zm(e){let t=Il(e);return t&&Ml(t.getConfig())?{worksheet:t}:void 0}function Bm(e){try{return e.get(Pl)}catch{return}}let Vm={id:r.SheetCopyDownCommand.id,preconditions:e=>_(e),binding:i.KeyCode.D|i.MetaKeys.CTRL_COMMAND},Hm={id:r.SheetCopyRightCommand.id,preconditions:e=>_(e),binding:i.KeyCode.R|i.MetaKeys.CTRL_COMMAND},Um={id:r.SetRowHiddenCommand.id,preconditions:e=>_(e),binding:i.KeyCode.Digit9|i.MetaKeys.CTRL_COMMAND},Wm={id:r.SetColHiddenCommand.id,preconditions:e=>_(e),binding:i.KeyCode.Digit0|i.MetaKeys.CTRL_COMMAND|i.MetaKeys.SHIFT},Gm={id:er.id,description:`sheets-ui.shortcut.sheet.select-below-cell`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_DOWN,priority:100,preconditions:_,staticParameters:{direction:n.Direction.DOWN}},Km={id:er.id,description:`sheets-ui.shortcut.sheet.select-up-cell`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_UP,priority:100,preconditions:_,staticParameters:{direction:n.Direction.UP}},qm={id:er.id,description:`sheets-ui.shortcut.sheet.select-left-cell`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_LEFT,priority:100,preconditions:y,staticParameters:{direction:n.Direction.LEFT}},Jm={id:er.id,description:`sheets-ui.shortcut.sheet.select-right-cell`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_RIGHT,priority:100,preconditions:y,staticParameters:{direction:n.Direction.RIGHT}},Ym={id:tr.id,description:`sheets-ui.shortcut.sheet.select-next-cell`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.TAB,priority:100,preconditions:_,staticParameters:{direction:n.Direction.RIGHT,keycode:i.KeyCode.TAB}},Xm={id:tr.id,description:`sheets-ui.shortcut.sheet.select-previous-cell`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.TAB|i.MetaKeys.SHIFT,priority:100,preconditions:_,staticParameters:{direction:n.Direction.LEFT,keycode:i.KeyCode.TAB}},Zm={id:tr.id,description:`sheets-ui.shortcut.sheet.select-below-cell`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ENTER,priority:100,preconditions:_,staticParameters:{direction:n.Direction.DOWN,keycode:i.KeyCode.ENTER}},Qm={id:tr.id,description:`sheets-ui.shortcut.sheet.select-up-cell`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ENTER|i.MetaKeys.SHIFT,priority:100,preconditions:_,staticParameters:{direction:n.Direction.UP,keycode:i.KeyCode.ENTER}},$m={id:er.id,description:`sheets-ui.shortcut.sheet.select-below-value-cell`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_DOWN|i.MetaKeys.CTRL_COMMAND,preconditions:_,staticParameters:{direction:n.Direction.DOWN,jumpOver:1}},eh={id:er.id,description:`sheets-ui.shortcut.sheet.select-up-value-cell`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_UP|i.MetaKeys.CTRL_COMMAND,preconditions:_,staticParameters:{direction:n.Direction.UP,jumpOver:1}},th={id:er.id,description:`sheets-ui.shortcut.sheet.select-left-value-cell`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_LEFT|i.MetaKeys.CTRL_COMMAND,preconditions:_,staticParameters:{direction:n.Direction.LEFT,jumpOver:1}},nh={id:er.id,description:`sheets-ui.shortcut.sheet.select-right-value-cell`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_RIGHT|i.MetaKeys.CTRL_COMMAND,preconditions:_,staticParameters:{direction:n.Direction.RIGHT,jumpOver:1}},rh={id:nr.id,description:`sheets-ui.shortcut.sheet.expand-selection-down`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_DOWN|i.MetaKeys.SHIFT,preconditions:_,staticParameters:{direction:n.Direction.DOWN}},ih={id:nr.id,description:`sheets-ui.shortcut.sheet.expand-selection-up`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_UP|i.MetaKeys.SHIFT,preconditions:_,staticParameters:{direction:n.Direction.UP}},ah={id:nr.id,description:`sheets-ui.shortcut.sheet.expand-selection-left`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_LEFT|i.MetaKeys.SHIFT,preconditions:_,staticParameters:{direction:n.Direction.LEFT}},oh={id:nr.id,description:`sheets-ui.shortcut.sheet.expand-selection-right`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_RIGHT|i.MetaKeys.SHIFT,preconditions:_,staticParameters:{direction:n.Direction.RIGHT}},sh={id:nr.id,description:`sheets-ui.shortcut.sheet.expand-selection-to-below-gap`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_DOWN|i.MetaKeys.SHIFT|i.MetaKeys.CTRL_COMMAND,preconditions:_,staticParameters:{direction:n.Direction.DOWN,jumpOver:1}},ch={id:nr.id,description:`sheets-ui.shortcut.sheet.expand-selection-to-up-gap`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_UP|i.MetaKeys.SHIFT|i.MetaKeys.CTRL_COMMAND,preconditions:_,staticParameters:{direction:n.Direction.UP,jumpOver:1}},lh={id:nr.id,description:`sheets-ui.shortcut.sheet.expand-selection-to-left-gap`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_LEFT|i.MetaKeys.SHIFT|i.MetaKeys.CTRL_COMMAND,preconditions:_,staticParameters:{direction:n.Direction.LEFT,jumpOver:1}},uh={id:nr.id,description:`sheets-ui.shortcut.sheet.expand-selection-to-right-gap`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_RIGHT|i.MetaKeys.SHIFT|i.MetaKeys.CTRL_COMMAND,preconditions:_,staticParameters:{direction:n.Direction.RIGHT,jumpOver:1}},dh={id:rr.id,description:`sheets-ui.shortcut.sheet.select-all`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.A|i.MetaKeys.CTRL_COMMAND,preconditions:_,staticParameters:{expandToGapFirst:!0,loop:!0}},fh={id:tn.id,description:`sheets-ui.shortcut.sheet.set-bold`,group:`4_sheet-edit`,groupTitle:`sheets-ui.shortcut.sheet-edit`,preconditions:e=>v(e),binding:i.KeyCode.B|i.MetaKeys.CTRL_COMMAND},ph={id:nn.id,description:`sheets-ui.shortcut.sheet.set-italic`,group:`4_sheet-edit`,groupTitle:`sheets-ui.shortcut.sheet-edit`,preconditions:e=>v(e),binding:i.KeyCode.I|i.MetaKeys.CTRL_COMMAND},mh={id:rn.id,description:`sheets-ui.shortcut.sheet.set-underline`,group:`4_sheet-edit`,groupTitle:`sheets-ui.shortcut.sheet-edit`,preconditions:e=>v(e),binding:i.KeyCode.U|i.MetaKeys.CTRL_COMMAND},hh={id:an.id,description:`sheets-ui.shortcut.sheet.set-strike-through`,group:`4_sheet-edit`,groupTitle:`sheets-ui.shortcut.sheet-edit`,preconditions:e=>v(e),binding:i.KeyCode.X|i.MetaKeys.SHIFT|i.MetaKeys.CTRL_COMMAND},gh={id:ln.id,description:`sheets-ui.toolbar.fontSizeIncrease`,group:`4_sheet-edit`,groupTitle:`sheets-ui.shortcut.sheet-edit`,preconditions:e=>v(e),binding:i.KeyCode.PERIOD|i.MetaKeys.SHIFT|i.MetaKeys.CTRL_COMMAND},_h={id:un.id,description:`sheets-ui.toolbar.fontSizeDecrease`,group:`4_sheet-edit`,groupTitle:`sheets-ui.shortcut.sheet-edit`,preconditions:e=>v(e),binding:i.KeyCode.COMMA|i.MetaKeys.SHIFT|i.MetaKeys.CTRL_COMMAND},vh={id:r.ClearSelectionContentCommand.id,preconditions:e=>_(e),binding:i.KeyCode.DELETE,mac:i.KeyCode.BACKSPACE},yh={id:r.ClearSelectionContentCommand.id,preconditions:e=>_(e),mac:i.KeyCode.DELETE},bh={id:r.ClearSelectionContentCommand.id,preconditions:e=>_(e),binding:i.MetaKeys.SHIFT+i.KeyCode.BACKSPACE},xh={id:Tt.id,preconditions:e=>_(e),binding:i.MetaKeys.SHIFT+i.KeyCode.DELETE},Sh={id:jr.id,description:`sheets-ui.shortcut.sheet.zoom-in`,binding:i.KeyCode.EQUAL|i.MetaKeys.CTRL_COMMAND,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,preconditions:_,priority:1,staticParameters:{delta:.2}},Ch={id:n.NilCommand.id,binding:i.KeyCode.EQUAL|i.MetaKeys.CTRL_COMMAND},wh={id:jr.id,description:`sheets-ui.shortcut.sheet.zoom-out`,binding:i.KeyCode.MINUS|i.MetaKeys.CTRL_COMMAND,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,preconditions:_,priority:1,staticParameters:{delta:-.2}},Th={id:n.NilCommand.id,binding:i.KeyCode.MINUS|i.MetaKeys.CTRL_COMMAND},Eh={id:jr.id,description:`sheets-ui.shortcut.sheet.reset-zoom`,binding:i.KeyCode.Digit0|i.MetaKeys.CTRL_COMMAND,preconditions:_,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,priority:1,staticParameters:{reset:!0}},Dh={id:n.NilCommand.id,binding:i.KeyCode.Digit0|i.MetaKeys.CTRL_COMMAND},Oh=class extends n.Disposable{constructor(e,t,n,r,i,a,o){super(),this._injector=e,this._layoutService=t,this._commandService=n,this._shortcutService=r,this._menuManagerService=i,this._uiPartsService=a,this._configService=o,this._init()}_init(){this._initCommands(),this._initMenus(),this._initShortcuts(),this._initWorkbenchParts(),this._initFocusHandler()}_initCommands(){[jr,nr,er,tr,Vr,Ln,Fn,In,Qt,$t,fr,mr,rr,Rr,r.SetBoldCommand,Br,X,zr,tn,nn,rn,an,on,sn,cn,ln,un,dn,fn,pn,r.SetItalicCommand,r.SetStrikeThroughCommand,r.SetFontFamilyCommand,r.SetFontSizeCommand,Vn,Hn,Un,Wn,ur,dr,Kn,qn,Jn,Yn,Xn,Hr,r.SetUnderlineCommand,qo,Mr,Ar,Fr,mn,It,hn,Ft,Ko,Gr,Dn,Ur,On,kn,An,jn,Mn,Lr,Nn,Pn,Ir,vr,B,V,Fi].forEach(e=>{this.disposeWithMe(this._commandService.registerCommand(e))})}_initMenus(){this._menuManagerService.mergeMenu(jl)}_initShortcuts(){[Gm,Km,qm,Jm,Ym,Xm,Zm,Qm,$m,eh,th,nh,rh,ih,ah,oh,sh,ch,lh,uh,dh,Sh,wh,Eh,Dh,Ch,Th,fh,ph,mh,hh,gh,_h,vh,yh,bh,xh,...Ri(),Vi,Hi,Bi,zi,Ui,Wi,qi,Ji,Yi,Zi,Gi,Ki,Xi,Vm,Hm,Um,Wm].forEach(e=>{this.disposeWithMe(this._shortcutService.registerShortcut(e))})}_initWorkbenchParts(){let e=this._uiPartsService,t=this._injector;this.disposeWithMe(e.registerComponent(i.BuiltInUIPart.HEADER,()=>(0,i.connectInjector)(Nm,t))),this.disposeWithMe(e.registerComponent(i.BuiltInUIPart.FOOTER,()=>(0,i.connectInjector)(Mm,t))),this.disposeWithMe(e.registerComponent(i.BuiltInUIPart.CONTENT,()=>(0,i.connectInjector)(Pm,t)))}_initFocusHandler(){this.disposeWithMe(this._layoutService.registerFocusHandler(n.UniverInstanceType.UNIVER_SHEET,e=>{let r=this._injector.get(a.IRenderManagerService).getRenderUnitById(n.DOCS_NORMAL_EDITOR_UNIT_ID_KEY),i=r==null?void 0:r.with(t.DocSelectionRenderService);i==null||i.focus()}))}};Oh=K([G(0,(0,n.Inject)(n.Injector)),G(1,i.ILayoutService),G(2,n.ICommandService),G(3,i.IShortcutService),G(4,i.IMenuManagerService),G(5,i.IUIPartsService),G(6,n.IConfigService)],Oh);let kh=(e=[])=>{let t=(0,i.useDependency)(me);(0,p.useEffect)(()=>{let n=e.map(e=>t.addShape({range:e,style:{fill:`rgba(73, 184, 17, 0.05)`,strokeWidth:1,stroke:`#49B811`,widgets:{}},primary:null}));return()=>{n.forEach(e=>{e&&t.removeShape(e)})}},[e])};var Ah=`@univerjs/sheets-ui`,jh=`1.5.1`;let Mh=`sheets.component.cell-popup`,Nh=[`horizontal`,`vertical`,`left-center`],Ph=class extends n.Disposable{constructor(e){super(),this._sheetCanvasPopManagerService=e,z(this,`_cellPopupMap`,/* @__PURE__ */ new Map),z(this,`_change$`,new o.Subject),z(this,`change$`,this._change$.asObservable())}_ensureCellPopupMap(e,t){let r=this._cellPopupMap.get(e);r||(r=/* @__PURE__ */ new Map,this._cellPopupMap.set(e,r));let i=r.get(t);return i||(i=new n.ObjectMatrix,r.set(t,i)),i}showPopup(e,t){var r;let{direction:i=`horizontal`}=t,{unitId:a,subUnitId:o,row:s,col:c}=e,l=this._ensureCellPopupMap(a,o),u=(r=l.getValue(s,c))==null?void 0:r[i];t.id=t.id??(0,n.generateRandomId)();let d=()=>{let n=l.getValue(s,c);if(!n)return;let r=n[i];if(!r)return;let a=r==null?void 0:r.popups.findIndex(e=>e.id===t.id&&e.componentKey===t.componentKey);if(r==null||r.popups.splice(a,1),r.popups.length===0){var o;(o=r.disposable)==null||o.dispose(),n[i]=void 0}this._change$.next({...e,direction:i})};if(u)u.popups.push(t),u.popups.sort((e,t)=>e.priority-t.priority);else{let n=this._sheetCanvasPopManagerService.attachPopupToCell(s,c,{...t,direction:i,componentKey:Mh,extraProps:{...e,direction:i},noPushMinimumGap:!0,autoRelayout:t.autoRelayout??!1,zIndex:90},a,o);l.setValue(s,c,{...l.getValue(s,c),[i]:{disposable:n,popups:[t]}})}return this._change$.next({...e,direction:i}),(0,n.toDisposable)(d)}getPopups(e,t,n,r,i){var a;return((a=this._ensureCellPopupMap(e,t).getValue(n,r))==null||(a=a[i])==null?void 0:a.popups)||[]}hidePopup(e,t,n,r){let i=this._ensureCellPopupMap(e,t),a=i.getValue(n,r);a&&(Nh.forEach(i=>{var o;let s=a[i];s&&((o=s.disposable)==null||o.dispose(),a[i]=void 0,this._change$.next({unitId:e,subUnitId:t,row:n,col:r,direction:i}))}),Nh.every(e=>!a[e])&&i.realDeleteValue(n,r))}hidePopupsForUnit(e,t){let n=this._cellPopupMap.get(e);if(!n)return;let r=[];(t?[[t,n.get(t)]]:[...n.entries()]).forEach(([e,t])=>{t==null||t.forValue((t,n)=>{r.push({subUnitId:e,row:t,col:n})})}),r.forEach(t=>this.hidePopup(e,t.subUnitId,t.row,t.col)),t?n.delete(t):this._cellPopupMap.delete(e)}};Ph=K([G(0,(0,n.Inject)($r))],Ph);let Fh=class extends n.Disposable{constructor(e,t,n){super(),this._context=e,this._editorBridgeService=t,this._cellPopupManagerService=n,this._initEditorVisibleListener()}_initEditorVisibleListener(){this.disposeWithMe(this._editorBridgeService.visible$.pipe((0,o.filter)(e=>e.visible)).subscribe(()=>{let e=this._editorBridgeService.getEditLocation();e&&this._cellPopupManagerService.hidePopup(e.unitId,e.sheetId,e.row,e.column)}))}};Fh=K([G(1,Y),G(2,(0,n.Inject)(Ph))],Fh);let Ih=class extends n.Disposable{constructor(e,t,n,r){super(),this._hoverManagerService=e,this._instanceService=t,this._commandService=n,this._renderManagerService=r,z(this,`_isPointer`,!1),this._initPointerEvent(),this._initHover()}get _mainComponent(){var e;return(e=(0,a.getCurrentTypeOfRenderer)(n.UniverInstanceType.UNIVER_SHEET,this._instanceService,this._renderManagerService))==null?void 0:e.mainComponent}_initHover(){this.disposeWithMe(this._hoverManagerService.currentRichText$.subscribe(e=>{if(e!=null&&e.bullet){if(!this._isPointer){var t;(t=this._mainComponent)==null||t.setCursor(a.CURSOR_TYPE.POINTER)}this._isPointer=!0}else{if(this._isPointer){var n;(n=this._mainComponent)==null||n.setCursor(a.CURSOR_TYPE.AUTO)}this._isPointer=!1}}))}_initPointerEvent(){this.disposeWithMe(this._hoverManagerService.currentClickedCell$.subscribe(e=>{let{location:t,bullet:n}=e;n&&this._commandService.executeCommand(r.ToggleCellCheckboxCommand.id,{unitId:t.unitId,subUnitId:t.subUnitId,row:t.row,col:t.col,paragraphIndex:n.startIndex})}))}};Ih=K([G(0,(0,n.Inject)(Za)),G(1,n.IUniverInstanceService),G(2,n.ICommandService),G(3,a.IRenderManagerService)],Ih);let Lh=class extends n.Disposable{constructor(e,t,n,r,i){super(),this._selectionManagerService=e,this._themeService=t,this._instanceSrv=n,this._cmdSrv=r,this._definedNamesService=i,this._init()}_init(){this.disposeWithMe((0,o.merge)(this._selectionManagerService.selectionMoveStart$,this._selectionManagerService.selectionMoving$,this._selectionManagerService.selectionMoveEnd$,this._selectionManagerService.selectionSet$).pipe((0,o.filter)(e=>!!e)).subscribe(e=>{this._syncDefinedNameRange(e)})),this.disposeWithMe(this._definedNamesService.focusRange$.subscribe(async e=>{if(e==null)return;let{unitId:t}=e,{formulaOrRefString:n}=e;if(n.substring(0,1)===u.operatorToken.EQUALS&&(n=n.substring(1)),!(0,u.isReferenceStrings)(n))return;let i=this._instanceSrv.getUnit(t),a=await this._getSelections(i,t,n);this._selectionManagerService.setSelections(a),this._cmdSrv.executeCommand(r.ScrollToCellOperation.id,{unitId:t,range:a[0].range})}))}_syncDefinedNameRange(e){if(e.length===0)return;let t=e[e.length-1],r=this._instanceSrv.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET),i=r==null?void 0:r.getActiveSheet();i&&this._definedNamesService.setCurrentRange({range:t.range,unitId:r.getUnitId(),sheetId:i.getSheetId()})}async _getSelections(e,t,n){let i=n.split(`,`),a=e.getActiveSheet();if(!a)return[];let o=[];for(let n=0;n<i.length;n++){let s=i[n].trim(),c=(0,u.deserializeRangeWithSheet)(s.trim());if(n===0){let n=e.getSheetBySheetName(c.sheetName);n&&a.getSheetId()!==n.getSheetId()&&(a=n,await this._cmdSrv.executeCommand(r.SetWorksheetActivateCommand.id,{subUnitId:a.getSheetId(),unitId:t}))}if(a.getName()!==c.sheetName)continue;let l=null;if(n===i.length-1){let{startRow:e,startColumn:t,endRow:n,endColumn:i}=c.range;l=(0,r.getPrimaryForRange)({startRow:e,startColumn:t,endRow:n,endColumn:i},a)}o.push({range:c.range,style:j(this._themeService),primary:l})}return o}};Lh=K([G(0,(0,n.Inject)(r.SheetsSelectionsService)),G(1,(0,n.Inject)(n.ThemeService)),G(2,n.IUniverInstanceService),G(3,n.ICommandService),G(4,u.IDefinedNamesService)],Lh);function Rh({popup:e,DropdownMenuComponent:t=l.DropdownMenu}){var n;let[r,i]=(0,p.useState)(!1),[a,o]=(0,p.useState)(!1),s=(n=e.extraProps)==null?void 0:n.alert;if(!s)return null;let{type:c,title:u,message:d,menu:f,action:h,width:g}=s;if(f!=null&&f.length){let e=[u,d].filter(e=>typeof e==`string`).join(`: `),n=r||a;return/* @__PURE__ */ (0,m.jsx)(`div`,{onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:/* @__PURE__ */ (0,m.jsx)(t,{align:`start`,open:r,onOpenChange:i,items:[{type:`custom`,className:`univer-px-2 univer-py-1.5 univer-font-medium univer-text-gray-900 dark:!univer-text-gray-0`,children:d},{type:`separator`},...f.map(e=>({type:`item`,children:e.label,disabled:e.disabled,onSelect:e.onSelect}))],children:/* @__PURE__ */ (0,m.jsxs)(`button`,{type:`button`,"aria-label":e||void 0,className:`univer-flex univer-items-center univer-gap-1 univer-rounded univer-border univer-border-solid univer-border-gray-200 univer-bg-gray-0 univer-p-1 univer-shadow hover:univer-bg-gray-100 dark:!univer-border-gray-600 dark:!univer-bg-gray-900 dark:hover:!univer-bg-gray-800`,children:[/* @__PURE__ */ (0,m.jsx)(_f,{className:`univer-text-yellow-500`}),n&&/* @__PURE__ */ (0,m.jsx)(Ad,{className:`univer-text-gray-600 dark:!univer-text-gray-300`})]})})})}let _={2:/* @__PURE__ */ (0,m.jsx)(Bu,{className:`univer-text-red-500`}),0:/* @__PURE__ */ (0,m.jsx)(fd,{className:`univer-text-blue-500`}),1:/* @__PURE__ */ (0,m.jsx)(_f,{className:`univer-text-yellow-500`})};return/* @__PURE__ */ (0,m.jsxs)(`div`,{style:{width:g},className:`univer-z-[100] univer-box-border univer-rounded-lg univer-bg-gray-0 univer-px-2 univer-py-1 univer-text-gray-900 univer-shadow dark:!univer-bg-gray-1000 dark:!univer-text-gray-0`,children:[/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-mb-1.5 univer-flex univer-h-5 univer-flex-row univer-items-center univer-gap-x-1.5 univer-text-sm univer-font-medium`,children:[c?_[c]:null,u]}),/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-text-sm`,children:d}),h&&/* @__PURE__ */ (0,m.jsx)(l.Button,{className:`univer-mt-2`,disabled:h.disabled,onClick:h.onSelect,children:h.label})]})}let zh=`univer.sheet.cell-alert`,Bh=/* @__PURE__ */ function(e){return e[e.INFO=0]=`INFO`,e[e.WARNING=1]=`WARNING`,e[e.ERROR=2]=`ERROR`,e}({}),Vh=class extends n.Disposable{get currentAlert(){return this._currentAlert}constructor(e,t){super(),this._renderManagerService=e,this._cellPopupManagerService=t,z(this,`_currentAlert$`,new o.Subject),z(this,`_currentAlert`,/* @__PURE__ */ new Map),z(this,`currentAlert$`,this._currentAlert$.asObservable()),this.disposeWithMe(()=>{this.clearAlert(),this._currentAlert$.complete()})}showAlert(e){var t,n,r;let i=this._currentAlert.get(e.key);i?(i.dispose.dispose(),i.alert=e):(i={alert:e,dispose:{dispose(){}}},this._currentAlert.set(e.key,i));let{location:a}=e,{row:o,col:s,unitId:c,subUnitId:l}=a;if(!this._renderManagerService.getRenderUnitById(c))return;let u=this._cellPopupManagerService.showPopup({unitId:c,subUnitId:l,row:o,col:s},{componentKey:zh,direction:(t=e.menu)!=null&&t.length?`left-center`:`horizontal`,autoRelayout:!!((n=e.menu)!=null&&n.length),showOnSelectionMoving:!!((r=e.menu)!=null&&r.length),extraProps:{alert:e},priority:1});u&&(i.dispose=u),this._currentAlert$.next(Array.from(this._currentAlert.entries()))}removeAlert(e){let t=this._currentAlert.get(e);t&&(this._currentAlert.delete(e),t==null||t.dispose.dispose(),this._currentAlert$.next(Array.from(this._currentAlert.entries())))}clearAlert(){this._currentAlert.forEach(e=>{e.dispose.dispose()}),this._currentAlert.clear(),this._currentAlert$.next(Array.from(this._currentAlert.entries()))}};Vh=K([G(0,a.IRenderManagerService),G(1,(0,n.Inject)(Ph))],Vh);let Hh=class extends n.Disposable{constructor(e,t,n,r,i,a,o){super(),this._context=e,this._selectionManagerService=t,this._cellAlertManagerService=n,this._localeService=r,this._configService=i,this._commandService=a,this._univerInstanceService=o,this._init()}_init(){this._initCellAlertPopup()}_initCellAlertPopup(){this.disposeWithMe(this._selectionManagerService.selectionChanged$.subscribe(e=>this._updateAlert(e))),this.disposeWithMe(this._context.unit.activeSheet$.subscribe(()=>this._updateAlert(this._selectionManagerService.getCurrentSelections()))),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET).subscribe(()=>this._updateAlert(this._selectionManagerService.getCurrentSelections())))}_isCurrentSheet(e){let t=this._selectionManagerService.currentSelectionParam;return!!(e&&(t==null?void 0:t.unitId)===this._context.unit.getUnitId()&&t.sheetId===e.getSheetId())}_updateAlert(e){var t,i;this._hideAlert();let a=this._context.unit,o=a.getActiveSheet();if(!this._isCurrentSheet(o)||(e==null?void 0:e.length)!==1||(t=this._configService.getConfig(`sheets-ui.config`))!=null&&t.disableForceStringAlert)return;let s=e[0],c=s.primary;if(!c)return;let l=c.actualRow,u=c.actualColumn,d=o.getCell(l,u);if(!d||d.v===null||d.v===void 0)return;let f=a.getStyles().get(d.s);if((0,n.isTextFormat)(f==null||(i=f.n)==null?void 0:i.pattern)||d.t!==n.CellValueType.FORCE_STRING&&d.t!==n.CellValueType.STRING||!(0,n.isRealNum)(d.v)&&!(typeof d.v==`string`&&(0,n.getNumfmtParseValueFilter)(d.v)))return;let p=a.getUnitId(),m=o.getSheetId(),h={...s.range};this._cellAlertManagerService.showAlert({type:1,title:this._localeService.t(`sheets-ui.info.error`),message:this._localeService.t(`sheets-ui.info.forceStringInfo`),location:{unitId:p,subUnitId:m,row:l,col:u},width:200,height:74,key:this._alertKey,menu:[{label:this._localeService.t(`sheets-ui.info.convertToNumber`),onSelect:()=>{this._commandService.syncExecuteCommand(r.TextToNumberCommand.id,{unitId:p,subUnitId:m,ranges:[h]})&&this._hideAlert()}}]})}get _alertKey(){return`SHEET_FORCE_STRING_ALERT:${this._context.unit.getUnitId()}`}_hideAlert(){this._cellAlertManagerService.removeAlert(this._alertKey)}};Hh=K([G(1,(0,n.Inject)(r.SheetsSelectionsService)),G(2,(0,n.Inject)(Vh)),G(3,(0,n.Inject)(n.LocaleService)),G(4,n.IConfigService),G(5,n.ICommandService),G(6,n.IUniverInstanceService)],Hh);let Uh=class extends n.RxDisposable{constructor(e,t,n,r){super(),this._context=e,this._sheetSkeletonManagerService=t,this._sheetInterceptorService=n,this._configService=r,this._initViewModelIntercept()}_initViewModelIntercept(){let e={tl:{size:6,color:`#409f11`}};this.disposeWithMe(this._sheetInterceptorService.intercept(r.INTERCEPTOR_POINT.CELL_CONTENT,{priority:10,effect:n.InterceptorEffectEnum.Style,handler:(t,r,i)=>{var a;if(!((a=this._sheetSkeletonManagerService.getCurrentParam())!=null&&a.skeleton))return i(t);let o=r.rawData;if(!o||o.v===null||o.v===void 0)return i(t);if(((t==null?void 0:t.t)===n.CellValueType.FORCE_STRING||(t==null?void 0:t.t)===n.CellValueType.STRING)&&((0,n.isRealNum)(o.v)||typeof o.v==`string`&&(0,n.getNumfmtParseValueFilter)(o.v))){var s,c;let a=r.workbook.getStyles().get(o.s);return(0,n.isTextFormat)(a==null||(s=a.n)==null?void 0:s.pattern)||(c=this._configService.getConfig(`sheets-ui.config`))!=null&&c.disableForceStringMark||(t===o&&(t={...o}),t.markers={...t==null?void 0:t.markers,...e}),i(t)}return i(t)}}))}};Uh=K([G(1,(0,n.Inject)(q)),G(2,(0,n.Inject)(r.SheetInterceptorService)),G(3,n.IConfigService)],Uh);let Wh=class extends n.Disposable{constructor(e,t,n,r,i,a,o){super(),this._commandService=e,this._formatPainterService=t,this._univerInstanceService=n,this._renderManagerService=r,this._selectionManagerService=i,this._sheetInterceptorService=a,this._injector=o,this._initialize()}_initialize(){this._addDefaultHook();let e=this._injector.get(i.FormatPainterSessionService),t=!0,a=this._injector.invoke(ds).disabled$;this.disposeWithMe(e.register({id:`sheet-cells`,priority:0,clear:()=>this._commandService.executeCommand(r.ClearSelectionFormatCommand.id),changes$:a.pipe((0,o.tap)(e=>{t=e})),isActive:()=>{var e;return((e=this._univerInstanceService.getFocusedUnit())==null?void 0:e.type)===n.UniverInstanceType.UNIVER_SHEET},canStart:()=>!t&&!!this._selectionManagerService.getCurrentLastSelection(),capture:()=>{let e=this._univerInstanceService.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET),t=this._collectSelectionRangeFormat();return!e||!t?null:(this._formatPainterService.setSelectionFormat(t),{unitId:e.getUnitId(),apply:e=>!!e.subUnitId&&!!e.range&&this._commandService.executeCommand(Wn.id,e),onModeChange:e=>this._formatPainterService.setStatus({off:0,once:1,continuous:2}[e])})}})),this.disposeWithMe(this._formatPainterService.status$.subscribe(t=>{t===0&&e.isActive(`sheet-cells`)&&e.cancel()}))}_addDefaultHook(){this._formatPainterService.addHook({id:`default-format-painter`,priority:0,isDefaultHook:!0,onStatusChange:e=>{if(e!==0&&!this._injector.get(i.FormatPainterSessionService).isActive(`sheet-cells`)){let e=this._collectSelectionRangeFormat();e&&this._formatPainterService.setSelectionFormat(e)}},onApply:(e,t,n,r)=>this._getUndoRedoMutationInfo(e,t,n,r)})}_collectSelectionRangeFormat(){let e=this._selectionManagerService.getCurrentLastSelection(),t=e==null?void 0:e.range;if(!t)return null;let{startRow:r,endRow:i,startColumn:a,endColumn:o}=t,s=this._univerInstanceService.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET),c=s==null?void 0:s.getActiveSheet();if(!c)return null;let l=c.getCellMatrix(),u=s.getStyles(),d=new n.ObjectMatrix,f=[];for(let e=r;e<=i;e++)for(let t=a;t<=o;t++){let r=l.getValue(e,t);d.setValue(e,t,n.Tools.deepClone(u.getStyleByCell(r)||{}));let{isMergedMainCell:i,...a}=c.getCellInfoInMergeData(e,t);i&&f.push({startRow:a.startRow,startColumn:a.startColumn,endRow:a.endRow,endColumn:a.endColumn})}return{styles:d,merges:f}}_getUndoRedoMutationInfo(e,t,i,a){let o=this._sheetInterceptorService,s=this._univerInstanceService,{merges:c,styles:l}=a;if(!l)return{undos:[],redos:[]};let{startRow:u,startColumn:d,endRow:f,endColumn:p}=l.getDataRange(),m=f-u+1,h=p-d+1,g=i.startRow===i.endRow&&i.startColumn===i.endColumn?{startRow:i.startRow,startColumn:i.startColumn,endRow:i.startRow+m-1,endColumn:i.startColumn+h-1}:i,_=Array.from({length:g.endRow-g.startRow+1},()=>Array.from({length:g.endColumn-g.startColumn+1},()=>({}))),v=[];_.forEach((e,t)=>{e.forEach((e,n)=>{let r=t%m+u,i=n%h+d,a=l.getValue(r,i);a&&(_[t][n].s=Object.keys(a).length>0?a:null)})});let y=0,b=0;c.forEach(e=>{e.startRow===u&&e.startColumn===d&&(y=e.endRow-e.startRow,b=e.endColumn-e.startColumn);let t={startRow:e.startRow-u,startColumn:e.startColumn-d,endRow:e.endRow-u,endColumn:e.endColumn-d},n=Math.max(1,Math.floor((g.endRow-g.startRow+1)/m)),r=Math.max(1,Math.floor((g.endColumn-g.startColumn+1)/h));for(let e=0;e<n;e++)for(let n=0;n<r;n++)v.push({startRow:t.startRow+e*m+g.startRow,startColumn:t.startColumn+n*h+g.startColumn,endRow:t.endRow+e*m+g.startRow,endColumn:t.endColumn+n*h+g.startColumn})});let x=[g],S=new n.ObjectMatrix,C=new n.ObjectMatrix;if(n.Tools.isArray(_))for(let e=0;e<x.length;e++){let{startRow:t,startColumn:n,endRow:r,endColumn:i}=x[e];for(let e=0;e<=r-t;e++)for(let r=0;r<=i-n;r++)S.setValue(e+t,r+n,{s:null}),C.setValue(e+t,r+n,_[e][r])}let w={subUnitId:t,unitId:e,trigger:r.SetStyleCommand.id,cellValue:S.getMatrix()},T={subUnitId:t,unitId:e,trigger:r.SetStyleCommand.id,cellValue:C.getMatrix()},E=this._injector.invoke(r.SetRangeValuesUndoMutationFactory,w),{undos:D,redos:O}=o.onCommandExecute({id:r.SetRangeValuesCommand.id,params:{...T,range:x}}),k=[],A=[];if(v.length>0){let n=(0,r.getAddMergeMutationRangeByType)(v),i=s.getUnit(e).getSheetBySheetId(t),a=br(i,n),o={unitId:e,subUnitId:t,ranges:n},c={unitId:e,subUnitId:t,ranges:n};k.push({id:r.RemoveWorksheetMergeMutation.id,params:o}),k.push({id:r.AddWorksheetMergeMutation.id,params:c});let l=this._injector.invoke(r.RemoveMergeUndoMutationFactory,o),u=this._injector.invoke(r.AddMergeUndoMutationFactory,c);if(A.push({id:r.RemoveWorksheetMergeMutation.id,params:u}),A.push({id:r.AddWorksheetMergeMutation.id,params:l}),a){let t=this._injector.invoke(t=>(0,r.getClearContentMutationParamsForRanges)(t,e,i,n));k.unshift(...t.redos),A.push(...t.undos)}}if(!n.Rectangle.equals(g,i)){let a={actualRow:g.startRow,actualColumn:g.startColumn,rangeType:n.RANGE_TYPE.NORMAL,isMerged:y>0||b>0,isMergedMainCell:!1,startRow:g.startRow,startColumn:g.startColumn,endRow:g.startRow+y,endColumn:g.startColumn+b};k.push({id:r.SetSelectionsOperation.id,params:{unitId:e,subUnitId:t,type:r.SelectionMoveType.ONLY_SET,selections:[{range:g,primary:a,style:null}]}}),A.unshift({id:r.SetSelectionsOperation.id,params:{unitId:e,subUnitId:t,type:r.SelectionMoveType.ONLY_SET,selections:[{range:i,primary:a,style:null}]}})}return{undos:[{id:r.SetRangeValuesMutation.id,params:w},{id:r.SetRangeValuesMutation.id,params:E},...D,...A],redos:[{id:r.SetRangeValuesMutation.id,params:w},{id:r.SetRangeValuesMutation.id,params:T},...O,...k]}}};Wh=K([G(0,n.ICommandService),G(1,zn),G(2,n.IUniverInstanceService),G(3,a.IRenderManagerService),G(4,(0,n.Inject)(r.SheetsSelectionsService)),G(5,(0,n.Inject)(r.SheetInterceptorService)),G(6,(0,n.Inject)(n.Injector))],Wh);let Gh=class extends n.Disposable{constructor(e,t,n,r){super(),this._context=e,this._markSelectionService=t,this._commandService=n,this._sheetSkeletonManagerService=r,this._initListeners()}_initListeners(){this._addRemoveListener(),this._addRefreshListener()}_addRemoveListener(){let e=[X.id];this.disposeWithMe(this._commandService.onCommandExecuted(t=>{e.includes(t.id)?this._markSelectionService.removeAllShapes():this._markSelectionService.getShapeMap().forEach((e,n)=>{e.exits.includes(t.id)&&this._markSelectionService.removeShape(n)})}))}_addRefreshListener(){this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.subscribe(e=>{e&&this._markSelectionService.refreshShapes()}))}};Gh=K([G(1,(0,n.Inject)(me)),G(2,n.ICommandService),G(3,(0,n.Inject)(q))],Gh);let Kh=[{value:`DEFAULT_PASTE`,label:`sheets-ui.rightClick.paste`},{value:`SPECIAL_PASTE_VALUE`,label:`sheets-ui.rightClick.pasteValue`},{value:`SPECIAL_PASTE_FORMAT`,label:`sheets-ui.rightClick.pasteFormat`},{value:`SPECIAL_PASTE_COL_WIDTH`,label:`sheets-ui.rightClick.pasteColWidth`},{value:`SPECIAL_PASTE_BESIDES_BORDER`,label:`sheets-ui.rightClick.pasteBesidesBorder`},{value:`SPECIAL_PASTE_FORMULA`,label:`sheets-ui.rightClick.pasteFormula`}],qh=e=>{var t;let r=(0,i.useDependency)(n.IUniverInstanceService),o=(0,i.useDependency)(a.IRenderManagerService),s=Fl();if(!e||!s)return null;let c={startRow:e.rows[0],startCol:e.cols[0],endRow:e.rows[e.rows.length-1],endCol:e.cols[e.cols.length-1]};if(c.endRow<0||c.endCol<0)return null;let l=o.getRenderUnitById(s.getUnitId()),u=l==null?void 0:l.with(q),d=ar(r,o);if(!d)return null;let{scene:f}=d,p=u==null?void 0:u.getCurrentSkeleton(),m=Cr(c.endRow,c.endCol,f,s.getActiveSheet());if(!m)return null;let h=f==null?void 0:f.scaleX,g=f==null?void 0:f.scaleY,_=f==null?void 0:f.getViewportScrollXY(m),v=(t=f.getEngine())==null?void 0:t.getCanvas();if(!h||!f||!h||!g||!_)return null;let y=p==null?void 0:p.getNoMergeCellWithCoordByIndex(c.endRow,c.endCol),b=(y==null?void 0:y.endX)??0,x=(y==null?void 0:y.endY)??0,S=(0,a.convertTransformToOffsetX)(b,h,_)??-9999,C=(0,a.convertTransformToOffsetY)(x,g,_)??-9999,w=v==null?void 0:v.getWidth(),T=v==null?void 0:v.getHeight();if(!w||!T)return null;let E=S+50<=w,D=C+50<=T,O=S,k=C;return E||(O=w-100),D||(k=T-100),{positionX:O,positionY:k}},Jh=({DropdownMenuComponent:e=l.DropdownMenu}={})=>{let t=(0,i.useDependency)(gt),r=(0,i.useObservable)(t.showMenu$,!1),a=(0,i.useObservable)(t.pasteOptionsCache$,null),o=(0,i.useDependency)(n.LocaleService),s=(0,i.useDependency)(n.ICommandService),c=(0,i.useDependency)(i.ILayoutService),[u,d]=(0,p.useState)(!1),[f,h]=(0,p.useState)(!1),g=a==null?void 0:a.target.pastedRange,_=qh(g);if(!_||!r||_.positionX<50||_.positionY<30)return null;let v=u||f,y=e=>{h(!1),s.executeCommand(Pt.id,{type:e})};return/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-absolute univer-inset-0 univer-z-10 univer-size-0`,children:/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-absolute`,style:{left:_.positionX+2,top:_.positionY+2},onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),children:/* @__PURE__ */ (0,m.jsx)(e,{align:`start`,onCloseAutoFocus:e=>{e.preventDefault(),c.focus()},items:Kh.map(e=>({type:`checkbox`,value:e.value,label:o.t(e.label),checked:(a==null?void 0:a.pasteType)===J[e.value],onSelect:()=>y(e.value)})),open:f,onOpenChange:h,children:/* @__PURE__ */ (0,m.jsxs)(`div`,{className:(0,l.clsx)(`univer-flex univer-items-center univer-gap-2 univer-rounded univer-p-1 hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-800`,l.borderClassName,{"univer-bg-gray-100 dark:!univer-bg-gray-800":f,"univer-bg-gray-0 dark:!univer-bg-gray-900":!f}),children:[/* @__PURE__ */ (0,m.jsx)(Lp,{className:`univer-fill-primary-600 univer-text-gray-900 dark:!univer-text-gray-0`}),v&&/* @__PURE__ */ (0,m.jsx)(Ad,{className:`dark:!univer-text-gray-0`})]})})})})};function Yh(){return/* @__PURE__ */ (0,m.jsx)(Jh,{DropdownMenuComponent:l.MobileDropdownMenu})}let Xh=class extends n.Disposable{constructor(e,t,n){var r;super();let a=t.getConfig(U);a!=null&&(r=a.clipboardConfig)!=null&&r.hidePasteOptions||this.disposeWithMe(n.registerComponent(i.BuiltInUIPart.CONTENT,()=>(0,i.connectInjector)(Yh,e)))}};Xh=K([G(0,(0,n.Inject)(n.Injector)),G(1,n.IConfigService),G(2,i.IUIPartsService)],Xh);let Zh=e=>{let{popup:t}=e,{row:n,col:r,direction:a,unitId:s,subUnitId:c}=t.extraProps,l=(0,i.useDependency)(Ph),u=(0,i.useObservable)((0,p.useMemo)(()=>l.change$.pipe((0,o.filter)(e=>e.row===n&&e.col===r&&e.direction===a),(0,o.map)(()=>l.getPopups(s,c,n,r,a))),[l,r,a,n,c,s]),l.getPopups(s,c,n,r,a)),d=(0,i.useDependency)(i.ComponentManager);return/* @__PURE__ */ (0,m.jsx)(`div`,{"data-u-comp":`sheets-ui-cell-popup`,className:`
|
|
9
|
+
`)}]}}let Ma=[r.InsertColMutation.id,r.InsertRowMutation.id,r.RemoveColMutation.id,r.RemoveRowMutation.id,r.MoveRangeMutation.id,r.MoveRowsMutation.id,r.MoveColsMutation.id],Na=class extends n.RxDisposable{constructor(e,t,n,r,i,a,s,c,l,u,d){super(),this._injector=e,this._instanceService=t,this._renderManagerService=n,this._commandService=r,this._contextService=i,this._configService=a,this._sheetClipboardService=s,this._clipboardInterfaceService=c,this._messageService=l,this._localService=u,this._embedRuntimeFocusCoordinator=d,z(this,`_refreshOptionalPaste$`,new o.Subject),z(this,`refreshOptionalPaste$`,this._refreshOptionalPaste$.asObservable()),this._init(),this._initCommandListener(),this._pasteWithDoc()}refreshOptionalPaste(){this._refreshOptionalPaste$.next(Math.random())}_pasteWithDoc(){var e;let r=e=>{e.onPaste$.pipe((0,o.takeUntil)(this.dispose$)).subscribe(async e=>{var t,n;if(!this._isSheetGridPasteTarget())return;e.event.preventDefault();let r=e.event,i=(t=r.clipboardData)==null?void 0:t.getData(`text/html`),a=(n=r.clipboardData)==null?void 0:n.getData(`text/plain`),o=this._resolveClipboardFiles(r.clipboardData),s=this._sheetClipboardService.capturePasteTarget();if(!s)return;let c=await this._readFormulaClipboardPayload();await this._commandService.executeCommand(Dt.id,{htmlContent:i,textContent:a,files:o,formulaClipboardPayload:c,target:s})}),e==null||e.onKeydown$.subscribe(e=>{e.event.key===`Escape`&&this._sheetClipboardService.removeMarkSelection()})},i=(e=this._renderManagerService.getRenderUnitById(n.DOCS_NORMAL_EDITOR_UNIT_ID_KEY))==null?void 0:e.with(t.DocSelectionRenderService);i&&r(i),this._renderManagerService.created$.subscribe(e=>{if(e.unitId===n.DOCS_NORMAL_EDITOR_UNIT_ID_KEY){var a;i=(a=this._renderManagerService.getRenderUnitById(n.DOCS_NORMAL_EDITOR_UNIT_ID_KEY))==null?void 0:a.with(t.DocSelectionRenderService),i&&r(i)}})}_isSheetGridPasteTarget(){var e,t;if(_(this._contextService))return!0;let r=(e=this._embedRuntimeFocusCoordinator)==null?void 0:e.resolveActiveChildSessionRuntimeScope();return(r==null?void 0:r.childType)!==n.UniverInstanceType.UNIVER_SHEET||!r.childUnitId||this._contextService.getContextValue(n.EDITOR_ACTIVATED)?!1:((t=this._instanceService.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET))==null?void 0:t.getUnitId())===r.childUnitId}_resolveClipboardFiles(e){if(!e)return;let t=Array.from(e.items).map(e=>e.kind===`file`?e.getAsFile():void 0).filter(Boolean);return t.length>0?t:void 0}async _readFormulaClipboardPayload(){if(this._clipboardInterfaceService.supportClipboard)try{let e=(await this._clipboardInterfaceService.read()).find(e=>e.types.includes(pt));return e?(await e.getType(pt)).text():void 0}catch{return}}_init(){[wt,Tt,Et].forEach(e=>this.disposeWithMe(this._commandService.registerMultipleCommand(e))),[At,jt,Mt,Nt,Dt,Pt].forEach(e=>this.disposeWithMe(this._commandService.registerCommand(e))),this.disposeWithMe(this._sheetClipboardService.addClipboardHook(this._initCopyingHooks())),this.disposeWithMe(this._sheetClipboardService.addClipboardHook(this._initPastingRowsHook())),this.disposeWithMe(this._sheetClipboardService.addClipboardHook(this._initPastingColumnsHook())),this.disposeWithMe(this._sheetClipboardService.addClipboardHook(this._initPastingHook()));let e=this._initSpecialPasteHooks().map(e=>this._sheetClipboardService.addClipboardHook(e));this.disposeWithMe({dispose:()=>e.forEach(e=>e.dispose())})}_initCopyingHooks(){let e=this,r=null;return{id:ut.DEFAULT_COPY,isDefaultHook:!0,onBeforeCopy(t,n){r=e._getWorksheet(t,n)},onCopyCellContent(e,i){var a,o;let s=r.getCell(e,i);if(s!=null&&(a=s.p)!=null&&(a=a.body)!=null&&a.paragraphs||s!=null&&(o=s.p)!=null&&(o=o.body)!=null&&o.textRuns)return(0,t.convertBodyToHtml)(s.p);let c=(0,n.extractPureTextFromCell)(s);return c.trim()===``?c:bt(c)},onCopyCellStyle:(e,t,i,a)=>{let o={};(i||a)&&(o.rowspan=`${i||1}`,o.colspan=`${a||1}`);let s=r.getMergedCell(e,t),c=r.getComposedCellStyle(e,t),l=``;if(c&&(l=(0,n.handleStyleToString)(c)),s){let e=s.endRow,t=s.endColumn,i=r.getRange(e,t).getTextStyle();if(i){let e=(0,n.handleStyleToString)(i);l?l+=e?`;${e}`:``:l=e}}return l&&(o.style=l),Object.keys(o).length?o:null},onCopyColumn(e){return{width:`${r.getColumnWidth(e)}`}},onCopyRow(e){return{style:`height: ${r.getRowHeight(e)}px;`}},onAfterCopy(){r=null},getFilteredOutRows(t,n,r){let i=e._getWorksheet(t,n);if(!i)return[];let{startRow:a,endRow:o}=r,s=[];for(let e=a;e<=o;e++)i.getRowFiltered(e)&&s.push(e);return s}}}_initPastingHook(){let e=this;return{id:J.DEFAULT_PASTE,isDefaultHook:!0,onBeforePaste({range:t}){let n=e._configService.getConfig(r.MAX_CELL_PER_SHEET_KEY),i=t.rows[t.rows.length-1],a=t.cols[t.cols.length-1];return n&&i*a>n?(e._messageService.show({type:l.MessageType.Error,content:e._localService.t(`sheets-ui.clipboard.paste.exceedMaxCells`)}),!1):!0},onPastePlainText(t,n,r){return e._onPastePlainText(t,n,r)},onPasteCells(t,n,r,i){return e._onPasteCells(t,n,r,i)}}}_initPastingRowsHook(){let e=this;return{id:J.DEFAULT_PASTE_ROWS,isDefaultHook:!0,onPasteRows(t){let n=[],i=[],{range:a,unitId:o,subUnitId:s}=t,{rows:c,cols:l}=a;if(!c||!l||c.length===0||l.length===0)return{redos:n,undos:i};let u=e._getWorksheet(o,s).getMaxRows()-1,d=c[c.length-1],f=l[0],p=l[l.length-1];if(d-u>0){let e={unitId:o,subUnitId:s,range:{startRow:u+1,endRow:d,startColumn:f,endColumn:p}};n.push({id:r.InsertRowMutation.id,params:e}),i.push({id:r.RemoveRowMutation.id,params:e})}return{redos:n,undos:i}}}}_initPastingColumnsHook(){let e=this;return{id:J.DEFAULT_PASTE_COLUMNS,isDefaultHook:!0,onPasteColumns(t){let n=[],i=[],{range:a,unitId:o,subUnitId:s}=t,{rows:c,cols:l}=a;if(!c||!l||c.length===0||l.length===0)return{redos:n,undos:i};let u=e._getWorksheet(o,s).getMaxColumns()-1,d=c[0],f=c[c.length-1],p=l[l.length-1];if(p-u>0){let e={unitId:o,subUnitId:s,range:{startRow:d,endRow:f,startColumn:u+1,endColumn:p}};n.push({id:r.InsertColMutation.id,params:e}),i.push({id:r.RemoveColMutation.id,params:e})}return{redos:n,undos:i}}}}_generateDocumentDataModelSnapshot(e){var t;if(((t=(0,a.withCurrentTypeOfRenderer)(n.UniverInstanceType.UNIVER_SHEET,q,this._instanceService,this._renderManagerService))==null?void 0:t.getCurrentParam())==null)return null;let r=(0,n.createDocumentModelWithStyle)(``,{}),i={...r==null?void 0:r.getSnapshot(),...e};return r==null||r.reset(i),r==null?void 0:r.getSnapshot()}_onPastePlainText(e,t,i){let{range:a,unitId:o,subUnitId:s}=e,c=this._instanceService.getUnit(o,n.UniverInstanceType.UNIVER_SHEET),l=c?{locale:(0,n.getNumfmtLocaleTag)(c.getSnapshot().locale),dateSystem:c.getDateSystem()}:void 0,u;if(/\r|\n/.test(t)||n.Tools.isLegalUrl(t)){let e=ja(t),n=this._generateDocumentDataModelSnapshot({body:e});u={[a.rows[0]]:{[a.cols[0]]:{p:n,v:null,f:null}}}}else if((0,n.isFormulaString)(t))u={[a.rows[0]]:{[a.cols[0]]:{f:t,ft:null,fd:null,v:null,p:null}}};else{let e=(0,n.getNumfmtParseValueFilter)(t,l);u=e!=null&&e.z?{[a.rows[0]]:{[a.cols[0]]:{v:e.v,s:{n:{pattern:e.z}},f:null}}}:{[a.rows[0]]:{[a.cols[0]]:{v:t,f:null}}}}let d={unitId:o,subUnitId:s,cellValue:u};return{redos:[{id:r.SetRangeValuesMutation.id,params:d}],undos:[{id:r.SetRangeValuesMutation.id,params:(0,r.SetRangeValuesUndoMutationFactory)(this._injector,d)}]}}_onPasteCells(e,t,n,r){return this._injector.invoke(i=>wa(e,t,n,r,i))}_initSpecialPasteHooks(){let e=this;return[{id:J.SPECIAL_PASTE_VALUE,specialPasteInfo:{label:`specialPaste.value`},onPasteCells:(e,t,n)=>this._injector.invoke(r=>{let{redo:i,undo:a}=Oa(t,e,n,r);return{redos:[i],undos:[a]}})},{id:J.SPECIAL_PASTE_FORMAT,specialPasteInfo:{label:`specialPaste.format`},onPasteCells:(e,t,n)=>{let r=[],i=[],{redo:a,undo:o}=this._injector.invoke(r=>ka(t,e,n,r));r.push(a),i.push(o);let{undos:s,redos:c}=this._injector.invoke(e=>Aa(t,n,e));return r.push(...c),i.push(...s),{undos:i,redos:r}}},{id:J.SPECIAL_PASTE_COL_WIDTH,specialPasteInfo:{label:`specialPaste.colWidth`},onPasteCells(){return{undos:[],redos:[]}},onPasteColumns(t,i,a){let o=[],s=[];if(a.pasteType!==J.SPECIAL_PASTE_COL_WIDTH)return{redos:o,undos:s};let{range:c,unitId:l,subUnitId:u}=t,{rows:d,cols:f}=c;if(!d||!f||d.length===0||f.length===0)return{redos:o,undos:s};let p=e._getWorksheet(l,u),m=e._configService.getConfig(n.DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY)??n.DEFAULT_WORKSHEET_COLUMN_WIDTH,h=d[0],g=d[d.length-1],_=f[0],v=f[f.length-1],y=i.length;if(y>0){let e={};for(let t=_;t<=v;t++){let n=i[(t-_)%y];n.width&&Number(n.width)!==m&&(e[t]=Number(n.width))}let t={unitId:l,subUnitId:u,ranges:[{startRow:h,endRow:g,startColumn:_,endColumn:v}],colWidth:e};o.push({id:r.SetWorksheetColWidthMutation.id,params:t}),s.unshift({id:r.SetWorksheetColWidthMutation.id,params:(0,r.SetWorksheetColWidthMutationFactory)(t,p)})}return{redos:o,undos:s}}},{id:J.SPECIAL_PASTE_BESIDES_BORDER,specialPasteInfo:{label:`specialPaste.besidesBorder`},onPasteCells:(t,i,a,o)=>{e._instanceService.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET);let s=[],c=[],{range:l,unitId:u,subUnitId:d}=i,f=new n.ObjectMatrix;a.forValue((e,t,r)=>{let i=r.s;if(typeof i==`object`){let a=n.Tools.deepClone(r);a.s&&={...i,bd:null},f.setValue(l.rows[e],l.cols[t],a)}});let p={unitId:u,subUnitId:d,cellValue:f.clone()};s.push({id:r.SetRangeValuesMutation.id,params:p});let m=this._injector.invoke(r.SetRangeValuesUndoMutationFactory,p);c.push({id:r.SetRangeValuesMutation.id,params:m});let{undos:h,redos:g}=this._injector.invoke(e=>Aa(i,a,e));return c.push(...h),s.push(...g),{redos:s,undos:c}}}]}_getWorksheet(e,t){var r;let i=(r=this._instanceService.getUnit(e,n.UniverInstanceType.UNIVER_SHEET))==null?void 0:r.getSheetBySheetId(t);if(!i)throw Error(`[SheetClipboardController]: cannot find a worksheet with unitId ${e} and subUnitId ${t}.`);return i}_initCommandListener(){var e;this.disposeWithMe(this._commandService.onCommandExecuted(e=>{(e.id===r.AddWorksheetMergeCommand.id||Ma.includes(e.id))&&this._sheetClipboardService.removeMarkSelection()}));let t=this._configService.getConfig(U);t!=null&&(e=t.clipboardConfig)!=null&&e.hidePasteOptions||(this.disposeWithMe(this._commandService.onCommandExecuted(e=>{Ci.includes(e.id)&&this._sheetClipboardService.disposePasteOptionsCache()})),this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(e.id===ur.id){if(!this._sheetClipboardService.getPasteMenuVisible())return;let t=e.params.unitId,n=this._sheetClipboardService.getPasteOptionsCache();t===(n==null?void 0:n.target.unitId)&&this._refreshOptionalPaste$.next(Math.random())}})))}};Na=K([G(0,(0,n.Inject)(n.Injector)),G(1,n.IUniverInstanceService),G(2,a.IRenderManagerService),G(3,n.ICommandService),G(4,n.IContextService),G(5,n.IConfigService),G(6,gt),G(7,i.IClipboardInterfaceService),G(8,i.IMessageService),G(9,(0,n.Inject)(n.LocaleService)),G(10,(0,n.Optional)(gi))],Na);let Pa=class extends n.Disposable{constructor(e,t){super(),this._univerInstanceService=e,this._renderManagerService=t,z(this,`_currentCell$`,new o.Subject),z(this,`currentCell$`,this._currentCell$.asObservable().pipe((0,o.distinctUntilChanged)((e,t)=>{var n,r,i,a,o,s,c,l;return(e==null||(n=e.location)==null?void 0:n.unitId)===(t==null||(r=t.location)==null?void 0:r.unitId)&&(e==null||(i=e.location)==null?void 0:i.subUnitId)===(t==null||(a=t.location)==null?void 0:a.subUnitId)&&(e==null||(o=e.location)==null?void 0:o.row)===(t==null||(s=t.location)==null?void 0:s.row)&&(e==null||(c=e.location)==null?void 0:c.col)===(t==null||(l=t.location)==null?void 0:l.col)}))),z(this,`_endCell$`,new o.Subject),z(this,`endCell$`,this._endCell$.asObservable()),this._initCellDisposableListener()}dispose(){super.dispose(),this._currentCell$.complete(),this._endCell$.complete()}_initCellDisposableListener(){this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET).subscribe(e=>{e||(this._currentCell$.next(null),this._endCell$.next(null))}))}_calcActiveCell(e,t){let r=this._univerInstanceService.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET);if(!r)return null;let i=r.getActiveSheet();if(!i)return;let a=this._renderManagerService.getRenderUnitById(r.getUnitId());if(!a)return;let o=a.with(q).getCurrentParam(),s=a.with(Gn).getCurrentScrollState();if(o&&s&&a)return Dr(a,r,i,o,e,t)}onDragOver(e){let{offsetX:t,offsetY:n,dataTransfer:r}=e,i=this._calcActiveCell(t,n);if(!i){this._currentCell$.next(null);return}let{location:a,position:o}=i;this._currentCell$.next({location:a,position:o,dataTransfer:r})}onDrop(e){let{offsetX:t,offsetY:n,dataTransfer:r}=e,i=this._calcActiveCell(t,n);if(!i){this._endCell$.next(null);return}let{location:a,position:o}=i;this._endCell$.next({location:a,position:o,dataTransfer:r})}};Pa=K([G(0,n.IUniverInstanceService),G(1,a.IRenderManagerService)],Pa);let Fa=class extends n.Disposable{constructor(e,t,n,r){super(),this._context=e,this._renderManagerService=t,this._dragManagerService=n,this._sheetSkeletonManagerService=r,this._initDragEvent()}_initDragEvent(){let e=new n.DisposableCollection,t=t=>{if(e.dispose(),!t)return;let{scene:n}=this._context,r=n.onDragOver$.subscribeEvent(e=>{this._dragManagerService.onDragOver(e)}),i=n.onDrop$.subscribeEvent(e=>{this._dragManagerService.onDrop(e)});e.add({dispose(){r.unsubscribe(),i.unsubscribe()}})};t(this._sheetSkeletonManagerService.getCurrentParam()),this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.subscribe(e=>{t(e)}))}};Fa=K([G(1,a.IRenderManagerService),G(2,(0,n.Inject)(Pa)),G(3,(0,n.Inject)(q))],Fa);var Ia=class extends n.Disposable{constructor(...e){super(...e),z(this,`_position`,null),z(this,`_position$`,new o.BehaviorSubject(null)),z(this,`position$`,this._position$.asObservable()),z(this,`_focus`,!1),z(this,`_focus$`,new o.BehaviorSubject(this._focus)),z(this,`focus$`,this._focus$.asObservable()),z(this,`_fxBtnClick$`,new o.Subject),z(this,`fxBtnClick$`,this._fxBtnClick$.asObservable()),z(this,`_foldBtnStatus$`,new o.Subject),z(this,`foldBtnStatus$`,this._foldBtnStatus$.asObservable())}dispose(){super.dispose(),this._position$.complete(),this._focus$.complete(),this._position=null,this._focus=!1}setPosition(e){this._position=e,this._refresh(e)}getPosition(){return this._position}setFocus(e=!1){this._focus=e,this._focus$.next(e)}handleFxBtnClick(e){this._fxBtnClick$.next(e)}handleFoldBtnClick(e){this._foldBtnStatus$.next(e)}_refresh(e){this._position$.next(e)}};let La=(0,n.createIdentifier)(`univer.sheet-formula-editor-manager.service`),Ra=class extends n.RxDisposable{constructor(e,t,n,r,i,a,o,s,c){super(),this._univerInstanceService=e,this._renderManagerService=t,this._editorBridgeService=n,this._commandService=r,this._contextService=i,this._formulaEditorManagerService=a,this._undoRedoService=o,this._textSelectionManagerService=s,this._editorService=c,z(this,`_loadedMap`,/* @__PURE__ */ new WeakSet),z(this,`_scheduledCallback`,-1),this._initialize()}_initialize(){this._syncEditorSize(),this._listenFxBtnClick(),this._handleContentChange(),this._univerInstanceService.focused$.pipe((0,o.takeUntil)(this.dispose$)).subscribe(e=>{this._create(e)}),this._create(n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY),this.disposeWithMe(this._editorService.focus$.subscribe(()=>{this._syncFxBarFocusContext()}))}_syncFxBarFocusContext(){var e;((e=this._editorService.getFocusEditor())==null?void 0:e.getEditorId())===n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY?this._contextService.setContextValue(n.FOCUSING_FX_BAR_EDITOR,!0):this._contextService.getContextValue(n.FOCUSING_FX_BAR_EDITOR)&&this._contextService.getContextValue(n.EDITOR_ACTIVATED)||this._contextService.setContextValue(n.FOCUSING_FX_BAR_EDITOR,!1)}_handleContentChange(){this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(e.id===s.RichTextEditingMutation.id){let{unitId:t}=e.params;t===n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY&&this.autoScroll()}}))}_create(e){if(e!==n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY)return;let t=this._renderManagerService.getRenderUnitById(e);if(t==null)return;let{mainComponent:r}=t;r!=null&&(this._loadedMap.has(r)||this._loadedMap.add(r))}_listenFxBtnClick(){this._formulaEditorManagerService.fxBtnClick$.pipe((0,o.takeUntil)(this.dispose$)).subscribe(e=>{if(this._contextService.getContextValue(n.FOCUSING_UNIVER_EDITOR)&&!this._contextService.getContextValue(n.EDITOR_ACTIVATED)||e){var r;this._univerInstanceService.setCurrentUnitForType(n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY);let e=this._univerInstanceService.getUnit(n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY,n.UniverInstanceType.UNIVER_DOC);this._editorBridgeService.isVisible().visible===!1&&this._commandService.syncExecuteCommand(X.id,{visible:!0,eventType:a.DeviceInputEventType.PointerDown,unitId:n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY});let i=e==null||(r=e.getBody())==null?void 0:r.dataStream;if(i==null)return;let o=i.startsWith(`=`)?i:`=${i}`;o=o.replace(/\r\n$/,``);let s=[{startOffset:o.length,endOffset:o.length}],c={unitId:n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY,body:{dataStream:o},segmentId:``,textRanges:s};this._commandService.syncExecuteCommand(t.CoverContentCommand.id,c),requestAnimationFrame(()=>{this._textSelectionManagerService.replaceDocRanges([],{unitId:n.DOCS_NORMAL_EDITOR_UNIT_ID_KEY,subUnitId:n.DOCS_NORMAL_EDITOR_UNIT_ID_KEY}),this._textSelectionManagerService.replaceDocRanges(s,{unitId:n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY,subUnitId:n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY}),this._contextService.setContextValue(n.FOCUSING_FX_BAR_EDITOR,!0)})}})}_syncEditorSize(){let e=this._univerInstanceService.unitAdded$.pipe((0,o.filter)(e=>e.unit.getUnitId()===n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY));this.disposeWithMe((0,o.combineLatest)([this._formulaEditorManagerService.position$,e]).subscribe(([e])=>{if(!e)return this._clearScheduledCallback();let t=h(n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY,this._renderManagerService),r=this._univerInstanceService.getUnit(n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY,n.UniverInstanceType.UNIVER_DOC);if(t==null||r==null)return this._clearScheduledCallback();let{width:i,height:a}=e;if(i===0||a===0)return this._clearScheduledCallback();let{engine:o}=t;r.updateDocumentDataPageSize(i),this.autoScroll(),this._scheduledCallback=requestIdleCallback(()=>o.resizeBySize(i,a))}))}_clearScheduledCallback(){this._scheduledCallback!==-1&&cancelIdleCallback(this._scheduledCallback),this._scheduledCallback=-1}autoScroll(){var e;let r=this._formulaEditorManagerService.getPosition(),i=(e=this._renderManagerService.getRenderUnitById(n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY))==null?void 0:e.with(s.DocSkeletonManagerService).getSkeleton(),o=this._renderManagerService.getRenderUnitById(n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY),c=this._univerInstanceService.getUnit(n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY,n.UniverInstanceType.UNIVER_DOC);if(i==null||r==null||o==null||c==null)return;let{marginTop:l=0,marginBottom:u=0}=c.getSnapshot().documentStyle,{scene:d,mainComponent:f}=o,{actualHeight:p}=i.getActualSize();p+=l+u;let{width:m,height:h}=r,g=d.getViewport(t.VIEWPORT_KEY.VIEW_MAIN),_=g==null?void 0:g.getScrollBar();if(d.transformByState({width:m,height:p}),f==null||f.resize(m,p),p>h)_==null?g&&new a.ScrollBar(g,{enableHorizontal:!1,barSize:8}):g==null||g.resetCanvasSizeAndUpdateScroll();else{var v;_=null,g==null||g.scrollToViewportPos({viewportScrollX:0,viewportScrollY:0}),g==null||(v=g.getScrollBar())==null||v.dispose()}}};Ra=K([G(0,n.IUniverInstanceService),G(1,a.IRenderManagerService),G(2,Y),G(3,n.ICommandService),G(4,n.IContextService),G(5,La),G(6,n.IUndoRedoService),G(7,(0,n.Inject)(s.DocSelectionManagerService)),G(8,t.IEditorService)],Ra);let za=`embedding_formula_editor`,Ba=e=>e.includes(za),Va=(e,n)=>{let r=n.findNodePositionByCharIndex(e.startOffset,!0,e.segmentId,-1),i=n.getSkeletonData(),a=e.endOffset;if(e.segmentId){var o,s;let t=Array.from((i==null||(o=i.skeFooters.get(e.segmentId))==null?void 0:o.values())??[])[0]??Array.from((i==null||(s=i.skeHeaders.get(e.segmentId))==null?void 0:s.values())??[])[0];t&&(a=Math.min(t.ed,a))}let c=n.findNodePositionByCharIndex(a,!0,e.segmentId,-1);if(!c||!r)return;let{borderBoxPointGroup:l}=new t.NodePositionConvertToCursor({docsLeft:0,docsTop:0,pageMarginLeft:0,pageMarginTop:0},n).getRangePointData(r,c);return(0,t.getLineBounding)(l).map(e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right}))},Ha=(e,n,r=-1)=>{let i=n.findPositionByGlyph(e,r);if(!i)return;let a={...i,isBack:!0},{borderBoxPointGroup:o}=new t.NodePositionConvertToCursor({docsLeft:0,docsTop:0,pageMarginLeft:0,pageMarginTop:0},n).getRangePointData(a,a),s=(0,t.getLineBounding)(o)[0];if(s)return{top:s.top,bottom:s.bottom,left:s.left,right:s.right}},Ua=(e,t,n=0,r=0)=>{let i=Va({startOffset:t.startIndex,endOffset:t.endIndex+1,collapsed:!1},e);if(i)return{rects:i.map(e=>({top:e.top+r,bottom:e.bottom+r,left:e.left+n,right:e.right+n})),range:t}},Wa=(e,t,n=0,r=0)=>{var i;let a=e.findNodeByCharIndex(t.startIndex),o=a==null?void 0:a.parent,s=o==null?void 0:o.parent,c=s==null?void 0:s.parent,l=c==null?void 0:c.lines.find(e=>e.paragraphStart&&e.paragraphIndex===t.startIndex),u=l==null||(i=l.divides)==null||(i=i[0])==null||(i=i.glyphGroup)==null?void 0:i[0];if(!u||!u)return;let d=Ha(u,e);if(d)return{rect:{top:d.top+r,bottom:d.bottom+r,left:d.left+n,right:d.right+n},segmentId:void 0,segmentPageIndex:-1,paragraph:t}},Ga=(e,t=0,r=0)=>{var i,a,o;let s=e.getViewModel().getDataModel(),c=((i=s.getBody())==null||(i=i.customRanges)==null?void 0:i.filter(e=>e.rangeType===n.CustomRangeType.HYPERLINK))??[],l=((a=s.getBody())==null||(a=a.paragraphs)==null?void 0:a.filter(e=>{var t;return((t=e.bullet)==null?void 0:t.listType.indexOf(n.PresetListType.CHECK_LIST))===0}))??[],u=(o=e.getSkeletonData())==null?void 0:o.pages[0].skeDrawings;return{links:c.map(n=>Ua(e,n,t,r)).filter(Boolean),checkLists:l.map(n=>Wa(e,n,t,r)).filter(Boolean),drawings:u?Array.from(u.keys()).map(e=>({drawingId:e,rect:{top:u.get(e).aTop,bottom:u.get(e).aTop+u.get(e).height,left:u.get(e).aLeft,right:u.get(e).aLeft+u.get(e).width},drawing:u.get(e)})):[]}};function Ka(e,t,r){var i,a;let o=((i=t.documentSkeleton)==null||(i=i.getSkeletonData())==null?void 0:i.pages[0].height)??0,s=((a=t.documentSkeleton)==null||(a=a.getSkeletonData())==null?void 0:a.pages[0].width)??0,c=t.verticalAlign,l=t.horizontalAlign,u=0;switch(c){case n.VerticalAlign.UNSPECIFIED:case n.VerticalAlign.BOTTOM:u=e.mergeInfo.endY-e.mergeInfo.startY-o;break;case n.VerticalAlign.MIDDLE:u=(e.mergeInfo.endY-e.mergeInfo.startY-o)/2}let d=0;switch(l){case n.HorizontalAlign.RIGHT:d=e.mergeInfo.endX-e.mergeInfo.startX-s;break;case n.HorizontalAlign.CENTER:d=(e.mergeInfo.endX-e.mergeInfo.startX-s)/2;break;case n.HorizontalAlign.UNSPECIFIED:r&&(d=e.mergeInfo.endX-e.mergeInfo.startX-s)}return{paddingLeft:d,paddingTop:u}}let qa=(e,r,i,o,s,c)=>{var l;let u=e.get(n.IUniverInstanceService),d=e.get(a.IRenderManagerService),f=u.getUnit(r,n.UniverInstanceType.UNIVER_SHEET);if(!f)return null;let p=f.getSheetBySheetId(i);if(!p)return null;let m=d.getRenderUnitById(f.getUnitId()),h=m==null?void 0:m.with(q).getSkeletonParam(p.getSheetId()),g=h==null?void 0:h.skeleton;if(!g||!m)return;let _=g.getFont(o,s),v=_==null?void 0:_.documentSkeleton;if(!v)return null;let y=(l=v.getViewModel().getBody())==null||(l=l.customRanges)==null?void 0:l.find(e=>e.rangeId===c);if(!y)return null;let b=t.DOC_VERTICAL_PADDING,{actualColumn:x,actualRow:S}=g.getCellWithCoordByIndex(o,s);g.overflowCache.forValue((e,t,n)=>{n.startRow<=S&&n.endRow>=S&&n.startColumn<=x&&n.endColumn>=x&&(x=t,S=e)});let C=g.getCellWithCoordByIndex(S,x),w=p.getCell(C.actualRow,C.actualColumn),{topOffset:T=0,leftOffset:E=0}=(w==null?void 0:w.fontRenderExtension)??{},{paddingLeft:D,paddingTop:O}=Ka(C,_,!1),k=Va({startOffset:y.startIndex,endOffset:y.endIndex,collapsed:!1},v);return{rects:k==null?void 0:k.map(e=>({top:e.top+C.mergeInfo.startY+O+T+b,bottom:e.bottom+C.mergeInfo.startY+O+T+b,left:e.left+C.mergeInfo.startX+D+E,right:e.right+C.mergeInfo.startX+D+E})),customRange:y,label:v.getViewModel().getBody().dataStream.slice(y.startIndex,y.endIndex+1)}},Ja=(e,t,n,r,i,o)=>{var c,l;let u=e.get(Y),d=u.getEditCellState();if(!d||!u.isVisible().visible)return null;let{editorUnitId:f,unitId:p,sheetId:m,row:h,column:g}=d;if(t!==p||n!==m||h!==r||g!==i)return null;let _=e.get(a.IRenderManagerService),v=_.getRenderUnitById(f),y=_.getRenderUnitById(t);if(!v||!y)return null;let b=v.with(s.DocSkeletonManagerService).getSkeleton(),x=(c=y.with(q).getSkeletonParam(m))==null?void 0:c.skeleton;if(!b||!x)return null;let S=(l=b.getViewModel().getBody())==null||(l=l.customRanges)==null?void 0:l.find(e=>e.rangeId===o);if(!S)return null;let C=Va({startOffset:S.startIndex,endOffset:S.endIndex,collapsed:!1},b),w=v.engine.getCanvasElement().getBoundingClientRect();return{rects:C==null?void 0:C.map(e=>({top:e.top+w.top-4,bottom:e.bottom+w.top+4,left:e.left+w.left,right:e.right+w.left})),customRange:S,label:b.getViewModel().getBody().dataStream.slice(S.startIndex,S.endIndex+1)}};function Ya(e){let{workbook:t,worksheet:n,...r}=e;return r}function Xa(e,t,n){var r;let i=(r=e.documentSkeleton)==null?void 0:r.getViewModel().getDataModel().getDrawings(),o={left:0,top:0,right:t.mergeInfo.endX-t.mergeInfo.startX,bottom:t.mergeInfo.endY-t.mergeInfo.startY};return n.map(t=>{var n,r,s;let c=i==null?void 0:i[t.drawingId],l=(c==null||(n=c.docTransform)==null?void 0:n.size.width)??t.drawing.width,u=(c==null||(r=c.docTransform)==null?void 0:r.size.height)??t.drawing.height;return{...t,rect:(0,a.calculateCellImageRect)({cellRect:o,imageWidth:l,imageHeight:u,horizontalAlign:e.horizontalAlign,verticalAlign:e.verticalAlign,padding:(s=e.style)==null?void 0:s.pd})}})}let Za=class extends n.Disposable{constructor(e,t){super(),this._univerInstanceService=e,this._renderManagerService=t,z(this,`_currentCell$`,new o.BehaviorSubject(null)),z(this,`_currentRichText$`,new o.BehaviorSubject(null)),z(this,`_currentClickedCell$`,new o.Subject),z(this,`_currentDbClickedCell$`,new o.Subject),z(this,`_currentCellWithEvent$`,new o.Subject),z(this,`_currentPointerDownCell$`,new o.Subject),z(this,`_currentPointerUpCell$`,new o.Subject),z(this,`_currentHoveredRowHeader$`,new o.BehaviorSubject(null)),z(this,`_currentHoveredColHeader$`,new o.BehaviorSubject(null)),z(this,`_currentRowHeaderClick$`,new o.Subject),z(this,`_currentColHeaderClick$`,new o.Subject),z(this,`_currentRowHeaderDbClick$`,new o.Subject),z(this,`_currentColHeaderDbClick$`,new o.Subject),z(this,`_currentRowHeaderPointerDown$`,new o.Subject),z(this,`_currentColHeaderPointerDown$`,new o.Subject),z(this,`_currentRowHeaderPointerUp$`,new o.Subject),z(this,`_currentColHeaderPointerUp$`,new o.Subject),z(this,`currentCell$`,this._currentCell$.asObservable().pipe((0,o.distinctUntilChanged)((e,t)=>{var n,r,i,a,o,s,c,l;return(e==null||(n=e.location)==null?void 0:n.unitId)===(t==null||(r=t.location)==null?void 0:r.unitId)&&(e==null||(i=e.location)==null?void 0:i.subUnitId)===(t==null||(a=t.location)==null?void 0:a.subUnitId)&&(e==null||(o=e.location)==null?void 0:o.row)===(t==null||(s=t.location)==null?void 0:s.row)&&(e==null||(c=e.location)==null?void 0:c.col)===(t==null||(l=t.location)==null?void 0:l.col)}))),z(this,`currentRichTextNoDistinct$`,this._currentRichText$.pipe((0,o.map)(e=>e&&{unitId:e.location.unitId,subUnitId:e.location.subUnitId,row:e.location.row,col:e.location.col,customRange:e.customRange,bullet:e.bullet,rect:e.rect,drawing:e.drawing}))),z(this,`currentRichText$`,this._currentRichText$.pipe((0,o.distinctUntilChanged)((e,t)=>{var n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y;return(e==null||(n=e.location)==null?void 0:n.unitId)===(t==null||(r=t.location)==null?void 0:r.unitId)&&(e==null||(i=e.location)==null?void 0:i.subUnitId)===(t==null||(a=t.location)==null?void 0:a.subUnitId)&&(e==null||(o=e.location)==null?void 0:o.row)===(t==null||(s=t.location)==null?void 0:s.row)&&(e==null||(c=e.location)==null?void 0:c.col)===(t==null||(l=t.location)==null?void 0:l.col)&&(e==null||(u=e.customRange)==null?void 0:u.rangeId)===(t==null||(d=t.customRange)==null?void 0:d.rangeId)&&(e==null||(f=e.bullet)==null?void 0:f.startIndex)===(t==null||(p=t.bullet)==null?void 0:p.startIndex)&&(e==null||(m=e.customRange)==null?void 0:m.startIndex)===(t==null||(h=t.customRange)==null?void 0:h.startIndex)&&(e==null||(g=e.customRange)==null?void 0:g.endIndex)===(t==null||(_=t.customRange)==null?void 0:_.endIndex)&&(e==null||(v=e.drawing)==null?void 0:v.drawingId)===(t==null||(y=t.drawing)==null?void 0:y.drawingId)}),(0,o.map)(e=>e&&{unitId:e.location.unitId,subUnitId:e.location.subUnitId,row:e.location.row,col:e.location.col,customRange:e.customRange,bullet:e.bullet,rect:e.rect,drawing:e.drawing}))),z(this,`currentCellPosWithEvent$`,this._currentCellWithEvent$.pipe((0,o.distinctUntilChanged)((e,t)=>{var n,r,i,a,o,s,c,l;return(e==null||(n=e.location)==null?void 0:n.unitId)===(t==null||(r=t.location)==null?void 0:r.unitId)&&(e==null||(i=e.location)==null?void 0:i.subUnitId)===(t==null||(a=t.location)==null?void 0:a.subUnitId)&&(e==null||(o=e.location)==null?void 0:o.row)===(t==null||(s=t.location)==null?void 0:s.row)&&(e==null||(c=e.location)==null?void 0:c.col)===(t==null||(l=t.location)==null?void 0:l.col)}),(0,o.map)(e=>e&&{unitId:e.location.unitId,subUnitId:e.location.subUnitId,row:e.location.row,col:e.location.col,event:e.event}))),z(this,`currentPosition$`,this._currentCell$.asObservable()),z(this,`currentClickedCell$`,this._currentClickedCell$.asObservable()),z(this,`currentDbClickedCell$`,this._currentDbClickedCell$.asObservable()),z(this,`currentPointerDownCell$`,this._currentPointerDownCell$.asObservable()),z(this,`currentPointerUpCell$`,this._currentPointerUpCell$.asObservable()),z(this,`currentHoveredRowHeader$`,this._currentHoveredRowHeader$.asObservable()),z(this,`currentHoveredColHeader$`,this._currentHoveredColHeader$.asObservable()),z(this,`currentRowHeaderClick$`,this._currentRowHeaderClick$.asObservable()),z(this,`currentColHeaderClick$`,this._currentColHeaderClick$.asObservable()),z(this,`currentRowHeaderDbClick$`,this._currentRowHeaderDbClick$.asObservable()),z(this,`currentColHeaderDbClick$`,this._currentColHeaderDbClick$.asObservable()),z(this,`currentRowHeaderPointerDown$`,this._currentRowHeaderPointerDown$.asObservable()),z(this,`currentColHeaderPointerDown$`,this._currentColHeaderPointerDown$.asObservable()),z(this,`currentRowHeaderPointerUp$`,this._currentRowHeaderPointerUp$.asObservable()),z(this,`currentColHeaderPointerUp$`,this._currentColHeaderPointerUp$.asObservable()),this._initCellDisposableListener()}dispose(){super.dispose(),this._currentCell$.complete(),this._currentClickedCell$.complete(),this._currentPointerDownCell$.complete(),this._currentPointerUpCell$.complete(),this._currentCellWithEvent$.complete(),this._currentRichText$.complete(),this._currentDbClickedCell$.complete(),this._currentHoveredRowHeader$.complete(),this._currentHoveredColHeader$.complete(),this._currentRowHeaderClick$.complete(),this._currentColHeaderClick$.complete(),this._currentRowHeaderDbClick$.complete(),this._currentColHeaderDbClick$.complete(),this._currentRowHeaderPointerDown$.complete(),this._currentColHeaderPointerDown$.complete(),this._currentRowHeaderPointerUp$.complete(),this._currentColHeaderPointerUp$.complete(),this.currentCellPosWithEvent$=(0,o.of)(null),this.currentRichText$=(0,o.of)(null)}_initCellDisposableListener(){this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET).subscribe(e=>{e||this._currentCell$.next(null)})),this.disposeWithMe(this._univerInstanceService.unitDisposed$.subscribe(e=>{var t,n;((t=this._currentCell$.getValue())==null?void 0:t.location.unitId)===e.getUnitId()&&this._currentCell$.next(null),((n=this._currentRichText$.getValue())==null?void 0:n.location.unitId)===e.getUnitId()&&this._currentRichText$.next(null)}))}_getCalcDeps(e){let t=this._univerInstanceService.getUnit(e,n.UniverInstanceType.UNIVER_SHEET);if(!t)return null;let r=t.getActiveSheet();if(!r)return null;let i=this._renderManagerService.getRenderUnitById(t.getUnitId());if(!i)return null;let a=i.with(q).getSkeletonParam(r.getSheetId());if(!a)return null;let o=i.with(Gn);if(o!=null&&o.getCurrentScrollState()&&i)return{currentRender:i,workbook:t,worksheet:r,skeletonParam:a}}_calcActiveCell(e,t,r,i,a,o){let s=Dr(e,t,r,i,a,o),c=i.skeleton;if(!s)return null;let{position:l,overflowLocation:u,location:d}=s,f=c.getFont(u.row,u.col),p=null,m=null,h=null,g=c.getCellWithCoordByIndex(u.row,u.col),_=r.getCell(u.row,u.col),{topOffset:v=0,leftOffset:y=0}=(_==null?void 0:_.fontRenderExtension)??{};if(f!=null&&f.documentSkeleton){let{paddingLeft:e,paddingTop:t}=Ka(g,f,_!=null&&_.p?!1:(0,n.isRealNum)(_==null?void 0:_.v)&&(!(_!=null&&_.t)||_.t===n.CellValueType.NUMBER)),r=Ga(f.documentSkeleton,e,t),i=Xa(f,g,r.drawings),s=a-l.startX-y,c=o-l.startY-v;p=r.links.find(e=>e.rects.some(e=>e.left<=s&&s<=e.right&&e.top<=c&&c<=e.bottom)),m=r.checkLists.find(e=>e.rect.left<=s&&s<=e.rect.right&&e.rect.top<=c&&c<=e.rect.bottom),h=i.find(e=>e.rect.left<=s&&s<=e.rect.right&&e.rect.top<=c&&c<=e.rect.bottom)}let b=(p==null?void 0:p.rects.pop())??(m==null?void 0:m.rect)??(h==null?void 0:h.rect),x=b&&(()=>{let e=b.top+g.mergeInfo.startY+v,t=b.bottom+g.mergeInfo.startY+v,n=b.left+g.mergeInfo.startX+y,r=b.right+g.mergeInfo.startX+y,i=g.mergeInfo.startY+v,a=g.mergeInfo.endY+v,o=g.mergeInfo.startX+y,s=g.mergeInfo.endX+y;return{top:Math.min(Math.max(e,i),i),bottom:Math.min(t,a),left:Math.min(Math.max(n,o),o),right:Math.min(r,s)}})();return{location:d,position:l,overflowLocation:u,customRange:p==null?void 0:p.range,bullet:m==null?void 0:m.paragraph,drawing:h,rect:x}}_calcActiveRowHeader(e,t,n){let r=this._getCalcDeps(e);if(!r)return;let{currentRender:i,worksheet:o,skeletonParam:s}=r,{scaleY:c}=i.scene.getAncestorScale(),l=i.scene.getViewports().find(e=>e.isHit(new a.Vector2(t,n)));if(!l||l.viewportKey!==a.SHEET_VIEWPORT_KEY.VIEW_ROW_TOP&&l.viewportKey!==a.SHEET_VIEWPORT_KEY.VIEW_ROW_BOTTOM)return;let u={x:l.viewportScrollX,y:l.viewportScrollY};return{unitId:e,index:s.skeleton.getRowIndexByOffsetY(n,c,u),subUnitId:o.getSheetId()}}_calcActiveColHeader(e,t,n){let r=this._getCalcDeps(e);if(!r)return;let{currentRender:i,worksheet:o,skeletonParam:s}=r,{scaleX:c}=i.scene.getAncestorScale(),l=i.scene.getViewports().find(e=>e.isHit(new a.Vector2(t,n)));if(!l||l.viewportKey!==a.SHEET_VIEWPORT_KEY.VIEW_COLUMN_LEFT&&l.viewportKey!==a.SHEET_VIEWPORT_KEY.VIEW_COLUMN_RIGHT)return;let u={x:l.viewportScrollX,y:l.viewportScrollY};return{unitId:e,index:s.skeleton.getColumnIndexByOffsetX(t,c,u),subUnitId:o.getSheetId()}}triggerPointerDown(e,t){let n=this._getCalcDeps(e);if(!n)return;let{currentRender:r,workbook:i,worksheet:a,skeletonParam:o}=n,s=this._calcActiveCell(r,i,a,o,t.offsetX,t.offsetY);if(s&&s.location){let{unitId:e,subUnitId:n,row:r,col:i}=Ya(s.location);this._currentPointerDownCell$.next({unitId:e,subUnitId:n,row:r,col:i,event:t})}}triggerPointerUp(e,t){let n=this._getCalcDeps(e);if(!n)return;let{currentRender:r,workbook:i,worksheet:a,skeletonParam:o}=n,s=this._calcActiveCell(r,i,a,o,t.offsetX,t.offsetY);if(s){let e=Ya(s.location);this._currentPointerUpCell$.next({...e,event:t})}}triggerMouseMove(e,t){let n=this._getCalcDeps(e);if(!n)return;let{currentRender:r,workbook:i,worksheet:a,skeletonParam:o}=n,s=this._calcActiveCell(r,i,a,o,t.offsetX,t.offsetY);this._currentCell$.next(s&&{location:Ya(s.location),position:s.position}),this._currentRichText$.next(s&&{...s,location:Ya(s.overflowLocation)}),this._currentCellWithEvent$.next(s&&{...s,location:Ya(s.location),event:t})}triggerClick(e,t,n){let r=this._getCalcDeps(e);if(!r)return;let{currentRender:i,workbook:a,worksheet:o,skeletonParam:s}=r,c=this._calcActiveCell(i,a,o,s,t,n);c&&this._currentClickedCell$.next({...c,location:Ya(c.location)})}triggerDbClick(e,t){let n=this._getCalcDeps(e);if(!n)return;let{currentRender:r,workbook:i,worksheet:a,skeletonParam:o}=n,s=this._calcActiveCell(r,i,a,o,t.offsetX,t.offsetY);s&&this._currentDbClickedCell$.next({...s,location:Ya(s.location),event:t})}triggerMouseLeave(){this._currentCell$.next(null)}triggerScroll(){this._currentCell$.next(null)}triggerRowHeaderClick(e,t,n){let r=this._calcActiveRowHeader(e,t,n);r&&this._currentRowHeaderClick$.next(r)}triggerColHeaderClick(e,t,n){let r=this._calcActiveColHeader(e,t,n);r&&this._currentColHeaderClick$.next(r)}triggerRowHeaderDbClick(e,t,n){let r=this._calcActiveRowHeader(e,t,n);r&&this._currentRowHeaderDbClick$.next(r)}triggerColHeaderDbClick(e,t,n){let r=this._calcActiveColHeader(e,t,n);r&&this._currentColHeaderDbClick$.next(r)}triggerRowHeaderMouseMove(e,t,n){this._currentHoveredRowHeader$.next(this._calcActiveRowHeader(e,t,n))}triggerColHeaderMouseMove(e,t,n){this._currentHoveredColHeader$.next(this._calcActiveColHeader(e,t,n))}triggerRowHeaderPoniterDown(e,t,n){let r=this._calcActiveRowHeader(e,t,n);r&&this._currentRowHeaderPointerDown$.next(r)}triggerColHeaderPoniterDown(e,t,n){let r=this._calcActiveColHeader(e,t,n);r&&this._currentColHeaderPointerDown$.next(r)}triggerRowHeaderPoniterUp(e,t,n){let r=this._calcActiveRowHeader(e,t,n);r&&this._currentRowHeaderPointerUp$.next(r)}triggerColHeaderPoniterUp(e,t,n){let r=this._calcActiveColHeader(e,t,n);r&&this._currentColHeaderPointerUp$.next(r)}};Za=K([G(0,n.IUniverInstanceService),G(1,a.IRenderManagerService)],Za);let Qa=class extends n.Disposable{get active(){return this._active}constructor(e,t,n,r){super(),this._context=e,this._hoverManagerService=t,this._sheetSkeletonManagerService=n,this._scrollManagerService=r,z(this,`_active`,!1),this._initPointerEvent(),this._initScrollEvent()}_initPointerEvent(){let e=new n.DisposableCollection,t=t=>{if(e.dispose(),!t)return;let{mainComponent:r,unitId:i,components:a}=this._context;if(!r)return;e.add(r.onPointerEnter$.subscribeEvent(()=>{this._active=!0})),e.add((0,n.fromEventSubject)(r.onPointerMove$).subscribe(e=>{this._active=!0,this._hoverManagerService.triggerMouseMove(i,e)})),e.add(r.onPointerDown$.subscribeEvent(e=>{this._hoverManagerService.triggerPointerDown(i,e)})),e.add(r.onPointerUp$.subscribeEvent(e=>{this._hoverManagerService.triggerPointerUp(i,e)})),e.add(r.onClick$.subscribeEvent(e=>{this._hoverManagerService.triggerClick(i,e.offsetX,e.offsetY)})),e.add(r.onDblclick$.subscribeEvent(e=>{this._hoverManagerService.triggerDbClick(i,e)})),e.add(r.onPointerLeave$.subscribeEvent(()=>{this._active=!1,this._hoverManagerService.triggerMouseLeave()}));let o=a.get(`__SpreadsheetRowHeader__`),s=a.get(`__SpreadsheetColumnHeader__`);o&&(e.add(o.onPointerMove$.subscribeEvent(e=>{this._hoverManagerService.triggerRowHeaderMouseMove(i,e.offsetX,e.offsetY)})),e.add(o.onPointerDown$.subscribeEvent(e=>{this._hoverManagerService.triggerRowHeaderPoniterDown(i,e.offsetX,e.offsetY)})),e.add(o.onPointerUp$.subscribeEvent(e=>{this._hoverManagerService.triggerRowHeaderPoniterUp(i,e.offsetX,e.offsetY),this._hoverManagerService.triggerRowHeaderClick(i,e.offsetX,e.offsetY)})),e.add(o.onDblclick$.subscribeEvent(e=>{this._hoverManagerService.triggerRowHeaderDbClick(i,e.offsetX,e.offsetY)}))),s&&(e.add(s.onPointerMove$.subscribeEvent(e=>{this._hoverManagerService.triggerColHeaderMouseMove(i,e.offsetX,e.offsetY)})),e.add(s.onPointerDown$.subscribeEvent(e=>{this._hoverManagerService.triggerColHeaderPoniterDown(i,e.offsetX,e.offsetY)})),e.add(s.onPointerUp$.subscribeEvent(e=>{this._hoverManagerService.triggerColHeaderPoniterUp(i,e.offsetX,e.offsetY),this._hoverManagerService.triggerColHeaderClick(i,e.offsetX,e.offsetY)})),e.add(s.onDblclick$.subscribeEvent(e=>{this._hoverManagerService.triggerColHeaderDbClick(i,e.offsetX,e.offsetY)})))};t(this._sheetSkeletonManagerService.getCurrentParam()),this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.subscribe(e=>{t(e)}))}_initScrollEvent(){this.disposeWithMe(this._scrollManagerService.validViewportScrollInfo$.subscribe(()=>this._hoverManagerService.triggerScroll()))}};Qa=K([G(1,(0,n.Inject)(Za)),G(2,(0,n.Inject)(q)),G(3,(0,n.Inject)(Gn))],Qa);let $a=`UNIVER_SHEET_PERMISSION_ALERT_DIALOG_ID`,eo=`UNIVER_SHEET_PERMISSION_ALERT_DIALOG`,to=class extends n.Disposable{constructor(e,t,r,i,a,o,s){super(),this._commandService=e,this._permissionService=t,this._dialogService=r,this._rangeProtectionRuleModel=i,this._localeService=a,this._contextService=o,this._sheetPermissionCheckController=s,z(this,`disposableCollection`,new n.DisposableCollection),this._initialize(),this._initUIEvent()}_initUIEvent(){this.disposeWithMe(this._sheetPermissionCheckController.triggerPermissionUIEvent$.subscribe(e=>{this._haveNotPermissionHandle(e)}))}_haveNotPermissionHandle(e){let t={id:$a,title:{title:`sheets-ui.permission.dialog.alert`},children:{label:eo,errorMsg:e},width:320,showOk:!0,onClose:()=>{this._dialogService.close($a)},onOk:()=>{this._dialogService.close($a)},className:`sheet-permission-user-dialog`};this._permissionService.getShowComponents()&&this._dialogService.open(t)}_getPermissionCheck(e){let{id:i}=e,a=!0,o=``,c;switch(i){case s.InsertTextCommand.id:case t.IMEInputCommand.id:if(c=e.params,!c||!n.SHEET_EDITOR_UNITS.includes(c.unitId)||this._contextService.getContextValue(n.FOCUSING_EDITOR_STANDALONE)===!0||this._contextService.getContextValue(n.FOCUSING_COMMENT_EDITOR)===!0)break;a=this._sheetPermissionCheckController.permissionCheckWithoutRange({workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetSetCellValuePermission,r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]}),o=this._localeService.t(`sheets-ui.permission.dialog.editErr`);break;case X.id:if(c=e.params,c.visible===!1)break;a=this._sheetPermissionCheckController.permissionCheckWithoutRange({workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetSetCellValuePermission,r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]},n.SHEET_EDITOR_UNITS.includes(c.unitId)?void 0:c.unitId),o=this._localeService.t(`sheets-ui.permission.dialog.editErr`);break;case Wn.id:a=this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellValuePermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]}),o=this._localeService.t(`sheets-ui.permission.dialog.commonErr`)}a||this._sheetPermissionCheckController.blockExecuteWithoutPermission(o)}_initialize(){this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(e=>{this._getPermissionCheck(e)}))}};to=K([G(0,n.ICommandService),G(1,n.IPermissionService),G(2,i.IDialogService),G(3,(0,n.Inject)(r.RangeProtectionRuleModel)),G(4,(0,n.Inject)(n.LocaleService)),G(5,n.IContextService),G(6,(0,n.Inject)(r.SheetPermissionCheckController))],to);let no=1.5,ro=(0,n.createInterceptorKey)(`freezePermissionCheck`),io=class extends n.Disposable{constructor(e,t,r,i,a,o,s,c){super(),this._context=e,this._sheetSkeletonManagerService=t,this._commandService=r,this._selectionManagerService=i,this._scrollManagerService=a,this._themeService=o,this._sheetInterceptorService=s,this._injector=c,z(this,`_rowFreezeHeaderRect`,void 0),z(this,`_rowFreezeMainRect`,void 0),z(this,`_columnFreezeHeaderRect`,void 0),z(this,`_columnFreezeMainRect`,void 0),z(this,`_freezeDownSubs`,void 0),z(this,`_freezePointerEnterSubs`,void 0),z(this,`_freezePointerLeaveSubs`,void 0),z(this,`_scenePointerMoveSub`,void 0),z(this,`_scenePointerUpSub`,void 0),z(this,`_changeToRow`,-1),z(this,`_changeToColumn`,-1),z(this,`_changeToOffsetX`,0),z(this,`_changeToOffsetY`,0),z(this,`_activeViewport`,null),z(this,`_freezeNormalHeaderColor`,``),z(this,`_freezeNormalMainColor`,``),z(this,`_freezeActiveColor`,``),z(this,`_freezeHoverColor`,``),z(this,`_lastFreeze`,void 0),z(this,`interceptor`,new n.InterceptorManager({FREEZE_PERMISSION_CHECK:ro})),this._initialize()}_getSheetType(){var e;return(e=this._context.unit.getActiveSheet())==null?void 0:e.getConfig().type}dispose(){this._clearFreeze(),super.dispose()}_initialize(){this._skeletonListener(),this._commandExecutedListener(),this._themeChangeListener(),this._interceptorCommands(),this._bindViewportScroll(),this._zoomRefresh()}_createFreeze(e=0,t){var r;if(this._getSheetType()===n.SheetTypes.CHART)return null;let i=t??this._getFreeze();if(i==null)return null;let o=(r=this._sheetSkeletonManagerService.getCurrentParam())==null?void 0:r.skeleton,{startRow:s,startColumn:c}=i,l=this._getPositionByIndex(s,c);if(l==null||o==null)return null;let u=this._getSheetObject().scene,{startX:d,startY:f}=l,{rowTotalHeight:p,columnTotalWidth:m,rowHeaderWidthAndMarginLeft:h,columnHeaderHeightAndMarginTop:g}=o;this._changeToRow=s,this._changeToColumn=c,this._changeToOffsetX=d,this._changeToOffsetY=f;let _=Math.max(u.scaleX,u.scaleY),v=2/Math.max(1,_);if(e===0){(s===-1||s===0)&&(v*=no);let e=v;this._rowFreezeHeaderRect=new a.Rect(`__SpreadsheetFreezeRowHeaderName__`,{fill:this._freezeNormalHeaderColor,width:h,height:v,left:0,top:f-e,zIndex:3});let t=this._freezeNormalHeaderColor;(s===-1||s===0)&&(t=this._freezeNormalMainColor),this._rowFreezeMainRect=new a.Rect(`__SpreadsheetFreezeRowMainName__`,{fill:t,width:m,height:v,left:h,top:f-e,zIndex:3}),this._rowFreezeHeaderRect.viewportCacheReusable=!0,this._rowFreezeMainRect.viewportCacheReusable=!0,u.addObjects([this._rowFreezeHeaderRect,this._rowFreezeMainRect],10)}else{(c===-1||c===0)&&(v*=no);let e=v;this._columnFreezeHeaderRect=new a.Rect(`__SpreadsheetFreezeColumnHeaderName__`,{fill:this._freezeNormalHeaderColor,width:v,height:g,left:d-e,top:0,zIndex:3});let t=this._freezeNormalHeaderColor;(c===-1||c===0)&&(t=this._freezeNormalMainColor),this._columnFreezeMainRect=new a.Rect(`__SpreadsheetFreezeColumnMainName__`,{fill:t,width:v,height:p,left:d-e,top:g,zIndex:3}),this._columnFreezeHeaderRect.viewportCacheReusable=!0,this._columnFreezeMainRect.viewportCacheReusable=!0,u.addObjects([this._columnFreezeHeaderRect,this._columnFreezeMainRect],10)}this._eventBinding(e)}_eventBinding(e=0){let t=this._rowFreezeHeaderRect,n=this._rowFreezeMainRect;e===1&&(t=this._columnFreezeHeaderRect,n=this._columnFreezeMainRect);let r=this._getSheetObject();if(r==null)return;let{scene:i}=r;if(this._freezePointerEnterSubs=new o.Subscription,this._freezePointerLeaveSubs=new o.Subscription,this._freezeDownSubs=new o.Subscription,n){let e=n.onPointerEnter$.subscribeEvent(()=>{if(!this.interceptor.fetchThroughInterceptors(ro)(!0,null))return!1;t==null||t.setProps({fill:this._freezeHoverColor,zIndex:4}),i.setCursor(a.CURSOR_TYPE.GRAB)});this._freezePointerEnterSubs.add(e);let r=n.onPointerLeave$.subscribeEvent(()=>{t==null||t.setProps({fill:this._freezeNormalHeaderColor,zIndex:3}),i.resetCursor()});this._freezePointerLeaveSubs.add(r)}if(t){let e=t.onPointerEnter$.subscribeEvent(()=>{if(!this.interceptor.fetchThroughInterceptors(ro)(!0,null))return!1;t==null||t.setProps({fill:this._freezeHoverColor,zIndex:4}),i.setCursor(a.CURSOR_TYPE.GRAB)});this._freezePointerEnterSubs.add(e);let n=t.onPointerLeave$.subscribeEvent(()=>{t==null||t.setProps({fill:this._freezeNormalHeaderColor,zIndex:3}),i.resetCursor()});this._freezePointerLeaveSubs.add(n)}let s=t==null?void 0:t.onPointerDown$.subscribeEvent(r=>{this._freezeDown(r,t,n,e)});s&&this._freezeDownSubs.add(s);let c=n==null?void 0:n.onPointerDown$.subscribeEvent(r=>{this._freezeDown(r,t,n,e)});c&&this._freezeDownSubs.add(c)}_getCurrentLastVisible(){var e;let t=this._getSheetObject();if(t==null)return;let n=(e=this._sheetSkeletonManagerService.getCurrentParam())==null?void 0:e.skeleton;if(n==null)return;let r=t.scene,i=Math.max(r.scaleX,r.scaleY),a=this._scrollManagerService.getCurrentScrollState(),o=(t.engine.height-n.columnHeaderHeight)/i,s=(t.engine.width-n.rowHeaderWidth)/i,c=(a==null?void 0:a.sheetViewStartRow)??0,l=c===0?-((a==null?void 0:a.offsetY)??0):n.rowHeightAccumulation[c-1]-((a==null?void 0:a.offsetY)??0),u=0,d=!1;for(let e=c,t=n.rowHeightAccumulation.length;e<t;e++)if(n.rowHeightAccumulation[e]-l>o){u=e,d=!0;break}d||(u=n.rowHeightAccumulation.length-1);let f=(a==null?void 0:a.sheetViewStartColumn)??0,p=f===0?-((a==null?void 0:a.offsetX)??0):n.columnWidthAccumulation[f-1]-((a==null?void 0:a.offsetX)??0),m=0,h=!1;for(let e=f,t=n.columnWidthAccumulation.length;e<t;e++)if(n.columnWidthAccumulation[e]-p>s){m=e,h=!0;break}return h||(m=n.columnWidthAccumulation.length-1),{lastRow:u,lastColumn:m}}_getActiveViewport(e){var t;let n=(t=this._getSheetObject())==null?void 0:t.scene.getViewports();return n&&n.find(t=>t.isHit(new a.Vector2(e.offsetX,e.offsetY)))||null}_freezeDown(e,t,i,o=0){var s;let c=(s=this._sheetSkeletonManagerService.getCurrentParam())==null?void 0:s.skeleton;if(c==null)return;let l=this._getSheetObject();if(l==null)return;if(!this.interceptor.fetchThroughInterceptors(ro)(!0,null))return!1;let{scene:u}=l;u.setCursor(a.CURSOR_TYPE.GRABBING),u.disableObjectsEvent();let d=this._getCurrentLastVisible(),f=d===void 0?1/0:c.rowHeightAccumulation[d.lastRow],p=d===void 0?1/0:c.columnWidthAccumulation[d.lastColumn-1]+c.rowHeaderWidth;this._activeViewport=null;let m=this._getFreeze();m&&(this._changeToColumn=m.startColumn,this._changeToRow=m.startRow),this._scenePointerMoveSub=u.onPointerMove$.subscribeEvent(e=>{let n=this._getActiveViewport(e),{startX:r,startY:s,row:l,column:m}=sr(e.offsetX,e.offsetY,u,c,n||void 0,!0);if(!this.interceptor.fetchThroughInterceptors(ro)(!0,null))return!1;u.setCursor(a.CURSOR_TYPE.GRABBING);let h=2/Math.max(u.scaleX,u.scaleY);if(o===0){var g,_;(g=t.transformByState({top:Math.min(s,f)-h/2}))==null||g.setProps({fill:this._freezeActiveColor}),(_=i.transformByState({top:Math.min(s,f)-h/2}))==null||_.setProps({fill:this._freezeNormalHeaderColor}),this._changeToRow=d===void 0?l:Math.min(l,d.lastRow),this._changeToOffsetY=Math.min(s,f),this._activeViewport=n}else{var v,y;(v=t.transformByState({left:Math.min(r,p)-h/2}))==null||v.setProps({fill:this._freezeActiveColor}),(y=i.transformByState({left:Math.min(r,p)-h/2}))==null||y.setProps({fill:this._freezeNormalHeaderColor}),this._changeToColumn=d===void 0?m:Math.min(m,d.lastColumn),this._changeToOffsetX=r,this._activeViewport=n}}),this._scenePointerUpSub=u.onPointerUp$.subscribeEvent(()=>{var e,s;u.resetCursor(),u.enableObjectsEvent(),this._clearObserverEvent();let{rowHeaderWidthAndMarginLeft:l,columnHeaderHeightAndMarginTop:d}=c;o===0&&(this._changeToRow===0||this._changeToRow===-1)||o===1&&(this._changeToColumn===0||this._changeToColumn===-1)?(t.setProps({fill:this._freezeNormalHeaderColor}),i.setProps({fill:this._freezeNormalMainColor})):(t==null||t.setProps({fill:this._freezeNormalHeaderColor}),i==null||i.setProps({fill:this._freezeNormalHeaderColor}));let f=2/Math.max(u.scaleX,u.scaleY);o===0?(this._changeToRow===0||this._changeToRow===-1)&&(t.transformByState({top:d-f}),i.transformByState({top:d-f})):(this._changeToColumn===0||this._changeToColumn===-1)&&(t.transformByState({left:l-f}),i.transformByState({left:l-f}));let{sheetViewStartRow:p,sheetViewStartColumn:m}=this._scrollManagerService.getCurrentScrollState()||{sheetViewStartRow:0,sheetViewStartColumn:0};if(m==null||p==null)return;let h=this._context.unit,g=h.getActiveSheet();if(!g||g.getConfig().type===n.SheetTypes.CHART){this._clearFreeze();return}let _=(e=g.getConfig())==null?void 0:e.freeze,v=(_==null?void 0:_.xSplit)||0,y=(_==null?void 0:_.ySplit)||0,b=(s=this._activeViewport)==null?void 0:s.viewportKey;o===0&&(y=!b||b===a.SHEET_VIEWPORT_KEY.VIEW_LEFT_TOP||b===a.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT_TOP||b===a.SHEET_VIEWPORT_KEY.VIEW_MAIN_TOP||b===a.SHEET_VIEWPORT_KEY.VIEW_ROW_TOP?this._changeToRow-(_.startRow-_.ySplit):this._changeToRow-p,y=y<0?0:y),o===1&&(v=!b||b===a.SHEET_VIEWPORT_KEY.VIEW_LEFT_TOP||b===a.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT_TOP||b===a.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT||b===a.SHEET_VIEWPORT_KEY.VIEW_COLUMN_LEFT?this._changeToColumn-(_.startColumn-_.xSplit):this._changeToColumn-m,v=v<0?0:v),this._commandService.executeCommand(r.SetFrozenCommand.id,{startRow:y===0?-1:this._changeToRow,startColumn:v===0?-1:this._changeToColumn,ySplit:y,xSplit:v,unitId:h.getUnitId(),subUnitId:g.getSheetId()})})}_getViewports(){let e=this._getSheetObject();if(e==null)return;let{scene:t}=e,n=t.getViewport(a.SHEET_VIEWPORT_KEY.VIEW_COLUMN_LEFT),r=t.getViewport(a.SHEET_VIEWPORT_KEY.VIEW_COLUMN_RIGHT),i=t.getViewport(a.SHEET_VIEWPORT_KEY.VIEW_ROW_TOP),o=t.getViewport(a.SHEET_VIEWPORT_KEY.VIEW_ROW_BOTTOM),s=t.getViewport(a.SHEET_VIEWPORT_KEY.VIEW_LEFT_TOP),c=t.getViewport(a.SHEET_VIEWPORT_KEY.VIEW_MAIN),l=t.getViewport(a.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT_TOP),u=t.getViewport(a.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT),d=t.getViewport(a.SHEET_VIEWPORT_KEY.VIEW_MAIN_TOP);if(n!=null&&r!=null&&i!=null&&o!=null&&s!=null&&c!=null&&l!=null&&u!=null&&d!=null)return{viewMain:c,viewMainLeftTop:l,viewMainLeft:u,viewMainTop:d,viewColumnLeft:n,viewColumnRight:r,viewRowTop:i,viewRowBottom:o,viewLeftTop:s}}_bindViewportScroll(){let e=this._getViewports();if(!e)return;let{viewRowBottom:t,viewColumnRight:r,viewMainLeft:i,viewMainTop:a}=e;this.disposeWithMe(this._scrollManagerService.validViewportScrollInfo$.subscribe(e=>{if(!e||this._getSheetType()===n.SheetTypes.CHART)return;let{scrollX:o,scrollY:s,viewportScrollX:c,viewportScrollY:l}=e;t.isActive&&t.updateScrollVal({scrollY:s,viewportScrollY:l}),r.isActive&&r.updateScrollVal({scrollX:o,viewportScrollX:c}),i.isActive&&i.updateScrollVal({scrollY:s,viewportScrollY:l}),a.isActive&&a.updateScrollVal({scrollX:o,viewportScrollX:c})}))}_updateViewport(e=-1,t=-1,r=0,i=0,a=3){var o;let s=(o=this._sheetSkeletonManagerService.getCurrentParam())==null?void 0:o.skeleton,c=this._context.unit.getActiveSheet();if(s==null||(c==null?void 0:c.getConfig().type)===n.SheetTypes.CHART||s.worksheet.getSheetId()!==(c==null?void 0:c.getSheetId()))return;let{rowHeaderWidthAndMarginLeft:l,columnHeaderHeightAndMarginTop:u}=s,d=this._getViewports();if(!d)return;let{viewMain:f,viewMainLeftTop:p,viewMainLeft:m,viewMainTop:h,viewColumnLeft:g,viewColumnRight:_,viewRowTop:v,viewRowBottom:y,viewLeftTop:b}=d;_.resizeWhenFreezeChange({left:l,top:0,height:u+1,right:0}),y.resizeWhenFreezeChange({left:0,top:u,bottom:0,width:l+1}),b.resizeWhenFreezeChange({left:0,top:0,width:l+1,height:u});let x=!0,S=!0;p.enable(),(e===-1||e===0)&&(x=!1),(t===-1||t===0)&&(S=!1);let C=s.getNoMergeCellWithCoordByIndex(e-r,t-i,!1);x&&e===r&&(C.startY=0);let w=s.getNoMergeCellWithCoordByIndex(e,t,!1);if(p.disable(),h.disable(),m.disable(),v.disable(),g.disable(),p.resetPadding(),h.resetPadding(),m.resetPadding(),v.resetPadding(),g.resetPadding(),x===!1&&S===!1)f.resizeWhenFreezeChange({left:l,top:u,bottom:0,right:0}),f.resetPadding(),m.resizeWhenFreezeChange({left:l,top:u,bottom:0,width:0}),h.resizeWhenFreezeChange({left:l,top:u,height:0,right:0}),p.resizeWhenFreezeChange({left:l,top:u,width:0,height:0}),v.resizeWhenFreezeChange({left:0,top:u,width:l+1,height:0}),g.resizeWhenFreezeChange({left:0,top:0,height:u+1,width:0});else if(x===!0&&S===!1){let e=w.startY-C.startY;f.resizeWhenFreezeChange({left:l,top:u+e,bottom:0,right:0}),f.setPadding({startY:C.startY,endY:w.startY,startX:0,endX:0}),a&2&&this._commandService.executeCommand(fr.id,{sheetViewStartRow:0,offsetY:0}),h.resizeWhenFreezeChange({left:l,top:u,height:e,right:0}),h.updateScrollVal({viewportScrollY:C.startY,rawScrollX:f.scrollX,viewportScrollX:f.viewportScrollX}),v.resizeWhenFreezeChange({left:0,top:u,width:l+1,height:e}),v.updateScrollVal({viewportScrollY:C.startY}),y.resizeWhenFreezeChange({left:0,top:u+e,bottom:0,width:l+1}),h.enable(),v.enable()}else if(x===!1&&S===!0){let e=w.startX-C.startX;f.resizeWhenFreezeChange({left:l+e,top:u,bottom:0,right:0}),f.setPadding({startX:C.startX,endX:w.startX,startY:0,endY:0}),a&1&&this._commandService.executeCommand(fr.id,{sheetViewStartColumn:0,offsetX:0}),m.resizeWhenFreezeChange({left:l,top:u,width:e,bottom:0,right:0}),m.updateScrollVal({viewportScrollX:C.startX,rawScrollY:f.scrollY,viewportScrollY:f.viewportScrollY}),g.resizeWhenFreezeChange({left:l,top:0,width:e,height:u+1}),g.updateScrollVal({viewportScrollX:C.startX}),_.resizeWhenFreezeChange({left:l+e,top:0,height:u+1,right:0}),m.enable(),g.enable()}else{let e=w.startX-C.startX,t=w.startY-C.startY;f.resizeWhenFreezeChange({left:l+e,top:u+t,bottom:0,right:0}),f.setPadding({startY:C.startY,endY:w.startY,startX:C.startX,endX:w.startX}),a&&this._commandService.executeCommand(fr.id,{...a&1?{sheetViewStartColumn:0,offsetX:0}:null,...a&2?{sheetViewStartRow:0,offsetY:0}:null}),m.resizeWhenFreezeChange({left:l,top:u+t,width:e,bottom:0}),m.updateScrollVal({viewportScrollX:C.startX,rawScrollY:f.scrollY,viewportScrollY:f.viewportScrollY}),h.resizeWhenFreezeChange({left:l+e,top:u,height:t,right:0}),h.updateScrollVal({viewportScrollY:C.startY,rawScrollX:f.scrollX,viewportScrollX:f.viewportScrollX}),p.resizeWhenFreezeChange({left:l,top:u,width:e,height:t}),p.updateScrollVal({viewportScrollX:C.startX,viewportScrollY:C.startY}),v.resizeWhenFreezeChange({left:0,top:u,width:l+1,height:t}),v.updateScrollVal({viewportScrollY:C.startY}),y.resizeWhenFreezeChange({left:0,top:u+t,bottom:0,width:l+1}),g.resizeWhenFreezeChange({left:l,top:0,width:e,height:u+1}),g.updateScrollVal({viewportScrollX:C.startX}),_.resizeWhenFreezeChange({left:l+e,top:0,height:u+1,right:0}),p.enable(),h.enable(),m.enable(),v.enable(),g.enable()}}_skeletonListener(){this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.pipe((0,o.switchMap)(e=>{var t;return(e==null||(t=e.skeleton)==null?void 0:t.gapConfigChanged$)??o.EMPTY})).subscribe(()=>this._refreshCurrent())),this.disposeWithMe((0,n.toDisposable)(this._sheetSkeletonManagerService.currentSkeleton$.subscribe(e=>{var t;if(this._getSheetType()===n.SheetTypes.CHART){this._clearFreeze(),this._lastFreeze=void 0;return}let i=[r.SetWorksheetActiveOperation.id,r.InsertRangeMoveDownCommand.id,r.InsertRangeMoveRightCommand.id];e&&(i.includes(e.commandId||``)||this._lastFreeze!==((t=this._context.unit.getActiveSheet())==null?void 0:t.getFreeze()))&&this._refreshCurrent()})))}_refreshCurrent(){let e=this._context.unit.getActiveSheet();if(!e||e.getConfig().type===n.SheetTypes.CHART){this._clearFreeze();return}let t=this._sheetSkeletonManagerService.getCurrentSkeleton();if((t==null?void 0:t.worksheet.getSheetId())!==e.getSheetId())return;let r=e.getConfig().freeze;this._lastFreeze=r;let{startRow:i=-1,startColumn:a=-1,ySplit:o=0,xSplit:s=0}=r;this._refreshFreeze(i,a,o,s,0)}_themeChangeListener(){this._themeChange(this._themeService.getCurrentTheme()),this.disposeWithMe(this._themeService.currentTheme$.subscribe(e=>{this._clearFreeze(),this._themeChange(e),this._refreshCurrent()}))}_themeChange(e){this._freezeNormalHeaderColor=(0,n.get)(e,`gray.300`),this._freezeNormalMainColor=new n.ColorKit(this._freezeNormalHeaderColor).setAlpha(.01).toRgbString(),this._freezeActiveColor=(0,n.get)(e,`primary.600`),this._freezeHoverColor=(0,n.get)(e,`gray.500`)}_interceptorCommands(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{let t={redos:[],undos:[]},i=this._getFreeze();if(!i)return t;let a=e=>{let n=this._context.unit,i=n.getUnitId(),a=n.getActiveSheet();if(!a)return t;let o=a.getSheetId();this._refreshFreeze(e.startRow,e.startColumn,e.ySplit,e.xSplit,0);let s={...e,unitId:i,subUnitId:o,resetScroll:!1},c=(0,r.SetFrozenMutationFactory)(this._injector,s);return{undos:[{id:r.SetFrozenMutation.id,params:c}],redos:[{id:r.SetFrozenMutation.id,params:s}]}};if(e.id===r.InsertRowCommand.id){let{range:t,direction:r}=e.params,o=t.endRow-t.startRow+1;if(t.startRow<i.startRow||t.startRow+1===i.startRow&&r===n.Direction.UP)return a({...i,startRow:Math.max(1,i.startRow+o),ySplit:Math.max(1,i.ySplit+o)})}if(e.id===r.InsertColCommand.id){let{range:t,direction:r}=e.params,o=t.endColumn-t.startColumn+1;if(t.startColumn<i.startColumn||t.startColumn+1===i.startColumn&&r===n.Direction.LEFT)return a({...i,startColumn:Math.max(1,i.startColumn+o),xSplit:Math.max(1,i.xSplit+o)})}if(e.id===r.MoveColsCommand.id){let r=this._selectionManagerService.getCurrentSelections(),{fromRange:{startColumn:o},toRange:{startColumn:s}}=e.params,c=r==null?void 0:r.filter(e=>e.range.rangeType===n.RANGE_TYPE.COLUMN&&e.range.startColumn<=o&&o<=e.range.endColumn);if(!(c!=null&&c.length))return t;let l=c[0].range,u={...l,startColumn:s,endColumn:s+l.endColumn-l.startColumn};if(!i||i.startColumn<=0||l.startColumn>=i.startColumn&&u.startColumn>=i.startColumn||l.startColumn===u.startColumn||l.endColumn<i.startColumn&&u.startColumn<i.startColumn)return t;let d=l.endColumn-l.startColumn+1,f=Math.max(Math.min(i.startColumn,l.endColumn+1)-l.startColumn,0),p,m;return u.startColumn>=i.startColumn?(p=Math.max(i.startColumn-f,1),m=Math.max(i.xSplit-f,1)):(p=i.startColumn+d-f,m=i.xSplit+d-f),a({...i,startColumn:p,xSplit:m})}if(e.id===r.MoveRowsCommand.id){let r=this._selectionManagerService.getCurrentSelections(),{fromRange:{startRow:o},toRange:{startRow:s}}=e.params,c=r==null?void 0:r.filter(e=>e.range.rangeType===n.RANGE_TYPE.ROW&&e.range.startRow<=o&&o<=e.range.endRow);if(!(c!=null&&c.length))return t;let l=c[0].range,u={...l,startRow:s,endRow:s+l.endRow-l.startRow};if(!i||i.startRow<=0||l.startRow>=i.startRow&&u.startRow>=i.startRow||l.startRow===u.startRow||l.endRow<i.startRow&&u.startRow<i.startRow)return t;let d=l.endRow-l.startRow+1,f=Math.max(Math.min(i.startRow,l.endRow+1)-l.startRow,0),p,m;return u.startRow>=i.startRow?(p=Math.max(i.startRow-f,1),m=Math.max(i.ySplit-f,1)):(p=i.startRow+d-f,m=i.ySplit+d-f),a({...i,startRow:p,ySplit:m})}if(e.id===r.RemoveColCommand.id||e.id===r.RemoveRowCommand.id){let t=e.params,r=t.range;if(r.rangeType===n.RANGE_TYPE.COLUMN&&r.startColumn<i.startColumn){let e=Math.min(i.startColumn,r.endColumn+1)-r.startColumn;return a({...i,startColumn:Math.max(1,i.startColumn-e),xSplit:Math.max(1,i.xSplit-e)})}if(t.range.rangeType===n.RANGE_TYPE.ROW&&r.startRow<i.startRow){let e=Math.min(i.startRow,r.endRow+1)-r.startRow;return a({...i,startRow:Math.max(1,i.startRow-e),ySplit:Math.max(1,i.ySplit-e)})}}return t}}))}_commandExecutedListener(){this.disposeWithMe(this._commandService.onCommandExecuted(e=>{switch(e.id){case r.SetFrozenMutation.id:case Ar.id:{let t=this._lastFreeze,n=this._context.unit,r=n.getActiveSheet(),i=e.params,{unitId:a,subUnitId:o}=i;if(a!==n.getUnitId()||o!==(r==null?void 0:r.getSheetId()))return;let s=r.getConfig().freeze;if(this._lastFreeze=s,s==null)return;let c=0,{startRow:l=-1,startColumn:u=-1,ySplit:d=0,xSplit:f=0}=s;t&&t.startRow===l&&t.ySplit===d||(c|=2),t&&t.startColumn===u&&t.xSplit===f||(c|=1),i.resetScroll===!1&&(c=0),this._refreshFreeze(l,u,d,f,c)}break;case r.SetWorksheetRowHeightMutation.id:{let t=this._getFreeze(),n=t&&e.params.ranges.some(e=>e.startRow<t.startRow);e.params&&n&&this._refreshCurrent()}break;case r.SetWorksheetColWidthMutation.id:{let t=this._getFreeze();e.params&&t&&e.params.ranges.some(e=>e.startColumn<t.startColumn)&&this._refreshCurrent()}break;case r.SetWorksheetRowAutoHeightMutation.id:{let t=e.params,n=this._getFreeze();if(n&&n.startRow>-1&&t.rowsAutoHeightInfo.some(e=>e.row<n.startRow)){let e=this._sheetSkeletonManagerService.currentSkeleton$.subscribe(()=>{this._refreshCurrent(),setTimeout(()=>{e.unsubscribe()})})}}break;case r.SetColHiddenMutation.id:case r.SetColVisibleMutation.id:{let t=e.params,n=this._getFreeze(),r=t.ranges;n&&n.startColumn>-1&&r.some(e=>e.startColumn<n.startColumn)&&this._refreshCurrent()}break;case r.SetRowHiddenMutation.id:case r.SetRowVisibleMutation.id:{let t=e.params,n=this._getFreeze(),r=t.ranges;n&&n.startRow>-1&&r.some(e=>e.startRow<n.startRow)&&this._refreshCurrent()}break;case B.id:case V.id:this._refreshCurrent()}}))}_zoomRefresh(){let e=this._getSheetObject();if(e==null)return;let{scene:t}=e;this.disposeWithMe(t.onTransformChange$.subscribeEvent(e=>{[a.TRANSFORM_CHANGE_OBSERVABLE_TYPE.scale,a.TRANSFORM_CHANGE_OBSERVABLE_TYPE.all].includes(e.type)&&this._refreshCurrent()}))}_clearObserverEvent(){var e,t;this._getSheetObject()!=null&&((e=this._scenePointerMoveSub)==null||e.unsubscribe(),(t=this._scenePointerUpSub)==null||t.unsubscribe(),this._scenePointerMoveSub=null,this._scenePointerUpSub=null)}_clearFreeze(){var e,t,n,r,i,a;(e=this._rowFreezeHeaderRect)==null||e.dispose(),(t=this._rowFreezeMainRect)==null||t.dispose(),(n=this._columnFreezeHeaderRect)==null||n.dispose(),(r=this._columnFreezeMainRect)==null||r.dispose(),this._rowFreezeHeaderRect=null,this._rowFreezeMainRect=null,this._columnFreezeHeaderRect=null,this._columnFreezeMainRect=null,[this._freezeDownSubs,this._freezePointerEnterSubs,this._freezePointerLeaveSubs].forEach(e=>{e==null||e.unsubscribe()}),this._freezeDownSubs=null,this._freezePointerEnterSubs=null,this._freezePointerLeaveSubs=null,(i=this._scenePointerMoveSub)==null||i.unsubscribe(),(a=this._scenePointerUpSub)==null||a.unsubscribe(),this._scenePointerMoveSub=null,this._scenePointerUpSub=null}_getPositionByIndex(e,t){var n;if(this._getSheetObject()==null)return;let r=(n=this._sheetSkeletonManagerService.getCurrentParam())==null?void 0:n.skeleton,i=r==null?void 0:r.getNoMergeCellWithCoordByIndex(e,t);if(r==null)return;if(i!=null&&(!isNaN(i.endX)||!isNaN(i.endY)))return i;let{rowHeaderWidthAndMarginLeft:a,columnHeaderHeightAndMarginTop:o}=r;return{startX:a,endX:a,startY:o,endY:o}}_getFreeze(){var e;if(this._getSheetType()!==n.SheetTypes.CHART)return(e=this._sheetSkeletonManagerService.getCurrentParam())==null?void 0:e.skeleton.worksheet.getFreeze()}_getSheetObject(){return ar(this._context.unit,this._context)}_refreshFreeze(e,t,n,r,i){var a;let o={startRow:e,startColumn:t,ySplit:n,xSplit:r};this._clearFreeze(),this._createFreeze(0,o),this._createFreeze(1,o),this._updateViewport(e,t,n,r,i),(a=this._getSheetObject())==null||a.spreadsheet.makeForceDirty()}};io=K([G(1,(0,n.Inject)(q)),G(2,n.ICommandService),G(3,(0,n.Inject)(r.SheetsSelectionsService)),G(4,(0,n.Inject)(Gn)),G(5,(0,n.Inject)(n.ThemeService)),G(6,(0,n.Inject)(r.SheetInterceptorService)),G(7,(0,n.Inject)(n.Injector))],io);function ao(e){let t=e.get(r.SheetsSelectionsService),i=e.get(r.RangeProtectionRuleModel),a=e.get(n.IUniverInstanceService),s=e.get(r.MergeCellController),c=a.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET);return(0,o.combineLatest)([t.selectionMoveEnd$,c.pipe((0,o.map)(e=>(e==null?void 0:e.getUnitId())??``)),c.pipe((0,o.switchMap)(e=>(e==null?void 0:e.activeSheet$)??(0,o.of)(null)))]).pipe((0,o.map)(([e,t,a])=>{if(!a||!e||e.length===0)return!1;let o=a.getSheetId(),c=e.map(e=>e.range);if(s.interceptor.fetchThroughInterceptors(r.MERGE_CELL_INTERCEPTOR_CHECK)(!1,c))return!0;let l=i.getSubunitRuleList(t,o).map(e=>e.ranges).flat();if(e.length<2){let t=e[0].range;return l.some(e=>n.Rectangle.intersects(e,t)&&!n.Rectangle.contains(e,t))}for(let t=0;t<e.length;t++)for(let r=t+1;r<e.length;r++)if(n.Rectangle.intersects(e[t].range,e[r].range))return!0;return!1}))}function oo(e,t){return!!co(e,t,n.RANGE_TYPE.ROW)}function so(e,t){return!!co(e,t,n.RANGE_TYPE.COLUMN)}function co(e,t,r){return e.find(e=>{let{startRow:i,endRow:a,startColumn:o,endColumn:s,rangeType:c}=e.range;return c===n.RANGE_TYPE.ALL||c===n.RANGE_TYPE.NORMAL?!1:c===r&&(r===n.RANGE_TYPE.COLUMN&&o<=t&&t<=s||r===n.RANGE_TYPE.ROW&&i<=t&&t<=a)})}let lo=(0,n.createInterceptorKey)(`headerMovePermissionCheck`),uo=class extends n.Disposable{constructor(e,t,r,i,a,o){super(),this._context=e,this._sheetSkeletonManagerService=r,this._commandService=i,this._platformService=a,this._contextService=o,z(this,`_startOffsetX`,-1/0),z(this,`_startOffsetY`,-1/0),z(this,`_moveHelperBackgroundShape`,void 0),z(this,`_moveHelperLineShape`,void 0),z(this,`_headerPointerDownSubs`,void 0),z(this,`_headerPointerMoveSubs`,void 0),z(this,`_headerPointerLeaveSubs`,void 0),z(this,`_dragHeaderMoveSub`,void 0),z(this,`_scenePointerUpSub`,void 0),z(this,`_scrollTimer`,void 0),z(this,`_changeFromColumn`,-1),z(this,`_changeFromRow`,-1),z(this,`_changeToColumn`,-1),z(this,`_changeToRow`,-1),z(this,`interceptor`,new n.InterceptorManager({HEADER_MOVE_PERMISSION_CHECK:lo})),z(this,`_workbookSelections`,void 0),this._workbookSelections=t.getWorkbookSelections(this._context.unitId),this._init()}dispose(){var e,t,n,r,i,a,o,s;(e=this._moveHelperBackgroundShape)==null||e.dispose(),(t=this._moveHelperLineShape)==null||t.dispose(),(n=this._headerPointerMoveSubs)==null||n.unsubscribe(),(r=this._headerPointerLeaveSubs)==null||r.unsubscribe(),(i=this._headerPointerDownSubs)==null||i.unsubscribe(),this._headerPointerMoveSubs=null,this._headerPointerLeaveSubs=null,this._headerPointerDownSubs=null,(a=this._dragHeaderMoveSub)==null||a.unsubscribe(),(o=this._scenePointerUpSub)==null||o.unsubscribe(),this._dragHeaderMoveSub=null,this._scenePointerUpSub=null,(s=this._scrollTimer)==null||s.dispose()}_init(){this._initialRowOrColumn(n.RANGE_TYPE.ROW),this._initialRowOrColumn(n.RANGE_TYPE.COLUMN)}_initialRowOrColumn(e=n.RANGE_TYPE.ROW){let t=this._context.components.get(`__SpreadsheetColumnHeader__`),r=this._context.components.get(`__SpreadsheetRowHeader__`),i=this._context.scene,s=e===n.RANGE_TYPE.ROW?r:t,c=t=>{var r,o;let s=(r=this._sheetSkeletonManagerService.getCurrentParam())==null?void 0:r.skeleton;if(s==null)return;let c=(o=this._workbookSelections.getCurrentLastSelection())==null?void 0:o.range;if(!c||!this.interceptor.fetchThroughInterceptors(lo)(!1,c))return;let l=this._workbookSelections.getCurrentSelections(),{row:u,column:d}=sr(t.offsetX,t.offsetY,i,s);co(l,e===n.RANGE_TYPE.ROW?u:d,e)?i.setCursor(a.CURSOR_TYPE.GRAB):i.resetCursor()},l=()=>{var e,t;(e=this._moveHelperBackgroundShape)==null||e.hide(),(t=this._moveHelperLineShape)==null||t.hide(),i.resetCursor()};this._headerPointerMoveSubs=new o.Subscription,this._headerPointerMoveSubs.add(s.onPointerMove$.subscribeEvent(c)),this._headerPointerLeaveSubs=new o.Subscription,this._headerPointerLeaveSubs.add(s==null?void 0:s.onPointerLeave$.subscribeEvent(l)),this._headerPointerDownSubs=new o.Subscription,this._headerPointerDownSubs.add(s==null?void 0:s.onPointerDown$.subscribeEvent((t,n)=>this._onPointerDown(t,n,e)))}_onPointerDown(e,t,i){var o,s;if(t.isStopPropagation||e.button!==0||H(e,this._platformService.isMac,this._contextService.getContextValue(r.REF_SELECTIONS_ENABLED)))return;let c=this._context.scene,l=(o=this._sheetSkeletonManagerService.getCurrentParam())==null?void 0:o.skeleton;if(l==null)return;let u=(s=this._workbookSelections.getCurrentLastSelection())==null?void 0:s.range;if(!u||!this.interceptor.fetchThroughInterceptors(lo)(!1,u))return;let{offsetX:d,offsetY:f}=e,{x:p,y:m}=c.getCoordRelativeToViewport(a.Vector2.FromArray([d,f]));this._startOffsetX=p,this._startOffsetY=m;let{row:h,column:g}=sr(e.offsetX,e.offsetY,c,l),_;i===n.RANGE_TYPE.ROW?(this._changeFromRow=h,_=a.ScrollTimerType.Y):(this._changeFromColumn=g,_=a.ScrollTimerType.X);let v=co(this._workbookSelections.getCurrentSelections(),i===n.RANGE_TYPE.ROW?h:g,i);v&&this._startDragging(p,m,v,_,i)}_startDragging(e,t,n,r,i){let o=this._context.scene,s=o.getScrollXYInfoByViewport(a.Vector2.FromArray([this._startOffsetX,this._startOffsetY]));this._newBackgroundAndLine(),o.setCursor(a.CURSOR_TYPE.GRABBING),o.disableObjectsEvent();let c=!1,l,u=()=>{if(c)return;l=a.ScrollTimer.create(o,r),this._scrollTimer=l;let n=o.getViewport(a.SHEET_VIEWPORT_KEY.VIEW_MAIN);l.startScroll(e,t,n),c=!0};this._dragHeaderMoveSub=o.onPointerMove$.subscribeEvent(e=>{u();let{offsetX:t,offsetY:r}=e,{x:c,y:d}=o.getCoordRelativeToViewport(a.Vector2.FromArray([t,r]));this._rowColumnMoving(c,d,n,s,i),l.scrolling(c,d,()=>{this._rowColumnMoving(c,d,n,s,i)})}),this._scenePointerUpSub=o.onPointerUp$.subscribeEvent(()=>this._onPointerUp(i))}_onPointerUp(e){var t;let i=this._context.scene;this._disposeBackgroundAndLine(),i.resetCursor(),i.enableObjectsEvent(),this._clearObserverEvent(),(t=this._scrollTimer)==null||t.dispose();let a=this._workbookSelections.getCurrentSelections();if(e===n.RANGE_TYPE.ROW){if(this._changeFromRow!==this._changeToRow&&this._changeToRow!==-1){var o;let e=(o=((a==null?void 0:a.filter(e=>e.range.rangeType===n.RANGE_TYPE.ROW&&e.range.startRow<=this._changeFromRow&&this._changeFromRow<=e.range.endRow))||[])[0])==null?void 0:o.range;e&&this._commandService.executeCommand(r.MoveRowsCommand.id,{fromRange:e,toRange:{...e,startRow:this._changeToRow,endRow:this._changeToRow+e.endRow-e.startRow}})}this._changeToRow=this._changeFromRow=-1}else{if(this._changeFromColumn!==this._changeToColumn&&this._changeToColumn!==-1){var s;let e=(s=((a==null?void 0:a.filter(e=>e.range.rangeType===n.RANGE_TYPE.COLUMN&&e.range.startColumn<=this._changeFromColumn&&this._changeFromColumn<=e.range.endColumn))||[])[0])==null?void 0:s.range;e&&this._commandService.executeCommand(r.MoveColsCommand.id,{fromRange:e,toRange:{...e,startColumn:this._changeToColumn,endColumn:this._changeToColumn+e.endColumn-e.startColumn}})}this._changeToColumn=this._changeFromColumn=-1}}_rowColumnMoving(e,t,i,o,s){var c,l;let u=this._context.scene,d=(c=this._sheetSkeletonManagerService.getCurrentParam())==null?void 0:c.skeleton;if(d==null)return;let{rowHeaderWidth:f,columnHeaderHeight:p,rowTotalHeight:m,columnTotalWidth:h}=d,g=u.getViewportScrollXY(u.getViewport(a.SHEET_VIEWPORT_KEY.VIEW_MAIN)),{scaleX:_,scaleY:v}=u.getAncestorScale(),y=d.getCellIndexByOffset(e,t,_,v,g),b=(0,r.attachRangeWithCoord)(d,i.range);if(b==null)return;let x=Math.max(_,_),{startX:S,endX:C,startY:w,endY:T}=b;if(s===n.RANGE_TYPE.ROW){var E;(E=this._moveHelperBackgroundShape)==null||E.transformByState({height:T-w,width:h+f,left:0,top:w+(t-this._startOffsetY)/x+g.y-o.y})}else{var D;(D=this._moveHelperBackgroundShape)==null||D.transformByState({height:m+p,width:C-S,left:S+(e-this._startOffsetX)/x+g.x-o.x,top:0})}(l=this._moveHelperBackgroundShape)==null||l.show(),this._updateMoveHelperLine(y,i.range,d,s,x)}_updateMoveHelperLine({row:e,column:t},r,i,a,o){var s;let{startX:c,startY:l,endX:u,endY:d}=i.getNoMergeCellWithCoordByIndex(e,t),{startRow:f,startColumn:p,endRow:m,endColumn:h}=r,{rowHeaderWidth:g,columnHeaderHeight:_,rowTotalHeight:v,columnTotalWidth:y}=i,b=4/o;if(a===n.RANGE_TYPE.ROW){var x;let t=0;if(e<=f)t=l-b/2,this._changeToRow=e;else if(e>m)t=d-b/2,this._changeToRow=e+1;else return;(x=this._moveHelperLineShape)==null||x.transformByState({height:b,width:y,left:g,top:t})}else{var S;let e=0;if(t<=p)e=c-b/2,this._changeToColumn=t;else if(t>h)e=u-b/2,this._changeToColumn=t+1;else return;(S=this._moveHelperLineShape)==null||S.transformByState({height:v,width:b,left:e,top:_})}(s=this._moveHelperLineShape)==null||s.show()}_clearObserverEvent(){var e,t;(e=this._dragHeaderMoveSub)==null||e.unsubscribe(),(t=this._scenePointerUpSub)==null||t.unsubscribe(),this._dragHeaderMoveSub=null,this._scenePointerUpSub=null}_newBackgroundAndLine(){let e=this._context.scene;this._moveHelperBackgroundShape=new a.Rect(`__SpreadsheetHeaderMoveControllerBackground__`,{fill:`rgba(0, 0, 0, 0.1)`,evented:!1,zIndex:100}),this._moveHelperLineShape=new a.Rect(`__SpreadsheetHeaderMoveControllerShapeLine__`,{fill:`rgb(119, 119, 119)`,evented:!1,zIndex:100}),e.addObjects([this._moveHelperBackgroundShape,this._moveHelperLineShape],10)}_disposeBackgroundAndLine(){var e,t;(e=this._moveHelperBackgroundShape)==null||e.dispose(),(t=this._moveHelperLineShape)==null||t.dispose()}};uo=K([G(1,(0,n.Inject)(r.SheetsSelectionsService)),G(2,(0,n.Inject)(q)),G(3,n.ICommandService),G(4,i.IPlatformService),G(5,n.IContextService)],uo);let fo=`rgb(68, 71, 70)`;var po=class extends a.Shape{constructor(e,t){super(e,t),z(this,`_size`,12),z(this,`_color`,fo),z(this,`_mode`,0),this.setShapeProps(t)}get size(){return this._size}get mode(){return this._mode}get color(){return this._color}_draw(e){let t=this.getScene();if(!t)return;let{scaleX:n,scaleY:r}=t.getAncestorScale(),i=Math.max(n,r),o=12/i,s=4/i,{width:c,height:l}=this,u=0,d=0;this.mode===0?(c=s,u=o-s):(l=s,d=o-s),a.Rect.drawWith(e,{width:this.width,height:this.height,left:0,top:0,fill:`rgba(120, 120, 120, 0.01)`}),a.Rect.drawWith(e,{width:c,height:l,fill:fo,radius:s}),e.save(),e.transform(1,0,0,1,u,d),a.Rect.drawWith(e,{width:c,height:l,fill:fo,radius:s}),e.restore()}setShapeProps(e){return e!=null&&e.size&&(this._size=e.size),e!=null&&e.mode&&(this._mode=e.mode),e!=null&&e.color&&(this._color=e.color),this.mode===0?this.transformByState({width:12,height:this.size}):this.transformByState({width:this.size,height:12}),this}};let mo=`__SpreadsheetHeaderResizeControllerShapeHelper__`,ho=`rgb(199, 199, 199)`,go=(0,n.createInterceptorKey)(`headerResizePermissionCheck`),_o=class extends n.Disposable{constructor(e,t,r,i){super(),this._context=e,this._sheetSkeletonManagerService=t,this._selectionManagerService=r,this._commandService=i,z(this,`_currentRow`,0),z(this,`_currentColumn`,0),z(this,`_rowResizeRect`,void 0),z(this,`_columnResizeRect`,void 0),z(this,`_headerPointerSubs`,void 0),z(this,`_scenePointerMoveSub`,void 0),z(this,`_scenePointerUpSub`,void 0),z(this,`_resizeHelperShape`,void 0),z(this,`_startOffsetX`,1/0),z(this,`_startOffsetY`,1/0),z(this,`interceptor`,new n.InterceptorManager({HEADER_RESIZE_PERMISSION_CHECK:go})),this._init()}dispose(){var e,t,n;(e=this._rowResizeRect)==null||e.dispose(),this._rowResizeRect=null,(t=this._columnResizeRect)==null||t.dispose(),this._columnResizeRect=null,(n=this._headerPointerSubs)==null||n.unsubscribe(),this._headerPointerSubs=null}_init(){let e=this._context.scene;this._rowResizeRect=new po(`__SpreadsheetHeaderResizeControllerShapeRow__`,{visible:!1,mode:1,zIndex:100}),this._columnResizeRect=new po(`__SpreadsheetHeaderResizeControllerShapeColumn__`,{visible:!1,mode:0,zIndex:100}),e.addObjects([this._rowResizeRect,this._columnResizeRect],10),this._initialHover(0),this._initialHover(1),this._initialHoverResize(0),this._initialHoverResize(1)}_initialHover(e=0){let t=this._context.components.get(`__SpreadsheetColumnHeader__`),n=this._context.components.get(`__SpreadsheetRowHeader__`),r=this._context.scene,i=e===0?n:t,a=(e,t)=>{var n,r;(n=this._rowResizeRect)==null||n.hide(),(r=this._columnResizeRect)==null||r.hide()},s=(t,n)=>{var i;let a=(i=this._sheetSkeletonManagerService.getCurrentParam())==null?void 0:i.skeleton;if(a==null||this._rowResizeRect==null||this._columnResizeRect==null)return;let{rowBaseWidth:o,rowGutterWidth:s,columnBaseHeight:c,columnGutterHeight:l}=vo(a),{startX:u,startY:d,endX:f,endY:p,row:m,column:h}=sr(t.offsetX,t.offsetY,r,a),g=m===a.worksheet.getRowCount()-1,_=h===a.worksheet.getColumnCount()-1,v=cr(t.offsetX,t.offsetY,r,a),{scaleX:y,scaleY:b}=r.getAncestorScale(),x=12/Math.max(y,b);if(e===0){let e=d-x/2;if(g&&p-d<=x/2)this._currentRow=m;else if(v.y<=d+x/2&&v.y>=d)this._currentRow=m-1;else if(v.y>=p-x/2&&v.y<=p)this._currentRow=m,e=p-x/2;else{this._rowResizeRect.hide();return}if(this._currentRow===-1)return;if(!this.interceptor.fetchThroughInterceptors(go)(null,{row:this._currentRow}))return!1;let t=Math.min(44,o/3);this._rowResizeRect.transformByState({left:s+o/2-t/2,top:e}),this._rowResizeRect.setShapeProps({size:t}),this._rowResizeRect.show()}else{let e=u-x/2;if(_&&f-u<=x/2)this._currentColumn=h;else if(v.x<=u+x/2&&v.x>=u)this._currentColumn=h-1;else if(v.x>=f-x/2&&v.x<=f)this._currentColumn=h,e=f-x/2;else{this._columnResizeRect.hide();return}if(this._currentColumn===-1)return;if(!this.interceptor.fetchThroughInterceptors(go)(null,{col:this._currentColumn}))return!1;let t=c*.7;this._columnResizeRect.transformByState({left:e,top:l+c/2-t/2}),this._columnResizeRect.setShapeProps({size:t}),this._columnResizeRect.show()}};this._headerPointerSubs=new o.Subscription,this._headerPointerSubs.add(i==null?void 0:i.onPointerMove$.subscribeEvent(s)),this._headerPointerSubs.add(i==null?void 0:i.onPointerLeave$.subscribeEvent(a))}_initialHoverResize(e=0){let t=this._context.scene,i=e===0?this._rowResizeRect:this._columnResizeRect;i!=null&&(this.disposeWithMe(i.onPointerEnter$.subscribeEvent(()=>{i!=null&&(i.show(),t.setCursor(e===0?a.CURSOR_TYPE.ROW_RESIZE:a.CURSOR_TYPE.COLUMN_RESIZE))})),this.disposeWithMe(i.onPointerLeave$.subscribeEvent(()=>{i!=null&&(i.hide(),t.resetCursor())})),this.disposeWithMe(i.onPointerDown$.subscribeEvent(t=>{var n,i,o,s,c;let l=(n=this._sheetSkeletonManagerService.getCurrentParam())==null?void 0:n.skeleton;if(l==null)return;let u=this._context.scene,d=u.getEngine(),f=(d==null?void 0:d.height)||0,p=(d==null?void 0:d.width)||0,m=u.getViewport(a.SHEET_VIEWPORT_KEY.VIEW_MAIN),h=((m==null||(i=m.getScrollBar())==null||(i=i.horizonScrollTrack)==null?void 0:i.height)||0)+10,g=((m==null||(o=m.getScrollBar())==null||(o=o.verticalScrollTrack)==null?void 0:o.width)||0)+10,_=cr(t.offsetX,t.offsetY,u,l),{scaleX:v,scaleY:y}=u.getAncestorScale();this._startOffsetX=_.x,this._startOffsetY=_.y;let b=l.getOffsetByColumn(this._currentColumn),x=l.getOffsetByRow(this._currentRow),S=l.getNoMergeCellWithCoordByIndex(this._currentRow,this._currentColumn),C=!1,w=0,T=0,{columnTotalWidth:E,rowHeaderWidthAndMarginLeft:D,rowTotalHeight:O,columnHeaderHeightAndMarginTop:k}=l,A=p>E+D?p:E+D,j=f>O+k?f:O+k,M=4/Math.max(v,y);this._resizeHelperShape=e===0?new a.Rect(mo,{width:A,height:M,fill:ho,left:0,top:x-M/2}):new a.Rect(mo,{width:M,height:j,fill:ho,left:b-M/2,top:0});let N=((s=this._columnResizeRect)==null?void 0:s.left)||0,P=((c=this._rowResizeRect)==null?void 0:c.top)||0;u.addObject(this._resizeHelperShape,10),u.disableObjectsEvent(),this._scenePointerMoveSub=u.onPointerMove$.subscribeEvent(t=>{let n=u.getCoordRelativeToViewport(a.Vector2.FromArray([this._startOffsetX,this._startOffsetY])),r=u.getScrollXYInfoByViewport(n,m),{x:i,y:o}=cr(t.offsetX,t.offsetY,u,l),{scaleX:s,scaleY:c}=u.getAncestorScale(),d=4/Math.max(s,c);if(w=i-this._startOffsetX-d/2,T=o-this._startOffsetY-d/2,Math.abs(e===0?T:w)>=2&&(C=!0),e===0){if(T>f-h+r.y-S.startY&&(T=f-h+r.y-S.startY),T=Math.max(T,-(S.endY-S.startY)),C){var _,v,y;(_=this._resizeHelperShape)==null||_.transformByState({top:x+T}),(v=this._rowResizeRect)==null||v.transformByState({top:P+T+d/2}),(y=this._rowResizeRect)==null||y.show(),u.setCursor(a.CURSOR_TYPE.ROW_RESIZE)}}else if(w>p-g+r.x-S.startX&&(w=p-g+r.x-S.startX),w=Math.max(w,-(S.endX-S.startX)),C){var E,D,O;(E=this._resizeHelperShape)==null||E.transformByState({left:b+w}),(D=this._columnResizeRect)==null||D.transformByState({left:N+w+d/2}),(O=this._columnResizeRect)==null||O.show(),u.setCursor(a.CURSOR_TYPE.COLUMN_RESIZE)}}),this._scenePointerUpSub=u.onPointerUp$.subscribeEvent(()=>{var t;let n=this._context.scene;if(this._clearObserverEvent(),(t=this._resizeHelperShape)==null||t.dispose(),this._resizeHelperShape=null,n.enableObjectsEvent(),C){var i,a;n.resetCursor(),(i=this._rowResizeRect)==null||i.hide(),(a=this._columnResizeRect)==null||a.hide(),e===0?this._commandService.executeCommand(r.DeltaRowHeightCommand.id,{deltaY:T,anchorRow:this._currentRow}):this._commandService.executeCommand(r.DeltaColumnWidthCommand.id,{deltaX:w,anchorCol:this._currentColumn})}})})),this.disposeWithMe(i.onDblclick$.subscribeEvent(()=>{var t;this._context.scene.resetCursor();let i=(t=this._sheetSkeletonManagerService.getCurrentParam())==null?void 0:t.skeleton;if(!i)return;let a=i.worksheet.getRowCount()-1||0,o=i.worksheet.getColumnCount()-1||0;switch(e){case 1:{var s;let e=this._selectionManagerService.getCurrentSelections(),t=[];for(let r=0;r<e.length;r++){let i=e[r];i.range.rangeType===n.RANGE_TYPE.COLUMN&&this._currentColumn<=i.range.endColumn&&this._currentColumn>=i.range.startColumn&&t.push({startColumn:i.range.startColumn,endColumn:i.range.endColumn,startRow:0,endRow:a})}t.length===0&&t.push({startColumn:this._currentColumn,endColumn:this._currentColumn,startRow:0,endRow:a}),this._commandService.executeCommand(vr.id,{ranges:t}),(s=this._columnResizeRect)==null||s.hide();break}case 0:var c;this._commandService.executeCommand(r.SetWorksheetRowIsAutoHeightCommand.id,{ranges:[{startRow:this._currentRow,endRow:this._currentRow,startColumn:0,endColumn:o}]}),(c=this._rowResizeRect)==null||c.hide()}})))}_clearObserverEvent(){var e,t;(e=this._scenePointerMoveSub)==null||e.unsubscribe(),(t=this._scenePointerUpSub)==null||t.unsubscribe(),this._scenePointerMoveSub=null,this._scenePointerUpSub=null}};_o=K([G(1,(0,n.Inject)(q)),G(2,(0,n.Inject)(r.SheetsSelectionsService)),G(3,n.ICommandService)],_o);function vo(e){var t,n,r,i;let a=(t=(n=e.worksheet).getConfig)==null?void 0:t.call(n),o=a==null||(r=a.rowHeader)==null?void 0:r.width,s=a==null||(i=a.columnHeader)==null?void 0:i.height,c=typeof o==`number`&&o>0?Math.min(o,e.rowHeaderWidth):e.rowHeaderWidth,l=typeof s==`number`&&s>0?Math.min(s,e.columnHeaderHeight):e.columnHeaderHeight;return{rowBaseWidth:c,rowGutterWidth:Math.max(0,e.rowHeaderWidthAndMarginLeft-c),columnBaseHeight:l,columnGutterHeight:Math.max(0,e.columnHeaderHeightAndMarginTop-l)}}let yo=/* @__PURE__ */ function(e){return e.ROW=`row`,e.COLUMN=`column`,e}({});var bo=class{constructor(){z(this,`_visibleHandlers`,/* @__PURE__ */ new Set)}registerRangeVisibleHandler(e){this._visibleHandlers.add(e);let t=()=>this._visibleHandlers.delete(e);return{dispose:t,unsubscribe:t}}shouldRenderRange(e,t){let n=e;for(let e of this._visibleHandlers)n=e(n,t);return n}};let xo=`gray.900`,So=`gray.50`;var Co=class extends a.Shape{constructor(e,t){super(e,t),z(this,`_size`,12),z(this,`_iconRatio`,.4),z(this,`_mode`,0),this.setShapeProps(t)}setShapeProps(e){e!=null&&e.size&&(this._size=e.size),e!=null&&e.mode&&(this._mode=e.mode),this.transformByState({width:this._size,height:this._size})}_draw(e){this._mode===1&&a.Rect.drawWith(e,{width:this._size,height:this._size,radius:this._size,fill:`gray.200`});let t=this._size*.5*this._iconRatio,n=Math.PI/180*60,r=t*Math.sin(n),i=t*Math.cos(n);a.RegularPolygon.drawWith(e,{pointsGroup:[[{x:-r+this._size/2,y:-i+this._size/2},{x:r+this._size/2,y:-i+this._size/2},{x:this._size/2,y:t+this._size/2}]],fill:xo})}},wo=class extends a.Shape{constructor(e,t,n){super(e,t),z(this,`_size`,12),z(this,`_iconRatio`,.4),z(this,`_hovered`,!0),z(this,`_hasPrevious`,!0),z(this,`_hasNext`,!0),z(this,`_unhideType`,void 0),t&&this.setShapeProps(t),this.onPointerEnter$.subscribeEvent(()=>this.setShapeProps({hovered:!0})),this.onPointerLeave$.subscribeEvent(()=>this.setShapeProps({hovered:!1})),this.onPointerDown$.subscribeEvent(()=>n==null?void 0:n())}setShapeProps(e){e.type!==void 0&&(this._unhideType=e.type),e.hovered!==void 0&&(this._hovered=e.hovered),e.hasPrevious!==void 0&&(this._hasPrevious=e.hasPrevious),e.hasNext!==void 0&&(this._hasNext=e.hasNext),this.transformByState({width:this._size*(this._unhideType===1?2:1),height:this._size*(this._unhideType===0?2:1)})}_draw(e){this._unhideType===0?this._drawOnRow(e):this._drawOnCol(e)}_drawOnRow(e){this._hovered&&(!this._hasNext||!this._hasPrevious?a.Rect.drawWith(e,{width:this._size,height:this._size,stroke:xo,fill:So}):a.Rect.drawWith(e,{width:this._size,height:2*this._size,stroke:xo,fill:So}));let t=this._size*.5*this._iconRatio,n=Math.PI/3,r=t*Math.cos(n),i=t*Math.sin(n);if(this._hasPrevious&&a.RegularPolygon.drawWith(e,{pointsGroup:[[{x:this._size/2,y:this._size/2-i},{x:this._size/2-i,y:this._size/2+r},{x:this._size/2+i,y:this._size/2+r}]],fill:xo}),this._hasNext){let t=this._hasPrevious?3:1;a.RegularPolygon.drawWith(e,{pointsGroup:[[{x:this._size/2,y:this._size*t/2+i},{x:this._size/2-i,y:this._size*t/2-r},{x:this._size/2+i,y:this._size*t/2-r}]],fill:xo})}}_drawOnCol(e){this._hovered&&(!this._hasNext||!this._hasPrevious?a.Rect.drawWith(e,{width:this._size,height:this._size,stroke:xo,fill:So}):a.Rect.drawWith(e,{width:2*this._size,height:this._size,stroke:xo,fill:So}));let t=this._size*.5*this._iconRatio,n=Math.PI/3,r=t*Math.cos(n),i=t*Math.sin(n);if(this._hasPrevious&&a.RegularPolygon.drawWith(e,{pointsGroup:[[{x:-r+this._size/2,y:this._size/2},{x:this._size/2+i,y:this._size/2-i},{x:this._size/2+i,y:this._size/2+i}]],fill:xo}),this._hasNext){let t=this._hasPrevious?3:1;a.RegularPolygon.drawWith(e,{pointsGroup:[[{x:r+this._size*t/2,y:this._size/2},{x:-i+this._size*t/2,y:this._size/2-i},{x:-i+this._size*t/2,y:this._size/2+i}]],fill:xo})}}};let To=`__SpreadsheetHeaderUnhideSHAPEControllerShape__`,Eo=(0,n.createInterceptorKey)(`headerUnhideRangeVisibleCheck`),Do=class extends n.RxDisposable{get _workbook(){return this._context.unit}constructor(e,t,r,i){super(),this._context=e,this._sheetSkeletonManagerService=t,this._headerUnhideRangeService=r,this._commandService=i,z(this,`_shapes`,{cols:[],rows:[]}),z(this,`interceptor`,new n.InterceptorManager({HEADER_UNHIDE_RANGE_VISIBLE_CHECK:Eo})),this._init()}dispose(){super.dispose(),this._clearShapes(),this.interceptor.dispose()}_init(){let e=``;this._context.unit.activeSheet$.pipe((0,o.takeUntil)(this.dispose$)).subscribe(t=>{this._clearShapes(),t?(e=t.getSheetId(),this._update(this._workbook,t)):e=``}),this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.subscribe(t=>{if(t){let{unitId:n,sheetId:r}=t;if(n===this._workbook.getUnitId()&&r===e){let e=this._workbook.getSheetBySheetId(r);e&&this._update(this._workbook,e)}}}))}_update(e,t){var i;let a=(i=this._sheetSkeletonManagerService.getSkeletonParam(t.getSheetId()))==null?void 0:i.skeleton;if(!a)return;let o=this.interceptor.fetchThroughInterceptors(Eo),s=e=>this._headerUnhideRangeService.shouldRenderRange(o(!0,e)??!0,e),c=[],l=t.getRowManager().getRowData();for(let e of Object.keys(l)){let n=Number(e);n>=0&&n<t.getRowCount()&&t.getRowVisible(n)&&t.getRowHeight(n)===0&&c.push({startRow:n,endRow:n,startColumn:0,endColumn:t.getColumnCount()-1})}let u=[...t.getHiddenRows(),...n.Rectangle.mergeRanges(c)].map(e=>({...e,rangeType:n.RANGE_TYPE.ROW})).filter(n=>s({axis:`row`,range:n,workbook:e,worksheet:t})),d=n.Rectangle.mergeRanges(u).map(e=>({...e,rangeType:n.RANGE_TYPE.ROW})),f=[],p=t.getColumnManager().getColumnData();for(let e of Object.keys(p)){let n=Number(e);n>=0&&n<t.getColumnCount()&&t.getColVisible(n)&&t.getColumnWidth(n)===0&&f.push({startRow:0,endRow:t.getRowCount()-1,startColumn:n,endColumn:n})}let m=[...t.getHiddenCols(),...n.Rectangle.mergeRanges(f)].map(e=>({...e,rangeType:n.RANGE_TYPE.COLUMN})).filter(n=>s({axis:`column`,range:n,workbook:e,worksheet:t})),h=n.Rectangle.mergeRanges(m).map(e=>({...e,rangeType:n.RANGE_TYPE.COLUMN})),{scene:g}=this._getSheetObject(),_=t.getRowCount(),v=d.map(n=>{let{startRow:i,endRow:o}=n,s=or(i,0,g,a),c=i!==0,l=o!==_-1;return new wo(To,{type:0,hovered:!1,hasPrevious:c,hasNext:l,top:s.startY-(c?12:0),left:s.startX-12},()=>this._commandService.executeCommand(r.SetSpecificRowsVisibleCommand.id,{unitId:e.getUnitId(),subUnitId:t.getSheetId(),ranges:[n]}))}),y=t.getColumnCount(),b=h.map(n=>{let{startColumn:i,endColumn:o}=n,s=or(0,i,g,a),c=i!==0,l=o!==y-1;return new wo(To,{type:1,hovered:!1,hasPrevious:c,hasNext:l,top:Math.max(a.columnHeaderHeight,a.columnHeaderHeightAndMarginTop)-12,left:s.startX-(c?12:0)},()=>this._commandService.executeCommand(r.SetSpecificColsVisibleCommand.id,{unitId:e.getUnitId(),subUnitId:t.getSheetId(),ranges:[n]}))});g.addObjects(b,12),g.addObjects(v,12),this._clearShapes(),this._shapes={cols:b,rows:v}}_clearShapes(){this._shapes.cols.forEach(e=>e.dispose()),this._shapes.rows.forEach(e=>e.dispose()),this._shapes={cols:[],rows:[]}}_getSheetObject(){return ar(this._workbook,this._context)}};Do=K([G(1,(0,n.Inject)(q)),G(2,(0,n.Inject)(bo)),G(3,n.ICommandService)],Do);let Oo=/* @__PURE__ */ new Set([a.SHEET_VIEWPORT_KEY.VIEW_MAIN,a.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT_TOP,a.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT,a.SHEET_VIEWPORT_KEY.VIEW_MAIN_TOP]),ko=/* @__PURE__ */ new Set([a.SHEET_VIEWPORT_KEY.VIEW_ROW_TOP,a.SHEET_VIEWPORT_KEY.VIEW_ROW_BOTTOM]),Ao=/* @__PURE__ */ new Set([a.SHEET_VIEWPORT_KEY.VIEW_COLUMN_LEFT,a.SHEET_VIEWPORT_KEY.VIEW_COLUMN_RIGHT]),jo=[`__SpreadsheetSelectionShape__`,`__SpreadsheetSelectionTopControl__`,`__SpreadsheetSelectionBottomControl__`,`__SpreadsheetSelectionShapeLeftControl__`,`__SpreadsheetSelectionShapeRightControl__`,`__SpreadsheetSelectionExpandControlTopLeft__`,`__SpreadsheetSelectionExpandControlBottomRight__`,`__SpreadsheetSelectionBackgroundControlTop__`,`__SpreadsheetSelectionBackgroundControlMiddleLeft__`,`__SpreadsheetSelectionBackgroundControlMiddleRight__`,`__SpreadsheetSelectionBackgroundControlBottom__`],Mo=(0,n.createInterceptorKey)(`mobile-context-menu`);function No(e){return!!e&&jo.some(t=>e.startsWith(t))}function Po(e){return Oo.has(e)?i.ContextMenuPosition.MAIN_AREA:ko.has(e)?i.ContextMenuPosition.ROW_HEADER:Ao.has(e)?i.ContextMenuPosition.COL_HEADER:null}function Fo(e,t){return e.some(e=>n.Rectangle.contains(`range`in e?e.range:e,t))}let Io=class extends n.Disposable{constructor(e,t,r,i,a,o,s,c){super(),this._context=e,this._layoutService=t,this._contextMenuService=r,this._contextService=i,this._commandService=a,this._renderManagerService=o,this._selectionManagerService=s,this._sheetSkeletonManagerService=c,z(this,`contextMenuInterceptor`,new n.InterceptorManager({MOBILE_CONTEXT_MENU:Mo})),this.disposeWithMe((0,n.toDisposable)(()=>this.contextMenuInterceptor.dispose())),this._init()}_init(){let e=this._layoutService.getContentElement();if(!e)return;let t=this._createLongPressState(),r=!1;this.disposeWithMe(this._context.activated$.subscribe(e=>{r=e,r||this._resetLongPressState(t)}));let i=n=>{r&&this._handlePointerDown(e,t,n)},a=n=>this._handlePointerMove(e,t,n),o=e=>this._handlePointerUp(t,e),s=()=>this._resetLongPressState(t);e.addEventListener(`pointerdown`,i,!0),e.addEventListener(`pointermove`,a,!0),e.addEventListener(`pointerup`,o,!0),e.addEventListener(`pointercancel`,s,!0),this.disposeWithMe((0,n.toDisposable)(()=>{e.removeEventListener(`pointerdown`,i,!0),e.removeEventListener(`pointermove`,a,!0),e.removeEventListener(`pointerup`,o,!0),e.removeEventListener(`pointercancel`,s,!0),this._resetLongPressState(t)}))}_createLongPressState(){return{activeTouch:null,longPressTimer:null,longPressTriggered:!1,selectionSnapshot:[],target:null}}_clearLongPressTimer(e){e.longPressTimer!=null&&(clearTimeout(e.longPressTimer),e.longPressTimer=null)}_resetLongPressState(e){this._clearLongPressTimer(e),e.activeTouch=null,e.longPressTriggered=!1,e.target=null}_getPointerOffset(e,t){let n=e.getBoundingClientRect();return{clientX:t.clientX,clientY:t.clientY,offsetX:t.clientX-n.left,offsetY:t.clientY-n.top,pointerId:t.pointerId}}_getTargetCellByOffset(e,t,n){var r;let i=(r=this._sheetSkeletonManagerService.getCurrentParam())==null?void 0:r.skeleton,{scene:o}=this._context;if(!i)return null;let s=o.getCoordRelativeToViewport(a.Vector2.FromArray([e,t])),c=o.getScrollXYInfoByViewport(s,n),{scaleX:l,scaleY:u}=o.getAncestorScale();return i.getCellWithCoordByOffset(s.x,s.y,l,u,c)}_resolveLongPressTarget(e,t){let{scene:n}=this._context,r=n.getActiveViewportByCoord(a.Vector2.FromArray([e,t]));if(!r)return null;let o=Po(r.viewportKey);if(!o)return null;if(o!==i.ContextMenuPosition.MAIN_AREA)return{cell:null,menuPosition:o,selectionObjectPicked:!1};let s=n.pick(a.Vector2.FromArray([e,t])),c=No(s&&`oKey`in s?s.oKey:void 0);if(s&&s!==this._context.mainComponent&&!c)return null;let l=this._getTargetCellByOffset(e,t,r);return l?{cell:l,menuPosition:o,selectionObjectPicked:c}:null}_getCurrentRenderSelections(){let e=this._renderManagerService.getRenderUnitById(this._context.unitId),t=e==null?void 0:e.with(W);return(t==null?void 0:t.getSelectionControls().map(e=>(0,r.convertSelectionDataToRange)(e.getValue())))??[]}_cloneSelections(e){return e.map(e=>({range:{...e.range},primary:e.primary?{...e.primary}:e.primary,style:e.style?{...e.style}:e.style}))}_getSelectionSnapshot(){let e=this._getCurrentRenderSelections();return e.length?this._cloneSelections(e):this._cloneSelections(this._selectionManagerService.getCurrentSelections())}_selectTargetCell(e){let t=this._context.unit.getActiveSheet();if(!t)return!1;let{startRow:i,endRow:a,startColumn:o,endColumn:s}=e.mergeInfo;return this._commandService.syncExecuteCommand(r.SetSelectionsOperation.id,{unitId:this._context.unitId,subUnitId:t.getSheetId(),type:r.SelectionMoveType.MOVE_END,selections:[{range:{startRow:i,endRow:a,startColumn:o,endColumn:s,rangeType:n.RANGE_TYPE.NORMAL},primary:(0,r.convertPrimaryWithCoordToPrimary)(e),style:null}]})}_openMenu(e,t,n){let r=new MouseEvent(`contextmenu`,{clientX:e,clientY:t});this._contextMenuService.triggerContextMenu(r,n,{unitId:this._context.unitId})}_triggerLongPress(e){var t,n;e.longPressTimer=null;let{activeTouch:r,target:a}=e;if(!r||!a||this._contextMenuService.visible||this._contextService.getContextValue(`MOBILE_PINCH_ZOOMING`)||this._contextService.getContextValue(`MOBILE_EXPANDING_SELECTION`)||a.menuPosition===i.ContextMenuPosition.MAIN_AREA&&a.cell&&!a.selectionObjectPicked&&!Fo(e.selectionSnapshot,a.cell.mergeInfo)&&!this._selectTargetCell(a.cell))return;e.longPressTriggered=!0,this._contextService.setContextValue(Jr,!0);let o=this._context.unit.getActiveSheet();o&&(this.contextMenuInterceptor.fetchThroughInterceptors(Mo)(!1,{col:(t=a.cell)==null?void 0:t.actualColumn,menuPosition:a.menuPosition,row:(n=a.cell)==null?void 0:n.actualRow,subUnitId:o.getSheetId(),unitId:this._context.unitId})||this._openMenu(r.clientX,r.clientY,a.menuPosition))}_handlePointerDown(e,t,n){if(this._resetLongPressState(t),this._contextService.setContextValue(Jr,!1),this._contextMenuService.visible){this._contextMenuService.hideContextMenu();return}if(!n.isPrimary||n.button!==0||this._contextService.getContextValue(`MOBILE_PINCH_ZOOMING`)||this._contextService.getContextValue(`MOBILE_EXPANDING_SELECTION`))return;let r=this._getPointerOffset(e,n),i=this._resolveLongPressTarget(r.offsetX,r.offsetY);i&&(t.activeTouch=r,t.selectionSnapshot=this._getSelectionSnapshot(),t.target=i,t.longPressTimer=setTimeout(()=>this._triggerLongPress(t),500))}_handlePointerMove(e,t,n){if(!t.activeTouch||!n.isPrimary||n.pointerId!==t.activeTouch.pointerId){this._resetLongPressState(t);return}let r=this._getPointerOffset(e,n);(Math.abs(r.offsetX-t.activeTouch.offsetX)>10||Math.abs(r.offsetY-t.activeTouch.offsetY)>10)&&this._resetLongPressState(t)}_handlePointerUp(e,t){var n;((n=e.activeTouch)==null?void 0:n.pointerId)===t.pointerId&&(e.longPressTriggered&&t.preventDefault(),this._resetLongPressState(e))}};Io=K([G(1,i.ILayoutService),G(2,i.IContextMenuService),G(3,n.IContextService),G(4,n.ICommandService),G(5,a.IRenderManagerService),G(6,(0,n.Inject)(r.SheetsSelectionsService)),G(7,(0,n.Inject)(q))],Io);let Lo=class extends n.RxDisposable{constructor(e,t,n,r,i,a,s){super(),this._context=e,this._configService=t,this._sheetSkeletonManagerService=n,this._sheetRenderService=r,this._commandService=i,this._telemetryService=a,this._formulaDataModel=s,z(this,`_arrayFormulaSheets`,void 0),z(this,`_hadEmbeddedArrayData`,void 0),z(this,`_renderMetric$`,new o.Subject),z(this,`renderMetric$`,this._renderMetric$.asObservable()),z(this,`_renderFrameTimeMetric`,null),z(this,`_renderFrameTags`,{}),z(this,`_afterRenderMetric$`,new o.Subject),this._formulaDataModel&&(this._arrayFormulaSheets=Ro(this._context.unitId,{arrayFormulaCellData:this._formulaDataModel.getArrayFormulaCellData(),arrayFormulaRange:this._formulaDataModel.getArrayFormulaRange()})),this._addNewRender(),this._initRenderMetricSubscriber()}_getSheetType(){var e;return(e=this._context.unit.getActiveSheet())==null?void 0:e.getConfig().type}_addNewRender(){let{scene:e,engine:t,unit:n}=this._context;this._addComponent(n),this._initWorksheetVisibility(),this._initRerenderScheduler(),this._initCommandListener();let r=this._context.unit.getActiveSheet();if(!r)throw Error(`No active sheet found`);let i=r.getSheetId();this._sheetSkeletonManagerService.setCurrent({sheetId:i});let a=()=>e.render();this.disposeWithMe(this._context.activated$.subscribe(e=>{e?t.runRenderLoop(a):t.stopRenderLoop(a)}))}_initRenderMetricSubscriber(){let{engine:e}=this._context;this.disposeWithMe(e.beginFrame$.subscribe(()=>{this._renderFrameTimeMetric=null,this._renderFrameTags={}})),this.disposeWithMe(e.endFrame$.subscribe(()=>{this._renderFrameTimeMetric&&Object.keys(this._renderFrameTimeMetric).some(e=>e.startsWith(a.SHEET_EXTENSION_PREFIX))&&this._afterRenderMetric$.next({frameTimeMetric:this._renderFrameTimeMetric,tags:this._renderFrameTags})})),this.disposeWithMe(e.renderFrameTimeMetric$.subscribe(([e,t])=>{this._renderFrameTimeMetric||={},this._renderFrameTimeMetric[e]||(this._renderFrameTimeMetric[e]=[]),this._renderFrameTimeMetric[e].push(Math.round(t*100)/100)})),this.disposeWithMe(e.renderFrameTags$.subscribe(([e,t])=>{this._renderFrameTags[e]=t}));let t=[];this.disposeWithMe(this._afterRenderMetric$.pipe((0,o.withLatestFrom)(e.endFrame$)).subscribe(([e,n])=>{t.push({FPS:n.FPS,elapsedTime:n.elapsedTime,frameTime:Math.round(n.frameTime*100)/100,...e.frameTimeMetric,...e.tags}),t.length>60&&(this._captureRenderMetric(t),t.length=0)}))}_captureRenderMetric(e){var t;let n=e;if(n.length===0)return;let r=e=>{let t=0,n=Object.entries(e).filter(([e,t])=>Array.isArray(t)).map(([e])=>e).reduce((t,n)=>(t[n]=e[n].reduce((e,t)=>e+t,0),t),{});return Object.keys(e).filter(e=>e.startsWith(a.SHEET_EXTENSION_PREFIX)).forEach(e=>{t+=n[e]}),{...n,extensionTotal:t}},i=(e=>Object.entries(e[0]).filter(([e,t])=>![`elapsedTime`].includes(e)).filter(([e,t])=>typeof t==`number`).map(([e])=>e).reduce((t,n)=>{let r=e.map(e=>e[n]),i=Math.max(...r),a=Math.min(...r),o=r.reduce((e,t)=>e+t,0)/r.length;return t[n]={max:Math.round(i*100)/100,min:Math.round(a*100)/100,avg:Math.round(o*100)/100},t},{}))(e.map(e=>({...e,...r(e)}))),o=n[n.length-1].elapsedTime,s={sheetId:this._context.unit.getActiveSheet().getSheetId(),unitId:this._context.unit.getUnitId(),elapsedTimeToStart:o,...i};this._renderMetric$.next(s),(t=this._telemetryService)==null||t.capture(`sheet_render_cost`,s)}_addComponent(e){let{scene:t,components:r}=this._context,i=e.getActiveSheet(),o=new a.Spreadsheet(`__SpreadsheetRender__`);this._addViewport(i);let s=new a.SpreadsheetRowHeader(`__SpreadsheetRowHeader__`),c=new a.SpreadsheetColumnHeader(`__SpreadsheetColumnHeader__`),l=new a.Rect(`__SpreadsheetLeftTopPlaceholder__`,{zIndex:2,left:-1,top:-1,fill:`gray.50`,stroke:`gray.200`,strokeWidth:1});l.viewportCacheReusable=!0,t.setViewportCacheReuseKey(a.SHEET_VIEWPORT_KEY.VIEW_MAIN),this.disposeWithMe((0,n.toDisposable)(()=>t.setViewportCacheReuseKey(null))),this._context.mainComponent=o,r.set(`__SpreadsheetRender__`,o),r.set(`__SpreadsheetRowHeader__`,s),r.set(`__SpreadsheetColumnHeader__`,c),r.set(`__SpreadsheetLeftTopPlaceholder__`,l),t.addObjects([o],0),t.addObjects([s,c,l],10),t.enableLayerCache(0,10)}_initViewports(e,t,n){let r=t.hidden?0:t.width,i=n.hidden?0:n.height,o=new a.Viewport(a.SHEET_VIEWPORT_KEY.VIEW_MAIN,e,{left:r,top:i,bottom:0,right:0,isWheelPreventDefaultX:!0,allowCache:!0,bufferEdgeX:100,bufferEdgeY:100}),s=new a.Viewport(a.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT_TOP,e,{isWheelPreventDefaultX:!0,active:!1,allowCache:!0,bufferEdgeX:0,bufferEdgeY:0}),c=new a.Viewport(a.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT,e,{isWheelPreventDefaultX:!0,active:!1,allowCache:!0,bufferEdgeX:0,bufferEdgeY:100}),l=new a.Viewport(a.SHEET_VIEWPORT_KEY.VIEW_MAIN_TOP,e,{isWheelPreventDefaultX:!0,active:!1,allowCache:!0,bufferEdgeX:100,bufferEdgeY:0}),u=new a.Viewport(a.SHEET_VIEWPORT_KEY.VIEW_ROW_TOP,e,{active:!1,isWheelPreventDefaultX:!0}),d=new a.Viewport(a.SHEET_VIEWPORT_KEY.VIEW_ROW_BOTTOM,e,{left:0,top:i,bottom:0,width:r+1,isWheelPreventDefaultX:!0}),f=new a.Viewport(a.SHEET_VIEWPORT_KEY.VIEW_COLUMN_LEFT,e,{active:!1,isWheelPreventDefaultX:!0}),p=new a.Viewport(a.SHEET_VIEWPORT_KEY.VIEW_COLUMN_RIGHT,e,{left:r,top:0,height:i+1,right:0,isWheelPreventDefaultX:!0});return{viewMain:o,viewLeftTop:new a.Viewport(a.SHEET_VIEWPORT_KEY.VIEW_LEFT_TOP,e,{left:0,top:0,width:r,height:i,isWheelPreventDefaultX:!0}),viewMainLeftTop:s,viewMainLeft:c,viewMainTop:l,viewColumnLeft:f,viewRowTop:u,viewRowBottom:d,viewColumnRight:p}}_addViewport(e){let t=this._context.scene,{rowHeader:n,columnHeader:r}=e.getConfig(),{viewMain:i}=this._initViewports(t,n,r),o=this._configService.getConfig(U),s=o==null?void 0:o.scrollConfig;return new a.ScrollBar(i,s),t.attachControl(),i}_initWorksheetVisibility(){let e=!1;this.disposeWithMe(this._context.unit.activeSheet$.subscribe(t=>{let{scene:r,components:i}=this._context,o=(t==null?void 0:t.getConfig().type)===n.SheetTypes.CHART;if(o||e){e=o;for(let e of[`__SpreadsheetRender__`,`__SpreadsheetRowHeader__`,`__SpreadsheetColumnHeader__`,`__SpreadsheetLeftTopPlaceholder__`]){let t=i.get(e);o?t==null||t.hide():t==null||t.show()}if(o)for(let e of[a.SHEET_VIEWPORT_KEY.VIEW_MAIN,a.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT_TOP,a.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT,a.SHEET_VIEWPORT_KEY.VIEW_MAIN_TOP,a.SHEET_VIEWPORT_KEY.VIEW_ROW_TOP,a.SHEET_VIEWPORT_KEY.VIEW_ROW_BOTTOM,a.SHEET_VIEWPORT_KEY.VIEW_COLUMN_LEFT,a.SHEET_VIEWPORT_KEY.VIEW_COLUMN_RIGHT,a.SHEET_VIEWPORT_KEY.VIEW_LEFT_TOP]){let t=r.getViewport(e);t&&(t.viewportKey===a.SHEET_VIEWPORT_KEY.VIEW_MAIN?(t.enable(),t.setMargin(0,0),t.resetPadding(),t.resizeWhenFreezeChange({left:0,top:0,right:0,bottom:0})):t.disable())}else for(let e of[a.SHEET_VIEWPORT_KEY.VIEW_MAIN,a.SHEET_VIEWPORT_KEY.VIEW_ROW_BOTTOM,a.SHEET_VIEWPORT_KEY.VIEW_COLUMN_RIGHT,a.SHEET_VIEWPORT_KEY.VIEW_LEFT_TOP]){var s;(s=r.getViewport(e))==null||s.enable()}r.makeDirty()}}))}_initRerenderScheduler(){this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.subscribe(e=>{if(!e)return null;let{skeleton:t,sheetId:r}=e,i=this._context.unit,a=i==null?void 0:i.getSheetBySheetId(r);if(!a||a!==i.getActiveSheet()||a.getConfig().type===n.SheetTypes.CHART)return;let{mainComponent:o,components:s}=this._context,c=o,l=s.get(`__SpreadsheetRowHeader__`),u=s.get(`__SpreadsheetColumnHeader__`),d=s.get(`__SpreadsheetLeftTopPlaceholder__`),f=zo(t);c==null||c.updateSkeleton(t),l==null||l.updateSkeleton(t),u==null||u.updateSkeleton(t),d==null||d.transformByState({width:f.width,height:f.height})}))}_initCommandListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(e=>{e.id!==dr.id&&e.id!==ur.id&&this._context.scene.invalidateViewportCacheReuse()})),this.disposeWithMe(this._commandService.onCommandExecuted((e,t)=>{let{unit:i}=this._context,{id:a}=e;if(r.COMMAND_LISTENER_SKELETON_CHANGE.includes(a)||this._sheetRenderService.checkMutationShouldTriggerRerender(a)){let{unitId:t,subUnitId:n}=e.params,r=i.getActiveSheet();if(!r)return;let o=this._context.unitId,s=r.getSheetId();if(t!==o||n!==s)return;this._sheetSkeletonManagerService.makeDirty({sheetId:s,commandId:a},!0),this._sheetSkeletonManagerService.setCurrent({sheetId:s,commandId:a})}else r.COMMAND_LISTENER_VALUE_CHANGE.includes(a)&&this._sheetSkeletonManagerService.reCalculate();e.type===n.CommandType.MUTATION&&this._markUnitDirty(e,t)}))}_markUnitDirty(e,t){if(e.id.substring(0,3)===`doc`||!this._sheetRenderService.shouldAutomaticallyRenderMutation(e.id))return;let i=!0;if(e.id===u.SetArrayFormulaDataMutation.id&&e.params){var a;let t=e.params,n=Ro(this._context.unitId,t),r=this._arrayFormulaSheets;this._arrayFormulaSheets=n;let o=(a=this._context.unit.getActiveSheet())==null?void 0:a.getSheetId(),s=this._hadEmbeddedArrayData,c=Object.values(t.arrayFormulaEmbedded??{}).some(e=>Object.values(e??{}).some(e=>Object.keys(e??{}).length>0));this._hadEmbeddedArrayData=c,r&&o&&!r.has(o)&&!n.has(o)&&s===!1&&!c&&(i=!1)}let{mainComponent:o,scene:s}=this._context;if(e.id===u.SetFormulaCalculationNotificationMutation.id&&e.params.stageInfo!=null||(o&&i&&o.makeDirty(),s.makeDirty(),!e.params||this._getSheetType()===n.SheetTypes.CHART))return;let c=e.params,l=this._spreadsheetViewports(s);if(e.id===r.SetRangeValuesMutation.id&&c.cellValue&&!(t!=null&&t.fromChangeset)){let e=this._cellValueToRange(c.cellValue),t=this._rangeToBounds([e]);this._markViewportDirty(l,t),o.setDirtyArea(t)}if(e.id===r.MoveRangeMutation.id&&c.from&&c.to&&!(t!=null&&t.fromChangeset)){let e=c.fromRange||this._cellValueToRange(c.from.value),t=c.toRange||this._cellValueToRange(c.to.value),n=this._rangeToBounds([e,t]);this._markViewportDirty(l,n),o.setDirtyArea(n)}}_cellValueToRange(e){let t=[],n=0,r=0,i=0,a=0;for(let[o,s]of Object.entries(e)){for(let e in s)t.push(Number(e)),n>Number(e)&&(n=Number(e)),r<Number(e)&&(r=Number(e));i>Number(o)&&(i=Number(o)),a<Number(o)&&(a=Number(o))}return{startRow:i,endRow:a,startColumn:n,endColumn:r}}_rangeToBounds(e){let t=this._sheetSkeletonManagerService.getCurrentParam();if(!t)return[];let{rowHeightAccumulation:n,columnWidthAccumulation:r,rowHeaderWidth:i,columnHeaderHeight:a}=t.skeleton,o=[];for(let t of e){let{startRow:e,endRow:s,startColumn:c,endColumn:l}=t,u=e===0?0:n[e-1]+a,d=n[s]+a,f=c===0?0:r[c-1]+i,p=r[l]+i;o.push({top:u,left:f,bottom:d,right:p,width:p-f,height:d-u})}return o}_markViewportDirty(e,t){let r=e.filter(e=>e.isActive&&e.cacheBound);for(let e of r)for(let r of t)n.Rectangle.hasIntersectionBetweenTwoRect(e.cacheBound,r)&&e.markDirty(!0)}_spreadsheetViewports(e){return e.getViewports().filter(e=>[`viewMain`,`viewMainLeftTop`,`viewMainTop`,`viewMainLeft`].includes(e.viewportKey))}};Lo=K([G(1,(0,n.Inject)(n.IConfigService)),G(2,(0,n.Inject)(q)),G(3,(0,n.Inject)(ii)),G(4,n.ICommandService),G(5,(0,n.Optional)(d.ITelemetryService)),G(6,(0,n.Optional)(u.FormulaDataModel))],Lo);function Ro(e,t){let n=/* @__PURE__ */ new Set;for(let r of[t.arrayFormulaCellData,t.arrayFormulaRange]){let t=r==null?void 0:r[e];for(let e in t)t[e]&&Object.keys(t[e]).length&&n.add(e)}return n}function zo(e){return{width:e.rowHeaderWidthAndMarginLeft??e.rowHeaderWidth,height:e.columnHeaderHeightAndMarginTop??e.columnHeaderHeight}}var Bo=class{constructor(){z(this,`_functions`,[{func:u.FUNCTION_NAMES_STATISTICAL.MAX,filter:e=>{var t,n;return(((t=e.values.find(e=>e.func===u.FUNCTION_NAMES_STATISTICAL.COUNTA))==null?void 0:t.value)??0)>1&&(((n=e.values.find(e=>e.func===u.FUNCTION_NAMES_STATISTICAL.COUNT))==null?void 0:n.value)??0)>0}},{func:u.FUNCTION_NAMES_STATISTICAL.MIN,filter:e=>{var t,n;return(((t=e.values.find(e=>e.func===u.FUNCTION_NAMES_STATISTICAL.COUNTA))==null?void 0:t.value)??0)>1&&(((n=e.values.find(e=>e.func===u.FUNCTION_NAMES_STATISTICAL.COUNT))==null?void 0:n.value)??0)>0}},{func:u.FUNCTION_NAMES_MATH.SUM,filter:e=>{var t,n;return(((t=e.values.find(e=>e.func===u.FUNCTION_NAMES_STATISTICAL.COUNTA))==null?void 0:t.value)??0)>1&&(((n=e.values.find(e=>e.func===u.FUNCTION_NAMES_STATISTICAL.COUNT))==null?void 0:n.value)??0)>0}},{func:u.FUNCTION_NAMES_STATISTICAL.COUNTA,filter:e=>{var t;return(((t=e.values.find(e=>e.func===u.FUNCTION_NAMES_STATISTICAL.COUNTA))==null?void 0:t.value)??0)>1}},{func:u.FUNCTION_NAMES_STATISTICAL.COUNT,filter:e=>{var t,n;return(((t=e.values.find(e=>e.func===u.FUNCTION_NAMES_STATISTICAL.COUNTA))==null?void 0:t.value)??0)>1&&(((n=e.values.find(e=>e.func===u.FUNCTION_NAMES_STATISTICAL.COUNT))==null?void 0:n.value)??0)>0}},{func:u.FUNCTION_NAMES_STATISTICAL.AVERAGE,filter:e=>{var t,n;return(((t=e.values.find(e=>e.func===u.FUNCTION_NAMES_STATISTICAL.COUNTA))==null?void 0:t.value)??0)>1&&(((n=e.values.find(e=>e.func===u.FUNCTION_NAMES_STATISTICAL.COUNT))==null?void 0:n.value)??0)>0}}]),z(this,`_state$`,new o.BehaviorSubject(null)),z(this,`state$`,this._state$.asObservable())}dispose(){this._state$.complete()}setState(e){let t={values:[],pattern:null};e==null||e.values.forEach(n=>{let r=this._functions.find(e=>e.func===n.func);r&&(r.filter===void 0||r.filter(e))&&t.values.push(n)}),t.pattern=(e==null?void 0:e.pattern)??null,this._state$.next(t)}getState(){return this._state$.getValue()}getFunctions(){return this._functions}addFunctions(e){this._functions.push(...e)}};let Vo=(0,n.createIdentifier)(`univer.sheet-status-bar.service`),Ho=(0,n.createInterceptorKey)(`statusBarPermissionCorrect`);var Uo=class{constructor(){z(this,`_sum`,0),z(this,`_count`,0),z(this,`_countNumber`,0),z(this,`_min`,1/0),z(this,`_max`,-1/0)}add(e,t,r){if(!n.Tools.isDefine(e==null?void 0:e.v))return;let i=e==null?void 0:e.t,{v:a}=e,o=e=>{this._sum+=e,this._countNumber++,this._min=Math.min(this._min,e),this._max=Math.max(this._max,e)},s=(e,t,r)=>{var i;if(!(e!=null&&(i=e.n)!=null&&i.pattern))return;let{pattern:a}=e.n;r[a]||(r[a]=n.numfmt.getFormatInfo(a)),r[a].isDate&&o(t)};if(typeof a==`string`&&i===n.CellValueType.NUMBER){let e=Number(a);Number.isNaN(e)||(a=e)}typeof a==`number`&&i!==n.CellValueType.STRING?o(a):i===n.CellValueType.NUMBER&&e.s&&s(t.get(e.s),a,r),this._count++}getResults(){return{sum:this._sum,count:this._countNumber,countA:this._count,min:this._min,max:this._max}}};function Wo(e){let{sum:t,count:n,countA:r,min:i,max:a}=e.getResults();return[{func:u.FUNCTION_NAMES_STATISTICAL.MAX,value:a},{func:u.FUNCTION_NAMES_STATISTICAL.MIN,value:i},{func:u.FUNCTION_NAMES_MATH.SUM,value:t},{func:u.FUNCTION_NAMES_STATISTICAL.COUNTA,value:r},{func:u.FUNCTION_NAMES_STATISTICAL.COUNT,value:n},{func:u.FUNCTION_NAMES_STATISTICAL.AVERAGE,value:t/n}]}let Go=class extends n.Disposable{constructor(e,t,r,i,a,o){super(),this._univerInstanceService=e,this._selectionManagerService=t,this._statusBarService=r,this._commandService=i,this._numfmtService=a,this._formulaDataModel=o,z(this,`interceptor`,new n.InterceptorManager({STATUS_BAR_PERMISSION_CORRECT:Ho})),this._init()}_init(){this._registerSelectionListener()}_registerSelectionListener(){let e=(0,n.debounce)(e=>{var t;let n=(t=e[e.length-1])==null?void 0:t.primary;this._calculateSelection(e.map(e=>e.range),n)},100),t=(0,n.debounce)(e=>{var t;let n=(t=e[e.length-1])==null?void 0:t.primary;this._calculateSelection(e.map(e=>e.range),n)},500);this.disposeWithMe((0,n.toDisposable)(this._selectionManagerService.selectionMoving$.subscribe(e=>{e&&t(e)}))),this.disposeWithMe((0,n.toDisposable)(this._selectionManagerService.selectionMoveEnd$.subscribe(t=>{t&&e(t)}))),this.disposeWithMe((0,n.toDisposable)(this._selectionManagerService.selectionSet$.subscribe(t=>{t&&e(t)}))),this.disposeWithMe(this._commandService.onCommandExecuted(t=>{if(t.id===r.SetRangeValuesMutation.id){let r=this._selectionManagerService.getCurrentSelections(),{cellValue:i}=t.params;if(r&&r.length>0&&i){let t=new n.ObjectMatrix(i),a=!1;t.forValue((e,t)=>{if(r.some(n=>{let r=n.range;return e>=r.startRow&&e<=r.endRow&&t>=r.startColumn&&t<=r.endColumn}))return a=!0,!1}),a&&e(r)}}}))}_clearResult(){this._statusBarService.setState(null)}getRangeStartEndInfo(e,t){return e.rangeType===n.RANGE_TYPE.ALL?{startRow:0,startColumn:0,endRow:t.getRowCount()-1,endColumn:t.getColumnCount()-1}:e.rangeType===n.RANGE_TYPE.COLUMN?{startRow:0,startColumn:e.startColumn,endRow:t.getRowCount()-1,endColumn:e.endColumn}:e.rangeType===n.RANGE_TYPE.ROW?{startRow:e.startRow,startColumn:0,endRow:e.endRow,endColumn:t.getColumnCount()-1}:{startRow:e.startRow,startColumn:e.startColumn,endRow:e.endRow,endColumn:e.endColumn}}_getCellValue(e,t,n,r){var i;let a=n.getCellRaw(e,t),o=r==null||(i=r[e])==null?void 0:i[t];return o?{t:o.t??(a==null?void 0:a.t),v:o.v??(a==null?void 0:a.v),s:o.s??(a==null?void 0:a.s)}:a}_calculateSelection(e,t){let r=this._univerInstanceService.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET);if(!r)return this._clearResult();let i=r.getUnitId(),a=r.getActiveSheet(),o=a==null?void 0:a.getSheetId();if(!o)return this._clearResult();let s={};if(this._univerInstanceService.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET).getSheets().forEach(e=>{let t=e.getConfig();s[e.getSheetId()]={cellData:new n.ObjectMatrix(t.cellData),rowCount:t.rowCount,columnCount:t.columnCount,rowData:t.rowData,columnData:t.columnData}}),e!=null&&e.length){var c;let s=[];e.forEach(e=>{let{startRow:t,endRow:n}=e,r=null;for(let i=t;i<=n;i++)a.getRowVisible(i)?r===null&&(r=i):r!==null&&(s.push({...e,startRow:r,endRow:i-1}),r=null);r!==null&&s.push({...e,startRow:r,endRow:n})});let u=(0,n.splitIntoGrid)(s),d=new Uo,f=r.getStyles(),p={},m=this._formulaDataModel.getArrayFormulaCellData(),h=m==null||(c=m[i])==null?void 0:c[o];for(let e of u){let{startRow:t,startColumn:n,endColumn:r,endRow:i}=this.getRangeStartEndInfo(e,a);for(let e=t;e<=i;e++)for(let t=n;t<=r;t++){let n=this._getCellValue(e,t,a,h);d.add(n,f,p)}}let g=Wo(d);if(g.every(e=>e===void 0))return;let _=null;if(t){var l;let{actualRow:e,actualColumn:n}=t;_=(l=this._numfmtService.getValue(i,o,e,n))==null?void 0:l.pattern}let v={values:g.filter(e=>e!==void 0),pattern:_};this._statusBarService.setState(v)}else this._clearResult()}};Go=K([G(0,n.IUniverInstanceService),G(1,(0,n.Inject)(r.SheetsSelectionsService)),G(2,Vo),G(3,n.ICommandService),G(4,(0,n.Inject)(r.INumfmtService)),G(5,(0,n.Inject)(u.FormulaDataModel))],Go);let Ko={type:n.CommandType.COMMAND,id:`sheet.command.move-range-confirm`,handler:async(e,t)=>{var i;if(!t||!await e.get(r.SheetInterceptorService).beforeCommandExecute({id:r.MoveRangeCommand.id,params:t}))return!1;let a=e.get(n.ICommandService);if(((i=e.get(n.IConfigService).getConfig(`sheets-ui.config`))==null?void 0:i.warnBeforeDragOverwrite)===!1)return a.executeCommand(r.MoveRangeCommand.id,t);let o=e.get(n.IUniverInstanceService),s=(0,r.getSheetCommandTarget)(o,{unitId:t.fromUnitId,subUnitId:t.fromSubUnitId}),c=(0,r.getSheetCommandTarget)(o,{unitId:t.toUnitId??t.fromUnitId,subUnitId:t.toSubUnitId??t.fromSubUnitId});if(!c)return a.executeCommand(r.MoveRangeCommand.id,t);if(((s==null?void 0:s.unitId)===c.unitId&&s.subUnitId===c.subUnitId?n.Rectangle.subtract(t.toRange,t.fromRange):[t.toRange]).some(e=>(0,r.findFirstNonEmptyCell)(e,c.worksheet)!==null)){let t=e.get(n.LocaleService);if(!await e.get(n.IConfirmService).confirm({id:Ko.id,title:{title:t.t(`sheets-ui.merge.confirm.warning`)},children:{title:t.t(`sheets-ui.info.overwriteCellContent`)},cancelText:t.t(`sheets-ui.button.cancel`),confirmText:t.t(`sheets-ui.button.confirm`)}))return!1}return a.executeCommand(r.MoveRangeCommand.id,t)}},qo={id:`sheet.command.set-zoom-ratio-from-toolbar`,type:n.CommandType.COMMAND,handler:(e,t)=>{if(!t||!Number.isFinite(t.value))return!1;let i=(0,r.getSheetCommandTarget)(e.get(n.IUniverInstanceService));if(!i)return!1;let a=Math.min(M[1],Math.max(M[0],t.value));return e.get(n.ICommandService).executeCommand(Mr.id,{unitId:i.unitId,subUnitId:i.subUnitId,zoomRatio:a/100})}},Jo=`UI_PLUGIN_SHEETS`,Yo=`${Jo}_BORDER_PANEL_COMPONENT`,Xo=[{label:`sheets-ui.borderLine.borderTop`,icon:`UpBorderDoubleIcon`,value:n.BorderType.TOP},{label:`sheets-ui.borderLine.borderBottom`,icon:`DownBorderDoubleIcon`,value:n.BorderType.BOTTOM},{label:`sheets-ui.borderLine.borderLeft`,icon:`LeftBorderDoubleIcon`,value:n.BorderType.LEFT},{label:`sheets-ui.borderLine.borderRight`,icon:`RightBorderDoubleIcon`,value:n.BorderType.RIGHT},{label:`sheets-ui.borderLine.borderNone`,icon:`NoBorderIcon`,value:n.BorderType.NONE},{label:`sheets-ui.borderLine.borderAll`,icon:`AllBorderIcon`,value:n.BorderType.ALL},{label:`sheets-ui.borderLine.borderOutside`,icon:`OuterBorderDoubleIcon`,value:n.BorderType.OUTSIDE},{label:`sheets-ui.borderLine.borderInside`,icon:`InnerBorderDoubleIcon`,value:n.BorderType.INSIDE},{label:`sheets-ui.borderLine.borderHorizontal`,icon:`HorizontalBorderDoubleIcon`,value:n.BorderType.HORIZONTAL},{label:`sheets-ui.borderLine.borderVertical`,icon:`VerticalBorderDoubleIcon`,value:n.BorderType.VERTICAL},{label:`sheets-ui.borderLine.borderTlbr`,icon:`BackSlashDoubleIcon`,value:n.BorderType.TLBR},{label:`sheets-ui.borderLine.borderTlbcTlmr`,icon:`LeftDoubleDiagonalDoubleIcon`,value:n.BorderType.TLBC_TLMR},{label:`sheets-ui.borderLine.borderTlbrTlbcTlmr`,icon:`LeftTridiagonalDoubleIcon`,value:n.BorderType.TLBR_TLBC_TLMR},{label:`sheets-ui.borderLine.borderBlTr`,icon:`SlashDoubleIcon`,value:n.BorderType.BLTR},{label:`sheets-ui.borderLine.borderMltrBctr`,icon:`RightDoubleDiagonalDoubleIcon`,value:n.BorderType.MLTR_BCTR}],Zo=[{label:`sheets-ui.borderStyle.thin`,value:n.BorderStyleTypes.THIN},{label:`sheets-ui.borderStyle.hair`,value:n.BorderStyleTypes.HAIR},{label:`sheets-ui.borderStyle.dotted`,value:n.BorderStyleTypes.DOTTED},{label:`sheets-ui.borderStyle.dashed`,value:n.BorderStyleTypes.DASHED},{label:`sheets-ui.borderStyle.dashDot`,value:n.BorderStyleTypes.DASH_DOT},{label:`sheets-ui.borderStyle.dashDotDot`,value:n.BorderStyleTypes.DASH_DOT_DOT},{label:`sheets-ui.borderStyle.medium`,value:n.BorderStyleTypes.MEDIUM},{label:`sheets-ui.borderStyle.mediumDashed`,value:n.BorderStyleTypes.MEDIUM_DASHED},{label:`sheets-ui.borderStyle.mediumDashDot`,value:n.BorderStyleTypes.MEDIUM_DASH_DOT},{label:`sheets-ui.borderStyle.mediumDashDotDot`,value:n.BorderStyleTypes.MEDIUM_DASH_DOT_DOT},{label:`sheets-ui.borderStyle.thick`,value:n.BorderStyleTypes.THICK},{label:`sheets-ui.borderStyle.double`,value:n.BorderStyleTypes.DOUBLE}];function Qo(e){return(0,o.merge)(e.activeSheet$,e.sheetDisposed$.pipe((0,f.map)(()=>e.getActiveSheet(!0)))).pipe((0,f.map)(t=>!t||!e.getSheetBySheetId(t.getSheetId())?null:t))}function $o(e){return e.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET).pipe((0,f.switchMap)(e=>e?Qo(e).pipe((0,f.map)(t=>t?{workbook:e,worksheet:t}:null)):(0,o.of)(null)))}function Z(e,t,n){return $o(e).pipe((0,f.switchMap)(e=>e?n(e):(0,o.of)(t)))}function es(e,t){let i=e.get(n.IUniverInstanceService),a=e.get(r.IExclusiveRangeService),s=e.get(r.SheetsSelectionsService);return i.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET).pipe((0,f.switchMap)(e=>e?e.activeSheet$.pipe((0,f.switchMap)(e=>e?s.selectionMoveEnd$.pipe((0,f.map)(()=>s.getCurrentSelections()),(0,f.startWith)(s.getCurrentSelections()),(0,f.map)(e=>{if(e.length===0)return!1;let n=a.getInterestGroupId([...e]);return t?n.some(e=>t.has(e)):n.length>0})):(0,o.of)(!1))):(0,o.of)(!1)))}function ts(e,t,n){return(0,o.combineLatest)([t,es(e,n)]).pipe((0,f.map)(([e,t])=>e||t))}function Q(e,t={},i=!1,a=!1){let s=e.get(n.IUniverInstanceService).getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET),c=e.get(n.UserManagerService),l=e.has(Y)?e.get(Y):null,u=e.get(n.IContextService),d=((l==null?void 0:l.visible$)??(0,o.of)(null)).pipe((0,f.startWith)(null),(0,f.shareReplay)({bufferSize:1,refCount:!0})),p=u.subscribeContextValue$(n.FOCUSING_FX_BAR_EDITOR).pipe((0,f.startWith)(!1),(0,f.shareReplay)({bufferSize:1,refCount:!0})),m=u.subscribeContextValue$(n.FOCUSING_SHAPE_TEXT_EDITOR).pipe((0,f.startWith)(!1),(0,f.shareReplay)({bufferSize:1,refCount:!0})),h=u.subscribeContextValue$(n.EDITOR_ACTIVATED).pipe((0,f.startWith)(!1));return(0,o.combineLatest)([c.currentUser$,s,d,p,m,h]).pipe((0,f.switchMap)(([s,c,l,u,d,p])=>!c||l!=null&&l.visible&&l.unitId===c.getUnitId()&&!i||u&&!i?(0,o.of)(!0):Qo(c).pipe((0,f.switchMap)(i=>{if(!i||i.getConfig().type===n.SheetTypes.CHART&&!(a&&d&&p))return(0,o.of)(!0);let s=c.getUnitId(),l=i.getSheetId(),u=e.get(r.RangeProtectionRuleModel),m=e.get(r.WorksheetProtectionRuleModel),h=e.get(r.SheetsSelectionsService),g=h.selectionChanged$.pipe((0,f.startWith)(h.getWorkbookSelections(s).getSelectionsOfWorksheet(l))),_=e.get(n.IContextService).subscribeContextValue$(n.FOCUSING_COMMON_DRAWINGS).pipe((0,f.startWith)(!1)),v=e.get(n.IPermissionService),y=v.permissionPointUpdate$.pipe((0,f.debounceTime)(100),(0,f.startWith)(null));return(0,o.combineLatest)([g,_,y]).pipe((0,f.switchMap)(([e,i])=>{if(i&&!d)return(0,o.of)(!0);let{workbookTypes:a=[r.WorkbookEditablePermission],worksheetTypes:c,rangeTypes:p}=t,h=[];if(a==null||a.forEach(e=>{h.push(new e(s).id)}),c==null||c.forEach(e=>{h.push(new e(s,l).id)}),m.getRule(s,l))return v.composePermission$(h).pipe((0,f.map)(e=>e.some(e=>e.value===!1)));let g=e==null?void 0:e.map(e=>e.range),_=u.getSubunitRuleList(s,l).filter(e=>g==null?void 0:g.some(t=>e.ranges.some(e=>n.Rectangle.intersects(t,e))));return p==null||p.forEach(e=>{_.forEach(t=>{h.push(new e(s,l,t.permissionId).id)})}),v.composePermission$(h).pipe((0,f.map)(e=>e.some(e=>e.value===!1)))}))}))))}function ns(e){let t=e.get(n.IUniverInstanceService),i=e.get(r.SheetsSelectionsService),a=e.get(r.RangeProtectionRuleModel),s=e.get(n.IPermissionService);return(0,o.combineLatest)([$o(t),(0,o.merge)(i.selectionMoveEnd$,s.permissionPointUpdate$.pipe((0,f.debounceTime)(100))).pipe((0,f.startWith)(null))]).pipe((0,f.map)(([e])=>{var t;let o=(t=i.getCurrentLastSelection())==null?void 0:t.range;if(!e||!o)return!0;let{workbook:c,worksheet:l}=e;if(l.getConfig().type===n.SheetTypes.CHART)return!0;let u=c.getUnitId(),d=l.getSheetId(),f=[new r.WorkbookEditablePermission(u).id,new r.WorksheetEditPermission(u,d).id];return a.getSubunitRuleList(u,d).filter(e=>e.ranges.some(e=>n.Rectangle.intersects(o,e))).forEach(e=>{f.push(new r.RangeProtectionPermissionEditPoint(u,d,e.permissionId).id)}),s.composePermission(f).some(e=>e.value===!1)}))}function rs(e,t){let i=e.get(n.IUniverInstanceService),a=e.get(r.SheetsSelectionsService),s=e.get(r.RangeProtectionRuleModel),c=e.get(n.IPermissionService);return(0,o.combineLatest)([$o(i),(0,o.merge)(a.selectionMoveEnd$,c.permissionPointUpdate$.pipe((0,f.debounceTime)(100))).pipe((0,f.startWith)(null))]).pipe((0,f.map)(([e])=>{var i;let o=(i=a.getCurrentLastSelection())==null?void 0:i.range;if(!e||!o)return!0;let{workbook:l,worksheet:u}=e;if(u.getConfig().type===n.SheetTypes.CHART)return!0;let d=l.getUnitId(),f=u.getSheetId(),p=[new r.WorkbookEditablePermission(d).id,new r.WorksheetEditPermission(d,f).id];return s.getSubunitRuleList(d,f).filter(e=>t===`row`?e.ranges.some(e=>o.startRow>e.startRow&&o.startRow<=e.endRow):e.ranges.some(e=>o.startColumn>e.startColumn&&o.startColumn<=e.endColumn)).forEach(e=>{p.push(new r.RangeProtectionPermissionEditPoint(d,f,e.permissionId).id)}),c.composePermission(p).some(e=>e.value===!1)}))}function is(e,t){let i=e.get(n.IUniverInstanceService),a=e.get(r.SheetsSelectionsService),s=e.get(r.RangeProtectionRuleModel),c=e.get(n.IPermissionService);return(0,o.combineLatest)([$o(i),(0,o.merge)(a.selectionMoveEnd$,c.permissionPointUpdate$.pipe((0,f.debounceTime)(100))).pipe((0,f.startWith)(null))]).pipe((0,f.map)(([e])=>{var i;let o=(i=a.getCurrentLastSelection())==null?void 0:i.range;if(!e||!o)return!0;let{workbook:l,worksheet:u}=e;if(u.getConfig().type===n.SheetTypes.CHART)return!0;let d=l.getUnitId(),f=u.getSheetId(),p=[new r.WorkbookEditablePermission(d).id,new r.WorksheetEditPermission(d,f).id],m=n.Tools.deepClone(o);return t===`row`?(m.startColumn=0,m.endColumn=u.getColumnCount()-1):(m.startRow=0,m.endRow=u.getRowCount()-1),s.getSubunitRuleList(d,f).filter(e=>e.ranges.some(e=>n.Rectangle.intersects(m,e))).forEach(e=>{p.push(new r.RangeProtectionPermissionEditPoint(d,f,e.permissionId).id)}),c.composePermission(p).some(e=>e.value===!1)}))}function as(e,t){let i=e.get(n.IUniverInstanceService),a=e.get(r.SheetsSelectionsService),s=e.get(r.RangeProtectionRuleModel),c=e.get(n.IPermissionService);return(0,o.combineLatest)([$o(i),(0,o.merge)(a.selectionMoveEnd$,c.permissionPointUpdate$.pipe((0,f.debounceTime)(100))).pipe((0,f.startWith)(null))]).pipe((0,f.map)(([e])=>{var i;let o=(i=a.getCurrentLastSelection())==null?void 0:i.range;if(!e||!o)return!0;let{workbook:l,worksheet:u}=e;if(u.getConfig().type===n.SheetTypes.CHART)return!0;let d=l.getUnitId(),f=u.getSheetId(),p=[new r.WorkbookEditablePermission(d).id,new r.WorksheetEditPermission(d,f).id],m=n.Tools.deepClone(o);return t===`row`?m.endRow=u.getRowCount()-1:m.endColumn=u.getColumnCount()-1,s.getSubunitRuleList(d,f).filter(e=>e.ranges.some(e=>n.Rectangle.intersects(m,e))).forEach(e=>{p.push(new r.RangeProtectionPermissionEditPoint(d,f,e.permissionId).id)}),c.composePermission(p).some(e=>e.value===!1)}))}function os(e,t){let i=e.get(n.IUniverInstanceService).getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET),a=e.get(n.IPermissionService),s=e.get(n.UserManagerService);return(0,o.combineLatest)([s.currentUser$,i]).pipe((0,f.switchMap)(([n,i])=>i?i.activeSheet$.pipe((0,f.switchMap)(n=>{if(!n)return(0,o.of)(!0);let s=i.getUnitId(),c=n.getSheetId(),l=e.get(r.RangeProtectionRuleModel),u=e.get(r.WorksheetProtectionRuleModel),d=[];t.forEach(e=>d.push(new e(s).id));let p=a.composePermission$(d).pipe((0,f.map)(e=>e.every(e=>e.value===!0)))??(0,o.of)(!1),m=(0,o.merge)(l.ruleChange$,u.ruleChange$).pipe((0,f.startWith)(null));return(0,o.combineLatest)([p,m]).pipe((0,f.map)(([e,t])=>{var n;if(!e)return!0;let r=u.getRule(s,c);return r!=null&&r.permissionId?!0:((n=l.getSubunitRuleList(s,c))==null?void 0:n.filter(e=>e==null?void 0:e.permissionId)).length>0}))})):(0,o.of)(!0)))}function ss(e){let t=e.get(r.BorderStyleManagerService),a=Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]});return{id:r.SetBorderBasicCommand.id,icon:new o.Observable(t=>{let i=`AllBorderIcon`,a=e.get(r.BorderStyleManagerService),o=e.get(n.ICommandService).onCommandExecuted(e=>{if(e.id!==r.SetBorderBasicCommand.id)return;let{type:n}=a.getBorderInfo(),o=Xo.find(e=>e.value===n),s=(o==null?void 0:o.icon)??i;t.next(s)});return t.next(i),o.dispose}),tooltip:`sheets-ui.toolbar.border.main`,type:i.MenuItemType.BUTTON_SELECTOR,slot:!0,selections:[{label:{name:Yo,hoverable:!1,selectable:!1},value$:t.borderInfo$}],value$:t.borderInfo$,hidden$:(0,o.combineLatest)([(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),e.get(n.IContextService).subscribeContextValue$(n.FOCUSING_COMMON_DRAWINGS).pipe((0,o.startWith)(!1))]).pipe((0,o.map)(([e,t])=>e||t)),disabled$:a}}let cs=`sheet.menu.clear-selection`;function ls(e){return{id:cs,type:i.MenuItemType.SUBITEMS,icon:`ClearFormatDoubleIcon`,title:`sheets-ui.rightClick.clearSelection`,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function us(e){return{id:r.ClearSelectionContentCommand.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.clearContent`,disabled$:ts(e,Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellValuePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function ds(e){return{id:r.ClearSelectionFormatCommand.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.clearFormat`,disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]}),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function fs(e){return{id:r.ClearSelectionAllCommand.id,type:i.MenuItemType.BUTTON,icon:`ClearFormatDoubleIcon`,tooltip:`sheets-ui.rightClick.clearAll`,disabled$:ts(e,Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellValuePermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function ps(e){return{id:r.ClearSelectionAllCommand.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.clearAll`,tooltip:`sheets-ui.rightClick.clearAll`,disabled$:ts(e,Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellValuePermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}let ms=`sheet.menu.delete`;function hs(e){return{id:ms,type:i.MenuItemType.SUBITEMS,title:`sheets-ui.rightClick.delete`,icon:`ReduceDoubleIcon`,hidden$:ts(e,ns(e)),disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission]})}}function gs(e){return{id:In.id,type:i.MenuItemType.BUTTON,icon:`DeleteColumnDoubleIcon`,title:`sheets-ui.rightClick.deleteSelectedColumn`,hidden$:is(e,`col`),disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission,r.WorkbookDeleteColumnPermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetDeleteColumnPermission]})}}function _s(e){return{id:Fn.id,type:i.MenuItemType.BUTTON,icon:`DeleteRowDoubleIcon`,title:`sheets-ui.rightClick.deleteSelectedRow`,disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission,r.WorkbookDeleteRowPermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetDeleteRowPermission]}),hidden$:is(e,`row`)}}function vs(e){return{id:Ft.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.moveLeft`,icon:`DeleteCellShiftLeftDoubleIcon`,disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]}),hidden$:as(e,`col`)}}function ys(e){return{id:It.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.moveUp`,icon:`DeleteCellShiftUpDoubleIcon`,disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]}),hidden$:as(e,`row`)}}function bs(e,i){let a=e.get(r.SheetsSelectionsService),c=e.get(n.IUniverInstanceService),l=e.get(n.ICommandService),u=e.get(n.IContextService);return Z(c,i,({worksheet:c})=>new o.Observable(o=>{let d=()=>{var e;let t=i,n=(e=a.getCurrentLastSelection())==null?void 0:e.primary;if(n!=null){let e=c.getComposedCellStyle(n.startRow,n.startColumn);e.fs&&(t=e.fs)}o.next(t)},f=()=>{let t=en(e);if(t!=null){var n;let e=((n=t.ts)==null?void 0:n.fs)??i;o.next(e)}},p=l.onCommandExecuted(e=>{let i=e.id;(i===r.SetRangeValuesMutation.id||i===r.SetSelectionsOperation.id||i===r.SetWorksheetActiveOperation.id)&&d(),(i===s.SetTextSelectionsOperation.id||i===t.SetInlineFormatCommand.id)&&u.getContextValue(n.EDITOR_ACTIVATED)&&(u.getContextValue(n.FOCUSING_SHEET)||u.getContextValue(n.FOCUSING_SHAPE_TEXT_EDITOR))&&f()});return d(),p.dispose}))}function xs(e){let t=n.DEFAULT_STYLES.fs,a=Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]},!0,!0);return{id:cn.id,type:i.MenuItemType.SELECTOR,tooltip:`sheets-ui.toolbar.fontSize`,label:{name:i.FONT_SIZE_COMPONENT,props:{min:6,max:400,disabled$:a}},selections:i.FONT_SIZE_LIST,disabled$:a,value$:bs(e,t),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Ss(e){let t=Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]},!0,!0);return{id:ln.id,type:i.MenuItemType.BUTTON,icon:`FontSizeIncreaseIcon`,tooltip:`sheets-ui.toolbar.fontSizeIncrease`,disabled$:t,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Cs(e){let t=Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]},!0,!0);return{id:un.id,type:i.MenuItemType.BUTTON,icon:`FontSizeReduceIcon`,tooltip:`sheets-ui.toolbar.fontSizeDecrease`,disabled$:t,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}let ws=`${Jo}_MENU_ITEM_FROZEN_COMPONENT`,Ts={row:`1`,col:`A`};function Es(e){if(!e)return Ts;let{primary:t,range:r}=e,i=(t==null?void 0:t.startRow)??r.startRow,a=(t==null?void 0:t.startColumn)??r.startColumn;return{row:i===0?`1`:String(i),col:a===0?`A`:n.Tools.chatAtABC(a-1)}}let Ds=e=>{let{type:t}=e,a=(0,i.useDependency)(n.LocaleService),o=(0,i.useDependency)(r.SheetsSelectionsService),[s,c]=(0,p.useState)(()=>Es(o.getCurrentLastSelection()));return(0,p.useEffect)(()=>{let e=o.selectionChanged$.subscribe(e=>{c(Es(e==null?void 0:e[e.length-1]))});return()=>e.unsubscribe()},[o]),/* @__PURE__ */ (0,m.jsxs)(m.Fragment,{children:[t===`row`&&a.t(`sheets-ui.rightClick.freezeRow`,s.row),t===`col`&&a.t(`sheets-ui.rightClick.freezeCol`,s.col),t===`all`&&a.t(`sheets-ui.rightClick.freezeCell`,s.row,s.col)]})};function Os(e){return Z(e.get(n.IUniverInstanceService),!0,({worksheet:e})=>(0,o.of)(e.getConfig().type===n.SheetTypes.CHART))}let ks=(e,t)=>{let n=e.get(r.SheetsSelectionsService);return new o.Observable(e=>{let r=n=>{if(!n)return e.next(!0);let{primary:r,range:i}=n,a=(r==null?void 0:r.startRow)??i.startRow,o=(r==null?void 0:r.startColumn)??i.startColumn;if(t===`row`&&a<=0||t===`col`&&o<=0)return e.next(!0);e.next(!1)},i=n.selectionChanged$.subscribe(t=>{if(!t||t.length===0)return e.next(!0);r(t[t.length-1])});return r(n.getCurrentLastSelection()),()=>i.unsubscribe()})},As=`sheet.menu.sheet-frozen`,js=`sheet.toolbar.sheet-frozen`;function Ms(e){return{id:js,type:i.MenuItemType.SUBITEMS,tooltip:`sheets-ui.rightClick.freeze`,icon:`FreezeToSelectedIcon`,selections:[{id:Kn.id,value:Kn.id,params:{},icon:`FreezeToSelectedIcon`,label:{name:ws,selectable:!1,props:{type:`all`}}},{id:qn.id,value:qn.id,params:{},icon:`FreezeRowIcon`,label:{name:ws,selectable:!1,props:{type:`row`}}},{id:Jn.id,value:Jn.id,params:{},icon:`FreezeColumnIcon`,label:{name:ws,selectable:!1,props:{type:`col`}}},{id:Yn.id,value:Yn.id,params:{},icon:`FreezeRowIcon`,label:{name:`sheets-ui.rightClick.freezeFirstRow`,selectable:!1}},{id:Xn.id,value:Xn.id,params:{},icon:`FreezeColumnIcon`,label:{name:`sheets-ui.rightClick.freezeFirstCol`,selectable:!1}},{id:r.CancelFrozenCommand.id,value:r.CancelFrozenCommand.id,params:{},icon:`CancelFreezeIcon`,label:{name:`sheets-ui.rightClick.cancelFreeze`,selectable:!1}}],hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),disabled$:Os(e)}}function Ns(e){return{id:As,type:i.MenuItemType.SUBITEMS,title:`sheets-ui.rightClick.freeze`,icon:`FreezeToSelectedIcon`,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),disabled$:Os(e)}}let Ps=`sheet.column-header-menu.sheet-frozen`;function Fs(e){return{id:Ps,type:i.MenuItemType.SUBITEMS,title:`sheets-ui.rightClick.freeze`,icon:`FreezeToSelectedIcon`,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),disabled$:Os(e)}}let Is=`sheet.row-header-menu.sheet-frozen`;function Ls(e){return{id:Is,type:i.MenuItemType.SUBITEMS,title:`sheets-ui.rightClick.freeze`,icon:`FreezeToSelectedIcon`,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),disabled$:Os(e)}}function Rs(e){return{id:Kn.id,type:i.MenuItemType.BUTTON,icon:`FreezeToSelectedIcon`,label:{name:ws,props:{type:`all`}},hidden$:(0,o.combineLatest)([(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),ks(e,`all`)]).pipe((0,o.map)(([e,t])=>e||t))}}function zs(e){return{id:qn.id,type:i.MenuItemType.BUTTON,icon:`FreezeRowIcon`,label:{name:ws,props:{type:`row`}},hidden$:(0,o.combineLatest)([(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),ks(e,`row`)]).pipe((0,o.map)(([e,t])=>e||t))}}function Bs(e){return{id:Jn.id,type:i.MenuItemType.BUTTON,icon:`FreezeColumnIcon`,label:{name:ws,props:{type:`col`}},hidden$:(0,o.combineLatest)([(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),ks(e,`col`)]).pipe((0,o.map)(([e,t])=>e||t))}}function Vs(e){return{id:Yn.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.freezeFirstRow`,icon:`FreezeRowIcon`,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),disabled$:Os(e)}}function Hs(e){return{id:Xn.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.freezeFirstCol`,icon:`FreezeColumnIcon`,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),disabled$:Os(e)}}function Us(e){return{id:r.CancelFrozenCommand.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.cancelFreeze`,icon:`CancelFreezeIcon`,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),disabled$:Os(e)}}function Ws(e){let t=e.get(i.ILayoutService).rootContainerElement,r=t?(0,o.merge)((0,o.of)(null),(0,o.fromEvent)(t.ownerDocument,`fullscreenchange`)).pipe((0,o.map)(()=>t.ownerDocument.fullscreenElement===t),(0,o.distinctUntilChanged)()):(0,o.of)(!1);return{id:i.ToggleFullscreenOperation.id,type:i.MenuItemType.BUTTON,tooltip:`sheets-ui.toolbar.fullscreen`,icon:r.pipe((0,o.map)(e=>e?`ShrinkIcon`:`ExpandIcon`)),activated$:r,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Gs(e){let t=e.get(n.ICommandService),a=e.get(n.IUniverInstanceService);return{id:r.ToggleGridlinesCommand.id,type:i.MenuItemType.BUTTON,tooltip:`sheets-ui.toolbar.toggleGridlines`,icon:`HideGridlinesIcon`,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),activated$:new o.Observable(e=>{let i=()=>{let e=a.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET);return e?e.getActiveSheet().getConfig().showGridlines===n.BooleanNumber.TRUE:!1},o=new n.DisposableCollection;return o.add(t.onCommandExecuted(t=>{(t.id===r.ToggleGridlinesMutation.id||t.id===r.SetWorksheetActiveOperation.id)&&e.next(i())})),o.add(a.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET).subscribe(()=>{e.next(i())})),e.next(i()),()=>o.dispose()}),disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission]})}}let Ks=`${Jo}_MENU_ITEM_INPUT_COMPONENT`,qs=e=>{let{prefix:t,suffix:r,value:a,min:o=-(2**53-1),max:s=2**53-1,disabled$:c,onChange:u}=e,d=(0,i.useDependency)(n.LocaleService),f=(0,i.useDependency)(i.IContextMenuService),h=(0,i.useObservable)(c??null,!1),[g,_]=(0,p.useState)(),v=(0,p.useRef)(!1),y=(0,p.useRef)(null);(0,p.useEffect)(()=>()=>{y.current!==null&&clearTimeout(y.current)},[]);let b=e=>{let t=(e??o).toString();_(t),u(t)};(0,p.useEffect)(()=>{f.visible||_(a)},[f.visible]),(0,p.useEffect)(()=>{+a<o?_(o.toString()):+a>s?_(s.toString()):_(a)},[a]);function x(e){(e.key!==`Escape`&&e.key!==`Enter`||e.nativeEvent.isComposing||v.current)&&e.stopPropagation()}function S(){y.current!==null&&(clearTimeout(y.current),y.current=null),v.current=!1}function C(){S(),v.current=!0}function w(){S(),v.current=!0,y.current=setTimeout(S,0)}return/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-inline-flex univer-items-center univer-gap-1`,children:[d.t(t),/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-w-16`,onClick:e=>e.stopPropagation(),onCompositionStart:C,onCompositionEnd:w,onBlur:S,children:/* @__PURE__ */ (0,m.jsx)(l.InputNumber,{value:Number(g),size:`mini`,precision:0,min:o,max:s,disabled:h,onKeyDown:x,onChange:b})}),d.t(r)]})},Js=`sheet.menu.cell-insert`;function Ys(e){return{id:Js,type:i.MenuItemType.SUBITEMS,title:`sheets-ui.rightClick.insert`,icon:`InsertDoubleIcon`,hidden$:ts(e,ns(e)),disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission,r.WorkbookInsertColumnPermission,r.WorkbookInsertRowPermission],worksheetTypes:[r.WorksheetInsertColumnPermission,r.WorksheetInsertRowPermission,r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})}}function Xs(e){let t=e.get(n.IUniverInstanceService),a=e.get(r.SheetsSelectionsService),s=e.get(n.ICommandService),c=Q(e,{workbookTypes:[r.WorkbookEditablePermission,r.WorkbookInsertRowPermission],worksheetTypes:[r.WorksheetInsertRowPermission,r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]});return{id:r.InsertRowBeforeCommand.id,type:i.MenuItemType.BUTTON,icon:`InsertRowAboveDoubleIcon`,label:{name:Ks,props:{prefix:`sheets-ui.rightClick.insertRowsAbove`,min:1,max:1e3,suffix:`sheets-ui.rightClick.insertRowsAboveSuffix`,disabled$:c}},value$:Z(t,1,()=>new o.Observable(e=>{function t(){var t;let n=(t=a.getCurrentLastSelection())==null?void 0:t.range,r=1;n&&(r=(n==null?void 0:n.endRow)-(n==null?void 0:n.startRow)+1),e.next(r)}let n=s.onCommandExecuted(e=>{if(e.id===r.SetSelectionsOperation.id)return t()});return t(),n.dispose})),disabled$:c,hidden$:rs(e,`row`)}}function Zs(e){let t=e.get(n.IUniverInstanceService),a=e.get(r.SheetsSelectionsService),s=e.get(n.ICommandService),c=Q(e,{workbookTypes:[r.WorkbookEditablePermission,r.WorkbookInsertColumnPermission],worksheetTypes:[r.WorksheetInsertColumnPermission,r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]});return{id:r.InsertColBeforeCommand.id,type:i.MenuItemType.BUTTON,icon:`LeftInsertColumnDoubleIcon`,label:{name:Ks,props:{prefix:`sheets-ui.rightClick.insertColsLeft`,min:1,max:1e3,suffix:`sheets-ui.rightClick.insertColsLeftSuffix`,disabled$:c}},value$:Z(t,1,()=>new o.Observable(e=>{function t(){var t;let n=(t=a.getCurrentLastSelection())==null?void 0:t.range,r=1;n&&(r=(n==null?void 0:n.endColumn)-(n==null?void 0:n.startColumn)+1),e.next(r)}let n=s.onCommandExecuted(e=>{if(e.id===r.SetSelectionsOperation.id)return t()});return t(),n.dispose})),disabled$:c,hidden$:rs(e,`col`)}}function Qs(e){return{id:hn.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.moveRight`,icon:`InsertCellShiftRightDoubleIcon`,disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]}),hidden$:as(e,`col`)}}function $s(e){return{id:mn.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.moveDown`,icon:`InsertCellDownDoubleIcon`,disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]}),hidden$:as(e,`row`)}}function ec(e){let t=e.get(n.IUniverInstanceService),a=e.get(r.SheetsSelectionsService),s=e.get(n.ICommandService),c=Q(e,{workbookTypes:[r.WorkbookEditablePermission,r.WorkbookInsertRowPermission],worksheetTypes:[r.WorksheetInsertRowPermission,r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]});return{id:r.InsertMultiRowsAfterCommand.id,type:i.MenuItemType.BUTTON,icon:`InsertRowBelowDoubleIcon`,label:{name:Ks,props:{prefix:`sheets-ui.rightClick.insertRowsAfter`,min:1,max:1e3,suffix:`sheets-ui.rightClick.insertRowsAfterSuffix`,disabled$:c}},value$:Z(t,1,()=>new o.Observable(e=>{function t(){var t;let n=(t=a.getCurrentLastSelection())==null?void 0:t.range,r=1;n&&(r=(n==null?void 0:n.endRow)-(n==null?void 0:n.startRow)+1),e.next(r)}let n=s.onCommandExecuted(e=>{if(e.id===r.SetSelectionsOperation.id)return t()});return t(),n.dispose})),disabled$:c,hidden$:ns(e)}}function tc(e){let t=e.get(n.IUniverInstanceService),a=e.get(r.SheetsSelectionsService),s=e.get(n.ICommandService),c=Q(e,{workbookTypes:[r.WorkbookEditablePermission,r.WorkbookInsertRowPermission],worksheetTypes:[r.WorksheetInsertRowPermission,r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]});return{id:r.InsertMultiRowsAboveCommand.id,type:i.MenuItemType.BUTTON,icon:`InsertRowAboveDoubleIcon`,label:{name:Ks,props:{prefix:`sheets-ui.rightClick.insertRowsAbove`,min:1,max:1e3,suffix:`sheets-ui.rightClick.insertRowsAboveSuffix`,disabled$:c}},value$:Z(t,1,()=>new o.Observable(e=>{function t(){var t;let n=(t=a.getCurrentLastSelection())==null?void 0:t.range,r=1;n&&(r=(n==null?void 0:n.endRow)-(n==null?void 0:n.startRow)+1),e.next(r)}let n=s.onCommandExecuted(e=>{if(e.id===r.SetSelectionsOperation.id)return t()});return t(),n.dispose})),disabled$:c,hidden$:ns(e)}}function nc(e){let t=e.get(n.IUniverInstanceService),a=e.get(r.SheetsSelectionsService),s=e.get(n.ICommandService),c=Q(e,{workbookTypes:[r.WorkbookEditablePermission,r.WorkbookInsertColumnPermission],worksheetTypes:[r.WorksheetInsertColumnPermission,r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]});return{id:r.InsertMultiColsLeftCommand.id,type:i.MenuItemType.BUTTON,icon:`LeftInsertColumnDoubleIcon`,label:{name:Ks,props:{prefix:`sheets-ui.rightClick.insertColsLeft`,min:1,max:1e3,suffix:`sheets-ui.rightClick.insertColsLeftSuffix`,disabled$:c}},value$:Z(t,1,()=>new o.Observable(e=>{function t(){var t;let n=(t=a.getCurrentLastSelection())==null?void 0:t.range,r=1;n&&(r=(n==null?void 0:n.endColumn)-(n==null?void 0:n.startColumn)+1),e.next(r)}let n=s.onCommandExecuted(e=>{if(e.id===r.SetSelectionsOperation.id)return t()});return t(),n.dispose})),disabled$:c,hidden$:ns(e)}}function rc(e){let t=e.get(n.IUniverInstanceService),a=e.get(r.SheetsSelectionsService),s=e.get(n.ICommandService),c=Q(e,{workbookTypes:[r.WorkbookEditablePermission,r.WorkbookInsertColumnPermission],worksheetTypes:[r.WorksheetInsertColumnPermission,r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]});return{id:r.InsertMultiColsRightCommand.id,type:i.MenuItemType.BUTTON,icon:`RightInsertColumnDoubleIcon`,label:{name:Ks,props:{prefix:`sheets-ui.rightClick.insertColsRight`,min:1,max:1e3,suffix:`sheets-ui.rightClick.insertColsRightSuffix`,disabled$:c}},value$:Z(t,1,()=>new o.Observable(e=>{function t(){var t;let n=(t=a.getCurrentLastSelection())==null?void 0:t.range,r=1;n&&(r=(n==null?void 0:n.endColumn)-(n==null?void 0:n.startColumn)+1),e.next(r)}let n=s.onCommandExecuted(e=>{if(e.id===r.SetSelectionsOperation.id)return t()});return t(),n.dispose})),disabled$:c,hidden$:ns(e)}}let ic=/* @__PURE__ */ function(e){return e.ROW_HEADER_CONTEXT_MENU=`ROW_HEADER_CONTEXT_MENU`,e.COL_HEADER_CONTEXT_MENU=`COL_HEADER_CONTEXT_MENU`,e.SHEET_BAR=`SHEET_BAR`,e.SHEET_FOOTER=`SHEET_FOOTER`,e}({});function ac(e){let t=e.get(zn);return{id:Un.id,subId:Hn.id,type:i.MenuItemType.BUTTON,icon:`BrushIcon`,title:`sheets-ui.toolbar.formatPainter`,tooltip:`sheets-ui.toolbar.formatPainter`,activated$:new o.Observable(e=>{let n=!1,r=t.status$.subscribe(t=>{n=t!==0,e.next(n)});return e.next(n),()=>{r.unsubscribe()}}),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetCopyPermission,r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]},!0)}}function oc(e){let a=e.get(n.ICommandService),c=e.get(n.IUniverInstanceService),l=e.get(n.IContextService),u=e.get(r.SheetsSelectionsService);return{id:tn.id,type:i.MenuItemType.BUTTON,icon:`BoldIcon`,title:`sheets-ui.toolbar.bold`,tooltip:`sheets-ui.toolbar.bold`,disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]},!0,!0),activated$:Z(c,!1,({worksheet:i})=>new o.Observable(o=>{var c;let d=a.onCommandExecuted(a=>{let c=a.id;if(c===r.SetRangeValuesMutation.id||c===r.SetSelectionsOperation.id||c===r.SetWorksheetActiveOperation.id){var d;let e=(d=u.getCurrentLastSelection())==null?void 0:d.primary,t=n.FontWeight.NORMAL;if(e!=null){let n=i.getRange(e.startRow,e.startColumn);t=n==null?void 0:n.getFontWeight()}o.next(t===n.FontWeight.BOLD)}if((c===s.SetTextSelectionsOperation.id||c===t.SetInlineFormatCommand.id)&&l.getContextValue(n.EDITOR_ACTIVATED)&&(l.getContextValue(n.FOCUSING_SHEET)||l.getContextValue(n.FOCUSING_SHAPE_TEXT_EDITOR))){var f;let t=en(e);if(t==null)return;let r=(f=t.ts)==null?void 0:f.bl;o.next(r===n.BooleanNumber.TRUE)}}),f=(c=u.getCurrentLastSelection())==null?void 0:c.primary;if(!i){o.next(!1);return}let p=n.FontWeight.NORMAL;if(f!=null){let e=i.getRange(f.startRow,f.startColumn);p=e==null?void 0:e.getFontWeight()}return o.next(p===n.FontWeight.BOLD),d.dispose})),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function sc(e){let a=e.get(n.ICommandService),c=e.get(n.IUniverInstanceService),l=e.get(r.SheetsSelectionsService),u=e.get(n.IContextService);return{id:nn.id,type:i.MenuItemType.BUTTON,icon:`ItalicIcon`,title:`sheets-ui.toolbar.italic`,tooltip:`sheets-ui.toolbar.italic`,disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]},!0,!0),activated$:Z(c,!1,({worksheet:i})=>new o.Observable(o=>{var c;let d=a.onCommandExecuted(a=>{let c=a.id;if(c===r.SetRangeValuesMutation.id||c===r.SetSelectionsOperation.id||c===r.SetWorksheetActiveOperation.id){var d;let e=(d=l.getCurrentLastSelection())==null?void 0:d.primary,t=n.FontItalic.NORMAL;if(e!=null){let n=i.getRange(e.startRow,e.startColumn);t=n==null?void 0:n.getFontStyle()}o.next(t===n.FontItalic.ITALIC)}if((c===s.SetTextSelectionsOperation.id||c===t.SetInlineFormatCommand.id)&&u.getContextValue(n.EDITOR_ACTIVATED)&&(u.getContextValue(n.FOCUSING_SHEET)||u.getContextValue(n.FOCUSING_SHAPE_TEXT_EDITOR))){var f;let t=en(e);if(t==null)return;let r=(f=t.ts)==null?void 0:f.it;o.next(r===n.BooleanNumber.TRUE)}}),f=(c=l.getCurrentLastSelection())==null?void 0:c.primary,p=n.FontItalic.NORMAL;if(f!=null){let e=i.getRange(f.startRow,f.startColumn);p=e==null?void 0:e.getFontStyle()}return o.next(p===n.FontItalic.ITALIC),d.dispose})),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function cc(e){let a=e.get(n.ICommandService),c=e.get(n.IUniverInstanceService),l=e.get(r.SheetsSelectionsService),u=e.get(n.IContextService);return{id:rn.id,type:i.MenuItemType.BUTTON,icon:`UnderlineIcon`,title:`sheets-ui.toolbar.underline`,tooltip:`sheets-ui.toolbar.underline`,activated$:Z(c,!1,({worksheet:i})=>new o.Observable(o=>{var c;let d=a.onCommandExecuted(a=>{let c=a.id;if(c===r.SetRangeValuesMutation.id||c===r.SetSelectionsOperation.id||c===r.SetWorksheetActiveOperation.id){var d;let e=(d=l.getCurrentLastSelection())==null?void 0:d.primary,t;if(e!=null){let n=i.getRange(e.startRow,e.startColumn);t=n==null?void 0:n.getUnderline()}o.next(!!(t&&t.s))}if((c===s.SetTextSelectionsOperation.id||c===t.SetInlineFormatCommand.id)&&u.getContextValue(n.EDITOR_ACTIVATED)&&(u.getContextValue(n.FOCUSING_SHEET)||u.getContextValue(n.FOCUSING_SHAPE_TEXT_EDITOR))){var f;let t=en(e);if(t==null)return;let r=(f=t.ts)==null?void 0:f.ul;o.next((r==null?void 0:r.s)===n.BooleanNumber.TRUE)}}),f=(c=l.getCurrentLastSelection())==null?void 0:c.primary,p;if(f!=null){let e=i.getRange(f.startRow,f.startColumn);p=e==null?void 0:e.getUnderline()}return o.next(!!(p&&p.s)),d.dispose})),disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]},!0,!0),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function lc(e){let a=e.get(n.ICommandService),c=e.get(n.IUniverInstanceService),l=e.get(r.SheetsSelectionsService),u=e.get(n.IContextService);return{id:an.id,type:i.MenuItemType.BUTTON,icon:`StrikethroughIcon`,title:`sheets-ui.toolbar.strikethrough`,tooltip:`sheets-ui.toolbar.strikethrough`,disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]},!0,!0),activated$:Z(c,!1,({worksheet:i})=>new o.Observable(o=>{var c;let d=a.onCommandExecuted(a=>{let c=a.id;if(c===r.SetRangeValuesMutation.id||c===r.SetSelectionsOperation.id||c===r.SetWorksheetActiveOperation.id){var d;let e=(d=l.getCurrentLastSelection())==null?void 0:d.primary,t;if(e!=null){let n=i.getRange(e.startRow,e.startColumn);t=n==null?void 0:n.getStrikeThrough()}o.next(!!(t&&t.s))}if((c===s.SetTextSelectionsOperation.id||c===t.SetInlineFormatCommand.id)&&u.getContextValue(n.EDITOR_ACTIVATED)&&(u.getContextValue(n.FOCUSING_SHEET)||u.getContextValue(n.FOCUSING_SHAPE_TEXT_EDITOR))){var f;let t=en(e);if(t==null)return;let r=(f=t.ts)==null?void 0:f.st;o.next((r==null?void 0:r.s)===n.BooleanNumber.TRUE)}}),f=(c=l.getCurrentLastSelection())==null?void 0:c.primary,p;if(f!=null){let e=i.getRange(f.startRow,f.startColumn);p=e==null?void 0:e.getStrikeThrough()}return o.next(!!(p&&p.s)),d.dispose})),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function uc(e){let a=e.get(n.ICommandService),c=e.get(n.IUniverInstanceService),l=e.get(r.SheetsSelectionsService),u=n.DEFAULT_STYLES.ff,d=Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]},!0,!0);return{id:dn.id,tooltip:`sheets-ui.toolbar.font`,type:i.MenuItemType.SELECTOR,label:{name:i.FONT_FAMILY_COMPONENT,props:{id:dn.id,disabled$:d}},selections:[{label:{name:i.FONT_FAMILY_ITEM_COMPONENT,hoverable:!1,selectable:!1,props:{id:dn.id}}}],disabled$:d,value$:Z(c,u,({worksheet:i})=>new o.Observable(o=>{let c=()=>{var e;let t=u,r=(e=l.getCurrentLastSelection())==null?void 0:e.primary;if(r!=null){let e=i.getCellStyle(r.startRow,r.startColumn),a=i.getDefaultCellStyleInternal(),o=i.getRowStyle(r.startRow),s=i.getColumnStyle(r.startColumn),c=(0,n.composeStyles)(a,o,s,e);c.ff&&(t=c.ff)}o.next(t)},d=a.onCommandExecuted(i=>{let a=i.id;if((a===r.SetRangeValuesMutation.id||a===r.SetSelectionsOperation.id||a===r.SetWorksheetActiveOperation.id)&&c(),(a===s.SetTextSelectionsOperation.id||a===t.SetInlineFormatCommand.id)&&e.get(n.IContextService).getContextValue(n.EDITOR_ACTIVATED)&&(e.get(n.IContextService).getContextValue(n.FOCUSING_SHEET)||e.get(n.IContextService).getContextValue(n.FOCUSING_SHAPE_TEXT_EDITOR))){let t=en(e);if(t!=null){var l;let e=((l=t.ts)==null?void 0:l.ff)??u;o.next(e)}}});return c(),d.dispose})),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function dc(e){return{id:pn.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.toolbar.resetColor`,icon:`NoColorDoubleIcon`,disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]},!0,!0),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function fc(e){let a=e.get(n.ICommandService),s=e.get(n.ThemeService),c=e.get(r.SheetsSelectionsService);return{id:fn.id,icon:`FontColorDoubleIcon`,tooltip:`sheets-ui.toolbar.textColor.main`,type:i.MenuItemType.BUTTON_SELECTOR,selections:[{label:{name:t.EditorColorPicker.componentKey,hoverable:!1,selectable:!1},value$:new o.Observable(e=>{let t=s.getColorFromTheme(`gray.900`),{isAllValuesSame:n,value:r}=c.getCellStylesProperty(`cl`);n?e.next((r==null?void 0:r.rgb)??t):e.next(t)})}],value$:new o.Observable(e=>{let t=s.getColorFromTheme(`gray.900`),n=a.onCommandExecuted(n=>{if(n.id===fn.id){let r=n.params.value;e.next(r??t)}});return e.next(t),n.dispose}),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]},!0,!0)}}function pc(e){return{id:r.ResetBackgroundColorCommand.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.toolbar.resetColor`,icon:`NoColorDoubleIcon`,disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})}}function mc(e){let a=e.get(n.ICommandService),s=e.get(n.ThemeService),c=e.get(r.SheetsSelectionsService);return{id:r.SetBackgroundColorCommand.id,tooltip:`sheets-ui.toolbar.fillColor.main`,type:i.MenuItemType.BUTTON_SELECTOR,icon:`PaintBucketDoubleIcon`,selections:[{label:{name:t.EditorColorPicker.componentKey,hoverable:!1,selectable:!1},value$:new o.Observable(e=>{let t=s.getColorFromTheme(`primary.600`),{isAllValuesSame:n,value:r}=c.getCellStylesProperty(`bg`);n?e.next((r==null?void 0:r.rgb)??t):e.next(t)})}],value$:new o.Observable(e=>{let t=s.getColorFromTheme(`primary.600`),n=a.onCommandExecuted(n=>{if(n.id===r.SetBackgroundColorCommand.id){let r=n.params.value;e.next(r??t)}});return e.next(t),n.dispose}),hidden$:(0,o.combineLatest)([(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),e.get(n.IContextService).subscribeContextValue$(n.FOCUSING_COMMON_DRAWINGS).pipe((0,o.startWith)(!1))]).pipe((0,o.map)(([e,t])=>e||t)),disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})}}let hc=[{label:`sheets-ui.align.left`,icon:`LeftJustifyingIcon`,value:n.HorizontalAlign.LEFT},{label:`sheets-ui.align.center`,icon:`HorizontallyIcon`,value:n.HorizontalAlign.CENTER},{label:`sheets-ui.align.right`,icon:`RightJustifyingIcon`,value:n.HorizontalAlign.RIGHT}];function gc(e){var t;let a=e.get(n.IUniverInstanceService),s=e.get(r.SheetsSelectionsService),c=a.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET),l=c==null?void 0:c.getActiveSheet().getDefaultCellStyleInternal(),u=(l==null?void 0:l.ht)??n.HorizontalAlign.LEFT;return{id:r.SetHorizontalTextAlignCommand.id,icon:(t=hc.find(e=>e.value===u))==null?void 0:t.icon,tooltip:`sheets-ui.toolbar.horizontalAlignMode.main`,type:i.MenuItemType.SELECTOR,selections:hc,value$:Z(a,u,({worksheet:t})=>new o.Observable(i=>{var a;let o=e.get(n.ICommandService).onCommandExecuted(e=>{var n;let a=e.id;if(a!==r.SetHorizontalTextAlignCommand.id&&a!==r.SetSelectionsOperation.id&&a!==r.SetWorksheetActiveOperation.id)return;let o=(n=s.getCurrentLastSelection())==null?void 0:n.primary,l;if(o!=null){let e=t.getRange(o.startRow,o.startColumn),n=c==null?void 0:c.getActiveSheet().getComposedCellStyle(o.startRow,o.startColumn);l=(n==null?void 0:n.ht)??(e==null?void 0:e.getHorizontalAlignment())}i.next(l??u)}),l=(a=s.getCurrentLastSelection())==null?void 0:a.primary,d;if(l!=null){let e=t.getRange(l.startRow,l.startColumn),n=c==null?void 0:c.getActiveSheet().getComposedCellStyle(l.startRow,l.startColumn);d=(n==null?void 0:n.ht)??(e==null?void 0:e.getHorizontalAlignment())}return i.next(d??u),o.dispose})),hidden$:(0,o.combineLatest)([(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),e.get(n.IContextService).subscribeContextValue$(n.FOCUSING_COMMON_DRAWINGS).pipe((0,o.startWith)(!1))]).pipe((0,o.map)(([e,t])=>e||t)),disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})}}let _c=[{label:`sheets-ui.align.top`,icon:`AlignTopIcon`,value:n.VerticalAlign.TOP},{label:`sheets-ui.align.middle`,icon:`VerticalCenterIcon`,value:n.VerticalAlign.MIDDLE},{label:`sheets-ui.align.bottom`,icon:`AlignBottomIcon`,value:n.VerticalAlign.BOTTOM}];function vc(e){var t;let a=e.get(n.IUniverInstanceService),s=e.get(r.SheetsSelectionsService),c=a.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET),l=c==null?void 0:c.getActiveSheet().getDefaultCellStyleInternal(),u=(l==null?void 0:l.vt)??n.VerticalAlign.BOTTOM;return{id:r.SetVerticalTextAlignCommand.id,icon:(t=_c.find(e=>e.value===u))==null?void 0:t.icon,tooltip:`sheets-ui.toolbar.verticalAlignMode.main`,type:i.MenuItemType.SELECTOR,selections:_c,value$:Z(a,u,({worksheet:t})=>new o.Observable(i=>{var a;let o=e.get(n.ICommandService).onCommandExecuted(e=>{var n;let a=e.id;if(a!==r.SetVerticalTextAlignCommand.id&&a!==r.SetSelectionsOperation.id&&a!==r.SetWorksheetActiveOperation.id)return;let o=(n=s.getCurrentLastSelection())==null?void 0:n.primary,l;if(o!=null){let e=t.getRange(o.startRow,o.startColumn),n=c==null?void 0:c.getActiveSheet().getComposedCellStyle(o.startRow,o.startColumn);l=(n==null?void 0:n.vt)??(e==null?void 0:e.getVerticalAlignment())}i.next(l??u)}),l=(a=s.getCurrentLastSelection())==null?void 0:a.primary,d;if(l!=null){let e=t.getRange(l.startRow,l.startColumn),n=c==null?void 0:c.getActiveSheet().getComposedCellStyle(l.startRow,l.startColumn);d=(n==null?void 0:n.vt)??(e==null?void 0:e.getVerticalAlignment())}return i.next(d??u),o.dispose})),hidden$:(0,o.combineLatest)([(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),e.get(n.IContextService).subscribeContextValue$(n.FOCUSING_COMMON_DRAWINGS).pipe((0,o.startWith)(!1))]).pipe((0,o.map)(([e,t])=>e||t)),disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})}}let yc=[{label:`sheets-ui.textWrap.overflow`,icon:`OverflowIcon`,value:n.WrapStrategy.OVERFLOW},{label:`sheets-ui.textWrap.wrap`,icon:`AutowrapIcon`,value:n.WrapStrategy.WRAP},{label:`sheets-ui.textWrap.clip`,icon:`TruncationIcon`,value:n.WrapStrategy.CLIP}];function bc(e){var t;let a=e.get(r.SheetsSelectionsService),s=e.get(n.IUniverInstanceService),c=s.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET),l=c==null?void 0:c.getActiveSheet().getDefaultCellStyleInternal(),u=(l==null?void 0:l.tb)??n.WrapStrategy.OVERFLOW;return{id:r.SetTextWrapCommand.id,tooltip:`sheets-ui.toolbar.textWrapMode.main`,icon:(t=yc.find(e=>e.value===u))==null?void 0:t.icon,type:i.MenuItemType.SELECTOR,selections:yc,value$:Z(s,u,({worksheet:t})=>new o.Observable(i=>{var o;let s=e.get(n.ICommandService).onCommandExecuted(e=>{var n;let o=e.id;if(o!==r.SetRangeValuesMutation.id&&o!==r.SetSelectionsOperation.id&&o!==r.SetWorksheetActiveOperation.id)return;let s=(n=a.getCurrentLastSelection())==null?void 0:n.primary,l;if(s!=null){let e=t.getRange(s.startRow,s.startColumn),n=c==null?void 0:c.getActiveSheet().getComposedCellStyle(s.startRow,s.startColumn);l=(n==null?void 0:n.tb)??(e==null?void 0:e.getWrapStrategy())}i.next(l??u)}),l=(o=a.getCurrentLastSelection())==null?void 0:o.primary,d;if(l!=null){let e=t.getRange(l.startRow,l.startColumn),n=c==null?void 0:c.getActiveSheet().getComposedCellStyle(l.startRow,l.startColumn);d=(n==null?void 0:n.tb)??(e==null?void 0:e.getWrapStrategy())}return i.next(d??u),s.dispose})),hidden$:(0,o.combineLatest)([(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),e.get(n.IContextService).subscribeContextValue$(n.FOCUSING_COMMON_DRAWINGS).pipe((0,o.startWith)(!1))]).pipe((0,o.map)(([e,t])=>e||t)),disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})}}function xc(e){let t=e.get(n.ICommandService),a=e.get(n.IUniverInstanceService),s=e.get(r.SheetsSelectionsService),c=Z(a,{},({worksheet:e})=>new o.Observable(n=>{let i=()=>{var t;let r=(t=s.getCurrentLastSelection())==null?void 0:t.primary;n.next(r==null?{}:e.getComposedCellStyle(r.startRow,r.startColumn)??{})},a=t.onCommandExecuted(e=>{[r.SetRangeValuesMutation.id,r.SetSelectionsOperation.id,r.SetWorksheetActiveOperation.id].includes(e.id)&&i()});return i(),a.dispose}));return{id:r.SetShrinkToFitCommand.id,type:i.MenuItemType.BUTTON,icon:`ShrinkToFitIcon`,title:`sheets-ui.toolbar.shrinkToFit`,tooltip:`sheets-ui.toolbar.shrinkToFit`,activated$:c.pipe((0,o.map)(e=>e.stf===n.BooleanNumber.TRUE&&e.tb!==n.WrapStrategy.WRAP)),disabled$:(0,o.combineLatest)([Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]}),c]).pipe((0,o.map)(([e,t])=>e||t.tb===n.WrapStrategy.WRAP)),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}let Sc=[{label:`sheets-ui.textRotate.none`,icon:`NoRotationIcon`,value:0},{label:`sheets-ui.textRotate.angleUp`,icon:`LeftRotationFortyFiveDegreesIcon`,value:-45},{label:`sheets-ui.textRotate.angleDown`,icon:`RightRotationFortyFiveDegreesIcon`,value:45},{label:`sheets-ui.textRotate.vertical`,icon:`VerticalTextIcon`,value:`v`},{label:`sheets-ui.textRotate.rotationUp`,icon:`LeftRotationNinetyDegreesIcon`,value:-90},{label:`sheets-ui.textRotate.rotationDown`,icon:`RightRotationNinetyDegreesIcon`,value:90}];function Cc(e){let t=e.get(r.SheetsSelectionsService),a=e.get(n.IUniverInstanceService);return{id:r.SetTextRotationCommand.id,tooltip:`sheets-ui.toolbar.textRotateMode.main`,icon:Sc[0].icon,type:i.MenuItemType.SELECTOR,selections:Sc,value$:Z(a,0,({worksheet:i})=>new o.Observable(a=>{var o;let s=e.get(n.ICommandService).onCommandExecuted(e=>{var o;let s=e.id;if(s!==r.SetTextRotationCommand.id&&s!==r.SetSelectionsOperation.id&&s!==r.SetWorksheetActiveOperation.id)return;let c=(o=t.getCurrentLastSelection())==null?void 0:o.primary,l;if(c!=null){let e=i.getRange(c.startRow,c.startColumn);l=e==null?void 0:e.getTextRotation()}(l==null?void 0:l.v)===n.BooleanNumber.TRUE?a.next(`v`):a.next((l&&l.a)??0)}),c=(o=t.getCurrentLastSelection())==null?void 0:o.primary,l;if(c!=null){let e=i.getRange(c.startRow,c.startColumn);l=e==null?void 0:e.getTextRotation()}return(l==null?void 0:l.v)===n.BooleanNumber.TRUE?a.next(`v`):a.next((l&&l.a)??0),s.dispose})),hidden$:(0,o.combineLatest)([(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),e.get(n.IContextService).subscribeContextValue$(n.FOCUSING_COMMON_DRAWINGS).pipe((0,o.startWith)(!1))]).pipe((0,o.map)(([e,t])=>e||t)),disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})}}function wc(e){return new o.Observable(t=>{let n=e.get(i.IClipboardInterfaceService).supportClipboard,r=e.get(gt).copyContentCache().lastCopyId$.subscribe(e=>{t.next(!n&&!e)});return t.next(!n),()=>r.unsubscribe()})}function Tc(e){return{id:wt.name,commandId:wt.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.copy`,icon:`CopyDoubleIcon`,disabled$:Q(e,{workbookTypes:[r.WorkbookCopyPermission],worksheetTypes:[r.WorksheetCopyPermission],rangeTypes:[r.RangeProtectionPermissionViewPoint]}),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Ec(e){return{id:Tt.name,commandId:i.CutCommand.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.cut`,icon:`CutIcon`,disabled$:Q(e,{workbookTypes:[r.WorkbookCopyPermission,r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetCopyPermission,r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionViewPoint,r.RangeProtectionPermissionEditPoint]}),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Dc(e){return{id:Et.name,commandId:Et.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.paste`,icon:`PasteSpecialDoubleIcon`,disabled$:wc(e).pipe((0,o.combineLatestWith)(Q(e,{rangeTypes:[r.RangeProtectionPermissionEditPoint],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission,r.WorksheetSetCellValuePermission],workbookTypes:[r.WorkbookEditablePermission]})),(0,o.map)(([e,t])=>e||t)),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}let Oc=`sheet.menu.copy-special`;function kc(e){return{id:Oc,type:i.MenuItemType.SUBITEMS,icon:`CopyDoubleIcon`,title:`sheets-ui.rightClick.copySpecial`,hidden$:ts(e,(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET))}}let Ac=`sheet.menu.paste-special`;function jc(e){return{id:Ac,type:i.MenuItemType.SUBITEMS,icon:`PasteSpecialDoubleIcon`,title:`sheets-ui.rightClick.pasteSpecial`,hidden$:ts(e,(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET))}}let Mc=`sheet.menu.paste`;function Nc(e){return{...jc(e),id:Mc,icon:`DocPasteOptionsIcon`,title:`sheets-ui.rightClick.paste`,hidden$:(0,o.combineLatest)([ts(e,(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)),e.get(n.IContextService).subscribeContextValue$(n.FOCUSING_SHAPE_TEXT_EDITOR).pipe((0,o.startWith)(!1))]).pipe((0,o.map)(([e,t])=>e||t))}}function Pc(e){return{id:At.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.pasteValue`,disabled$:wc(e).pipe((0,o.combineLatestWith)(Q(e,{rangeTypes:[r.RangeProtectionPermissionEditPoint],worksheetTypes:[r.WorksheetSetCellValuePermission,r.WorksheetEditPermission],workbookTypes:[r.WorkbookEditablePermission]})),(0,o.map)(([e,t])=>e||t)),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Fc(e){return{id:jt.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.pasteFormat`,disabled$:wc(e).pipe((0,o.combineLatestWith)(Q(e,{rangeTypes:[r.RangeProtectionPermissionEditPoint],worksheetTypes:[r.WorksheetSetCellStylePermission,r.WorksheetEditPermission],workbookTypes:[r.WorkbookEditablePermission]})),(0,o.map)(([e,t])=>e||t)),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Ic(e){return{id:Mt.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.pasteColWidth`,disabled$:wc(e).pipe((0,o.combineLatestWith)(Q(e,{rangeTypes:[r.RangeProtectionPermissionEditPoint],worksheetTypes:[r.WorksheetSetColumnStylePermission,r.WorksheetEditPermission],workbookTypes:[r.WorkbookEditablePermission]})),(0,o.map)(([e,t])=>e||t))}}function Lc(e){return{id:Nt.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.pasteBesidesBorder`,disabled$:wc(e).pipe((0,o.combineLatestWith)(Q(e,{rangeTypes:[r.RangeProtectionPermissionEditPoint],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellStylePermission,r.WorksheetSetCellValuePermission,r.WorksheetSetRowStylePermission,r.WorksheetSetColumnStylePermission],workbookTypes:[r.WorkbookEditablePermission]})),(0,o.map)(([e,t])=>e||t)),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Rc(e){return{id:r.SetWorksheetRowIsAutoHeightCommand.id,type:i.MenuItemType.BUTTON,icon:`AutoHeightDoubleIcon`,title:`sheets-ui.rightClick.fitContent`,disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetSetRowStylePermission,r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]}),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function zc(e){return{id:vr.id,type:i.MenuItemType.BUTTON,icon:`AutoWidthDoubleIcon`,title:`sheets-ui.rightClick.fitContent`,disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetSetRowStylePermission,r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]}),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Bc(e){return{id:Qt.id,type:i.MenuItemType.BUTTON,icon:`HideDoubleIcon`,title:`sheets-ui.rightClick.hideSelectedRow`,disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetSetRowStylePermission,r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]}),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Vc(e){return{id:$t.id,type:i.MenuItemType.BUTTON,icon:`HideDoubleIcon`,title:`sheets-ui.rightClick.hideSelectedColumn`,disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetColumnStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]}),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Hc(e){let t=e.get(n.IUniverInstanceService),a=e.get(r.SheetsSelectionsService),s=e.get(n.ICommandService),c=[r.SetSelectionsOperation,r.SetRowHiddenMutation,r.SetRowVisibleMutation].map(e=>e.id);return{id:r.SetSelectedRowsVisibleCommand.id,type:i.MenuItemType.BUTTON,icon:`EyeIcon`,title:`sheets-ui.rightClick.showHideRow`,hidden$:Z(t,!0,({worksheet:e})=>new o.Observable(t=>{function r(){var t;let r=(t=a.getCurrentSelections())==null?void 0:t.map(e=>e.range).filter(e=>e.rangeType===n.RANGE_TYPE.ROW);return!!(r!=null&&r.some(t=>{for(let n=t.startRow;n<=t.endRow;n++)if(!e.getRowRawVisible(n))return!0;return!1}))}let i=s.onCommandExecuted(e=>{c.findIndex(t=>t===e.id)!==-1&&t.next(!r())});return t.next(!r()),()=>i.dispose()})),disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetRowStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})}}function Uc(e){let t=e.get(n.IUniverInstanceService),a=e.get(r.SheetsSelectionsService),s=e.get(n.ICommandService),c=[r.SetSelectionsOperation,r.SetColHiddenMutation,r.SetColVisibleMutation].map(e=>e.id);return{id:r.SetSelectedColsVisibleCommand.id,type:i.MenuItemType.BUTTON,icon:`EyeIcon`,title:`sheets-ui.rightClick.showHideColumn`,hidden$:Z(t,!0,({worksheet:e})=>new o.Observable(t=>{function r(){var t;let r=(t=a.getCurrentSelections())==null?void 0:t.map(e=>e.range).filter(e=>e.rangeType===n.RANGE_TYPE.COLUMN);return!r||r.length===0?!1:!!r.some(t=>{for(let n=t.startColumn;n<=t.endColumn;n++)if(!e.getColVisible(n))return!0;return!1})}let i=s.onCommandExecuted(e=>{c.findIndex(t=>t===e.id)!==-1&&t.next(!r())});return t.next(!r()),()=>i.dispose()})),disabled$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetSetColumnStylePermission,r.WorksheetEditPermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})}}function Wc(e){let t=e.get(n.ICommandService),a=e.get(n.IUniverInstanceService),s=e.get(r.SheetsSelectionsService);return{id:r.SetRowHeightCommand.id,type:i.MenuItemType.BUTTON,icon:`AdjustHeightDoubleIcon`,label:{name:Ks,props:{prefix:`sheets-ui.rightClick.rowHeight`,suffix:`px`,min:0,max:1e3}},value$:Z(a,0,({worksheet:e})=>new o.Observable(n=>{function i(){var t;let r=(t=s.getCurrentLastSelection())==null?void 0:t.primary,i=r?e.getRowHeight(r.startRow):e.getConfig().defaultRowHeight;n.next(i)}let a=t.onCommandExecuted(e=>{let t=e.id;if(t===r.SetRangeValuesMutation.id||t===r.SetSelectionsOperation.id||t===r.SetWorksheetRowIsAutoHeightMutation.id)return i()});return i(),a.dispose})),hidden$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetRowStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})}}function Gc(e){let t=e.get(n.ICommandService),a=e.get(n.IUniverInstanceService),s=e.get(r.SheetsSelectionsService);return{id:r.SetColWidthCommand.id,type:i.MenuItemType.BUTTON,icon:`AdjustWidthDoubleIcon`,label:{name:Ks,props:{prefix:`sheets-ui.rightClick.columnWidth`,suffix:`px`,min:0,max:1e3}},value$:Z(a,0,({worksheet:e})=>new o.Observable(n=>{function i(){var t;let r=(t=s.getCurrentLastSelection())==null?void 0:t.primary,i=r?e.getColumnWidth(r.startColumn):e.getConfig().defaultColumnWidth;n.next(i)}let a=t.onCommandExecuted(e=>{let t=e.id;if(t===r.SetRangeValuesMutation.id||t===r.SetSelectionsOperation.id||t===r.SetWorksheetColWidthMutation.id)return i()});return i(),a.dispose})),hidden$:Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetColumnStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})}}function Kc(e){let t=e.get(n.ICommandService),a=e.get(n.IUniverInstanceService),s=e.get(r.SheetsSelectionsService),c=ts(e,Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellValuePermission,r.WorksheetSetCellStylePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})),l=ao(e);return{id:r.AddWorksheetMergeCommand.id,icon:`MergeAllIcon`,tooltip:`sheets-ui.toolbar.mergeCell.main`,type:i.MenuItemType.SUBITEMS,activated$:Z(a,!1,({worksheet:e})=>new o.Observable(n=>{let i=()=>{var t;let r=(t=s.getCurrentLastSelection())==null?void 0:t.primary;n.next(!!r&&!!e.getMergedCell(r.actualRow,r.actualColumn))},a=s.selectionChanged$.subscribe(i),o=t.onCommandExecuted(e=>{(e.id===r.AddWorksheetMergeMutation.id||e.id===r.RemoveWorksheetMergeMutation.id)&&i()});return i(),()=>{a.unsubscribe(),o.dispose()}})).pipe((0,o.distinctUntilChanged)()),hidden$:(0,o.combineLatest)([(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),e.get(n.IContextService).subscribeContextValue$(n.FOCUSING_COMMON_DRAWINGS).pipe((0,o.startWith)(!1))]).pipe((0,o.map)(([e,t])=>e||t)),disabled$:c.pipe((0,o.combineLatestWith)(l),(0,o.map)(([e,t])=>e||t))}}function qc(e){return{id:r.AddWorksheetMergeAllCommand.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.merge.all`,icon:`MergeAllIcon`,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Jc(e){return{id:r.AddWorksheetMergeVerticalCommand.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.merge.vertical`,icon:`VerticalIntegrationIcon`,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Yc(e){return{id:r.AddWorksheetMergeHorizontalCommand.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.merge.horizontal`,icon:`HorizontalMergeIcon`,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Xc(e){return{id:r.RemoveWorksheetMergeCommand.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.merge.cancel`,icon:`CancelMergeIcon`,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Zc(e){let t=e.get(n.IUniverInstanceService).getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET),i=e.get(n.UserManagerService);return(0,o.combineLatest)([t,i.currentUser$]).pipe((0,o.switchMap)(([t,i])=>t?t.activeSheet$.pipe((0,o.switchMap)(i=>{if(!i)return(0,o.of)(!0);let a=e.get(r.RangeProtectionRuleModel),s=e.get(r.WorksheetProtectionRuleModel),c=e.get(r.SheetsSelectionsService);return(0,o.merge)(c.selectionMoveEnd$,a.ruleChange$,s.ruleChange$).pipe((0,o.map)(()=>{let e=t.getUnitId(),r=i.getSheetId(),o=a.getSubunitRuleList(e,r),l=c.getCurrentSelections(),u=l==null?void 0:l.map(e=>e.range),d=o.map(e=>e.ranges).flat();if(!u)return!1;let f=s.getRule(e,r);return f!=null&&f.permissionId?!0:u==null?void 0:u.some(e=>d.some(t=>n.Rectangle.intersects(e,t)))}))})):(0,o.of)(!0)))}function Qc(e){let t=e.get(n.IUniverInstanceService),i=e.get(r.RangeProtectionRuleModel),a=t.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET),s=e.get(n.UserManagerService);return(0,o.combineLatest)([a,s.currentUser$]).pipe((0,o.switchMap)(([t,a])=>t?t.activeSheet$.pipe((0,o.switchMap)(a=>{if(!a)return(0,o.of)(!0);let s=e.get(r.RangeProtectionRuleModel),l=e.get(r.WorksheetProtectionRuleModel),u=e.get(n.IPermissionService),d=e.get(r.SheetsSelectionsService);return(0,o.merge)(d.selectionMoveEnd$,s.ruleChange$,l.ruleChange$).pipe((0,o.map)(()=>{var o;let s=t.getUnitId(),f=a.getSheetId(),p=i.getSubunitRuleList(s,f),m=(o=d.getCurrentSelections())==null?void 0:o.map(e=>e.range);if(p.map(e=>e.ranges).flat(),!(m!=null&&m.length)||m.length>1)return!0;let h=m[0];if((h==null?void 0:h.rangeType)===n.RANGE_TYPE.ALL||(h==null?void 0:h.rangeType)===n.RANGE_TYPE.COLUMN||(h==null?void 0:h.rangeType)===n.RANGE_TYPE.ROW)return!0;let g=l.getRule(s,f);if(g!=null&&g.permissionId){var _;return((_=u.getPermissionPoint(new r.WorksheetManageCollaboratorPermission(s,f).id))==null?void 0:_.value)===!1}if(p.filter(e=>e.ranges.some(e=>n.Rectangle.intersects(e,h))).length!==1)return!0;let{startRow:v,endRow:y,startColumn:b,endColumn:x}=h,S=e.get(r.RangeProtectionCache);for(let e=v;e<=y;e++)for(let t=b;t<=x;t++){let n=S.getCellInfo(s,f,e,t);if(n)return n[c.UnitAction.ManageCollaborator]===!1}return!1}))})):(0,o.of)(!0)))}function $c(e){let t=e.get(n.IUniverInstanceService),i=e.get(n.IPermissionService),a=t.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET),s=e.get(n.UserManagerService);return(0,o.combineLatest)([a,s.currentUser$]).pipe((0,o.switchMap)(([t,n])=>t?t.activeSheet$.pipe((0,o.switchMap)(n=>{if(!n)return(0,o.of)(!0);let a=t.getUnitId(),s=e.get(r.SheetsSelectionsService),c=e.get(r.RangeProtectionRuleModel),l=e.get(r.WorksheetProtectionRuleModel),u=i.composePermission$([new r.WorkbookEditablePermission(a).id]).pipe((0,o.map)(e=>e.every(e=>e.value)))??(0,o.of)(!1),d=(0,o.merge)(c.ruleChange$,l.ruleChange$).pipe((0,o.startWith)(null));return(0,o.combineLatest)([u,d,s.selectionMoveEnd$]).pipe((0,o.map)(([e,t,n])=>{if(!e)return!0;let r=s.getCurrentSelections(),i=r==null?void 0:r.map(e=>e.range);return i!=null&&i.length?i.length>1:!1}))})):(0,o.of)(!0)))}function el(e){let t=e.get(n.IUniverInstanceService),i=e.get(n.IPermissionService),a=t.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET),s=e.get(n.UserManagerService),c=e.has(Y)?e.get(Y):null,l=e.get(n.IContextService).subscribeContextValue$(n.FOCUSING_FX_BAR_EDITOR).pipe((0,o.startWith)(!1),(0,o.shareReplay)({bufferSize:1,refCount:!0})),u=(c==null?void 0:c.visible$.pipe((0,o.startWith)(null),(0,o.shareReplay)({bufferSize:1,refCount:!0})))??(0,o.of)(null);return(0,o.combineLatest)([a,s.currentUser$,u,l]).pipe((0,o.switchMap)(([t,a,s,c])=>!t||s!=null&&s.visible&&s.unitId===t.getUnitId()||c?(0,o.of)(!0):t.activeSheet$.pipe((0,o.switchMap)(a=>{if(!a)return(0,o.of)(!0);let s=e.get(n.IContextService).subscribeContextValue$(n.FOCUSING_COMMON_DRAWINGS).pipe((0,o.startWith)(!1)),c=t.getUnitId(),l=a.getSheetId(),u=e.get(r.RangeProtectionRuleModel),d=e.get(r.WorksheetProtectionRuleModel),f=e.get(r.SheetsSelectionsService),p=i.composePermission$([new r.WorkbookCreateProtectPermission(c).id]).pipe((0,o.map)(e=>e.every(e=>e.value)))??(0,o.of)(!1),m=(0,o.merge)(u.ruleChange$,d.ruleChange$).pipe((0,o.startWith)(null));return(0,o.combineLatest)([p,m,f.selectionMoveEnd$,s]).pipe((0,o.map)(([e,t,r,i])=>{if(!e||i)return!0;let a=f.getCurrentSelections(),o=a==null?void 0:a.map(e=>e.range);if(!(o!=null&&o.length))return!0;let s=d.getRule(c,l);if(s!=null&&s.permissionId)return!0;let p=u.getSubunitRuleList(c,l);return o==null?void 0:o.some(e=>p.some(t=>t.ranges.some(t=>n.Rectangle.intersects(e,t))))}))}))))}function tl(e){let t=e.get(n.IUniverInstanceService),i=e.get(n.IPermissionService),a=t.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET),s=e.get(n.UserManagerService);return(0,o.combineLatest)([a,s.currentUser$]).pipe((0,o.switchMap)(([t,n])=>t?t.activeSheet$.pipe((0,o.switchMap)(n=>{if(!n)return(0,o.of)(!0);let a=t.getUnitId(),s=n.getSheetId(),c=e.get(r.RangeProtectionRuleModel),l=e.get(r.WorksheetProtectionRuleModel),u=i.composePermission$([new r.WorkbookCreateProtectPermission(a).id]).pipe((0,o.map)(e=>e.every(e=>e.value)))??(0,o.of)(!1),d=(0,o.merge)(c.ruleChange$,l.ruleChange$).pipe((0,o.startWith)(null));return(0,o.combineLatest)([u,d]).pipe((0,o.map)(([e,t])=>{var n;if(!e)return!0;let r=l.getRule(a,s);return r!=null&&r.permissionId?!0:((n=c.getSubunitRuleList(a,s))==null?void 0:n.filter(e=>e==null?void 0:e.permissionId)).length>0}))})):(0,o.of)(!0)))}function nl(e){let t=e.get(n.IUniverInstanceService),i=e.get(n.IPermissionService),a=t.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET),s=e.get(n.UserManagerService);return(0,o.combineLatest)([a,s.currentUser$]).pipe((0,o.switchMap)(([t,n])=>t?t.activeSheet$.pipe((0,o.switchMap)(n=>{var a;if(!n)return(0,o.of)(!0);let s=t.getUnitId(),c=n.getSheetId(),l=e.get(r.WorksheetProtectionRuleModel),u=((a=i.getPermissionPoint$(new r.WorksheetDeleteProtectionPermission(s,c).id))==null?void 0:a.pipe((0,o.map)(e=>!!e.value)))??(0,o.of)(!1),d=l.ruleChange$.pipe((0,o.startWith)(null));return(0,o.combineLatest)([u,d]).pipe((0,o.map)(([e,t])=>{let n=l.getRule(s,c);return n!=null&&n.permissionId?!e:!0}))})):(0,o.of)(!0)))}function rl(e){let t=e.get(n.IUniverInstanceService),i=e.get(n.IPermissionService),a=t.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET),s=e.get(n.UserManagerService);return(0,o.combineLatest)([a,s.currentUser$]).pipe((0,o.switchMap)(([t,n])=>t?t.activeSheet$.pipe((0,o.switchMap)(n=>{if(!n)return(0,o.of)(!0);let a=t.getUnitId(),s=n.getSheetId(),c=e.get(r.RangeProtectionRuleModel),l=e.get(r.WorksheetProtectionRuleModel),u=i.composePermission$([new r.WorkbookCreateProtectPermission(a).id,new r.WorkbookManageCollaboratorPermission(a).id]).pipe((0,o.map)(e=>e.every(e=>e.value)))??(0,o.of)(!1),d=(0,o.merge)(c.ruleChange$,l.ruleChange$).pipe((0,o.startWith)(null));return(0,o.combineLatest)([u,d]).pipe((0,o.map)(([e,t])=>{var n;if(!e)return!0;let r=l.getRule(a,s);return r!=null&&r.permissionId?!1:((n=c.getSubunitRuleList(a,s))==null?void 0:n.filter(e=>e==null?void 0:e.permissionId)).length===0}))})):(0,o.of)(!0)))}function il(e){let t=e.get(n.IUniverInstanceService),i=e.get(n.IPermissionService),a=t.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET),s=e.get(n.UserManagerService);return(0,o.combineLatest)([a,s.currentUser$]).pipe((0,o.switchMap)(([t,a])=>t?t.activeSheet$.pipe((0,o.switchMap)(a=>{if(!a)return(0,o.of)(!0);let s=t.getUnitId(),l=a.getSheetId(),u=e.get(r.SheetsSelectionsService),d=e.get(r.RangeProtectionRuleModel),f=e.get(r.WorksheetProtectionRuleModel),p=(0,o.merge)(d.ruleChange$,f.ruleChange$,u.selectionMoveEnd$).pipe((0,o.startWith)(null));return(0,o.combineLatest)([p]).pipe((0,o.map)(([t])=>{let a=e.get(r.SheetsSelectionsService).getCurrentSelections(),o=a==null?void 0:a.map(e=>e.range);if(!(o!=null&&o.length)||o.length>1)return!0;let u=o[0];if((u==null?void 0:u.rangeType)===n.RANGE_TYPE.ALL||(u==null?void 0:u.rangeType)===n.RANGE_TYPE.COLUMN||(u==null?void 0:u.rangeType)===n.RANGE_TYPE.ROW)return!0;let p=f.getRule(s,l);if(p!=null&&p.permissionId){var m;return((m=i.getPermissionPoint(new r.WorksheetDeleteProtectionPermission(s,l).id))==null?void 0:m.value)===!1}if(d.getSubunitRuleList(s,l).filter(e=>e.ranges.some(e=>n.Rectangle.intersects(e,u))).length!==1)return!0;let{startRow:h,endRow:g,startColumn:_,endColumn:v}=u,y=e.get(r.RangeProtectionCache);for(let e=h;e<=g;e++)for(let t=_;t<=v;t++){let n=y.getCellInfo(s,l,e,t);if(n)return n[c.UnitAction.Delete]===!1}return!1}))})):(0,o.of)(!0)))}function al(e){let t=e.get(n.IUniverInstanceService),i=e.get(n.IPermissionService),a=t.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET),s=e.get(n.UserManagerService),c=e.has(Y)?e.get(Y):null,l=e.get(n.IContextService).subscribeContextValue$(n.FOCUSING_FX_BAR_EDITOR),u=(c==null?void 0:c.visible$)??(0,o.of)(null);return(0,o.combineLatest)([a,s.currentUser$,u,l]).pipe((0,o.switchMap)(([e,t,n,a])=>!e||n!=null&&n.visible&&n.unitId===e.getUnitId()||a?(0,o.of)(!0):e.activeSheet$.pipe((0,o.switchMap)(t=>{var n;if(!t)return(0,o.of)(!0);let a=e.getUnitId();return(((n=i.getPermissionPoint$(new r.WorkbookEditablePermission(a).id))==null?void 0:n.pipe((0,o.map)(e=>!!e.value)))??(0,o.of)(!1)).pipe((0,o.map)(e=>!e))}))))}let ol=`sheet.contextMenu.permission`;function sl(e){return{id:On.id,type:i.MenuItemType.BUTTON,icon:`ProtectIcon`,tooltip:`sheets-ui.permission.toolbarMenu`,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),disabled$:el(e)}}function cl(e){return{id:ol,type:i.MenuItemType.SUBITEMS,title:`sheets-ui.rightClick.protectRange`,icon:`LockIcon`,hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function ll(e){return{id:kn.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.turnOnProtectRange`,hidden$:Zc(e),disabled$:el(e)}}function ul(e){return{id:Pn.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.editProtectRange`,disabled$:$c(e),hidden$:Qc(e)}}function dl(e){return{id:Nn.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.removeProtectRange`,disabled$:il(e),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function fl(e){return{id:An.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.viewAllProtectArea`,disabled$:al(e),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function pl(e){return{id:jn.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.sheetConfig.addProtectSheet`,disabled$:tl(e),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function ml(e){return{id:Ir.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.sheetConfig.removeProtectSheet`,disabled$:nl(e),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function hl(e){return{id:Lr.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.sheetConfig.changeSheetPermission`,disabled$:rl(e),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function gl(e){return{id:Mn.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.sheetConfig.viewAllProtectArea`,disabled$:al(e),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function _l(e){let t=e.get(n.IUniverInstanceService),a=e.get(n.ICommandService),s=new o.Observable(e=>{let n=a.onCommandExecuted(n=>{let i=n.id;(i===r.RemoveSheetMutation.id||i===r.InsertSheetMutation.id||i===r.SetWorksheetHideMutation.id)&&Cl(t,e)});return Cl(t,e),n.dispose}),c=os(e,[r.WorkbookEditablePermission,r.WorkbookDeleteSheetPermission]);return{id:Ln.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.sheetConfig.delete`,disabled$:(0,o.combineLatest)([s,c]).pipe((0,o.map)(([e,t])=>e||t)),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function vl(e){return{id:r.CopySheetCommand.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.sheetConfig.copy`,disabled$:os(e,[r.WorkbookEditablePermission,r.WorkbookCreateSheetPermission]),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function yl(e){return{id:Vr.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.sheetConfig.rename`,disabled$:os(e,[r.WorkbookEditablePermission,r.WorkbookRenameSheetPermission]),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function bl(e){let a=e.get(n.IUniverInstanceService),s=e.get(n.ICommandService);return{id:r.SetTabColorCommand.id,title:`sheets-ui.sheetConfig.changeColor`,type:i.MenuItemType.SELECTOR,selections:[{label:`sheets-ui.toolbar.resetColor`,icon:`NoColorDoubleIcon`,value:``},{label:{name:t.EditorColorPicker.componentKey,hoverable:!1,selectable:!1},value$:new o.Observable(e=>{let t=()=>{var t;let r=a.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET);e.next((r==null||(t=r.getActiveSheet())==null?void 0:t.getTabColor())??``)};t();let i=s.onCommandExecuted(({id:e})=>{(e===r.SetTabColorMutation.id||e===r.SetWorksheetActiveOperation.id)&&t()});return()=>i.dispose()})}],hidden$:os(e,[r.WorkbookEditablePermission])}}function xl(e){let t=e.get(n.IUniverInstanceService),a=e.get(n.ICommandService);return{id:r.SetWorksheetHideCommand.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.sheetConfig.hide`,disabled$:new o.Observable(e=>{let n=a.onCommandExecuted(n=>{let i=n.id;(i===r.RemoveSheetMutation.id||i===r.InsertSheetMutation.id||i===r.SetWorksheetHideMutation.id)&&Cl(t,e)});return Cl(t,e),n.dispose}).pipe((0,o.combineLatestWith)(os(e,[r.WorkbookEditablePermission,r.WorkbookHideSheetPermission])),(0,o.map)(([e,t])=>e||t)),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Sl(e){let t=e.get(n.IUniverInstanceService),a=e.get(n.ICommandService);return{id:Fr.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.sheetConfig.unhide`,disabled$:new o.Observable(e=>{function i(){let r=t.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET).getWorksheets(),i=Array.from(r.values());e.next(i.length===1)}let o=a.onCommandExecuted(e=>{let t=e.id;(t===r.RemoveSheetMutation.id||t===r.InsertSheetMutation.id||t===r.SetWorksheetHideMutation.id)&&i()});return i(),o.dispose}).pipe((0,o.combineLatestWith)(os(e,[r.WorkbookEditablePermission,r.WorkbookHideSheetPermission])),(0,o.map)(([e,t])=>e||t)),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}function Cl(e,t){let r=e.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET).getWorksheets(),i=Array.from(r.values()).filter(e=>e.getConfig().hidden===n.BooleanNumber.FALSE);t.next(i.length===1)}let wl=e=>{var t;let i=e.get(r.SheetsSelectionsService),a=(t=e.get(n.IUniverInstanceService).getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET))==null?void 0:t.getActiveSheet();return new o.Observable(e=>{let t=t=>{if(!a||!t||t.length===0)return e.next(!0);for(let o=0;o<t.length;o++){let{range:s}=t[o];for(let t=s.startRow;t<=s.endRow;t++)for(let o=s.startColumn;o<=s.endColumn;o++){var r,i;let s=a.getCellRaw(t,o),c=typeof(s==null?void 0:s.s)==`string`?(r=a.getStyleDataByHash(s.s))==null||(r=r.n)==null?void 0:r.pattern:s==null||(i=s.s)==null||(i=i.n)==null?void 0:i.pattern;if(s&&s.v&&(s.t!==n.CellValueType.NUMBER||(0,n.isTextFormat)(c))&&(0,n.isRealNum)(s.v))return e.next(!1)}}e.next(!0)},r=i.selectionChanged$.subscribe(n=>{if(!n||n.length===0)return e.next(!0);t(n)});return t(i.getCurrentSelections()),()=>r.unsubscribe()})},Tl=`sheet.contextMenu.text-to-number`;function El(e){return{id:Tl,commandId:r.TextToNumberCommand.id,type:i.MenuItemType.BUTTON,title:`sheets-ui.rightClick.textToNumber`,icon:`ConvertToNumberIcon`,disabled$:ts(e,Q(e,{workbookTypes:[r.WorkbookEditablePermission],worksheetTypes:[r.WorksheetEditPermission,r.WorksheetSetCellValuePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint]})),hidden$:(0,o.combineLatest)([(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET),wl(e)]).pipe((0,o.map)(([e,t])=>e||t))}}let Dl=`sheet.menu.zoom-ratio`,Ol=[50,75,100,125,150,175,200,400];function kl(e){let t=e.get(n.ICommandService);return Z(e.get(n.IUniverInstanceService),100,({worksheet:e})=>new o.Observable(n=>{let r=()=>n.next(Math.round(e.getZoomRatio()*100)),i=t.onCommandExecuted(e=>{e.id===Ar.id&&r()});return r(),i.dispose}))}function Al(e){return{id:Dl,selectionsCommandId:qo.id,type:i.MenuItemType.SELECTOR,icon:`ZoomInIcon`,tooltip:`sheets-ui.toolbar.zoom`,selections:Ol.map(e=>({value:e,label:`${e}%`})),value$:kl(e),hidden$:(0,i.getMenuHiddenObservable)(e,n.UniverInstanceType.UNIVER_SHEET)}}let jl={[i.RibbonPosition.START]:{[i.RibbonStartGroup.HISTORY]:{[Mc]:{order:4,gridLayout:{row:1,column:3,rowSpan:2,showLabel:!0},menuItemFactory:Nc,[Et.name]:{order:0,menuItemFactory:e=>({...Dc(e),icon:void 0})},[At.id]:{order:1,menuItemFactory:Pc},[jt.id]:{order:2,menuItemFactory:Fc},[Mt.id]:{order:3,menuItemFactory:Ic},[Nt.id]:{order:4,menuItemFactory:Lc}}},[i.RibbonStartGroup.FORMAT]:{[dn.id]:{order:1,gridLayout:{row:1,column:1,columnSpan:4,width:180,minWidth:120},menuItemFactory:uc},[cn.id]:{order:2,gridLayout:{row:1,column:5,width:72},menuItemFactory:xs},[ln.id]:{order:2.1,gridLayout:{row:1,column:6},menuItemFactory:Ss},[un.id]:{order:2.2,gridLayout:{row:1,column:7},menuItemFactory:Cs},[tn.id]:{order:5,gridLayout:{row:2,column:1},menuItemFactory:oc},[nn.id]:{order:6,gridLayout:{row:2,column:2},menuItemFactory:sc},[rn.id]:{order:7,gridLayout:{row:2,column:3},menuItemFactory:cc},[an.id]:{order:8,gridLayout:{row:2,column:4},menuItemFactory:lc},[fn.id]:{order:9,gridLayout:{row:2,column:7},menuItemFactory:fc,[r.ResetTextColorCommand.id]:{order:0,menuItemFactory:dc}},[r.SetBackgroundColorCommand.id]:{order:10,gridLayout:{row:2,column:6},menuItemFactory:mc,[r.ResetBackgroundColorCommand.id]:{order:0,menuItemFactory:pc}},[r.SetBorderBasicCommand.id]:{order:11,gridLayout:{row:2,column:5},menuItemFactory:ss}},[i.RibbonStartGroup.LAYOUT]:{[r.SetHorizontalTextAlignCommand.id]:{order:0,gridLayout:{row:1,column:1},menuItemFactory:gc},[r.SetVerticalTextAlignCommand.id]:{order:3,gridLayout:{row:2,column:1},menuItemFactory:vc},[r.SetTextWrapCommand.id]:{order:6,gridLayout:{row:1,column:2},menuItemFactory:bc},[r.SetShrinkToFitCommand.id]:{order:7,gridLayout:{row:2,column:2},menuItemFactory:xc},[r.SetTextRotationCommand.id]:{order:8,gridLayout:{row:1,column:3},menuItemFactory:Cc},[r.AddWorksheetMergeCommand.id]:{order:9,gridLayout:{row:2,column:3},menuItemFactory:Kc,[r.AddWorksheetMergeAllCommand.id]:{order:0,menuItemFactory:qc},[r.AddWorksheetMergeVerticalCommand.id]:{order:1,menuItemFactory:Jc},[r.AddWorksheetMergeHorizontalCommand.id]:{order:2,menuItemFactory:Yc},[r.RemoveWorksheetMergeCommand.id]:{order:3,menuItemFactory:Xc}}},[i.RibbonStartGroup.OTHERS]:{[On.id]:{order:0,gridLayout:{row:1,column:1,rowSpan:2,showLabel:!0},menuItemFactory:sl}}},[i.RibbonPosition.VIEW]:{[i.RibbonViewGroup.DISPLAY]:{[js]:{order:0,gridLayout:{row:1,column:1,rowSpan:2,showLabel:!0},menuItemFactory:Ms},[Dl]:{order:1,gridLayout:{row:1,column:2},menuItemFactory:Al}},[i.RibbonViewGroup.VISIBILITY]:{[r.ToggleGridlinesCommand.id]:{order:0,gridLayout:{row:1,column:1},menuItemFactory:Gs},[i.ToggleFullscreenOperation.id]:{order:1,gridLayout:{row:2,column:1},menuItemFactory:Ws}}},[i.ContextMenuPosition.MAIN_AREA]:{[i.ContextMenuGroup.QUICK]:{quickLayout:`tile`,[wt.name]:{order:0,menuItemFactory:Tc},[Tt.name]:{order:1,menuItemFactory:Ec},[Et.name]:{order:2,menuItemFactory:Dc}},[i.ContextMenuGroup.FORMAT]:{[Oc]:{order:0,menuItemFactory:kc},[Ac]:{order:1,menuItemFactory:jc,[At.id]:{order:0,menuItemFactory:Pc},[jt.id]:{order:1,menuItemFactory:Fc},[Mt.id]:{order:2,menuItemFactory:Ic},[Nt.id]:{order:3,menuItemFactory:Lc}},[cs]:{order:2,menuItemFactory:ls,[r.ClearSelectionContentCommand.id]:{order:0,menuItemFactory:us},[r.ClearSelectionFormatCommand.id]:{order:1,menuItemFactory:ds},[r.ClearSelectionAllCommand.id]:{order:2,menuItemFactory:ps}},[Tl]:{order:3,menuItemFactory:El}},[i.ContextMenuGroup.LAYOUT]:{order:1,[Js]:{order:0,menuItemFactory:Ys,[r.InsertRowBeforeCommand.id]:{order:0,menuItemFactory:Xs},[r.InsertColBeforeCommand.id]:{order:1,menuItemFactory:Zs},[hn.id]:{order:2,menuItemFactory:Qs},[mn.id]:{order:3,menuItemFactory:$s}},[ms]:{order:0,menuItemFactory:hs,[In.id]:{order:0,menuItemFactory:gs},[Fn.id]:{order:1,menuItemFactory:_s},[Ft.id]:{order:2,menuItemFactory:vs},[It.id]:{order:3,menuItemFactory:ys}},[As]:{order:2,menuItemFactory:Ns,[Kn.id]:{order:0,menuItemFactory:Rs},[qn.id]:{order:1,menuItemFactory:zs},[Jn.id]:{order:2,menuItemFactory:Bs},[Yn.id]:{order:3,menuItemFactory:Vs},[Xn.id]:{order:4,menuItemFactory:Hs},[r.CancelFrozenCommand.id]:{order:5,menuItemFactory:Us}},[ol]:{order:3,menuItemFactory:cl,[kn.id]:{order:0,menuItemFactory:ll},[Pn.id]:{order:1,menuItemFactory:ul},[Nn.id]:{order:2,menuItemFactory:dl},[An.id]:{order:3,menuItemFactory:fl}}},[i.ContextMenuGroup.DATA]:{order:2},[i.ContextMenuGroup.OTHERS]:{order:3}},[i.ContextMenuPosition.COL_HEADER]:{[i.ContextMenuGroup.QUICK]:{quickLayout:`tile`,[wt.name]:{order:0,menuItemFactory:Tc},[Tt.name]:{order:1,menuItemFactory:Ec},[Et.name]:{order:2,menuItemFactory:Dc}},[i.ContextMenuGroup.FORMAT]:{[Oc]:{order:0,menuItemFactory:kc},[Ac]:{order:1,menuItemFactory:jc,[At.id]:{order:0,menuItemFactory:Pc},[jt.id]:{order:1,menuItemFactory:Fc},[Mt.id]:{order:2,menuItemFactory:Ic},[Nt.id]:{order:3,menuItemFactory:Lc}},[cs]:{order:2,menuItemFactory:ls,[r.ClearSelectionContentCommand.id]:{order:0,menuItemFactory:us},[r.ClearSelectionFormatCommand.id]:{order:1,menuItemFactory:ds},[r.ClearSelectionAllCommand.id]:{order:2,menuItemFactory:ps}},[Tl]:{order:3,menuItemFactory:El}},[i.ContextMenuGroup.LAYOUT]:{order:1,[r.InsertMultiColsLeftCommand.id]:{order:0,menuItemFactory:nc},[r.InsertMultiColsRightCommand.id]:{order:0,menuItemFactory:rc},[$t.id]:{order:1,menuItemFactory:Vc},[r.SetSelectedColsVisibleCommand.id]:{order:2,menuItemFactory:Uc},[In.id]:{order:2,menuItemFactory:gs},[r.SetColWidthCommand.id]:{order:3,menuItemFactory:Gc},[vr.id]:{order:4,menuItemFactory:zc},[Ps]:{order:5,menuItemFactory:Fs,[Jn.id]:{order:2,menuItemFactory:Bs},[Xn.id]:{order:4,menuItemFactory:Hs},[r.CancelFrozenCommand.id]:{order:5,menuItemFactory:Us}},[ol]:{order:6,menuItemFactory:cl,[kn.id]:{order:0,menuItemFactory:ll},[Pn.id]:{order:1,menuItemFactory:ul},[Nn.id]:{order:2,menuItemFactory:dl},[An.id]:{order:3,menuItemFactory:fl}}},[i.ContextMenuGroup.DATA]:{order:2},[i.ContextMenuGroup.OTHERS]:{order:3}},[i.ContextMenuPosition.ROW_HEADER]:{[i.ContextMenuGroup.QUICK]:{quickLayout:`tile`,[wt.name]:{order:0,menuItemFactory:Tc},[Tt.name]:{order:1,menuItemFactory:Ec},[Et.name]:{order:2,menuItemFactory:Dc}},[i.ContextMenuGroup.FORMAT]:{[Oc]:{order:0,menuItemFactory:kc},[Ac]:{order:1,menuItemFactory:jc,[At.id]:{order:0,menuItemFactory:Pc},[jt.id]:{order:1,menuItemFactory:Fc},[Mt.id]:{order:2,menuItemFactory:Ic},[Nt.id]:{order:3,menuItemFactory:Lc}},[cs]:{order:2,menuItemFactory:ls,[r.ClearSelectionContentCommand.id]:{order:0,menuItemFactory:us},[r.ClearSelectionFormatCommand.id]:{order:1,menuItemFactory:ds},[r.ClearSelectionAllCommand.id]:{order:2,menuItemFactory:ps}},[Tl]:{order:3,menuItemFactory:El}},[i.ContextMenuGroup.LAYOUT]:{order:1,[r.InsertMultiRowsAboveCommand.id]:{order:0,menuItemFactory:tc},[r.InsertMultiRowsAfterCommand.id]:{order:1,menuItemFactory:ec},[Fn.id]:{order:1,menuItemFactory:_s},[Qt.id]:{order:2,menuItemFactory:Bc},[r.SetSelectedRowsVisibleCommand.id]:{order:2,menuItemFactory:Hc},[r.SetRowHeightCommand.id]:{order:3,menuItemFactory:Wc},[r.SetWorksheetRowIsAutoHeightCommand.id]:{order:4,menuItemFactory:Rc},[Is]:{order:5,menuItemFactory:Ls,[qn.id]:{order:1,menuItemFactory:zs},[Yn.id]:{order:3,menuItemFactory:Vs},[r.CancelFrozenCommand.id]:{order:5,menuItemFactory:Us}},[ol]:{order:6,menuItemFactory:cl,[kn.id]:{order:0,menuItemFactory:ll},[Pn.id]:{order:1,menuItemFactory:ul},[Nn.id]:{order:2,menuItemFactory:dl},[An.id]:{order:3,menuItemFactory:fl}}},[i.ContextMenuGroup.DATA]:{order:2},[i.ContextMenuGroup.OTHERS]:{order:3}},[i.ContextMenuPosition.FOOTER_TABS]:{[i.ContextMenuGroup.OTHERS]:{order:0,[Ln.id]:{order:0,menuItemFactory:_l},[r.CopySheetCommand.id]:{order:1,menuItemFactory:vl},[Vr.id]:{order:2,menuItemFactory:yl},[r.SetTabColorCommand.id]:{order:3,menuItemFactory:bl},[r.SetWorksheetHideCommand.id]:{order:4,menuItemFactory:xl},[Fr.id]:{order:6,menuItemFactory:Sl},[jn.id]:{order:7,menuItemFactory:pl},[Ir.id]:{order:8,menuItemFactory:ml},[Lr.id]:{order:9,menuItemFactory:hl},[Mn.id]:{order:10,menuItemFactory:gl}}},[i.ContextMenuPosition.FOOTER_MENU]:{[i.ContextMenuGroup.OTHERS]:{[r.ToggleGridlinesCommand.id]:{order:1,menuItemFactory:Gs}}}};function Ml(e){var t;let n=(t=e.custom)==null?void 0:t.UNIVER_EMBED_SHEETS_TAB;if(Nl(n))return n}function Nl(e){if(!e||typeof e!=`object`)return!1;let t=e;return t.version===1&&typeof t.embedId==`string`&&typeof t.hostAnchorId==`string`&&(t.childType===void 0||typeof t.childType==`number`)}let Pl=(0,n.createIdentifier)(`sheet-ui.embed-runtime.service`);function Fl(){let e=(0,i.useDependency)(n.IUniverInstanceService);return(0,i.useObservable)(()=>e.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET),void 0,void 0,[])??null}function Il(e){return(0,i.useObservable)(()=>(e==null?void 0:e.activeSheet$)??(0,o.of)(null),void 0,void 0,[e])}function Ll(){let e=(0,i.useDependency)(n.IUniverInstanceService);return(0,i.useObservable)(()=>(0,o.merge)([e.getTypeOfUnitAdded$(n.UniverInstanceType.UNIVER_SHEET),e.getTypeOfUnitDisposed$(n.UniverInstanceType.UNIVER_SHEET)]).pipe((0,o.map)(()=>e.getAllUnitsForType(n.UniverInstanceType.UNIVER_SHEET)),(0,o.startWith)(e.getAllUnitsForType(n.UniverInstanceType.UNIVER_SHEET))),[],void 0,[e])}function Rl(e){var t;let r=(t=e.getEditor(n.DOCS_NORMAL_EDITOR_UNIT_ID_KEY))==null?void 0:t.docSelectionRenderService;return!r||r.isFocusing?!1:(r.focus(),r.isFocusing)}function zl(e){let t=e.ownerDocument??(typeof document>`u`?void 0:document);if(!t)return(0,n.toDisposable)(()=>{});let r=new n.DisposableCollection,i=t.defaultView,a=!1,o=null,s,c=[],l,u=()=>{var t;if(a)return;let r=(t=e.editorService.getEditor(n.DOCS_NORMAL_EDITOR_UNIT_ID_KEY))==null?void 0:t.docSelectionRenderService,i=r!=null&&r.selectionContainer.isConnected?r.selectionContainer:null;if(i===o||(s==null||s.dispose(),s=void 0,o=null,!i))return;let c=new n.DisposableCollection;if(o=i,e.interactionBoundaryService&&c.add(e.interactionBoundaryService.registerOwnedElement(e.embedId,i)),e.focusCoordinator){c.add(e.focusCoordinator.registerElement({embedId:e.embedId,role:`child-editor`,element:i}));let t=r==null?void 0:r.inputElement;t&&t!==i&&c.add(e.focusCoordinator.registerElement({embedId:e.embedId,role:`child-editor`,element:t}))}s=c},d=e=>{if(e<=0||!(i!=null&&i.requestAnimationFrame))return;let t=i.requestAnimationFrame(()=>{let n=c.indexOf(t);n>=0&&c.splice(n,1),u(),o||d(e-1)});c.push(t)};return u(),o||d(2),i!=null&&i.MutationObserver&&t.body&&(l=new i.MutationObserver(()=>u()),l.observe(t.body,{childList:!0,subtree:!0})),r.add((0,n.toDisposable)(()=>{a=!0,c.forEach(e=>{var t;return i==null||(t=i.cancelAnimationFrame)==null?void 0:t.call(i,e)}),c.length=0,l==null||l.disconnect(),l=void 0,s==null||s.dispose(),s=void 0,o=null})),r}function Bl(e){let t=(0,i.useDependency)(Y),r=(0,i.useDependency)(n.ICommandService),o=(0,i.useDependency)(n.Injector);return(0,p.useMemo)(()=>({keyCodes:[{keyCode:i.KeyCode.ENTER},{keyCode:i.KeyCode.ENTER,metaKey:i.MetaKeys.SHIFT},{keyCode:i.KeyCode.ESC},{keyCode:i.KeyCode.TAB},{keyCode:i.KeyCode.TAB,metaKey:i.MetaKeys.SHIFT}],handler:(s,c)=>{if(s===i.KeyCode.ENTER||s===i.KeyCode.ESC||s===i.KeyCode.TAB){if(e==null)return;t.disableForceKeepVisible();let l=o.has(i.IUIRuntimeScopeService)?o.get(i.IUIRuntimeScopeService).get(e):void 0;(l!=null&&l.has(n.ICommandService)?l.get(n.ICommandService):r).syncExecuteCommand(X.id,{visible:!1,eventType:a.DeviceInputEventType.Keyboard,keycode:s,isShift:c===i.MetaKeys.SHIFT,unitId:e})}}}),[r,t,o,e])}let Vl=-1e3,Hl={width:0,height:0,top:Vl,left:Vl};function Ul(e){let{root:t,target:n,activeElement:r,isEditorFocusing:i}=e;if(!t||!(n instanceof HTMLElement)||!(r instanceof HTMLElement))return!0;let a=t.closest(`[${di}]`),o=a==null?void 0:a.getAttribute(di);if(!o)return!0;let s=n.closest(`[${di}="${o}"]`)!=null,c=r.closest(`[${di}="${o}"]`);return s&&c&&Wl(r)?!1:!i||n.closest(`[data-embed-interaction-boundary-owner="${o}"]`)==null||c==null}function Wl(e){let t=e.getAttribute(fi);return t===`child-editor`||t===`child-popup`||t===`floating-menu`}function Gl(e,t){var r;if(!e)return!1;let a=t.activeElement;if(!(a instanceof HTMLElement)||(0,i.getEmbedBoundaryOwner)(a)!==e)return!1;let o=a.getAttribute(`data-embed-runtime-focus-role`)??((r=a.closest(`[data-embed-runtime-focus-role]`))==null?void 0:r.getAttribute(`data-embed-runtime-focus-role`)),s=o===`child-editor`&&a.id!==`__editor_${n.DOCS_NORMAL_EDITOR_UNIT_ID_KEY}`;return a.matches(`input, textarea, select`)||s||o===`child-popup`||o===`floating-menu`}function Kl(e,t){var n;if(!e)return!1;let r=t.activeElement;if(!(r instanceof HTMLElement)||(0,i.getEmbedBoundaryOwner)(r)!==e)return!1;let a=r.getAttribute(`data-embed-runtime-focus-role`)??((n=r.closest(`[data-embed-runtime-focus-role]`))==null?void 0:n.getAttribute(`data-embed-runtime-focus-role`));return r.matches(`input, textarea, select`)||a==null&&r.tagName!==`CANVAS`||a===`child-editor`||a===`child-popup`||a===`floating-menu`}function ql(e){var t;if(!(e instanceof HTMLElement))return!1;let n=e.getAttribute(`data-embed-runtime-focus-role`)??((t=e.closest(`[data-embed-runtime-focus-role]`))==null?void 0:t.getAttribute(`data-embed-runtime-focus-role`));return n===`child-editor`||n===`child-popup`||n===`floating-menu`}function Jl({hidden:e=!1}){var r;let[s,c]=(0,p.useState)({...Hl}),l=(0,i.useDependency)(Ti),d=(0,i.useDependency)(n.Injector),f=(0,i.useDependency)(t.IEditorService),h=(0,i.useDependency)(n.IUniverInstanceService),g=(0,i.useDependency)(n.IContextService),_=(0,i.useDependency)(n.ThemeService),v=(0,i.useDependency)(i.ComponentManager),y=(0,i.useDependency)(Y),b=(0,i.useDependency)(Ei),x=(0,i.useDependency)(a.IRenderManagerService),S=(0,p.useRef)(null),C=(0,p.useRef)(void 0),w=(0,i.useObservable)(y.visible$),T=(0,i.useDependency)(n.ICommandService),E=(0,i.useObservable)(()=>g.subscribeContextValue$(i.DISABLE_AUTO_FOCUS_KEY),!1,void 0,[g,i.DISABLE_AUTO_FOCUS_KEY]),D=v.get(P),O=(0,i.useObservable)(y.currentEditCellState$),k=O?h.getUnit(O.unitId,n.UniverInstanceType.UNIVER_SHEET)??null:null,A=Il(k),M=(0,i.useObservable)(_.darkMode$,_.darkMode),N=O==null?void 0:O.documentLayoutObject.fill,F=N==null?void 0:N.trim().toLowerCase().replace(/\s+/g,``),I=N&&F!==`transparent`&&F!==`rgba(0,0,0,0)`?N:_.getColorFromTheme(M?`gray.800`:`gray.0`),[L,R]=(0,p.useState)(!1),z=O?k==null||(r=k.getSheetBySheetId(O.sheetId))==null?void 0:r.getName():null,ee=O?`${A&&z&&A.getSheetId()!==O.sheetId?`'${(0,u.quoteSheetName)(z)}'!`:``}${(0,n.numberToABC)(O.column)}${O.row+1}`:null,{stroke:B,strokeWidth:V}=j(_),H=d.has(gi)?d.get(gi):void 0,te=()=>{var e;return{activeSessionScope:H==null?void 0:H.resolveActiveChildSessionRuntimeScope(),editUnitScope:H==null?void 0:H.resolveRuntimeScopeByChildUnitId(O==null?void 0:O.unitId),visibleUnitScope:H==null?void 0:H.resolveRuntimeScopeByChildUnitId(w==null?void 0:w.unitId),focusedUnitScope:H==null?void 0:H.resolveRuntimeScopeByChildUnitId((e=h.getFocusedUnit())==null?void 0:e.getUnitId())}},U=(0,i.useObservable)(H?()=>H.runtimeSessionChanged$.pipe((0,o.map)(te),(0,o.startWith)(te())):null,te(),!1,[O==null?void 0:O.unitId,H,h,w==null?void 0:w.unitId]);(0,p.useEffect)(()=>{var e;if(R(!1),!(w!=null&&w.visible)||!(O!=null&&O.unitId))return;let t=(e=x.getRenderUnitById(O.unitId))==null?void 0:e.with(Gn);if(!t)return;let n=t.validViewportScrollInfo$.pipe((0,o.skip)(1)).subscribe(e=>{e&&R(!0)});return()=>n.unsubscribe()},[O==null?void 0:O.column,O==null?void 0:O.row,O==null?void 0:O.sheetId,O==null?void 0:O.unitId,x,w==null?void 0:w.visible]),(0,p.useEffect)(()=>{let e=l.state$.subscribe(e=>{if(e==null)return;let{startX:t=Vl,startY:r=Vl,endX:i=0,endY:a=0,show:o=!1}=e;if(!o)c({...Hl});else{c({width:i-t,height:a-r,left:t,top:r});let e=f.getEditor(n.DOCS_NORMAL_EDITOR_UNIT_ID_KEY);if(e==null)return;let{left:o,top:s,width:u,height:d}=e.getBoundingClientRect();l.setRect({left:o,top:s,width:u,height:d})}});return()=>e.unsubscribe()},[l,f]),(0,p.useEffect)(()=>{if(!d.has(_i))return;let e=d.get(_i).geometryInvalidated$.subscribe(()=>{b.resizeCellEditor()});return()=>e.unsubscribe()},[b,d]),(0,p.useEffect)(()=>{e||E||g.getContextValue(i.DISABLE_AUTO_FOCUS_KEY)||l.setFocus(!0)},[l,g,E,e,s]),(0,p.useEffect)(()=>{var t;if(e||!(w!=null&&w.visible)||(b.fitTextSize(),g.getContextValue(n.FOCUSING_FX_BAR_EDITOR)))return;let r=((t=S.current)==null?void 0:t.ownerDocument)??document,i=r.defaultView??window,a=0,o=0,s,c=()=>{let e=S.current?vi(S.current)??yi(r):yi(r);Kl(e==null?void 0:e.embedId,r)||(Rl(f),s!=null&&i.clearTimeout(s),s=i.setTimeout(()=>{s=void 0,Kl(e==null?void 0:e.embedId,r)||Rl(f)},0))},l=()=>{if(g.getContextValue(n.FOCUSING_FX_BAR_EDITOR))return;let e=S.current?vi(S.current)??yi(r):yi(r);Gl(e==null?void 0:e.embedId,r)||c()};return l(),a=requestAnimationFrame(()=>{l(),o=requestAnimationFrame(l)}),()=>{cancelAnimationFrame(a),cancelAnimationFrame(o),s!=null&&i.clearTimeout(s)}},[b,g,f,e,w==null?void 0:w.visible]),(0,p.useEffect)(()=>{if(!(w!=null&&w.visible)||!S.current||!H)return;let e=vi(S.current),t=[U.editUnitScope,U.visibleUnitScope,U.focusedUnitScope].find(e=>e!=null);if(e&&t&&e.embedId!==t.embedId)return;let r=U.activeSessionScope,i=t??e;if(r&&e&&!t&&e.embedId!==r.embedId)return;let a=i??r??yi(S.current.ownerDocument);if(!a)return;let o=new n.DisposableCollection,s=d.has(hi)?d.get(hi):void 0,c=S.current;if(o.add(H.acquireLease({embedId:a.embedId,role:`child-editor`,owner:`sheet-cell-editor`,hostUnitId:a.hostUnitId,childUnitId:a.childUnitId,associatedChildUnitIds:[n.DOCS_NORMAL_EDITOR_UNIT_ID_KEY]})),s&&o.add(s.registerOwnedElement(a.embedId,c)),o.add(H.registerElement({embedId:a.embedId,role:`child-editor`,element:c})),o.add(zl({editorService:f,embedId:a.embedId,ownerDocument:S.current.ownerDocument,interactionBoundaryService:s,focusCoordinator:H})),a.childType===n.UniverInstanceType.UNIVER_SHEET&&a.childUnitId){let e=S.current.ownerDocument,t=0,r=()=>{g.getContextValue(n.FOCUSING_FX_BAR_EDITOR)||Gl(a.embedId,e)||Rl(f)},i=e=>{H.isChildUnitRuntimeEvent(a.childUnitId,e.target,e)&&!ql(e.target)&&(cancelAnimationFrame(t),t=requestAnimationFrame(r))};e.addEventListener(`pointerdown`,i,!0),e.addEventListener(`pointerup`,i,!0),e.addEventListener(`click`,i,!0),o.add((0,n.toDisposable)(()=>{cancelAnimationFrame(t),e.removeEventListener(`pointerdown`,i,!0),e.removeEventListener(`pointerup`,i,!0),e.removeEventListener(`click`,i,!0)}))}return()=>o.dispose()},[g,f,H,d,U,w==null?void 0:w.visible]),(0,p.useEffect)(()=>{var e;if(w!=null&&w.visible||!H||E||g.getContextValue(i.DISABLE_AUTO_FOCUS_KEY))return;let r=U.activeSessionScope,a=r==null?void 0:r.childUnitId;if(!r||r.childType!==n.UniverInstanceType.UNIVER_SHEET||!a||!h.getUnit(a,n.UniverInstanceType.UNIVER_SHEET))return;let o=((e=S.current)==null?void 0:e.ownerDocument)??document,s=d.has(hi)?d.get(hi):void 0,c=zl({editorService:f,embedId:r.embedId,ownerDocument:o,interactionBoundaryService:s,focusCoordinator:H}),l=o.defaultView??window,u,p=()=>{Kl(r.embedId,o)||(Rl(f),u!=null&&l.clearTimeout(u),u=l.setTimeout(()=>{u=void 0,Kl(r.embedId,o)||Rl(f)},0))},m=()=>{if(Gl(r.embedId,o))return;let e=f.getEditor(n.DOCS_NORMAL_EDITOR_UNIT_ID_KEY),i=e==null?void 0:e.render.with(t.DocSelectionRenderService);i!=null&&i.isFocusing||i==null||i.focus(),p()},_=0,v=0,y=0;m(),_=requestAnimationFrame(()=>{m(),v=requestAnimationFrame(m)});let b=e=>{H.isChildUnitRuntimeEvent(a,e.target,e)&&!ql(e.target)&&(cancelAnimationFrame(y),e.type===`click`&&m(),y=requestAnimationFrame(m))};return o.addEventListener(`pointerdown`,b,!0),o.addEventListener(`pointerup`,b,!0),o.addEventListener(`click`,b,!0),()=>{cancelAnimationFrame(_),cancelAnimationFrame(v),cancelAnimationFrame(y),u!=null&&l.clearTimeout(u),o.removeEventListener(`pointerdown`,b,!0),o.removeEventListener(`pointerup`,b,!0),o.removeEventListener(`click`,b,!0),c.dispose()}},[g,E,f,H,d,h,U,w==null?void 0:w.visible]),(0,p.useEffect)(()=>{var e;let t=(e=S.current)==null?void 0:e.ownerDocument.defaultView;return()=>{t&&C.current!=null&&t.clearTimeout(C.current)}},[]);let ne=(0,i.useEvent)(r=>{var i;if(e||!(w!=null&&w.visible))return;let a=((i=S.current)==null?void 0:i.ownerDocument)??document,o=a.defaultView??window,s=f.getEditor(n.DOCS_NORMAL_EDITOR_UNIT_ID_KEY),c=s==null?void 0:s.render.with(t.DocSelectionRenderService),l=r.target,u=a.activeElement;Ul({root:S.current,target:l,activeElement:u,isEditorFocusing:c==null?void 0:c.isFocusing})&&(C.current!=null&&o.clearTimeout(C.current),C.current=o.setTimeout(()=>{C.current=void 0,Rl(f)},0))}),re=(0,i.useEvent)(()=>{if(y.isVisible().visible)return T.executeCommand(X.id,{visible:!1,eventType:a.DeviceInputEventType.PointerUp,unitId:O==null?void 0:O.unitId})});(0,i.useSidebarClick)(re);let ie=Bl(O==null?void 0:O.unitId),W=(0,i.useEvent)((e,t)=>T.executeCommand(Br.id,{keycode:e,visible:!1,eventType:a.DeviceInputEventType.Keyboard,isShift:t===i.MetaKeys.SHIFT||t===(i.MetaKeys.CTRL_COMMAND|i.MetaKeys.SHIFT),unitId:O==null?void 0:O.unitId}));return/* @__PURE__ */ (0,m.jsxs)(`div`,{ref:S,"data-u-comp":`editor`,className:`univer-absolute univer-z-10 univer-flex`,onPointerDownCapture:ne,style:{left:s.left,top:s.top,width:s.width,height:s.height,opacity:e?0:void 0,pointerEvents:e?`none`:void 0,backgroundColor:I},children:[(w==null?void 0:w.visible)&&L&&ee&&/* @__PURE__ */ (0,m.jsx)(`div`,{"data-u-comp":`sheet-cell-editor-address`,className:`univer-pointer-events-none univer-absolute univer-left-0 univer-top-0 univer-z-10 univer-whitespace-nowrap univer-rounded-t univer-px-1.5 univer-text-xs univer-leading-5`,style:{backgroundColor:B,color:_.getColorFromTheme(`gray.0`),transform:`translateY(-100%)`},children:ee}),D&&/* @__PURE__ */ (0,m.jsx)(D,{editorId:n.DOCS_NORMAL_EDITOR_UNIT_ID_KEY,className:`univer-relative univer-flex univer-size-full [&_canvas]:univer-absolute`,initValue:``,onChange:()=>{},isFocus:!e&&(w==null?void 0:w.visible),unitId:O==null?void 0:O.unitId,subUnitId:O==null?void 0:O.sheetId,keyboardEventConfig:ie,onMoveInEditor:W,isSupportAcrossSheet:!0,resetSelectionOnBlur:!1,isSingle:!1,autoScrollbar:!1,borderless:!0,onFormulaSelectingChange:e=>{e?y.enableForceKeepVisible():y.disableForceKeepVisible()},disableContextMenu:!1,canvasStyle:{backgroundColor:`transparent`}}),(w==null?void 0:w.visible)&&/* @__PURE__ */ (0,m.jsx)(`div`,{"aria-hidden":!0,className:`univer-pointer-events-none univer-absolute univer-left-0 univer-top-0 univer-z-10 univer-box-border`,style:{width:s.width+V,height:s.height+V,border:`${V}px solid ${B}`}})]})}function $({ref:e,...t}){let{preserveStrokeWidth:n,icon:r,id:i,className:a,extend:o,...s}=t,c=`univerjs-icon univerjs-icon-${i} ${a||``}`.trim(),l=`_${(0,p.useId)()}`,u=(0,p.useRef)(null);return(0,p.useImperativeHandle)(e,()=>u.current),(0,p.useLayoutEffect)(()=>{if(n&&u.current&&u.current.localName===r.tag)return Ql(u.current)},[n,r]),Yl(r,`${i}`,{defIds:r.defIds,idSuffix:l},{ref:u,className:c,...s},o)}function Yl(e,t,n,r,i){return(0,p.createElement)(e.tag,{key:t,...Xl(e,n,i),...r},(Zl(e,n).children||[]).map((r,a)=>Yl(r,`${t}-${e.tag}-${a}`,n,void 0,i)))}function Xl(e,t,n){let r={...e.attrs};n!=null&&n.colorChannel1&&r.fill===`colorChannel1`&&(r.fill=n.colorChannel1),n!=null&&n.colorChannel1&&r.stroke===`colorChannel1`&&(r.stroke=n.colorChannel1),e.tag===`mask`&&r.id&&(r.id+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{e===`mask`&&typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))});let{defIds:i}=t;return!i||i.length===0||(e.tag===`use`&&r[`xlink:href`]&&(r[`xlink:href`]+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))})),r}function Zl(e,t){var n;let{defIds:r}=t;return!r||r.length===0?e:e.tag===`defs`&&(n=e.children)!=null&&n.length?{...e,children:e.children.map(e=>typeof e.attrs.id==`string`&&r&&r.includes(e.attrs.id)?{...e,attrs:{...e.attrs,id:e.attrs.id+t.idSuffix}}:e)}:e}function Ql(e){let t=e.viewBox.baseVal,n=Math.max(t.width,t.height);if(!Number.isFinite(n)||n<=0||t.width<=0||t.height<=0)return()=>void 0;let r=16/n,i=Array.from(e.querySelectorAll(`circle, ellipse, line, path, polygon, polyline, rect, text, textPath, tspan, use`)).flatMap(e=>{let t=getComputedStyle(e),n=Number.parseFloat(t.strokeWidth);return t.stroke===`none`||Number.parseFloat(t.strokeOpacity)===0||t.vectorEffect===`non-scaling-stroke`||!Number.isFinite(n)||n<=0?[]:[{element:e,hadStyleAttribute:e.hasAttribute(`style`),originalStrokeWidth:n,strokeWidth:$l(e.style,`stroke-width`)}]}).map(e=>({appliedStrokeWidth:null,element:e.element,hadStyleAttribute:e.hadStyleAttribute,isReleased:!1,originalStrokeWidth:e.originalStrokeWidth,strokeWidth:e.strokeWidth}));if(i.length===0)return()=>void 0;let a=(e,n)=>{if(t.width<=0||t.height<=0||e<=0||n<=0)return;let a=Math.min(e/t.width,n/t.height);!Number.isFinite(a)||a<=0||i.forEach(e=>{if(e.isReleased)return;if(e.appliedStrokeWidth!==null&&(e.element.style.getPropertyValue(`stroke-width`)!==e.appliedStrokeWidth||e.element.style.getPropertyPriority(`stroke-width`)!==e.strokeWidth.priority)){e.appliedStrokeWidth=null,e.isReleased=!0;return}let t=e.originalStrokeWidth*r/a,n=`${Number(t.toFixed(12))}px`;e.element.style.setProperty(`stroke-width`,n,e.strokeWidth.priority),e.appliedStrokeWidth=n})},o=e.getBoundingClientRect();a(o.width,o.height);let s=typeof ResizeObserver>`u`?null:new ResizeObserver(t=>{if(t.some(t=>t.target===e)){let t=e.getBoundingClientRect();a(t.width,t.height)}});return s==null||s.observe(e),()=>{s==null||s.disconnect(),i.forEach(e=>{e.appliedStrokeWidth!==null&&(eu(e.element.style,`stroke-width`,e.appliedStrokeWidth,e.strokeWidth.priority,e.strokeWidth),!e.hadStyleAttribute&&e.element.style.length===0&&e.element.removeAttribute(`style`))})}}function $l(e,t){return{priority:e.getPropertyPriority(t),value:e.getPropertyValue(t)}}function eu(e,t,n,r,i){e.getPropertyValue(t)===n&&e.getPropertyPriority(t)===r&&(i.value?e.setProperty(t,i.value,i.priority):e.removeProperty(t))}$.displayName=`UniverIcon`;let tu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M7.9998 1.65005H3.64981C2.54524 1.65005 1.6498 2.54548 1.6498 3.65005V12.35C1.6498 13.4546 2.54523 14.35 3.6498 14.35H12.3498C13.4544 14.35 14.3498 13.4546 14.3498 12.3501V8.00005`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.2}},{tag:`path`,attrs:{stroke:`currentColor`,d:`M1.6498 11.2148L5.43408 8.29588L10.711 12.0198`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.2}},{tag:`path`,attrs:{stroke:`currentColor`,d:`M9.46559 10.1621L10.9774 8.65032C11.2042 8.42344 11.5634 8.39794 11.8201 8.59045L14.3498 10.4877`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.2}},{tag:`path`,attrs:{stroke:`currentColor`,d:`M11.8097 1.74783V6.24167M9.6603 3.897H14.1541`,strokeLinecap:`round`,strokeWidth:1.2}}]},nu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`add-image-icon`,ref:t,icon:tu}))});nu.displayName=`AddImageIcon`;let ru={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M1.3999 13.6999C1.3999 13.3685 1.66853 13.0999 1.9999 13.0999H13.9999C14.3313 13.0999 14.5999 13.3685 14.5999 13.6999C14.5999 14.0312 14.3313 14.2999 13.9999 14.2999H1.9999C1.66853 14.2999 1.3999 14.0312 1.3999 13.6999Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M7.57564 10.3914C7.80995 10.6257 8.18985 10.6257 8.42417 10.3914L10.4242 8.3914C10.6585 8.15709 10.6585 7.77719 10.4242 7.54287C10.1899 7.30856 9.80995 7.30856 9.57564 7.54287L7.9999 9.11861L6.42417 7.54287C6.18985 7.30856 5.80995 7.30856 5.57564 7.54287C5.34132 7.77719 5.34132 8.15709 5.57564 8.3914L7.57564 10.3914Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M7.9999 10.5671C8.33127 10.5671 8.5999 10.2985 8.5999 9.96714V2.30047C8.5999 1.9691 8.33127 1.70047 7.9999 1.70047C7.66853 1.70047 7.3999 1.9691 7.3999 2.30047V9.96714C7.3999 10.2985 7.66853 10.5671 7.9999 10.5671Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},iu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`align-bottom-icon`,ref:t,icon:ru}))});iu.displayName=`AlignBottomIcon`;let au={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M1.3999 2.3002C1.3999 2.63157 1.66853 2.9002 1.9999 2.9002H13.9999C14.3313 2.9002 14.5999 2.63157 14.5999 2.3002C14.5999 1.96882 14.3313 1.7002 13.9999 1.7002H1.9999C1.66853 1.7002 1.3999 1.96882 1.3999 2.3002Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M8.22957 5.47839C8.30034 5.50767 8.36664 5.55107 8.42417 5.6086L10.4242 7.6086C10.6585 7.84291 10.6585 8.22281 10.4242 8.45713C10.1899 8.69144 9.80995 8.69144 9.57564 8.45713L8.5999 7.48139V13.6995C8.5999 14.0309 8.33127 14.2995 7.9999 14.2995C7.66853 14.2995 7.3999 14.0309 7.3999 13.6995V7.48139L6.42417 8.45713C6.18985 8.69144 5.80995 8.69144 5.57564 8.45713C5.34132 8.22281 5.34132 7.84291 5.57564 7.6086L7.57541 5.60882C7.7522 5.43203 8.01209 5.38841 8.22957 5.47839Z`}}]},ou=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`align-top-icon`,ref:t,icon:au}))});ou.displayName=`AlignTopIcon`;let su={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M7.9999 1.12915C8.03875 1.12915 8.07673 1.13284 8.11352 1.13989H12.2599C13.6958 1.13989 14.8599 2.30395 14.8599 3.73989V7.88619C14.867 7.92301 14.8707 7.96102 14.8707 7.9999C14.8707 8.03878 14.867 8.0768 14.8599 8.11362V12.2599C14.8599 13.6958 13.6958 14.8599 12.2599 14.8599H8.11362C8.0768 14.867 8.03878 14.8707 7.9999 14.8707C7.96102 14.8707 7.92301 14.867 7.88619 14.8599H3.73989C2.30396 14.8599 1.13989 13.6958 1.13989 12.2599V8.11352C1.13284 8.07673 1.12915 8.03875 1.12915 7.9999C1.12915 7.96106 1.13284 7.92308 1.13989 7.88629V3.73989C1.13989 2.30396 2.30395 1.13989 3.73989 1.13989H7.88629C7.92308 1.13284 7.96106 1.12915 7.9999 1.12915ZM2.33989 8.5999V12.2599C2.33989 13.0331 2.9667 13.6599 3.73989 13.6599H7.3999V8.5999H2.33989ZM7.3999 7.3999H2.33989V3.73989C2.33989 2.9667 2.96669 2.33989 3.73989 2.33989H7.3999V7.3999ZM8.5999 8.5999V13.6599H12.2599C13.0331 13.6599 13.6599 13.0331 13.6599 12.2599V8.5999H8.5999ZM13.6599 7.3999H8.5999V2.33989H12.2599C13.0331 2.33989 13.6599 2.96669 13.6599 3.73989V7.3999Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},cu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`all-border-icon`,ref:t,icon:su}))});cu.displayName=`AllBorderIcon`;let lu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M2.5999 2.2001C2.5999 1.86873 2.33127 1.6001 1.9999 1.6001C1.66853 1.6001 1.3999 1.86873 1.3999 2.2001V13.8001C1.3999 14.1315 1.66853 14.4001 1.9999 14.4001C2.33127 14.4001 2.5999 14.1315 2.5999 13.8001V2.2001Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M14.5999 2.2001C14.5999 1.86873 14.3313 1.6001 13.9999 1.6001C13.6685 1.6001 13.3999 1.86873 13.3999 2.2001V13.8001C13.3999 14.1315 13.6685 14.4001 13.9999 14.4001C14.3313 14.4001 14.5999 14.1315 14.5999 13.8001V2.2001Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M6.424 8.24239C6.65832 8.4767 6.65832 8.8566 6.424 9.09091L6.11502 9.3999H9.33307C10.1063 9.3999 10.7331 8.7731 10.7331 7.9999C10.7331 7.22671 10.1063 6.5999 9.33307 6.5999H4.6666L4.66645 5.3999H9.33307C10.769 5.3999 11.9331 6.56396 11.9331 7.9999C11.9331 9.43584 10.769 10.5999 9.33307 10.5999H6.11485L6.424 10.9091C6.65832 11.1434 6.65832 11.5233 6.424 11.7576C6.18969 11.9919 5.80979 11.9919 5.57548 11.7576L4.24214 10.4242C4.00783 10.1899 4.00783 9.81003 4.24214 9.57572L5.57548 8.24239C5.80979 8.00807 6.18969 8.00807 6.424 8.24239Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M4.6666 6.5999C4.33523 6.5999 4.06641 6.33127 4.06641 5.9999C4.06641 5.66853 4.33508 5.3999 4.66645 5.3999L4.6666 6.5999Z`}}]},uu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`autowrap-icon`,ref:t,icon:lu}))});uu.displayName=`AutowrapIcon`;let du={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M4.65791 1.30005C3.77355 1.30005 3.05664 2.01696 3.05664 2.90132V12.8588C3.05664 13.8755 3.88086 14.6998 4.89759 14.6998H9.1016C11.2233 14.6998 12.9433 12.9798 12.9433 10.8581C12.9433 9.13925 11.8145 7.68407 10.2578 7.1934C10.8806 6.56856 11.2655 5.70659 11.2655 4.75472C11.2655 2.84676 9.71883 1.30005 7.81087 1.30005H4.65791ZM4.25664 2.90132C4.25664 2.6797 4.4363 2.50005 4.65791 2.50005H7.81087C9.05609 2.50005 10.0655 3.5095 10.0655 4.75472C10.0655 5.99993 9.05609 7.00938 7.81087 7.00938H4.25664V2.90132ZM4.25664 12.8588V8.21636H9.1016C10.5606 8.21636 11.7433 9.39909 11.7433 10.8581C11.7433 12.317 10.5606 13.4998 9.1016 13.4998H4.89759C4.5436 13.4998 4.25664 13.2128 4.25664 12.8588Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},fu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`bold-icon`,ref:t,icon:du}))});fu.displayName=`BoldIcon`;let pu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M2.59219 1.3667C1.70853 1.3667 0.992188 2.08304 0.992188 2.9667V4.9667C0.992188 5.85036 1.70853 6.5667 2.59219 6.5667H11.2694C12.1531 6.5667 12.8694 5.85036 12.8694 4.9667V4.79985H13.8075V8.18642C13.8075 8.38777 13.6579 8.55773 13.4581 8.58321L7.10511 9.39341C6.30618 9.4953 5.70752 10.1752 5.70752 10.9806V14.0332C5.70752 14.3646 5.97615 14.6332 6.30752 14.6332C6.63889 14.6332 6.90752 14.3646 6.90752 14.0332V10.9806C6.90752 10.7792 7.05718 10.6092 7.25692 10.5838L13.6099 9.77356C14.4089 9.67168 15.0075 8.99182 15.0075 8.18642V4.19985C15.0075 3.86848 14.7389 3.59985 14.4075 3.59985H12.8694V2.9667C12.8694 2.08304 12.1531 1.3667 11.2694 1.3667H2.59219ZM2.19219 2.9667C2.19219 2.74579 2.37127 2.5667 2.59219 2.5667H11.2694C11.4903 2.5667 11.6694 2.74579 11.6694 2.9667V4.9667C11.6694 5.18761 11.4903 5.3667 11.2694 5.3667H2.59219C2.37127 5.3667 2.19219 5.18761 2.19219 4.9667V2.9667Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},mu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`brush-icon`,ref:t,icon:pu}))});mu.displayName=`BrushIcon`;let hu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M1.14014 3.73989C1.14014 2.30396 2.3042 1.13989 3.74014 1.13989H12.2601C13.6961 1.13989 14.8601 2.30395 14.8601 3.73989V4.86989C14.8601 5.20126 14.5915 5.46989 14.2601 5.46989C13.9288 5.46989 13.6601 5.20126 13.6601 4.86989V3.73989C13.6601 2.96669 13.0333 2.33989 12.2601 2.33989H8.34014V3.20284C8.34014 3.20446 8.34014 3.20608 8.34014 3.2077V6.73989C8.34014 7.62355 7.62379 8.33989 6.74014 8.33989H2.70277C2.70112 8.3399 2.69947 8.3399 2.69781 8.33989H2.34014V12.2599C2.34014 13.0331 2.96694 13.6599 3.74014 13.6599H12.2601C13.0333 13.6599 13.6601 13.0331 13.6601 12.2599V11.7299C13.6601 11.3985 13.9288 11.1299 14.2601 11.1299C14.5915 11.1299 14.8601 11.3985 14.8601 11.7299V12.2599C14.8601 13.6958 13.6961 14.8599 12.2601 14.8599H3.74014C2.3042 14.8599 1.14014 13.6958 1.14014 12.2599V3.73989ZM4.26409 7.13989H6.74014C6.96105 7.13989 7.14014 6.96081 7.14014 6.73989V4.55237L4.26409 7.13989ZM7.14014 2.93819V2.33989H6.28159L2.34044 5.614L2.34056 7.13989H2.46992L7.14014 2.93819ZM2.34032 4.05403L4.40368 2.33989H3.74029C2.96705 2.33989 2.34023 2.96676 2.34029 3.74L2.34032 4.05403Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M8.73877 9.00298C8.73877 9.55526 9.18649 10.003 9.73877 10.003H11.7792C12.1106 10.003 12.3792 9.73435 12.3792 9.40298C12.3792 9.07161 12.1106 8.80298 11.7792 8.80298H10.7874L12.2304 7.36157C12.7051 6.88734 13.4743 6.88754 13.9488 7.36202C14.4234 7.83667 14.4234 8.60624 13.9488 9.0809L13.2095 9.82016C12.9752 10.0545 12.9752 10.4344 13.2095 10.6687C13.4439 10.903 13.8238 10.903 14.0581 10.6687L14.7973 9.92943C15.7406 8.98614 15.7406 7.45678 14.7973 6.51349C13.8544 5.57056 12.3257 5.57015 11.3823 6.51259L9.93877 7.95459V6.96255C9.93877 6.63118 9.67014 6.36255 9.33877 6.36255C9.0074 6.36255 8.73877 6.63118 8.73877 6.96255V9.00298Z`}}]},gu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`cancel-freeze-icon`,ref:t,icon:hu}))});gu.displayName=`CancelFreezeIcon`;let _u={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M12.5939 1.13916L10.6607 1.1392C9.55628 1.13922 8.66093 2.03448 8.66077 3.13893L8.66063 4.19191C8.66059 4.52328 8.92918 4.79194 9.26055 4.79199C9.59192 4.79204 9.86059 4.52344 9.86063 4.19207L9.86077 3.13909C9.86084 2.69731 10.219 2.33921 10.6608 2.3392L12.594 2.33916C13.0358 2.33915 13.394 2.69732 13.394 3.13916L13.394 12.8612C13.394 13.303 13.0358 13.6612 12.594 13.6612H10.6606C10.2188 13.6612 9.86063 13.303 9.86063 12.8612V11.8084C9.86063 11.4771 9.592 11.2084 9.26063 11.2084C8.92926 11.2084 8.66063 11.4771 8.66063 11.8084V12.8612C8.66063 13.9658 9.55606 14.8612 10.6606 14.8612H12.594C13.6986 14.8612 14.594 13.9658 14.594 12.8612L14.594 3.13915C14.594 2.03457 13.6985 1.13914 12.5939 1.13916Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M5.33888 1.13919L3.40568 1.13926C2.30114 1.13931 1.40575 2.03474 1.40576 3.13928L1.40586 12.8612C1.40587 13.9658 2.3013 14.8612 3.40586 14.8612H5.33896C6.44353 14.8612 7.33896 13.9658 7.33896 12.8612V11.8084C7.33896 11.4771 7.07033 11.2084 6.73896 11.2084C6.40759 11.2084 6.13896 11.4771 6.13896 11.8084V12.8612C6.13896 13.303 5.78079 13.6612 5.33896 13.6612H3.40586C2.96403 13.6612 2.60586 13.303 2.60586 12.8612L2.60576 3.13927C2.60576 2.69745 2.96391 2.33928 3.40573 2.33926L5.33893 2.33919C5.78077 2.33917 6.13896 2.69735 6.13896 3.13919V4.192C6.13896 4.52337 6.40759 4.792 6.73896 4.792C7.07033 4.792 7.33896 4.52337 7.33896 4.192V3.13919C7.33896 2.03459 6.44348 1.13914 5.33888 1.13919Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M9.20731 5.99993C8.973 6.23424 8.973 6.61414 9.20731 6.84845L10.0912 7.73235C10.2474 7.88856 10.2474 8.14182 10.0912 8.29803L9.20731 9.18192C8.973 9.41624 8.973 9.79614 9.20731 10.0305C9.44163 10.2648 9.82153 10.2648 10.0558 10.0305L10.9397 9.14654C11.5646 8.52171 11.5646 7.50867 10.9397 6.88384L10.0558 5.99993C9.82153 5.76561 9.44163 5.76561 9.20731 5.99993Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M5.94379 5.99993C6.1781 5.76561 6.558 5.76561 6.79232 5.99993C7.02663 6.23424 7.02663 6.61414 6.79232 6.84845L5.90842 7.73235C5.75221 7.88856 5.75221 8.14182 5.90842 8.29803L6.79232 9.18193C7.02663 9.41624 7.02663 9.79614 6.79232 10.0305C6.558 10.2648 6.1781 10.2648 5.94379 10.0305L5.0599 9.14656C4.43506 8.52172 4.43506 7.50866 5.0599 6.88382L5.94379 5.99993Z`}}]},vu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`cancel-merge-icon`,ref:t,icon:_u}))});vu.displayName=`CancelMergeIcon`;let yu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M2.27 8L6.09 11.82L13.73 4.18`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.2}}]},bu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`check-mark-icon`,ref:t,icon:yu}))});bu.displayName=`CheckMarkIcon`;let xu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M3.3 3.3L12.7 12.7M12.7 3.3L3.3 12.7`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.2}}]},Su=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`close-icon`,ref:t,icon:xu}))});Su.displayName=`CloseIcon`;let Cu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M9.92206 2.45064C9.98634 2.12556 9.77492 1.80992 9.44984 1.74564C9.12477 1.68136 8.80913 1.89278 8.74485 2.21785L6.41152 14.0179C6.34724 14.3429 6.55865 14.6586 6.88373 14.7228C7.20881 14.7871 7.52444 14.5757 7.58872 14.2506L9.92206 2.45064Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M5.14972 3.90157C5.38815 4.1317 5.39487 4.51154 5.16473 4.74996L2.55461 7.45409C2.01739 8.01066 2.03336 8.89745 2.59029 9.43431L5.14944 11.9013C5.38802 12.1313 5.39498 12.5111 5.165 12.7497C4.93502 12.9883 4.55519 12.9952 4.31662 12.7652L1.75746 10.2983C0.723174 9.30122 0.693506 7.65434 1.69121 6.6207L4.30133 3.91657C4.53146 3.67815 4.9113 3.67143 5.14972 3.90157Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M10.8505 3.90157C11.0889 3.67143 11.4688 3.67815 11.6989 3.91657L14.309 6.6207C15.3067 7.65434 15.2771 9.30122 14.2428 10.2983L11.6836 12.7652C11.4451 12.9952 11.0652 12.9883 10.8352 12.7497C10.6053 12.5111 10.6122 12.1313 10.8508 11.9013L13.41 9.43431C13.9669 8.89745 13.9829 8.01066 13.4456 7.45409L10.8355 4.74996C10.6054 4.51154 10.6121 4.1317 10.8505 3.90157Z`}}]},wu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`code-icon`,ref:t,icon:Cu}))});wu.displayName=`CodeIcon`;let Tu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`g`,attrs:{fill:`currentColor`,clipPath:`url(#convert-icon_clip0_911_593)`},children:[{tag:`path`,attrs:{d:`M2.44766 0.848145C1.564 0.848145 0.847656 1.56449 0.847656 2.44814V6.44814C0.847656 7.3318 1.564 8.04814 2.44766 8.04814H6.44766C7.33131 8.04814 8.04766 7.3318 8.04766 6.44814V2.44814C8.04766 1.56449 7.33131 0.848145 6.44766 0.848145H2.44766ZM2.04766 6.44814V5.04824H3.84775V6.84814H2.44766C2.22674 6.84814 2.04766 6.66906 2.04766 6.44814ZM2.04766 3.84824H3.84775V2.04814H2.44766C2.22674 2.04814 2.04766 2.22723 2.04766 2.44814V3.84824ZM5.04775 6.84814V5.04824H6.84766V6.44814C6.84766 6.66906 6.66857 6.84814 6.44766 6.84814H5.04775ZM5.04775 3.84824H6.84766V2.44814C6.84766 2.22723 6.66857 2.04814 6.44766 2.04814H5.04775V3.84824Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{d:`M9.55215 7.95166C8.66849 7.95166 7.95215 8.668 7.95215 9.55166V13.5517C7.95215 14.4353 8.66849 15.1517 9.55215 15.1517L11.5522 15.1517L13.5521 15.1517C14.4358 15.1517 15.1521 14.4353 15.1521 13.5517L15.1521 11.5518L15.1521 9.55166C15.1521 8.668 14.4358 7.95166 13.5521 7.95166H9.55215ZM13.9521 10.9518V9.55166C13.9521 9.33075 13.7731 9.15166 13.5521 9.15166H12.1522V10.9518H13.9521ZM10.9522 10.9518V9.15166H9.55215C9.33123 9.15166 9.15215 9.33075 9.15215 9.55166V10.9518H10.9522ZM9.15215 12.1518H10.9522V13.9517H9.55215C9.33123 13.9517 9.15215 13.7726 9.15215 13.5517V12.1518ZM12.1522 12.1518H13.9521V13.5517C13.9521 13.7726 13.7731 13.9517 13.5521 13.9517H12.1522V12.1518Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{d:`M9.62158 2.44912C9.62158 2.11775 9.89021 1.84912 10.2216 1.84912H12.7516C13.6352 1.84912 14.3516 2.56547 14.3516 3.44912V5.9791C14.3516 6.31047 14.0829 6.5791 13.7516 6.5791C13.4202 6.5791 13.1516 6.31047 13.1516 5.9791V3.44912C13.1516 3.22821 12.9725 3.04912 12.7516 3.04912H10.2216C9.89021 3.04912 9.62158 2.78049 9.62158 2.44912Z`}},{tag:`path`,attrs:{d:`M5.77871 14.1507C6.11008 14.1507 6.37871 13.8821 6.37871 13.5507C6.37871 13.2193 6.11008 12.9507 5.77871 12.9507L3.24873 12.9507C3.02782 12.9507 2.84873 12.7716 2.84873 12.5507L2.84873 10.0207C2.84873 9.68933 2.5801 9.4207 2.24873 9.4207C1.91736 9.4207 1.64873 9.68933 1.64873 10.0207L1.64873 12.5507C1.64873 13.4343 2.36507 14.1507 3.24873 14.1507H5.77871Z`}}]},{tag:`defs`,attrs:{},children:[{tag:`clipPath`,attrs:{id:`convert-icon_clip0_911_593`},children:[{tag:`path`,attrs:{fill:`white`,d:`M0 0H16V16H0z`}}]}]}],defIds:[`convert-icon_clip0_911_593`]},Eu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`convert-icon`,ref:t,icon:Tu}))});Eu.displayName=`ConvertIcon`;let Du={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M2 3.5V6.2C2 7.2 2.8 8 3.8 8H6.4M4.8 6.2L6.6 8L4.8 9.8`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.2}},{tag:`path`,attrs:{stroke:`currentColor`,d:`M9.8 3.2L8.8 12.8M13.2 3.2L12.2 12.8M8 6.2H14M7.7 9.8H13.7`,strokeLinecap:`round`,strokeWidth:1.2}}]},Ou=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`convert-to-number-icon`,ref:t,icon:Du}))});Ou.displayName=`ConvertToNumberIcon`;let ku={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M2.50095 1.84399C2.73322 1.60765 3.11311 1.60435 3.34945 1.83662L8.00012 6.40726L12.6508 1.83662C12.8871 1.60435 13.267 1.60765 13.4993 1.84399C13.7316 2.08032 13.7283 2.46021 13.4919 2.69248L8.85611 7.24852L10.8941 9.25146C11.1382 9.17563 11.3976 9.13477 11.6667 9.13477C13.1026 9.13477 14.2667 10.2988 14.2667 11.7348C14.2667 13.1707 13.1026 14.3348 11.6667 14.3348C10.2307 14.3348 9.06665 13.1707 9.06665 11.7348C9.06665 11.0143 9.35973 10.3622 9.83319 9.89129L8.00012 8.08978L6.16708 9.89127C6.64055 10.3622 6.93364 11.0142 6.93364 11.7348C6.93364 13.1707 5.76958 14.3348 4.33364 14.3348C2.8977 14.3348 1.73364 13.1707 1.73364 11.7348C1.73364 10.2988 2.8977 9.13477 4.33364 9.13477C4.60263 9.13477 4.86208 9.17562 5.10612 9.25145L7.14413 7.24852L2.50831 2.69248C2.27197 2.46021 2.26868 2.08032 2.50095 1.84399ZM2.93364 11.7348C2.93364 10.9616 3.56044 10.3348 4.33364 10.3348C5.10684 10.3348 5.73364 10.9616 5.73364 11.7348C5.73364 12.508 5.10684 13.1348 4.33364 13.1348C3.56044 13.1348 2.93364 12.508 2.93364 11.7348ZM10.2667 11.7348C10.2667 10.9616 10.8935 10.3348 11.6667 10.3348C12.4398 10.3348 13.0667 10.9616 13.0667 11.7348C13.0667 12.508 12.4398 13.1348 11.6667 13.1348C10.8935 13.1348 10.2667 12.508 10.2667 11.7348Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Au=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`cut-icon`,ref:t,icon:ku}))});Au.displayName=`CutIcon`;let ju={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M5.93 1.47H10.07M1.7 3.64H14.3M4.75 5.82H11.25A1 1 0 0 1 12.25 6.82V12.53A2 2 0 0 1 10.25 14.53H5.75A2 2 0 0 1 3.75 12.53V6.82A1 1 0 0 1 4.75 5.82ZM6.55 8.73L9.45 11.63M9.45 8.73L6.55 11.63`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.2}}]},Mu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`delete-icon`,ref:t,icon:ju}))});Mu.displayName=`DeleteIcon`;let Nu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M4.5 2.75H3.25C2.56 2.75 2 3.31 2 4V12.75C2 13.44 2.56 14 3.25 14H5.5M8.5 2.75H9.75C10.44 2.75 11 3.31 11 4V5`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.33}},{tag:`rect`,attrs:{width:4,height:2.5,x:4.5,y:1.5,stroke:`currentColor`,rx:.75,strokeWidth:1.33}},{tag:`rect`,attrs:{width:7,height:7,x:7.5,y:7,stroke:`currentColor`,rx:1.25,strokeWidth:1.33}},{tag:`path`,attrs:{stroke:`currentColor`,d:`M9.25 9.25H12.75M9.25 11.75H12.75M10.25 8.5V10M11.75 11V12.5`,strokeLinecap:`round`,strokeWidth:1.33}}]},Pu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`doc-paste-options-icon`,ref:t,icon:Nu}))});Pu.displayName=`DocPasteOptionsIcon`;let Fu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M8.55935 11.7617C8.29238 12.1202 7.75558 12.1202 7.48861 11.7617L3.08649 5.84931C2.75722 5.40708 3.07292 4.77771 3.62432 4.77771H12.4236C12.975 4.77771 13.2907 5.40708 12.9614 5.84931L8.55935 11.7617Z`}}]},Iu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`down-icon`,ref:t,icon:Fu}))});Iu.displayName=`DownIcon`;let Lu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M2.35381 3.65517C2.35381 2.88198 2.98061 2.25518 3.75381 2.25518H8.10381C8.43518 2.25518 8.70381 1.98655 8.70381 1.65518C8.70381 1.3238 8.43518 1.05518 8.10381 1.05518H3.75381C2.31787 1.05518 1.15381 2.21923 1.15381 3.65517V12.3552C1.15381 13.7911 2.31787 14.9552 3.75381 14.9552H12.4538C13.8897 14.9552 15.0538 13.7911 15.0538 12.3552V8.00518C15.0538 7.6738 14.7852 7.40518 14.4538 7.40518C14.1224 7.40518 13.8538 7.6738 13.8538 8.00518V9.24469L12.3428 8.11143C11.8294 7.72642 11.1111 7.77744 10.6573 8.23119L9.11281 9.77567L6.84342 7.83047C6.34812 7.40592 5.61375 7.41815 5.13289 7.85896L2.35381 10.4064V3.65517ZM2.35381 12.0343V12.3552C2.35381 13.1284 2.98061 13.7552 3.75381 13.7552H12.4538C13.227 13.7552 13.8538 13.1284 13.8538 12.3552V10.7447L11.6228 9.07144C11.5871 9.04469 11.5373 9.04827 11.5058 9.07971L10.0266 10.5589L11.2057 11.5696C11.4573 11.7853 11.4865 12.164 11.2708 12.4156C11.0552 12.6672 10.6764 12.6964 10.4248 12.4807L6.06245 8.74157C6.02809 8.71212 5.97713 8.71296 5.94377 8.74353L2.35381 12.0343Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M10.3911 3.84419C10.6254 3.60988 11.0053 3.60988 11.2396 3.84419L11.8818 4.48643V1.93496C11.8818 1.60359 12.1505 1.33496 12.4818 1.33496C12.8132 1.33496 13.0818 1.60359 13.0818 1.93496V4.48676L13.7244 3.84419C13.9587 3.60988 14.3386 3.60988 14.5729 3.84419C14.8072 4.07851 14.8072 4.45841 14.5729 4.69272L12.9063 6.35939C12.6719 6.5937 12.292 6.5937 12.0577 6.35939L10.3911 4.69272C10.1568 4.45841 10.1568 4.07851 10.3911 3.84419Z`}}]},Ru=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`download-image-icon`,ref:t,icon:Lu}))});Ru.displayName=`DownloadImageIcon`;let zu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM10.3097 5.69014C10.544 5.92445 10.544 6.30435 10.3097 6.53867L8.84843 7.9999L10.3099 9.46137C10.5442 9.69569 10.5442 10.0756 10.3099 10.3099C10.0756 10.5442 9.69569 10.5442 9.46137 10.3099L7.9999 8.84843L6.53842 10.3099C6.30411 10.5442 5.92421 10.5442 5.6899 10.3099C5.45558 10.0756 5.45558 9.69569 5.6899 9.46137L7.15137 7.9999L5.69014 6.53867C5.45583 6.30435 5.45583 5.92445 5.69014 5.69014C5.92445 5.45583 6.30435 5.45583 6.53867 5.69014L7.9999 7.15137L9.46113 5.69014C9.69544 5.45583 10.0753 5.45583 10.3097 5.69014Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Bu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`error-icon`,ref:t,icon:zu}))});Bu.displayName=`ErrorIcon`;let Vu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M7.46613 5.2614C7.99641 5.15377 8.54607 5.209 9.04566 5.42016C9.54527 5.63133 9.9725 5.98902 10.2732 6.44821C10.5739 6.90741 10.7345 7.44742 10.7345 7.99994C10.7345 8.74088 10.446 9.45122 9.93293 9.97475C9.41991 10.4982 8.72439 10.7921 7.99945 10.7921C7.45882 10.7921 6.93021 10.6285 6.48047 10.3219C6.03072 10.0152 5.67998 9.57922 5.47282 9.06887C5.26565 8.55852 5.21142 7.99686 5.31705 7.45498C5.42268 6.9131 5.68338 6.41554 6.06598 6.02513C6.44856 5.63474 6.93584 5.36903 7.46613 5.2614ZM7.99945 6.50637C7.70941 6.50637 7.42599 6.59414 7.18504 6.75842C6.94411 6.92269 6.75652 7.15604 6.64579 7.4288C6.53508 7.70156 6.50613 8.00161 6.56255 8.29108C6.61898 8.58055 6.7583 8.84663 6.96308 9.05559C7.16788 9.26456 7.42896 9.40703 7.7134 9.46476C7.99784 9.5225 8.29266 9.49286 8.56052 9.37964C8.82836 9.26643 9.05707 9.07481 9.21789 8.82922C9.3787 8.58364 9.46445 8.29505 9.46445 7.99994C9.46445 7.60424 9.31042 7.22449 9.03583 6.94429C8.76119 6.66405 8.38842 6.50637 7.99945 6.50637Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.06445 7.99994C1.06445 7.86432 1.111 7.68433 1.20506 7.46997C1.29865 7.25669 1.43723 7.01393 1.61634 6.75416C1.97451 6.23466 2.49209 5.65088 3.12753 5.10347C4.3995 4.00771 6.13495 3.06494 7.99945 3.06494C9.86395 3.06494 11.5994 4.00771 12.8714 5.10347C13.5068 5.65088 14.0244 6.23466 14.3826 6.75416C14.5617 7.01393 14.7003 7.25669 14.7938 7.46997C14.8879 7.68433 14.9345 7.86432 14.9345 7.99994C14.9345 8.29406 14.7859 8.75016 14.4847 9.27371C14.1847 9.79497 13.7374 10.3759 13.1495 10.9188C11.974 12.0042 10.2392 12.9349 7.99945 12.9349C5.75972 12.9349 4.02489 12.0042 2.84937 10.9188C2.26147 10.3759 1.81418 9.79497 1.51423 9.27371C1.21296 8.75016 1.06445 8.29406 1.06445 7.99994ZM7.99945 4.36351C6.48933 4.36351 5.14092 5.09788 4.14125 5.91406C3.64087 6.32258 3.22616 6.75295 2.92026 7.12521C2.61595 7.49554 2.415 7.81359 2.34753 7.99756L2.33827 8.0228L2.34954 8.0472C2.85275 9.13669 3.65354 10.055 4.65594 10.6918C5.65805 11.3283 6.81899 11.6563 7.99945 11.6364C9.17991 11.6563 10.3409 11.3283 11.343 10.6918C12.3454 10.055 13.1462 9.13669 13.6494 8.0472L13.6606 8.0228L13.6514 7.99756C13.5839 7.81359 13.383 7.49554 13.0786 7.12521C12.7727 6.75295 12.358 6.32258 11.8577 5.91406C10.858 5.09788 9.50957 4.36351 7.99945 4.36351Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Hu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`eye-icon`,ref:t,icon:Vu}))});Hu.displayName=`EyeIcon`;let Uu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M1.28096 4.6541C1.57489 4.50109 1.93721 4.61533 2.09022 4.90926C2.27315 5.26067 2.55999 5.60455 2.94829 5.92278C4.04628 6.82266 5.87505 7.44865 7.99828 7.44865C10.1215 7.44865 11.9503 6.82267 13.0482 5.92279C13.4366 5.60455 13.7234 5.26067 13.9063 4.90927C14.0594 4.61533 14.4217 4.50109 14.7156 4.65409C15.0095 4.8071 15.1238 5.16941 14.9708 5.46334C14.6995 5.98445 14.2981 6.44997 13.8089 6.8509C13.7298 6.91575 13.6481 6.97914 13.564 7.041L15.2245 8.70153C15.4588 8.93585 15.4588 9.31575 15.2245 9.55006C14.9902 9.78438 14.6103 9.78438 14.376 9.55006L12.5041 7.67822C11.8977 7.97568 11.2181 8.21208 10.4884 8.37706L11.0996 10.6581C11.1853 10.9782 10.9954 11.3072 10.6753 11.393C10.3552 11.4787 10.0262 11.2888 9.94045 10.9687L9.29949 8.57652C8.8758 8.62404 8.44081 8.64865 7.99828 8.64865C7.55276 8.64865 7.11487 8.62371 6.68846 8.57555L6.04723 10.9687C5.96147 11.2888 5.63247 11.4788 5.31239 11.393C4.99231 11.3073 4.80236 10.9783 4.88812 10.6582L5.49983 8.37516C4.7743 8.2105 4.09843 7.9752 3.49498 7.67947L1.62436 9.55009C1.39005 9.78441 1.01015 9.78441 0.775835 9.5501C0.54152 9.31578 0.541518 8.93588 0.775832 8.70157L2.43478 7.04261C2.34987 6.98024 2.26746 6.91632 2.18764 6.8509C1.69842 6.44997 1.29706 5.98445 1.0258 5.46335C0.872791 5.16942 0.987031 4.80711 1.28096 4.6541Z`}}]},Wu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`eyelash-icon`,ref:t,icon:Uu}))});Wu.displayName=`EyelashIcon`;let Gu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M4.92494 2.4224C5.37364 1.19807 7.10523 1.19807 7.55394 2.4224L11.7284 13.8128C11.8425 14.124 11.6827 14.4686 11.3716 14.5827C11.0604 14.6967 10.7158 14.5369 10.6017 14.2258L9.02773 9.93099C9.02555 9.93101 9.02338 9.93102 9.0212 9.93102H3.74372C3.6469 9.93102 3.55544 9.90809 3.47447 9.86736L1.87714 14.2258C1.76312 14.5369 1.41845 14.6967 1.10732 14.5827C0.796186 14.4686 0.636401 14.124 0.750429 13.8128L4.92494 2.4224ZM3.89093 8.73102H8.58795L6.42722 2.83533C6.36312 2.66043 6.11576 2.66042 6.05165 2.83533L3.89093 8.73102Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M13.0504 2.47954C13.0504 2.14817 12.7818 1.87954 12.4504 1.87954C12.1191 1.87954 11.8504 2.14817 11.8504 2.47954V4.11554H10.2144C9.88305 4.11554 9.61442 4.38417 9.61442 4.71554C9.61442 5.04691 9.88305 5.31554 10.2144 5.31554H11.8504V6.95155C11.8504 7.28292 12.1191 7.55155 12.4504 7.55155C12.7818 7.55155 13.0504 7.28292 13.0504 6.95155V5.31554H14.6864C15.0178 5.31554 15.2864 5.04691 15.2864 4.71554C15.2864 4.38417 15.0178 4.11554 14.6864 4.11554H13.0504V2.47954Z`}}]},Ku=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`font-size-increase-icon`,ref:t,icon:Gu}))});Ku.displayName=`FontSizeIncreaseIcon`;let qu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M4.92469 2.4224C5.3734 1.19807 7.10499 1.19807 7.5537 2.4224L11.7282 13.8128C11.8422 14.124 11.6824 14.4686 11.3713 14.5827C11.0602 14.6967 10.7155 14.5369 10.6015 14.2258L9.02748 9.93099C9.02539 9.93101 9.0233 9.93102 9.0212 9.93102H3.74372C3.64682 9.93102 3.55528 9.90805 3.47426 9.86726L1.8769 14.2258C1.76287 14.5369 1.41821 14.6967 1.10708 14.5827C0.795942 14.4686 0.636156 14.124 0.750185 13.8128L4.92469 2.4224ZM3.89068 8.73102H8.58771L6.42698 2.83533C6.36288 2.66043 6.11551 2.66042 6.05141 2.83533L3.89068 8.73102Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M9.61442 4.71554C9.61442 4.38417 9.88305 4.11554 10.2144 4.11554H14.6864C15.0178 4.11554 15.2864 4.38417 15.2864 4.71554C15.2864 5.04691 15.0178 5.31554 14.6864 5.31554H10.2144C9.88305 5.31554 9.61442 5.04691 9.61442 4.71554Z`}}]},Ju=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`font-size-reduce-icon`,ref:t,icon:qu}))});Ju.displayName=`FontSizeReduceIcon`;let Yu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M1.14014 12.2599C1.14014 13.6958 2.3042 14.8599 3.74014 14.8599H12.2601C13.6961 14.8599 14.8601 13.6958 14.8601 12.2599V3.73989C14.8601 2.30395 13.6961 1.13989 12.2601 1.13989H3.74014C2.3042 1.13989 1.14014 2.30396 1.14014 3.73989V12.2599ZM2.68766 13.1831C2.47131 12.9367 2.34014 12.6136 2.34014 12.2599V11.9756L5.68213 8.21656V9.69237L2.68766 13.1831ZM3.85969 13.6599H5.68213V11.5354L3.85969 13.6599ZM6.88213 13.6599H12.2601C13.0333 13.6599 13.6601 13.0331 13.6601 12.2599V3.73989C13.6601 2.96669 13.0333 2.33989 12.2601 2.33989H6.88213V13.6599ZM5.68213 2.33989H5.10563L2.34014 5.5448V6.99379L5.68213 3.23472V2.33989ZM2.34014 8.79985V10.1696L5.68213 6.4105V5.04078L2.34014 8.79985ZM2.3405 3.70754L3.50344 2.35982C2.85328 2.47053 2.35588 3.02952 2.3405 3.70754Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Xu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`freeze-column-icon`,ref:t,icon:Yu}))});Xu.displayName=`FreezeColumnIcon`;let Zu={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M3.74015 1.13989C2.30421 1.13989 1.14015 2.30396 1.14015 3.73989V5.32866C1.14013 5.33155 1.14013 5.33444 1.14015 5.33732V12.2599C1.14015 13.6958 2.30421 14.8599 3.74015 14.8599H12.2602C13.6961 14.8599 14.8602 13.6958 14.8602 12.2599V3.73989C14.8602 2.46491 13.9424 1.40427 12.7315 1.18251C12.6397 1.14703 12.5407 1.13477 12.4436 1.14626C12.383 1.14204 12.3218 1.13989 12.2602 1.13989H3.74015ZM10.9392 2.33989H9.5695L5.81042 5.68188H7.18015L10.9392 2.33989ZM7.76344 2.33989H6.2816L2.34015 5.61425V5.68188H4.00437L7.76344 2.33989ZM2.34015 6.88188V12.2599C2.34015 13.0331 2.96695 13.6599 3.74015 13.6599H12.2602C13.0334 13.6599 13.6602 13.0331 13.6602 12.2599V6.88188H2.34015ZM13.6602 5.68188V4.48357L12.2714 5.68188H13.6602ZM13.4806 3.05349C13.3067 2.745 13.0193 2.50905 12.675 2.40238L8.98621 5.68188H10.4346L13.4806 3.05349ZM2.34015 4.05418L4.4037 2.33989H3.74015C2.96695 2.33989 2.34015 2.9667 2.34015 3.73989V4.05418Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Qu=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`freeze-row-icon`,ref:t,icon:Zu}))});Qu.displayName=`FreezeRowIcon`;let $u={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M1.74014 4.65986L4.66011 1.73989M1.74014 7.85986L7.86011 1.73989M1.74014 11.0599L11.2601 1.73989M1.74014 14.2599L7.39256 8.60744M8.89317 7.10684L14.2601 1.73989M4.94011 14.2599L7.39256 11.8074M12.0932 7.10684L14.2601 4.93989`,strokeWidth:1.2}},{tag:`path`,attrs:{stroke:`currentColor`,d:`M7.39256 7.10684H14.2601M7.39256 7.10684V14.2599`,strokeWidth:1.2}},{tag:`rect`,attrs:{width:12.52,height:12.52,x:1.74,y:1.74,stroke:`currentColor`,rx:2,strokeWidth:1.2}}]},ed=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`freeze-to-selected-icon`,ref:t,icon:$u}))});ed.displayName=`FreezeToSelectedIcon`;let td={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 17`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M6.06409 5.53454C5.93592 5.53454 5.84083 5.41567 5.86897 5.29063L5.95442 4.9109C6.05444 4.48178 6.23806 4.11547 6.51182 3.81952C6.81082 3.49628 7.25398 3.35405 7.79738 3.35405C7.99847 3.35405 8.21359 3.37775 8.44188 3.42245C8.46089 3.42617 8.47974 3.43006 8.49846 3.4341C8.7099 3.4798 8.93698 3.38478 9.02031 3.18514L9.24767 2.6404C9.33457 2.43219 9.23178 2.19404 9.01582 2.12874C8.98358 2.11899 8.95028 2.10912 8.91591 2.09914C8.62745 2.01631 8.28392 1.97217 7.88074 1.97217C6.82015 1.97217 6.02714 2.23936 5.4746 2.7444C4.90987 3.26069 4.50889 3.99917 4.28413 4.9762L2.83703 11.1909C2.76126 11.5286 2.666 11.8917 2.54844 12.2812C2.42975 12.6734 2.2873 13.0595 2.12221 13.4373C1.95577 13.8159 1.76813 14.1762 1.55955 14.5171C1.49345 14.6251 1.42515 14.7282 1.35467 14.8263C1.26508 14.9509 1.3347 15.133 1.48655 15.1554C2.13635 15.2509 2.8179 15.0763 3.18197 14.5296C3.32661 14.3124 3.46779 14.0646 3.60509 13.7851C3.96635 13.0497 4.30522 12.0103 4.61867 10.6574L5.469 7.01534C5.49013 6.92483 5.57082 6.86081 5.66376 6.86081H7.62478C7.8097 6.86081 7.97051 6.73405 8.01371 6.55425L8.14014 6.02798C8.20057 5.77642 8.00992 5.53454 7.75121 5.53454H6.06409Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M14.3211 5.72037L12.5124 7.96963L11.4089 5.77754C11.3422 5.63012 11.1954 5.5354 11.0336 5.5354H10.3129C10.0085 5.5354 9.80921 5.85428 9.9427 6.1279L11.4089 9.05502L8.79783 12.1493C8.56587 12.4158 8.75519 12.8315 9.10855 12.8315H9.68607C9.80672 12.8315 9.9605 12.7822 10.0388 12.6904L12.1108 10.2648L13.1176 12.561C13.1786 12.7231 13.333 12.8315 13.5061 12.8315H14.3C14.5831 12.8315 14.7417 12.6175 14.6426 12.3524L13.1728 9.28628C13.1728 9.28628 15.4009 6.45542 15.6013 6.17892C15.7966 5.90929 15.6023 5.5354 15.2693 5.5354H14.6661C14.5275 5.5354 14.4333 5.58887 14.3211 5.72037Z`}}]},nd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`fx-icon`,ref:t,icon:td}))});nd.displayName=`FxIcon`;let rd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M5 2H2V5M11 2H14V5M14 11V14H11M5 14H2V11`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.3}},{tag:`path`,attrs:{stroke:`currentColor`,d:`M5.4 4V12M10.6 4V12M4 5.4H12M4 10.6H12`,strokeDasharray:`1.6 1.6`,strokeWidth:1.05}},{tag:`path`,attrs:{fill:`currentColor`,d:`M4.875 4.875H5.925V5.925H4.875V4.875ZM10.075 4.875H11.125V5.925H10.075V4.875ZM10.075 10.075H11.125V11.125H10.075V10.075ZM4.875 10.075H5.925V11.125H4.875V10.075Z`}}]},id=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`hide-gridlines-icon`,ref:t,icon:rd}))});id.displayName=`HideGridlinesIcon`;let ad={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M5.91296 6.82256L5.89774 6.82237L2.83868 6.8223C1.89982 6.82228 1.13874 6.06119 1.13872 5.12234L1.13867 3.32265C1.13865 2.38375 1.89977 1.62261 2.83866 1.62261L5.90639 1.62259L5.91296 1.62256L5.91953 1.62259L10.0821 1.62258L10.0868 1.62256L10.0914 1.62258L13.1607 1.62256C14.0996 1.62256 14.8607 2.38368 14.8607 3.32256V5.12253C14.8607 6.06143 14.0996 6.82256 13.1607 6.82253L10.0975 6.82246L10.0868 6.82256L10.076 6.82246L5.92815 6.82237L5.91296 6.82256ZM10.6868 5.62248L13.1607 5.62253C13.4368 5.62254 13.6607 5.39868 13.6607 5.12253V3.32256C13.6607 3.04642 13.4368 2.82256 13.1607 2.82256L10.6868 2.82257V5.62248ZM9.48679 2.82258V5.62245L6.51296 5.62238V2.82259L9.48679 2.82258ZM5.31296 2.8226V5.62236L2.8387 5.6223C2.56257 5.62229 2.33872 5.39845 2.33872 5.12231L2.33867 3.32262C2.33867 3.04647 2.56252 2.82261 2.83867 2.82261L5.31296 2.8226Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.1387 10.8773L1.13878 12.6773C1.13883 13.6162 1.89994 14.3772 2.8388 14.3772L5.90638 14.3772L5.91296 14.3772L5.91955 14.3772L10.0775 14.3772C10.0806 14.3772 10.0837 14.3772 10.0868 14.3772C10.0899 14.3772 10.093 14.3772 10.0961 14.3772L13.1607 14.3772C14.0996 14.3771 14.8607 13.616 14.8607 12.6772V10.8772C14.8607 9.93836 14.0996 9.17725 13.1607 9.17725H2.8387C1.89978 9.17725 1.13865 9.93841 1.1387 10.8773ZM9.48679 10.3772H6.51296V13.1772L9.48679 13.1772V10.3772ZM10.6868 13.1772V10.3772H13.1607C13.4369 10.3772 13.6607 10.6011 13.6607 10.8772V12.6772C13.6607 12.9533 13.4369 13.1771 13.1607 13.1772L10.6868 13.1772ZM5.31296 13.1772V10.3772H2.8387C2.56254 10.3772 2.33868 10.6011 2.3387 10.8773L2.33878 12.6773C2.33879 12.9534 2.56265 13.1772 2.83879 13.1772L5.31296 13.1772Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},od=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`horizontal-merge-icon`,ref:t,icon:ad}))});od.displayName=`HorizontalMergeIcon`;let sd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M1.9999 1.89941C1.66853 1.89941 1.3999 2.16804 1.3999 2.49941C1.3999 2.83078 1.66853 3.09941 1.9999 3.09941H13.9999C14.3313 3.09941 14.5999 2.83078 14.5999 2.49941C14.5999 2.16804 14.3313 1.89941 13.9999 1.89941H1.9999Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M3.33315 5.56641C3.00178 5.56641 2.73315 5.83504 2.73315 6.16641C2.73315 6.49778 3.00178 6.76641 3.33315 6.76641H12.6665C12.9979 6.76641 13.2665 6.49778 13.2665 6.16641C13.2665 5.83504 12.9979 5.56641 12.6665 5.56641H3.33315Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.3999 9.8334C1.3999 9.50203 1.66853 9.2334 1.9999 9.2334H13.9999C14.3313 9.2334 14.5999 9.50203 14.5999 9.8334C14.5999 10.1648 14.3313 10.4334 13.9999 10.4334H1.9999C1.66853 10.4334 1.3999 10.1648 1.3999 9.8334Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M3.33315 12.9004C3.00178 12.9004 2.73315 13.169 2.73315 13.5004C2.73315 13.8318 3.00178 14.1004 3.33315 14.1004H12.6665C12.9979 14.1004 13.2665 13.8318 13.2665 13.5004C13.2665 13.169 12.9979 12.9004 12.6665 12.9004H3.33315Z`}}]},cd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`horizontally-icon`,ref:t,icon:sd}))});cd.displayName=`HorizontallyIcon`;let ld={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M8 2V14M2 8H14`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.2}}]},ud=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`increase-icon`,ref:t,icon:ld}))});ud.displayName=`IncreaseIcon`;let dd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M8.00016 1.33203C6.68162 1.33203 5.39269 1.72302 4.29636 2.45557C3.20004 3.18811 2.34555 4.2293 1.84097 5.44747C1.33638 6.66565 1.20436 8.00609 1.4616 9.2993C1.71883 10.5925 2.35377 11.7804 3.28612 12.7127C4.21847 13.6451 5.40636 14.28 6.69956 14.5373C7.99277 14.7945 9.33321 14.6625 10.5514 14.1579C11.7696 13.6533 12.8108 12.7988 13.5433 11.7025C14.2758 10.6062 14.6668 9.31724 14.6668 7.9987C14.6649 6.23118 13.9619 4.53662 12.7121 3.2868C11.4622 2.03697 9.76768 1.33397 8.00016 1.33203ZM7.66683 3.9987C7.86461 3.9987 8.05795 4.05735 8.2224 4.16723C8.38685 4.27711 8.51502 4.43329 8.59071 4.61601C8.6664 4.79874 8.6862 4.99981 8.64762 5.19379C8.60903 5.38777 8.51379 5.56595 8.37394 5.7058C8.23409 5.84566 8.0559 5.9409 7.86192 5.97948C7.66794 6.01807 7.46687 5.99826 7.28415 5.92258C7.10142 5.84689 6.94524 5.71872 6.83536 5.55427C6.72548 5.38982 6.66683 5.19648 6.66683 4.9987C6.66683 4.73348 6.77219 4.47913 6.95972 4.29159C7.14726 4.10405 7.40162 3.9987 7.66683 3.9987ZM9.3335 11.332H6.66683C6.49002 11.332 6.32045 11.2618 6.19543 11.1368C6.0704 11.0117 6.00016 10.8422 6.00016 10.6654C6.00016 10.4886 6.0704 10.319 6.19543 10.194C6.32045 10.0689 6.49002 9.9987 6.66683 9.9987H7.3335V7.9987H6.66683C6.49002 7.9987 6.32045 7.92846 6.19543 7.80343C6.0704 7.67841 6.00016 7.50884 6.00016 7.33203C6.00016 7.15522 6.0704 6.98565 6.19543 6.86063C6.32045 6.7356 6.49002 6.66536 6.66683 6.66536H8.00016C8.17698 6.66536 8.34655 6.7356 8.47157 6.86063C8.59659 6.98565 8.66683 7.15522 8.66683 7.33203V9.9987H9.3335C9.51031 9.9987 9.67988 10.0689 9.8049 10.194C9.92993 10.319 10.0002 10.4886 10.0002 10.6654C10.0002 10.8422 9.92993 11.0117 9.8049 11.1368C9.67988 11.2618 9.51031 11.332 9.3335 11.332Z`}}]},fd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`info-icon`,ref:t,icon:dd}))});fd.displayName=`InfoIcon`;let pd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M9.80385 1.40005H11.9997C12.3311 1.40005 12.5997 1.66868 12.5997 2.00005C12.5997 2.33143 12.3311 2.60005 11.9997 2.60005H10.1185L7.12251 13.4001H9.33324C9.66461 13.4001 9.93324 13.6687 9.93324 14.0001C9.93324 14.3314 9.66461 14.6001 9.33324 14.6001H6.34785C6.33847 14.6003 6.32905 14.6003 6.31962 14.6001H3.9999C3.66853 14.6001 3.3999 14.3314 3.3999 14.0001C3.3999 13.6687 3.66853 13.4001 3.9999 13.4001H5.87719L8.87322 2.60005H6.66641C6.33504 2.60005 6.06641 2.33143 6.06641 2.00005C6.06641 1.66868 6.33504 1.40005 6.66641 1.40005H9.52916C9.61698 1.37929 9.71064 1.3781 9.80385 1.40005Z`}}]},md=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`italic-icon`,ref:t,icon:pd}))});md.displayName=`ItalicIcon`;let hd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M3.39986 6.33339C3.39986 6.00202 3.66849 5.73339 3.99986 5.73339H4.66652C4.99789 5.73339 5.26652 6.00202 5.26652 6.33339C5.26652 6.66476 4.99789 6.93339 4.66652 6.93339H3.99986C3.66849 6.93339 3.39986 6.66476 3.39986 6.33339Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M6.99986 5.73339C6.66849 5.73339 6.39986 6.00202 6.39986 6.33339C6.39986 6.66476 6.66849 6.93339 6.99986 6.93339H7.66652C7.99789 6.93339 8.26652 6.66476 8.26652 6.33339C8.26652 6.00202 7.99789 5.73339 7.66652 5.73339H6.99986Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M9.06636 6.33339C9.06636 6.00202 9.33499 5.73339 9.66636 5.73339H11.9997C12.3311 5.73339 12.5997 6.00202 12.5997 6.33339C12.5997 6.66476 12.3311 6.93339 11.9997 6.93339H9.66636C9.33499 6.93339 9.06636 6.66476 9.06636 6.33339Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M3.99986 8.73339C3.66849 8.73339 3.39986 9.00202 3.39986 9.33339C3.39986 9.66476 3.66849 9.93339 3.99986 9.93339H11.9999C12.3312 9.93339 12.5999 9.66476 12.5999 9.33339C12.5999 9.00202 12.3312 8.73339 11.9999 8.73339H3.99986Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M3.33338 1.73345L12.6667 1.7334C14.1026 1.73339 15.2667 2.89745 15.2667 4.3334V11C15.2667 12.4359 14.1027 13.6 12.6667 13.6H3.33355C1.89763 13.6 0.733583 12.4359 0.73355 11L0.733398 4.33351C0.733366 2.89755 1.89742 1.73346 3.33338 1.73345ZM12.6667 2.9334L3.33339 2.93345C2.56018 2.93346 1.93338 3.56028 1.9334 4.33348L1.93355 11C1.93357 11.7732 2.56036 12.4 3.33355 12.4H12.6667C13.4399 12.4 14.0667 11.7732 14.0667 11V4.3334C14.0667 3.5602 13.4399 2.93339 12.6667 2.9334Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},gd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`keyboard-icon`,ref:t,icon:hd}))});gd.displayName=`KeyboardIcon`;let _d={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M1.9999 1.89941C1.66853 1.89941 1.3999 2.16804 1.3999 2.49941C1.3999 2.83078 1.66853 3.09941 1.9999 3.09941H13.9999C14.3313 3.09941 14.5999 2.83078 14.5999 2.49941C14.5999 2.16804 14.3313 1.89941 13.9999 1.89941H1.9999Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.9999 5.56641C1.66853 5.56641 1.3999 5.83504 1.3999 6.16641C1.3999 6.49778 1.66853 6.76641 1.9999 6.76641H11.3332C11.6646 6.76641 11.9332 6.49778 11.9332 6.16641C11.9332 5.83504 11.6646 5.56641 11.3332 5.56641H1.9999Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.3999 9.8334C1.3999 9.50203 1.66853 9.2334 1.9999 9.2334H13.9999C14.3313 9.2334 14.5999 9.50203 14.5999 9.8334C14.5999 10.1648 14.3313 10.4334 13.9999 10.4334H1.9999C1.66853 10.4334 1.3999 10.1648 1.3999 9.8334Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.9999 12.9004C1.66853 12.9004 1.3999 13.169 1.3999 13.5004C1.3999 13.8318 1.66853 14.1004 1.9999 14.1004H11.3332C11.6646 14.1004 11.9332 13.8318 11.9332 13.5004C11.9332 13.169 11.6646 12.9004 11.3332 12.9004H1.9999Z`}}]},vd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`left-justifying-icon`,ref:t,icon:_d}))});vd.displayName=`LeftJustifyingIcon`;let yd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M1.3732 3.94019C0.82475 2.75718 2.04917 1.53276 3.23218 2.0812L10.0657 5.24921C10.3663 5.38859 10.497 5.74529 10.3576 6.04592C10.2183 6.34656 9.86157 6.47728 9.56094 6.33791L6.86664 5.08883L4.42613 7.52934C4.41111 7.54436 4.3955 7.55841 4.37936 7.5715L5.6299 10.2689C5.76928 10.5696 5.63855 10.9263 5.33791 11.0656C5.03728 11.205 4.68058 11.0743 4.54121 10.7737L1.3732 3.94019ZM2.72746 3.1699L5.70713 4.55128L3.84327 6.41514L2.46189 3.43547C2.38354 3.26647 2.55846 3.09155 2.72746 3.1699Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M4.56311 13.7359C4.32879 13.9702 4.32879 14.3501 4.56311 14.5844C4.79742 14.8188 5.17732 14.8188 5.41163 14.5844L13.3083 6.68776L13.3842 8.21165C13.4006 8.54261 13.6823 8.79755 14.0133 8.78108C14.3442 8.76461 14.5992 8.48295 14.5827 8.15199L14.4844 6.17786C14.4413 5.3118 13.3917 4.90732 12.7786 5.52046L4.56311 13.7359Z`}}]},bd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`left-rotation-forty-five-degrees-icon`,ref:t,icon:yd}))});bd.displayName=`LeftRotationFortyFiveDegreesIcon`;let xd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M11.4046 13.9395C11.4046 14.2708 11.6732 14.5395 12.0046 14.5395C12.336 14.5395 12.6046 14.2708 12.6046 13.9395V2.77186L13.7358 3.79578C13.9815 4.01815 14.3609 3.99927 14.5833 3.75359C14.8057 3.50792 14.7868 3.12849 14.5411 2.90612L13.0757 1.57967C12.4328 0.997761 11.4046 1.45394 11.4046 2.32106V13.9395Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M2.22244 9.26836C0.998116 8.81966 0.998119 7.08807 2.22245 6.63936L9.29456 4.04749C9.60569 3.93346 9.95036 4.09325 10.0644 4.40438C10.1784 4.71551 10.0186 5.06018 9.70749 5.1742L6.91911 6.19613V9.64753C6.91911 9.66877 6.918 9.68974 6.91585 9.71041L9.70749 10.7335C10.0186 10.8476 10.1784 11.1922 10.0644 11.5033C9.95036 11.8145 9.60569 11.9743 9.29456 11.8602L2.22244 9.26836ZM2.63538 7.76608L5.71911 6.63592V9.27181L2.63538 8.14165C2.46047 8.07755 2.46047 7.83018 2.63538 7.76608Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Sd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`left-rotation-ninety-degrees-icon`,ref:t,icon:xd}))});Sd.displayName=`LeftRotationNinetyDegreesIcon`;let Cd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M2.62402 7.72905C2.58427 7.72905 2.55205 7.76127 2.55205 7.80102V13.6782C2.55205 13.7179 2.58427 13.7502 2.62402 13.7502H13.3755C13.4152 13.7502 13.4474 13.7179 13.4474 13.6782V7.80102C13.4474 7.76127 13.4152 7.72905 13.3755 7.72905H2.62402ZM1.35205 7.80102C1.35205 7.09853 1.92153 6.52905 2.62402 6.52905H13.3755C14.0779 6.52905 14.6474 7.09853 14.6474 7.80102V13.6782C14.6474 14.3807 14.0779 14.9502 13.3755 14.9502H2.62402C1.92153 14.9502 1.35205 14.3807 1.35205 13.6782V7.80102Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M8 2.25005C6.69847 2.25003 5.64336 3.30513 5.64336 4.60666V7.12895C5.64336 7.46032 5.37473 7.72895 5.04336 7.72895C4.71199 7.72895 4.44336 7.46032 4.44336 7.12895V4.60666C4.44336 2.64239 6.04451 1.05565 8.00879 1.05566M8 2.25005L8.00879 1.05566L8 2.25005ZM8.00879 1.05566L8 2.25005C9.30154 2.25003 10.3567 3.30513 10.3567 4.60666V7.12895C10.3567 7.46032 10.6253 7.72895 10.9567 7.72895C11.288 7.72895 11.5567 7.46032 11.5567 7.12895V4.60666C11.5567 2.64239 9.97306 1.05565 8.00879 1.05566Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M8.00039 9.4668C8.33176 9.4668 8.60039 9.73543 8.60039 10.0668V12.0827C8.60039 12.4141 8.33176 12.6827 8.00039 12.6827C7.66902 12.6827 7.40039 12.4141 7.40039 12.0827V10.0668C7.40039 9.73543 7.66902 9.4668 8.00039 9.4668Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},wd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`lock-icon`,ref:t,icon:Cd}))});wd.displayName=`LockIcon`;let Td={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M1.66504 2.8666C1.66504 2.53523 1.93367 2.2666 2.26504 2.2666H13.735C14.0664 2.2666 14.335 2.53523 14.335 2.8666C14.335 3.19797 14.0664 3.4666 13.735 3.4666H2.26504C1.93367 3.4666 1.66504 3.19797 1.66504 2.8666Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.66504 8.00002C1.66504 7.66865 1.93367 7.40002 2.26504 7.40002H13.735C14.0664 7.40002 14.335 7.66865 14.335 8.00002C14.335 8.3314 14.0664 8.60002 13.735 8.60002H2.26504C1.93367 8.60002 1.66504 8.3314 1.66504 8.00002Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M2.26504 12.5334C1.93367 12.5334 1.66504 12.8021 1.66504 13.1334C1.66504 13.4648 1.93367 13.7334 2.26504 13.7334H13.735C14.0664 13.7334 14.335 13.4648 14.335 13.1334C14.335 12.8021 14.0664 12.5334 13.735 12.5334H2.26504Z`}}]},Ed=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`menu-icon`,ref:t,icon:Td}))});Ed.displayName=`MenuIcon`;let Dd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M12.5939 1.13916L10.6607 1.1392C9.5563 1.13922 8.66094 2.03448 8.66079 3.13893L8.66064 4.19191C8.6606 4.52328 8.92919 4.79194 9.26056 4.79199C9.59193 4.79204 9.8606 4.52344 9.86064 4.19207L9.86079 3.13909C9.86085 2.69731 10.219 2.33921 10.6608 2.3392L12.594 2.33916C13.0358 2.33915 13.394 2.69732 13.394 3.13916L13.394 7.40012H10.4947L11.0464 6.84845C11.2807 6.61414 11.2807 6.23424 11.0464 5.99993C10.8121 5.76561 10.4322 5.76561 10.1979 5.99993L9.31395 6.88384C8.68914 7.50867 8.68914 8.52171 9.31396 9.14654L10.1979 10.0305C10.4322 10.2648 10.8121 10.2648 11.0464 10.0305C11.2807 9.79614 11.2807 9.41624 11.0464 9.18192L10.4646 8.60012H13.394L13.394 12.8612C13.394 13.303 13.0359 13.6612 12.594 13.6612H10.6606C10.2188 13.6612 9.86064 13.303 9.86064 12.8612V11.8084C9.86064 11.4771 9.59202 11.2084 9.26064 11.2084C8.92927 11.2084 8.66064 11.4771 8.66064 11.8084V12.8612C8.66064 13.9658 9.55607 14.8612 10.6606 14.8612H12.594C13.6986 14.8612 14.594 13.9658 14.594 12.8612L14.594 8.0066L14.594 8.00012L14.594 7.99363L14.594 3.13915C14.594 2.03457 13.6985 1.13914 12.5939 1.13916Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M5.33889 1.13919L3.4057 1.13926C2.30115 1.13931 1.40576 2.03474 1.40578 3.13928L1.40582 7.99139L1.40576 8.00012L1.40582 8.00886L1.40587 12.8612C1.40588 13.9658 2.30131 14.8612 3.40587 14.8612H5.33897C6.44354 14.8612 7.33897 13.9658 7.33897 12.8612V11.8084C7.33897 11.4771 7.07034 11.2084 6.73897 11.2084C6.4076 11.2084 6.13897 11.4771 6.13897 11.8084V12.8612C6.13897 13.303 5.7808 13.6612 5.33897 13.6612H3.40587C2.96405 13.6612 2.60588 13.303 2.60587 12.8612L2.60583 8.60012H5.53538L4.95357 9.18193C4.71925 9.41624 4.71925 9.79614 4.95357 10.0305C5.18788 10.2648 5.56778 10.2648 5.8021 10.0305L6.68599 9.14656C7.31083 8.52172 7.31083 7.50866 6.68599 6.88382L5.8021 5.99993C5.56778 5.76561 5.18788 5.76561 4.95357 5.99993C4.71925 6.23424 4.71925 6.61414 4.95357 6.84845L5.50523 7.40012H2.60582L2.60578 3.13927C2.60577 2.69745 2.96393 2.33928 3.40574 2.33926L5.33894 2.33919C5.78078 2.33917 6.13897 2.69735 6.13897 3.13919V4.192C6.13897 4.52337 6.4076 4.792 6.73897 4.792C7.07034 4.792 7.33897 4.52337 7.33897 4.192V3.13919C7.33897 2.03459 6.44349 1.13914 5.33889 1.13919Z`}}]},Od=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`merge-all-icon`,ref:t,icon:Dd}))});Od.displayName=`MergeAllIcon`;let kd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M5 6.5L8 9.5L11 6.5`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.2}}]},Ad=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`more-down-icon`,ref:t,icon:kd}))});Ad.displayName=`MoreDownIcon`;let jd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M9.5 5L6.5 8L9.5 11`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.2}}]},Md=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`more-left-icon`,ref:t,icon:jd}))});Md.displayName=`MoreLeftIcon`;let Nd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M6.5 5L9.5 8L6.5 11`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.2}}]},Pd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`more-right-icon`,ref:t,icon:Nd}))});Pd.displayName=`MoreRightIcon`;let Fd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M7.1349 1.3999C6.80353 1.3999 6.5349 1.66853 6.5349 1.9999C6.5349 2.33127 6.80353 2.5999 7.1349 2.5999H7.67993V4.55065C7.67993 4.88203 7.94856 5.15065 8.27993 5.15065C8.6113 5.15065 8.87993 4.88203 8.87993 4.55065V2.5999H9.4049C9.73627 2.5999 10.0049 2.33127 10.0049 1.9999C10.0049 1.66853 9.73627 1.3999 9.4049 1.3999H7.1349Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M2.5999 7.1349C2.5999 6.80353 2.33127 6.5349 1.9999 6.5349C1.66853 6.5349 1.3999 6.80353 1.3999 7.1349V9.4049C1.3999 9.73627 1.66853 10.0049 1.9999 10.0049C2.33127 10.0049 2.5999 9.73627 2.5999 9.4049V8.86968H4.54992C4.88129 8.86968 5.14992 8.60105 5.14992 8.26968C5.14992 7.93831 4.88129 7.66968 4.54992 7.66968H2.5999V7.1349Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M15.1399 7.1349C15.1399 6.80353 14.8713 6.5349 14.5399 6.5349C14.2085 6.5349 13.9399 6.80353 13.9399 7.1349V7.66968H12.0099C11.6786 7.66968 11.4099 7.93831 11.4099 8.26968C11.4099 8.60105 11.6786 8.86968 12.0099 8.86968H13.9399V9.4049C13.9399 9.73627 14.2085 10.0049 14.5399 10.0049C14.8713 10.0049 15.1399 9.73627 15.1399 9.4049V8.27463L15.1399 8.26968L15.1399 8.26472V7.1349Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M7.1349 13.9399C6.80353 13.9399 6.5349 14.2085 6.5349 14.5399C6.5349 14.8713 6.80353 15.1399 7.1349 15.1399H8.24962C8.25966 15.1404 8.26977 15.1407 8.27993 15.1407C8.2901 15.1407 8.3002 15.1404 8.31024 15.1399H9.4049C9.73627 15.1399 10.0049 14.8713 10.0049 14.5399C10.0049 14.2085 9.73627 13.9399 9.4049 13.9399H8.87993V12.0107C8.87993 11.6793 8.6113 11.4107 8.27993 11.4107C7.94856 11.4107 7.67993 11.6793 7.67993 12.0107V13.9399H7.1349Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M2.60991 4.00967C2.60991 3.23647 3.23671 2.60967 4.00991 2.60967H4.33991C4.67128 2.60967 4.93991 2.34104 4.93991 2.00967C4.93991 1.6783 4.67128 1.40967 4.33991 1.40967H4.00991C2.57397 1.40967 1.40991 2.57373 1.40991 4.00967V4.33967C1.40991 4.67104 1.67854 4.93967 2.00991 4.93967C2.34128 4.93967 2.60991 4.67104 2.60991 4.33967V4.00967Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M12.1999 1.40967C11.8685 1.40967 11.5999 1.6783 11.5999 2.00967C11.5999 2.34104 11.8685 2.60967 12.1999 2.60967H12.5299C13.3031 2.60967 13.9299 3.23647 13.9299 4.00967V4.33967C13.9299 4.67104 14.1985 4.93967 14.5299 4.93967C14.8613 4.93967 15.1299 4.67104 15.1299 4.33967V4.00967C15.1299 2.57373 13.9659 1.40967 12.5299 1.40967H12.1999Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M2.60991 12.1997C2.60991 11.8683 2.34128 11.5997 2.00991 11.5997C1.67854 11.5997 1.40991 11.8683 1.40991 12.1997V12.5297C1.40991 13.9656 2.57397 15.1297 4.00991 15.1297H4.33991C4.67128 15.1297 4.93991 14.861 4.93991 14.5297C4.93991 14.1983 4.67128 13.9297 4.33991 13.9297H4.00991C3.23671 13.9297 2.60991 13.3029 2.60991 12.5297V12.1997Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M15.1299 12.1997C15.1299 11.8683 14.8613 11.5997 14.5299 11.5997C14.1985 11.5997 13.9299 11.8683 13.9299 12.1997V12.5297C13.9299 13.3029 13.3031 13.9297 12.5299 13.9297H12.1999C11.8685 13.9297 11.5999 14.1983 11.5999 14.5297C11.5999 14.861 11.8685 15.1297 12.1999 15.1297H12.5299C13.9659 15.1297 15.1299 13.9656 15.1299 12.5297V12.1997Z`}}]},Id=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`no-border-icon`,ref:t,icon:Fd}))});Id.displayName=`NoBorderIcon`;let Ld={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M6.671 2.24246C7.1197 1.01814 8.85129 1.01814 9.3 2.24246L11.8919 9.31458C12.0059 9.62571 11.8461 9.97038 11.535 10.0844C11.2238 10.1984 10.8792 10.0386 10.7652 9.72751L9.74324 6.93913H6.29183C6.2706 6.93913 6.24962 6.93802 6.22895 6.93587L5.20584 9.72751C5.09181 10.0386 4.74715 10.1984 4.43601 10.0844C4.12488 9.97038 3.96509 9.62571 4.07912 9.31458L6.671 2.24246ZM8.17328 2.6554L9.30345 5.73913H6.66755L7.79771 2.6554C7.86181 2.48049 8.10918 2.48049 8.17328 2.6554Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.9999 11.4246C1.66853 11.4246 1.3999 11.6933 1.3999 12.0246C1.3999 12.356 1.66853 12.6246 1.9999 12.6246H13.1675L12.1436 13.7558C11.9212 14.0015 11.9401 14.3809 12.1858 14.6033C12.4314 14.8257 12.8109 14.8068 13.0332 14.5611L14.3597 13.0957C14.9416 12.4528 14.4854 11.4246 13.6183 11.4246H1.9999Z`}}]},Rd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`no-rotation-icon`,ref:t,icon:Ld}))});Rd.displayName=`NoRotationIcon`;let zd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M7.9999 0.733154C8.33127 0.733154 8.5999 1.00178 8.5999 1.33315V5.33315C8.5999 5.66453 8.33127 5.93315 7.9999 5.93315C7.66853 5.93315 7.3999 5.66453 7.3999 5.33315V1.33315C7.3999 1.00178 7.66853 0.733154 7.9999 0.733154Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M2.46621 2.73315C2.79758 2.73315 3.06621 3.00178 3.06621 3.33315V12.6665C3.06621 12.9979 2.79758 13.2665 2.46621 13.2665C2.13484 13.2665 1.86621 12.9979 1.86621 12.6665V3.33315C1.86621 3.00178 2.13484 2.73315 2.46621 2.73315Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M5.3334 7.3999C5.00203 7.3999 4.7334 7.66853 4.7334 7.9999C4.7334 8.33127 5.00203 8.5999 5.3334 8.5999H12.603L11.9252 9.28591C11.6922 9.52163 11.6945 9.90152 11.9302 10.1344C12.166 10.3673 12.5458 10.3651 12.7788 10.1293L14.4577 8.43018C14.69 8.19509 14.6884 7.81641 14.4542 7.58324L12.7753 5.91184C12.5404 5.67806 12.1605 5.67891 11.9267 5.91375C11.6929 6.14859 11.6938 6.52849 11.9286 6.76228L12.5691 7.3999H5.3334Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M8.5999 10.6667C8.5999 10.3353 8.33127 10.0667 7.9999 10.0667C7.66853 10.0667 7.3999 10.3353 7.3999 10.6667V14.6667C7.3999 14.998 7.66853 15.2667 7.9999 15.2667C8.33127 15.2667 8.5999 14.998 8.5999 14.6667V10.6667Z`}}]},Bd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`overflow-icon`,ref:t,icon:zd}))});Bd.displayName=`OverflowIcon`;let Vd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M12.666 2.70571C11.7769 1.76476 10.3295 1.76476 9.4404 2.70571L3.37843 9.12427C3.31779 9.18848 3.27756 9.26409 3.24979 9.3439C3.24809 9.3493 3.24299 9.3529 3.24129 9.3583L2.02912 13.2097C1.96112 13.4251 2.01439 13.6633 2.16626 13.8236C2.27393 13.9382 2.41901 14 2.56692 14C2.62699 14 2.68762 13.9898 2.74599 13.9688L6.3825 12.6846C6.3876 12.6828 6.391 12.678 6.39553 12.6762C6.47147 12.6474 6.54287 12.6042 6.60351 12.54L12.666 6.12202C13.5558 5.18048 13.5558 3.64725 12.666 2.70571ZM8.62832 5.26209L9.04031 5.69836C9.03918 5.69956 9.03748 5.70016 9.03634 5.70136L4.99182 9.9836L4.58096 9.54853L8.62832 5.26209ZM3.46287 12.4512L4.02673 10.6593L5.15446 11.8535L3.46287 12.4512ZM6.20342 11.2672L5.79256 10.8321L9.83709 6.54988C9.83822 6.54868 9.83879 6.54688 9.83992 6.54568L10.2513 6.98135L6.20342 11.2672ZM11.8647 5.27349L11.0532 6.13282L9.42963 4.41356L10.2411 3.55423C10.6888 3.08016 11.417 3.08076 11.8642 3.55423C12.3124 4.0283 12.3124 4.79942 11.8647 5.27349Z`}}]},Hd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`pen-icon`,ref:t,icon:Vd}))});Hd.displayName=`PenIcon`;let Ud={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M14.2638 7.63727V3.9999C14.2638 2.89533 13.3683 1.9999 12.2638 1.9999L3.56389 1.99999C2.45932 2 1.56392 2.89542 1.56392 3.99998L1.56387 11.6666C1.56386 12.7712 2.4593 13.6666 3.56387 13.6666H8.0542`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.2}},{tag:`path`,attrs:{stroke:`currentColor`,d:`M1.5639 6.17762H14.2638M5.79725 1.99996V6.17762M10.0307 1.99993V6.17762`,strokeWidth:1.2}},{tag:`path`,attrs:{stroke:`currentColor`,d:`M11.5223 11.2333V10.2333C11.5223 9.681 11.97 9.23328 12.5223 9.23328C13.0746 9.23328 13.5223 9.681 13.5223 10.2333V11.2333`,strokeLinecap:`round`,strokeWidth:1.2}},{tag:`rect`,attrs:{width:4,height:2.67,x:10.52,y:11.23,stroke:`currentColor`,rx:1,strokeWidth:1.2}}]},Wd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`protect-icon`,ref:t,icon:Ud}))});Wd.displayName=`ProtectIcon`;let Gd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M1.9999 1.89941C1.66853 1.89941 1.3999 2.16804 1.3999 2.49941C1.3999 2.83078 1.66853 3.09941 1.9999 3.09941H13.9999C14.3313 3.09941 14.5999 2.83078 14.5999 2.49941C14.5999 2.16804 14.3313 1.89941 13.9999 1.89941H1.9999Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M4.66665 5.56641C4.33528 5.56641 4.06665 5.83504 4.06665 6.16641C4.06665 6.49778 4.33528 6.76641 4.66665 6.76641H14C14.3314 6.76641 14.6 6.49778 14.6 6.16641C14.6 5.83504 14.3314 5.56641 14 5.56641H4.66665Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.3999 9.8334C1.3999 9.50203 1.66853 9.2334 1.9999 9.2334H13.9999C14.3313 9.2334 14.5999 9.50203 14.5999 9.8334C14.5999 10.1648 14.3313 10.4334 13.9999 10.4334H1.9999C1.66853 10.4334 1.3999 10.1648 1.3999 9.8334Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M4.66665 12.9004C4.33528 12.9004 4.06665 13.169 4.06665 13.5004C4.06665 13.8318 4.33528 14.1004 4.66665 14.1004H14C14.3314 14.1004 14.6 13.8318 14.6 13.5004C14.6 13.169 14.3314 12.9004 14 12.9004H4.66665Z`}}]},Kd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`right-justifying-icon`,ref:t,icon:Gd}))});Kd.displayName=`RightJustifyingIcon`;let qd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M12.1994 1.49307C13.3824 0.944623 14.6068 2.16904 14.0584 3.35206L10.8904 10.1855C10.751 10.4862 10.3943 10.6169 10.0937 10.4775C9.79302 10.3381 9.66229 9.98144 9.80166 9.68081L11.0507 6.98651L8.61023 4.546C8.59522 4.53098 8.58116 4.51537 8.56807 4.49924L5.87063 5.74977C5.57 5.88915 5.2133 5.75842 5.07392 5.45779C4.93455 5.15715 5.06528 4.80045 5.36591 4.66108L12.1994 1.49307ZM12.9697 2.84734L11.5883 5.82701L9.72443 3.96315L12.7041 2.58177C12.8731 2.50342 13.048 2.67833 12.9697 2.84734Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M2.40366 4.68273C2.16934 4.44842 1.78945 4.44842 1.55513 4.68273C1.32082 4.91705 1.32082 5.29695 1.55513 5.53126L9.45182 13.4279L7.92792 13.5038C7.59696 13.5203 7.34202 13.8019 7.35849 14.1329C7.37497 14.4639 7.65662 14.7188 7.98758 14.7023L9.96172 14.6041C10.8278 14.5609 11.2323 13.5113 10.6191 12.8982L2.40366 4.68273Z`}}]},Jd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`right-rotation-forty-five-degrees-icon`,ref:t,icon:qd}))});Jd.displayName=`RightRotationFortyFiveDegreesIcon`;let Yd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`g`,attrs:{fill:`currentColor`},children:[{tag:`path`,attrs:{d:`M11.4046 13.9395C11.4046 14.2708 11.6732 14.5395 12.0046 14.5395C12.336 14.5395 12.6046 14.2708 12.6046 13.9395V2.77186L13.7358 3.79578C13.9815 4.01815 14.3609 3.99927 14.5833 3.75359C14.8057 3.50792 14.7868 3.12849 14.5411 2.90612L13.0757 1.57967C12.4328 0.997761 11.4046 1.45394 11.4046 2.32106V13.9395Z`,transform:`rotate(180 8 8)`}},{tag:`path`,attrs:{d:`M2.22244 9.26836C0.998116 8.81966 0.998119 7.08807 2.22245 6.63936L9.29456 4.04749C9.60569 3.93346 9.95036 4.09325 10.0644 4.40438C10.1784 4.71551 10.0186 5.06018 9.70749 5.1742L6.91911 6.19613V9.64753C6.91911 9.66877 6.918 9.68974 6.91585 9.71041L9.70749 10.7335C10.0186 10.8476 10.1784 11.1922 10.0644 11.5033C9.95036 11.8145 9.60569 11.9743 9.29456 11.8602L2.22244 9.26836ZM2.63538 7.76608L5.71911 6.63592V9.27181L2.63538 8.14165C2.46047 8.07755 2.46047 7.83018 2.63538 7.76608Z`,transform:`rotate(180 8 8)`,fillRule:`evenodd`,clipRule:`evenodd`}}]}]},Xd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`right-rotation-ninety-degrees-icon`,ref:t,icon:Yd}))});Xd.displayName=`RightRotationNinetyDegreesIcon`;let Zd={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M5.4 13.5L7.65 2.8C7.73 2.4 8.27 2.4 8.35 2.8L10.6 13.5M6.2 9.7H9.8`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.3}},{tag:`path`,attrs:{stroke:`currentColor`,d:`M1.5 8H4.3M3.2 6.9L4.3 8L3.2 9.1M14.5 8H11.7M12.8 6.9L11.7 8L12.8 9.1`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.2}}]},Qd=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`shrink-to-fit-icon`,ref:t,icon:Zd}))});Qd.displayName=`ShrinkToFitIcon`;let $d={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M8.00033 1.20996C6.43345 1.20996 5.23596 1.88077 4.64804 2.94304C4.06338 3.99943 4.15123 5.32084 4.90099 6.47062C5.08199 6.7482 5.45374 6.82648 5.73131 6.64548C6.00888 6.46448 6.08716 6.09273 5.90616 5.81516C5.36418 4.98402 5.35768 4.13897 5.69797 3.52412C6.035 2.91515 6.78176 2.40996 8.00033 2.40996C9.19423 2.40996 10.0017 2.93409 10.5236 3.46755C10.7871 3.73682 10.9756 4.00712 11.0974 4.20903C11.158 4.30951 11.2013 4.39164 11.2284 4.44625C11.2419 4.47351 11.2514 4.49377 11.2568 4.50588L11.2621 4.51771C11.3901 4.82216 11.7407 4.96686 12.046 4.83992C12.3519 4.71267 12.4968 4.36149 12.3695 4.05552L11.8231 4.28278C12.3695 4.05552 12.3697 4.0558 12.3695 4.05552L12.3691 4.05437L12.3685 4.05298L12.367 4.04953L12.3629 4.03993L12.3498 4.01036C12.3388 3.98619 12.3234 3.95326 12.3033 3.91282C12.2632 3.83203 12.2043 3.72072 12.1249 3.58908C11.9666 3.32674 11.7235 2.97805 11.3814 2.62834C10.6921 1.92381 9.59192 1.20996 8.00033 1.20996Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M2.11953 8.5999H7.88935C10.1109 9.46549 10.5895 10.7649 10.4268 11.6869C10.2475 12.703 9.26939 13.5898 8.00009 13.5898C6.63323 13.5898 5.77631 13.0502 5.25534 12.528C4.99021 12.2623 4.80823 11.9965 4.69365 11.7993C4.63659 11.7011 4.59698 11.6211 4.5727 11.5686C4.56059 11.5424 4.55236 11.5231 4.54774 11.512L4.54352 11.5016C4.4267 11.193 4.0823 11.0363 3.77279 11.1516C3.46228 11.2673 3.30438 11.6129 3.4201 11.9234L3.9649 11.7203C3.4201 11.9234 3.41998 11.9231 3.4201 11.9234L3.4206 11.9247L3.42118 11.9263L3.42262 11.9301L3.42661 11.9403C3.42977 11.9484 3.43394 11.9588 3.43914 11.9713C3.44956 11.9965 3.46418 12.0304 3.48334 12.0719C3.52161 12.1547 3.57828 12.2682 3.65608 12.4021C3.81124 12.6692 4.0534 13.0223 4.40584 13.3756C5.12 14.0914 6.27196 14.7898 8.00009 14.7898C9.82574 14.7898 11.3236 13.5101 11.6085 11.8955C11.812 10.7422 11.3901 9.55402 10.2665 8.5999H13.8804C14.2117 8.5999 14.4803 8.33127 14.4803 7.9999C14.4803 7.66853 14.2117 7.3999 13.8804 7.3999H8.01411C8.0048 7.39968 7.99551 7.39969 7.98625 7.3999H2.11953C1.78816 7.3999 1.51953 7.66853 1.51953 7.9999C1.51953 8.33127 1.78816 8.5999 2.11953 8.5999Z`}}]},ef=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`strikethrough-icon`,ref:t,icon:$d}))});ef.displayName=`StrikethroughIcon`;let tf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 17`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M2.08596 14.1387L10.3379 2.66873`,strokeLinecap:`round`,strokeWidth:1.2}},{tag:`path`,attrs:{stroke:`currentColor`,d:`M10.3379 14.1387L2.08596 2.66873`,strokeLinecap:`round`,strokeWidth:1.2}},{tag:`path`,attrs:{stroke:`currentColor`,d:`M12.8098 10.0174C13.4565 9.45285 14.781 9.44507 15.0272 10.5759C15.2798 11.736 13.8101 13.2515 12.7376 14.1033C12.7227 14.1151 12.7315 14.1389 12.7505 14.1388L15.2251 14.1388`,strokeLinecap:`round`,strokeWidth:1.2}}]},nf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`subscript-icon`,ref:t,icon:tf}))});nf.displayName=`SubscriptIcon`;let rf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 17`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M2.10904 14.4537L10.299 3.06987`,strokeLinecap:`round`,strokeWidth:1.2}},{tag:`path`,attrs:{stroke:`currentColor`,d:`M10.2989 14.4537L2.10899 3.06987`,strokeLinecap:`round`,strokeWidth:1.2}},{tag:`path`,attrs:{stroke:`currentColor`,d:`M12.7525 3.35933C13.3943 2.79901 14.7089 2.79129 14.9533 3.91363C15.204 5.06487 13.7456 6.56876 12.6812 7.41429C12.6663 7.4261 12.6751 7.44982 12.6941 7.44982L15.1497 7.44977`,strokeLinecap:`round`,strokeWidth:1.2}}]},af=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`superscript-icon`,ref:t,icon:rf}))});af.displayName=`SuperscriptIcon`;let of={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M2.21572 1.80029C2.54709 1.80029 2.81572 2.06892 2.81572 2.40029V14.0003C2.81572 14.3317 2.54709 14.6003 2.21572 14.6003C1.88435 14.6003 1.61572 14.3317 1.61572 14.0003V2.40029C1.61572 2.06892 1.88435 1.80029 2.21572 1.80029Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M13.7841 1.80029C14.1155 1.80029 14.3841 2.06892 14.3841 2.40029V14.0003C14.3841 14.3317 14.1155 14.6003 13.7841 14.6003C13.4527 14.6003 13.1841 14.3317 13.1841 14.0003V8.60259H7.13467C6.8033 8.60259 6.53467 8.33396 6.53467 8.00259C6.53467 7.67122 6.8033 7.40259 7.13467 7.40259H13.1841V2.40029C13.1841 2.06892 13.4527 1.80029 13.7841 1.80029Z`}}]},sf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`truncation-icon`,ref:t,icon:of}))});sf.displayName=`TruncationIcon`;let cf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M4.46416 2.03237C4.46416 1.701 4.19553 1.43237 3.86416 1.43237C3.53279 1.43237 3.26416 1.701 3.26416 2.03237V7.33338C3.26416 10.0313 5.35834 12.2667 7.9999 12.2667C10.6415 12.2667 12.7356 10.0313 12.7356 7.33338V2.03237C12.7356 1.701 12.467 1.43237 12.1356 1.43237C11.8043 1.43237 11.5356 1.701 11.5356 2.03237V7.33338C11.5356 9.42194 9.92656 11.0667 7.9999 11.0667C6.07325 11.0667 4.46416 9.42194 4.46416 7.33338V2.03237Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M2.66641 13.4663C2.33504 13.4663 2.06641 13.7349 2.06641 14.0663C2.06641 14.3977 2.33504 14.6663 2.66641 14.6663H13.3331C13.6644 14.6663 13.9331 14.3977 13.9331 14.0663C13.9331 13.7349 13.6644 13.4663 13.3331 13.4663H2.66641Z`}}]},lf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`underline-icon`,ref:t,icon:cf}))});lf.displayName=`UnderlineIcon`;let uf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M7.9999 0.733398C8.33127 0.733398 8.5999 1.00203 8.5999 1.3334V4.55137L9.57564 3.57564C9.80995 3.34132 10.1899 3.34132 10.4242 3.57564C10.6585 3.80995 10.6585 4.18985 10.4242 4.42417L8.42417 6.42417C8.18985 6.65848 7.80995 6.65848 7.57564 6.42417L5.57564 4.42417C5.34132 4.18985 5.34132 3.80995 5.57564 3.57564C5.80995 3.34132 6.18985 3.34132 6.42417 3.57564L7.3999 4.55137V1.3334C7.3999 1.00203 7.66853 0.733398 7.9999 0.733398Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M5.57564 11.5756L7.57564 9.57564C7.80995 9.34132 8.18985 9.34132 8.42417 9.57564L10.4242 11.5756C10.6585 11.81 10.6585 12.1899 10.4242 12.4242C10.1899 12.6585 9.80995 12.6585 9.57564 12.4242L8.5999 11.4484V14.6665C8.5999 14.9979 8.33127 15.2665 7.9999 15.2665C7.66853 15.2665 7.3999 14.9979 7.3999 14.6665V11.4484L6.42417 12.4242C6.18985 12.6585 5.80995 12.6585 5.57564 12.4242C5.34132 12.1899 5.34132 11.81 5.57564 11.5756Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.9999 7.40015C1.66853 7.40015 1.3999 7.66878 1.3999 8.00015C1.3999 8.33152 1.66853 8.60015 1.9999 8.60015H13.9999C14.3313 8.60015 14.5999 8.33152 14.5999 8.00015C14.5999 7.66878 14.3313 7.40015 13.9999 7.40015H1.9999Z`}}]},df=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`vertical-center-icon`,ref:t,icon:uf}))});df.displayName=`VerticalCenterIcon`;let ff={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 17`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M2.2157 2.90265C2.2157 2.16628 2.81264 1.56934 3.54901 1.56934H6.21565C6.95202 1.56934 7.54896 2.16628 7.54896 2.90265V13.5692C7.54896 14.3056 6.95202 14.9025 6.21565 14.9025H3.54901C2.81264 14.9025 2.2157 14.3056 2.2157 13.5692V2.90265ZM3.54901 2.90265H6.21565V5.5622H3.54901V2.90265ZM3.54901 6.89552V9.57631H6.21565V6.89552H3.54901ZM3.54901 13.5692V10.9096H6.21565V13.5692H3.54901Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M10.2156 2.90265C10.2156 2.16628 10.8125 1.56934 11.5489 1.56934H14.2155C14.9519 1.56934 15.5489 2.16628 15.5489 2.90265V13.5692C15.5489 14.3056 14.9519 14.9025 14.2155 14.9025H11.5489C10.8125 14.9025 10.2156 14.3056 10.2156 13.5692V2.90265ZM11.5489 2.90265H14.2155V5.5622H11.5489V2.90265ZM11.5489 6.89552V9.57631H14.2155V6.89552H11.5489ZM11.5489 13.5692V10.9096H14.2155V13.5692H11.5489Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},pf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`vertical-integration-icon`,ref:t,icon:ff}))});pf.displayName=`VerticalIntegrationIcon`;let mf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M4.55504 2.73208C4.55504 2.40071 4.28641 2.13208 3.95504 2.13208C3.62367 2.13208 3.35504 2.40071 3.35504 2.73208V12.5172L2.21439 11.5276C1.96409 11.3104 1.58515 11.3373 1.36799 11.5876C1.15084 11.8379 1.17771 12.2169 1.42801 12.434L2.89972 13.7108C3.54718 14.2726 4.55504 13.8127 4.55504 12.9555L4.55504 2.73208Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M9.00725 4.01095C9.45595 2.78663 11.1875 2.78662 11.6362 4.01095L14.743 12.488C14.8571 12.7992 14.6973 13.1438 14.3861 13.2578C14.075 13.3719 13.7303 13.2121 13.6163 12.9009L12.4148 9.62242H8.36729C8.32154 9.62242 8.27699 9.6173 8.23417 9.6076L7.02719 12.9009C6.91316 13.2121 6.5685 13.3719 6.25736 13.2578C5.94623 13.1438 5.78644 12.7992 5.90047 12.488L9.00725 4.01095ZM10.5095 4.42388L11.975 8.42242H8.66853L10.134 4.42389C10.1981 4.24898 10.4454 4.24898 10.5095 4.42388Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},hf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`vertical-text-icon`,ref:t,icon:mf}))});hf.displayName=`VerticalTextIcon`;let gf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM8.00008 12.3671C8.46031 12.3671 8.83342 11.994 8.83342 11.5338C8.83342 11.0735 8.46031 10.7004 8.00008 10.7004C7.53985 10.7004 7.16675 11.0735 7.16675 11.5338C7.16675 11.994 7.53985 12.3671 8.00008 12.3671ZM8.5999 4.4335C8.5999 4.10213 8.33127 3.8335 7.9999 3.8335C7.66853 3.8335 7.3999 4.10213 7.3999 4.4335V9.36683C7.3999 9.6982 7.66853 9.96683 7.9999 9.96683C8.33127 9.96683 8.5999 9.6982 8.5999 9.36683V4.4335Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},_f=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`warning-icon`,ref:t,icon:gf}))});_f.displayName=`WarningIcon`;let vf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M12.6551 1.98906C11.7476 1.08113 10.2757 1.08149 9.3686 1.98987L4.82542 6.53955C4.75087 6.61421 4.69336 6.70411 4.65682 6.80309L3.2461 10.625C3.16506 10.8446 3.21909 11.0912 3.3845 11.2568C3.54991 11.4224 3.79651 11.4767 4.01616 11.3959L7.85031 9.98517C7.94979 9.94856 8.04014 9.89077 8.11508 9.81579L12.6552 5.27327C13.5618 4.36621 13.5618 2.89607 12.6551 1.98906ZM10.2177 2.83779C10.6562 2.39869 11.3677 2.39851 11.8064 2.8374C12.2447 3.27584 12.2447 3.9865 11.8065 4.42497L7.3392 8.89457L4.82213 9.82068L5.74706 7.31487L10.2177 2.83779Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.79238 13.2999C1.46101 13.2999 1.19238 13.5685 1.19238 13.8999C1.19238 14.2313 1.46101 14.4999 1.79238 14.4999H14.4924C14.8238 14.4999 15.0924 14.2313 15.0924 13.8999C15.0924 13.5685 14.8238 13.2999 14.4924 13.2999H1.79238Z`}}]},yf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`write-icon`,ref:t,icon:vf}))});yf.displayName=`WriteIcon`;let bf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`g`,attrs:{stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.2},children:[{tag:`circle`,attrs:{cx:7,cy:7,r:5.2}},{tag:`path`,attrs:{d:`M10.8 10.8L14.2 14.2M5 7H9M7 5V9`}}]}]},xf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`zoom-in-icon`,ref:t,icon:bf}))});xf.displayName=`ZoomInIcon`;let Sf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`#14B8A6`,d:`M3.4535 1.12549C2.7002 1.12549 2.08954 1.73615 2.08954 2.48945V13.5104C2.08954 14.2637 2.7002 14.8744 3.4535 14.8744H12.5465C13.2998 14.8744 13.9105 14.2637 13.9105 13.5104V5.0992L10.0091 1.12549H3.4535Z`}},{tag:`path`,attrs:{fill:`#0E9284`,d:`M10.0075 1.12549L13.9104 5.09842H10.6742C10.306 5.09842 10.0075 4.79994 10.0075 4.43175V1.12549Z`}},{tag:`path`,attrs:{fill:`white`,d:`M7.9 6.55C6.24437 6.55 4.9 7.10222 4.9 7.78333V11.0167C4.9 11.6978 6.24437 12.25 7.9 12.25C9.55563 12.25 10.9 11.6978 10.9 11.0167V7.78333C10.9 7.10222 9.55563 6.55 7.9 6.55Z`}},{tag:`path`,attrs:{fill:`#14B8A6`,d:`M5.05 8.42C5.671 8.72 6.709 8.89 7.9 8.89C9.091 8.89 10.129 8.72 10.75 8.42V9.02C10.129 9.32 9.091 9.49 7.9 9.49C6.709 9.49 5.671 9.32 5.05 9.02V8.42Z`}},{tag:`path`,attrs:{fill:`#14B8A6`,d:`M5.05 10.02C5.671 10.32 6.709 10.49 7.9 10.49C9.091 10.49 10.129 10.32 10.75 10.02V10.62C10.129 10.92 9.091 11.09 7.9 11.09C6.709 11.09 5.671 10.92 5.05 10.62V10.02Z`}}]},Cf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`bases-multi-icon`,ref:t,icon:Sf}))});Cf.displayName=`BasesMultiIcon`;let wf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`#8B5CF6`,d:`M3.4535 1.12549C2.7002 1.12549 2.08954 1.73615 2.08954 2.48945V13.5104C2.08954 14.2637 2.7002 14.8744 3.4535 14.8744H12.5465C13.2998 14.8744 13.9105 14.2637 13.9105 13.5104V5.0992L10.0091 1.12549H3.4535Z`}},{tag:`path`,attrs:{fill:`#6D3FE8`,d:`M10.0075 1.12549L13.9104 5.09842H10.6742C10.306 5.09842 10.0075 4.79994 10.0075 4.43175V1.12549Z`}},{tag:`path`,attrs:{fill:`white`,d:`M5 7.45H10.8V11.65H5V7.45ZM5.8 8.25V10.85H10V8.25H5.8Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`white`,d:`M5.8 6.25H7.25V7H5.8V6.25Z`}},{tag:`path`,attrs:{fill:`white`,d:`M8.55 6.25H10V7H8.55V6.25Z`}}]},Tf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`boards-multi-icon`,ref:t,icon:wf}))});Tf.displayName=`BoardsMultiIcon`;let Ef={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`#4B7DFF`,d:`M3.4535 1.12549C2.7002 1.12549 2.08954 1.73615 2.08954 2.48945V13.5104C2.08954 14.2637 2.7002 14.8744 3.4535 14.8744H12.5465C13.2998 14.8744 13.9105 14.2637 13.9105 13.5104V5.0992L10.0091 1.12549H3.4535Z`}},{tag:`path`,attrs:{fill:`#305CFA`,d:`M10.0075 1.12549L13.9104 5.09842H10.6742C10.306 5.09842 10.0075 4.79994 10.0075 4.43175V1.12549Z`}},{tag:`path`,attrs:{fill:`white`,d:`M4.57245 7.27962C4.57245 7.09553 4.72169 6.94629 4.90578 6.94629H10.2391C10.4232 6.94629 10.5724 7.09553 10.5724 7.27962C10.5724 7.46372 10.4232 7.61296 10.2391 7.61296H4.90578C4.72169 7.61296 4.57245 7.46372 4.57245 7.27962Z`}},{tag:`path`,attrs:{fill:`white`,d:`M4.57245 9.62638C4.57245 9.44229 4.72169 9.29305 4.90578 9.29305H10.2391C10.4232 9.29305 10.5724 9.44229 10.5724 9.62638C10.5724 9.81048 10.4232 9.95972 10.2391 9.95972H4.90578C4.72169 9.95972 4.57245 9.81048 4.57245 9.62638Z`}},{tag:`path`,attrs:{fill:`white`,d:`M4.90578 11.6398C4.72169 11.6398 4.57245 11.789 4.57245 11.9731C4.57245 12.1572 4.72169 12.3065 4.90578 12.3065H7.57245C7.75654 12.3065 7.90578 12.1572 7.90578 11.9731C7.90578 11.789 7.75654 11.6398 7.57245 11.6398H4.90578Z`}}]},Df=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`docs-multi-icon`,ref:t,icon:Ef}))});Df.displayName=`DocsMultiIcon`;let Of={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`#35BD4B`,d:`M3.4535 1.12549C2.7002 1.12549 2.08954 1.73615 2.08954 2.48945V13.5104C2.08954 14.2637 2.7002 14.8744 3.4535 14.8744H12.5465C13.2998 14.8744 13.9105 14.2637 13.9105 13.5104V5.0992L10.0091 1.12549H3.4535Z`}},{tag:`path`,attrs:{fill:`#32A846`,d:`M10.0075 1.12549L13.9104 5.09842H10.6742C10.306 5.09842 10.0075 4.79994 10.0075 4.43175V1.12549Z`}},{tag:`path`,attrs:{fill:`white`,d:`M4.7 7.05H11.1V12.05H4.7V7.05ZM5.5 7.85V9.2H7.35V7.85H5.5ZM8.15 7.85V9.2H10.3V7.85H8.15ZM5.5 10V11.25H7.35V10H5.5ZM8.15 10V11.25H10.3V10H8.15Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},kf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`sheets-multi-icon`,ref:t,icon:Of}))});kf.displayName=`SheetsMultiIcon`;let Af={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`#FF6B4B`,d:`M3.4535 1.12549C2.7002 1.12549 2.08954 1.73615 2.08954 2.48945V13.5104C2.08954 14.2637 2.7002 14.8744 3.4535 14.8744H12.5465C13.2998 14.8744 13.9105 14.2637 13.9105 13.5104V5.0992L10.0091 1.12549H3.4535Z`}},{tag:`path`,attrs:{fill:`#EC4F2D`,d:`M10.0075 1.12549L13.9104 5.09842H10.6742C10.306 5.09842 10.0075 4.79994 10.0075 4.43175V1.12549Z`}},{tag:`path`,attrs:{fill:`white`,d:`M7.76493 7.24535C7.76493 7.07967 7.63024 6.94371 7.46548 6.96123C7.01146 7.00953 6.57426 7.16714 6.19216 7.42245C5.72662 7.73351 5.36378 8.17564 5.14951 8.69292C4.93525 9.2102 4.87918 9.77941 4.98842 10.3285C5.09765 10.8777 5.36727 11.3821 5.76318 11.778C6.15909 12.1739 6.66351 12.4436 7.21265 12.5528C7.76179 12.662 8.33099 12.606 8.84828 12.3917C9.36556 12.1774 9.80769 11.8146 10.1188 11.349C10.3741 10.9669 10.5317 10.5297 10.58 10.0757C10.5975 9.91096 10.4615 9.77627 10.2958 9.77627L8.06493 9.77627C7.89925 9.77627 7.76493 9.64195 7.76493 9.47627L7.76493 7.24535Z`}},{tag:`path`,attrs:{fill:`white`,d:`M10.4097 9.35206C10.5753 9.35206 10.7115 9.21728 10.6918 9.05277C10.6645 8.82511 10.6062 8.60178 10.5181 8.38909C10.3917 8.08379 10.2063 7.80639 9.97264 7.57272C9.73897 7.33905 9.46157 7.1537 9.15627 7.02724C8.94358 6.93914 8.72024 6.88083 8.49259 6.85356C8.32808 6.83385 8.1933 6.97001 8.1933 7.13569V9.05206C8.1933 9.21774 8.32761 9.35206 8.4933 9.35206H10.4097Z`}}]},jf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`slides-multi-icon`,ref:t,icon:Af}))});jf.displayName=`SlidesMultiIcon`;let Mf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`colorChannel1`,d:`M8.60231 5.77597L9.38125 6.55432C9.61658 6.78947 9.99797 6.78932 10.2331 6.554C10.4683 6.31867 10.4681 5.93728 10.2328 5.70214L8.44939 3.92009C8.33908 3.79657 8.1786 3.7188 7.99995 3.7188C7.84562 3.71861 7.6906 3.77736 7.57281 3.89506L5.76712 5.69933C5.5318 5.93447 5.53165 6.31587 5.76679 6.55119C6.00193 6.78652 6.38332 6.78667 6.61865 6.55153L7.3976 5.77319L7.3976 10.2246L6.61865 9.44621C6.38333 9.21107 6.00194 9.21121 5.76679 9.44654C5.53165 9.68186 5.53179 10.0633 5.76712 10.2984L7.55051 12.0804C7.66082 12.204 7.82131 12.2817 7.99995 12.2817L8.00089 12.2817C8.15512 12.2819 8.30939 12.2231 8.4271 12.1055L10.2328 10.3012C10.4681 10.0661 10.4683 9.68467 10.2331 9.44934C9.99798 9.21402 9.61659 9.21387 9.38126 9.44901L8.60231 10.2274L8.60231 5.77597Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M13.7039 3.24701C14.0539 3.24701 14.3377 2.96327 14.3377 2.61325C14.3377 2.26324 14.0539 1.97949 13.7039 1.97949L2.29627 1.97949C1.94625 1.97949 1.66251 2.26324 1.66251 2.61325C1.66251 2.96327 1.94625 3.24701 2.29627 3.24701L13.7039 3.24701Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M13.7039 14.0209C14.0539 14.0209 14.3377 13.7372 14.3377 13.3872C14.3377 13.0371 14.0539 12.7534 13.7039 12.7534L2.29627 12.7534C1.94625 12.7534 1.66251 13.0371 1.66251 13.3872C1.66251 13.7372 1.94625 14.0209 2.29627 14.0209L13.7039 14.0209Z`}}]},Nf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`adjust-height-double-icon`,ref:t,icon:Mf}))});Nf.displayName=`AdjustHeightDoubleIcon`;let Pf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`colorChannel1`,d:`M5.77574 7.3974L6.5541 6.61846C6.78924 6.38313 6.78909 6.00174 6.55377 5.7666C6.31844 5.53145 5.93705 5.5316 5.70191 5.76692L3.91987 7.55032C3.79634 7.66063 3.71857 7.82111 3.71857 7.99976C3.71838 8.15409 3.77713 8.30912 3.89483 8.42691L5.6991 10.2326C5.93425 10.4679 6.31564 10.4681 6.55096 10.2329C6.78629 9.99778 6.78644 9.61639 6.5513 9.38106L5.77296 8.60211L10.2243 8.60211L9.44598 9.38106C9.21084 9.61638 9.21099 9.99777 9.44631 10.2329C9.68164 10.4681 10.063 10.4679 10.2982 10.2326L12.0802 8.4492C12.2037 8.33889 12.2815 8.1784 12.2815 7.99976L12.2815 7.99882C12.2816 7.84459 12.2229 7.69032 12.1052 7.57261L10.301 5.76693C10.0658 5.5316 9.68444 5.53145 9.44911 5.76659C9.21379 6.00173 9.21364 6.38312 9.44878 6.61845L10.2271 7.3974L5.77574 7.3974Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M3.24683 2.29598C3.24683 1.94596 2.96308 1.66222 2.61307 1.66222C2.26305 1.66222 1.97931 1.94596 1.97931 2.29598L1.97931 13.7036C1.97931 14.0537 2.26305 14.3374 2.61307 14.3374C2.96308 14.3374 3.24683 14.0537 3.24683 13.7036L3.24683 2.29598Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M14.0207 2.29598C14.0207 1.94596 13.737 1.66222 13.387 1.66222C13.037 1.66222 12.7532 1.94596 12.7532 2.29598L12.7532 13.7036C12.7532 14.0537 13.037 14.3374 13.387 14.3374C13.737 14.3374 14.0207 14.0537 14.0207 13.7036L14.0207 2.29598Z`}}]},Ff=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`adjust-width-double-icon`,ref:t,icon:Pf}))});Ff.displayName=`AdjustWidthDoubleIcon`;let If={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M2.29713 1.98047C1.94717 1.98047 1.66348 2.26416 1.66348 2.61412C1.66348 2.96408 1.94717 3.24777 2.29713 3.24777H13.7028C14.0528 3.24777 14.3365 2.96408 14.3365 2.61412C14.3365 2.26416 14.0528 1.98047 13.7028 1.98047H2.29713Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M2.29713 12.7525C1.94717 12.7525 1.66348 13.0362 1.66348 13.3862C1.66348 13.7361 1.94717 14.0198 2.29713 14.0198H13.7028C14.0528 14.0198 14.3365 13.7361 14.3365 13.3862C14.3365 13.0362 14.0528 12.7525 13.7028 12.7525H2.29713Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M7.42163 4.25588L4.25471 11.2231C4.10989 11.5417 4.25077 11.9174 4.56935 12.0622C4.88794 12.207 5.2636 12.0661 5.40841 11.7475L6.24766 9.90119H9.75197L10.5912 11.7475C10.736 12.0661 11.1117 12.207 11.4303 12.0622C11.7489 11.9174 11.8897 11.5417 11.7449 11.2231L8.578 4.25589C8.5675 4.23244 8.55557 4.20961 8.54227 4.18755C8.49012 4.10102 8.41688 4.0262 8.32579 3.97171C8.301 3.95688 8.27527 3.94377 8.24878 3.93246C8.16764 3.89775 8.08309 3.8813 7.99981 3.88135C7.88457 3.88142 7.77177 3.91309 7.67384 3.97171C7.58714 4.02361 7.5121 4.09664 7.45735 4.18755C7.44406 4.20961 7.43213 4.23244 7.42163 4.25588ZM9.17592 8.63388L7.99981 6.04644L6.8237 8.63388H9.17592Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Lf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`auto-height-double-icon`,ref:t,icon:If}))});Lf.displayName=`AutoHeightDoubleIcon`;let Rf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M1.98032 13.7028C1.98032 14.0527 2.26401 14.3364 2.61397 14.3364C2.96392 14.3364 3.24762 14.0527 3.24762 13.7028L3.24762 2.29706C3.24762 1.9471 2.96392 1.66341 2.61397 1.66341C2.26401 1.66341 1.98032 1.9471 1.98032 2.29706L1.98032 13.7028Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M12.7524 13.7028C12.7524 14.0527 13.0361 14.3364 13.386 14.3364C13.736 14.3364 14.0197 14.0527 14.0197 13.7028L14.0197 2.29706C14.0197 1.9471 13.736 1.66341 13.386 1.66341C13.0361 1.66341 12.7524 1.9471 12.7524 2.29706L12.7524 13.7028Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M7.42187 4.25588L4.25495 11.2231C4.11014 11.5417 4.25101 11.9174 4.5696 12.0622C4.88819 12.207 5.26385 12.0661 5.40866 11.7475L6.2479 9.90119H9.75222L10.5915 11.7475C10.7363 12.0661 11.1119 12.207 11.4305 12.0622C11.7491 11.9174 11.89 11.5417 11.7452 11.2231L8.57825 4.25589C8.56775 4.23244 8.55582 4.20961 8.54252 4.18755C8.49037 4.10102 8.41713 4.0262 8.32603 3.97171C8.30125 3.95688 8.27551 3.94377 8.24902 3.93246C8.16788 3.89775 8.08333 3.8813 8.00006 3.88135C7.88481 3.88142 7.77201 3.91309 7.67409 3.97171C7.58739 4.02361 7.51235 4.09664 7.4576 4.18755C7.4443 4.20961 7.43237 4.23244 7.42187 4.25588ZM9.17617 8.63388L8.00006 6.04644L6.82395 8.63388H9.17617Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},zf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`auto-width-double-icon`,ref:t,icon:Rf}))});zf.displayName=`AutoWidthDoubleIcon`;let Bf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`colorChannel1`,d:`M11.0363 12.2367V14.0367C11.0363 14.3681 11.3049 14.6367 11.6363 14.6367C11.9676 14.6367 12.2363 14.3681 12.2363 14.0367V12.2367H14.0364C14.3677 12.2367 14.6364 11.9681 14.6364 11.6367C14.6364 11.3054 14.3677 11.0367 14.0364 11.0367H12.2363V9.23672C12.2363 8.90535 11.9676 8.63672 11.6363 8.63672C11.3049 8.63672 11.0363 8.90535 11.0363 9.23672V11.0367H9.23635C8.90498 11.0367 8.63635 11.3054 8.63635 11.6367C8.63635 11.9681 8.90498 12.2367 9.23635 12.2367H11.0363Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M2.56365 1.36377C1.90091 1.36377 1.36365 1.90103 1.36365 2.56377V6.16377C1.36365 6.82651 1.90091 7.36377 2.56365 7.36377H6.16365C6.82639 7.36377 7.36365 6.82651 7.36365 6.16377V2.56377C7.36365 1.90103 6.82639 1.36377 6.16365 1.36377H2.56365ZM6.16365 2.56377H2.56365L2.56365 6.16377H6.16365V2.56377Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M2.56365 8.63647C1.90091 8.63647 1.36365 9.17373 1.36365 9.83647V13.4365C1.36365 14.0992 1.90091 14.6365 2.56365 14.6365H6.16365C6.82639 14.6365 7.36365 14.0992 7.36365 13.4365V9.83647C7.36365 9.17373 6.82639 8.63647 6.16365 8.63647H2.56365ZM6.16365 9.83647H2.56365L2.56365 13.4365H6.16365V9.83647Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M9.83635 7.36377C9.17361 7.36377 8.63635 6.82651 8.63635 6.16377V2.56377C8.63635 1.90103 9.17361 1.36377 9.83635 1.36377H13.4364C14.0991 1.36377 14.6364 1.90103 14.6364 2.56377V6.16377C14.6364 6.82651 14.0991 7.36377 13.4364 7.36377H9.83635ZM9.83635 6.16377V2.56377L13.4364 2.56377V6.16377H9.83635Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Vf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`autofill-double-icon`,ref:t,icon:Bf}))});Vf.displayName=`AutofillDoubleIcon`;let Hf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 17`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M13.5853 14.7987L2.27159 3.485L3.12012 2.63647L14.4338 13.9502L13.5853 14.7987Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M1.69629 12.8102L1.69629 14.1743C1.69629 14.8371 2.23355 15.3743 2.89629 15.3743L4.26042 15.3743L4.26042 14.0443L3.02629 14.0443L3.02629 12.8102L1.69629 12.8102ZM4.26042 2.06128L2.89629 2.06128C2.23355 2.06128 1.69629 2.59854 1.69629 3.26128L1.69629 4.62541L3.02629 4.62541L3.02629 3.39128L4.26042 3.39128L4.26042 2.06128ZM1.69629 10.0819L3.02629 10.0819L3.02629 7.35367L1.69629 7.35367L1.69629 10.0819ZM6.98868 2.06128L6.98868 3.39128L9.71693 3.39128L9.71693 2.06128L6.98868 2.06128ZM12.4452 2.06128L12.4452 3.39128L13.6793 3.39128L13.6793 4.62541L15.0093 4.62541L15.0093 3.26128C15.0093 2.59854 14.4721 2.06128 13.8093 2.06128L12.4452 2.06128ZM15.0093 7.35367L13.6793 7.35367L13.6793 10.0819L15.0093 10.0819L15.0093 7.35367ZM15.0093 12.8102L13.6793 12.8102L13.6793 14.0443L12.4452 14.0443L12.4452 15.3743L13.8093 15.3743C14.4721 15.3743 15.0093 14.8371 15.0093 14.1743L15.0093 12.8102ZM9.71693 15.3743L9.71693 14.0443L6.98868 14.0443L6.98868 15.3743L9.71693 15.3743Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Uf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`back-slash-double-icon`,ref:t,icon:Hf}))});Uf.displayName=`BackSlashDoubleIcon`;let Wf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`colorChannel1`,d:`M5.36831 3.22148C5.36831 1.94497 6.40313 0.910156 7.67964 0.910156C8.95615 0.910156 9.99097 1.94497 9.99097 3.22149V6.74754H8.72649V3.22149C8.72649 2.64333 8.2578 2.17464 7.67964 2.17464C7.10148 2.17464 6.63279 2.64333 6.63279 3.22148V6.74754H5.36831V3.22148Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M5.00091 5.47314C3.33644 5.47314 1.9499 6.74914 1.81192 8.40788L1.54428 11.6254C1.38911 13.4909 2.86133 15.0906 4.73327 15.0906H13.6667C14.175 15.0906 14.5544 14.6228 14.4495 14.1255L13.0262 7.37781C12.792 6.26766 11.8125 5.47314 10.6779 5.47314H5.00091ZM10.6779 6.75314H5.00091C4.00223 6.75314 3.1703 7.51874 3.08751 8.51399L2.81988 11.7315C2.72677 12.8508 3.61011 13.8106 4.73327 13.8106H5.7695C5.26362 13.0554 5.05585 12.0527 5.31224 11.047C5.40861 10.6689 5.76242 10.4493 6.10249 10.5564C6.44256 10.6636 6.64012 11.0569 6.54374 11.4349C6.27517 12.4885 6.92898 13.6738 7.87916 13.8106H9.01412C8.50824 13.0554 8.30047 12.0527 8.55686 11.047C8.65324 10.6689 9.00704 10.4493 9.34711 10.5564C9.68719 10.6636 9.88474 11.0569 9.78837 11.4349C9.51979 12.4885 10.1736 13.6738 11.1238 13.8106H13.0749L11.7738 7.64199C11.6645 7.12392 11.2073 6.75314 10.6779 6.75314Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Gf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`clear-format-double-icon`,ref:t,icon:Wf}))});Gf.displayName=`ClearFormatDoubleIcon`;let Kf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`colorChannel1`,d:`M5.4004 2.60213C5.25792 2.60213 5.14241 2.71763 5.14241 2.86011V4.32679C5.14241 4.67752 4.85809 4.96184 4.50736 4.96184C4.15663 4.96184 3.87231 4.67752 3.87231 4.32679V2.86011C3.87231 2.01618 4.55646 1.33203 5.4004 1.33203H13.14C13.984 1.33203 14.6681 2.01618 14.6681 2.86011V10.5998C14.6681 11.4437 13.984 12.1278 13.14 12.1278H11.6568C11.3061 12.1278 11.0218 11.8435 11.0218 11.4928C11.0218 11.1421 11.3061 10.8577 11.6568 10.8577H13.14C13.2825 10.8577 13.398 10.7422 13.398 10.5998V2.86011C13.398 2.71763 13.2825 2.60213 13.14 2.60213H5.4004Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.33203 5.40015C1.33203 4.55622 2.01618 3.87207 2.86011 3.87207H10.5998C11.4437 3.87207 12.1278 4.55622 12.1278 5.40015V13.1398C12.1278 13.9837 11.4437 14.6679 10.5998 14.6679H2.86011C2.01618 14.6679 1.33203 13.9837 1.33203 13.1398V5.40015ZM2.86011 5.14217C2.71763 5.14217 2.60213 5.25767 2.60213 5.40015V13.1398C2.60213 13.2823 2.71763 13.3978 2.86011 13.3978H10.5998C10.7422 13.3978 10.8577 13.2823 10.8577 13.1398V5.40015C10.8577 5.25767 10.7422 5.14217 10.5998 5.14217H2.86011Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},qf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`copy-double-icon`,ref:t,icon:Kf}))});qf.displayName=`CopyDoubleIcon`;let Jf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M8.29012 10.552C8.29012 10.9202 8.5886 11.2187 8.95679 11.2187L12.7271 11.2187C13.0953 11.2187 13.3938 10.9202 13.3938 10.552L13.3938 5.44836C13.3938 5.08016 13.0953 4.7817 12.7271 4.7817L8.95678 4.7817C8.5886 4.7817 8.29012 5.08016 8.29012 5.44836L8.29012 10.552ZM13.3938 12.4946C14.0985 12.4946 14.6697 11.9234 14.6697 11.2187L14.6697 4.7817C14.6697 4.07703 14.0985 3.50576 13.3938 3.50576L8.29012 3.50576C7.58547 3.50576 7.0142 4.07703 7.0142 4.7817L7.0142 11.2187C7.0142 11.9234 7.58547 12.4946 8.29012 12.4946L13.3938 12.4946Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M1.37899 7.7562C1.34779 7.83142 1.33053 7.9139 1.33053 8.0004C1.33053 8.0869 1.34779 8.16938 1.37899 8.2446C1.41013 8.31985 1.45626 8.39034 1.51739 8.45151L3.43133 10.3654C3.68046 10.6145 4.08439 10.6145 4.33353 10.3654C4.58266 10.1163 4.58266 9.71232 4.33353 9.46318L3.50873 8.63836L5.70059 8.63836C6.05293 8.63836 6.33855 8.35273 6.33855 8.0004C6.33855 7.64806 6.05293 7.36244 5.70059 7.36244L3.50873 7.36244L4.33353 6.53762C4.58266 6.28848 4.58266 5.88455 4.33353 5.63541C4.08439 5.38627 3.68046 5.38627 3.43133 5.63541L1.51773 7.54899M9.00896 6.15858C9.28326 5.87701 9.72798 5.87701 10.0023 6.15858L10.8032 6.98073L11.6042 6.15852C11.8784 5.87695 12.3232 5.87695 12.5975 6.15852C12.8718 6.44009 12.8718 6.89661 12.5975 7.17819L11.7965 8.00041L12.5975 8.8226C12.8718 9.10417 12.8718 9.56069 12.5975 9.84227C12.3232 10.1238 11.8784 10.1238 11.6041 9.84227L10.8032 9.02007L10.0023 9.84221C9.728 10.1238 9.28327 10.1238 9.00897 9.84221C8.73468 9.56063 8.73468 9.10411 9.00898 8.82254L9.80987 8.00041L9.00896 7.17825C8.73466 6.89668 8.73466 6.44016 9.00896 6.15858Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Yf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`delete-cell-shift-left-double-icon`,ref:t,icon:Jf}))});Yf.displayName=`DeleteCellShiftLeftDoubleIcon`;let Xf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M7.69172 10.552C7.69172 10.9202 7.39324 11.2187 7.02506 11.2187H3.2547C2.8865 11.2187 2.58803 10.9202 2.58803 10.552V5.44836C2.58803 5.08016 2.8865 4.7817 3.2547 4.7817H7.02506C7.39324 4.7817 7.69172 5.08016 7.69172 5.44836V10.552ZM2.58803 12.4946C1.88335 12.4946 1.3121 11.9234 1.3121 11.2187V4.7817C1.3121 4.07703 1.88335 3.50576 2.58803 3.50576H7.69172C8.39637 3.50576 8.96764 4.07703 8.96764 4.7817V11.2187C8.96764 11.9234 8.39637 12.4946 7.69172 12.4946H2.58803Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M11.892 5.54431C11.9672 5.51312 12.0497 5.49591 12.1362 5.49591C12.2227 5.49591 12.3052 5.51312 12.3804 5.54431C12.4557 5.57545 12.5261 5.62159 12.5873 5.68276L14.5012 7.59665C14.7503 7.84579 14.7503 8.24972 14.5012 8.49886C14.2521 8.748 13.8481 8.748 13.599 8.49886L12.7741 7.67405V9.86594C12.7741 10.2183 12.4885 10.5039 12.1362 10.5039C11.7839 10.5039 11.4983 10.2183 11.4983 9.86594V7.67405L10.6734 8.49886C10.4243 8.748 10.0203 8.748 9.77121 8.49886C9.52207 8.24972 9.52207 7.84579 9.77121 7.59665L11.6848 5.68305M6.97304 6.15811C6.69874 5.87653 6.25401 5.87654 5.97972 6.15811L5.17881 6.98026L4.37784 6.15805C4.10355 5.87647 3.65882 5.87647 3.38453 6.15805C3.11023 6.43962 3.11023 6.89615 3.38453 7.17772L4.18549 7.99993L3.38454 8.82213C3.11024 9.1037 3.11024 9.56023 3.38454 9.8418C3.65884 10.1234 4.10356 10.1234 4.37786 9.8418L5.17881 9.0196L5.9797 9.84174C6.254 10.1233 6.69872 10.1233 6.97302 9.84174C7.24732 9.56016 7.24732 9.10364 6.97302 8.82207L6.17213 7.99993L6.97304 7.17778C7.24734 6.89621 7.24734 6.43969 6.97304 6.15811Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Zf=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`delete-cell-shift-up-double-icon`,ref:t,icon:Xf}))});Zf.displayName=`DeleteCellShiftUpDoubleIcon`;let Qf={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M11.9503 1.33317C12.6866 1.33317 13.2836 1.9301 13.2836 2.6665V13.3332C13.2836 14.0695 12.6866 14.6665 11.9503 14.6665H9.28359C8.54721 14.6665 7.95026 14.0696 7.95026 13.3332L7.95026 2.6665C7.95026 1.9301 8.54721 1.33317 9.28359 1.33317H11.9503ZM11.9503 2.6665V13.3332H9.28359V2.6665H11.9503Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M3.8542 6.29716C3.59385 6.03681 3.17174 6.03681 2.91139 6.29716C2.65104 6.55751 2.65104 6.97962 2.91139 7.23997L3.67157 8.00014L2.9114 8.76031C2.65105 9.02066 2.65105 9.44277 2.9114 9.70312C3.17175 9.96347 3.59387 9.96347 3.85421 9.70312L4.61437 8.94296L5.37459 9.70318C5.63494 9.96352 6.05705 9.96353 6.31741 9.70318C6.57775 9.44283 6.57775 9.02072 6.31741 8.76036L5.55718 8.00014L6.31742 7.23991C6.57777 6.97956 6.57777 6.55745 6.31742 6.2971C6.05707 6.03675 5.63496 6.03675 5.37461 6.2971L4.61437 7.05734L3.8542 6.29716Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},$f=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`delete-column-double-icon`,ref:t,icon:Qf}))});$f.displayName=`DeleteColumnDoubleIcon`;let ep={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M14.6666 11.9502C14.6666 12.6866 14.0697 13.2835 13.3333 13.2835H2.66665C1.93027 13.2835 1.33331 12.6866 1.33331 11.9502V9.28353C1.33331 8.54715 1.93027 7.9502 2.66665 7.9502L13.3333 7.9502C14.0697 7.9502 14.6666 8.54715 14.6666 9.28353V11.9502ZM13.3333 11.9502H2.66665V9.28353H13.3333V11.9502Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M9.60134 3.85438C9.86169 3.59403 9.86169 3.17192 9.60134 2.91157C9.34099 2.65122 8.91888 2.65122 8.65853 2.91157L7.89835 3.67175L7.13819 2.91159C6.87784 2.65124 6.45573 2.65124 6.19538 2.91159C5.93503 3.17194 5.93503 3.59405 6.19538 3.8544L6.95554 4.61456L6.19532 5.37478C5.93497 5.63513 5.93497 6.05724 6.19532 6.31759C6.45567 6.57794 6.87778 6.57794 7.13813 6.31759L7.89835 5.55737L8.65859 6.3176C8.91893 6.57796 9.34105 6.57796 9.60139 6.3176C9.86175 6.05726 9.86175 5.63514 9.60139 5.3748L8.84116 4.61456L9.60134 3.85438Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},tp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`delete-row-double-icon`,ref:t,icon:ep}))});tp.displayName=`DeleteRowDoubleIcon`;let np={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`colorChannel1`,d:`M3.99992 1.33301H2.66659C1.93021 1.33301 1.33325 1.92996 1.33325 2.66634V3.99967H2.66659V2.66634L3.99992 2.66634V1.33301Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M1.33325 9.33301H2.66659V6.66634H1.33325V9.33301Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M6.66659 1.33301V2.66634H7.33325V5.33301H8.66659V2.66634H9.33325V1.33301H6.66659Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M11.9999 1.33301V2.66634H13.3333V3.99967H14.6666V2.66634C14.6666 1.92996 14.0696 1.33301 13.3333 1.33301H11.9999Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M14.6666 6.66634H13.3333V7.33301H10.6666V8.66634H13.3333V9.33301H14.6666V6.66634Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M7.33325 13.333V10.6663H8.66659V13.333H7.33325Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M5.33325 7.33301H2.66659V8.66634H5.33325V7.33301Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.33325 13.3333V12H2.66659L2.66659 13.3333H13.3333V12H14.6666V13.3333C14.6666 14.0697 14.0696 14.6667 13.3333 14.6667H2.66659C1.93021 14.6667 1.33325 14.0697 1.33325 13.3333Z`}}]},rp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`down-border-double-icon`,ref:t,icon:np}))});rp.displayName=`DownBorderDoubleIcon`;let ip={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`colorChannel1`,d:`M1.98682 13.4992C1.98682 12.5603 2.74793 11.7992 3.68682 11.7992H14.2868C15.2257 11.7992 15.9868 12.5603 15.9868 13.4992V13.4992C15.9868 14.4381 15.2257 15.1992 14.2868 15.1992H3.68682C2.74793 15.1992 1.98682 14.4381 1.98682 13.4992V13.4992Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M10.3014 1.70389C9.85268 0.479568 8.12109 0.479557 7.67238 1.70389L4.72235 9.75326C4.60832 10.0644 4.76811 10.4091 5.07924 10.5231C5.39038 10.6371 5.73504 10.4773 5.84907 10.1662L6.99975 7.02646C7.03588 7.03324 7.07314 7.03679 7.11123 7.03679H10.9778L12.1247 10.1662C12.2387 10.4773 12.5834 10.6371 12.8945 10.5231C13.2057 10.4091 13.3654 10.0644 13.2514 9.75326L10.3014 1.70389ZM10.538 5.83679L9.17467 2.11682C9.11057 1.94192 8.8632 1.94192 8.7991 2.11682L7.43576 5.83679H10.538Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},ap=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`font-color-double-icon`,ref:t,icon:ip}))});ap.displayName=`FontColorDoubleIcon`;let op={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M8.01519 4.9156C7.65059 4.9156 7.29055 4.96431 6.93757 5.05194C6.6062 5.1342 6.2709 4.93226 6.18864 4.60089C6.10638 4.26953 6.30831 3.93422 6.63968 3.85196C7.0796 3.74275 7.53991 3.6792 8.01519 3.6792C9.93752 3.6792 11.6225 4.71575 12.781 5.67605C13.3691 6.16346 13.8434 6.64946 14.171 7.01358C14.3351 7.19604 14.4633 7.34895 14.5515 7.45755C14.5956 7.51187 14.6298 7.5552 14.6535 7.58568C14.6653 7.60092 14.6745 7.61296 14.6811 7.62157L14.6889 7.63188L14.6913 7.63506L14.6921 7.63614C14.6921 7.63614 14.6927 7.63689 14.1972 8.0066C14.6927 8.37631 14.6925 8.37646 14.6925 8.37646L14.6921 8.37705L14.6913 8.37814L14.6889 8.38131L14.6811 8.39163C14.6745 8.40023 14.6653 8.41227 14.6535 8.42752C14.6298 8.458 14.5956 8.50132 14.5515 8.55565C14.4633 8.66425 14.3351 8.81715 14.171 8.99961C13.8434 9.36373 13.3691 9.84973 12.781 10.3371C12.5182 10.555 12.1284 10.5186 11.9106 10.2557C11.6927 9.99285 11.7291 9.60313 11.992 9.38524C12.5227 8.94536 12.9537 8.50406 13.2518 8.1727C13.3051 8.11347 13.354 8.05788 13.3984 8.0066C13.354 7.95531 13.3051 7.89972 13.2518 7.84049C12.9537 7.50913 12.5227 7.06783 11.992 6.62795C10.9131 5.73365 9.50709 4.9156 8.01519 4.9156ZM14.1972 8.0066L14.6925 8.37646C14.8562 8.15715 14.8563 7.8562 14.6927 7.63689L14.1972 8.0066ZM4.11981 5.75748C4.3377 6.02035 4.30123 6.41007 4.03837 6.62795C3.50769 7.06783 3.07669 7.50913 2.7786 7.84049C2.72531 7.89972 2.67639 7.95531 2.63203 8.0066C2.67639 8.05788 2.72531 8.11347 2.7786 8.17271C3.07669 8.50406 3.50769 8.94536 4.03837 9.38524C5.11729 10.2795 6.5233 11.0976 8.01519 11.0976C8.38283 11.0976 8.74582 11.0481 9.10157 10.9591C9.43279 10.8762 9.76846 11.0776 9.85131 11.4088C9.93417 11.74 9.73283 12.0757 9.40162 12.1585C8.95841 12.2694 8.49443 12.334 8.01519 12.334C6.09287 12.334 4.40788 11.2974 3.24935 10.3371C2.66132 9.84973 2.18698 9.36373 1.85941 8.99961C1.69527 8.81715 1.56704 8.66425 1.47887 8.55565C1.43476 8.50132 1.4006 8.458 1.37692 8.42752C1.36508 8.41227 1.35585 8.40023 1.3493 8.39162L1.34149 8.38131L1.3391 8.37813L1.33829 8.37705C1.33829 8.37705 1.33773 8.37631 1.8332 8.0066C1.33773 7.63689 1.33785 7.63673 1.33785 7.63673L1.3391 7.63506L1.34149 7.63188L1.3493 7.62157C1.35585 7.61296 1.36508 7.60092 1.37692 7.58568C1.4006 7.5552 1.43476 7.51187 1.47887 7.45755C1.56704 7.34895 1.69527 7.19604 1.85941 7.01358C2.18698 6.64946 2.66132 6.16346 3.24935 5.67605C3.51221 5.45816 3.90193 5.49462 4.11981 5.75748ZM1.8332 8.0066L1.33785 7.63673C1.1742 7.85604 1.17464 8.15774 1.33829 8.37705L1.8332 8.0066Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M3.8775 2.99454C3.63608 2.75312 3.24466 2.75312 3.00323 2.99454C2.76181 3.23596 2.76181 3.62739 3.00323 3.86881L6.11167 6.97725C5.94588 7.28339 5.85153 7.63423 5.85153 8.00647C5.85153 9.20144 6.82025 10.1702 8.01523 10.1702C8.38756 10.1702 8.73834 10.0758 9.04444 9.91001L12.1095 12.9751C12.3509 13.2165 12.7424 13.2165 12.9838 12.9751C13.2252 12.7337 13.2252 12.3422 12.9838 12.1008L3.8775 2.99454ZM8.0668 8.93237L7.08932 7.9549C7.0884 7.97197 7.08793 7.98916 7.08793 8.00647C7.08793 8.5186 7.5031 8.93377 8.01523 8.93377C8.03254 8.93377 8.04973 8.9333 8.0668 8.93237Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},sp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`hide-double-icon`,ref:t,icon:op}))});sp.displayName=`HideDoubleIcon`;let cp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`colorChannel1`,d:`M1.33325 13.333V11.9997H2.66659L2.66659 13.333H3.99992V14.6663H2.66659C1.93021 14.6663 1.33325 14.0694 1.33325 13.333Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M2.66659 1.33301H3.99992V2.66634L2.66659 2.66634V3.99967H1.33325V2.66634C1.33325 1.92996 1.93021 1.33301 2.66659 1.33301Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M2.66659 9.33301H1.33325V6.66634H2.66659V9.33301Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M6.66659 2.66634V1.33301H9.33325V2.66634H8.66496V3.9855H7.33496V2.66634H6.66659Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M11.9999 2.66634V1.33301H13.3333C14.0696 1.33301 14.6666 1.92996 14.6666 2.66634V3.99967H13.3333V2.66634H11.9999Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M13.3333 6.66634H14.6666V9.33301H13.3333V6.66634Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M13.3333 11.9997H14.6666V13.333C14.6666 14.0694 14.0696 14.6663 13.3333 14.6663H11.9999V13.333H13.3333V11.9997Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M9.33325 13.333V14.6663H6.66659V13.333H7.33496V12.0138H8.66496V13.333H9.33325Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M7.33496 6.66159L7.33496 9.33768H8.66496V6.66159H7.33496Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M8.66687 7.33423H7.33354L2.66687 7.33431V8.66764H7.33354L8.66687 8.66756L13.3335 8.66764V7.33431L8.66687 7.33423Z`}}]},lp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`horizontal-border-double-icon`,ref:t,icon:cp}))});lp.displayName=`HorizontalBorderDoubleIcon`;let up={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`colorChannel1`,d:`M1.33325 11.9997V13.333C1.33325 14.0694 1.93021 14.6663 2.66659 14.6663H3.99992V13.333H2.66659L2.66659 11.9997H1.33325ZM3.99992 1.33301H2.66659C1.93021 1.33301 1.33325 1.92996 1.33325 2.66634V3.99967H2.66659V2.66634L3.99992 2.66634V1.33301ZM1.33325 9.33301H2.66659V6.66634H1.33325V9.33301ZM6.66659 1.33301V2.66634H9.33325V1.33301H6.66659ZM11.9999 1.33301V2.66634H13.3333V3.99967H14.6666V2.66634C14.6666 1.92996 14.0696 1.33301 13.3333 1.33301H11.9999ZM14.6666 6.66634H13.3333V9.33301H14.6666V6.66634ZM14.6666 11.9997H13.3333V13.333H11.9999V14.6663H13.3333C14.0696 14.6663 14.6666 14.0694 14.6666 13.333V11.9997ZM9.33325 14.6663V13.333H6.66659V14.6663H9.33325Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M8.66693 7.33415V2.66748H7.3336V7.33415H2.66693V8.66748H7.3336V13.3341H8.66693V8.66748H13.3336V7.33415H8.66693Z`}}]},dp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`inner-border-double-icon`,ref:t,icon:up}))});dp.displayName=`InnerBorderDoubleIcon`;let fp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M7.66105 5.44796C7.66105 5.07977 7.36257 4.7813 6.99439 4.7813H3.22403C2.85583 4.7813 2.55736 5.07977 2.55736 5.44796V10.5516C2.55736 10.9198 2.85583 11.2183 3.22403 11.2183H6.99439C7.36257 11.2183 7.66105 10.9198 7.66105 10.5516V5.44796ZM2.55736 3.50537C1.85268 3.50537 1.28143 4.07662 1.28143 4.7813V11.2183C1.28143 11.923 1.85268 12.4942 2.55736 12.4942H7.66105C8.3657 12.4942 8.93697 11.923 8.93697 11.2183V4.7813C8.93697 4.07662 8.3657 3.50537 7.66105 3.50537H2.55736Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M11.9225 10.465C11.9977 10.4962 12.0802 10.5134 12.1667 10.5134C12.2532 10.5134 12.3357 10.4962 12.4109 10.465C12.4862 10.4338 12.5567 10.3877 12.6178 10.3265L14.5317 8.41263C14.7808 8.16349 14.7808 7.75956 14.5317 7.51042C14.2826 7.26128 13.8786 7.26128 13.6295 7.51042L12.8047 8.33523V6.14333C12.8047 5.791 12.5191 5.50537 12.1667 5.50537C11.8144 5.50537 11.5288 5.791 11.5288 6.14333V8.33523L10.7039 7.51042C10.4548 7.26128 10.0509 7.26128 9.80172 7.51042C9.55258 7.75956 9.55258 8.16349 9.80172 8.41263L11.7153 10.3262`,fillRule:`evenodd`,clipRule:`evenodd`}}]},pp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`insert-cell-down-double-icon`,ref:t,icon:fp}))});pp.displayName=`InsertCellDownDoubleIcon`;let mp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M7.56614 5.44796C7.56614 5.07977 7.26766 4.7813 6.89948 4.7813H3.12912C2.76092 4.7813 2.46245 5.07977 2.46245 5.44796V10.5516C2.46245 10.9198 2.76092 11.2183 3.12912 11.2183H6.89948C7.26766 11.2183 7.56614 10.9198 7.56614 10.5516V5.44796ZM2.46245 3.50537C1.75777 3.50537 1.18652 4.07662 1.18652 4.7813V11.2183C1.18652 11.923 1.75777 12.4942 2.46245 12.4942H7.56614C8.27079 12.4942 8.84206 11.923 8.84206 11.2183V4.7813C8.84206 4.07662 8.27079 3.50537 7.56614 3.50537H2.46245Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M14.7651 8.2438C14.7963 8.16858 14.8135 8.0861 14.8135 7.9996C14.8135 7.9131 14.7963 7.83062 14.7651 7.7554C14.7339 7.68015 14.6878 7.60966 14.6266 7.54849L12.7127 5.63461C12.4636 5.38547 12.0597 5.38547 11.8105 5.63461C11.5614 5.88375 11.5614 6.28768 11.8105 6.53682L12.6353 7.36164H10.4434C10.0911 7.36164 9.80548 7.64727 9.80548 7.9996C9.80548 8.35194 10.0911 8.63756 10.4434 8.63756H12.6353L11.8105 9.46238C11.5614 9.71152 11.5614 10.1155 11.8105 10.3646C12.0597 10.6137 12.4636 10.6137 12.7127 10.3646L14.6263 8.45101`,fillRule:`evenodd`,clipRule:`evenodd`}}]},hp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`insert-cell-shift-right-double-icon`,ref:t,icon:mp}))});hp.displayName=`InsertCellShiftRightDoubleIcon`;let gp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M2.53337 14C2.35658 14 2.18704 13.9297 2.06203 13.8047C1.93703 13.6797 1.86681 13.5101 1.86681 13.3333C1.86681 13.1565 1.93703 12.987 2.06203 12.862C2.18704 12.7369 2.35658 12.6667 2.53337 12.6667L13.4667 12.6667C13.6435 12.6667 13.813 12.7369 13.938 12.862C14.063 12.987 14.1333 13.1565 14.1333 13.3333C14.1333 13.5101 14.063 13.6797 13.938 13.8047C13.813 13.9297 13.6435 14 13.4667 14L2.53337 14ZM2.53337 3.33333C2.35658 3.33331 2.18703 3.26306 2.06203 3.13804C1.93703 3.01301 1.86681 2.84346 1.86681 2.66667C1.86681 2.48987 1.93703 2.32032 2.06203 2.1953C2.18703 2.07028 2.35658 2.00003 2.53337 2L13.4667 2C13.6435 2.00003 13.813 2.07028 13.938 2.1953C14.063 2.32032 14.1333 2.48987 14.1333 2.66667C14.1333 2.84346 14.063 3.01301 13.938 3.13803C13.813 3.26306 13.6435 3.33331 13.4667 3.33333L2.53337 3.33333Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M11.0573 7.33327L10.1953 6.47127C10.0703 6.34627 10.0001 6.17672 10.0001 5.99994C10.0001 5.82315 10.0703 5.65361 10.1953 5.52861C10.3203 5.4036 10.4899 5.33337 10.6667 5.33337C10.8434 5.33337 11.013 5.4036 11.138 5.52861L13.138 7.5286C13.2 7.59046 13.2491 7.66393 13.2827 7.74481C13.3162 7.82569 13.3335 7.91238 13.3335 7.99994C13.3335 8.08749 13.3162 8.17419 13.2827 8.25507C13.2491 8.33594 13.2 8.40941 13.138 8.47127L11.138 10.4713C11.0761 10.5332 11.0026 10.5823 10.9217 10.6158C10.8409 10.6493 10.7542 10.6665 10.6667 10.6665C10.5791 10.6665 10.4925 10.6493 10.4116 10.6158C10.3307 10.5823 10.2572 10.5332 10.1953 10.4713C10.1334 10.4094 10.0843 10.3359 10.0508 10.255C10.0173 10.1742 10.0001 10.0875 10.0001 9.99994C10.0001 9.9124 10.0173 9.82573 10.0508 9.74486C10.0843 9.66398 10.1334 9.5905 10.1953 9.52861L11.0573 8.6666L3.33333 8.66661C3.15652 8.66661 2.98695 8.59637 2.86193 8.47134C2.7369 8.34632 2.66666 8.17675 2.66666 7.99994C2.66666 7.82313 2.7369 7.65356 2.86193 7.52853C2.98695 7.40351 3.15652 7.33327 3.33333 7.33327L11.0573 7.33327Z`}}]},_p=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`insert-double-icon`,ref:t,icon:gp}))});_p.displayName=`InsertDoubleIcon`;let vp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M13.3333 13.4087C14.0697 13.4087 14.6666 12.8117 14.6666 12.0754L14.6666 9.40869C14.6666 8.67231 14.0697 8.07536 13.3333 8.07536L2.66663 8.07536C1.93023 8.07536 1.33329 8.67231 1.33329 9.40869L1.33329 12.0754C1.33329 12.8117 1.93023 13.4087 2.66663 13.4087L13.3333 13.4087ZM2.66663 12.0754L13.3333 12.0754L13.3333 9.40869L2.66663 9.40869L2.66663 12.0754Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M7.74168 2.59137C8.10987 2.59137 8.40835 2.88984 8.40835 3.25804L8.40835 4.33309L9.48348 4.33309C9.85167 4.33309 10.1501 4.63156 10.1501 4.99976C10.1501 5.36794 9.85167 5.66642 9.48348 5.66642L8.40835 5.66642L8.40835 6.74154C8.40835 7.10973 8.10987 7.4082 7.74168 7.4082C7.37349 7.4082 7.07501 7.10973 7.07501 6.74154L7.07501 5.66642L5.99998 5.66642C5.63179 5.66642 5.33331 5.36794 5.33331 4.99976C5.33331 4.63156 5.63179 4.33309 5.99998 4.33309L7.07501 4.33309L7.07501 3.25804C7.07501 2.88984 7.37349 2.59137 7.74168 2.59137Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},yp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`insert-row-above-double-icon`,ref:t,icon:vp}))});yp.displayName=`InsertRowAboveDoubleIcon`;let bp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M2.66671 2.59131C1.93033 2.59131 1.33337 3.18826 1.33337 3.92464L1.33337 6.59131C1.33337 7.32769 1.93033 7.92464 2.66671 7.92464L13.3334 7.92464C14.0698 7.92464 14.6667 7.32769 14.6667 6.59131L14.6667 3.92464C14.6667 3.18826 14.0698 2.59131 13.3334 2.59131L2.66671 2.59131ZM13.3334 3.92464L2.66671 3.92464L2.66671 6.59131L13.3334 6.59131L13.3334 3.92464Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M8.25838 13.4086C7.8902 13.4086 7.59172 13.1102 7.59172 12.742L7.59172 11.6669L6.51658 11.6669C6.14839 11.6669 5.84992 11.3684 5.84991 11.0002C5.84991 10.6321 6.14839 10.3336 6.51658 10.3336L7.59172 10.3336L7.59171 9.25846C7.59171 8.89027 7.89019 8.5918 8.25838 8.5918C8.62657 8.5918 8.92505 8.89027 8.92505 9.25846L8.92505 10.3336L10.0001 10.3336C10.3683 10.3336 10.6667 10.6321 10.6667 11.0002C10.6667 11.3684 10.3683 11.6669 10.0001 11.6669L8.92505 11.6669L8.92505 12.742C8.92505 13.1102 8.62658 13.4086 8.25838 13.4086Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},xp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`insert-row-below-double-icon`,ref:t,icon:bp}))});xp.displayName=`InsertRowBelowDoubleIcon`;let Sp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`colorChannel1`,d:`M14.6664 3.99967L14.6664 2.66634C14.6664 1.92996 14.0694 1.33301 13.333 1.33301L11.9997 1.33301L11.9997 2.66634L13.333 2.66634L13.333 3.99967L14.6664 3.99967Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M6.66638 1.33301L6.66638 2.66634L9.33305 2.66634L9.33305 1.33301L6.66638 1.33301Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M14.6664 6.66634L13.333 6.66634L13.333 7.33301L10.6664 7.33301L10.6664 8.66634L13.333 8.66634L13.333 9.33301L14.6664 9.33301L14.6664 6.66634Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M14.6664 11.9997L13.333 11.9997L13.333 13.333L11.9997 13.333L11.9997 14.6663L13.333 14.6663C14.0694 14.6663 14.6664 14.0694 14.6664 13.333L14.6664 11.9997Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M9.33305 14.6663L9.33305 13.333L8.66638 13.333L8.66638 10.6663L7.33305 10.6663L7.33305 13.333L6.66638 13.333L6.66638 14.6663L9.33305 14.6663Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M2.66638 7.33301L5.33305 7.33301L5.33305 8.66634L2.66638 8.66634L2.66638 7.33301Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M8.66638 5.33301L8.66638 2.66634L7.33305 2.66634L7.33305 5.33301L8.66638 5.33301Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M2.66667 1.33301L4 1.33301L4 2.66634L2.66667 2.66634L2.66667 13.333L4 13.333L4 14.6663L2.66667 14.6663C1.93029 14.6663 1.33333 14.0694 1.33333 13.333L1.33333 2.66634C1.33333 1.92996 1.93029 1.33301 2.66667 1.33301Z`}}]},Cp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`left-border-double-icon`,ref:t,icon:Sp}))});Cp.displayName=`LeftBorderDoubleIcon`;let wp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M3.2987 2.39556L14.424 7.49259L13.9241 8.58354L4.06409 4.06617L8.58147 13.9262L7.49051 14.426L2.39348 3.30078L2.08524 3.15956L2.20701 2.89377L2.06653 2.58713L2.42214 2.42421L2.58506 2.0686L2.89169 2.20909L3.15748 2.08732L3.2987 2.39556Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M1.34351 12.0924L1.34351 13.4565C1.34351 14.1193 1.88077 14.6565 2.54351 14.6565L3.90764 14.6565L3.90764 13.3265L2.67351 13.3265L2.67351 12.0924L1.34351 12.0924ZM3.90763 1.34351L2.54351 1.34351C1.88076 1.34351 1.34351 1.88076 1.34351 2.54351L1.34351 3.90764L2.67351 3.90764L2.67351 2.67351L3.90763 2.67351L3.90763 1.34351ZM1.34351 9.36415L2.67351 9.36415L2.67351 6.63589L1.34351 6.63589L1.34351 9.36415ZM6.63589 1.34351L6.63589 2.67351L9.36415 2.67351L9.36415 1.34351L6.63589 1.34351ZM12.0924 1.34351L12.0924 2.67351L13.3265 2.67351L13.3265 3.90763L14.6565 3.90763L14.6565 2.54351C14.6565 1.88076 14.1193 1.34351 13.4565 1.34351L12.0924 1.34351ZM14.6565 6.63589L13.3265 6.63589L13.3265 9.36415L14.6565 9.36415L14.6565 6.63589ZM14.6565 12.0924L13.3265 12.0924L13.3265 13.3265L12.0924 13.3265L12.0924 14.6565L13.4565 14.6565C14.1193 14.6565 14.6565 14.1193 14.6565 13.4565L14.6565 12.0924ZM9.36415 14.6565L9.36415 13.3265L6.63589 13.3265L6.63589 14.6565L9.36415 14.6565Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Tp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`left-double-diagonal-double-icon`,ref:t,icon:wp}))});Tp.displayName=`LeftDoubleDiagonalDoubleIcon`;let Ep={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M13.4322 2.66683C13.4322 1.93045 12.8352 1.3335 12.0989 1.3335H9.43219C8.69581 1.3335 8.09886 1.93045 8.09886 2.66683V13.3335C8.09886 14.0699 8.69581 14.6668 9.43219 14.6668H12.0989C12.8352 14.6668 13.4322 14.0699 13.4322 13.3335V2.66683ZM12.0989 13.3335V2.66683H9.43219V13.3335H12.0989Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M2.56769 7.99978C2.56769 7.63159 2.86616 7.33311 3.23435 7.33311H4.30941V6.25798C4.30941 5.88979 4.60788 5.59131 4.97607 5.59131C5.34426 5.59131 5.64274 5.88979 5.64274 6.25798V7.33311H6.71785C7.08604 7.33311 7.38452 7.63159 7.38452 7.99978C7.38452 8.36797 7.08604 8.66644 6.71785 8.66644H5.64274V9.74148C5.64274 10.1097 5.34426 10.4081 4.97607 10.4081C4.60788 10.4081 4.30941 10.1097 4.30941 9.74148V8.66644H3.23435C2.86616 8.66644 2.56769 8.36797 2.56769 7.99978Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Dp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`left-insert-column-double-icon`,ref:t,icon:Ep}))});Dp.displayName=`LeftInsertColumnDoubleIcon`;let Op={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 17`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M2.33875 3.57255L2.23657 3.79614L2.72883 4.0211L7.58275 14.6428L8.67419 14.144L5.10931 6.34311L13.5649 14.7987L14.4134 13.9502L5.96172 5.49847L13.7573 9.0609L14.2561 7.96947L3.63438 3.11555L3.40942 2.62329L3.18782 2.72456L3.09973 2.63647L2.93861 2.7976L2.73534 2.70471L2.60444 2.99116L2.31799 3.12206L2.41088 3.32533L2.2512 3.485L2.33875 3.57255Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M1.6759 12.8102L1.6759 14.1743C1.6759 14.8371 2.21316 15.3743 2.8759 15.3743L4.24003 15.3743L4.24003 14.0443L3.0059 14.0443L3.0059 12.8102L1.6759 12.8102ZM4.24003 2.06128L2.8759 2.06128C2.21316 2.06128 1.6759 2.59854 1.6759 3.26128L1.6759 4.62541L3.0059 4.62541L3.0059 3.39128L4.24003 3.39128L4.24003 2.06128ZM1.6759 10.0819L3.0059 10.0819L3.0059 7.35367L1.6759 7.35367L1.6759 10.0819ZM6.96829 2.06128L6.96829 3.39128L9.69655 3.39128L9.69655 2.06128L6.96829 2.06128ZM12.4248 2.06128L12.4248 3.39128L13.6589 3.39128L13.6589 4.62541L14.9889 4.62541L14.9889 3.26128C14.9889 2.59854 14.4517 2.06128 13.7889 2.06128L12.4248 2.06128ZM14.9889 7.35367L13.6589 7.35367L13.6589 10.0819L14.9889 10.0819L14.9889 7.35367ZM14.9889 12.8102L13.6589 12.8102L13.6589 14.0443L12.4248 14.0443L12.4248 15.3743L13.7889 15.3743C14.4517 15.3743 14.9889 14.8371 14.9889 14.1743L14.9889 12.8102ZM9.69655 15.3743L9.69655 14.0443L6.96829 14.0443L6.96829 15.3743L9.69655 15.3743Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},kp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`left-tridiagonal-double-icon`,ref:t,icon:Op}))});kp.displayName=`LeftTridiagonalDoubleIcon`;let Ap={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M12.665 2.66496H3.33496C2.96493 2.66496 2.66496 2.96493 2.66496 3.33496V12.665C2.66496 13.035 2.96493 13.335 3.33496 13.335H12.665C13.035 13.335 13.335 13.035 13.335 12.665V3.33496C13.335 2.96493 13.035 2.66496 12.665 2.66496ZM3.33496 1.33496C2.23039 1.33496 1.33496 2.23039 1.33496 3.33496V12.665C1.33496 13.7695 2.23039 14.665 3.33496 14.665H12.665C13.7695 14.665 14.665 13.7695 14.665 12.665V3.33496C14.665 2.23039 13.7695 1.33496 12.665 1.33496H3.33496Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M13.2559 14.1963L1.64941 2.58984L2.58987 1.64939L14.1963 13.2558L13.2559 14.1963Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},jp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`no-color-double-icon`,ref:t,icon:Ap}))});jp.displayName=`NoColorDoubleIcon`;let Mp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M13.3333 2.66634H2.66659V13.333H13.3333V2.66634ZM2.66659 1.33301C1.93021 1.33301 1.33325 1.92996 1.33325 2.66634V13.333C1.33325 14.0694 1.93021 14.6663 2.66659 14.6663H13.3333C14.0696 14.6663 14.6666 14.0694 14.6666 13.333V2.66634C14.6666 1.92996 14.0696 1.33301 13.3333 1.33301H2.66659Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M7.33311 2.66748V5.33415H8.66644V2.66748H7.33311Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M7.33311 10.6675V13.3341H8.66644V10.6675H7.33311Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M13.3331 7.33415H10.6664V8.66748H13.3331V7.33415Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M5.33311 7.33415H2.66644V8.66748H5.33311V7.33415Z`}}]},Np=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`outer-border-double-icon`,ref:t,icon:Mp}))});Np.displayName=`OuterBorderDoubleIcon`;let Pp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M8.01281 1.36643C8.79386 0.585377 10.0602 0.585378 10.8412 1.36643L12.9223 3.44752C13.7034 4.22857 13.7034 5.4949 12.9223 6.27595L9.36445 9.83383C8.5834 10.6149 7.31707 10.6149 6.53602 9.83383L4.45493 7.75273C3.67388 6.97168 3.67388 5.70535 4.45493 4.9243L8.01281 1.36643ZM9.9927 2.21495C9.68028 1.90253 9.17375 1.90253 8.86133 2.21495L5.30346 5.77283L5.29671 5.77966L10.839 6.66224L12.0738 5.42742C12.3862 5.115 12.3862 4.60847 12.0738 4.29605L9.9927 2.21495Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M14.5179 9.48875C14.5179 9.99175 14.1101 10.3995 13.607 10.3995C13.1041 10.3995 12.6963 9.99175 12.6963 9.48875C12.6963 9.1773 13.0455 8.59966 13.3114 8.20487C13.4549 7.99177 13.7591 7.99177 13.9027 8.20486C14.1687 8.59965 14.5179 9.1773 14.5179 9.48875Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M1.98682 13.4992C1.98682 12.5603 2.74793 11.7992 3.68682 11.7992H14.2868C15.2257 11.7992 15.9868 12.5603 15.9868 13.4992V13.4992C15.9868 14.4381 15.2257 15.1992 14.2868 15.1992H3.68682C2.74793 15.1992 1.98682 14.4381 1.98682 13.4992V13.4992Z`}}]},Fp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`paint-bucket-double-icon`,ref:t,icon:Pp}))});Fp.displayName=`PaintBucketDoubleIcon`;let Ip={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`colorChannel1`,d:`M7.74692 9.12463C7.74692 9.46018 8.01893 9.73219 8.35448 9.73219H11.4933C11.8288 9.73219 12.1009 9.46018 12.1009 9.12463C12.1009 8.78909 11.8288 8.51707 11.4933 8.51707H8.35448C8.01893 8.51707 7.74692 8.78909 7.74692 9.12463Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M10.8636 10.8523C10.8636 11.1879 10.5915 11.4599 10.256 11.4599H8.35448C8.01893 11.4599 7.74692 11.1879 7.74692 10.8523C7.74692 10.5168 8.01893 10.2447 8.35448 10.2447H10.256C10.5915 10.2447 10.8636 10.5168 10.8636 10.8523Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M5.4791 1.98268C5.47913 1.71529 5.87912 1.49854 6.37252 1.49854C6.86593 1.49854 7.26592 1.71529 7.26595 1.98268H7.62187C8.22277 1.98268 8.72459 2.39534 8.84412 2.9452H9.39563C10.0856 2.9452 10.6449 3.48923 10.6449 4.16032V6.00569H12.1261C13.161 6.00569 14 6.82174 14 7.82838V11.334C14 11.8174 13.8025 12.281 13.4511 12.6228L12.0693 13.9647C11.7179 14.3065 11.2412 14.4985 10.7442 14.4985H7.91116C7.05024 14.4985 6.32492 14.0431 6.10535 13.2737H3.34925C2.6593 13.2737 2.09998 12.7297 2.09998 12.0586V4.16032C2.09998 3.48923 2.6593 2.9452 3.34925 2.9452H3.90107C4.0206 2.39534 4.52241 1.98268 5.12332 1.98268H5.4791ZM3.97249 4.16032H3.24925L3.24925 12.0586H6.03725V7.82838C6.03725 6.82174 6.87623 6.00569 7.91116 6.00569H9.49563V4.16032H8.7727C8.58289 4.59611 8.13909 4.90183 7.62187 4.90183H5.12332C4.6061 4.90183 4.1623 4.59611 3.97249 4.16032ZM5.12332 2.89403H7.62187C7.79436 2.89403 7.93419 3.03003 7.93419 3.19781V3.68671C7.93419 3.85448 7.79436 3.99049 7.62187 3.99049H5.12332C4.95083 3.99049 4.811 3.85448 4.811 3.68671V3.19781C4.811 3.03003 4.95083 2.89403 5.12332 2.89403ZM7.91116 7.11157C7.56618 7.11157 7.28652 7.38359 7.28652 7.71913V12.7851C7.28652 13.1206 7.56618 13.3927 7.91116 13.3927H10.7442C10.8401 13.3927 10.9337 13.3712 11.0182 13.3311C11.1373 13.2746 11.1859 13.1423 11.1859 13.0134V12.0066C11.1859 11.8724 11.2978 11.7636 11.4358 11.7636H12.4709C12.6034 11.7636 12.7394 11.7163 12.7975 11.6004C12.8388 11.5182 12.8608 11.4272 12.8608 11.334V7.71913C12.8608 7.38359 12.5811 7.11157 12.2362 7.11157H7.91116Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Lp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`paste-special-double-icon`,ref:t,icon:Ip}))});Lp.displayName=`PasteSpecialDoubleIcon`;let Rp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M2.53331 14C2.35652 14 2.18697 13.9297 2.06197 13.8047C1.93697 13.6797 1.86675 13.5101 1.86675 13.3333C1.86675 13.1565 1.93697 12.987 2.06197 12.862C2.18697 12.7369 2.35652 12.6667 2.53331 12.6667L13.4666 12.6667C13.6434 12.6667 13.813 12.7369 13.938 12.862C14.063 12.987 14.1332 13.1565 14.1332 13.3333C14.1332 13.5101 14.063 13.6797 13.938 13.8047C13.813 13.9297 13.6434 14 13.4666 14L2.53331 14ZM2.53331 3.33333C2.35652 3.33331 2.18697 3.26306 2.06197 3.13804C1.93697 3.01301 1.86675 2.84346 1.86675 2.66667C1.86675 2.48987 1.93697 2.32032 2.06197 2.1953C2.18697 2.07028 2.35652 2.00003 2.53331 2L13.4666 2C13.6434 2.00003 13.813 2.07028 13.938 2.1953C14.063 2.32032 14.1332 2.48987 14.1332 2.66667C14.1332 2.84346 14.063 3.01301 13.938 3.13803C13.813 3.26306 13.6434 3.33331 13.4666 3.33333L2.53331 3.33333Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M10.8142 10.8141C10.5588 11.0695 10.1447 11.0695 9.88929 10.8141L7.97868 8.90354L6.14021 10.742C5.89652 10.9857 5.50142 10.9857 5.25774 10.742C5.01405 10.4983 5.01405 10.1032 5.25774 9.85955L7.09621 8.02107L5.18561 6.11047C4.93021 5.85507 4.93021 5.44098 5.18561 5.18557C5.44101 4.93017 5.8551 4.93017 6.11051 5.18557L8.02111 7.09618L9.85959 5.2577C10.1033 5.01401 10.4984 5.01401 10.7421 5.2577C10.9857 5.50139 10.9857 5.89648 10.7421 6.14017L8.90358 7.97865L10.8142 9.88925C11.0696 10.1447 11.0696 10.5587 10.8142 10.8141Z`}}]},zp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`reduce-double-icon`,ref:t,icon:Rp}))});zp.displayName=`ReduceDoubleIcon`;let Bp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`colorChannel1`,d:`M1.33325 3.99992L1.33325 2.66659C1.33325 1.93021 1.93021 1.33325 2.66659 1.33325L3.99992 1.33325L3.99992 2.66659L2.66659 2.66659L2.66659 3.99992L1.33325 3.99992Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M9.33325 1.33325L9.33325 2.66658L6.66659 2.66659L6.66659 1.33325L9.33325 1.33325Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M1.33325 6.66659L2.66659 6.66659L2.66659 7.33325L5.33325 7.33325L5.33325 8.66659L2.66659 8.66659L2.66659 9.33325L1.33325 9.33325L1.33325 6.66659Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M1.33325 11.9999L2.66659 11.9999L2.66659 13.3333L3.99992 13.3333L3.99992 14.6666L2.66659 14.6666C1.93021 14.6666 1.33325 14.0696 1.33325 13.3333L1.33325 11.9999Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M6.66659 14.6666L6.66659 13.3333L7.33325 13.3333L7.33325 10.6666L8.66659 10.6666L8.66659 13.3333L9.33325 13.3333L9.33325 14.6666L6.66659 14.6666Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M13.3333 7.33325L10.6666 7.33325L10.6666 8.66659L13.3333 8.66658L13.3333 7.33325Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M7.33325 5.33325L7.33325 2.66659L8.66659 2.66659L8.66659 5.33325L7.33325 5.33325Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M13.3333 1.33325L12 1.33325L12 2.66659L13.3333 2.66659L13.3333 13.3333L12 13.3333L12 14.6666L13.3333 14.6666C14.0697 14.6666 14.6667 14.0696 14.6667 13.3333L14.6667 2.66659C14.6667 1.93021 14.0697 1.33325 13.3333 1.33325Z`}}]},Vp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`right-border-double-icon`,ref:t,icon:Bp}))});Vp.displayName=`RightBorderDoubleIcon`;let Hp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 17`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M13.2368 2.87507L2.11162 7.97208L2.61144 9.06304L12.4714 4.54568L7.95409 14.4057L9.04505 14.9055L14.1421 3.78029L14.4503 3.63905L14.3286 3.37322L14.469 3.0666L14.1134 2.90369L13.9505 2.5481L13.6439 2.68857L13.3781 2.56678L13.2368 2.87507Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M4.44524 1.82495L3.08111 1.82495C2.41837 1.82495 1.88111 2.36221 1.88111 3.02495L1.88111 4.38908L3.21111 4.38908L3.21111 3.15495L4.44524 3.15495L4.44524 1.82495ZM15.1941 4.38908L15.1941 3.02495C15.1941 2.36221 14.6569 1.82495 13.9941 1.82495L12.63 1.82495L12.63 3.15495L13.8641 3.15495L13.8641 4.38908L15.1941 4.38908ZM7.17349 1.82495L7.17349 3.15495L9.90175 3.15495L9.90175 1.82495L7.17349 1.82495ZM15.1941 7.11734L13.8641 7.11734L13.8641 9.84559L15.1941 9.84559L15.1941 7.11734ZM15.1941 12.5739L13.8641 12.5739L13.8641 13.808L12.63 13.808L12.63 15.138L13.9941 15.138C14.6569 15.138 15.1941 14.6007 15.1941 13.938L15.1941 12.5739ZM9.90175 15.138L9.90175 13.808L7.17349 13.808L7.17349 15.138L9.90175 15.138ZM4.44524 15.138L4.44524 13.808L3.21111 13.808L3.21111 12.5739L1.88111 12.5739L1.88111 13.938C1.88111 14.6007 2.41837 15.138 3.08111 15.138L4.44524 15.138ZM1.88111 9.8456L3.21111 9.8456L3.21111 7.11734L1.88111 7.11734L1.88111 9.8456Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Up=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`right-double-diagonal-double-icon`,ref:t,icon:Hp}))});Up.displayName=`RightDoubleDiagonalDoubleIcon`;let Wp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M2.56781 13.3332C2.56781 14.0695 3.16476 14.6665 3.90114 14.6665L6.56781 14.6665C7.30419 14.6665 7.90114 14.0695 7.90114 13.3332L7.90114 2.6665C7.90114 1.9301 7.30419 1.33317 6.56781 1.33317L3.90114 1.33317C3.16476 1.33317 2.56781 1.9301 2.56781 2.6665L2.56781 13.3332ZM3.90114 2.6665L3.90114 13.3332L6.56781 13.3332L6.56781 2.6665L3.90114 2.6665Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M13.4323 8.00022C13.4323 8.36841 13.1338 8.66689 12.7656 8.66689L11.6906 8.66689L11.6906 9.74202C11.6906 10.1102 11.3921 10.4087 11.0239 10.4087C10.6557 10.4087 10.3573 10.1102 10.3573 9.74202L10.3573 8.66689L9.28215 8.66689C8.91396 8.66689 8.61548 8.36841 8.61548 8.00022C8.61548 7.63203 8.91396 7.33356 9.28214 7.33356L10.3573 7.33356L10.3573 6.25852C10.3573 5.89033 10.6557 5.59186 11.0239 5.59186C11.3921 5.59186 11.6906 5.89033 11.6906 6.25852L11.6906 7.33356L12.7656 7.33356C13.1338 7.33356 13.4323 7.63203 13.4323 8.00022Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},Gp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`right-insert-column-double-icon`,ref:t,icon:Wp}))});Gp.displayName=`RightInsertColumnDoubleIcon`;let Kp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 17`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M2.27177 13.714L13.5855 2.40025L14.434 3.24878L3.1203 14.5625L2.27177 13.714Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M4.2603 1.82495L2.89617 1.82495C2.23343 1.82495 1.69617 2.36221 1.69617 3.02495L1.69617 4.38908L3.02617 4.38908L3.02617 3.15495L4.2603 3.15495L4.2603 1.82495ZM15.0092 4.38908L15.0092 3.02495C15.0092 2.36221 14.4719 1.82495 13.8092 1.82495L12.4451 1.82495L12.4451 3.15495L13.6792 3.15495L13.6792 4.38908L15.0092 4.38908ZM6.98856 1.82495L6.98856 3.15495L9.71681 3.15495L9.71681 1.82495L6.98856 1.82495ZM15.0092 7.11734L13.6792 7.11734L13.6792 9.84559L15.0092 9.84559L15.0092 7.11734ZM15.0092 12.5739L13.6792 12.5739L13.6792 13.808L12.4451 13.808L12.4451 15.138L13.8092 15.138C14.4719 15.138 15.0092 14.6007 15.0092 13.938L15.0092 12.5739ZM9.71681 15.138L9.71681 13.808L6.98856 13.808L6.98856 15.138L9.71681 15.138ZM4.2603 15.138L4.2603 13.808L3.02617 13.808L3.02617 12.5739L1.69617 12.5739L1.69617 13.938C1.69617 14.6007 2.23343 15.138 2.89617 15.138L4.2603 15.138ZM1.69617 9.8456L3.02617 9.8456L3.02617 7.11734L1.69617 7.11734L1.69617 9.8456Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},qp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`slash-double-icon`,ref:t,icon:Kp}))});qp.displayName=`SlashDoubleIcon`;let Jp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`colorChannel1`,d:`M4.0001 14.667H2.66677C1.93039 14.667 1.33344 14.07 1.33344 13.3337V12.0003H2.66677V13.3337L4.0001 13.3337V14.667Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M1.33344 6.66699H2.66677V9.33366H1.33344V6.66699Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M6.66677 14.667V13.3337H7.33344V10.667H8.66677V13.3337H9.33344V14.667H6.66677Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M12.0001 14.667V13.3337H13.3334V12.0003H14.6668V13.3337C14.6668 14.07 14.0698 14.667 13.3334 14.667H12.0001Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M14.6668 9.33366H13.3334V8.66699H10.6668V7.33366H13.3334V6.66699H14.6668V9.33366Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M7.33344 2.66699V5.33366H8.66677V2.66699H7.33344Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M5.33344 8.66699H2.66677V7.33366H5.33344V8.66699Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.33344 2.66789V4.00122H2.66677L2.66677 2.66789H13.3334V4.00122H14.6668V2.66789C14.6668 1.93151 14.0698 1.33455 13.3334 1.33455H2.66677C1.93039 1.33455 1.33344 1.93151 1.33344 2.66789Z`}}]},Yp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`up-border-double-icon`,ref:t,icon:Jp}))});Yp.displayName=`UpBorderDoubleIcon`;let Xp={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`colorChannel1`,d:`M2.66699 1.33325L4.00033 1.33325L4.00033 2.66658L2.66699 2.66659L2.66699 3.99992L1.33366 3.99992L1.33366 2.66659C1.33366 1.93021 1.93061 1.33325 2.66699 1.33325Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M14.667 2.66659L14.667 3.99992L13.3337 3.99992L13.3337 2.66659L12.0003 2.66659L12.0003 1.33325L13.3337 1.33325C14.07 1.33325 14.667 1.93021 14.667 2.66659Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M6.66699 2.66658L6.66699 1.33325L9.33366 1.33325L9.33366 2.66659L6.66699 2.66658Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M13.3337 6.66659L14.667 6.66659L14.667 9.33325L13.3337 9.33325L13.3337 8.66496L12.0145 8.66496L12.0145 7.33496L13.3337 7.33496L13.3337 6.66659Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M13.3337 11.9999L14.667 11.9999L14.667 13.3333C14.667 14.0696 14.07 14.6666 13.3337 14.6666L12.0003 14.6666L12.0003 13.3333L13.3337 13.3333L13.3337 11.9999Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M9.33366 13.3333L9.33366 14.6666L6.66699 14.6666L6.66699 13.3333L9.33366 13.3333Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M4.00032 13.3333L4.00032 14.6666L2.66699 14.6666C1.93061 14.6666 1.33366 14.0696 1.33366 13.3333L1.33366 11.9999L2.66699 11.9999L2.66699 13.3333L4.00032 13.3333Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M2.66699 9.33325L1.33366 9.33325L1.33366 6.66658L2.66699 6.66658L2.66699 7.33496L3.98624 7.33496L3.98624 8.66496L2.66699 8.66496L2.66699 9.33325Z`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M9.33841 7.33496L6.66232 7.33496L6.66232 8.66496L9.33841 8.66496L9.33841 7.33496Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M8.66577 8.66675L8.66577 7.33342L8.66569 2.66675L7.33236 2.66675L7.33236 7.33341L7.33244 8.66675L7.33236 13.3334L8.66569 13.3334L8.66577 8.66675Z`}}]},Zp=(0,p.forwardRef)(function(e,t){return(0,p.createElement)($,Object.assign({},e,{id:`vertical-border-double-icon`,ref:t,icon:Xp}))});Zp.displayName=`VerticalBorderDoubleIcon`;function Qp(e){let{inputValue:t,rangeString:i,unitId:a,formulaOrRefString:o,worksheet:s,univerInstanceService:c,definedNamesService:l,superTableService:d,functionService:f}=e;if(t===i)return{type:`noop`};let p=l.getValueByName(a,t);if(p)return{type:`focusDefinedName`,definedName:p};if((0,u.isReferenceStringWithEffectiveColumn)(t)){let{range:e}=(0,u.deserializeRangeWithSheet)(t);return!s||!(0,n.isValidRange)(e,s)?{type:`reset`}:{type:`focusSelection`,refString:t}}return(0,r.validateDefinedName)(t,{unitId:a,formulaOrRefString:o,univerInstanceService:c,definedNamesService:l,superTableService:d,functionService:f})===!0?{type:`createDefinedName`,name:t}:{type:`reset`}}function $p(e,t,r){var i;let a=(i=e.getActiveSheet())==null?void 0:i.getName();if(!a||t==null||t.length===0)return``;let o=t.map(e=>(0,u.serializeRangeWithSheet)(a,e.range)).join(`,`);return r.convertRefersToAbsolute(o,n.AbsoluteRefType.ALL,n.AbsoluteRefType.ALL,a)}function em({search:e,isInputEvent:t,onClose:a}){let s=(0,i.useDependency)(n.ICommandService),c=(0,i.useDependency)(n.LocaleService),d=(0,i.useDependency)(u.IDefinedNamesService),f=(0,i.useDependency)(n.IUniverInstanceService),h=(0,i.useDependency)(i.ISidebarService),g=c.getDirection(),_=f.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET).getUnitId(),v=()=>{let e=d.getDefinedNameMap(_);return e?Object.values(e):[]},y=(0,i.useObservable)(()=>d.update$.pipe((0,o.map)(v),(0,o.startWith)(v())),v(),!1,[d,_]);(0,p.useEffect)(()=>{let e,t=h.sidebarOptions$.subscribe(t=>{t.id===`DefinedNameContainer`&&(t.visible||(e!==void 0&&clearTimeout(e),e=setTimeout(()=>{h.sidebarOptions$.next({visible:!1})})))});return()=>{t.unsubscribe(),e!==void 0&&clearTimeout(e)}},[]);let b=(0,p.useMemo)(()=>e&&t?y.filter(t=>t.name.toLowerCase().includes(e.toLowerCase())):y,[e,t,y]),x=(0,p.useRef)(void 0),[S,C]=(0,i.useVirtualList)(b,{containerTarget:x,itemHeight:30,overscan:6}),w=async()=>{a(),await s.executeCommand(Gr.id,{value:`open`})},T=async e=>{let{formulaOrRefString:t,id:n}=e,i=d.getWorksheetByRef(_,t);i&&(i.isSheetHidden()&&await s.executeCommand(r.SetWorksheetShowCommand.id,{unitId:_,subUnitId:i.getSheetId()}),d.focusRange(_,n))};return/* @__PURE__ */ (0,m.jsxs)(`div`,{"data-u-comp":`defined-name-overlay`,dir:g,className:`univer-w-[300px] rtl:univer-text-right`,children:[/* @__PURE__ */ (0,m.jsx)(`div`,{ref:x,className:(0,l.clsx)(`univer-max-h-[360px] univer-min-h-0 univer-overflow-y-auto`,l.scrollbarClassName,{"univer-min-h-[30px]":b.length>0}),...C.containerProps,children:/* @__PURE__ */ (0,m.jsx)(`div`,{style:C.wrapperStyle,children:S.map(({data:e,index:t})=>/* @__PURE__ */ (0,m.jsx)(`li`,{className:`univer-cursor-pointer univer-px-2 univer-transition-colors univer-duration-200 hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-600`,onClick:async()=>{a(),await T(e)},children:/* @__PURE__ */ (0,m.jsxs)(`div`,{"data-u-comp":`defined-name-overlay-row`,className:(0,l.clsx)(`univer-flex univer-items-center univer-gap-2 univer-py-1 rtl:univer-flex-row-reverse`,l.borderBottomClassName),children:[/* @__PURE__ */ (0,m.jsx)(`div`,{"data-u-comp":`defined-name-overlay-name`,className:`univer-min-w-0 univer-flex-1 univer-basis-0 univer-truncate univer-text-sm univer-text-gray-600 rtl:univer-text-right dark:!univer-text-gray-200`,title:e.name,children:e.name}),/* @__PURE__ */ (0,m.jsx)(`div`,{"data-u-comp":`defined-name-overlay-reference`,className:`univer-min-w-0 univer-flex-1 univer-basis-0 univer-truncate univer-text-xs univer-text-gray-400 rtl:univer-text-right`,title:e.formulaOrRefString,children:e.formulaOrRefString})]})},t))})}),/* @__PURE__ */ (0,m.jsxs)(`div`,{"data-u-comp":`defined-name-overlay-footer`,className:`univer-cursor-pointer univer-p-2 univer-transition-colors univer-duration-200 hover:univer-bg-gray-100 rtl:univer-text-right dark:hover:!univer-bg-gray-600`,onClick:w,children:[/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-mb-2 univer-text-sm univer-font-semibold univer-text-gray-600 dark:!univer-text-gray-200`,children:c.t(`sheets-ui.definedName.managerTitle`)}),/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-text-xs univer-text-gray-400`,children:c.t(`sheets-ui.definedName.managerDescription`)})]})]})}function tm({disable:e}){let[t,a]=(0,p.useState)(``),[s,c]=(0,p.useState)(``),d=(0,i.useDependency)(u.IDefinedNamesService),f=(0,i.useDependency)(n.ICommandService),h=(0,i.useDependency)(n.IUniverInstanceService),g=(0,i.useDependency)(r.SheetsSelectionsService),_=(0,i.useDependency)(u.LexerTreeBuilder),v=(0,i.useDependency)(u.ISuperTableService),y=(0,i.useDependency)(u.IFunctionService),b=(0,i.useDependency)(i.ILayoutService),x=(0,i.useDependency)(r.SheetPermissionCheckController),S=Fl(),C=Il(S),w=!!C&&(C.getConfig().type??n.SheetTypes.GRID)===n.SheetTypes.GRID,T=e||!w,E=S==null?void 0:S.getUnitId(),D=(0,i.useDependency)(n.ThemeService),[O,k]=(0,p.useState)(!1),[A,M]=(0,p.useState)(!1),N=(0,p.useRef)(null),P=(0,p.useRef)(null),F=()=>{let e=d.getDefinedNameMap(E);return e?Object.values(e):[]},I=async e=>{let{formulaOrRefString:t,id:n}=e,i=d.getWorksheetByRef(E,t);i&&(i.isSheetHidden()&&await f.executeCommand(r.SetWorksheetShowCommand.id,{unitId:E,subUnitId:i.getSheetId()}),d.focusRange(E,n))},L=e=>{let t=S.getActiveSheet(),n=t.getSheetId();te(t,e).then(e=>{e&&(f.executeCommand(r.SetSelectionsOperation.id,{unitId:E,subUnitId:n,selections:e}),f.executeCommand(mr.id,{range:e[0].range}))})},R=(0,i.useObservable)(()=>d.update$.pipe((0,o.map)(F),(0,o.startWith)(F())),F(),!1,[d,E]);(0,p.useEffect)(()=>{let e=d.currentRange$.subscribe(()=>{let e=g.getCurrentSelections(),t=$p(S,e,_),n=d.getDefinedNameByRefString(E,t);if(n)a(n.name),c(n.name);else{let e=d.getCurrentRangeForString();a(e),c(e)}});return()=>{e.unsubscribe()}},[d,_,g,E,S]);let z=(0,p.useMemo)(()=>(0,n.debounce)(e=>{let t=R.find(t=>t.name.toLowerCase().includes(e.toLowerCase()));t&&!O?k(!0):!t&&O&&k(!1)},100),[R,O]);(0,p.useEffect)(()=>()=>z.cancel(),[z,w]),(0,p.useEffect)(()=>{let e=S==null?void 0:S.activeSheet$.subscribe(()=>k(!1));return()=>e==null?void 0:e.unsubscribe()},[S]);function ee(e){if(T)return;let t=e.target.value.trim();c(t),M(!0),t?z(t):O&&k(!1)}function B(){if(T)return!1;let e=$p(S,g.getCurrentSelections(),_),i=Qp({inputValue:s,rangeString:t,unitId:E,formulaOrRefString:e,worksheet:S.getActiveSheet(),univerInstanceService:h,definedNamesService:d,superTableService:v,functionService:y});switch(i.type){case`noop`:return!0;case`focusDefinedName`:return a(i.definedName.name),c(i.definedName.name),I(i.definedName),!0;case`focusSelection`:return a(i.refString),c(i.refString),L(i.refString),!0;case`createDefinedName`:{if(!e||!x.permissionCheckWithoutRange({workbookTypes:[r.WorkbookEditablePermission]},E))return H(),!1;let t=f.syncExecuteCommand(r.InsertDefinedNameCommand.id,{id:(0,n.generateRandomId)(10),unitId:E,name:i.name,formulaOrRefString:e,localSheetId:r.SCOPE_WORKBOOK_VALUE_DEFINED_NAME});return t?(a(i.name),c(i.name)):H(),!!t}case`reset`:return H(),!1}}function V(e){if(!T){if(e.key===`Enter`){let e=B();M(!1),k(!1),e&&b.focus()}else e.key===`Escape`&&(e.preventDefault(),M(!1),H())}}function H(){c(t)}async function te(e,t){if(!e)return;let n=(0,u.deserializeRangeWithSheet)(t.trim()),{startRow:i,startColumn:a,endRow:o,endColumn:s}=n.range,c=(0,r.getPrimaryForRange)({startRow:i,startColumn:a,endRow:o,endColumn:s},e),l=[];return l.push({range:n.range,style:j(D),primary:c}),l}return/* @__PURE__ */ (0,m.jsxs)(`div`,{ref:N,"data-u-comp":`defined-name`,onMouseDown:e=>{T&&e.preventDefault()},className:`univer-relative univer-box-border univer-flex univer-h-full univer-w-24 univer-border-r-gray-200 univer-py-1.5 univer-transition-all`,children:[/* @__PURE__ */ (0,m.jsx)(`input`,{ref:P,className:(0,l.clsx)(`univer-box-border univer-size-full univer-appearance-none univer-bg-transparent univer-pl-1.5 univer-pr-5 univer-text-gray-900 focus:univer-outline-none dark:!univer-border-r-gray-700 dark:!univer-text-gray-0`,l.borderRightClassName,{"univer-cursor-not-allowed":T}),type:`text`,disabled:T,value:w?s:``,onChange:ee,onKeyDown:V,onBlur:()=>M(!1)}),/* @__PURE__ */ (0,m.jsx)(l.Dropdown,{align:`start`,anchorRef:N,overlay:/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-z-[1001]`,children:/* @__PURE__ */ (0,m.jsx)(em,{search:s,isInputEvent:A,onClose:()=>k(!1)})}),disabled:T,open:!T&&O,onOpenChange:k,onOpenAutoFocus:e=>e.preventDefault(),children:/* @__PURE__ */ (0,m.jsx)(`a`,{className:(0,l.clsx)(`univer-absolute univer-right-0 univer-top-0 univer-flex univer-h-full univer-cursor-pointer univer-items-center univer-justify-center univer-px-1 univer-transition-colors univer-duration-200 hover:univer-bg-gray-100 dark:!univer-text-gray-0 dark:hover:!univer-bg-gray-800`,{"univer-cursor-not-allowed univer-text-gray-300 hover:univer-bg-transparent dark:!univer-text-gray-700":T}),children:/* @__PURE__ */ (0,m.jsx)(Ad,{})})})]})}function nm(e){var s;let{className:u,disableDefinedName:d}=e,f=(0,i.useDependency)(Y),h=(0,i.useObservable)(()=>f.visible$.pipe((0,o.map)(e=>e.visible)),!1,!1,[f]),[g,_]=(0,p.useState)(0),v=(0,i.useDependency)(La),y=(0,i.useDependency)(r.WorksheetProtectionRuleModel),b=(0,i.useDependency)(r.RangeProtectionRuleModel),x=(0,i.useDependency)(r.SheetsSelectionsService),S=(0,i.useDependency)(n.IPermissionService),C=(0,i.useDependency)(r.RangeProtectionCache),w=(0,i.useDependency)(n.ICommandService),T=(0,i.useObservable)(()=>f.currentEditCellState$.pipe((0,o.map)(e=>{var t;return!!(e!=null&&(t=e.documentLayoutObject.documentModel)!=null&&(t=t.getBody())!=null&&(t=t.customBlocks)!=null&&t.length)})),!1,!1,[f]),E=(0,i.useDependency)(i.ComponentManager),D=Fl(),O=Il(D),k=!!O&&(O.getConfig().type??n.SheetTypes.GRID)===n.SheetTypes.GRID,A=(0,i.useObservable)(f.currentEditCellState$),j=Bl(A==null?void 0:A.unitId),M=E.get(P),N=(0,i.useComponentsOfPart)(`formula-aux`),F=(0,i.useDependency)(n.IContextService),I=(0,i.useObservable)((0,p.useMemo)(()=>F.subscribeContextValue$(n.FOCUSING_FX_BAR_EDITOR),[F]),F.getContextValue(n.FOCUSING_FX_BAR_EDITOR)),L=(0,i.useObservable)((0,p.useMemo)(()=>{if(D)return S.getPermissionPoint$(new r.WorkbookEditablePermission(D.getUnitId()).id)},[S,D])),R=(0,p.useRef)(null),z=(0,i.useDependency)(t.IEditorService),ee=(0,i.useConfigValue)(U),B=ee==null?void 0:ee.disableEdit,V=(0,i.useObservable)(()=>D?D.activeSheet$.pipe((0,o.switchMap)(e=>e?(0,o.merge)(y.ruleChange$,b.ruleChange$,x.selectionMoveEnd$,x.selectionSet$).pipe((0,o.switchMap)(()=>{var t,n;let r=D.getUnitId(),i=e.getSheetId();if(!((t=x.getCurrentLastSelection())!=null&&t.range))return o.EMPTY;let a=(n=x.getCurrentLastSelection())==null?void 0:n.primary;return a?(0,o.of)({unitId:r,subUnitId:i,primary:a}):(0,o.of)(null)})):o.EMPTY),(0,o.map)(e=>{if(e){let{unitId:i,subUnitId:a,primary:o}=e;if(y.getRule(i,a)){var t,n;let e=!(((t=S.getPermissionPoint(new r.WorksheetEditPermission(i,a).id))==null?void 0:t.value)??!0);return{viewDisable:!(((n=S.getPermissionPoint(new r.WorksheetViewPermission(i,a).id))==null?void 0:n.value)??!0),editDisable:e}}let{actualRow:s,actualColumn:l}=o,u=C.getCellInfo(i,a,s,l);return{editDisable:!((u==null?void 0:u[c.UnitAction.Edit])??!0),viewDisable:!((u==null?void 0:u[c.UnitAction.View])??!0)}}return{viewDisable:!1,editDisable:!1}})):o.EMPTY,{editDisable:!1,viewDisable:!1},!1,[S,C,b,x,D,y]);(0,p.useEffect)(()=>{let e=()=>{if(!R.current)return;let e=R.current.getBoundingClientRect();v.setPosition(e)};if(R.current){e();let t=new ResizeObserver(e);return t.observe(R.current),()=>t.disconnect()}},[v]);function H(){k&&(_(+(g===0)),setTimeout(()=>{v.handleFoldBtnClick(g===1)},150))}function te(){k&&f.isVisible().visible&&w.executeCommand(X.id,{visible:!1,eventType:a.DeviceInputEventType.Keyboard,keycode:i.KeyCode.ESC,unitId:A.unitId})}function ne(){k&&f.isVisible().visible&&w.executeCommand(X.id,{visible:!1,eventType:a.DeviceInputEventType.PointerDown,unitId:A.unitId})}function re(){k&&v.handleFxBtnClick(!0)}let{viewDisable:ie,editDisable:W}=V,ae=!k||W||!!B,oe=!((L==null?void 0:L.value)??!0),se=ae||oe,ce=ae||T,G=(0,p.useRef)(!1),K=()=>{if(k)try{if(F.setContextValue(n.FOCUSING_FX_BAR_EDITOR,!0),f.isVisible().visible===!1){if(se){z.focus(n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY);return}w.syncExecuteCommand(X.id,{visible:!0,eventType:a.DeviceInputEventType.PointerDown,unitId:A.unitId})||(F.setContextValue(n.FOCUSING_FX_BAR_EDITOR,!1),G.current=!0)}}catch(e){throw F.setContextValue(n.FOCUSING_FX_BAR_EDITOR,!1),G.current=!0,e}},q=()=>{G.current&&setTimeout(()=>{z.blur(!0)},30),G.current=!1},le=(0,r.isCellImage)(A==null||(s=A.documentLayoutObject.documentModel)==null?void 0:s.getSnapshot()),ue=!k||le||ie;return/* @__PURE__ */ (0,m.jsxs)(`div`,{dir:`ltr`,"data-u-comp":`formula-bar`,className:(0,l.clsx)(`univer-box-border univer-flex univer-bg-gray-0 univer-text-gray-900 univer-transition-[height] univer-ease-linear dark:!univer-bg-gray-800`,l.borderBottomClassName,u,{"univer-h-7":g===0,"univer-h-20":g===1,"univer-pointer-events-none":ae}),children:[/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-relative univer-box-border univer-h-full univer-w-[100px]`,children:/* @__PURE__ */ (0,m.jsx)(tm,{disable:h||(d??ae)})}),/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-flex univer-size-full`,children:[/* @__PURE__ */ (0,m.jsx)(`div`,{className:(0,l.clsx)(`univer-py-1.5`,{"univer-cursor-not-allowed univer-text-gray-200":ce}),children:/* @__PURE__ */ (0,m.jsxs)(`div`,{"data-u-comp":`formula-bar-actions`,className:(0,l.clsx)(`univer-relative univer-box-border univer-flex univer-h-full univer-w-20 univer-items-center univer-justify-center univer-text-xs`,l.borderRightClassName),children:[/* @__PURE__ */ (0,m.jsx)(`span`,{className:(0,l.clsx)(`univer-flex univer-items-center univer-justify-center univer-rounded univer-p-1 univer-text-base dark:!univer-text-gray-0`,{"univer-cursor-pointer univer-text-red-600 hover:univer-bg-gray-100 dark:!univer-text-green-400 dark:hover:!univer-bg-gray-700":h}),onClick:te,children:/* @__PURE__ */ (0,m.jsx)(Su,{})}),/* @__PURE__ */ (0,m.jsx)(`span`,{className:(0,l.clsx)(`univer-flex univer-items-center univer-justify-center univer-rounded univer-p-1 univer-text-base dark:!univer-text-gray-0`,{"univer-cursor-pointer univer-text-green-600 hover:univer-bg-gray-100 dark:!univer-text-red-400 dark:hover:!univer-bg-gray-700":h}),onClick:ne,children:/* @__PURE__ */ (0,m.jsx)(bu,{})}),/* @__PURE__ */ (0,m.jsx)(`span`,{className:`univer-flex univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-p-1 univer-text-base hover:univer-bg-gray-100 dark:!univer-text-gray-0 dark:hover:!univer-bg-gray-700`,onClick:re,children:/* @__PURE__ */ (0,m.jsx)(nd,{})})]})}),/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-flex univer-w-full univer-flex-1 univer-overflow-hidden univer-pl-3`,children:[/* @__PURE__ */ (0,m.jsxs)(`div`,{ref:R,className:`univer-relative univer-flex-1 univer-bg-gray-0 dark:!univer-bg-gray-800`,onPointerDown:K,onPointerUp:q,"aria-hidden":!k,style:{pointerEvents:ue?`none`:`auto`,visibility:k?void 0:`hidden`},children:[M&&/* @__PURE__ */ (0,m.jsx)(M,{className:`univer-relative univer-size-full univer-break-words univer-outline-none`,borderless:!0,disableSelectionOnClick:!0,editorId:n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY,initValue:``,onChange:()=>{},isFocus:k&&I,unitId:A==null?void 0:A.unitId,subUnitId:A==null?void 0:A.sheetId,isSupportAcrossSheet:!0,resetSelectionOnBlur:!1,isSingle:!1,keyboardEventConfig:j,onFormulaSelectingChange:(e,t)=>{t&&(e?f.enableForceKeepVisible():f.disableForceKeepVisible())},autoScrollbar:!1,disableContextMenu:!1}),ue&&/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-pointer-events-none univer-relative univer-left-0 univer-top-0 univer-z-[100] univer-size-full univer-cursor-not-allowed univer-bg-gray-0 dark:!univer-bg-gray-800`})]}),/* @__PURE__ */ (0,m.jsx)(`div`,{className:(0,l.clsx)(`univer-flex univer-h-full univer-w-5 univer-cursor-pointer univer-items-center univer-justify-center univer-text-xs univer-text-gray-700 dark:!univer-text-gray-200`,{"univer-cursor-not-allowed univer-text-gray-200 dark:!univer-text-gray-700":ae}),onClick:H,children:/* @__PURE__ */ (0,m.jsx)(Iu,{className:(0,l.clsx)({"univer-rotate-180":g===1})})})]})]}),/* @__PURE__ */ (0,m.jsx)(i.ComponentContainer,{components:N},`formula-aux`)]})}function rm(e){let{children:t,className:n,style:r,disabled:i=!1,onClick:a,...o}=e;return/* @__PURE__ */ (0,m.jsx)(l.Button,{"data-u-comp":`sheet-bar-append-button`,className:n,size:`small`,disabled:i,style:r,variant:`text`,onClick:e=>{i?e.preventDefault():a&&a(e)},...o,children:t})}function im(){let[e,t]=(0,p.useState)([]),[a,o]=(0,p.useState)(!1),s=(0,i.useDependency)(n.IUniverInstanceService),c=(0,i.useDependency)(n.ICommandService),u=(0,i.useDependency)(Nr),d=(0,i.useDependency)(r.WorksheetProtectionRuleModel),f=(0,i.useObservable)(()=>s.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET),null,!1,[]),h=e=>{let{sheetId:t}=e;t&&f&&(e.hidden?c.executeCommand(r.SetWorksheetShowCommand.id,{unitId:f.getUnitId(),subUnitId:t}):e.selected||c.executeCommand(r.SetWorksheetActivateCommand.id,{unitId:f.getUnitId(),subUnitId:t}),o(!1))},g=(0,p.useCallback)(()=>{if(!f)return;let e=f.getSheets(),r=f.getActiveSheet(),i=e.filter(e=>e.getHiddenState()!==n.WorksheetHiddenState.VERY_HIDDEN).map((e,t)=>({label:e.getName(),index:`${t}`,sheetId:e.getSheetId(),hidden:e.isSheetHidden()===n.BooleanNumber.TRUE,selected:r===e}));t(i)},[f,d]),_=(0,p.useCallback)(()=>c.onCommandExecuted(e=>{switch(e.id){case r.SetWorksheetHideMutation.id:case r.RemoveSheetMutation.id:case r.SetWorksheetNameMutation.id:case r.InsertSheetMutation.id:case r.SetWorksheetOrderMutation.id:case r.SetWorksheetActiveOperation.id:g()}}),[c,g]);function v(){o(!0)}let y=e=>{o(e)};(0,p.useEffect)(()=>{g();let e=new n.DisposableCollection;return e.add(_()),e.add(u.registerSheetBarMenuHandler({handleSheetBarMenu:v})),()=>e.dispose()},[_,u,g,f]);let b=(0,p.useMemo)(()=>e.map(e=>({type:`item`,children:/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-relative univer-box-border univer-overflow-hidden univer-truncate univer-pl-6`,children:[(e.selected||e.hidden)&&/* @__PURE__ */ (0,m.jsxs)(`span`,{className:`univer-absolute univer-left-1 univer-top-0.5`,children:[e.selected&&/* @__PURE__ */ (0,m.jsx)(bu,{className:`univer-size-4 univer-text-primary-600`}),e.hidden&&/* @__PURE__ */ (0,m.jsx)(Wu,{className:`univer-size-4 univer-text-gray-400`})]}),/* @__PURE__ */ (0,m.jsx)(`span`,{className:(0,l.clsx)({"univer-text-primary-600":e.selected}),children:e.label})]}),onSelect:()=>{h(e)}})),[e]);return/* @__PURE__ */ (0,m.jsx)(l.DropdownMenu,{className:`univer-max-w-lg`,align:`start`,items:b,open:a,onOpenChange:y,children:/* @__PURE__ */ (0,m.jsx)(`div`,{children:/* @__PURE__ */ (0,m.jsx)(rm,{children:/* @__PURE__ */ (0,m.jsx)(Eu,{})})})})}function am(e){let{sheetId:t,label:r,color:a,selected:o,className:s,onKeyDown:c,onClick:u,tabIndex:d}=e,f=(0,i.useDependency)(n.ThemeService),p=e=>{let t=f.getColorFromTheme(`gray.900`),r=f.getColorFromTheme(`gray.0`);return new n.ColorKit(e).isDark()?r:t},h=!!o,g=a?p(a):``;return/* @__PURE__ */ (0,m.jsxs)(`div`,{"data-u-comp":`slide-tab-item`,"data-id":t,role:`tab`,"aria-selected":h,tabIndex:d??(h?0:-1),onKeyDown:c,onClick:u,className:(0,l.clsx)(`univer-relative univer-mx-1 univer-box-border univer-flex univer-flex-grow univer-cursor-pointer univer-select-none univer-flex-row univer-items-center univer-justify-center univer-rounded univer-text-xs univer-font-medium univer-transition-[colors,box-shadow] focus-visible:univer-ring-2 focus-visible:univer-ring-primary-500`,{"dark:!univer-text-gray-0":!a||a&&!g,"univer-bg-gray-0 univer-text-primary-700 univer-shadow":h,"dark:!univer-bg-gray-700":h&&!a,"univer-text-gray-900 hover:univer-bg-gray-100":!h,"dark:hover:!univer-bg-gray-700":!h&&!a},s),style:{backgroundColor:!h&&a?a:``,color:!h&&a?g:``,boxShadow:h&&a?`0px 0px 8px rgba(0, 0, 0, 0.08)`:``},children:[/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-box-border univer-flex univer-max-w-lg univer-items-center univer-gap-1 univer-overflow-hidden univer-whitespace-nowrap univer-rounded univer-border-2 univer-border-solid univer-border-transparent univer-px-1.5 univer-py-1`,children:r}),h&&a&&/* @__PURE__ */ (0,m.jsx)(`div`,{"aria-hidden":!0,className:`univer-pointer-events-none univer-absolute univer-inset-x-2 univer-bottom-0 univer-h-0.5`,style:{backgroundColor:a}})]},t)}function om(e){let{children:t,anchorRect:r,showContextMenu:a,visible:o,onCommandSelect:s,onVisibleChange:c}=e,l=(0,p.useRef)(`sheetbar-tabs-context-menu-${(0,n.generateRandomId)(6)}`);return a?/* @__PURE__ */ (0,m.jsxs)(m.Fragment,{children:[t,/* @__PURE__ */ (0,m.jsx)(i.AnchoredContextMenu,{hostId:l.current,visible:o,anchorRect:r,menuType:i.ContextMenuPosition.FOOTER_TABS,anchorVertical:`top`,menuOffset:6,onRequestClose:()=>c(!1),onOptionSelect:e=>{let{label:t,id:n,commandId:r,value:i}=e;s(r??n??t,i)}})]}):t}function sm(e){return e.left+e.width/2}function cm(e,t,n){let r=e.map(()=>0),i=e[t];if(!i)return{targetIndex:t,itemOffsets:r};r[t]=n;let a=i.left+n,o=a+i.width,s=t;if(n>0)for(let n=t+1;n<e.length;n++)o>sm(e[n])&&(r[n]=-i.width,s=n);else if(n<0)for(let n=t-1;n>=0;n--)a<sm(e[n])&&(r[n]=i.width,s=n);return{targetIndex:s,itemOffsets:r}}function lm(e,t,n){if(t===n||t<0||n<0||t>=e.length||n>=e.length)return[...e];let r=[...e],[i]=r.splice(t,1);return r.splice(n,0,i),r}function um(e,t,n){return e.indexOf(t[n])}let dm={easeOutStrong(e,t,n,r){return-n*((e=e/r-1)*e*e*e-1)+t},backOut(e,t,n,r,i){return i===void 0&&(i=.7),n*((e=e/r-1)*e*((i+1)*e+i)+1)+t}},fm={loop:!1,begin:0,end:0,duration:300,delay:0,type:`easeOutStrong`,receive(e){},success(e){},cancel(e){},complete(e){}};var pm=class{constructor(e){z(this,`_config`,void 0),z(this,`_status`,0),z(this,`_start`,0),z(this,`_handle`,0),z(this,`_delayHandle`,null),this._config={...fm,...e},this._config.loop&&(this._config.complete=()=>{},this._config.success=()=>{this.request()})}static success(...e){let t=0;return new Promise(n=>{for(let r=0;r<e.length;r++){let i=e[r],a=i._config,o=a.success;a.loop||(a.success=r=>{t++,o&&o.call(i,r),t===e.length&&n()})}})}request(){this._config.delay===0?(this._status=0,this._start=Date.now(),this._fakeHandle()):(this._delayHandle&&clearTimeout(this._delayHandle),this._delayHandle=setTimeout(()=>{this._status=0,this._start=Date.now(),this._fakeHandle()},this._config.delay))}cancel(){this._status=1,this._delayHandle&&clearTimeout(this._delayHandle),cancelAnimationFrame(this._handle)}_fakeHandle(){let e=Date.now()-this._start;e=e>=this._config.duration?this._config.duration:e;let t=dm[this._config.type](e,this._config.begin,this._config.end-this._config.begin,this._config.duration,.7).toFixed(2);this._config.receive(t),this._status===1?(this._config.cancel(t),this._config.complete(t)):e===this._config.duration?(this._config.success(t),this._config.complete(t)):this._handle=requestAnimationFrame(()=>{this._fakeHandle()})}};function mm(e){return e.textContent??``}function hm(e){setTimeout(()=>{let t=window.getSelection();t&&(t.selectAllChildren(e),t.collapseToEnd())})}function gm(e){setTimeout(()=>{let t=window.getSelection();if(!t)return;let n=document.createRange();n.selectNodeContents(e),mm(e)||n.collapse(!0),t.removeAllRanges(),t.addRange(n)})}function _m(e,t){let n=!0,r=()=>{},i=mm(e),a=e=>{var t;e.preventDefault();let n=(t=e.clipboardData)==null?void 0:t.getData(`text/plain`);if(n){let e=n.replace(/\s/g,``);document.execCommand(`insertText`,!1,e)}},o=n=>{t.checkName(mm(e))||(t.setEditMode(!1),r(),t.beforeCommit(),t.onCommit(mm(e),n))},s=()=>{e.textContent=i,t.setEditMode(!1),r(),t.beforeCommit(),t.onCancel()},c=t=>{t.stopPropagation(),t.key===`Escape`?(t.preventDefault(),s()):t.key===`Enter`&&(e.blur(),t.preventDefault())},l=()=>{n=!1},u=()=>{n=!0},d=()=>{setTimeout(()=>{if(n){let t=mm(e);t.length>31&&(e.textContent=t.substring(0,31),hm(e))}},0)};return r=()=>{e.removeAttribute(`contentEditable`),e.removeEventListener(`focusout`,o),e.removeEventListener(`compositionstart`,l),e.removeEventListener(`compositionend`,u),e.removeEventListener(`input`,d),e.removeEventListener(`keydown`,c),e.removeEventListener(`paste`,a)},{blurAction:o,compositionstartAction:l,compositionendAction:u,inputAction:d,keydownAction:c,pasteAction:a,cleanup:r}}function vm(e){if(!e.canStart())return;let t=e.slideTabItem.querySelector(`span`);if(!t)return;let n=_m(t,e);t.setAttribute(`contentEditable`,`true`),t.addEventListener(`focusout`,n.blurAction),t.addEventListener(`compositionstart`,n.compositionstartAction),t.addEventListener(`compositionend`,n.compositionendAction),t.addEventListener(`input`,n.inputAction),t.addEventListener(`keydown`,n.keydownAction),t.addEventListener(`paste`,n.pasteAction),e.setEditMode(!0),gm(t)}var ym=class e{constructor(e,t){z(this,`_slideTabItem`,void 0),z(this,`_animate`,void 0),z(this,`_midline`,0),z(this,`_translateX`,void 0),z(this,`_scrollbar`,void 0),z(this,`_slideTabBar`,void 0),z(this,`_editMode`,void 0),z(this,`_placeholder`,void 0),this._slideTabItem=e,this._animate=null,this._translateX=0,this._editMode=!1,this._slideTabBar=t,this._placeholder=null,this._scrollbar=t.getScrollbar(),this.update()}static midline(e){return e.getBoundingRect().x+e.getBoundingRect().width/2}static leftLine(e){return e.getBoundingRect().x}static rightLine(e){return e.getBoundingRect().x+e.getBoundingRect().width}static make(t,n){let r=[];return t.forEach(t=>r.push(new e(t,n))),r}getSlideTabItem(){return this._slideTabItem}getEditor(){return this._slideTabItem.querySelector(`span`)}focus(){var e;(e=this.getEditor())==null||e.focus()}selectAll(){let e=this.getEditor();e&&xm.keepSelectAll(e)}isEditMode(){return this._editMode}classList(){return this._slideTabItem.classList}translateX(e){return this._translateX=e,this._slideTabItem.style.transform=`translateX(${e}px)`,this.getTranslateXDirection()}setEditor(e){this._editMode||vm({slideTabItem:this._slideTabItem,canStart:()=>this._slideTabBar.getConfig().onNameChangeCheck(),checkName:e=>this._slideTabBar.getConfig().onNameCheckAlert(e,this.getId()),setEditMode:e=>{this._editMode=e},beforeCommit:()=>{this._slideTabBar.removeListener(),this._slideTabBar.updateItems()},onCommit:(t,n)=>{try{this._slideTabBar.getConfig().onChangeName(this.getId(),t),e&&e(n)}finally{this._slideTabBar.addListener()}},onCancel:()=>{this._slideTabBar.addListener()}})}nameCheck(){let e=this._slideTabItem.querySelector(`span`);if(!e)return!1;let t=e.textContent??``;return this._slideTabBar.getConfig().onNameCheckAlert(t,this.getId())}animate(){return{translateX:e=>{this._translateX!==e&&(this._animate&&=(this._animate.cancel(),null),this._animate=new pm({begin:this._translateX,end:e,receive:e=>{this._slideTabItem.style.transform=`translateX(${e}px)`}}),this._translateX=e,this._animate.request())},cancel:()=>{this._animate&&=(this._animate.cancel(),null)}}}after(e){this._slideTabItem.after(e._slideTabItem||e)}update(){this._midline=e.midline(this)}disableFixed(){if(this._placeholder){let e=this._slideTabBar.primeval();this._slideTabItem.style.removeProperty(`position`),this._slideTabItem.style.removeProperty(`left`),this._slideTabItem.style.removeProperty(`top`),this._slideTabItem.style.removeProperty(`width`),this._slideTabItem.style.removeProperty(`height`),this._slideTabItem.style.removeProperty(`background`),this._slideTabItem.style.removeProperty(`padding`),this._slideTabItem.style.removeProperty(`box-sizing`),this._slideTabItem.style.removeProperty(`font-size`),this._slideTabItem.style.removeProperty(`font-family`),this._slideTabItem.style.removeProperty(`font-weight`),this._slideTabItem.style.removeProperty(`color`),this._slideTabItem.style.removeProperty(`border-radius`),this._placeholder.after(this._slideTabItem),e.removeChild(this._placeholder),this._placeholder=null}}enableFixed(){let e=document.createElement(`div`),t=this.getBoundingRect(),n=getComputedStyle(this._slideTabItem),r=this._slideTabItem.querySelector(`span`);if(this._placeholder=e,this._placeholder.style.width=`${t.width}px`,this._placeholder.style.height=`${t.height}px`,this._placeholder.style.flexShrink=`0`,this._placeholder.style.margin=n.margin,this._slideTabItem.style.background=n.background,r){let e=getComputedStyle(r).padding;this._slideTabItem.style.padding=e}this._slideTabItem.style.boxSizing=n.boxSizing,this._slideTabItem.style.fontSize=n.fontSize,this._slideTabItem.style.fontFamily=n.fontFamily,this._slideTabItem.style.fontWeight=n.fontWeight,this._slideTabItem.style.color=n.color,this._slideTabItem.style.borderRadius=n.borderRadius,this._slideTabItem.style.left=`${t.x-this.getScrollbar().getScrollX()}px`,this._slideTabItem.style.top=`${t.y}px`,this._slideTabItem.style.width=`${t.width}px`,this._slideTabItem.style.height=`${t.height}px`,this._slideTabItem.style.position=`fixed`,this._slideTabItem.after(e),document.body.appendChild(this._slideTabItem)}addEventListener(e,t,n){this._slideTabItem.addEventListener(e,t,n)}removeEventListener(e,t,n){this._slideTabItem.removeEventListener(e,t,n)}getScrollbar(){return this._scrollbar}getMidLine(){return this._midline}getBoundingRect(){let e=this._slideTabItem.getBoundingClientRect();return e.x+=this._scrollbar.getScrollX(),e}getWidth(){return this.getBoundingRect().width}getTranslateXDirection(){let t=e.midline(this);return t>this._midline?1:t<this._midline?-1:0}equals(e){return e&&e._slideTabItem===this._slideTabItem}getId(){return this._slideTabItem.dataset.id||``}},bm=class{constructor(e){z(this,`_slideTabBar`,void 0),this._slideTabBar=e}scrollX(e){var t;let n=this._slideTabBar.primeval(),r=((t=n.parentElement)==null?void 0:t.clientWidth)??n.clientWidth,i=Math.max(0,n.scrollWidth-r);n.scrollLeft=Math.min(i,Math.max(0,e))}scrollRight(){let e=this._slideTabBar.primeval();this.scrollX(e.scrollWidth)}getScrollX(){return this._slideTabBar.primeval().scrollLeft}},xm=class e{constructor(e){if(z(this,`_activeTabItemIndex`,0),z(this,`_slideTabBar`,void 0),z(this,`_slideTabItems`,[]),z(this,`_config`,void 0),z(this,`_downActionX`,0),z(this,`_moveActionX`,0),z(this,`_compareIndex`,0),z(this,`_activeTabItem`,null),z(this,`_moveAction`,e=>{this._activeTabItem&&(this._moveActionX=e.pageX-this._downActionX,this._moveActionX<=-this._leftMoveX?this._moveActionX=-this._leftMoveX:this._moveActionX>=this._rightMoveX&&(this._moveActionX=this._rightMoveX),this._scrollIncremental=0,this._scrollLeft(e),this._scrollRight(e))}),z(this,`_upAction`,e=>{var t,n,r;if(this._longPressTimer&&=(clearTimeout(this._longPressTimer),null),!this._activeTabItem)return;if(this._activeTabItem.isEditMode()){let t=this._activeTabItem.getSlideTabItem(),n=e.pointerId;n!=null&&t.hasPointerCapture(n)&&t.releasePointerCapture(n),this._activeTabItem.removeEventListener(`pointerup`,this._upAction);return}let i=this._autoScrollTime!==null;this._closeAutoScroll(),this._activeTabItem.disableFixed(),this.updateItems();let a=(t=this._activeTabItem)==null?void 0:t.getSlideTabItem();a&&(a.style.cursor=``,a.releasePointerCapture(e.pointerId),(n=this._activeTabItem)==null||n.removeEventListener(`pointermove`,this._moveAction),(r=this._activeTabItem)==null||r.removeEventListener(`pointerup`,this._upAction),this._config.onSlideEnd&&this._activeTabItemIndex!==this._compareIndex&&i&&(this.removeListener(),this._config.onSlideEnd(e,this._compareIndex||0)),this._scrollIncremental=0,this._downActionX=0,this._moveActionX=0,this._dragStartScrollX=this._slideScrollbar.getScrollX(),this._compareIndex=0)}),z(this,`_downAction`,void 0),z(this,`_wheelAction`,e=>{var t;let n=((t=this._slideTabBar.parentElement)==null?void 0:t.clientWidth)??this._slideTabBar.clientWidth;if(this._slideTabBar.scrollWidth<=n)return;let r=Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY;if(r===0)return;let i=e.deltaMode===WheelEvent.DOM_DELTA_LINE?16:e.deltaMode===WheelEvent.DOM_DELTA_PAGE?n:1;e.preventDefault(),this.setScroll(r*i)}),z(this,`_scrollIncremental`,0),z(this,`_dragStartScrollX`,0),z(this,`_compareDirection`,0),z(this,`_autoScrollTime`,null),z(this,`_slideScrollbar`,void 0),z(this,`_longPressTimer`,null),z(this,`_leftBoundingLine`,0),z(this,`_rightBoundingLine`,0),z(this,`_leftMoveX`,0),z(this,`_rightMoveX`,0),e.slideTabBarContainer==null)throw Error(`not found slide-tab-bar root element`);let t=e.slideTabBarContainer.querySelector(`${e.slideTabBarSelector}`);if(t==null)throw Error(`not found slide-tab-bar`);this._slideTabBar=t,this._slideScrollbar=new bm(this),this._config=e,this._initConfig(),this._downAction=this._createDownAction(),this.addListener()}_createDownAction(){let t=0,n=0,r=0;return i=>{var a,o,s;if((a=this._activeTabItem)!=null&&a.isEditMode())return;this._longPressTimer&&=(clearTimeout(this._longPressTimer),null);let c=(o=i.target)==null||(o=o.closest(this._config.slideTabBarItemSelector))==null?void 0:o.getAttribute(`data-id`),l=this._slideTabItems.findIndex(e=>e.getId()===c);if(c==null||l===-1)return;if(this._activeTabItemIndex!==l){var u,d;(u=this._activeTabItem)==null||u.removeEventListener(`pointermove`,this._moveAction),(d=this._activeTabItem)==null||d.removeEventListener(`pointerup`,this._upAction),this._config.onChangeTab(i,c);return}if(this._compareIndex=l,this._downActionX=i.pageX,this._moveActionX=0,this._scrollIncremental=0,this._dragStartScrollX=this._slideScrollbar.getScrollX(),this._activeTabItem=this._slideTabItems[l],!this._activeTabItem){console.error(`Not found active slide-tab-item in sheet bar`);return}let f=this._activeTabItem.getSlideTabItem();f==null||f.setPointerCapture(i.pointerId),(s=this._activeTabItem)==null||s.addEventListener(`pointerup`,this._upAction);let{x:p,width:m}=this._activeTabItem.getBoundingRect(),{x:h,width:g}=this.getBoundingRect(),_=this._slideScrollbar.getScrollX();if(this._leftBoundingLine=this._downActionX-(p-_),this._rightBoundingLine=p-_+m-this._downActionX,this._leftMoveX=p-h-_,this._rightMoveX=h+g-(p+m)+_,i.button===2||this._hasEditItem())return;let{pageX:v,pageY:y}=i,b=Date.now(),x=b-r<=e.DoubleClickDelay,S=Math.abs(v-t)<10,C=Math.abs(y-n)<10;x&&S&&C&&this._activeTabItem.setEditor(),t=v,n=y,r=b,this._startLongPress(i,f)}}_startLongPress(t,n){this._longPressTimer=setTimeout(()=>{var e,r,i;!n||(e=this._activeTabItem)!=null&&e.isEditMode()||((r=this._activeTabItem)==null||r.enableFixed(),this._startAutoScroll(),n.setPointerCapture(t.pointerId),n.style.cursor=`move`,(i=this._activeTabItem)==null||i.addEventListener(`pointermove`,this._moveAction))},e.LongPressDelay)}static checkedSkipSlide(e){let t=e.target;for(;t!=null&&t!==document.body;){if(t.getAttribute(`data-slide-skip`))return!0;t=t.parentElement}return!1}static keepLastIndex(e){hm(e)}static keepSelectAll(e){gm(e)}update(e){this.removeListener(),this._config.currentIndex=e,this._initConfig(),this.addListener(),this.scrollToItem(e)}primeval(){return this._slideTabBar}updateItems(){for(let e=0;e<this._slideTabItems.length;e++)this._slideTabItems[e].animate().cancel(),this._slideTabItems[e].translateX(0),this._slideTabItems[e].update()}getScrollbar(){return this._slideScrollbar}getConfig(){return this._config}getBoundingRect(){return this._slideTabBar.getBoundingClientRect()}getSlideTabItems(){return this._slideTabItems}getActiveItem(){return this._activeTabItem}isLeftEnd(){return this._slideTabBar.scrollLeft<=1}isRightEnd(){let e=this._slideTabBar.parentElement;return e?Math.max(0,this._slideTabBar.scrollWidth-e.clientWidth)-this._slideTabBar.scrollLeft<=1:!1}addListener(){this._slideTabBar.addEventListener(`wheel`,this._wheelAction,{passive:!1}),this._slideTabItems.forEach(e=>{e.addEventListener(`pointerdown`,this._downAction)})}removeListener(){this._slideTabBar.removeEventListener(`wheel`,this._wheelAction),this._slideTabItems.forEach(e=>{e.removeEventListener(`pointerdown`,this._downAction)})}setScroll(e){this._slideScrollbar.scrollX(this._slideScrollbar.getScrollX()+e),this._config.onScroll({leftEnd:this.isLeftEnd(),rightEnd:this.isRightEnd()})}flipPage(e){if(e>0){let e=this.calculateLeftScrollX(!0);this._slideScrollbar.scrollX(this._slideScrollbar.getScrollX()+e)}else if(e<0){let e=this.calculateRightScrollX(!0);this._slideScrollbar.scrollX(this._slideScrollbar.getScrollX()+e)}this._config.onScroll({leftEnd:this.isLeftEnd(),rightEnd:this.isRightEnd()})}scrollToItem(e){let t=e??this._config.currentIndex;if(t<0||t>=this._slideTabItems.length){console.error(`Index out of bounds`);return}let n=this.calculateTabItemScrollX(t);this._slideScrollbar.scrollX(this._slideScrollbar.getScrollX()+n),this._config.onScroll({leftEnd:this.isLeftEnd(),rightEnd:this.isRightEnd()})}calculateLeftScrollX(e){let t=0;return this._slideTabItems.some(n=>{let r=this._slideTabBar.getBoundingClientRect(),i=r.left+r.width,a=n.getSlideTabItem().getBoundingClientRect(),o=a.left,s=a.width;return o<i&&o+s+8>i&&(t=e?o-r.left-4:o+s-i+4,!0)}),t}calculateRightScrollX(e){let t=0;return this._slideTabItems.some(n=>{let r=this._slideTabBar.getBoundingClientRect(),i=r.left,a=n.getSlideTabItem().getBoundingClientRect(),o=a.left,s=a.width;return o-8<i&&o+s>i&&(t=e?o+s-r.left-r.width+4:o-i-4,!0)}),t}calculateTabItemScrollX(e){let t=0,n=this._slideTabBar.getBoundingClientRect(),r=n.left,i=n.left+n.width,a=this._slideTabItems[e].getSlideTabItem().getBoundingClientRect(),o=a.left,s=a.width;return o-8<r&&(t=o-r-4),o+s+8>i&&(t=o+s-i+4),t}calculateActiveTabItemScrollX(){var e;let t=0,n=this._slideTabBar.getBoundingClientRect(),r=n.left,i=n.left+n.width,a=(e=this._activeTabItem)==null?void 0:e.getSlideTabItem().getBoundingClientRect();if(!a)return 0;let o=a.left,s=a.width;return o-8<r&&o+s>r&&(t=o-r-4),o<i&&o+s+8>i&&(t=o+s-i+4),t}destroy(){this.removeListener(),this._downActionX=0,this._moveActionX=0,this._dragStartScrollX=this._slideScrollbar.getScrollX(),this._compareDirection=0,this._compareIndex=0,this._slideTabItems=[],this._activeTabItem=null}_hasEditItem(){for(let e=0;e<this._slideTabItems.length;e++)if(this._slideTabItems[e].isEditMode())return!0;return!1}_autoScrollFrame(){this._activeTabItem&&(this._slideScrollbar.scrollX(this._slideScrollbar.getScrollX()+this._scrollIncremental),this._updateDragSortState()),this._autoScrollTime=requestAnimationFrame(()=>{this._autoScrollFrame()})}_startAutoScroll(){this._autoScrollTime??this._autoScrollFrame()}_closeAutoScroll(){this._autoScrollTime&&cancelAnimationFrame(this._autoScrollTime),this._autoScrollTime=null}_scrollLeft(e){let t=this.getBoundingRect(),n=e.pageX-t.x;n<this._leftBoundingLine&&(this._scrollIncremental=-Math.min(Math.abs(n-this._leftBoundingLine)*.1,50))}_scrollRight(e){let t=this.getBoundingRect(),n=e.pageX-t.x;n>t.width-this._rightBoundingLine&&(this._scrollIncremental=Math.min(Math.abs(n-(t.width-this._rightBoundingLine))*.1,50))}_sortedItems(){if(this._activeTabItem!=null&&this._activeTabItemIndex!=null&&this._compareIndex!=null&&(this._slideTabItems=lm(this._slideTabItems,this._activeTabItemIndex,this._compareIndex),this._config.slideTabBarItemAutoSort))for(let e=0;e<this._slideTabItems.length;e++){let t=this._slideTabItems[e],n=this._slideTabItems[e+1];n&&t.after(n)}}_compareLeft(){this._updateDragSortState()}_compareRight(){this._updateDragSortState()}_updateDragSortState(){if(!this._activeTabItem)return;let e=this._moveActionX+this._slideScrollbar.getScrollX()-this._dragStartScrollX,t=cm(this._slideTabItems.map(e=>({id:e.getId(),left:e.getMidLine()-e.getWidth()/2,width:e.getWidth()})),this._activeTabItemIndex,e);this._compareIndex=t.targetIndex,t.itemOffsets.forEach((e,t)=>{let n=this._slideTabItems[t];n&&(n.equals(this._activeTabItem)?this._compareDirection=n.translateX(this._moveActionX):n.animate().translateX(e))})}_initConfig(){let e=this._slideTabBar.querySelectorAll(`${this._config.slideTabBarItemSelector}`);this._downActionX=0,this._moveActionX=0,this._compareDirection=0,this._compareIndex=0,this._slideTabItems=ym.make(e,this),this._activeTabItemIndex=this._config.currentIndex,this._activeTabItem=this._slideTabItems[this._activeTabItemIndex]}};z(xm,`LongPressDelay`,500),z(xm,`DoubleClickDelay`,300);function Sm({childType:e}){let t=`univer-size-4 univer-shrink-0`;switch(e){case n.UniverInstanceType.UNIVER_SHEET:return/* @__PURE__ */ (0,m.jsx)(kf,{"aria-hidden":!0,className:t});case n.UniverInstanceType.UNIVER_DOC:return/* @__PURE__ */ (0,m.jsx)(Df,{"aria-hidden":!0,className:t});case n.UniverInstanceType.UNIVER_SLIDE:return/* @__PURE__ */ (0,m.jsx)(jf,{"aria-hidden":!0,className:t});case n.UniverInstanceType.UNIVER_BASE:return/* @__PURE__ */ (0,m.jsx)(Cf,{"aria-hidden":!0,className:t});case n.UniverInstanceType.UNIVER_BOARD:return/* @__PURE__ */ (0,m.jsx)(Tf,{"aria-hidden":!0,className:t});default:return null}}function Cm(){let e=(0,i.useDependency)(n.Injector),[t,a]=(0,p.useState)([]),[s,c]=(0,p.useState)(``),[l,u]=(0,p.useState)(``),[d,f]=(0,p.useState)(!1),[h,g]=(0,p.useState)(null),_=(0,p.useRef)(null),v=(0,p.useRef)(null),y=(0,i.useDependency)(n.ICommandService),b=(0,i.useDependency)(i.ILayoutService),x=(0,i.useDependency)(Nr),S=(0,i.useDependency)(n.LocaleService),C=(0,i.useDependency)(n.IConfirmService),w=(0,i.useDependency)(Y,n.Quantity.OPTIONAL),T=(0,i.useDependency)(r.WorksheetProtectionRuleModel),E=(0,i.useDependency)(r.RangeProtectionRuleModel),D=(0,i.useDependency)(n.IPermissionService),O=Fl(),k=(0,i.useObservable)(T.resetOrder$),A=(0,i.useConfigValue)(i.UI_PLUGIN_CONFIG_KEY),j=(A==null?void 0:A.contextMenu)??!0,M=(0,p.useCallback)(()=>{var e;let t=(e=_.current)==null||(e=e.getActiveItem())==null?void 0:e.getSlideTabItem().getBoundingClientRect();return t?{left:t.left,top:t.top,bottom:t.bottom}:null},[]),N=(0,p.useCallback)(()=>{setTimeout(()=>{var e;let t=(e=_.current)==null?void 0:e.getActiveItem();t&&(t.focus(),t.selectAll())},0)},[]),P=(0,p.useCallback)((e,t)=>{C.open({id:e,title:{title:S.t(`sheets-ui.sheetConfig.sheetNameErrorTitle`)},children:{title:t},cancelText:S.t(`sheets-ui.button.cancel`),confirmText:S.t(`sheets-ui.button.confirm`),onClose(){N(),C.close(e)},onConfirm(){N(),C.close(e)}})},[C,N,S]),F=(0,p.useCallback)(e=>e.trim()===``&&(P(`sheetNameEmptyAlert`,S.t(`sheets-ui.sheetConfig.sheetNameCannotIsEmptyError`)),!0),[S,P]),I=(0,p.useCallback)(e=>!(0,n.nameCharacterCheck)(e)&&(P(`sheetNameSpecCharAlert`,S.t(`sheets-ui.sheetConfig.sheetNameSpecCharError`)),!0),[S,P]),L=(0,p.useCallback)((e,t)=>{var n,r;if((t?(n=O.getSheetBySheetId(t))==null?void 0:n.getName():(r=O.getActiveSheet())==null?void 0:r.getName())===e||!O.checkSheetName(e))return!1;let i=`sheetNameRepeatAlert`;return C.open({id:i,title:{title:S.t(`sheets-ui.sheetConfig.sheetNameErrorTitle`)},children:{title:S.t(`sheets-ui.sheetConfig.sheetNameAlreadyExistsError`)},cancelText:S.t(`sheets-ui.button.cancel`),confirmText:S.t(`sheets-ui.button.confirm`),onClose(){C.close(i),N()},onConfirm(){C.close(i),N()}}),!0},[C,N,S,O]),R=(0,p.useCallback)(()=>{var e;let t=O.getUnitId(),n=O.getActiveSheet();if(!n)return!1;let i=n.getSheetId(),a=T.getRule(t,i),o=E.getSubunitRuleList(t,i).length>0;if(a||o){var s;return((s=D.getPermissionPoint(new r.WorkbookManageCollaboratorPermission(t).id))==null?void 0:s.value)??!1}return((e=D.getPermissionPoint(new r.WorkbookRenameSheetPermission(t).id))==null?void 0:e.value)??!1},[D,E,O,T]),z=(0,p.useCallback)(()=>{let t=O.getActiveSheet(),n=(t==null?void 0:t.getSheetId())??``,r=e.has(Pl)?e.get(Pl):void 0,i=O.getSheets().filter(e=>!e.isSheetHidden()).map((e,n)=>{var i;let a=T.getRule(O.getUnitId(),e.getSheetId()),o=E.getSubunitRuleList(O.getUnitId(),e.getSheetId()).length>0,s=!!(a!=null&&a.permissionId||o),c=Ml(e.getConfig()),l=(c==null?void 0:c.childType)??(c?r==null||(i=r.getSheetTabChildType)==null?void 0:i.call(r,{hostUnitId:O.getUnitId(),hostAnchorId:c.hostAnchorId,embedId:c.embedId}):void 0);return{sheetId:e.getSheetId(),label:/* @__PURE__ */ (0,m.jsxs)(m.Fragment,{children:[l!=null&&/* @__PURE__ */ (0,m.jsx)(Sm,{childType:l}),s&&/* @__PURE__ */ (0,m.jsx)(wd,{className:`univer-shrink-0`}),/* @__PURE__ */ (0,m.jsx)(`span`,{className:`univer-min-w-px univer-truncate univer-outline-none`,children:e.getName()})]}),index:n,selected:t===e,color:e.getTabColor()??void 0}});a(i),c(n)},[e,E,O,T]),ee=(0,p.useCallback)(()=>{var e;(e=_.current)==null||(e=e.getActiveItem())==null||e.setEditor()},[]),B=(0,p.useCallback)(({leftEnd:e,rightEnd:t})=>{u(e&&t?``:e?`inset -10px 0px 10px -10px rgba(0, 0, 0, 0.2)`:t?`inset 10px 0px 10px -10px rgba(0, 0, 0, 0.2)`:`inset 10px 0px 10px -10px rgba(0, 0, 0, 0.2), inset -10px 0px 10px -10px rgba(0, 0, 0, 0.2)`)},[]),V=(0,p.useCallback)(e=>{let t=e.calculateActiveTabItemScrollX();if(t){let n=e.getScrollbar();n.scrollX(n.getScrollX()+t)}x.setScroll({leftEnd:e.isLeftEnd(),rightEnd:e.isRightEnd()})},[x]),H=(0,p.useCallback)(e=>{var t;!e||e===s||(t=_.current)!=null&&(t=t.getActiveItem())!=null&&t.isEditMode()||y.executeCommand(r.SetWorksheetActiveOperation.id,{subUnitId:e,unitId:O.getUnitId()}).then(e=>{e!==!1&&requestAnimationFrame(()=>b.focus(O.getUnitId()))})},[s,y,b,O]),te=(0,p.useCallback)(e=>{var t;let n=(t=v.current)==null?void 0:t.querySelector(`[data-u-comp=slide-tab-bar]`);if(!n)return;let r=new ResizeObserver(()=>{V(e)});return r.observe(n),()=>r.disconnect()},[V]),U=(0,p.useCallback)(e=>{j&&(w!=null&&w.isForceKeepVisible()||(g(e),f(!0)))},[w,j]),ne=(0,p.useCallback)(e=>{if(!e){f(!1);return}let t=M();t&&U(t)},[M,U]),re=(0,p.useCallback)((e,t)=>{y.executeCommand(e,{value:t,subUnitId:s}),f(!1)},[s,y]);(0,p.useEffect)(()=>{if(!d)return;let e=()=>{let e=M();e&&g(e)};return window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},[d,M]);let ie=(0,p.useCallback)(e=>{var t;if(e.preventDefault(),(t=_.current)!=null&&(t=t.getActiveItem())!=null&&t.isEditMode())return;let n=e.target.closest(`[data-u-comp=slide-tab-item]`),i=n==null?void 0:n.dataset.id;if(!i||!n)return;let a=n.getBoundingClientRect(),o={left:a.left,top:a.top,bottom:a.bottom};i===s?U(o):y.executeCommand(r.SetWorksheetActiveOperation.id,{unitId:O.getUnitId(),subUnitId:i}).finally(()=>{U(o)})},[s,y,U,O]),W=(0,p.useCallback)(e=>{var t;let n=e.target;if(n.closest(`[contenteditable=true]`))return;let r=n.closest(`[data-u-comp=slide-tab-item]`),i=r==null?void 0:r.dataset.id;if(!i)return;if(e.key===`Enter`||e.key===` `){e.preventDefault(),H(i);return}if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`)return;let a=Array.from(((t=v.current)==null?void 0:t.querySelectorAll(`[data-u-comp=slide-tab-item]`))??[]),o=a.findIndex(e=>e.dataset.id===i);if(o<0)return;e.preventDefault();let s=a[e.key===`ArrowRight`?Math.min(a.length-1,o+1):Math.max(0,o-1)],c=s==null?void 0:s.dataset.id;s&&c&&(s.focus(),H(c))},[H]),ae=(0,p.useCallback)(()=>{let e=new xm({slideTabBarSelector:`[data-u-comp=slide-tab-bar]`,slideTabBarItemSelector:`[data-u-comp=slide-tab-item]`,slideTabBarItemAutoSort:!0,slideTabBarContainer:v.current,currentIndex:0,onChangeName:(e,t)=>{var n;((n=O.getSheetBySheetId(e))==null?void 0:n.getName())===t?z():y.executeCommand(r.SetWorksheetNameCommand.id,{subUnitId:e,name:t})},onSlideEnd:async(e,t)=>{let n=um(O.getSheetOrders(),O.getUnhiddenWorksheets(),t);await y.executeCommand(r.SetWorksheetOrderCommand.id,{order:n})},onChangeTab:(e,t)=>{y.executeCommand(r.SetWorksheetActiveOperation.id,{subUnitId:t,unitId:O.getUnitId()})},onScroll:e=>{x.setScroll(e)},onNameCheckAlert:(e,t)=>F(e)||I(e)||L(e,t),onNameChangeCheck:R});return _.current=e,{slideTabBar:e,disconnectResizeObserver:te(e)}},[R,y,F,L,te,x,I,z,O]);return(0,p.useEffect)(()=>{let{slideTabBar:e,disconnectResizeObserver:t}=ae(),n=y.onCommandExecuted(e=>{switch(e.id){case r.SetTabColorMutation.id:case r.SetWorksheetHideMutation.id:case r.RemoveSheetMutation.id:case r.SetWorksheetNameMutation.id:case r.InsertSheetMutation.id:case r.SetWorksheetOrderMutation.id:case r.SetWorksheetActiveOperation.id:z()}}),i=x.scroll$.subscribe(B),a=x.scrollX$.subscribe(e=>{var t;(t=_.current)==null||t.flipPage(e)}),o=x.renameId$.subscribe(()=>{ee()}),s=O.activeSheet$.subscribe(()=>{z()});return()=>{n.dispose(),e.destroy(),_.current=null,i.unsubscribe(),a.unsubscribe(),o.unsubscribe(),s.unsubscribe(),t==null||t()}},[y,ae,k,ee,x,B,z,O]),(0,p.useEffect)(()=>{var e;if(!t.length)return;let n=t.findIndex(e=>e.sheetId===s);(e=_.current)==null||e.update(n>=0?n:0)},[s,t]),(0,p.useEffect)(()=>{let e=e=>{let t=v.current,n=e.target;if(!t||!(n instanceof Element))return;let r=n.closest(`[data-u-comp=slide-tab-item]`);r&&t.contains(r)&&H(r.getAttribute(`data-id`)??void 0)};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[H]),(0,p.useEffect)(()=>{let e=(0,o.merge)(T.ruleChange$,E.ruleChange$).subscribe(()=>{z()});return()=>{e.unsubscribe()}},[E,z,T]),!j&&d&&f(!1),/* @__PURE__ */ (0,m.jsx)(om,{showContextMenu:j,visible:d,anchorRect:h,onVisibleChange:ne,onCommandSelect:re,children:/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-max-w-[calc(100%-112px)] univer-overflow-hidden`,ref:v,onDragStart:e=>e.preventDefault(),onContextMenu:ie,children:/* @__PURE__ */ (0,m.jsx)(`div`,{"data-u-comp":`slide-tab-bar`,role:`tablist`,"aria-label":S.t(`sheets-ui.sheetConfig.sheetTabs`),onKeyDown:W,className:`univer-flex univer-select-none univer-flex-row univer-items-center univer-overflow-hidden univer-px-1.5 univer-py-1`,style:{boxShadow:l},children:t.map(e=>/* @__PURE__ */ (0,m.jsx)(am,{...e,selected:s===e.sheetId},e.sheetId))})})})}let wm=()=>{var e,t;let[a,o]=(0,p.useState)(!0),[s,c]=(0,p.useState)(!0),l=(0,i.useDependency)(n.ICommandService),u=(0,i.useDependency)(Nr),d=(0,i.useDependency)(n.IPermissionService),f=Fl().getUnitId(),h=(0,i.useObservable)(d.getPermissionPoint$((e=new r.WorkbookEditablePermission(f))==null?void 0:e.id)),g=(0,i.useObservable)(d.getPermissionPoint$((t=new r.WorkbookCreateSheetPermission(f))==null?void 0:t.id)),_=(0,i.useConfigValue)(U),{show:v=!0,defaultRowCount:y=n.DEFAULT_WORKSHEET_ROW_COUNT,defaultColumnCount:b=n.DEFAULT_WORKSHEET_COLUMN_COUNT}=((_==null?void 0:_.footer)||{}).addSheetButtonConfig||{},x=e=>{let{leftEnd:t,rightEnd:n}=e;o(t),c(n)};return(0,p.useEffect)(()=>{let e=u.scroll$.subscribe((0,n.throttle)(e=>{x(e)},100));return()=>{e.unsubscribe()}},[u.scroll$]),/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-relative univer-flex univer-h-full univer-min-w-0 univer-flex-1`,children:[/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-flex univer-items-center`,children:[v&&/* @__PURE__ */ (0,m.jsx)(rm,{className:`univer-mr-2`,onClick:()=>{l.executeCommand(r.InsertSheetCommand.id,{sheet:{rowCount:y,columnCount:b}}),setTimeout(()=>{u.setAddSheet(0)},0)},disabled:!(g!=null&&g.value&&h!=null&&h.value),children:/* @__PURE__ */ (0,m.jsx)(ud,{})}),/* @__PURE__ */ (0,m.jsx)(im,{})]}),/* @__PURE__ */ (0,m.jsx)(Cm,{}),(!a||!s)&&/* @__PURE__ */ (0,m.jsxs)(`div`,{"data-u-comp":`sheet-bar-scroll-buttons`,className:`univer-relative univer-flex univer-items-center univer-px-2 after:univer-absolute after:univer-right-0 after:univer-top-1/2 after:univer-h-4 after:univer-w-px after:-univer-translate-y-1/2 after:univer-bg-gray-200 after:univer-content-[""] rtl:univer-flex-row-reverse rtl:after:univer-left-0 rtl:after:univer-right-auto`,children:[/* @__PURE__ */ (0,m.jsx)(rm,{disabled:a,onClick:()=>{u.setScrollX(-100)},children:/* @__PURE__ */ (0,m.jsx)(Md,{})}),/* @__PURE__ */ (0,m.jsx)(rm,{disabled:s,onClick:()=>{u.setScrollX(100)},children:/* @__PURE__ */ (0,m.jsx)(Pd,{})})]})]})},Tm=[50,75,100,125,150,175,200,400];function Em(){let e=(0,i.useDependency)(n.ICommandService),t=(0,i.useDependency)(n.IUniverInstanceService),a=Fl(),o=(0,i.useDependency)(Y),s=(0,i.useObservable)(o.visible$),c=(0,p.useCallback)(()=>{if(!a)return 100;let e=a.getActiveSheet(),t=e&&e.getZoomRatio()*100||100;return Math.round(t)},[a]),[l,u]=(0,p.useState)(()=>c());(0,p.useEffect)(()=>(u(c()),e.onCommandExecuted(e=>{if(e.id===Ar.id||e.id===r.SetWorksheetActiveOperation.id){let e=c();u(e)}}).dispose),[e,c]);function d(r){u(r);let i=t.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET),a=i==null?void 0:i.getActiveSheet();if(a==null)return;let o=r/100;e.executeCommand(Mr.id,{unitId:i.getUnitId(),subUnitId:a.getSheetId(),zoomRatio:o})}let f=(s==null?void 0:s.visible)&&(s.unitId===(a==null?void 0:a.getUnitId())||s.unitId===n.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY);return/* @__PURE__ */ (0,m.jsx)(i.Slider,{disabled:f,min:M[0],value:l,shortcuts:Tm,onChange:d})}function Dm(){return/* @__PURE__ */ (0,m.jsx)(`section`,{className:`univer-flex univer-flex-shrink-0 univer-justify-end`,children:/* @__PURE__ */ (0,m.jsx)(Em,{})})}let Om=[u.FUNCTION_NAMES_MATH.SUM,u.FUNCTION_NAMES_STATISTICAL.AVERAGE,u.FUNCTION_NAMES_STATISTICAL.MIN,u.FUNCTION_NAMES_STATISTICAL.MAX],km={[u.FUNCTION_NAMES_MATH.SUM]:`sheets-ui.statusbar.sum`,[u.FUNCTION_NAMES_STATISTICAL.AVERAGE]:`sheets-ui.statusbar.average`,[u.FUNCTION_NAMES_STATISTICAL.MIN]:`sheets-ui.statusbar.min`,[u.FUNCTION_NAMES_STATISTICAL.MAX]:`sheets-ui.statusbar.max`,[u.FUNCTION_NAMES_STATISTICAL.COUNT]:`sheets-ui.statusbar.count`,[u.FUNCTION_NAMES_STATISTICAL.COUNTA]:`sheets-ui.statusbar.countA`,[u.FUNCTION_NAMES_TEXT.CONCATENATE]:`concatenate`};function Am(e){let{pattern:t,value:r}=e;return typeof r==`number`?t&&Om.includes(e.name)?n.numfmt.format(t,r,{throws:!1}):r.toLocaleString():0}let jm=()=>{let e=(0,i.useDependency)(n.LocaleService),t=(0,i.useDependency)(Vo),[r,a]=(0,p.useState)(u.FUNCTION_NAMES_MATH.SUM),[o,s]=(0,p.useState)(!1),[c,d]=(0,p.useState)(()=>t.getFunctions().map(e=>({name:e.func,value:0,show:!0,disable:!0,pattern:null})));(0,p.useEffect)(()=>{let e=t.state$.subscribe(e=>{let t=(e==null?void 0:e.values)??[];d(n=>n.map(n=>{let r=t.find(e=>e.func===n.name);return{...n,value:(r==null?void 0:r.value)??n.value,disable:!r,pattern:(e==null?void 0:e.pattern)??null}}))});return()=>e.unsubscribe()},[t]);let f=c.filter(e=>e.show&&!e.disable),h=f.find(e=>e.name===r)??f.find(e=>e.name===u.FUNCTION_NAMES_MATH.SUM)??f[0];if(!h)return null;let g=t=>{let n=km[t.name]||t.name;return`${e.t(n)}: ${Am(t)}`},_=e=>{a(e),s(!1)};return/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-relative univer-box-border univer-flex univer-h-full univer-min-w-0 univer-max-w-64 univer-items-center univer-overflow-hidden univer-px-2 after:univer-absolute after:univer-right-0 after:univer-top-1/2 after:univer-block after:univer-h-4 after:univer-w-px after:-univer-translate-y-1/2 after:univer-bg-gray-200 after:univer-content-[""]`,children:/* @__PURE__ */ (0,m.jsx)(l.Dropdown,{align:`end`,side:`top`,open:o,onOpenChange:s,overlay:/* @__PURE__ */ (0,m.jsx)(`div`,{"data-u-comp":`status-bar-statistic-menu`,className:`univer-grid univer-w-max univer-max-w-[calc(100vw-16px)] univer-gap-0.5 univer-p-1.5`,children:f.map(e=>{let t=g(e),n=e.name===h.name;return/* @__PURE__ */ (0,m.jsxs)(`button`,{type:`button`,className:(0,l.clsx)(`univer-flex univer-cursor-pointer univer-items-center univer-gap-2 univer-rounded univer-border-none univer-bg-transparent univer-px-2 univer-py-1.5 univer-text-left univer-text-xs univer-text-gray-900 hover:univer-bg-gray-100 dark:!univer-text-gray-200 dark:hover:!univer-bg-gray-800`,{"univer-bg-gray-100 dark:!univer-bg-gray-800":n}),"aria-pressed":n,onClick:()=>_(e.name),children:[/* @__PURE__ */ (0,m.jsx)(`span`,{className:`univer-w-3 univer-shrink-0`,children:n&&/* @__PURE__ */ (0,m.jsx)(bu,{})}),/* @__PURE__ */ (0,m.jsx)(l.Tooltip,{title:t,placement:`top`,children:/* @__PURE__ */ (0,m.jsx)(`span`,{className:`univer-min-w-0 univer-flex-1 univer-truncate`,children:t})})]},e.name)})}),children:/* @__PURE__ */ (0,m.jsxs)(`button`,{type:`button`,"data-u-comp":`status-bar-statistic-picker`,className:`univer-flex univer-min-w-0 univer-max-w-full univer-cursor-pointer univer-items-center univer-gap-1 univer-border-none univer-bg-transparent univer-p-0 univer-text-xs univer-text-gray-400`,children:[/* @__PURE__ */ (0,m.jsx)(l.Tooltip,{title:g(h),placement:`top`,children:/* @__PURE__ */ (0,m.jsx)(`span`,{className:`univer-min-w-0 univer-flex-1 univer-truncate`,children:g(h)})}),/* @__PURE__ */ (0,m.jsx)(Ad,{className:`univer-shrink-0`})]})})})};function Mm(){let e=(0,i.useConfigValue)(U),t=(0,i.useDependency)(i.IMenuManagerService),r=(e==null?void 0:e.footer)??!0,a=Lm(),o=Im(a),s=Rm(),c=zm(a);if(!a||!r||o||s!==n.UniverInstanceType.UNIVER_SHEET&&!c)return null;let l=t.getMenuByPositionKey(i.ContextMenuPosition.FOOTER_MENU),{sheetBar:u=!0,statisticBar:d=!0,menus:f=!0,zoomSlider:p=!0}=(e==null?void 0:e.footer)||{},h=!c&&d,g=!c&&f,_=!c&&p;return!u&&!h&&!g&&!_?null:/* @__PURE__ */ (0,m.jsxs)(`section`,{className:`univer-box-border univer-grid univer-w-full univer-grid-flow-col univer-grid-cols-[1fr,auto,auto,auto] univer-items-center univer-justify-between univer-bg-gray-0 univer-px-5 univer-text-gray-900 dark:!univer-bg-gray-900 dark:!univer-text-gray-200`,"data-range-selector":!0,style:{height:36},children:[u&&/* @__PURE__ */ (0,m.jsx)(wm,{}),h&&/* @__PURE__ */ (0,m.jsx)(jm,{}),g&&l.length>0&&/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-box-border univer-flex univer-gap-2 univer-px-2`,children:l.map(e=>{var t;return(t=e.children)==null?void 0:t.map(e=>(e==null?void 0:e.item)&&/* @__PURE__ */ (0,m.jsx)(i.ToolbarItem,{...e.item},e.key))})}),_&&/* @__PURE__ */ (0,m.jsx)(Dm,{})]})}function Nm(){let e=(0,i.useConfigValue)(U),t=Lm(),r=!!t,a=Im(t),o=Rm(),s=zm(t);return!r||a||s||o!==n.UniverInstanceType.UNIVER_SHEET||(e==null?void 0:e.formulaBar)===!1?null:/* @__PURE__ */ (0,m.jsx)(nm,{})}function Pm(){let e=(0,i.useConfigValue)(U),t=(0,i.useDependency)(i.ComponentManager),r=Fl(),o=Lm(),s=zm(o),c=(0,i.useDependency)(n.Injector),l=Im(r),u=Im(o),d=Rm()===n.UniverInstanceType.UNIVER_SHEET||!!s,f=t.get(`SheetShapeTextEditorContainer`)??t.get(`ShapeTextEditorContainer`),h=t.get(`EMBEDDING_CELL_EDITOR_COMPONENT_KEY`)??Jl;return(0,p.useEffect)(()=>{var e,t,i;if(!o||s||(r==null?void 0:r.getUnitId())!==o.getUnitId()||l||u||!d)return;let f=c.get(n.IUniverInstanceService),p=f.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET),m=c.has(gi)?c.get(gi):void 0,h=m==null?void 0:m.resolveRuntimeScopeByChildUnitId(p==null?void 0:p.getUnitId()),g=p!=null&&(((e=c.get(a.IRenderManagerService).getRenderUnitById(p.getUnitId()))==null?void 0:e.isMainScene)===!1||((t=f.getUnitCreateOptions(p.getUnitId()))==null?void 0:t.embeddedRender)===!0);((p==null?void 0:p.getUnitId())===o.getUnitId()||(h==null?void 0:h.hostUnitId)!==o.getUnitId()&&!g)&&(f.setCurrentUnitForType(o.getUnitId()),f.focusUnit(o.getUnitId()),(i=Bm(c))==null||i.clearTab())},[s,l,r,u,c,d,o]),!o||!d||u?null:s&&o?/* @__PURE__ */ (0,m.jsx)(Fm,{workbook:o,worksheet:s.worksheet}):/* @__PURE__ */ (0,m.jsxs)(m.Fragment,{children:[f&&/* @__PURE__ */ (0,m.jsx)(f,{}),!(e!=null&&e.disableEdit)&&/* @__PURE__ */ (0,m.jsx)(h,{})]})}function Fm(e){let{workbook:t,worksheet:r}=e,a=(0,i.useDependency)(n.Injector),o=Ml(r.getConfig()),s=t.getUnitId(),c=o==null?void 0:o.hostAnchorId,l=o==null?void 0:o.embedId;return(0,p.useEffect)(()=>{if(!l||!c)return;let e=Bm(a);if(e)try{let t=e.mountSheetTab({hostUnitId:s,hostAnchorId:c,embedId:l});return()=>{t==null||t.dispose()}}catch(e){console.warn(`[sheets-ui] failed to mount embedded sheet-tab block`,e)}},[l,c,s,a]),/* @__PURE__ */ (0,m.jsx)(`div`,{"data-embed-sheets-sheet-tab-host":c,className:`univer-absolute univer-inset-0 univer-z-40 univer-bg-gray-0 dark:!univer-bg-gray-900`})}function Im(e){let t=(0,i.useDependency)(n.IUniverInstanceService),r=(0,i.useDependency)(a.IRenderManagerService),s=(0,i.useDependency)(n.Injector),c=s.has(gi)?s.get(gi):void 0,l=(0,i.useObservable)(()=>(0,o.merge)(r.created$,r.disposed$,(c==null?void 0:c.runtimeSessionChanged$)??o.EMPTY),null,!1,[r,c]);return(0,p.useMemo)(()=>{var n,i;return e?(c==null?void 0:c.resolveRuntimeScopeByChildUnitId(e.getUnitId()))!=null||((n=r.getRenderUnitById(e.getUnitId()))==null?void 0:n.isMainScene)===!1||((i=t.getUnitCreateOptions(e.getUnitId()))==null?void 0:i.embeddedRender)===!0:!1},[l,r,c,t,e])}function Lm(){let e=Fl(),t=(0,i.useDependency)(n.Injector),r=(0,i.useDependency)(n.IUniverInstanceService),a=t.has(gi)?t.get(gi):void 0,s=(0,i.useObservable)(()=>(a==null?void 0:a.runtimeSessionChanged$)??o.EMPTY,null,!1,[a]);return(0,p.useMemo)(()=>{if(!e||!a)return e;let t=a.resolveRuntimeScopeByChildUnitId(e.getUnitId());return t!=null&&t.hostUnitId?r.getUnit(t.hostUnitId,n.UniverInstanceType.UNIVER_SHEET)??e:e},[e,r,a,s])}function Rm(){let e=(0,i.useDependency)(i.IWorkbenchService);return(0,i.useObservable)(e.rootUnitType$,null,!0)}function zm(e){let t=Il(e);return t&&Ml(t.getConfig())?{worksheet:t}:void 0}function Bm(e){try{return e.get(Pl)}catch{return}}let Vm={id:r.SheetCopyDownCommand.id,preconditions:e=>_(e),binding:i.KeyCode.D|i.MetaKeys.CTRL_COMMAND},Hm={id:r.SheetCopyRightCommand.id,preconditions:e=>_(e),binding:i.KeyCode.R|i.MetaKeys.CTRL_COMMAND},Um={id:r.SetRowHiddenCommand.id,preconditions:e=>_(e),binding:i.KeyCode.Digit9|i.MetaKeys.CTRL_COMMAND},Wm={id:r.SetColHiddenCommand.id,preconditions:e=>_(e),binding:i.KeyCode.Digit0|i.MetaKeys.CTRL_COMMAND|i.MetaKeys.SHIFT},Gm={id:er.id,description:`sheets-ui.shortcut.sheet.select-below-cell`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_DOWN,priority:100,preconditions:_,staticParameters:{direction:n.Direction.DOWN}},Km={id:er.id,description:`sheets-ui.shortcut.sheet.select-up-cell`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_UP,priority:100,preconditions:_,staticParameters:{direction:n.Direction.UP}},qm={id:er.id,description:`sheets-ui.shortcut.sheet.select-left-cell`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_LEFT,priority:100,preconditions:y,staticParameters:{direction:n.Direction.LEFT}},Jm={id:er.id,description:`sheets-ui.shortcut.sheet.select-right-cell`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_RIGHT,priority:100,preconditions:y,staticParameters:{direction:n.Direction.RIGHT}},Ym={id:tr.id,description:`sheets-ui.shortcut.sheet.select-next-cell`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.TAB,priority:100,preconditions:_,staticParameters:{direction:n.Direction.RIGHT,keycode:i.KeyCode.TAB}},Xm={id:tr.id,description:`sheets-ui.shortcut.sheet.select-previous-cell`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.TAB|i.MetaKeys.SHIFT,priority:100,preconditions:_,staticParameters:{direction:n.Direction.LEFT,keycode:i.KeyCode.TAB}},Zm={id:tr.id,description:`sheets-ui.shortcut.sheet.select-below-cell`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ENTER,priority:100,preconditions:_,staticParameters:{direction:n.Direction.DOWN,keycode:i.KeyCode.ENTER}},Qm={id:tr.id,description:`sheets-ui.shortcut.sheet.select-up-cell`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ENTER|i.MetaKeys.SHIFT,priority:100,preconditions:_,staticParameters:{direction:n.Direction.UP,keycode:i.KeyCode.ENTER}},$m={id:er.id,description:`sheets-ui.shortcut.sheet.select-below-value-cell`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_DOWN|i.MetaKeys.CTRL_COMMAND,preconditions:_,staticParameters:{direction:n.Direction.DOWN,jumpOver:1}},eh={id:er.id,description:`sheets-ui.shortcut.sheet.select-up-value-cell`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_UP|i.MetaKeys.CTRL_COMMAND,preconditions:_,staticParameters:{direction:n.Direction.UP,jumpOver:1}},th={id:er.id,description:`sheets-ui.shortcut.sheet.select-left-value-cell`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_LEFT|i.MetaKeys.CTRL_COMMAND,preconditions:_,staticParameters:{direction:n.Direction.LEFT,jumpOver:1}},nh={id:er.id,description:`sheets-ui.shortcut.sheet.select-right-value-cell`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_RIGHT|i.MetaKeys.CTRL_COMMAND,preconditions:_,staticParameters:{direction:n.Direction.RIGHT,jumpOver:1}},rh={id:nr.id,description:`sheets-ui.shortcut.sheet.expand-selection-down`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_DOWN|i.MetaKeys.SHIFT,preconditions:_,staticParameters:{direction:n.Direction.DOWN}},ih={id:nr.id,description:`sheets-ui.shortcut.sheet.expand-selection-up`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_UP|i.MetaKeys.SHIFT,preconditions:_,staticParameters:{direction:n.Direction.UP}},ah={id:nr.id,description:`sheets-ui.shortcut.sheet.expand-selection-left`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_LEFT|i.MetaKeys.SHIFT,preconditions:_,staticParameters:{direction:n.Direction.LEFT}},oh={id:nr.id,description:`sheets-ui.shortcut.sheet.expand-selection-right`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_RIGHT|i.MetaKeys.SHIFT,preconditions:_,staticParameters:{direction:n.Direction.RIGHT}},sh={id:nr.id,description:`sheets-ui.shortcut.sheet.expand-selection-to-below-gap`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_DOWN|i.MetaKeys.SHIFT|i.MetaKeys.CTRL_COMMAND,preconditions:_,staticParameters:{direction:n.Direction.DOWN,jumpOver:1}},ch={id:nr.id,description:`sheets-ui.shortcut.sheet.expand-selection-to-up-gap`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_UP|i.MetaKeys.SHIFT|i.MetaKeys.CTRL_COMMAND,preconditions:_,staticParameters:{direction:n.Direction.UP,jumpOver:1}},lh={id:nr.id,description:`sheets-ui.shortcut.sheet.expand-selection-to-left-gap`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_LEFT|i.MetaKeys.SHIFT|i.MetaKeys.CTRL_COMMAND,preconditions:_,staticParameters:{direction:n.Direction.LEFT,jumpOver:1}},uh={id:nr.id,description:`sheets-ui.shortcut.sheet.expand-selection-to-right-gap`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.ARROW_RIGHT|i.MetaKeys.SHIFT|i.MetaKeys.CTRL_COMMAND,preconditions:_,staticParameters:{direction:n.Direction.RIGHT,jumpOver:1}},dh={id:rr.id,description:`sheets-ui.shortcut.sheet.select-all`,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,binding:i.KeyCode.A|i.MetaKeys.CTRL_COMMAND,preconditions:_,staticParameters:{expandToGapFirst:!0,loop:!0}},fh={id:tn.id,description:`sheets-ui.shortcut.sheet.set-bold`,group:`4_sheet-edit`,groupTitle:`sheets-ui.shortcut.sheet-edit`,preconditions:e=>v(e),binding:i.KeyCode.B|i.MetaKeys.CTRL_COMMAND},ph={id:nn.id,description:`sheets-ui.shortcut.sheet.set-italic`,group:`4_sheet-edit`,groupTitle:`sheets-ui.shortcut.sheet-edit`,preconditions:e=>v(e),binding:i.KeyCode.I|i.MetaKeys.CTRL_COMMAND},mh={id:rn.id,description:`sheets-ui.shortcut.sheet.set-underline`,group:`4_sheet-edit`,groupTitle:`sheets-ui.shortcut.sheet-edit`,preconditions:e=>v(e),binding:i.KeyCode.U|i.MetaKeys.CTRL_COMMAND},hh={id:an.id,description:`sheets-ui.shortcut.sheet.set-strike-through`,group:`4_sheet-edit`,groupTitle:`sheets-ui.shortcut.sheet-edit`,preconditions:e=>v(e),binding:i.KeyCode.X|i.MetaKeys.SHIFT|i.MetaKeys.CTRL_COMMAND},gh={id:ln.id,description:`sheets-ui.toolbar.fontSizeIncrease`,group:`4_sheet-edit`,groupTitle:`sheets-ui.shortcut.sheet-edit`,preconditions:e=>v(e),binding:i.KeyCode.PERIOD|i.MetaKeys.SHIFT|i.MetaKeys.CTRL_COMMAND},_h={id:un.id,description:`sheets-ui.toolbar.fontSizeDecrease`,group:`4_sheet-edit`,groupTitle:`sheets-ui.shortcut.sheet-edit`,preconditions:e=>v(e),binding:i.KeyCode.COMMA|i.MetaKeys.SHIFT|i.MetaKeys.CTRL_COMMAND},vh={id:r.ClearSelectionContentCommand.id,preconditions:e=>_(e),binding:i.KeyCode.DELETE,mac:i.KeyCode.BACKSPACE},yh={id:r.ClearSelectionContentCommand.id,preconditions:e=>_(e),mac:i.KeyCode.DELETE},bh={id:r.ClearSelectionContentCommand.id,preconditions:e=>_(e),binding:i.MetaKeys.SHIFT+i.KeyCode.BACKSPACE},xh={id:Tt.id,preconditions:e=>_(e),binding:i.MetaKeys.SHIFT+i.KeyCode.DELETE},Sh={id:jr.id,description:`sheets-ui.shortcut.sheet.zoom-in`,binding:i.KeyCode.EQUAL|i.MetaKeys.CTRL_COMMAND,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,preconditions:_,priority:1,staticParameters:{delta:.2}},Ch={id:n.NilCommand.id,binding:i.KeyCode.EQUAL|i.MetaKeys.CTRL_COMMAND},wh={id:jr.id,description:`sheets-ui.shortcut.sheet.zoom-out`,binding:i.KeyCode.MINUS|i.MetaKeys.CTRL_COMMAND,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,preconditions:_,priority:1,staticParameters:{delta:-.2}},Th={id:n.NilCommand.id,binding:i.KeyCode.MINUS|i.MetaKeys.CTRL_COMMAND},Eh={id:jr.id,description:`sheets-ui.shortcut.sheet.reset-zoom`,binding:i.KeyCode.Digit0|i.MetaKeys.CTRL_COMMAND,preconditions:_,group:`3_sheet-view`,groupTitle:`sheets-ui.shortcut.sheet-view`,priority:1,staticParameters:{reset:!0}},Dh={id:n.NilCommand.id,binding:i.KeyCode.Digit0|i.MetaKeys.CTRL_COMMAND},Oh=class extends n.Disposable{constructor(e,t,n,r,i,a,o){super(),this._injector=e,this._layoutService=t,this._commandService=n,this._shortcutService=r,this._menuManagerService=i,this._uiPartsService=a,this._configService=o,this._init()}_init(){this._initCommands(),this._initMenus(),this._initShortcuts(),this._initWorkbenchParts(),this._initFocusHandler()}_initCommands(){[jr,nr,er,tr,Vr,Ln,Fn,In,Qt,$t,fr,mr,rr,Rr,r.SetBoldCommand,Br,X,zr,tn,nn,rn,an,on,sn,cn,ln,un,dn,fn,pn,r.SetItalicCommand,r.SetStrikeThroughCommand,r.SetFontFamilyCommand,r.SetFontSizeCommand,Vn,Hn,Un,Wn,ur,dr,Kn,qn,Jn,Yn,Xn,Hr,r.SetUnderlineCommand,qo,Mr,Ar,Fr,mn,It,hn,Ft,Ko,Gr,Dn,Ur,On,kn,An,jn,Mn,Lr,Nn,Pn,Ir,vr,B,V,Fi].forEach(e=>{this.disposeWithMe(this._commandService.registerCommand(e))})}_initMenus(){this._menuManagerService.mergeMenu(jl)}_initShortcuts(){[Gm,Km,qm,Jm,Ym,Xm,Zm,Qm,$m,eh,th,nh,rh,ih,ah,oh,sh,ch,lh,uh,dh,Sh,wh,Eh,Dh,Ch,Th,fh,ph,mh,hh,gh,_h,vh,yh,bh,xh,...Ri(),Vi,Hi,Bi,zi,Ui,Wi,qi,Ji,Yi,Zi,Gi,Ki,Xi,Vm,Hm,Um,Wm].forEach(e=>{this.disposeWithMe(this._shortcutService.registerShortcut(e))})}_initWorkbenchParts(){let e=this._uiPartsService,t=this._injector;this.disposeWithMe(e.registerComponent(i.BuiltInUIPart.HEADER,()=>(0,i.connectInjector)(Nm,t))),this.disposeWithMe(e.registerComponent(i.BuiltInUIPart.FOOTER,()=>(0,i.connectInjector)(Mm,t))),this.disposeWithMe(e.registerComponent(i.BuiltInUIPart.CONTENT,()=>(0,i.connectInjector)(Pm,t)))}_initFocusHandler(){this.disposeWithMe(this._layoutService.registerFocusHandler(n.UniverInstanceType.UNIVER_SHEET,e=>{let r=this._injector.get(a.IRenderManagerService).getRenderUnitById(n.DOCS_NORMAL_EDITOR_UNIT_ID_KEY),i=r==null?void 0:r.with(t.DocSelectionRenderService);i==null||i.focus()}))}};Oh=K([G(0,(0,n.Inject)(n.Injector)),G(1,i.ILayoutService),G(2,n.ICommandService),G(3,i.IShortcutService),G(4,i.IMenuManagerService),G(5,i.IUIPartsService),G(6,n.IConfigService)],Oh);let kh=(e=[])=>{let t=(0,i.useDependency)(me);(0,p.useEffect)(()=>{let n=e.map(e=>t.addShape({range:e,style:{fill:`rgba(73, 184, 17, 0.05)`,strokeWidth:1,stroke:`#49B811`,widgets:{}},primary:null}));return()=>{n.forEach(e=>{e&&t.removeShape(e)})}},[e])};var Ah=`@univerjs/sheets-ui`,jh=`1.5.2`;let Mh=`sheets.component.cell-popup`,Nh=[`horizontal`,`vertical`,`left-center`],Ph=class extends n.Disposable{constructor(e){super(),this._sheetCanvasPopManagerService=e,z(this,`_cellPopupMap`,/* @__PURE__ */ new Map),z(this,`_change$`,new o.Subject),z(this,`change$`,this._change$.asObservable())}_ensureCellPopupMap(e,t){let r=this._cellPopupMap.get(e);r||(r=/* @__PURE__ */ new Map,this._cellPopupMap.set(e,r));let i=r.get(t);return i||(i=new n.ObjectMatrix,r.set(t,i)),i}showPopup(e,t){var r;let{direction:i=`horizontal`}=t,{unitId:a,subUnitId:o,row:s,col:c}=e,l=this._ensureCellPopupMap(a,o),u=(r=l.getValue(s,c))==null?void 0:r[i];t.id=t.id??(0,n.generateRandomId)();let d=()=>{let n=l.getValue(s,c);if(!n)return;let r=n[i];if(!r)return;let a=r==null?void 0:r.popups.findIndex(e=>e.id===t.id&&e.componentKey===t.componentKey);if(r==null||r.popups.splice(a,1),r.popups.length===0){var o;(o=r.disposable)==null||o.dispose(),n[i]=void 0}this._change$.next({...e,direction:i})};if(u)u.popups.push(t),u.popups.sort((e,t)=>e.priority-t.priority);else{let n=this._sheetCanvasPopManagerService.attachPopupToCell(s,c,{...t,direction:i,componentKey:Mh,extraProps:{...e,direction:i},noPushMinimumGap:!0,autoRelayout:t.autoRelayout??!1,zIndex:90},a,o);l.setValue(s,c,{...l.getValue(s,c),[i]:{disposable:n,popups:[t]}})}return this._change$.next({...e,direction:i}),(0,n.toDisposable)(d)}getPopups(e,t,n,r,i){var a;return((a=this._ensureCellPopupMap(e,t).getValue(n,r))==null||(a=a[i])==null?void 0:a.popups)||[]}hidePopup(e,t,n,r){let i=this._ensureCellPopupMap(e,t),a=i.getValue(n,r);a&&(Nh.forEach(i=>{var o;let s=a[i];s&&((o=s.disposable)==null||o.dispose(),a[i]=void 0,this._change$.next({unitId:e,subUnitId:t,row:n,col:r,direction:i}))}),Nh.every(e=>!a[e])&&i.realDeleteValue(n,r))}hidePopupsForUnit(e,t){let n=this._cellPopupMap.get(e);if(!n)return;let r=[];(t?[[t,n.get(t)]]:[...n.entries()]).forEach(([e,t])=>{t==null||t.forValue((t,n)=>{r.push({subUnitId:e,row:t,col:n})})}),r.forEach(t=>this.hidePopup(e,t.subUnitId,t.row,t.col)),t?n.delete(t):this._cellPopupMap.delete(e)}};Ph=K([G(0,(0,n.Inject)($r))],Ph);let Fh=class extends n.Disposable{constructor(e,t,n){super(),this._context=e,this._editorBridgeService=t,this._cellPopupManagerService=n,this._initEditorVisibleListener()}_initEditorVisibleListener(){this.disposeWithMe(this._editorBridgeService.visible$.pipe((0,o.filter)(e=>e.visible)).subscribe(()=>{let e=this._editorBridgeService.getEditLocation();e&&this._cellPopupManagerService.hidePopup(e.unitId,e.sheetId,e.row,e.column)}))}};Fh=K([G(1,Y),G(2,(0,n.Inject)(Ph))],Fh);let Ih=class extends n.Disposable{constructor(e,t,n,r){super(),this._hoverManagerService=e,this._instanceService=t,this._commandService=n,this._renderManagerService=r,z(this,`_isPointer`,!1),this._initPointerEvent(),this._initHover()}get _mainComponent(){var e;return(e=(0,a.getCurrentTypeOfRenderer)(n.UniverInstanceType.UNIVER_SHEET,this._instanceService,this._renderManagerService))==null?void 0:e.mainComponent}_initHover(){this.disposeWithMe(this._hoverManagerService.currentRichText$.subscribe(e=>{if(e!=null&&e.bullet){if(!this._isPointer){var t;(t=this._mainComponent)==null||t.setCursor(a.CURSOR_TYPE.POINTER)}this._isPointer=!0}else{if(this._isPointer){var n;(n=this._mainComponent)==null||n.setCursor(a.CURSOR_TYPE.AUTO)}this._isPointer=!1}}))}_initPointerEvent(){this.disposeWithMe(this._hoverManagerService.currentClickedCell$.subscribe(e=>{let{location:t,bullet:n}=e;n&&this._commandService.executeCommand(r.ToggleCellCheckboxCommand.id,{unitId:t.unitId,subUnitId:t.subUnitId,row:t.row,col:t.col,paragraphIndex:n.startIndex})}))}};Ih=K([G(0,(0,n.Inject)(Za)),G(1,n.IUniverInstanceService),G(2,n.ICommandService),G(3,a.IRenderManagerService)],Ih);let Lh=class extends n.Disposable{constructor(e,t,n,r,i){super(),this._selectionManagerService=e,this._themeService=t,this._instanceSrv=n,this._cmdSrv=r,this._definedNamesService=i,this._init()}_init(){this.disposeWithMe((0,o.merge)(this._selectionManagerService.selectionMoveStart$,this._selectionManagerService.selectionMoving$,this._selectionManagerService.selectionMoveEnd$,this._selectionManagerService.selectionSet$).pipe((0,o.filter)(e=>!!e)).subscribe(e=>{this._syncDefinedNameRange(e)})),this.disposeWithMe(this._definedNamesService.focusRange$.subscribe(async e=>{if(e==null)return;let{unitId:t}=e,{formulaOrRefString:n}=e;if(n.substring(0,1)===u.operatorToken.EQUALS&&(n=n.substring(1)),!(0,u.isReferenceStrings)(n))return;let i=this._instanceSrv.getUnit(t),a=await this._getSelections(i,t,n);this._selectionManagerService.setSelections(a),this._cmdSrv.executeCommand(r.ScrollToCellOperation.id,{unitId:t,range:a[0].range})}))}_syncDefinedNameRange(e){if(e.length===0)return;let t=e[e.length-1],r=this._instanceSrv.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET),i=r==null?void 0:r.getActiveSheet();i&&this._definedNamesService.setCurrentRange({range:t.range,unitId:r.getUnitId(),sheetId:i.getSheetId()})}async _getSelections(e,t,n){let i=n.split(`,`),a=e.getActiveSheet();if(!a)return[];let o=[];for(let n=0;n<i.length;n++){let s=i[n].trim(),c=(0,u.deserializeRangeWithSheet)(s.trim());if(n===0){let n=e.getSheetBySheetName(c.sheetName);n&&a.getSheetId()!==n.getSheetId()&&(a=n,await this._cmdSrv.executeCommand(r.SetWorksheetActivateCommand.id,{subUnitId:a.getSheetId(),unitId:t}))}if(a.getName()!==c.sheetName)continue;let l=null;if(n===i.length-1){let{startRow:e,startColumn:t,endRow:n,endColumn:i}=c.range;l=(0,r.getPrimaryForRange)({startRow:e,startColumn:t,endRow:n,endColumn:i},a)}o.push({range:c.range,style:j(this._themeService),primary:l})}return o}};Lh=K([G(0,(0,n.Inject)(r.SheetsSelectionsService)),G(1,(0,n.Inject)(n.ThemeService)),G(2,n.IUniverInstanceService),G(3,n.ICommandService),G(4,u.IDefinedNamesService)],Lh);function Rh({popup:e,DropdownMenuComponent:t=l.DropdownMenu}){var n;let[r,i]=(0,p.useState)(!1),[a,o]=(0,p.useState)(!1),s=(n=e.extraProps)==null?void 0:n.alert;if(!s)return null;let{type:c,title:u,message:d,menu:f,action:h,width:g}=s;if(f!=null&&f.length){let e=[u,d].filter(e=>typeof e==`string`).join(`: `),n=r||a;return/* @__PURE__ */ (0,m.jsx)(`div`,{onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:/* @__PURE__ */ (0,m.jsx)(t,{align:`start`,open:r,onOpenChange:i,items:[{type:`custom`,className:`univer-px-2 univer-py-1.5 univer-font-medium univer-text-gray-900 dark:!univer-text-gray-0`,children:d},{type:`separator`},...f.map(e=>({type:`item`,children:e.label,disabled:e.disabled,onSelect:e.onSelect}))],children:/* @__PURE__ */ (0,m.jsxs)(`button`,{type:`button`,"aria-label":e||void 0,className:`univer-flex univer-items-center univer-gap-1 univer-rounded univer-border univer-border-solid univer-border-gray-200 univer-bg-gray-0 univer-p-1 univer-shadow hover:univer-bg-gray-100 dark:!univer-border-gray-600 dark:!univer-bg-gray-900 dark:hover:!univer-bg-gray-800`,children:[/* @__PURE__ */ (0,m.jsx)(_f,{className:`univer-text-yellow-500`}),n&&/* @__PURE__ */ (0,m.jsx)(Ad,{className:`univer-text-gray-600 dark:!univer-text-gray-300`})]})})})}let _={2:/* @__PURE__ */ (0,m.jsx)(Bu,{className:`univer-text-red-500`}),0:/* @__PURE__ */ (0,m.jsx)(fd,{className:`univer-text-blue-500`}),1:/* @__PURE__ */ (0,m.jsx)(_f,{className:`univer-text-yellow-500`})};return/* @__PURE__ */ (0,m.jsxs)(`div`,{style:{width:g},className:`univer-z-[100] univer-box-border univer-rounded-lg univer-bg-gray-0 univer-px-2 univer-py-1 univer-text-gray-900 univer-shadow dark:!univer-bg-gray-1000 dark:!univer-text-gray-0`,children:[/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-mb-1.5 univer-flex univer-h-5 univer-flex-row univer-items-center univer-gap-x-1.5 univer-text-sm univer-font-medium`,children:[c?_[c]:null,u]}),/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-text-sm`,children:d}),h&&/* @__PURE__ */ (0,m.jsx)(l.Button,{className:`univer-mt-2`,disabled:h.disabled,onClick:h.onSelect,children:h.label})]})}let zh=`univer.sheet.cell-alert`,Bh=/* @__PURE__ */ function(e){return e[e.INFO=0]=`INFO`,e[e.WARNING=1]=`WARNING`,e[e.ERROR=2]=`ERROR`,e}({}),Vh=class extends n.Disposable{get currentAlert(){return this._currentAlert}constructor(e,t){super(),this._renderManagerService=e,this._cellPopupManagerService=t,z(this,`_currentAlert$`,new o.Subject),z(this,`_currentAlert`,/* @__PURE__ */ new Map),z(this,`currentAlert$`,this._currentAlert$.asObservable()),this.disposeWithMe(()=>{this.clearAlert(),this._currentAlert$.complete()})}showAlert(e){var t,n,r;let i=this._currentAlert.get(e.key);i?(i.dispose.dispose(),i.alert=e):(i={alert:e,dispose:{dispose(){}}},this._currentAlert.set(e.key,i));let{location:a}=e,{row:o,col:s,unitId:c,subUnitId:l}=a;if(!this._renderManagerService.getRenderUnitById(c))return;let u=this._cellPopupManagerService.showPopup({unitId:c,subUnitId:l,row:o,col:s},{componentKey:zh,direction:(t=e.menu)!=null&&t.length?`left-center`:`horizontal`,autoRelayout:!!((n=e.menu)!=null&&n.length),showOnSelectionMoving:!!((r=e.menu)!=null&&r.length),extraProps:{alert:e},priority:1});u&&(i.dispose=u),this._currentAlert$.next(Array.from(this._currentAlert.entries()))}removeAlert(e){let t=this._currentAlert.get(e);t&&(this._currentAlert.delete(e),t==null||t.dispose.dispose(),this._currentAlert$.next(Array.from(this._currentAlert.entries())))}clearAlert(){this._currentAlert.forEach(e=>{e.dispose.dispose()}),this._currentAlert.clear(),this._currentAlert$.next(Array.from(this._currentAlert.entries()))}};Vh=K([G(0,a.IRenderManagerService),G(1,(0,n.Inject)(Ph))],Vh);let Hh=class extends n.Disposable{constructor(e,t,n,r,i,a,o){super(),this._context=e,this._selectionManagerService=t,this._cellAlertManagerService=n,this._localeService=r,this._configService=i,this._commandService=a,this._univerInstanceService=o,this._init()}_init(){this._initCellAlertPopup()}_initCellAlertPopup(){this.disposeWithMe(this._selectionManagerService.selectionChanged$.subscribe(e=>this._updateAlert(e))),this.disposeWithMe(this._context.unit.activeSheet$.subscribe(()=>this._updateAlert(this._selectionManagerService.getCurrentSelections()))),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(n.UniverInstanceType.UNIVER_SHEET).subscribe(()=>this._updateAlert(this._selectionManagerService.getCurrentSelections())))}_isCurrentSheet(e){let t=this._selectionManagerService.currentSelectionParam;return!!(e&&(t==null?void 0:t.unitId)===this._context.unit.getUnitId()&&t.sheetId===e.getSheetId())}_updateAlert(e){var t,i;this._hideAlert();let a=this._context.unit,o=a.getActiveSheet();if(!this._isCurrentSheet(o)||(e==null?void 0:e.length)!==1||(t=this._configService.getConfig(`sheets-ui.config`))!=null&&t.disableForceStringAlert)return;let s=e[0],c=s.primary;if(!c)return;let l=c.actualRow,u=c.actualColumn,d=o.getCell(l,u);if(!d||d.v===null||d.v===void 0)return;let f=a.getStyles().get(d.s);if((0,n.isTextFormat)(f==null||(i=f.n)==null?void 0:i.pattern)||d.t!==n.CellValueType.FORCE_STRING&&d.t!==n.CellValueType.STRING||!(0,n.isRealNum)(d.v)&&!(typeof d.v==`string`&&(0,n.getNumfmtParseValueFilter)(d.v)))return;let p=a.getUnitId(),m=o.getSheetId(),h={...s.range};this._cellAlertManagerService.showAlert({type:1,title:this._localeService.t(`sheets-ui.info.error`),message:this._localeService.t(`sheets-ui.info.forceStringInfo`),location:{unitId:p,subUnitId:m,row:l,col:u},width:200,height:74,key:this._alertKey,menu:[{label:this._localeService.t(`sheets-ui.info.convertToNumber`),onSelect:()=>{this._commandService.syncExecuteCommand(r.TextToNumberCommand.id,{unitId:p,subUnitId:m,ranges:[h]})&&this._hideAlert()}}]})}get _alertKey(){return`SHEET_FORCE_STRING_ALERT:${this._context.unit.getUnitId()}`}_hideAlert(){this._cellAlertManagerService.removeAlert(this._alertKey)}};Hh=K([G(1,(0,n.Inject)(r.SheetsSelectionsService)),G(2,(0,n.Inject)(Vh)),G(3,(0,n.Inject)(n.LocaleService)),G(4,n.IConfigService),G(5,n.ICommandService),G(6,n.IUniverInstanceService)],Hh);let Uh=class extends n.RxDisposable{constructor(e,t,n,r){super(),this._context=e,this._sheetSkeletonManagerService=t,this._sheetInterceptorService=n,this._configService=r,this._initViewModelIntercept()}_initViewModelIntercept(){let e={tl:{size:6,color:`#409f11`}};this.disposeWithMe(this._sheetInterceptorService.intercept(r.INTERCEPTOR_POINT.CELL_CONTENT,{priority:10,effect:n.InterceptorEffectEnum.Style,handler:(t,r,i)=>{var a;if(!((a=this._sheetSkeletonManagerService.getCurrentParam())!=null&&a.skeleton))return i(t);let o=r.rawData;if(!o||o.v===null||o.v===void 0)return i(t);if(((t==null?void 0:t.t)===n.CellValueType.FORCE_STRING||(t==null?void 0:t.t)===n.CellValueType.STRING)&&((0,n.isRealNum)(o.v)||typeof o.v==`string`&&(0,n.getNumfmtParseValueFilter)(o.v))){var s,c;let a=r.workbook.getStyles().get(o.s);return(0,n.isTextFormat)(a==null||(s=a.n)==null?void 0:s.pattern)||(c=this._configService.getConfig(`sheets-ui.config`))!=null&&c.disableForceStringMark||(t===o&&(t={...o}),t.markers={...t==null?void 0:t.markers,...e}),i(t)}return i(t)}}))}};Uh=K([G(1,(0,n.Inject)(q)),G(2,(0,n.Inject)(r.SheetInterceptorService)),G(3,n.IConfigService)],Uh);let Wh=class extends n.Disposable{constructor(e,t,n,r,i,a,o){super(),this._commandService=e,this._formatPainterService=t,this._univerInstanceService=n,this._renderManagerService=r,this._selectionManagerService=i,this._sheetInterceptorService=a,this._injector=o,this._initialize()}_initialize(){this._addDefaultHook();let e=this._injector.get(i.FormatPainterSessionService),t=!0,a=this._injector.invoke(ds).disabled$;this.disposeWithMe(e.register({id:`sheet-cells`,priority:0,clear:()=>this._commandService.executeCommand(r.ClearSelectionFormatCommand.id),changes$:a.pipe((0,o.tap)(e=>{t=e})),isActive:()=>{var e;return((e=this._univerInstanceService.getFocusedUnit())==null?void 0:e.type)===n.UniverInstanceType.UNIVER_SHEET},canStart:()=>!t&&!!this._selectionManagerService.getCurrentLastSelection(),capture:()=>{let e=this._univerInstanceService.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET),t=this._collectSelectionRangeFormat();return!e||!t?null:(this._formatPainterService.setSelectionFormat(t),{unitId:e.getUnitId(),apply:e=>!!e.subUnitId&&!!e.range&&this._commandService.executeCommand(Wn.id,e),onModeChange:e=>this._formatPainterService.setStatus({off:0,once:1,continuous:2}[e])})}})),this.disposeWithMe(this._formatPainterService.status$.subscribe(t=>{t===0&&e.isActive(`sheet-cells`)&&e.cancel()}))}_addDefaultHook(){this._formatPainterService.addHook({id:`default-format-painter`,priority:0,isDefaultHook:!0,onStatusChange:e=>{if(e!==0&&!this._injector.get(i.FormatPainterSessionService).isActive(`sheet-cells`)){let e=this._collectSelectionRangeFormat();e&&this._formatPainterService.setSelectionFormat(e)}},onApply:(e,t,n,r)=>this._getUndoRedoMutationInfo(e,t,n,r)})}_collectSelectionRangeFormat(){let e=this._selectionManagerService.getCurrentLastSelection(),t=e==null?void 0:e.range;if(!t)return null;let{startRow:r,endRow:i,startColumn:a,endColumn:o}=t,s=this._univerInstanceService.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET),c=s==null?void 0:s.getActiveSheet();if(!c)return null;let l=c.getCellMatrix(),u=s.getStyles(),d=new n.ObjectMatrix,f=[];for(let e=r;e<=i;e++)for(let t=a;t<=o;t++){let r=l.getValue(e,t);d.setValue(e,t,n.Tools.deepClone(u.getStyleByCell(r)||{}));let{isMergedMainCell:i,...a}=c.getCellInfoInMergeData(e,t);i&&f.push({startRow:a.startRow,startColumn:a.startColumn,endRow:a.endRow,endColumn:a.endColumn})}return{styles:d,merges:f}}_getUndoRedoMutationInfo(e,t,i,a){let o=this._sheetInterceptorService,s=this._univerInstanceService,{merges:c,styles:l}=a;if(!l)return{undos:[],redos:[]};let{startRow:u,startColumn:d,endRow:f,endColumn:p}=l.getDataRange(),m=f-u+1,h=p-d+1,g=i.startRow===i.endRow&&i.startColumn===i.endColumn?{startRow:i.startRow,startColumn:i.startColumn,endRow:i.startRow+m-1,endColumn:i.startColumn+h-1}:i,_=Array.from({length:g.endRow-g.startRow+1},()=>Array.from({length:g.endColumn-g.startColumn+1},()=>({}))),v=[];_.forEach((e,t)=>{e.forEach((e,n)=>{let r=t%m+u,i=n%h+d,a=l.getValue(r,i);a&&(_[t][n].s=Object.keys(a).length>0?a:null)})});let y=0,b=0;c.forEach(e=>{e.startRow===u&&e.startColumn===d&&(y=e.endRow-e.startRow,b=e.endColumn-e.startColumn);let t={startRow:e.startRow-u,startColumn:e.startColumn-d,endRow:e.endRow-u,endColumn:e.endColumn-d},n=Math.max(1,Math.floor((g.endRow-g.startRow+1)/m)),r=Math.max(1,Math.floor((g.endColumn-g.startColumn+1)/h));for(let e=0;e<n;e++)for(let n=0;n<r;n++)v.push({startRow:t.startRow+e*m+g.startRow,startColumn:t.startColumn+n*h+g.startColumn,endRow:t.endRow+e*m+g.startRow,endColumn:t.endColumn+n*h+g.startColumn})});let x=[g],S=new n.ObjectMatrix,C=new n.ObjectMatrix;if(n.Tools.isArray(_))for(let e=0;e<x.length;e++){let{startRow:t,startColumn:n,endRow:r,endColumn:i}=x[e];for(let e=0;e<=r-t;e++)for(let r=0;r<=i-n;r++)S.setValue(e+t,r+n,{s:null}),C.setValue(e+t,r+n,_[e][r])}let w={subUnitId:t,unitId:e,trigger:r.SetStyleCommand.id,cellValue:S.getMatrix()},T={subUnitId:t,unitId:e,trigger:r.SetStyleCommand.id,cellValue:C.getMatrix()},E=this._injector.invoke(r.SetRangeValuesUndoMutationFactory,w),{undos:D,redos:O}=o.onCommandExecute({id:r.SetRangeValuesCommand.id,params:{...T,range:x}}),k=[],A=[];if(v.length>0){let n=(0,r.getAddMergeMutationRangeByType)(v),i=s.getUnit(e).getSheetBySheetId(t),a=br(i,n),o={unitId:e,subUnitId:t,ranges:n},c={unitId:e,subUnitId:t,ranges:n};k.push({id:r.RemoveWorksheetMergeMutation.id,params:o}),k.push({id:r.AddWorksheetMergeMutation.id,params:c});let l=this._injector.invoke(r.RemoveMergeUndoMutationFactory,o),u=this._injector.invoke(r.AddMergeUndoMutationFactory,c);if(A.push({id:r.RemoveWorksheetMergeMutation.id,params:u}),A.push({id:r.AddWorksheetMergeMutation.id,params:l}),a){let t=this._injector.invoke(t=>(0,r.getClearContentMutationParamsForRanges)(t,e,i,n));k.unshift(...t.redos),A.push(...t.undos)}}if(!n.Rectangle.equals(g,i)){let a={actualRow:g.startRow,actualColumn:g.startColumn,rangeType:n.RANGE_TYPE.NORMAL,isMerged:y>0||b>0,isMergedMainCell:!1,startRow:g.startRow,startColumn:g.startColumn,endRow:g.startRow+y,endColumn:g.startColumn+b};k.push({id:r.SetSelectionsOperation.id,params:{unitId:e,subUnitId:t,type:r.SelectionMoveType.ONLY_SET,selections:[{range:g,primary:a,style:null}]}}),A.unshift({id:r.SetSelectionsOperation.id,params:{unitId:e,subUnitId:t,type:r.SelectionMoveType.ONLY_SET,selections:[{range:i,primary:a,style:null}]}})}return{undos:[{id:r.SetRangeValuesMutation.id,params:w},{id:r.SetRangeValuesMutation.id,params:E},...D,...A],redos:[{id:r.SetRangeValuesMutation.id,params:w},{id:r.SetRangeValuesMutation.id,params:T},...O,...k]}}};Wh=K([G(0,n.ICommandService),G(1,zn),G(2,n.IUniverInstanceService),G(3,a.IRenderManagerService),G(4,(0,n.Inject)(r.SheetsSelectionsService)),G(5,(0,n.Inject)(r.SheetInterceptorService)),G(6,(0,n.Inject)(n.Injector))],Wh);let Gh=class extends n.Disposable{constructor(e,t,n,r){super(),this._context=e,this._markSelectionService=t,this._commandService=n,this._sheetSkeletonManagerService=r,this._initListeners()}_initListeners(){this._addRemoveListener(),this._addRefreshListener()}_addRemoveListener(){let e=[X.id];this.disposeWithMe(this._commandService.onCommandExecuted(t=>{e.includes(t.id)?this._markSelectionService.removeAllShapes():this._markSelectionService.getShapeMap().forEach((e,n)=>{e.exits.includes(t.id)&&this._markSelectionService.removeShape(n)})}))}_addRefreshListener(){this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.subscribe(e=>{e&&this._markSelectionService.refreshShapes()}))}};Gh=K([G(1,(0,n.Inject)(me)),G(2,n.ICommandService),G(3,(0,n.Inject)(q))],Gh);let Kh=[{value:`DEFAULT_PASTE`,label:`sheets-ui.rightClick.paste`},{value:`SPECIAL_PASTE_VALUE`,label:`sheets-ui.rightClick.pasteValue`},{value:`SPECIAL_PASTE_FORMAT`,label:`sheets-ui.rightClick.pasteFormat`},{value:`SPECIAL_PASTE_COL_WIDTH`,label:`sheets-ui.rightClick.pasteColWidth`},{value:`SPECIAL_PASTE_BESIDES_BORDER`,label:`sheets-ui.rightClick.pasteBesidesBorder`},{value:`SPECIAL_PASTE_FORMULA`,label:`sheets-ui.rightClick.pasteFormula`}],qh=e=>{var t;let r=(0,i.useDependency)(n.IUniverInstanceService),o=(0,i.useDependency)(a.IRenderManagerService),s=Fl();if(!e||!s)return null;let c={startRow:e.rows[0],startCol:e.cols[0],endRow:e.rows[e.rows.length-1],endCol:e.cols[e.cols.length-1]};if(c.endRow<0||c.endCol<0)return null;let l=o.getRenderUnitById(s.getUnitId()),u=l==null?void 0:l.with(q),d=ar(r,o);if(!d)return null;let{scene:f}=d,p=u==null?void 0:u.getCurrentSkeleton(),m=Cr(c.endRow,c.endCol,f,s.getActiveSheet());if(!m)return null;let h=f==null?void 0:f.scaleX,g=f==null?void 0:f.scaleY,_=f==null?void 0:f.getViewportScrollXY(m),v=(t=f.getEngine())==null?void 0:t.getCanvas();if(!h||!f||!h||!g||!_)return null;let y=p==null?void 0:p.getNoMergeCellWithCoordByIndex(c.endRow,c.endCol),b=(y==null?void 0:y.endX)??0,x=(y==null?void 0:y.endY)??0,S=(0,a.convertTransformToOffsetX)(b,h,_)??-9999,C=(0,a.convertTransformToOffsetY)(x,g,_)??-9999,w=v==null?void 0:v.getWidth(),T=v==null?void 0:v.getHeight();if(!w||!T)return null;let E=S+50<=w,D=C+50<=T,O=S,k=C;return E||(O=w-100),D||(k=T-100),{positionX:O,positionY:k}},Jh=({DropdownMenuComponent:e=l.DropdownMenu}={})=>{let t=(0,i.useDependency)(gt),r=(0,i.useObservable)(t.showMenu$,!1),a=(0,i.useObservable)(t.pasteOptionsCache$,null),o=(0,i.useDependency)(n.LocaleService),s=(0,i.useDependency)(n.ICommandService),c=(0,i.useDependency)(i.ILayoutService),[u,d]=(0,p.useState)(!1),[f,h]=(0,p.useState)(!1),g=a==null?void 0:a.target.pastedRange,_=qh(g);if(!_||!r||_.positionX<50||_.positionY<30)return null;let v=u||f,y=e=>{h(!1),s.executeCommand(Pt.id,{type:e})};return/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-absolute univer-inset-0 univer-z-10 univer-size-0`,children:/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-absolute`,style:{left:_.positionX+2,top:_.positionY+2},onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),children:/* @__PURE__ */ (0,m.jsx)(e,{align:`start`,onCloseAutoFocus:e=>{e.preventDefault(),c.focus()},items:Kh.map(e=>({type:`checkbox`,value:e.value,label:o.t(e.label),checked:(a==null?void 0:a.pasteType)===J[e.value],onSelect:()=>y(e.value)})),open:f,onOpenChange:h,children:/* @__PURE__ */ (0,m.jsxs)(`div`,{className:(0,l.clsx)(`univer-flex univer-items-center univer-gap-2 univer-rounded univer-p-1 hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-800`,l.borderClassName,{"univer-bg-gray-100 dark:!univer-bg-gray-800":f,"univer-bg-gray-0 dark:!univer-bg-gray-900":!f}),children:[/* @__PURE__ */ (0,m.jsx)(Lp,{className:`univer-fill-primary-600 univer-text-gray-900 dark:!univer-text-gray-0`}),v&&/* @__PURE__ */ (0,m.jsx)(Ad,{className:`dark:!univer-text-gray-0`})]})})})})};function Yh(){return/* @__PURE__ */ (0,m.jsx)(Jh,{DropdownMenuComponent:l.MobileDropdownMenu})}let Xh=class extends n.Disposable{constructor(e,t,n){var r;super();let a=t.getConfig(U);a!=null&&(r=a.clipboardConfig)!=null&&r.hidePasteOptions||this.disposeWithMe(n.registerComponent(i.BuiltInUIPart.CONTENT,()=>(0,i.connectInjector)(Yh,e)))}};Xh=K([G(0,(0,n.Inject)(n.Injector)),G(1,n.IConfigService),G(2,i.IUIPartsService)],Xh);let Zh=e=>{let{popup:t}=e,{row:n,col:r,direction:a,unitId:s,subUnitId:c}=t.extraProps,l=(0,i.useDependency)(Ph),u=(0,i.useObservable)((0,p.useMemo)(()=>l.change$.pipe((0,o.filter)(e=>e.row===n&&e.col===r&&e.direction===a),(0,o.map)(()=>l.getPopups(s,c,n,r,a))),[l,r,a,n,c,s]),l.getPopups(s,c,n,r,a)),d=(0,i.useDependency)(i.ComponentManager);return/* @__PURE__ */ (0,m.jsx)(`div`,{"data-u-comp":`sheets-ui-cell-popup`,className:`
|
|
10
10
|
${a===`left-center`?`univer-mr-px`:`univer-ml-px`}
|
|
11
11
|
univer-flex univer-flex-col
|
|
12
12
|
`,children:u.map(e=>{let t=d.get(e.componentKey);return t?/* @__PURE__ */ (0,m.jsx)(t,{popup:e},e.id??e.componentKey):null})})};function Qh(e){let{popup:t}=e,{extraProps:n}=t,{options:r,defaultValue:i,onChange:a}=n,[o,s]=(0,p.useState)(i??[]);return/* @__PURE__ */ (0,m.jsx)(l.CascaderList,{options:r,value:o,onChange:a})}Qh.componentKey=`sheets.dropdown.cascader`;function $h(e){if(e==null||!Number.isFinite(e))return``;let t=e<0?`-`:``,n=Math.round(Math.abs(e)*24*60*60*1e3),r=Math.floor(n/36e5),i=Math.floor(n/6e4)%60,a=Math.floor(n/1e3)%60,o=n%1e3;return`${t}${r}:${String(i).padStart(2,`0`)}:${String(a).padStart(2,`0`)}${o?`.${String(o).padStart(3,`0`)}`:``}`}function eg(e){let t=e.trim().match(/^([+-])?(\d+):([0-5]\d):([0-5]\d)(?:\.(\d{1,3}))?$/);if(!t)return null;let[,n,r,i,a,o=``]=t,s=Number(r)*3600+Number(i)*60+Number(a)+Number(o.padEnd(3,`0`))/1e3;return(n===`-`?-1:1)*s/86400}function tg(e){let{popup:t}=e,{extraProps:r}=t,{hideFn:a,patternType:o,defaultValue:s,durationValue:c,unsupportedValue:u,onChange:d,onDurationChange:f,onSerialChange:h,exceptionalDateLabel:g,preserveDefaultValue:_,showTime:v}=r,[y,b]=(0,p.useState)(s),[x,S]=(0,p.useState)(()=>$h(c)),[C,w]=(0,p.useState)(()=>u==null?``:String(u)),[T,E]=(0,p.useState)(!1),[D,O]=(0,p.useState)(),[k]=(0,p.useState)(()=>o===`time`?(0,n.dateKit)(`1900-01-01 00:00:00`):(0,n.dateKit)()),A=y&&y.isValid()?y:k,j=(0,i.useDependency)(n.LocaleService),M=eg(x),N=Number(C),P=C.trim()!==``&&Number.isFinite(N)&&N>=0?N:null,F=_&&!T&&(o===`duration`?c!=null:s!=null),I=async()=>{if(u!=null){if(!T||P==null)return;await(h==null?void 0:h(P))&&a()}else if(o===`duration`){if(M==null)return;await(f==null?void 0:f(F?void 0:M))&&a()}else A&&await(d==null?void 0:d(F?void 0:A,D))&&a()};function L(){return u==null?o===`duration`?/* @__PURE__ */ (0,m.jsx)(l.Input,{value:x,onChange:e=>{S(e),E(!0)}}):o===`time`?/* @__PURE__ */ (0,m.jsx)(l.TimeInput,{value:A.toDate(),onValueChange:e=>{b((0,n.dateKit)(e)),E(!0),O(`time`)}}):/* @__PURE__ */ (0,m.jsx)(l.Calendar,{value:A.toDate(),showSelection:!g,showTime:v??o===`datetime`,onValueChange:(e,t)=>{b((0,n.dateKit)(e)),E(!0),O(t)}}):/* @__PURE__ */ (0,m.jsx)(l.Input,{value:C,onChange:e=>{w(e),E(!0)}})}return/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-rounded univer-bg-gray-0 univer-p-2 univer-shadow-lg dark:!univer-bg-gray-1000`,children:[L(),g&&u==null&&/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-px-2 univer-pb-2 univer-text-center univer-text-sm`,children:g}),/* @__PURE__ */ (0,m.jsx)(`footer`,{className:(0,l.clsx)(`univer-mt-2 univer-flex univer-justify-end univer-pt-2`,l.borderTopClassName),children:/* @__PURE__ */ (0,m.jsx)(l.Button,{size:`small`,variant:`primary`,onClick:I,disabled:u==null?o===`duration`?M==null:!A||!A.isValid():!T||P==null,children:j.t(`sheets-ui.data-validation.alert.ok`)})})]})}tg.componentKey=`sheets.dropdown.date`;function ng(e,t){return e?t?(0,r.deserializeListOptions)(e):[e]:[]}function rg(e){let{value:t,onChange:a,multiple:o,options:s,onEdit:c,style:u,location:d,showEdit:f,showSearch:h}=e,g=(0,i.useDependency)(n.LocaleService),_=(0,i.useDependency)(n.ThemeService);(0,i.useObservable)(_.currentTheme$);let{row:v,col:y,unitId:b,subUnitId:x}=d,S=(0,p.useRef)(null);(0,p.useEffect)(()=>{let e=null;return h&&(e=setTimeout(()=>{var e;(e=S.current)==null||e.focus()},0)),()=>{e&&clearTimeout(e)}},[h]);let[C,w]=(0,p.useState)(``),T=(0,p.useMemo)(()=>s.filter(e=>!C||e.label.toLowerCase().includes(C)),[s,C]),E=e=>{w(e.toLowerCase())},D=(0,i.useDependency)(r.SheetPermissionCheckController),O=(0,p.useMemo)(()=>D.permissionCheckWithRanges({workbookTypes:[r.WorkbookEditablePermission],rangeTypes:[r.RangeProtectionPermissionEditPoint],worksheetTypes:[r.WorksheetEditPermission]},[{startColumn:y,startRow:v,endColumn:y,endRow:v}],b,x),[D,y,v,b,x]);return/* @__PURE__ */ (0,m.jsxs)(`div`,{"data-u-comp":`sheets-dropdown-list`,className:(0,l.clsx)(`univer-box-border univer-rounded-lg univer-bg-gray-0 univer-py-1 univer-text-gray-900 univer-shadow dark:!univer-bg-gray-1000 dark:!univer-text-gray-0`,l.borderClassName),style:u,children:[h&&/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-box-border univer-flex univer-w-full univer-px-2`,children:/* @__PURE__ */ (0,m.jsx)(l.Input,{ref:S,type:`text`,value:C,autoFocus:!0,onChange:E})}),/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-px-3.5 univer-py-1 univer-pt-2 univer-text-xs`,children:g.t(o?`sheets-ui.data-validation.listMultiple.dropdown`:`sheets-ui.data-validation.list.dropdown`)}),/* @__PURE__ */ (0,m.jsx)(`div`,{className:(0,l.clsx)(`univer-flex univer-max-h-52 univer-flex-col univer-gap-1 univer-overflow-y-auto univer-px-2 univer-py-1`,l.scrollbarClassName),children:T.map((e,r)=>{var i;let c=t.indexOf(e.value)>-1,u=()=>{let n;n=c?new Set(t.filter(t=>t!==e.value)):new Set(o?[...t,e.value]:[e.value]);let r=[];s.forEach(e=>{n.has(e.value)&&r.push(e.value)}),a(r)},d=e.label.toLocaleLowerCase().indexOf(C),f=!!((i=e.color)!=null&&i.includes(`.`)&&_.isValidThemeColor(e.color)),p=f?_.getColorFromTheme(e.color):e.color,h=new n.ColorKit(p),g=!!p&&p!==`transparent`&&h.getAlpha()>0,v=h.isDark();return/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-flex univer-cursor-pointer univer-flex-row univer-items-center univer-justify-between univer-rounded-md univer-px-1.5 univer-py-1 hover:univer-bg-gray-50 dark:hover:!univer-bg-gray-700`,onClick:u,children:[/* @__PURE__ */ (0,m.jsx)(`div`,{className:(0,l.clsx)(`univer-inline-flex univer-h-4 univer-w-fit univer-items-center univer-truncate univer-rounded-full univer-px-1.5 univer-text-xs`,{"univer-text-gray-900":g&&(f||!v),"univer-text-gray-0":g&&!f&&v}),style:{background:p},children:C&&e.label.toLowerCase().includes(C)?/* @__PURE__ */ (0,m.jsxs)(m.Fragment,{children:[/* @__PURE__ */ (0,m.jsx)(`span`,{children:e.label.substring(0,d)}),/* @__PURE__ */ (0,m.jsx)(`span`,{className:`univer-font-semibold`,children:e.label.substring(d,d+C.length)}),/* @__PURE__ */ (0,m.jsx)(`span`,{children:e.label.substring(d+C.length)})]}):e.label}),/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-ml-3 univer-size-4 univer-flex-shrink-0 univer-flex-grow-0 univer-text-base univer-text-primary-500`,children:c&&/* @__PURE__ */ (0,m.jsx)(bu,{className:`univer-text-primary-600`})})]},r)})},C),f&&O&&/* @__PURE__ */ (0,m.jsx)(`div`,{className:(0,l.clsx)(`univer-box-border univer-px-2 univer-pt-1`,l.borderTopClassName),children:/* @__PURE__ */ (0,m.jsx)(`a`,{className:`univer-block univer-cursor-pointer univer-rounded univer-px-1.5 univer-py-1 univer-text-xs hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-800`,onClick:c,children:g.t(`sheets-ui.data-validation.list.edit`)})})]})}function ig(e){let{popup:{extraProps:t,anchorRect:n}}=e,{location:i,hideFn:a,onChange:o,onEdit:s,options:c,defaultValue:l,multiple:u,showSearch:d,showEdit:f}=t,{worksheet:h}=i,[g,_]=(0,p.useState)(l);if(!h)return null;let v=((n==null?void 0:n.right)??0)-((n==null?void 0:n.left)??0);return/* @__PURE__ */ (0,m.jsx)(rg,{style:{minWidth:v,maxWidth:Math.max(v,200)},value:ng(g,u),multiple:u,onChange:async e=>{let t=u?(0,r.serializeListOptions)(e):e[0]??``;_(t),await(o==null?void 0:o(e))!==!1&&a()},options:c,onEdit:s,location:i,showEdit:f,showSearch:d})}ig.componentKey=`sheets.dropdown.list`;let ag=({className:e})=>/* @__PURE__ */ (0,m.jsxs)(`svg`,{className:e,width:`120`,height:`2`,viewBox:`0 0 120 2`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M0.98999 1.08218H-0.0100098V0.0821838H0.98999V1.08218Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M5.78992 1.08218H2.78992V0.0821838H5.78992V1.08218Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M7.58984 1.08218H8.58984V0.0821838H7.58984V1.08218Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M14.9152 1.08218H13.9152V0.0821838H14.9152V1.08218Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M16.7151 1.08218H19.7151V0.0821838H16.7151V1.08218Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M22.515 1.08218H21.515V0.0821838H22.515V1.08218Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M27.8405 1.08218H28.8405V0.0821838H27.8405V1.08218Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M33.6404 1.08218H30.6404V0.0821838H33.6404V1.08218Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M35.4403 1.08218H36.4403V0.0821838H35.4403V1.08218Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M42.7657 1.08218H41.7657V0.0821838H42.7657V1.08218Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M44.5657 1.08218H47.5657V0.0821838H44.5657V1.08218Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M50.3656 1.08218H49.3656V0.0821838H50.3656V1.08218Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M55.691 1.08218H56.691V0.0821838H55.691V1.08218Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M61.491 1.08218H58.491V0.0821838H61.491V1.08218Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M63.2909 1.08218H64.2909V0.0821838H63.2909V1.08218Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M70.6163 1.08218H69.6163V0.0821838H70.6163V1.08218Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M72.4163 1.08218H75.4163V0.0821838H72.4163V1.08218Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M78.2162 1.08218H77.2162V0.0821838H78.2162V1.08218Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M83.5416 1.08218H84.5416V0.0821838H83.5416V1.08218Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M89.3416 1.08218H86.3416V0.0821838H89.3416V1.08218Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M91.1415 1.08218H92.1415V0.0821838H91.1415V1.08218Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M98.4669 1.08218H97.4669V0.0821838H98.4669V1.08218Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M100.267 1.08218H103.267V0.0821838H100.267V1.08218Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M106.067 1.08218H105.067V0.0821838H106.067V1.08218Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M111.392 1.08218H112.392V0.0821838H111.392V1.08218Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M117.192 1.08218H114.192V0.0821838H117.192V1.08218Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M118.992 1.08218H119.992V0.0821838H118.992V1.08218Z`})]}),og=({className:e})=>/* @__PURE__ */ (0,m.jsxs)(`svg`,{className:e,width:`120`,height:`2`,viewBox:`0 0 120 2`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M-0.0100098 1.15771H0.98999V0.157715H-0.0100098V1.15771Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M2.78992 1.15771H5.78992V0.157715H2.78992V1.15771Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M8.58984 1.15771H7.58984V0.157715H8.58984V1.15771Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M10.3899 1.15771H11.3899V0.157715H10.3899V1.15771Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M19.0903 1.15771H18.0903V0.157715H19.0903V1.15771Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M20.8903 1.15771H23.8903V0.157715H20.8903V1.15771Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M26.6902 1.15771H25.6902V0.157715H26.6902V1.15771Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M28.4902 1.15771H29.4902V0.157715H28.4902V1.15771Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M37.1907 1.15771H36.1907V0.157715H37.1907V1.15771Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M38.9906 1.15771H41.9906V0.157715H38.9906V1.15771Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M44.7905 1.15771H43.7905V0.157715H44.7905V1.15771Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M46.5906 1.15771H47.5906V0.157715H46.5906V1.15771Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M55.291 1.15771H54.291V0.157715H55.291V1.15771Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M57.0909 1.15771H60.0909V0.157715H57.0909V1.15771Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M62.8909 1.15771H61.8909V0.157715H62.8909V1.15771Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M64.6909 1.15771H65.6909V0.157715H64.6909V1.15771Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M73.3914 1.15771H72.3914V0.157715H73.3914V1.15771Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M75.1913 1.15771H78.1913V0.157715H75.1913V1.15771Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M80.9912 1.15771H79.9912V0.157715H80.9912V1.15771Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M82.7913 1.15771H83.7913V0.157715H82.7913V1.15771Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M91.4917 1.15771H90.4917V0.157715H91.4917V1.15771Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M93.2916 1.15771H96.2916V0.157715H93.2916V1.15771Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M99.0916 1.15771H98.0916V0.157715H99.0916V1.15771Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M100.892 1.15771H101.892V0.157715H100.892V1.15771Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M109.592 1.15771H108.592V0.157715H109.592V1.15771Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M111.392 1.15771H114.392V0.157715H111.392V1.15771Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M117.192 1.15771H116.192V0.157715H117.192V1.15771Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M118.992 1.15771H119.992V0.157715H118.992V1.15771Z`})]}),sg=({className:e})=>/* @__PURE__ */ (0,m.jsxs)(`svg`,{className:e,width:`120`,height:`2`,viewBox:`0 0 120 2`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M-0.00842285 1.22449H2.99158V0.224487H-0.00842285V1.22449Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M6.14941 1.22449H9.14941V0.224487H6.14941V1.22449Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M15.3073 1.22449H12.3073V0.224487H15.3073V1.22449Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M18.4651 1.22449H21.4651V0.224487H18.4651V1.22449Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M27.6229 1.22449H24.6229V0.224487H27.6229V1.22449Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M30.7808 1.22449H33.7808V0.224487H30.7808V1.22449Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M39.9386 1.22449H36.9386V0.224487H39.9386V1.22449Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M43.0964 1.22449H46.0964V0.224487H43.0964V1.22449Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M52.2543 1.22449H49.2543V0.224487H52.2543V1.22449Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M55.4121 1.22449H58.4121V0.224487H55.4121V1.22449Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M64.5699 1.22449H61.5699V0.224487H64.5699V1.22449Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M67.7278 1.22449H70.7278V0.224487H67.7278V1.22449Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M76.8856 1.22449H73.8856V0.224487H76.8856V1.22449Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M80.0435 1.22449H83.0435V0.224487H80.0435V1.22449Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M89.2013 1.22449H86.2013V0.224487H89.2013V1.22449Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M92.3591 1.22449H95.3591V0.224487H92.3591V1.22449Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M101.517 1.22449H98.517V0.224487H101.517V1.22449Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M104.675 1.22449H107.675V0.224487H104.675V1.22449Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M113.833 1.22449H110.833V0.224487H113.833V1.22449Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M116.99 1.22449H119.99V0.224487H116.99V1.22449Z`})]}),cg=({className:e})=>/* @__PURE__ */ (0,m.jsxs)(`svg`,{className:e,width:`120`,height:`2`,viewBox:`0 0 120 2`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M0.491699 1.69537H1.4917V0.695374H0.491699V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M4.2981 1.69537H5.2981V0.695374H4.2981V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M9.10449 1.69537H8.10449V0.695374H9.10449V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M11.9109 1.69537H12.9109V0.695374H11.9109V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M16.7173 1.69537H15.7173V0.695374H16.7173V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M19.5237 1.69537H20.5237V0.695374H19.5237V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M24.3301 1.69537H23.3301V0.695374H24.3301V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M27.1365 1.69537H28.1365V0.695374H27.1365V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M31.9429 1.69537H30.9429V0.695374H31.9429V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M34.7493 1.69537H35.7493V0.695374H34.7493V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M39.5557 1.69537H38.5557V0.695374H39.5557V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M42.3621 1.69537H43.3621V0.695374H42.3621V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M47.1685 1.69537H46.1685V0.695374H47.1685V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M49.9749 1.69537H50.9749V0.695374H49.9749V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M54.7812 1.69537H53.7812V0.695374H54.7812V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M57.5876 1.69537H58.5876V0.695374H57.5876V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M62.394 1.69537H61.394V0.695374H62.394V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M65.2004 1.69537H66.2004V0.695374H65.2004V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M70.0068 1.69537H69.0068V0.695374H70.0068V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M72.8132 1.69537H73.8132V0.695374H72.8132V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M77.6196 1.69537H76.6196V0.695374H77.6196V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M80.426 1.69537H81.426V0.695374H80.426V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M85.2324 1.69537H84.2324V0.695374H85.2324V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M88.0388 1.69537H89.0388V0.695374H88.0388V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M92.8452 1.69537H91.8452V0.695374H92.8452V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M95.6516 1.69537H96.6516V0.695374H95.6516V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M100.458 1.69537H99.458V0.695374H100.458V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M103.264 1.69537H104.264V0.695374H103.264V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M108.071 1.69537H107.071V0.695374H108.071V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M110.877 1.69537H111.877V0.695374H110.877V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M115.684 1.69537H114.684V0.695374H115.684V1.69537Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M118.49 1.69537H119.49V0.695374H118.49V1.69537Z`})]}),lg=({className:e})=>/* @__PURE__ */ (0,m.jsxs)(`svg`,{className:e,width:`120`,height:`8`,viewBox:`0 0 120 8`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[/* @__PURE__ */ (0,m.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M119.991 2.06215H-0.0090332V0.862152H119.991V1.86215Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M119.991 6.66215H-0.0090332V5.86215H119.991V6.86215Z`})]}),ug=({className:e})=>/* @__PURE__ */ (0,m.jsxs)(`svg`,{className:e,width:`120`,height:`2`,viewBox:`0 0 120 2`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M-0.00976562 1.65707H0.990234V0.657074H-0.00976562V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M2.32361 1.65707H3.32361V0.657074H2.32361V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M5.65698 1.65707H4.65698V0.657074H5.65698V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M6.99036 1.65707H7.99036V0.657074H6.99036V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M10.3237 1.65707H9.32373V0.657074H10.3237V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M11.6571 1.65707H12.6571V0.657074H11.6571V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M14.9905 1.65707H13.9905V0.657074H14.9905V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M16.3239 1.65707H17.3239V0.657074H16.3239V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M19.6572 1.65707H18.6572V0.657074H19.6572V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M20.9906 1.65707H21.9906V0.657074H20.9906V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M24.324 1.65707H23.324V0.657074H24.324V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M25.6573 1.65707H26.6573V0.657074H25.6573V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M28.9907 1.65707H27.9907V0.657074H28.9907V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M30.3241 1.65707H31.3241V0.657074H30.3241V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M33.6575 1.65707H32.6575V0.657074H33.6575V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M34.9908 1.65707H35.9908V0.657074H34.9908V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M38.3242 1.65707H37.3242V0.657074H38.3242V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M39.6576 1.65707H40.6576V0.657074H39.6576V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M42.991 1.65707H41.991V0.657074H42.991V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M44.3243 1.65707H45.3243V0.657074H44.3243V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M47.6577 1.65707H46.6577V0.657074H47.6577V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M48.9911 1.65707H49.9911V0.657074H48.9911V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M52.3245 1.65707H51.3245V0.657074H52.3245V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M53.6578 1.65707H54.6578V0.657074H53.6578V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M56.9912 1.65707H55.9912V0.657074H56.9912V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M58.3246 1.65707H59.3246V0.657074H58.3246V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M61.658 1.65707H60.658V0.657074H61.658V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M62.9913 1.65707H63.9913V0.657074H62.9913V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M66.3247 1.65707H65.3247V0.657074H66.3247V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M67.6581 1.65707H68.6581V0.657074H67.6581V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M70.9915 1.65707H69.9915V0.657074H70.9915V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M72.3248 1.65707H73.3248V0.657074H72.3248V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M75.6582 1.65707H74.6582V0.657074H75.6582V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M76.9916 1.65707H77.9916V0.657074H76.9916V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M80.325 1.65707H79.325V0.657074H80.325V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M81.6583 1.65707H82.6583V0.657074H81.6583V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M84.9917 1.65707H83.9917V0.657074H84.9917V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M86.3251 1.65707H87.3251V0.657074H86.3251V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M89.6584 1.65707H88.6584V0.657074H89.6584V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M90.9918 1.65707H91.9918V0.657074H90.9918V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M94.3252 1.65707H93.3252V0.657074H94.3252V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M95.6586 1.65707H96.6586V0.657074H95.6586V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M98.9919 1.65707H97.9919V0.657074H98.9919V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M100.325 1.65707H101.325V0.657074H100.325V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M103.659 1.65707H102.659V0.657074H103.659V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M104.992 1.65707H105.992V0.657074H104.992V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M108.325 1.65707H107.325V0.657074H108.325V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M109.659 1.65707H110.659V0.657074H109.659V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M112.992 1.65707H111.992V0.657074H112.992V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M114.325 1.65707H115.325V0.657074H114.325V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M117.659 1.65707H116.659V0.657074H117.659V1.65707Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M118.992 1.65707H119.992V0.657074H118.992V1.65707Z`})]}),dg=({className:e})=>/* @__PURE__ */ (0,m.jsx)(`svg`,{className:e,width:`120`,height:`3`,viewBox:`0 0 120 3`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:/* @__PURE__ */ (0,m.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M119.991 2.42035H-0.0090332V0.420349H119.991V2.42035Z`})}),fg=({className:e})=>/* @__PURE__ */ (0,m.jsxs)(`svg`,{className:e,width:`120`,height:`3`,viewBox:`0 0 120 3`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M-0.0100098 2.47614H1.98999V0.476135H-0.0100098V2.47614Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M3.99014 2.47614H9.99014V0.476135H3.99014V2.47614Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M13.9901 2.47614H11.9901V0.476135H13.9901V2.47614Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M21.1904 2.47614H23.1904V0.476135H21.1904V2.47614Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M31.1906 2.47614H25.1906V0.476135H31.1906V2.47614Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M33.1906 2.47614H35.1906V0.476135H33.1906V2.47614Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M44.3909 2.47614H42.3909V0.476135H44.3909V2.47614Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M46.391 2.47614H52.391V0.476135H46.391V2.47614Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M56.391 2.47614H54.391V0.476135H56.391V2.47614Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M63.5913 2.47614H65.5913V0.476135H63.5913V2.47614Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M73.5915 2.47614H67.5915V0.476135H73.5915V2.47614Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M75.5915 2.47614H77.5915V0.476135H75.5915V2.47614Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M86.7917 2.47614H84.7917V0.476135H86.7917V2.47614Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M88.7919 2.47614H94.7919V0.476135H88.7919V2.47614Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M98.7919 2.47614H96.7919V0.476135H98.7919V2.47614Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M105.992 2.47614H107.992V0.476135H105.992V2.47614Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M115.992 2.47614H109.992V0.476135H115.992V2.47614Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M117.992 2.47614H119.992V0.476135H117.992V2.47614Z`})]}),pg=({className:e})=>/* @__PURE__ */ (0,m.jsxs)(`svg`,{className:e,width:`120`,height:`2`,viewBox:`0 0 120 2`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M-0.0100098 2.00415H1.98999V0.00415039H-0.0100098V2.00415Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M3.99014 2.00415H9.99014V0.00415039H3.99014V2.00415Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M13.9901 2.00415H11.9901V0.00415039H13.9901V2.00415Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M15.9901 2.00415H17.9901V0.00415039H15.9901V2.00415Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M27.4905 2.00415H25.4905V0.00415039H27.4905V2.00415Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M29.4906 2.00415H35.4906V0.00415039H29.4906V2.00415Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M39.4906 2.00415H37.4906V0.00415039H39.4906V2.00415Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M41.4906 2.00415H43.4906V0.00415039H41.4906V2.00415Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M52.991 2.00415H50.991V0.00415039H52.991V2.00415Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M54.9911 2.00415H60.9911V0.00415039H54.9911V2.00415Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M64.9911 2.00415H62.9911V0.00415039H64.9911V2.00415Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M66.9911 2.00415H68.9911V0.00415039H66.9911V2.00415Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M78.4915 2.00415H76.4915V0.00415039H78.4915V2.00415Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M80.4916 2.00415H86.4916V0.00415039H80.4916V2.00415Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M90.4916 2.00415H88.4916V0.00415039H90.4916V2.00415Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M92.4916 2.00415H94.4916V0.00415039H92.4916V2.00415Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M103.992 2.00415H101.992V0.00415039H103.992V2.00415Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M105.992 2.00415H111.992V0.00415039H105.992V2.00415Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M115.992 2.00415H113.992V0.00415039H115.992V2.00415Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M117.992 2.00415H119.992V0.00415039H117.992V2.00415Z`})]}),mg=({className:e})=>/* @__PURE__ */ (0,m.jsxs)(`svg`,{className:e,width:`118`,height:`3`,viewBox:`0 0 118 3`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M-0.00854492 2.94815H1.99146V0.948151H-0.00854492V2.94815Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M6.09668 2.94815H8.09668V0.948151H6.09668V2.94815Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M14.2019 2.94815H12.2019V0.948151H14.2019V2.94815Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M18.3071 2.94815H20.3071V0.948151H18.3071V2.94815Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M26.4124 2.94815H24.4124V0.948151H26.4124V2.94815Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M30.5176 2.94815H32.5176V0.948151H30.5176V2.94815Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M38.6228 2.94815H36.6228V0.948151H38.6228V2.94815Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M42.728 2.94815H44.728V0.948151H42.728V2.94815Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M50.8333 2.94815H48.8333V0.948151H50.8333V2.94815Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M54.9385 2.94815H56.9385V0.948151H54.9385V2.94815Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M63.0437 2.94815H61.0437V0.948151H63.0437V2.94815Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M67.1489 2.94815H69.1489V0.948151H67.1489V2.94815Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M75.2542 2.94815H73.2542V0.948151H75.2542V2.94815Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M79.3594 2.94815H81.3594V0.948151H79.3594V2.94815Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M87.4645 2.94815H85.4645V0.948151H87.4645V2.94815Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M91.5697 2.94815H93.5697V0.948151H91.5697V2.94815Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M99.6749 2.94815H97.6749V0.948151H99.6749V2.94815Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M103.78 2.94815H105.78V0.948151H103.78V2.94815Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M111.885 2.94815H109.885V0.948151H111.885V2.94815Z`}),/* @__PURE__ */ (0,m.jsx)(`path`,{d:`M115.991 2.94815H117.991V0.948151H115.991V2.94815Z`})]}),hg=({className:e})=>/* @__PURE__ */ (0,m.jsx)(`svg`,{className:e,width:`120`,height:`4`,viewBox:`0 0 120 4`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:/* @__PURE__ */ (0,m.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M119.991 3.86215H-0.0090332V0.862152H119.991V3.86215Z`})}),gg=({className:e})=>/* @__PURE__ */ (0,m.jsx)(`svg`,{className:e,width:`120`,height:`2`,viewBox:`0 0 120 2`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:/* @__PURE__ */ (0,m.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M119.991 1.15668H-0.0090332V0.156677H119.991V1.15668Z`})});function _g(e){let{type:t=n.BorderStyleTypes.THIN,className:r}=e;switch(t){case n.BorderStyleTypes.DASH_DOT:return/* @__PURE__ */ (0,m.jsx)(ag,{className:r});case n.BorderStyleTypes.DASH_DOT_DOT:return/* @__PURE__ */ (0,m.jsx)(og,{className:r});case n.BorderStyleTypes.DASHED:return/* @__PURE__ */ (0,m.jsx)(sg,{className:r});case n.BorderStyleTypes.DOTTED:return/* @__PURE__ */ (0,m.jsx)(cg,{className:r});case n.BorderStyleTypes.HAIR:return/* @__PURE__ */ (0,m.jsx)(ug,{className:r});case n.BorderStyleTypes.MEDIUM:return/* @__PURE__ */ (0,m.jsx)(dg,{className:r});case n.BorderStyleTypes.MEDIUM_DASH_DOT:return/* @__PURE__ */ (0,m.jsx)(fg,{className:r});case n.BorderStyleTypes.MEDIUM_DASH_DOT_DOT:return/* @__PURE__ */ (0,m.jsx)(pg,{className:r});case n.BorderStyleTypes.MEDIUM_DASHED:return/* @__PURE__ */ (0,m.jsx)(mg,{className:r});case n.BorderStyleTypes.THICK:return/* @__PURE__ */ (0,m.jsx)(hg,{className:r});case n.BorderStyleTypes.DOUBLE:return/* @__PURE__ */ (0,m.jsx)(lg,{className:r});case n.BorderStyleTypes.THIN:default:return/* @__PURE__ */ (0,m.jsx)(gg,{className:r})}}function vg(e){let t=(0,i.useDependency)(n.LocaleService),a=(0,i.useDependency)(i.IconManager),o=(0,i.useDependency)(r.SheetsSelectionsService),{direction:s}=(0,p.useContext)(l.ConfigContext),{isAllValuesSame:c,value:u}=o.getCellStylesProperty(`bd`),d=c?v(u):void 0,{onChange:f,value:h,ColorPickerComponent:g=l.ColorPicker,DropdownComponent:_=l.Dropdown}=e;function v(e){if(e)for(let n in e){var t;let r=e[n];if(r!=null&&(t=r.cl)!=null&&t.rgb)return r.cl.rgb}}function y(e,t){f==null||f({...h,[t]:e})}function b(e){let t=a.get(e);return t&&/* @__PURE__ */ (0,m.jsx)(t,{className:`univer-fill-primary-600`})}return/* @__PURE__ */ (0,m.jsxs)(`section`,{dir:s,className:`univer-box-border univer-grid univer-gap-2 univer-p-1.5`,children:[/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-box-border univer-grid univer-grid-cols-5 univer-gap-2 univer-text-gray-600 dark:!univer-text-gray-200`,children:Xo.map(e=>/* @__PURE__ */ (0,m.jsx)(`a`,{className:(0,l.clsx)(`univer-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-justify-self-center univer-rounded hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700`,{"univer-bg-gray-200 dark:!univer-bg-gray-600":h.type===e.value}),onClick:t=>{t.stopPropagation(),y(e.value,`type`)},children:b(e.icon)},e.value))}),/* @__PURE__ */ (0,m.jsx)(l.Separator,{}),/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-flex univer-items-center univer-gap-2`,children:[/* @__PURE__ */ (0,m.jsx)(`div`,{children:/* @__PURE__ */ (0,m.jsx)(_,{overlay:/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-rounded-lg univer-p-4`,children:/* @__PURE__ */ (0,m.jsx)(g,{value:d,onChange:e=>y(e,`color`)})}),children:/* @__PURE__ */ (0,m.jsxs)(`button`,{className:`univer-flex univer-cursor-pointer univer-items-center univer-gap-2 univer-rounded univer-border-none univer-bg-transparent univer-p-1 univer-text-gray-900 hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700`,type:`button`,children:[/* @__PURE__ */ (0,m.jsx)(Fp,{className:`univer-fill-primary-600 dark:!univer-text-gray-0`,extend:{colorChannel1:(h==null?void 0:h.color)??``}}),/* @__PURE__ */ (0,m.jsx)(Ad,{className:`dark:!univer-text-gray-0`})]})})}),/* @__PURE__ */ (0,m.jsx)(`div`,{children:/* @__PURE__ */ (0,m.jsx)(_,{overlay:/* @__PURE__ */ (0,m.jsx)(`section`,{className:`univer-rounded-lg univer-p-1.5`,children:/* @__PURE__ */ (0,m.jsx)(`ul`,{className:`univer-m-0 univer-grid univer-list-none univer-gap-1 univer-p-0`,children:Zo.map(e=>/* @__PURE__ */ (0,m.jsx)(`li`,{children:/* @__PURE__ */ (0,m.jsx)(`button`,{type:`button`,"aria-label":t.t(e.label),"aria-pressed":e.value===h.style,className:(0,l.clsx)(`univer-flex univer-w-full univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-border-none univer-bg-transparent univer-px-1 univer-py-3 hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700`,{"univer-bg-gray-200 dark:!univer-bg-gray-600":e.value===h.style}),onClick:()=>y(e.value,`style`),children:/* @__PURE__ */ (0,m.jsx)(_g,{className:`univer-fill-gray-900 dark:!univer-fill-gray-0`,type:e.value})})},e.value))})}),children:/* @__PURE__ */ (0,m.jsxs)(`button`,{className:`univer-flex univer-cursor-pointer univer-items-center univer-gap-2 univer-rounded univer-border-none univer-bg-transparent univer-p-1 univer-text-gray-900 hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700`,type:`button`,children:[/* @__PURE__ */ (0,m.jsx)(_g,{className:`univer-fill-gray-900 dark:!univer-fill-gray-0`,type:h.style}),/* @__PURE__ */ (0,m.jsx)(Ad,{className:`dark:!univer-text-gray-0`})]})})})]})]})}function yg(e){return/* @__PURE__ */ (0,m.jsx)(vg,{...e,ColorPickerComponent:l.MobileColorPicker,DropdownComponent:l.MobileDropdown})}function bg(e){return/* @__PURE__ */ (0,m.jsx)(Rh,{...e,DropdownMenuComponent:l.MobileDropdownMenu})}let xg=e=>(0,i.useDependency)(n.IUniverInstanceService).getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET)?/* @__PURE__ */ (0,m.jsx)(Sg,{...e}):null;function Sg(e){let{inputId:t,state:a=!1,type:o=`range`,confirm:s,cancel:c,name:d,formulaOrRefString:f,comment:h=``,localSheetId:g=r.SCOPE_WORKBOOK_VALUE_DEFINED_NAME,hidden:_=!1,id:v,SelectComponent:y=l.Select}=e,b=(0,i.useDependency)(n.IUniverInstanceService),x=b.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET),S=(0,i.useDependency)(n.LocaleService),C=(0,i.useDependency)(u.IDefinedNamesService),w=(0,i.useDependency)(u.ISuperTableService),T=(0,i.useDependency)(u.IFunctionService),E=(0,i.useDependency)(u.LexerTreeBuilder),D=(0,i.useDependency)(i.ComponentManager),O=(0,p.useMemo)(()=>D.get(N),[]),k=(0,p.useMemo)(()=>D.get(P),[]),A=x.getUnitId(),j=x.getActiveSheet().getSheetId(),[M,F]=(0,p.useState)(d),[I,L]=(0,p.useState)(f),[R,z]=(0,p.useState)(h),[ee,B]=(0,p.useState)(g),[V,H]=(0,p.useState)(``),[te,U]=(0,p.useState)(o),[ne,re]=(0,p.useState)(!0),ie=[{label:S.t(`sheets-ui.definedName.scopeWorkbook`),value:r.SCOPE_WORKBOOK_VALUE_DEFINED_NAME}],W=e=>!(0,u.isReferenceStrings)(e);(0,p.useEffect)(()=>{re(!0),F(d),z(h),B(g);let e=f;f.substring(0,1)===u.operatorToken.EQUALS?U(`formula`):W(f)?(U(`formula`),e=u.operatorToken.EQUALS+f):U(`range`),L(e),H(``)},[a]),x.getSheetOrders().forEach(e=>{let t=x.getSheetBySheetId(e);ie.push({label:(t==null?void 0:t.getName())||``,value:e})});let ae=e=>{L(e)},oe=e=>{L(e||``)},se=()=>{let e=(0,r.validateDefinedName)(M,{unitId:A,formulaOrRefString:I,univerInstanceService:b,definedNamesService:C,superTableService:w,functionService:T,id:v});if(typeof e==`string`){H(S.t(e));return}if(!ne){H(S.t(`sheets-ui.definedName.formulaOrRefStringInvalid`));return}let t=x.getActiveSheet().getName();s&&s({id:v||``,name:M,formulaOrRefString:E.convertRefersToAbsolute(I,n.AbsoluteRefType.ALL,n.AbsoluteRefType.ALL,t),comment:R,localSheetId:ee})},ce=e=>{let t=e;t===`formula`?f[0]===u.operatorToken.EQUALS?L(f):L(`${u.operatorToken.EQUALS}`):f[0]===u.operatorToken.EQUALS?L(``):L(f),U(t)},G=(0,p.useRef)(null),[K,q]=(0,p.useState)(!1);return(0,i.useSidebarClick)(e=>{var t;(t=G.current)!=null&&t.isClickOutSide(e)&&q(!1)}),/* @__PURE__ */ (0,m.jsxs)(`div`,{className:(0,l.clsx)(`univer-grid univer-space-y-2 univer-pb-1`,l.borderBottomClassName,{"univer-hidden":!a}),children:[/* @__PURE__ */ (0,m.jsx)(`div`,{children:/* @__PURE__ */ (0,m.jsx)(l.Input,{className:`univer-w-full`,placeholder:S.t(`sheets-ui.definedName.inputNamePlaceholder`),value:M,allowClear:!0,onChange:F})}),/* @__PURE__ */ (0,m.jsx)(`div`,{children:/* @__PURE__ */ (0,m.jsxs)(l.RadioGroup,{value:te,onChange:ce,children:[/* @__PURE__ */ (0,m.jsx)(l.Radio,{value:`range`,children:S.t(`sheets-ui.definedName.ratioRange`)}),/* @__PURE__ */ (0,m.jsx)(l.Radio,{value:`formula`,children:S.t(`sheets-ui.definedName.ratioFormula`)})]})}),te===`range`?O&&/* @__PURE__ */ (0,m.jsx)(O,{unitId:A,subUnitId:j,initialValue:I,onChange:(e,t)=>ae(t),supportAcrossSheet:!0}):k&&/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-relative univer-mt-4 univer-h-full`,children:/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-relative univer-h-8 univer-select-none`,children:/* @__PURE__ */ (0,m.jsx)(k,{ref:G,className:(0,l.clsx)(`univer-box-border univer-h-8 univer-w-full univer-cursor-pointer univer-items-center univer-rounded-lg univer-bg-gray-0 univer-pt-2 univer-transition-colors hover:univer-border-primary-600 dark:!univer-bg-gray-700 dark:!univer-text-gray-0 [&>div:first-child]:univer-px-2.5 [&>div]:univer-h-5 [&>div]:univer-ring-transparent`,l.borderClassName),initValue:I,unitId:A,subUnitId:j,isFocus:K,isSupportAcrossSheet:!0,onChange:(e=``)=>{oe(e||``)},onVerify:e=>{re(e)},onFocus:()=>q(!0)})})}),/* @__PURE__ */ (0,m.jsx)(`div`,{children:/* @__PURE__ */ (0,m.jsx)(y,{className:`univer-w-full`,value:ee,options:ie,onChange:B})}),/* @__PURE__ */ (0,m.jsx)(`div`,{children:/* @__PURE__ */ (0,m.jsx)(l.Input,{className:`univer-w-full`,placeholder:S.t(`sheets-ui.definedName.inputCommentPlaceholder`),value:R,onChange:z,allowClear:!0})}),/* @__PURE__ */ (0,m.jsxs)(`div`,{className:(0,l.clsx)(`univer-items-center univer-gap-1 univer-text-sm univer-text-red-500`,{"univer-hidden":V.length===0,"univer-flex":V.length!==0}),children:[/* @__PURE__ */ (0,m.jsx)(`span`,{children:V}),/* @__PURE__ */ (0,m.jsx)(Bu,{})]}),/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-flex univer-gap-2`,children:[/* @__PURE__ */ (0,m.jsx)(l.Button,{onClick:()=>{c==null||c()},children:S.t(`sheets-ui.definedName.cancel`)}),/* @__PURE__ */ (0,m.jsx)(l.Button,{variant:`primary`,onClick:se,children:S.t(`sheets-ui.definedName.confirm`)})]})]})}let Cg=({ConfirmComponent:e=l.Confirm,DefinedNameInputComponent:t=xg}={})=>{let a=(0,i.useDependency)(n.ICommandService),s=(0,i.useDependency)(n.IUniverInstanceService),c=(0,i.useDependency)(n.LocaleService),d=(0,i.useDependency)(u.IDefinedNamesService),f=(0,i.useDependency)(r.SheetsSelectionsService),h=(0,i.useDependency)(n.IPermissionService),g=(0,i.useDependency)(r.SheetPermissionCheckController),_=s.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET),v=_==null?void 0:_.getUnitId(),y=()=>{if(!v)return[];let e=d.getDefinedNameMap(v);return e?Object.values(e):[]},[b,x]=(0,p.useState)(!1),S=(0,i.useObservable)(()=>d.update$.pipe((0,o.map)(y),(0,o.startWith)(y())),y(),!1,[d,v]),[C,w]=(0,p.useState)(null),[T,E]=(0,p.useState)(),D=(0,p.useRef)(void 0),[O,k]=(0,i.useVirtualList)(S,{containerTarget:D,itemHeight:(e,t)=>t.id===C?240:72,overscan:6}),A=()=>v?{workbook:g.permissionCheckWithoutRange({workbookTypes:[r.WorkbookEditablePermission]},v),worksheets:new Map(S.map(e=>[e.id,!e.localSheetId||e.localSheetId===r.SCOPE_WORKBOOK_VALUE_DEFINED_NAME?g.permissionCheckWithoutRange({workbookTypes:[r.WorkbookEditablePermission]},v):g.permissionCheckWithoutRange({worksheetTypes:[r.WorksheetEditPermission]},v,e.localSheetId)]))}:{workbook:!1,worksheets:/* @__PURE__ */ new Map},j=(0,i.useObservable)(()=>h.permissionPointUpdate$.pipe((0,o.map)(A),(0,o.startWith)(A())),A(),!1,[S,h,g,v]);if(!_||!v)return;let M=j.workbook,N=e=>j.worksheets.get(e.id)??M,P=e=>{let{name:t,formulaOrRefString:i,comment:o,localSheetId:s,hidden:c}=e,l=e.id;if(l==null||l.length===0)l=(0,n.generateRandomId)(10),a.executeCommand(r.InsertDefinedNameCommand.id,{id:l,unitId:v,name:t,formulaOrRefString:i,comment:o,localSheetId:s,hidden:c});else{let e={id:l,unitId:v,name:t,formulaOrRefString:i,comment:o,localSheetId:s,hidden:c};a.executeCommand(r.SetDefinedNameCommand.id,e)}x(!1),w(null)},F=e=>{E(e)};function I(){E(null)}function L(e){if(!v)return;let t=d.getValueById(v,e);a.executeCommand(r.RemoveDefinedNameCommand.id,{...t,unitId:v}),E(null)}let R=async e=>{let{formulaOrRefString:t,id:n}=e,i=d.getWorksheetByRef(v,t);i&&(i.isSheetHidden()&&await a.executeCommand(r.SetWorksheetShowCommand.id,{unitId:v,subUnitId:i.getSheetId()}),d.focusRange(v,n))},z=()=>{let e=S.length+1,t=c.t(`sheets-ui.definedName.defaultName`)+e;if(d.getValueByName(v,t)==null)return t;let n=e+1;for(;;){let e=c.t(`sheets-ui.definedName.defaultName`)+n;if(d.getValueByName(v,e)==null)return e;n++}},ee=()=>{var e;let t=(e=_.getActiveSheet())==null?void 0:e.getName();if(!t)return``;let n=f.getCurrentSelections();return n==null?``:n.map(e=>(0,u.serializeRangeWithSheet)(t,e.range)).join(`,`)},B=()=>{x(!1),w(null)},V=()=>{x(!0),w(null)},H=e=>{x(!1),w(e)},te=e=>{let t=_.getSheetBySheetId(e);return t==null?``:t.getName()};return/* @__PURE__ */ (0,m.jsxs)(`div`,{"data-u-comp":`defined-name-container`,className:`univer-relative univer-box-border univer-flex univer-h-0 univer-min-h-full univer-w-full univer-flex-col univer-overflow-hidden`,children:[/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-mb-4`,children:[/* @__PURE__ */ (0,m.jsxs)(l.Button,{className:(0,l.clsx)(`univer-w-full`,{"univer-hidden":b}),disabled:!M,onClick:V,children:[/* @__PURE__ */ (0,m.jsx)(ud,{}),/* @__PURE__ */ (0,m.jsx)(`span`,{className:`univer-ml-1`,children:c.t(`sheets-ui.definedName.addButton`)})]}),b&&/* @__PURE__ */ (0,m.jsx)(t,{confirm:P,cancel:B,state:b,inputId:`insertDefinedName`,name:z(),formulaOrRefString:ee()})]},`insertDefinedName`),/* @__PURE__ */ (0,m.jsx)(`div`,{ref:D,className:(0,l.clsx)(`univer-min-h-0 univer-flex-1 univer-overflow-y-auto`,l.scrollbarClassName),...k.containerProps,children:/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-box-content univer-pb-4`,style:k.wrapperStyle,children:O.map(({data:n,index:i})=>/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-relative univer-w-full univer-divide-x-0 univer-divide-y univer-divide-solid univer-divide-gray-200 dark:!univer-divide-gray-600`,children:[/* @__PURE__ */ (0,m.jsxs)(`div`,{className:(0,l.clsx)(`univer-group univer-relative univer-box-border univer-flex univer-w-full univer-cursor-default univer-select-none univer-items-center univer-justify-between univer-rounded-md univer-p-2 hover:univer-bg-gray-50 dark:hover:!univer-bg-gray-700`,{"univer-hidden":n.id===C}),onClick:()=>{R(n)},children:[/* @__PURE__ */ (0,m.jsxs)(`div`,{title:n.comment,children:[/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-my-1 univer-max-h-[100px] univer-max-w-[190px] univer-truncate univer-text-sm univer-font-medium univer-text-gray-900 dark:!univer-text-gray-0`,children:[n.name,/* @__PURE__ */ (0,m.jsx)(`span`,{className:`univer-ml-1 univer-text-xs univer-text-gray-400`,children:n.localSheetId===r.SCOPE_WORKBOOK_VALUE_DEFINED_NAME||n.localSheetId==null?``:te(n.localSheetId)})]}),/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-my-1 univer-max-h-[100px] univer-w-full univer-max-w-[190px] univer-truncate univer-text-xs univer-text-gray-500`,title:n.formulaOrRefString,children:n.formulaOrRefString})]}),N(n)&&/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-absolute univer-right-5 univer-top-1/2 univer-hidden -univer-translate-y-1/2 univer-cursor-pointer univer-items-center univer-justify-end univer-gap-7 univer-text-xs univer-text-primary-600 group-hover:univer-flex dark:hover:!univer-bg-gray-600`,children:[/* @__PURE__ */ (0,m.jsx)(l.Tooltip,{title:c.t(`sheets-ui.definedName.updateButton`),placement:`top`,children:/* @__PURE__ */ (0,m.jsx)(`a`,{className:`univer-rounded univer-p-1 hover:univer-bg-gray-100`,onClick:e=>{e.stopPropagation(),H(n.id)},children:/* @__PURE__ */ (0,m.jsx)(Hd,{})})}),/* @__PURE__ */ (0,m.jsx)(l.Tooltip,{title:c.t(`sheets-ui.definedName.deleteButton`),placement:`top`,children:/* @__PURE__ */ (0,m.jsx)(`a`,{className:`univer-rounded univer-p-1 univer-text-red-600 hover:univer-bg-gray-100`,onClick:e=>{e.stopPropagation(),F(n.id)},children:/* @__PURE__ */ (0,m.jsx)(Mu,{})})})]})]}),/* @__PURE__ */ (0,m.jsx)(e,{visible:T===n.id,onClose:I,onConfirm:()=>{L(n.id)},children:c.t(`sheets-ui.definedName.deleteConfirmText`)}),n.id===C&&/* @__PURE__ */ (0,m.jsx)(t,{confirm:P,cancel:B,state:n.id===C,id:n.id,inputId:n.id+i,name:n.name,formulaOrRefString:n.formulaOrRefString,comment:n.comment,localSheetId:n.localSheetId})]},i))})})]})};function wg(e){return/* @__PURE__ */ (0,m.jsx)(xg,{...e,SelectComponent:l.MobileSelect})}function Tg(e){return/* @__PURE__ */ (0,m.jsx)(Cg,{...e,ConfirmComponent:l.MobileConfirm,DefinedNameInputComponent:wg})}function Eg(e){let{popup:t,ColorPickerComponent:n=l.ColorPicker}=e,{extraProps:r}=t,{defaultValue:i,onChange:a}=r;return/* @__PURE__ */ (0,m.jsx)(n,{value:i,onChange:a})}Eg.componentKey=`sheets.dropdown.color`;function Dg(e){return/* @__PURE__ */ (0,m.jsx)(Eg,{...e,ColorPickerComponent:l.MobileColorPicker})}Dg.componentKey=Eg.componentKey;function Og(){return/* @__PURE__ */ (0,m.jsx)(Jl,{hidden:!0})}function kg(e){let{prefix:t,suffix:r,value:a,min:o=-(2**53-1),max:s=2**53-1,disabled$:c,onChange:u}=e,d=(0,i.useDependency)(n.LocaleService),f=(0,i.useObservable)(c??null,!1),[h,g]=(0,p.useState)(null),_=h!==null&&h.source===a?h.value:Math.min(s,Math.max(o,Number(a)));h!==null&&h.source!==a&&g(null);function v(e){g({source:a,value:e})}function y(){if(f||_==null||!Number.isFinite(_))return;let e=Math.min(s,Math.max(o,_));g({source:a,value:e}),u(e.toString())}function b(e){(e.key!==`Escape`||e.nativeEvent.isComposing)&&(e.stopPropagation(),e.key===`Enter`&&!e.nativeEvent.isComposing&&(e.preventDefault(),y()))}return/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-flex univer-min-w-0 univer-flex-1 univer-flex-wrap univer-items-center univer-gap-2`,onClick:e=>e.stopPropagation(),children:[/* @__PURE__ */ (0,m.jsx)(`span`,{className:`univer-shrink-0 univer-text-base univer-font-medium`,children:d.t(t)}),/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-w-20 univer-shrink-0`,children:/* @__PURE__ */ (0,m.jsx)(l.InputNumber,{value:_,size:`small`,precision:0,allowEmpty:!0,disabled:f,onKeyDown:b,onChange:v})}),/* @__PURE__ */ (0,m.jsx)(`span`,{className:`univer-min-w-0 univer-truncate univer-text-base univer-font-medium`,children:d.t(r)}),/* @__PURE__ */ (0,m.jsx)(l.Button,{type:`button`,variant:`primary`,size:`middle`,className:`univer-shrink-0`,disabled:f||_==null||!Number.isFinite(_),onClick:y,children:d.t(`sheets-ui.button.confirm`)})]})}let Ag=({loading:e,children:t})=>/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-relative univer-size-full`,children:[e&&/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-absolute -univer-bottom-0.5 -univer-left-0.5 -univer-right-0.5 -univer-top-0.5 univer-z-10 univer-flex univer-items-center univer-justify-center univer-bg-gray-0 univer-backdrop-blur dark:!univer-bg-gray-1000`,children:/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-size-10 univer-animate-spin univer-rounded-full univer-border-4 univer-border-solid univer-border-gray-100 univer-border-t-primary-500`})}),/* @__PURE__ */ (0,m.jsx)(`div`,{className:e?`univer-pointer-events-none univer-blur-sm`:``,children:t})]}),jg=({ActionRowComponent:e=l.ActionRow}={})=>{let t=(0,i.useDependency)(n.LocaleService),a=(0,i.useDependency)(n.ILogService),o=(0,i.useDependency)(n.IUniverInstanceService),s=(0,i.useDependency)(n.IAuthzIoService),u=(0,i.useDependency)(r.WorksheetProtectionPointModel),d=(0,i.useDependency)(i.IDialogService),f=(0,i.useDependency)(n.IPermissionService),h=o.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET),g=h.getActiveSheet(),_=h.getUnitId(),v=g.getSheetId(),[y,b]=(0,p.useState)([]),x=(0,i.useDependency)(n.ICommandService),[S,C]=(0,p.useState)(()=>!!u.getRule(_,v)),[w,T]=(0,p.useState)(()=>Object.keys(Sn).reduce((e,n)=>(e[n]={text:t.t(`sheets-ui.permission.panel.${Sn[Number(n)]}`),allowed:!0},e),{}));(0,p.useEffect)(()=>{let e=!1;return s.listCollaborators({objectID:_,unitID:_}).then(t=>{e||b(t)}).catch(e=>a.error(e)),()=>{e=!0}},[s,a,_]),(0,p.useEffect)(()=>{let e=!1,n,r=u.getRule(_,v);return r&&(C(!0),s.list({unitID:_,objectIDs:[r.permissionId],actions:Cn}).then(r=>{if(e)return;let i=r[0].strategies.reduce((e,n)=>(Sn[n.action]&&(e[n.action]={text:t.t(`sheets-ui.permission.panel.${Sn[n.action]}`),allowed:n.role!==c.UnitRole.Owner}),e),{});T(i),n=setTimeout(()=>{C(!1)},100)}).catch(e=>a.error(e))),()=>{e=!0,n!==void 0&&clearTimeout(n)}},[s,t,a,v,_,u]);let E=async()=>{let e=o.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET),t=e==null?void 0:e.getActiveSheet();if(!t)throw Error(`No active sheet found`);let i=e.getUnitId(),a=t.getSheetId(),l=u.getRule(i,a),d=Object.keys(w).map(e=>({action:Number(e),role:w[e].allowed?c.UnitRole.Editor:c.UnitRole.Owner})),p=l==null?void 0:l.permissionId;p?s.update({objectType:c.UnitObject.Worksheet,objectID:p,unitID:i,strategies:d,share:void 0,name:``,scope:{read:c.ObjectScope.AllCollaborator,edit:c.ObjectScope.AllCollaborator},collaborators:void 0}).then(()=>{(0,r.getAllWorksheetPermissionPoint)().forEach(e=>{let t=new e(i,a),n=t.subType,r=d.find(e=>e.action===n);r&&f.updatePermissionPoint(t.id,r.role===c.UnitRole.Editor)})}):(p=await s.create({objectType:c.UnitObject.Worksheet,worksheetObject:{unitID:i,collaborators:y,name:``,strategies:d,scope:{read:c.ObjectScope.AllCollaborator,edit:c.ObjectScope.AllCollaborator}}}),x.executeCommand(r.SetWorksheetPermissionPointsCommand.id,{rule:{permissionId:p,unitId:i,subUnitId:a}}))};return/* @__PURE__ */ (0,m.jsx)(Ag,{loading:S,children:/* @__PURE__ */ (0,m.jsxs)(`div`,{className:(0,l.clsx)(`univer-flex univer-flex-col univer-gap-2 univer-pt-2`,l.borderTopClassName),children:[Object.keys(w).map(e=>{let t=w[e],{text:n,allowed:r}=t;return/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-flex univer-h-5 univer-items-center univer-justify-between`,children:[/* @__PURE__ */ (0,m.jsx)(`span`,{className:`univer-text-sm`,children:n}),/* @__PURE__ */ (0,m.jsx)(l.Switch,{"aria-label":n,defaultChecked:r,onChange:()=>{T({...w,[e]:{...t,allowed:!r}})}})]},n)}),/* @__PURE__ */ (0,m.jsxs)(e,{className:(0,l.clsx)(`univer-flex univer-h-9 univer-items-center univer-justify-end univer-gap-2 univer-pt-2`,l.borderTopClassName),children:[/* @__PURE__ */ (0,m.jsx)(l.Button,{onClick:()=>{d.close(xn)},children:t.t(`sheets-ui.permission.button.cancel`)}),/* @__PURE__ */ (0,m.jsx)(l.Button,{variant:`primary`,onClick:()=>{E(),d.close(xn)},children:t.t(`sheets-ui.permission.button.confirm`)})]})]})})};function Mg(e){return/* @__PURE__ */ (0,m.jsx)(jg,{...e,ActionRowComponent:l.MobileActionRowGroup})}let Ng=(e,t,i,a,o)=>{let s=e.get(n.LocaleService),c=e.get(r.WorksheetProtectionRuleModel),l=e.get(r.RangeProtectionRuleModel),u=``;if(t.length===0)u=s.t(`sheets-ui.permission.panel.emptyRangeError`);else if(t.length>1){let e=!1;for(let r=0;r<t.length;r++){for(let i=r+1;i<t.length;i++)if(n.Rectangle.intersects(t[r],t[i])){e=!0;break}if(e)break}e&&(u=s.t(`sheets-ui.permission.panel.rangeOverlapError`))}if(!u){if(c.getRule(a,o)&&!i)return u=s.t(`sheets-ui.permission.panel.rangeOverlapOverPermissionError`),u;let e=l.getSubunitRuleList(a,o).filter(e=>e.permissionId!==i).find(e=>e.ranges.some(e=>t.some(t=>n.Rectangle.intersects(e,t))));e!=null&&e.ranges.find(e=>t.some(t=>n.Rectangle.intersects(e,t)))&&(u=s.t(`sheets-ui.permission.panel.rangeOverlapOverPermissionError`))}return u===``?void 0:u},Pg=(e,t)=>{if(e.length!==1)return!1;let n=e[0],r=t.getRowCount(),i=t.getColumnCount(),{startRow:a,endRow:o,startColumn:s,endColumn:c}=n;return a===0&&s===0&&o===r-1&&c===i-1},Fg=(e,t)=>{var i;let a=e.get(n.IUniverInstanceService),o=e.get(r.SheetsSelectionsService),s=a.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET),l=s.getActiveSheet(),u=c.UnitObject.SelectRange,d=((i=o.getCurrentSelections())==null?void 0:i.map(e=>e.range))??[];return t&&(u=c.UnitObject.Worksheet,d=[{startRow:0,startColumn:0,endRow:l.getRowCount()-1,endColumn:l.getColumnCount()-1,rangeType:n.RANGE_TYPE.ALL}]),{unitId:s.getUnitId(),subUnitId:l.getSheetId(),permissionId:``,unitType:u,description:``,id:``,ranges:d,editState:r.EditStateEnum.OnlyMe,viewState:r.ViewStateEnum.OthersCanView}},Ig=(e,t)=>{let r=e.get(n.IUniverInstanceService).getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET).getActiveSheet(),{unitType:i}=t;return i===c.UnitObject.Worksheet?{...t,ranges:[{startRow:0,startColumn:0,endRow:r.getRowCount()-1,endColumn:r.getColumnCount()-1,rangeType:n.RANGE_TYPE.ALL}]}:t},Lg=e=>{let{viewState:t,editState:a,permissionId:o,ranges:s,rangesErrMsg:u,desc:d,oldRule:f,id:p,ActionRowComponent:h=l.ActionRow}=e,g=(0,i.useDependency)(Tn),_=(0,i.useDependency)(i.ISidebarService),v=(0,i.useDependency)(n.IAuthzIoService),y=(0,i.useDependency)(n.LocaleService),b=(0,i.useDependency)(n.ICommandService),x=(0,i.useDependency)(En),S=(0,i.useDependency)(n.IUniverInstanceService).getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET),C=S==null?void 0:S.getActiveSheet();if(!S||!C)return null;let w=S.getUnitId(),T=C.getSheetId();return/* @__PURE__ */ (0,m.jsxs)(h,{className:`univer-mt-auto univer-flex univer-flex-row-reverse univer-gap-2 univer-py-5`,children:[/* @__PURE__ */ (0,m.jsx)(l.Button,{variant:`primary`,onClick:async()=>{if(u)return;let e={unitId:w,subUnitId:T,permissionId:o,id:p,viewState:t,editState:a,unitType:c.UnitObject.SelectRange,ranges:s,description:d};Pg(s,C)&&(e.unitType=c.UnitObject.Worksheet,e.ranges=[]);let n=x.selectUserList,i={read:e.viewState===r.ViewStateEnum.OthersCanView?c.ObjectScope.AllCollaborator:c.ObjectScope.SomeCollaborator,edit:e.editState===r.EditStateEnum.DesignedUserCanEdit?c.ObjectScope.SomeCollaborator:c.ObjectScope.OneSelf};if(e.editState===r.EditStateEnum.OnlyMe?(n=[],x.setSelectUserList([])):e.editState===r.EditStateEnum.DesignedUserCanEdit&&(n.length===0?(n=[],i.edit=c.ObjectScope.OneSelf):n=n.map(e=>({...e,role:c.UnitRole.Editor}))),e.permissionId){let t=yr(n.filter(e=>e.role===c.UnitRole.Editor),x.oldCollaboratorList.filter(e=>e.role===c.UnitRole.Editor)),a=(f==null?void 0:f.viewState)===e.viewState,o=(f==null?void 0:f.editState)===e.editState,s=e.unitType===(f==null?void 0:f.unitType)&&e.description===f.description&&e.ranges===f.ranges,l=!t||!a||!o;if(s&&l)await v.update({objectType:e.unitType,objectID:e.permissionId,unitID:e.unitId,share:void 0,name:``,strategies:[],scope:i,collaborators:{collaborators:n}});else{let t=e.permissionId;l&&(t=e.unitType===c.UnitObject.Worksheet?await v.create({worksheetObject:{collaborators:n,unitID:e.unitId,name:``,strategies:[{role:c.UnitRole.Editor,action:c.UnitAction.Edit},{role:c.UnitRole.Reader,action:c.UnitAction.View}],scope:i},objectType:c.UnitObject.Worksheet}):await v.create({selectRangeObject:{collaborators:n,unitID:e.unitId,name:``,scope:i},objectType:c.UnitObject.SelectRange})),b.executeCommand(r.SetProtectionCommand.id,{rule:{...e,permissionId:t},oldRule:f})}}else if(e.unitType===c.UnitObject.Worksheet){let t=await v.create({worksheetObject:{collaborators:n,unitID:e.unitId,name:``,strategies:[{role:c.UnitRole.Editor,action:c.UnitAction.Edit},{role:c.UnitRole.Reader,action:c.UnitAction.View}],scope:i},objectType:c.UnitObject.Worksheet}),{ranges:a=[],...o}=e;o.permissionId=t,b.executeCommand(r.AddWorksheetProtectionCommand.id,{rule:o,unitId:e.unitId})}else if(e.unitType===c.UnitObject.SelectRange){let t=await v.create({selectRangeObject:{collaborators:n,unitID:e.unitId,name:``,scope:i},objectType:c.UnitObject.SelectRange});b.executeCommand(r.AddRangeProtectionCommand.id,{rule:e,permissionId:t})}let l={header:{title:`${y.t(`sheets-ui.permission.panel.title`)}`},children:{label:gn,showDetail:!1},width:330};_.open(l)},children:y.t(`sheets-ui.permission.button.confirm`)}),/* @__PURE__ */ (0,m.jsx)(l.Button,{onClick:()=>{g.reset(),x.reset(),_.close()},children:y.t(`sheets-ui.permission.button.cancel`)})]})},Rg=e=>{let{ranges:t,onRangesChange:a,desc:o,onDescChange:s,rangesErrMsg:c,permissionId:d}=e,f=(0,i.useDependency)(i.ComponentManager),h=(0,p.useMemo)(()=>f.get(N),[]),g=(0,i.useDependency)(n.IUniverInstanceService),_=(0,i.useDependency)(n.LocaleService),v=(0,i.useDependency)(n.Injector),y=g.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET),b=y==null?void 0:y.getActiveSheet();if(!y||!b)return null;let x=y.getUnitId(),S=b.getSheetId(),C=e=>{let t=e.split(`,`).map(u.deserializeRangeWithSheet).map(e=>e.range);if(t.some(e=>!(0,n.isValidRange)(e)||e.endColumn<e.startColumn||e.endRow<e.startRow))return;let i=g.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET),o=i==null?void 0:i.getActiveSheet();if(!i||!o)return;let s=i.getUnitId(),c=o.getSheetId(),l=t.map(e=>{let t=o.getRowCount(),n=o.getColumnCount();return(0,r.setEndForRange)(e,t,n),e}),f=Ng(v,l,d,s,c);a(l,f)};return/* @__PURE__ */ (0,m.jsxs)(m.Fragment,{children:[/* @__PURE__ */ (0,m.jsx)(l.FormLayout,{className:`univer-font-medium`,label:_.t(`sheets-ui.permission.panel.protectedRange`),error:c,children:h&&/* @__PURE__ */ (0,m.jsx)(h,{unitId:x,subUnitId:S,initialValue:t==null?void 0:t.map(e=>(0,u.serializeRange)(e)).join(`,`),onChange:(e,t)=>C(t)})}),/* @__PURE__ */ (0,m.jsx)(l.FormLayout,{className:`univer-font-medium`,label:_.t(`sheets-ui.permission.panel.permissionDirection`),children:/* @__PURE__ */ (0,m.jsx)(l.Input,{value:o,onChange:e=>s(e),placeholder:_.t(`sheets-ui.permission.panel.permissionDirectionPlaceholder`)})})]})},zg=e=>{let{editState:t,onEditStateChange:a,viewState:o,onViewStateChange:s,permissionId:u,SelectComponent:d=l.Select,userListClassName:f}=e,h=(0,i.useDependency)(n.LocaleService),g=(0,i.useDependency)(i.IDialogService),_=(0,i.useDependency)(n.IAuthzIoService),v=(0,i.useDependency)(En),y=(0,i.useDependency)(n.UserManagerService),b=(0,i.useDependency)(n.IUniverInstanceService),x=(0,i.useObservable)(v.selectUserList$,v.selectUserList),S=b.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET),C=S==null?void 0:S.getActiveSheet(),w=(S==null?void 0:S.getUnitId())??``,T=(0,i.useEvent)(a);return(0,p.useEffect)(()=>{let e=!1;return u&&w?_.listCollaborators({objectID:u,unitID:w}).then(t=>{if(e)return;let n=t.filter(e=>e.role===c.UnitRole.Editor);n.length>0&&T(r.EditStateEnum.DesignedUserCanEdit),v.setSelectUserList(n),v.setOldCollaboratorList(n)}):(v.setSelectUserList([]),v.setOldCollaboratorList([])),()=>{e=!0}},[_,T,u,v,w]),!S||!C?null:/* @__PURE__ */ (0,m.jsxs)(m.Fragment,{children:[/* @__PURE__ */ (0,m.jsx)(l.FormLayout,{className:`univer-font-medium`,label:h.t(`sheets-ui.permission.panel.editPermission`),children:/* @__PURE__ */ (0,m.jsxs)(l.RadioGroup,{value:t,onChange:e=>a(e),className:`univer-flex univer-flex-col`,children:[/* @__PURE__ */ (0,m.jsx)(l.Radio,{value:r.EditStateEnum.OnlyMe,children:/* @__PURE__ */ (0,m.jsx)(`span`,{children:h.t(`sheets-ui.permission.panel.onlyICanEdit`)})}),/* @__PURE__ */ (0,m.jsx)(l.Radio,{value:r.EditStateEnum.DesignedUserCanEdit,children:/* @__PURE__ */ (0,m.jsx)(`span`,{children:h.t(`sheets-ui.permission.panel.designedUserCanEdit`)})})]})}),t===r.EditStateEnum.DesignedUserCanEdit&&/* @__PURE__ */ (0,m.jsxs)(`div`,{className:(0,l.clsx)(`univer-mb-2 univer-box-border univer-flex univer-flex-col univer-overflow-y-auto univer-rounded-lg univer-p-3`,x!=null&&x.length?`univer-h-[270px]`:`univer-h-44`,l.borderClassName,f),children:[/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-flex univer-items-center univer-justify-between univer-text-sm`,children:[/* @__PURE__ */ (0,m.jsx)(`span`,{children:h.t(`sheets-ui.permission.panel.designedPerson`)}),/* @__PURE__ */ (0,m.jsx)(l.Button,{variant:`link`,className:`univer-h-auto univer-p-0`,onClick:async()=>{let e=await _.listCollaborators({objectID:w,unitID:w}),t=y.getCurrentUser();v.setCanEditUserList(e.filter(e=>{var n;return((n=e.subject)==null?void 0:n.userID)!==t.userID})),g.open({id:bn,title:{title:h.t(`sheets-ui.permission.panel.addPerson`)},children:{label:vn},width:`auto`,closable:!1,onClose:()=>g.close(bn),className:`sheet-permission-user-dialog`})},children:h.t(`sheets-ui.permission.panel.addPerson`)})]}),/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-my-2 univer-h-px univer-bg-gray-200`}),/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-flex univer-flex-1 univer-flex-col`,children:(x==null?void 0:x.length)>0?x.map(e=>{var t,n,r;return/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-mb-3 univer-flex univer-h-7 univer-items-center univer-leading-7 last:univer-mb-0`,children:[/* @__PURE__ */ (0,m.jsx)(l.Avatar,{size:24,src:(n=e.subject)==null?void 0:n.avatar}),/* @__PURE__ */ (0,m.jsx)(`span`,{className:`univer-ml-1.5 univer-w-[130px] univer-truncate univer-text-gray-900 dark:!univer-text-gray-0`,children:(r=e.subject)==null?void 0:r.name}),/* @__PURE__ */ (0,m.jsx)(d,{className:`!univer-w-[90px] univer-min-w-0 univer-cursor-pointer`,borderless:!0,value:`edit`,options:[{label:`${h.t(`sheets-ui.permission.panel.canEdit`)}`,value:`edit`},{label:`${h.t(`sheets-ui.permission.panel.delete`)}`,value:`delete`}],onChange:t=>{t===`delete`&&v.setSelectUserList(x.filter(t=>{var n,r;return((n=t.subject)==null?void 0:n.userID)!==((r=e.subject)==null?void 0:r.userID)}))}})]},(t=e.subject)==null?void 0:t.userID)}):/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-flex univer-min-h-24 univer-flex-1 univer-items-center univer-justify-center univer-px-2 univer-text-center`,children:/* @__PURE__ */ (0,m.jsx)(`p`,{className:`univer-m-0 univer-max-w-60 univer-text-sm univer-text-gray-500 dark:!univer-text-gray-200`,children:h.t(`sheets-ui.permission.dialog.userEmpty`)})})})]}),/* @__PURE__ */ (0,m.jsx)(l.FormLayout,{className:`univer-font-medium`,label:h.t(`sheets-ui.permission.panel.viewPermission`),children:/* @__PURE__ */ (0,m.jsxs)(l.RadioGroup,{value:o,onChange:e=>s(e),className:`univer-flex univer-flex-col last:univer-mb-0`,children:[/* @__PURE__ */ (0,m.jsx)(l.Radio,{value:r.ViewStateEnum.OthersCanView,children:/* @__PURE__ */ (0,m.jsx)(`span`,{children:h.t(`sheets-ui.permission.panel.othersCanView`)})}),/* @__PURE__ */ (0,m.jsx)(l.Radio,{value:r.ViewStateEnum.NoOneElseCanView,children:/* @__PURE__ */ (0,m.jsx)(`span`,{children:h.t(`sheets-ui.permission.panel.noOneElseCanView`)})})]})})]})},Bg=e=>{let{fromSheetBar:t,rule:a,oldRule:o,FooterComponent:s=Lg,UserComponent:c=zg}=e,l=(0,i.useDependency)(n.Injector),u=(0,i.useDependency)(i.ComponentManager),d=a?Ig(l,a):Fg(l,t),[f,h]=(0,p.useState)(d.ranges),[g,_]=(0,p.useState)(()=>Ng(l,d.ranges,d.permissionId,d.unitId,d.subUnitId)),[v,y]=(0,p.useState)(d.description),[b,x]=(0,p.useState)(d.editState??r.EditStateEnum.OnlyMe),[S,C]=(0,p.useState)(d.viewState??r.ViewStateEnum.OthersCanView),w=u.get(`UNIVER_SHEET_PERMISSION_USER_PART`)??c;return(0,p.useEffect)(()=>{let e=l.get(n.IUniverInstanceService),t=l.get(i.ISidebarService),r=e.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET);if(!r)return;let a=r.getActiveSheet().getSheetId(),o=r.activeSheet$.subscribe(e=>{(e==null?void 0:e.getSheetId())!==a&&t.close()});return()=>{o.unsubscribe()}},[]),/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-mt-4 univer-flex univer-h-[calc(100%-16px)] univer-flex-col`,children:[/* @__PURE__ */ (0,m.jsx)(Rg,{permissionId:d.permissionId,ranges:f,onRangesChange:(e,t)=>{h(e),_(t)},rangesErrMsg:g,desc:v,onDescChange:e=>y(e)}),/* @__PURE__ */ (0,m.jsx)(w,{editState:b,onEditStateChange:e=>x(e),viewState:S,onViewStateChange:e=>C(e),permissionId:d.permissionId}),/* @__PURE__ */ (0,m.jsx)(s,{permissionId:d.permissionId,id:d.id,ranges:f,rangesErrMsg:g,desc:v,viewState:S,editState:b,oldRule:o})]})};function Vg({ActionRowComponent:e=l.ActionRow}={}){return(0,i.useDependency)(n.IUniverInstanceService).getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET)?/* @__PURE__ */ (0,m.jsx)(Hg,{ActionRowComponent:e}):null}function Hg({ActionRowComponent:e}){var t;let[a,s]=(0,p.useState)(!0),[d,f]=(0,p.useState)([]),h=(0,i.useDependency)(n.LocaleService),g=(0,i.useDependency)(r.RangeProtectionRuleModel),_=(0,i.useDependency)(r.WorksheetProtectionRuleModel),v=(0,i.useDependency)(n.IUniverInstanceService),y=(0,i.useDependency)(n.ICommandService),b=(0,i.useDependency)(i.ISidebarService),x=(0,i.useDependency)(n.IAuthzIoService),S=(0,i.useDependency)(n.IPermissionService),C=(0,i.useDependency)(n.UserManagerService).getCurrentUser(),w=(0,i.useDependency)(En),T=v.getCurrentUnitOfType(n.UniverInstanceType.UNIVER_SHEET),E=T.getUnitId(),D=(0,p.useCallback)(async e=>{var t;let n=T.getActiveSheet(),i=T.getUnitId(),a=n.getSheetId(),o=[],s=[];T.getSheets().forEach(e=>{let t=e.getSheetId();g.getSubunitRuleList(i,t).forEach(e=>{e.permissionId&&o.push(e.permissionId)});let n=_.getRule(i,t);n!=null&&n.permissionId&&s.push(n.permissionId)});let c=[...o,...s],l=await x.list({objectIDs:c,unitID:i,actions:r.baseProtectionActions}),u=g.getSubunitRuleList(i,a).map(e=>e.permissionId),d=(t=_.getRule(i,a))==null?void 0:t.permissionId;d&&u.push(d);let f=l.filter(e=>{var t;return u.includes(e.objectID)||e.objectID===((t=_.getRule(i,a))==null?void 0:t.permissionId)});return e?f:l},[x,g,T,_]),O=(0,i.useObservable)(()=>(0,o.merge)(g.ruleChange$,_.ruleChange$,g.ruleRefresh$,_.ruleRefresh$,T.activeSheet$.pipe((0,o.distinctUntilChanged)((e,t)=>(e==null?void 0:e.getSheetId())===(t==null?void 0:t.getSheetId())))).pipe((0,o.startWith)(void 0),(0,o.switchMap)(()=>(0,o.from)(D(a)))),[],!1,[D,a,g,T,_]);function k(e){let{unitId:t,subUnitId:n,unitType:i}=e,a;i===c.UnitObject.Worksheet?a=y.executeCommand(r.DeleteWorksheetProtectionCommand.id,{unitId:t,subUnitId:n,rule:e}):i===c.UnitObject.SelectRange&&(a=y.executeCommand(r.DeleteRangeProtectionCommand.id,{unitId:t,subUnitId:n,rule:e})),a&&e.ranges===d&&f([])}(0,p.useEffect)(()=>{w.reset()},[w]),kh(d);let A=(0,p.useMemo)(()=>{let e=/* @__PURE__ */ new Map;return T.getSheets().forEach(t=>{let n=t.getSheetId();g.getSubunitRuleList(E,n).forEach(t=>{e.set(t.permissionId,t)});let r=_.getRule(E,n);r&&e.set(r==null?void 0:r.permissionId,r)}),e},[E,T,g,_]),j=e=>{e.subUnitId!==T.getActiveSheet().getSheetId()&&y.executeCommand(r.SetWorksheetActiveOperation.id,{unitId:e.unitId,subUnitId:e.subUnitId});let t={header:{title:`sheets-ui.permission.panel.title`},children:{label:gn,showDetail:!0,rule:n.Tools.deepClone(e),oldRule:n.Tools.deepClone(e)},width:330};b.open(t)},M=(t=S.getPermissionPoint(new r.WorkbookCreateProtectPermission(E).id))==null?void 0:t.value;return/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-mt-2 univer-flex univer-h-[calc(100%-8px)] univer-flex-col`,children:[/* @__PURE__ */ (0,m.jsx)(l.Segmented,{className:`univer-my-2 univer-w-full univer-shrink-0`,items:[{label:h.t(`sheets-ui.permission.panel.currentSheet`),value:`current`},{label:h.t(`sheets-ui.permission.panel.allSheet`),value:`all`}],value:a?`current`:`all`,onChange:e=>s(e===`current`)}),(O==null?void 0:O.length)>0?/* @__PURE__ */ (0,m.jsx)(`div`,{children:O==null?void 0:O.map(e=>{var t,n,r,i;let a=A.get(e.objectID);if(!a)return null;let o=e.actions.find(e=>e.action===c.UnitAction.Edit),s=o==null?void 0:o.allowed,p=e.actions.find(e=>e.action===c.UnitAction.View),g=p==null?void 0:p.allowed,_=e.actions.find(e=>e.action===c.UnitAction.ManageCollaborator),v=e.actions.find(e=>e.action===c.UnitAction.Delete),y=(_==null?void 0:_.allowed)||C.userID===((t=e.creator)==null?void 0:t.userID),b=(v==null?void 0:v.allowed)||C.userID===((n=e.creator)==null?void 0:n.userID),x=``,S=T.getSheetBySheetId(a.subUnitId),w=S==null?void 0:S.getName();if(a.unitType===c.UnitObject.SelectRange){let e=a.ranges;x=`${w}(${e!=null&&e.length?e.map(e=>{let t=(0,u.serializeRange)(e);return t===`NaN`?``:t}).filter(e=>!!e).join(`,`):``})`}else a.unitType===c.UnitObject.Worksheet&&(x=w||``);return/* @__PURE__ */ (0,m.jsxs)(`div`,{className:(0,l.clsx)(`univer-mt-3 univer-rounded-lg univer-p-3 hover:univer-bg-gray-50 dark:hover:!univer-bg-gray-800`,l.borderClassName),onMouseMove:()=>{let{subUnitId:e,unitType:t}=a,n=T.getActiveSheet();if(!n||e!==n.getSheetId())return!1;if(t===c.UnitObject.SelectRange){let e=a.ranges||[];e!==d&&f(e)}else if(t===c.UnitObject.Worksheet){let e=[{startRow:0,endRow:n.getRowCount()-1,startColumn:0,endColumn:n.getColumnCount()-1}];e!==d&&f(e)}},onMouseLeave:()=>f([]),children:[/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-flex univer-h-5 univer-justify-between univer-leading-5`,children:[/* @__PURE__ */ (0,m.jsx)(l.Tooltip,{title:x,children:/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-max-w-[200px] univer-truncate univer-text-sm univer-font-medium`,children:x})}),(y||b)&&/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-flex univer-items-center`,children:[y&&/* @__PURE__ */ (0,m.jsx)(l.Tooltip,{title:h.t(`sheets-ui.permission.panel.edit`),children:/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-box-border univer-h-6 univer-rounded-sm univer-p-1 hover:univer-bg-gray-200 dark:hover:!univer-bg-gray-700`,onClick:()=>j(a),children:/* @__PURE__ */ (0,m.jsx)(yf,{})})}),b&&/* @__PURE__ */ (0,m.jsx)(l.Tooltip,{title:h.t(`sheets-ui.permission.panel.delete`),children:/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-box-border univer-h-6 univer-rounded-sm univer-p-1 hover:univer-bg-gray-200 dark:hover:!univer-bg-gray-700`,onClick:()=>k(a),children:/* @__PURE__ */ (0,m.jsx)(Mu,{})})})]})]}),/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-my-2 univer-h-px univer-bg-gray-200`}),/* @__PURE__ */ (0,m.jsxs)(`div`,{children:[/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-flex univer-items-center`,children:[/* @__PURE__ */ (0,m.jsx)(l.Tooltip,{title:((r=e.creator)==null?void 0:r.name)??``,children:/* @__PURE__ */ (0,m.jsx)(`div`,{children:/* @__PURE__ */ (0,m.jsx)(l.Avatar,{src:(i=e.creator)==null?void 0:i.avatar,className:`univer-mr-1.5`,size:24})})}),/* @__PURE__ */ (0,m.jsx)(`span`,{className:`univer-h-4 univer-flex-grow univer-text-xs univer-text-gray-900 dark:!univer-text-gray-0`,children:h.t(`sheets-ui.permission.panel.created`)}),/* @__PURE__ */ (0,m.jsx)(`span`,{className:`univer-h-4 univer-text-xs univer-text-gray-900 dark:!univer-text-gray-0`,children:s?`${h.t(`sheets-ui.permission.panel.iCanEdit`)}`:`${h.t(`sheets-ui.permission.panel.iCanNotEdit`)}`})]}),/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-mt-2 univer-flex univer-items-center`,children:[/* @__PURE__ */ (0,m.jsx)(`span`,{className:`univer-h-4 univer-flex-grow univer-text-xs univer-text-gray-900 dark:!univer-text-gray-0`,children:h.t(`sheets-ui.permission.panel.viewPermission`)}),/* @__PURE__ */ (0,m.jsx)(`span`,{className:`univer-h-4 univer-text-xs univer-text-gray-900 dark:!univer-text-gray-0`,children:g?`${h.t(`sheets-ui.permission.panel.iCanView`)}`:`${h.t(`sheets-ui.permission.panel.iCanNotView`)}`})]}),a.description&&/* @__PURE__ */ (0,m.jsx)(l.Tooltip,{title:a.description,children:/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-mt-2 univer-max-w-64 univer-truncate univer-text-sm univer-text-gray-400`,children:a.description})})]})]},e.objectID)})}):/* @__PURE__ */ (0,m.jsxs)(`div`,{role:`status`,className:`univer-flex univer-flex-1 univer-flex-col univer-items-center univer-justify-center univer-gap-2 univer-px-6 univer-text-center`,children:[/* @__PURE__ */ (0,m.jsx)(`p`,{className:`univer-m-0 univer-text-sm univer-font-medium univer-text-gray-900 dark:!univer-text-gray-0`,children:h.t(`sheets-ui.permission.dialog.listEmpty`)}),M&&/* @__PURE__ */ (0,m.jsx)(`p`,{className:`univer-m-0 univer-max-w-60 univer-text-sm univer-leading-relaxed univer-text-gray-500 dark:!univer-text-gray-200`,children:h.t(`sheets-ui.permission.dialog.listEmptyDescription`)})]}),M&&/* @__PURE__ */ (0,m.jsx)(e,{className:`univer-mt-auto univer-py-5`,children:/* @__PURE__ */ (0,m.jsxs)(l.Button,{className:`univer-w-full`,variant:`primary`,onClick:()=>{let e={header:{title:`${h.t(`sheets-ui.permission.panel.title`)}`},children:{label:`UNIVER_SHEET_PERMISSION_PANEL`,showDetail:!0},width:330};b.open(e)},children:[/* @__PURE__ */ (0,m.jsx)(`div`,{children:`+ `}),h.t(`sheets-ui.permission.button.addNewPermission`)]})})]})}let Ug=({showDetail:e,fromSheetBar:t,rule:a,oldRule:o,DetailComponent:s=Bg,ListComponent:c=Vg})=>{var l;let d=(0,i.useDependency)(n.IUniverInstanceService),f=(0,i.useDependency)(r.SheetsSelectionsService);if(!(0,i.useDependency)(Tn).getVisible())return null;let p=(0,r.getSheetCommandTarget)(d);if(!p)return null;let{worksheet:h}=p,g=((l=f.getCurrentSelections())==null?void 0:l.map(e=>e.range)).reduce((e,t)=>e+(0,u.serializeRangeWithSheet)(h.getName(),t),``);return e?/* @__PURE__ */ (0,m.jsx)(s,{fromSheetBar:t,rule:a,oldRule:o},t?`sheet-bar`:`normal`):/* @__PURE__ */ (0,m.jsx)(c,{},g)};function Wg(e){return/* @__PURE__ */ (0,m.jsx)(Lg,{...e,ActionRowComponent:l.MobileActionRowGroup})}function Gg(e){return/* @__PURE__ */ (0,m.jsx)(zg,{...e,SelectComponent:l.MobileSelect,userListClassName:`!univer-h-auto univer-max-h-[40vh] univer-shrink-0`})}function Kg(e){return/* @__PURE__ */ (0,m.jsx)(Bg,{...e,FooterComponent:Wg,UserComponent:Gg})}function qg(e={}){return/* @__PURE__ */ (0,m.jsx)(Vg,{...e,ActionRowComponent:l.MobileActionRowGroup})}function Jg(e){return/* @__PURE__ */ (0,m.jsx)(Ug,{...e,DetailComponent:Kg,ListComponent:qg})}let Yg=({ActionRowComponent:e=l.ActionRow}={})=>{var t;let[r,a]=(0,p.useState)(``),o=(0,p.useRef)(null),s=(0,i.useDependency)(n.LocaleService),u=(0,i.useDependency)(i.IDialogService),d=(0,i.useDependency)(En),f=(0,i.useDependency)(n.IAuthzIoService),h=(0,i.useObservable)(d.userList$,d.userList),g=r.trim().toLocaleLowerCase(),_=(h==null?void 0:h.filter(e=>{var t;return((t=e.subject)==null?void 0:t.name.toLocaleLowerCase().includes(g))&&(e.role===c.UnitRole.Owner||e.role===c.UnitRole.Editor)}))??[],[v,y]=(0,p.useState)(d.selectUserList),b=((t=f.getCfgEnableObjInherit)==null?void 0:t.call(f))??!1,x=e=>{if((v==null?void 0:v.findIndex(t=>{var n,r;return((n=t.subject)==null?void 0:n.userID)===((r=e.subject)==null?void 0:r.userID)}))===-1){let t={...e};y([...v,t])}else{let t=v.filter(t=>{var n,r;return((n=t.subject)==null?void 0:n.userID)!==((r=e.subject)==null?void 0:r.userID)});y(t)}};return/* @__PURE__ */ (0,m.jsxs)(`div`,{children:[/* @__PURE__ */ (0,m.jsx)(`div`,{children:/* @__PURE__ */ (0,m.jsx)(l.Input,{ref:o,"aria-label":s.t(`sheets-ui.permission.dialog.search`),className:`univer-w-full`,placeholder:s.t(`sheets-ui.permission.dialog.search`),value:r,onChange:e=>a(e)})}),/* @__PURE__ */ (0,m.jsx)(`div`,{className:(0,l.clsx)(`univer-h-60 univer-min-w-72 univer-overflow-y-auto`,l.scrollbarClassName),children:(_==null?void 0:_.length)>0?_==null?void 0:_.map(e=>{var t,n,r;if(b&&e.role===c.UnitRole.Owner){var i,a,o;return/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-my-2 univer-flex univer-cursor-not-allowed univer-items-center univer-rounded-md`,children:[/* @__PURE__ */ (0,m.jsx)(l.Avatar,{src:(a=e.subject)==null?void 0:a.avatar,size:24}),/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-mx-1.5 univer-flex-1`,children:(o=e.subject)==null?void 0:o.name}),/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-text-xs univer-text-rose-600`,children:s.t(`sheets-ui.permission.dialog.ownerInherit`)})]},(i=e.subject)==null?void 0:i.userID)}return/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-my-2 univer-flex univer-items-center univer-rounded-md hover:univer-bg-gray-50`,onClick:()=>x(e),children:[/* @__PURE__ */ (0,m.jsx)(l.Avatar,{src:(n=e.subject)==null?void 0:n.avatar,size:24}),/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-mx-1.5 univer-flex-1`,children:(r=e.subject)==null?void 0:r.name}),e.role===c.UnitRole.Owner&&/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-text-xs univer-text-rose-600`,children:s.t(`sheets-ui.permission.dialog.ownerWithoutInherit`)}),(v==null?void 0:v.findIndex(t=>{var n,r;return((n=t.subject)==null?void 0:n.userID)===((r=e.subject)==null?void 0:r.userID)}))!==-1&&/* @__PURE__ */ (0,m.jsx)(`div`,{children:/* @__PURE__ */ (0,m.jsx)(bu,{className:`univer-ml-1.5`})})]},(t=e.subject)==null?void 0:t.userID)}):/* @__PURE__ */ (0,m.jsxs)(`div`,{className:`univer-flex univer-h-full univer-flex-col univer-items-center univer-justify-center univer-gap-2 univer-px-6 univer-text-center`,children:[/* @__PURE__ */ (0,m.jsxs)(`div`,{role:`status`,className:`univer-flex univer-flex-col univer-gap-2`,children:[/* @__PURE__ */ (0,m.jsx)(`p`,{className:`univer-m-0 univer-text-sm univer-font-medium univer-text-gray-900 dark:!univer-text-gray-0`,children:s.t(g?`sheets-ui.permission.dialog.searchEmpty`:`sheets-ui.permission.dialog.candidatesEmpty`)}),g&&/* @__PURE__ */ (0,m.jsx)(`p`,{className:`univer-m-0 univer-text-sm univer-leading-relaxed univer-text-gray-500 dark:!univer-text-gray-200`,children:s.t(`sheets-ui.permission.dialog.searchEmptyDescription`)})]}),g&&/* @__PURE__ */ (0,m.jsx)(l.Button,{variant:`link`,onClick:()=>{var e;a(``),(e=o.current)==null||e.focus()},children:s.t(`sheets-ui.permission.button.clearSearch`)})]})}),/* @__PURE__ */ (0,m.jsx)(`div`,{className:`univer-h-px univer-w-full univer-bg-gray-200`}),/* @__PURE__ */ (0,m.jsxs)(e,{className:`univer-flex univer-items-center univer-justify-end univer-gap-1 univer-py-2`,children:[/* @__PURE__ */ (0,m.jsx)(l.Button,{onClick:()=>u.close(bn),children:s.t(`sheets-ui.permission.button.cancel`)}),/* @__PURE__ */ (0,m.jsx)(l.Button,{variant:`primary`,onClick:()=>{d.setSelectUserList(v),u.close(bn)},children:s.t(`sheets-ui.permission.button.confirm`)})]})]})};function Xg(e){return/* @__PURE__ */ (0,m.jsx)(Yg,{...e,ActionRowComponent:l.MobileActionRowGroup})}let Zg=({errorMsg:e})=>{let t=(0,i.useDependency)(n.LocaleService);return/* @__PURE__ */ (0,m.jsx)(`div`,{children:/* @__PURE__ */ (0,m.jsx)(`p`,{className:`univer-m-0`,children:e||t.t(`sheets-ui.permission.dialog.alertContent`)})})},Qg={AddImageIcon:nu,AdjustHeightDoubleIcon:Nf,AdjustWidthDoubleIcon:Ff,AlignBottomIcon:iu,AlignTopIcon:ou,AllBorderIcon:cu,AutoHeightDoubleIcon:Lf,AutoWidthDoubleIcon:zf,AutowrapIcon:uu,BackSlashDoubleIcon:Uf,BoldIcon:fu,BrushIcon:mu,CancelFreezeIcon:gu,CancelMergeIcon:vu,CheckMarkIcon:bu,ClearFormatDoubleIcon:Gf,CodeIcon:wu,ConvertToNumberIcon:Ou,CopyDoubleIcon:qf,CutIcon:Au,DeleteCellShiftLeftDoubleIcon:Yf,DeleteCellShiftUpDoubleIcon:Zf,DeleteColumnDoubleIcon:$f,DeleteIcon:Mu,DeleteRowDoubleIcon:tp,DocPasteOptionsIcon:Pu,DownBorderDoubleIcon:rp,DownloadImageIcon:Ru,EyeIcon:Hu,FontColorDoubleIcon:ap,FontSizeIncreaseIcon:Ku,FontSizeReduceIcon:Ju,FreezeColumnIcon:Xu,FreezeRowIcon:Qu,FreezeToSelectedIcon:ed,HideDoubleIcon:sp,HideGridlinesIcon:id,HorizontalBorderDoubleIcon:lp,HorizontallyIcon:cd,HorizontalMergeIcon:od,InnerBorderDoubleIcon:dp,InsertCellDownDoubleIcon:pp,InsertCellShiftRightDoubleIcon:hp,InsertDoubleIcon:_p,InsertRowAboveDoubleIcon:yp,InsertRowBelowDoubleIcon:xp,ItalicIcon:md,LeftBorderDoubleIcon:Cp,LeftDoubleDiagonalDoubleIcon:Tp,LeftInsertColumnDoubleIcon:Dp,LeftJustifyingIcon:vd,LeftRotationFortyFiveDegreesIcon:bd,LeftRotationNinetyDegreesIcon:Sd,LeftTridiagonalDoubleIcon:kp,LockIcon:wd,MergeAllIcon:Od,NoBorderIcon:Id,NoColorDoubleIcon:jp,NoRotationIcon:Rd,OuterBorderDoubleIcon:Np,OverflowIcon:Bd,PaintBucketDoubleIcon:Fp,PasteSpecialDoubleIcon:Lp,ProtectIcon:Wd,ReduceDoubleIcon:zp,RightBorderDoubleIcon:Vp,RightDoubleDiagonalDoubleIcon:Up,RightInsertColumnDoubleIcon:Gp,RightJustifyingIcon:Kd,RightRotationFortyFiveDegreesIcon:Jd,RightRotationNinetyDegreesIcon:Xd,ShrinkToFitIcon:Qd,SlashDoubleIcon:qp,StrikethroughIcon:ef,SubscriptIcon:nf,SuperscriptIcon:af,TruncationIcon:sf,UnderlineIcon:lf,UpBorderDoubleIcon:Yp,VerticalBorderDoubleIcon:Zp,VerticalCenterIcon:df,VerticalIntegrationIcon:pf,VerticalTextIcon:hf,WriteIcon:yf,ZoomInIcon:xf},$g=class extends n.Disposable{constructor(e,t,r){super(),this.disposeWithMe(e.register(`EMBEDDING_CELL_EDITOR_COMPONENT_KEY`,Og)),this.disposeWithMe(e.register(zh,bg)),this.disposeWithMe(e.register(Dg.componentKey,Dg)),this.disposeWithMe(e.register(tg.componentKey,tg)),this.disposeWithMe(e.register(ig.componentKey,ig)),this.disposeWithMe(e.register(Qh.componentKey,Qh)),this.disposeWithMe(e.register(Ks,kg)),this.disposeWithMe(e.register(ws,Ds)),this.disposeWithMe(e.register(Yo,yg)),this.disposeWithMe(e.register(Wr,Tg)),this.disposeWithMe(e.register(Mh,Zh)),this.disposeWithMe(e.register(gn,Jg)),this.disposeWithMe(e.register(yn,Mg)),this.disposeWithMe(e.register(vn,Xg)),this.disposeWithMe(e.register(eo,Zg));let i=r.get(n.IConfigService).getConfig(U);if(i!=null&&i.protectedRangeUserSelector){let{component:t,framework:n}=i.protectedRangeUserSelector;this.disposeWithMe(e.register(_n,t,{framework:n}))}this.disposeWithMe(t.register(Qg))}};$g=K([G(0,(0,n.Inject)(i.ComponentManager)),G(1,(0,n.Inject)(i.IconManager)),G(2,(0,n.Inject)(n.Injector))],$g);let e_={pageSize:{width:1/0,height:1/0},documentFlavor:n.DocumentFlavor.UNSPECIFIED,marginTop:5,marginBottom:5,marginRight:0,marginLeft:0,paragraphLineGapDefault:0,renderConfig:{horizontalAlign:n.HorizontalAlign.UNSPECIFIED,verticalAlign:n.VerticalAlign.TOP,centerAngle:0,vertexAngle:0,wrapStrategy:n.WrapStrategy.WRAP,isRenderStyle:n.BooleanNumber.FALSE}},t_=/* @__PURE__ */ new Set([`v`,`t`,`f`,`si`,`p`]),n_=class extends n.Disposable{constructor(e,t,n,r,i,a,o,s,c,l){super(),this._univerInstanceService=e,this._renderManagerService=t,this._editorBridgeService=n,this._commandService=r,this._rangeProtectionRuleModel=i,this._worksheetProtectionRuleModel=a,this._formulaEditorController=o,this._formulaEditorManagerService=s,this._contextService=c,this._themeService=l,this._initialize()}_initialize(){this._syncFormulaEditorContent(),this._commandExecutedListener(),this._syncFormulaRefRenderStyleOnFocusChange(),this._syncFormulaBarTextColorOnThemeChange()}_getEditorViewModel(e){var t;return(t=this._renderManagerService.getRenderUnitById(e))==null?void 0:t.with(s.DocSkeletonManagerService).getViewModel()}_syncFormulaEditorContent(){this.disposeWithMe(this._editorBridgeService.currentEditCellState$.subscribe(e=>{e!=null&&!this._editorBridgeService.isForceKeepVisible()&&this._rangeProtectionRuleModel.getRangeRuleInitState()&&this._worksheetProtectionRuleModel.getSheetRuleInitState()&&this._editorSyncHandler(e)}))}_editorSyncHandler(e){var t,r,i;let a=n.Tools.deepClone((t=e.documentLayoutObject.documentModel)==null?void 0:t.getBody()),o=n.Tools.deepClone((r=e.documentLayoutObject.documentModel)==null?void 0:r.drawings),s=n.Tools.deepClone((i=e.documentLayoutObject.documentModel)==null?void 0:i.getDrawingsOrder()),{visible:c}=this._editorBridgeService.isVisible();(!a||e.isInArrayFormulaRange===!0&&c)&&(a={dataStream:`\r
|